@spiffcommerce/core 44.5.6-alpha.2 → 44.5.6-alpha.3

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.
@@ -1779,7 +1779,7 @@ React keys must be passed directly to JSX without using spread:
1779
1779
  matrix(${l}, ${-u}, ${u}, ${l}, 0, 0)
1780
1780
  matrix(1, 0, 0, 1, ${-r.width/2}, ${-r.height/2})
1781
1781
  matrix(${r.scaleX}, 0, 0, ${r.scaleY}, 0, 0)
1782
- `,children:At.jsx(UT,{id:e,x:0,y:0,rotation:0,width:r.width,height:r.height,clipPath:r.path,children:c()})})})]})};String.prototype.codePointAt||(function(){var r=(function(){try{var t={},n=Object.defineProperty,i=n(t,t,t)&&n}catch{}return i})(),e=function(t){if(this==null)throw TypeError();var n=String(this),i=n.length,a=t?Number(t):0;if(a!=a&&(a=0),!(a<0||a>=i)){var s=n.charCodeAt(a),o;return s>=55296&&s<=56319&&i>a+1&&(o=n.charCodeAt(a+1),o>=56320&&o<=57343)?(s-55296)*1024+o-56320+65536:s}};r?r(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e})();var u1=0,VT=-3;function yf(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function t5(r,e){this.source=r,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=e,this.destLen=0,this.ltree=new yf,this.dtree=new yf}var zT=new yf,$T=new yf,c1=new Uint8Array(30),d1=new Uint16Array(30),HT=new Uint8Array(30),GT=new Uint16Array(30),r5=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rx=new yf,Wa=new Uint8Array(320);function jT(r,e,t,n){var i,a;for(i=0;i<t;++i)r[i]=0;for(i=0;i<30-t;++i)r[i+t]=i/t|0;for(a=n,i=0;i<30;++i)e[i]=a,a+=1<<r[i]}function n5(r,e){var t;for(t=0;t<7;++t)r.table[t]=0;for(r.table[7]=24,r.table[8]=152,r.table[9]=112,t=0;t<24;++t)r.trans[t]=256+t;for(t=0;t<144;++t)r.trans[24+t]=t;for(t=0;t<8;++t)r.trans[168+t]=280+t;for(t=0;t<112;++t)r.trans[176+t]=144+t;for(t=0;t<5;++t)e.table[t]=0;for(e.table[5]=32,t=0;t<32;++t)e.trans[t]=t}var nx=new Uint16Array(16);function F0(r,e,t,n){var i,a;for(i=0;i<16;++i)r.table[i]=0;for(i=0;i<n;++i)r.table[e[t+i]]++;for(r.table[0]=0,a=0,i=0;i<16;++i)nx[i]=a,a+=r.table[i];for(i=0;i<n;++i)e[t+i]&&(r.trans[nx[e[t+i]]++]=i)}function i5(r){r.bitcount--||(r.tag=r.source[r.sourceIndex++],r.bitcount=7);var e=r.tag&1;return r.tag>>>=1,e}function Za(r,e,t){if(!e)return t;for(;r.bitcount<24;)r.tag|=r.source[r.sourceIndex++]<<r.bitcount,r.bitcount+=8;var n=r.tag&65535>>>16-e;return r.tag>>>=e,r.bitcount-=e,n+t}function Qy(r,e){for(;r.bitcount<24;)r.tag|=r.source[r.sourceIndex++]<<r.bitcount,r.bitcount+=8;var t=0,n=0,i=0,a=r.tag;do n=2*n+(a&1),a>>>=1,++i,t+=e.table[i],n-=e.table[i];while(n>=0);return r.tag=a,r.bitcount-=i,e.trans[t+n]}function a5(r,e,t){var n,i,a,s,o,l;for(n=Za(r,5,257),i=Za(r,5,1),a=Za(r,4,4),s=0;s<19;++s)Wa[s]=0;for(s=0;s<a;++s){var u=Za(r,3,0);Wa[r5[s]]=u}for(F0(rx,Wa,0,19),o=0;o<n+i;){var c=Qy(r,rx);switch(c){case 16:var f=Wa[o-1];for(l=Za(r,2,3);l;--l)Wa[o++]=f;break;case 17:for(l=Za(r,3,3);l;--l)Wa[o++]=0;break;case 18:for(l=Za(r,7,11);l;--l)Wa[o++]=0;break;default:Wa[o++]=c;break}}F0(e,Wa,0,n),F0(t,Wa,n,i)}function ix(r,e,t){for(;;){var n=Qy(r,e);if(n===256)return u1;if(n<256)r.dest[r.destLen++]=n;else{var i,a,s,o;for(n-=257,i=Za(r,c1[n],d1[n]),a=Qy(r,t),s=r.destLen-Za(r,HT[a],GT[a]),o=s;o<s+i;++o)r.dest[r.destLen++]=r.dest[o]}}}function s5(r){for(var e,t,n;r.bitcount>8;)r.sourceIndex--,r.bitcount-=8;if(e=r.source[r.sourceIndex+1],e=256*e+r.source[r.sourceIndex],t=r.source[r.sourceIndex+3],t=256*t+r.source[r.sourceIndex+2],e!==(~t&65535))return VT;for(r.sourceIndex+=4,n=e;n;--n)r.dest[r.destLen++]=r.source[r.sourceIndex++];return r.bitcount=0,u1}function o5(r,e){var t=new t5(r,e),n,i,a;do{switch(n=i5(t),i=Za(t,2,0),i){case 0:a=s5(t);break;case 1:a=ix(t,zT,$T);break;case 2:a5(t,t.ltree,t.dtree),a=ix(t,t.ltree,t.dtree);break;default:a=VT}if(a!==u1)throw new Error("Data error")}while(!n);return t.destLen<t.dest.length?typeof t.dest.slice=="function"?t.dest.slice(0,t.destLen):t.dest.subarray(0,t.destLen):t.dest}n5(zT,$T);jT(c1,d1,4,3);jT(HT,GT,2,1);c1[28]=0;d1[28]=258;var l5=o5;function Cu(r,e,t,n,i){return Math.pow(1-i,3)*r+3*Math.pow(1-i,2)*i*e+3*(1-i)*Math.pow(i,2)*t+Math.pow(i,3)*n}function Bo(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}Bo.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)};Bo.prototype.addPoint=function(r,e){typeof r=="number"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=r,this.x2=r),r<this.x1&&(this.x1=r),r>this.x2&&(this.x2=r)),typeof e=="number"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))};Bo.prototype.addX=function(r){this.addPoint(r,null)};Bo.prototype.addY=function(r){this.addPoint(null,r)};Bo.prototype.addBezier=function(r,e,t,n,i,a,s,o){var l=[r,e],u=[t,n],c=[i,a],f=[s,o];this.addPoint(r,e),this.addPoint(s,o);for(var d=0;d<=1;d++){var h=6*l[d]-12*u[d]+6*c[d],g=-3*l[d]+9*u[d]-9*c[d]+3*f[d],v=3*u[d]-3*l[d];if(g===0){if(h===0)continue;var y=-v/h;0<y&&y<1&&(d===0&&this.addX(Cu(l[d],u[d],c[d],f[d],y)),d===1&&this.addY(Cu(l[d],u[d],c[d],f[d],y)));continue}var A=Math.pow(h,2)-4*v*g;if(!(A<0)){var C=(-h+Math.sqrt(A))/(2*g);0<C&&C<1&&(d===0&&this.addX(Cu(l[d],u[d],c[d],f[d],C)),d===1&&this.addY(Cu(l[d],u[d],c[d],f[d],C)));var S=(-h-Math.sqrt(A))/(2*g);0<S&&S<1&&(d===0&&this.addX(Cu(l[d],u[d],c[d],f[d],S)),d===1&&this.addY(Cu(l[d],u[d],c[d],f[d],S)))}}};Bo.prototype.addQuad=function(r,e,t,n,i,a){var s=r+.6666666666666666*(t-r),o=e+2/3*(n-e),l=s+1/3*(i-r),u=o+1/3*(a-e);this.addBezier(r,e,s,o,l,u,i,a)};function fi(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}fi.prototype.moveTo=function(r,e){this.commands.push({type:"M",x:r,y:e})};fi.prototype.lineTo=function(r,e){this.commands.push({type:"L",x:r,y:e})};fi.prototype.curveTo=fi.prototype.bezierCurveTo=function(r,e,t,n,i,a){this.commands.push({type:"C",x1:r,y1:e,x2:t,y2:n,x:i,y:a})};fi.prototype.quadTo=fi.prototype.quadraticCurveTo=function(r,e,t,n){this.commands.push({type:"Q",x1:r,y1:e,x:t,y:n})};fi.prototype.close=fi.prototype.closePath=function(){this.commands.push({type:"Z"})};fi.prototype.extend=function(r){if(r.commands)r=r.commands;else if(r instanceof Bo){var e=r;this.moveTo(e.x1,e.y1),this.lineTo(e.x2,e.y1),this.lineTo(e.x2,e.y2),this.lineTo(e.x1,e.y2),this.close();return}Array.prototype.push.apply(this.commands,r)};fi.prototype.getBoundingBox=function(){for(var r=new Bo,e=0,t=0,n=0,i=0,a=0;a<this.commands.length;a++){var s=this.commands[a];switch(s.type){case"M":r.addPoint(s.x,s.y),e=n=s.x,t=i=s.y;break;case"L":r.addPoint(s.x,s.y),n=s.x,i=s.y;break;case"Q":r.addQuad(n,i,s.x1,s.y1,s.x,s.y),n=s.x,i=s.y;break;case"C":r.addBezier(n,i,s.x1,s.y1,s.x2,s.y2,s.x,s.y),n=s.x,i=s.y;break;case"Z":n=e,i=t;break;default:throw new Error("Unexpected path command "+s.type)}}return r.isEmpty()&&r.addPoint(0,0),r};fi.prototype.draw=function(r){r.beginPath();for(var e=0;e<this.commands.length;e+=1){var t=this.commands[e];t.type==="M"?r.moveTo(t.x,t.y):t.type==="L"?r.lineTo(t.x,t.y):t.type==="C"?r.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y):t.type==="Q"?r.quadraticCurveTo(t.x1,t.y1,t.x,t.y):t.type==="Z"&&r.closePath()}this.fill&&(r.fillStyle=this.fill,r.fill()),this.stroke&&(r.strokeStyle=this.stroke,r.lineWidth=this.strokeWidth,r.stroke())};fi.prototype.toPathData=function(r){r=r!==void 0?r:2;function e(s){return Math.round(s)===s?""+Math.round(s):s.toFixed(r)}function t(){for(var s=arguments,o="",l=0;l<arguments.length;l+=1){var u=s[l];u>=0&&l>0&&(o+=" "),o+=e(u)}return o}for(var n="",i=0;i<this.commands.length;i+=1){var a=this.commands[i];a.type==="M"?n+="M"+t(a.x,a.y):a.type==="L"?n+="L"+t(a.x,a.y):a.type==="C"?n+="C"+t(a.x1,a.y1,a.x2,a.y2,a.x,a.y):a.type==="Q"?n+="Q"+t(a.x1,a.y1,a.x,a.y):a.type==="Z"&&(n+="Z")}return n};fi.prototype.toSVG=function(r){var e='<path d="';return e+=this.toPathData(r),e+='"',this.fill&&this.fill!=="black"&&(this.fill===null?e+=' fill="none"':e+=' fill="'+this.fill+'"'),this.stroke&&(e+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),e+="/>",e};fi.prototype.toDOMElement=function(r){var e=this.toPathData(r),t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",e),t};function qT(r){throw new Error(r)}function ax(r,e){r||qT(e)}var Gt={fail:qT,argument:ax,assert:ax},sx=32768,ox=2147483648,nc={},it={},Qt={};function Na(r){return function(){return r}}it.BYTE=function(r){return Gt.argument(r>=0&&r<=255,"Byte value should be between 0 and 255."),[r]};Qt.BYTE=Na(1);it.CHAR=function(r){return[r.charCodeAt(0)]};Qt.CHAR=Na(1);it.CHARARRAY=function(r){typeof r>"u"&&(r="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var e=[],t=0;t<r.length;t+=1)e[t]=r.charCodeAt(t);return e};Qt.CHARARRAY=function(r){return typeof r>"u"?0:r.length};it.USHORT=function(r){return[r>>8&255,r&255]};Qt.USHORT=Na(2);it.SHORT=function(r){return r>=sx&&(r=-(2*sx-r)),[r>>8&255,r&255]};Qt.SHORT=Na(2);it.UINT24=function(r){return[r>>16&255,r>>8&255,r&255]};Qt.UINT24=Na(3);it.ULONG=function(r){return[r>>24&255,r>>16&255,r>>8&255,r&255]};Qt.ULONG=Na(4);it.LONG=function(r){return r>=ox&&(r=-(2*ox-r)),[r>>24&255,r>>16&255,r>>8&255,r&255]};Qt.LONG=Na(4);it.FIXED=it.ULONG;Qt.FIXED=Qt.ULONG;it.FWORD=it.SHORT;Qt.FWORD=Qt.SHORT;it.UFWORD=it.USHORT;Qt.UFWORD=Qt.USHORT;it.LONGDATETIME=function(r){return[0,0,0,0,r>>24&255,r>>16&255,r>>8&255,r&255]};Qt.LONGDATETIME=Na(8);it.TAG=function(r){return Gt.argument(r.length===4,"Tag should be exactly 4 ASCII characters."),[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3)]};Qt.TAG=Na(4);it.Card8=it.BYTE;Qt.Card8=Qt.BYTE;it.Card16=it.USHORT;Qt.Card16=Qt.USHORT;it.OffSize=it.BYTE;Qt.OffSize=Qt.BYTE;it.SID=it.USHORT;Qt.SID=Qt.USHORT;it.NUMBER=function(r){return r>=-107&&r<=107?[r+139]:r>=108&&r<=1131?(r=r-108,[(r>>8)+247,r&255]):r>=-1131&&r<=-108?(r=-r-108,[(r>>8)+251,r&255]):r>=-32768&&r<=32767?it.NUMBER16(r):it.NUMBER32(r)};Qt.NUMBER=function(r){return it.NUMBER(r).length};it.NUMBER16=function(r){return[28,r>>8&255,r&255]};Qt.NUMBER16=Na(3);it.NUMBER32=function(r){return[29,r>>24&255,r>>16&255,r>>8&255,r&255]};Qt.NUMBER32=Na(5);it.REAL=function(r){var e=r.toString(),t=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);if(t){var n=parseFloat("1e"+((t[2]?+t[2]:0)+t[1].length));e=(Math.round(r*n)/n).toString()}for(var i="",a=0,s=e.length;a<s;a+=1){var o=e[a];o==="e"?i+=e[++a]==="-"?"c":"b":o==="."?i+="a":o==="-"?i+="e":i+=o}i+=i.length&1?"f":"ff";for(var l=[30],u=0,c=i.length;u<c;u+=2)l.push(parseInt(i.substr(u,2),16));return l};Qt.REAL=function(r){return it.REAL(r).length};it.NAME=it.CHARARRAY;Qt.NAME=Qt.CHARARRAY;it.STRING=it.CHARARRAY;Qt.STRING=Qt.CHARARRAY;nc.UTF8=function(r,e,t){for(var n=[],i=t,a=0;a<i;a++,e+=1)n[a]=r.getUint8(e);return String.fromCharCode.apply(null,n)};nc.UTF16=function(r,e,t){for(var n=[],i=t/2,a=0;a<i;a++,e+=2)n[a]=r.getUint16(e);return String.fromCharCode.apply(null,n)};it.UTF16=function(r){for(var e=[],t=0;t<r.length;t+=1){var n=r.charCodeAt(t);e[e.length]=n>>8&255,e[e.length]=n&255}return e};Qt.UTF16=function(r){return r.length*2};var Yy={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};nc.MACSTRING=function(r,e,t,n){var i=Yy[n];if(i!==void 0){for(var a="",s=0;s<t;s++){var o=r.getUint8(e+s);o<=127?a+=String.fromCharCode(o):a+=i[o&127]}return a}};var Qh=typeof WeakMap=="function"&&new WeakMap,Yh,u5=function(r){if(!Yh){Yh={};for(var e in Yy)Yh[e]=new String(e)}var t=Yh[r];if(t!==void 0){if(Qh){var n=Qh.get(t);if(n!==void 0)return n}var i=Yy[r];if(i!==void 0){for(var a={},s=0;s<i.length;s++)a[i.charCodeAt(s)]=s+128;return Qh&&Qh.set(t,a),a}}};it.MACSTRING=function(r,e){var t=u5(e);if(t!==void 0){for(var n=[],i=0;i<r.length;i++){var a=r.charCodeAt(i);if(a>=128&&(a=t[a],a===void 0))return;n[i]=a}return n}};Qt.MACSTRING=function(r,e){var t=it.MACSTRING(r,e);return t!==void 0?t.length:0};function Xy(r){return r>=-128&&r<=127}function c5(r,e,t){for(var n=0,i=r.length;e<i&&n<64&&r[e]===0;)++e,++n;return t.push(128|n-1),e}function d5(r,e,t){for(var n=0,i=r.length,a=e;a<i&&n<64;){var s=r[a];if(!Xy(s)||s===0&&a+1<i&&r[a+1]===0)break;++a,++n}t.push(n-1);for(var o=e;o<a;++o)t.push(r[o]+256&255);return a}function f5(r,e,t){for(var n=0,i=r.length,a=e;a<i&&n<64;){var s=r[a];if(s===0||Xy(s)&&a+1<i&&Xy(r[a+1]))break;++a,++n}t.push(64|n-1);for(var o=e;o<a;++o){var l=r[o];t.push(l+65536>>8&255,l+256&255)}return a}it.VARDELTAS=function(r){for(var e=0,t=[];e<r.length;){var n=r[e];n===0?e=c5(r,e,t):n>=-128&&n<=127?e=d5(r,e,t):e=f5(r,e,t)}return t};it.INDEX=function(r){for(var e=1,t=[e],n=[],i=0;i<r.length;i+=1){var a=it.OBJECT(r[i]);Array.prototype.push.apply(n,a),e+=a.length,t.push(e)}if(n.length===0)return[0,0];for(var s=[],o=1+Math.floor(Math.log(e)/Math.log(2))/8|0,l=[void 0,it.BYTE,it.USHORT,it.UINT24,it.ULONG][o],u=0;u<t.length;u+=1){var c=l(t[u]);Array.prototype.push.apply(s,c)}return Array.prototype.concat(it.Card16(r.length),it.OffSize(o),s,n)};Qt.INDEX=function(r){return it.INDEX(r).length};it.DICT=function(r){for(var e=[],t=Object.keys(r),n=t.length,i=0;i<n;i+=1){var a=parseInt(t[i],0),s=r[a];e=e.concat(it.OPERAND(s.value,s.type)),e=e.concat(it.OPERATOR(a))}return e};Qt.DICT=function(r){return it.DICT(r).length};it.OPERATOR=function(r){return r<1200?[r]:[12,r-1200]};it.OPERAND=function(r,e){var t=[];if(Array.isArray(e))for(var n=0;n<e.length;n+=1)Gt.argument(r.length===e.length,"Not enough arguments given for type"+e),t=t.concat(it.OPERAND(r[n],e[n]));else if(e==="SID")t=t.concat(it.NUMBER(r));else if(e==="offset")t=t.concat(it.NUMBER32(r));else if(e==="number")t=t.concat(it.NUMBER(r));else if(e==="real")t=t.concat(it.REAL(r));else throw new Error("Unknown operand type "+e);return t};it.OP=it.BYTE;Qt.OP=Qt.BYTE;var Xh=typeof WeakMap=="function"&&new WeakMap;it.CHARSTRING=function(r){if(Xh){var e=Xh.get(r);if(e!==void 0)return e}for(var t=[],n=r.length,i=0;i<n;i+=1){var a=r[i];t=t.concat(it[a.type](a.value))}return Xh&&Xh.set(r,t),t};Qt.CHARSTRING=function(r){return it.CHARSTRING(r).length};it.OBJECT=function(r){var e=it[r.type];return Gt.argument(e!==void 0,"No encoding function for type "+r.type),e(r.value)};Qt.OBJECT=function(r){var e=Qt[r.type];return Gt.argument(e!==void 0,"No sizeOf function for type "+r.type),e(r.value)};it.TABLE=function(r){for(var e=[],t=r.fields.length,n=[],i=[],a=0;a<t;a+=1){var s=r.fields[a],o=it[s.type];Gt.argument(o!==void 0,"No encoding function for field type "+s.type+" ("+s.name+")");var l=r[s.name];l===void 0&&(l=s.value);var u=o(l);s.type==="TABLE"?(i.push(e.length),e=e.concat([0,0]),n.push(u)):e=e.concat(u)}for(var c=0;c<n.length;c+=1){var f=i[c],d=e.length;Gt.argument(d<65536,"Table "+r.tableName+" too big."),e[f]=d>>8,e[f+1]=d&255,e=e.concat(n[c])}return e};Qt.TABLE=function(r){for(var e=0,t=r.fields.length,n=0;n<t;n+=1){var i=r.fields[n],a=Qt[i.type];Gt.argument(a!==void 0,"No sizeOf function for field type "+i.type+" ("+i.name+")");var s=r[i.name];s===void 0&&(s=i.value),e+=a(s),i.type==="TABLE"&&(e+=2)}return e};it.RECORD=it.TABLE;Qt.RECORD=Qt.TABLE;it.LITERAL=function(r){return r};Qt.LITERAL=function(r){return r.length};function yi(r,e,t){if(e.length&&(e[0].name!=="coverageFormat"||e[0].value===1))for(var n=0;n<e.length;n+=1){var i=e[n];this[i.name]=i.value}if(this.tableName=r,this.fields=e,t)for(var a=Object.keys(t),s=0;s<a.length;s+=1){var o=a[s],l=t[o];this[o]!==void 0&&(this[o]=l)}}yi.prototype.encode=function(){return it.TABLE(this)};yi.prototype.sizeOf=function(){return Qt.TABLE(this)};function Af(r,e,t){t===void 0&&(t=e.length);var n=new Array(e.length+1);n[0]={name:r+"Count",type:"USHORT",value:t};for(var i=0;i<e.length;i++)n[i+1]={name:r+i,type:"USHORT",value:e[i]};return n}function Jy(r,e,t){var n=e.length,i=new Array(n+1);i[0]={name:r+"Count",type:"USHORT",value:n};for(var a=0;a<n;a++)i[a+1]={name:r+a,type:"TABLE",value:t(e[a],a)};return i}function wf(r,e,t){var n=e.length,i=[];i[0]={name:r+"Count",type:"USHORT",value:n};for(var a=0;a<n;a++)i=i.concat(t(e[a],a));return i}function sg(r){r.format===1?yi.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(Af("glyph",r.glyphs))):r.format===2?yi.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(wf("rangeRecord",r.ranges,function(e){return[{name:"startGlyphID",type:"USHORT",value:e.start},{name:"endGlyphID",type:"USHORT",value:e.end},{name:"startCoverageIndex",type:"USHORT",value:e.index}]}))):Gt.assert(!1,"Coverage format must be 1 or 2.")}sg.prototype=Object.create(yi.prototype);sg.prototype.constructor=sg;function og(r){yi.call(this,"scriptListTable",wf("scriptRecord",r,function(e,t){var n=e.script,i=n.defaultLangSys;return Gt.assert(!!i,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new yi("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new yi("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:i.reqFeatureIndex}].concat(Af("featureIndex",i.featureIndexes)))}].concat(wf("langSys",n.langSysRecords,function(a,s){var o=a.langSys;return[{name:"langSysTag"+s,type:"TAG",value:a.tag},{name:"langSys"+s,type:"TABLE",value:new yi("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:o.reqFeatureIndex}].concat(Af("featureIndex",o.featureIndexes)))}]})))}]}))}og.prototype=Object.create(yi.prototype);og.prototype.constructor=og;function lg(r){yi.call(this,"featureListTable",wf("featureRecord",r,function(e,t){var n=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new yi("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat(Af("lookupListIndex",n.lookupListIndexes)))}]}))}lg.prototype=Object.create(yi.prototype);lg.prototype.constructor=lg;function ug(r,e){yi.call(this,"lookupListTable",Jy("lookup",r,function(t){var n=e[t.lookupType];return Gt.assert(!!n,"Unable to write GSUB lookup type "+t.lookupType+" tables."),new yi("lookupTable",[{name:"lookupType",type:"USHORT",value:t.lookupType},{name:"lookupFlag",type:"USHORT",value:t.lookupFlag}].concat(Jy("subtable",t.subtables,n)))}))}ug.prototype=Object.create(yi.prototype);ug.prototype.constructor=ug;var dt={Table:yi,Record:yi,Coverage:sg,ScriptList:og,FeatureList:lg,LookupList:ug,ushortList:Af,tableList:Jy,recordList:wf};function lx(r,e){return r.getUint8(e)}function cg(r,e){return r.getUint16(e,!1)}function h5(r,e){return r.getInt16(e,!1)}function f1(r,e){return r.getUint32(e,!1)}function WT(r,e){var t=r.getInt16(e,!1),n=r.getUint16(e+2,!1);return t+n/65535}function p5(r,e){for(var t="",n=e;n<e+4;n+=1)t+=String.fromCharCode(r.getInt8(n));return t}function g5(r,e,t){for(var n=0,i=0;i<t;i+=1)n<<=8,n+=r.getUint8(e+i);return n}function m5(r,e,t){for(var n=[],i=e;i<t;i+=1)n.push(r.getUint8(i));return n}function v5(r){for(var e="",t=0;t<r.length;t+=1)e+=String.fromCharCode(r[t]);return e}var y5={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function be(r,e){this.data=r,this.offset=e,this.relativeOffset=0}be.prototype.parseByte=function(){var r=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,r};be.prototype.parseChar=function(){var r=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,r};be.prototype.parseCard8=be.prototype.parseByte;be.prototype.parseUShort=function(){var r=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,r};be.prototype.parseCard16=be.prototype.parseUShort;be.prototype.parseSID=be.prototype.parseUShort;be.prototype.parseOffset16=be.prototype.parseUShort;be.prototype.parseShort=function(){var r=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,r};be.prototype.parseF2Dot14=function(){var r=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,r};be.prototype.parseULong=function(){var r=f1(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,r};be.prototype.parseOffset32=be.prototype.parseULong;be.prototype.parseFixed=function(){var r=WT(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,r};be.prototype.parseString=function(r){var e=this.data,t=this.offset+this.relativeOffset,n="";this.relativeOffset+=r;for(var i=0;i<r;i++)n+=String.fromCharCode(e.getUint8(t+i));return n};be.prototype.parseTag=function(){return this.parseString(4)};be.prototype.parseLongDateTime=function(){var r=f1(this.data,this.offset+this.relativeOffset+4);return r-=2082844800,this.relativeOffset+=8,r};be.prototype.parseVersion=function(r){var e=cg(this.data,this.offset+this.relativeOffset),t=cg(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,r===void 0&&(r=4096),e+t/r/10};be.prototype.skip=function(r,e){e===void 0&&(e=1),this.relativeOffset+=y5[r]*e};be.prototype.parseULongList=function(r){r===void 0&&(r=this.parseULong());for(var e=new Array(r),t=this.data,n=this.offset+this.relativeOffset,i=0;i<r;i++)e[i]=t.getUint32(n),n+=4;return this.relativeOffset+=r*4,e};be.prototype.parseOffset16List=be.prototype.parseUShortList=function(r){r===void 0&&(r=this.parseUShort());for(var e=new Array(r),t=this.data,n=this.offset+this.relativeOffset,i=0;i<r;i++)e[i]=t.getUint16(n),n+=2;return this.relativeOffset+=r*2,e};be.prototype.parseShortList=function(r){for(var e=new Array(r),t=this.data,n=this.offset+this.relativeOffset,i=0;i<r;i++)e[i]=t.getInt16(n),n+=2;return this.relativeOffset+=r*2,e};be.prototype.parseByteList=function(r){for(var e=new Array(r),t=this.data,n=this.offset+this.relativeOffset,i=0;i<r;i++)e[i]=t.getUint8(n++);return this.relativeOffset+=r,e};be.prototype.parseList=function(r,e){e||(e=r,r=this.parseUShort());for(var t=new Array(r),n=0;n<r;n++)t[n]=e.call(this);return t};be.prototype.parseList32=function(r,e){e||(e=r,r=this.parseULong());for(var t=new Array(r),n=0;n<r;n++)t[n]=e.call(this);return t};be.prototype.parseRecordList=function(r,e){e||(e=r,r=this.parseUShort());for(var t=new Array(r),n=Object.keys(e),i=0;i<r;i++){for(var a={},s=0;s<n.length;s++){var o=n[s],l=e[o];a[o]=l.call(this)}t[i]=a}return t};be.prototype.parseRecordList32=function(r,e){e||(e=r,r=this.parseULong());for(var t=new Array(r),n=Object.keys(e),i=0;i<r;i++){for(var a={},s=0;s<n.length;s++){var o=n[s],l=e[o];a[o]=l.call(this)}t[i]=a}return t};be.prototype.parseStruct=function(r){if(typeof r=="function")return r.call(this);for(var e=Object.keys(r),t={},n=0;n<e.length;n++){var i=e[n],a=r[i];t[i]=a.call(this)}return t};be.prototype.parseValueRecord=function(r){if(r===void 0&&(r=this.parseUShort()),r!==0){var e={};return r&1&&(e.xPlacement=this.parseShort()),r&2&&(e.yPlacement=this.parseShort()),r&4&&(e.xAdvance=this.parseShort()),r&8&&(e.yAdvance=this.parseShort()),r&16&&(e.xPlaDevice=void 0,this.parseShort()),r&32&&(e.yPlaDevice=void 0,this.parseShort()),r&64&&(e.xAdvDevice=void 0,this.parseShort()),r&128&&(e.yAdvDevice=void 0,this.parseShort()),e}};be.prototype.parseValueRecordList=function(){for(var r=this.parseUShort(),e=this.parseUShort(),t=new Array(e),n=0;n<e;n++)t[n]=this.parseValueRecord(r);return t};be.prototype.parsePointer=function(r){var e=this.parseOffset16();if(e>0)return new be(this.data,this.offset+e).parseStruct(r)};be.prototype.parsePointer32=function(r){var e=this.parseOffset32();if(e>0)return new be(this.data,this.offset+e).parseStruct(r)};be.prototype.parseListOfLists=function(r){for(var e=this.parseOffset16List(),t=e.length,n=this.relativeOffset,i=new Array(t),a=0;a<t;a++){var s=e[a];if(s===0){i[a]=void 0;continue}if(this.relativeOffset=s,r){for(var o=this.parseOffset16List(),l=new Array(o.length),u=0;u<o.length;u++)this.relativeOffset=s+o[u],l[u]=r.call(this);i[a]=l}else i[a]=this.parseUShortList()}return this.relativeOffset=n,i};be.prototype.parseCoverage=function(){var r=this.offset+this.relativeOffset,e=this.parseUShort(),t=this.parseUShort();if(e===1)return{format:1,glyphs:this.parseUShortList(t)};if(e===2){for(var n=new Array(t),i=0;i<t;i++)n[i]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:n}}throw new Error("0x"+r.toString(16)+": Coverage format must be 1 or 2.")};be.prototype.parseClassDef=function(){var r=this.offset+this.relativeOffset,e=this.parseUShort();if(e===1)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(e===2)return{format:2,ranges:this.parseRecordList({start:be.uShort,end:be.uShort,classId:be.uShort})};throw new Error("0x"+r.toString(16)+": ClassDef format must be 1 or 2.")};be.list=function(r,e){return function(){return this.parseList(r,e)}};be.list32=function(r,e){return function(){return this.parseList32(r,e)}};be.recordList=function(r,e){return function(){return this.parseRecordList(r,e)}};be.recordList32=function(r,e){return function(){return this.parseRecordList32(r,e)}};be.pointer=function(r){return function(){return this.parsePointer(r)}};be.pointer32=function(r){return function(){return this.parsePointer32(r)}};be.tag=be.prototype.parseTag;be.byte=be.prototype.parseByte;be.uShort=be.offset16=be.prototype.parseUShort;be.uShortList=be.prototype.parseUShortList;be.uLong=be.offset32=be.prototype.parseULong;be.uLongList=be.prototype.parseULongList;be.struct=be.prototype.parseStruct;be.coverage=be.prototype.parseCoverage;be.classDef=be.prototype.parseClassDef;var ux={reserved:be.uShort,reqFeatureIndex:be.uShort,featureIndexes:be.uShortList};be.prototype.parseScriptList=function(){return this.parsePointer(be.recordList({tag:be.tag,script:be.pointer({defaultLangSys:be.pointer(ux),langSysRecords:be.recordList({tag:be.tag,langSys:be.pointer(ux)})})}))||[]};be.prototype.parseFeatureList=function(){return this.parsePointer(be.recordList({tag:be.tag,feature:be.pointer({featureParams:be.offset16,lookupListIndexes:be.uShortList})}))||[]};be.prototype.parseLookupList=function(r){return this.parsePointer(be.list(be.pointer(function(){var e=this.parseUShort();Gt.argument(1<=e&&e<=9,"GPOS/GSUB lookup type "+e+" unknown.");var t=this.parseUShort(),n=t&16;return{lookupType:e,lookupFlag:t,subtables:this.parseList(be.pointer(r[e])),markFilteringSet:n?this.parseUShort():void 0}})))||[]};be.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var r=this.parseUShort(),e=this.parseUShort();Gt.argument(r===1&&e<1,"GPOS/GSUB feature variations table unknown.");var t=this.parseRecordList32({conditionSetOffset:be.offset32,featureTableSubstitutionOffset:be.offset32});return t})||[]};var vt={getByte:lx,getCard8:lx,getUShort:cg,getCard16:cg,getShort:h5,getULong:f1,getFixed:WT,getTag:p5,getOffset:g5,getBytes:m5,bytesToString:v5,Parser:be};function A5(r,e){e.parseUShort(),r.length=e.parseULong(),r.language=e.parseULong();var t;r.groupCount=t=e.parseULong(),r.glyphIndexMap={};for(var n=0;n<t;n+=1)for(var i=e.parseULong(),a=e.parseULong(),s=e.parseULong(),o=i;o<=a;o+=1)r.glyphIndexMap[o]=s,s++}function w5(r,e,t,n,i){r.length=e.parseUShort(),r.language=e.parseUShort();var a;r.segCount=a=e.parseUShort()>>1,e.skip("uShort",3),r.glyphIndexMap={};for(var s=new vt.Parser(t,n+i+14),o=new vt.Parser(t,n+i+16+a*2),l=new vt.Parser(t,n+i+16+a*4),u=new vt.Parser(t,n+i+16+a*6),c=n+i+16+a*8,f=0;f<a-1;f+=1)for(var d=void 0,h=s.parseUShort(),g=o.parseUShort(),v=l.parseShort(),y=u.parseUShort(),A=g;A<=h;A+=1)y!==0?(c=u.offset+u.relativeOffset-2,c+=y,c+=(A-g)*2,d=vt.getUShort(t,c),d!==0&&(d=d+v&65535)):d=A+v&65535,r.glyphIndexMap[A]=d}function b5(r,e){var t={};t.version=vt.getUShort(r,e),Gt.argument(t.version===0,"cmap table version should be 0."),t.numTables=vt.getUShort(r,e+2);for(var n=-1,i=t.numTables-1;i>=0;i-=1){var a=vt.getUShort(r,e+4+i*8),s=vt.getUShort(r,e+4+i*8+2);if(a===3&&(s===0||s===1||s===10)||a===0&&(s===0||s===1||s===2||s===3||s===4)){n=vt.getULong(r,e+4+i*8+4);break}}if(n===-1)throw new Error("No valid cmap sub-tables found.");var o=new vt.Parser(r,e+n);if(t.format=o.parseUShort(),t.format===12)A5(t,o);else if(t.format===4)w5(t,o,r,e,n);else throw new Error("Only format 4 and 12 cmap tables are supported (found format "+t.format+").");return t}function C5(r,e,t){r.segments.push({end:e,start:e,delta:-(e-t),offset:0,glyphIndex:t})}function x5(r){r.segments.push({end:65535,start:65535,delta:1,offset:0})}function S5(r){var e=!0,t;for(t=r.length-1;t>0;t-=1){var n=r.get(t);if(n.unicode>65535){console.log("Adding CMAP format 12 (needed!)"),e=!1;break}}var i=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:e?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:e?12:20}];e||(i=i.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),i=i.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var a=new dt.Table("cmap",i);for(a.segments=[],t=0;t<r.length;t+=1){for(var s=r.get(t),o=0;o<s.unicodes.length;o+=1)C5(a,s.unicodes[o],t);a.segments=a.segments.sort(function(C,S){return C.start-S.start})}x5(a);var l=a.segments.length,u=0,c=[],f=[],d=[],h=[],g=[],v=[];for(t=0;t<l;t+=1){var y=a.segments[t];y.end<=65535&&y.start<=65535?(c=c.concat({name:"end_"+t,type:"USHORT",value:y.end}),f=f.concat({name:"start_"+t,type:"USHORT",value:y.start}),d=d.concat({name:"idDelta_"+t,type:"SHORT",value:y.delta}),h=h.concat({name:"idRangeOffset_"+t,type:"USHORT",value:y.offset}),y.glyphId!==void 0&&(g=g.concat({name:"glyph_"+t,type:"USHORT",value:y.glyphId}))):u+=1,!e&&y.glyphIndex!==void 0&&(v=v.concat({name:"cmap12Start_"+t,type:"ULONG",value:y.start}),v=v.concat({name:"cmap12End_"+t,type:"ULONG",value:y.end}),v=v.concat({name:"cmap12Glyph_"+t,type:"ULONG",value:y.glyphIndex}))}if(a.segCountX2=(l-u)*2,a.searchRange=Math.pow(2,Math.floor(Math.log(l-u)/Math.log(2)))*2,a.entrySelector=Math.log(a.searchRange/2)/Math.log(2),a.rangeShift=a.segCountX2-a.searchRange,a.fields=a.fields.concat(c),a.fields.push({name:"reservedPad",type:"USHORT",value:0}),a.fields=a.fields.concat(f),a.fields=a.fields.concat(d),a.fields=a.fields.concat(h),a.fields=a.fields.concat(g),a.cmap4Length=14+c.length*2+2+f.length*2+d.length*2+h.length*2+g.length*2,!e){var A=16+v.length*4;a.cmap12Offset=20+a.cmap4Length,a.fields=a.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:A},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:v.length/3}]),a.fields=a.fields.concat(v)}return a}var QT={parse:b5,make:S5},Gp=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],E5=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],k5=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],ml=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function YT(r){this.font=r}YT.prototype.charToGlyphIndex=function(r){var e=r.codePointAt(0),t=this.font.glyphs;if(t){for(var n=0;n<t.length;n+=1)for(var i=t.get(n),a=0;a<i.unicodes.length;a+=1)if(i.unicodes[a]===e)return n}return null};function XT(r){this.cmap=r}XT.prototype.charToGlyphIndex=function(r){return this.cmap.glyphIndexMap[r.codePointAt(0)]||0};function dg(r,e){this.encoding=r,this.charset=e}dg.prototype.charToGlyphIndex=function(r){var e=r.codePointAt(0),t=this.encoding[e];return this.charset.indexOf(t)};function h1(r){switch(r.version){case 1:this.names=ml.slice();break;case 2:this.names=new Array(r.numberOfGlyphs);for(var e=0;e<r.numberOfGlyphs;e++)r.glyphNameIndex[e]<ml.length?this.names[e]=ml[r.glyphNameIndex[e]]:this.names[e]=r.names[r.glyphNameIndex[e]-ml.length];break;case 2.5:this.names=new Array(r.numberOfGlyphs);for(var t=0;t<r.numberOfGlyphs;t++)this.names[t]=ml[t+r.glyphNameIndex[t]];break;case 3:this.names=[];break;default:this.names=[];break}}h1.prototype.nameToGlyphIndex=function(r){return this.names.indexOf(r)};h1.prototype.glyphIndexToName=function(r){return this.names[r]};function T5(r){for(var e,t=r.tables.cmap.glyphIndexMap,n=Object.keys(t),i=0;i<n.length;i+=1){var a=n[i],s=t[a];e=r.glyphs.get(s),e.addUnicode(parseInt(a))}for(var o=0;o<r.glyphs.length;o+=1)e=r.glyphs.get(o),r.cffEncoding?r.isCIDFont?e.name="gid"+o:e.name=r.cffEncoding.charset[o]:r.glyphNames.names&&(e.name=r.glyphNames.glyphIndexToName(o))}function F5(r){r._IndexToUnicodeMap={};for(var e=r.tables.cmap.glyphIndexMap,t=Object.keys(e),n=0;n<t.length;n+=1){var i=t[n],a=e[i];r._IndexToUnicodeMap[a]===void 0?r._IndexToUnicodeMap[a]={unicodes:[parseInt(i)]}:r._IndexToUnicodeMap[a].unicodes.push(parseInt(i))}}function I5(r,e){e.lowMemory?F5(r):T5(r)}function P5(r,e,t,n,i){r.beginPath(),r.moveTo(e,t),r.lineTo(n,i),r.stroke()}var dl={line:P5};function D5(r,e){var t=e||new fi;return{configurable:!0,get:function(){return typeof t=="function"&&(t=t()),t},set:function(n){t=n}}}function ga(r){this.bindConstructorValues(r)}ga.prototype.bindConstructorValues=function(r){this.index=r.index||0,this.name=r.name||null,this.unicode=r.unicode||void 0,this.unicodes=r.unicodes||r.unicode!==void 0?[r.unicode]:[],"xMin"in r&&(this.xMin=r.xMin),"yMin"in r&&(this.yMin=r.yMin),"xMax"in r&&(this.xMax=r.xMax),"yMax"in r&&(this.yMax=r.yMax),"advanceWidth"in r&&(this.advanceWidth=r.advanceWidth),Object.defineProperty(this,"path",D5(this,r.path))};ga.prototype.addUnicode=function(r){this.unicodes.length===0&&(this.unicode=r),this.unicodes.push(r)};ga.prototype.getBoundingBox=function(){return this.path.getBoundingBox()};ga.prototype.getPath=function(r,e,t,n,i){r=r!==void 0?r:0,e=e!==void 0?e:0,t=t!==void 0?t:72;var a,s;n||(n={});var o=n.xScale,l=n.yScale;if(n.hinting&&i&&i.hinting&&(s=this.path&&i.hinting.exec(this,t)),s)a=i.hinting.getCommands(s),r=Math.round(r),e=Math.round(e),o=l=1;else{a=this.path.commands;var u=1/(this.path.unitsPerEm||1e3)*t;o===void 0&&(o=u),l===void 0&&(l=u)}for(var c=new fi,f=0;f<a.length;f+=1){var d=a[f];d.type==="M"?c.moveTo(r+d.x*o,e+-d.y*l):d.type==="L"?c.lineTo(r+d.x*o,e+-d.y*l):d.type==="Q"?c.quadraticCurveTo(r+d.x1*o,e+-d.y1*l,r+d.x*o,e+-d.y*l):d.type==="C"?c.curveTo(r+d.x1*o,e+-d.y1*l,r+d.x2*o,e+-d.y2*l,r+d.x*o,e+-d.y*l):d.type==="Z"&&c.closePath()}return c};ga.prototype.getContours=function(){if(this.points===void 0)return[];for(var r=[],e=[],t=0;t<this.points.length;t+=1){var n=this.points[t];e.push(n),n.lastPointOfContour&&(r.push(e),e=[])}return Gt.argument(e.length===0,"There are still points left in the current contour."),r};ga.prototype.getMetrics=function(){for(var r=this.path.commands,e=[],t=[],n=0;n<r.length;n+=1){var i=r[n];i.type!=="Z"&&(e.push(i.x),t.push(i.y)),(i.type==="Q"||i.type==="C")&&(e.push(i.x1),t.push(i.y1)),i.type==="C"&&(e.push(i.x2),t.push(i.y2))}var a={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,e),yMax:Math.max.apply(null,t),leftSideBearing:this.leftSideBearing};return isFinite(a.xMin)||(a.xMin=0),isFinite(a.xMax)||(a.xMax=this.advanceWidth),isFinite(a.yMin)||(a.yMin=0),isFinite(a.yMax)||(a.yMax=0),a.rightSideBearing=this.advanceWidth-a.leftSideBearing-(a.xMax-a.xMin),a};ga.prototype.draw=function(r,e,t,n,i){this.getPath(e,t,n,i).draw(r)};ga.prototype.drawPoints=function(r,e,t,n){function i(f,d,h,g){r.beginPath();for(var v=0;v<f.length;v+=1)r.moveTo(d+f[v].x*g,h+f[v].y*g),r.arc(d+f[v].x*g,h+f[v].y*g,2,0,Math.PI*2,!1);r.closePath(),r.fill()}e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:24;for(var a=1/this.path.unitsPerEm*n,s=[],o=[],l=this.path,u=0;u<l.commands.length;u+=1){var c=l.commands[u];c.x!==void 0&&s.push({x:c.x,y:-c.y}),c.x1!==void 0&&o.push({x:c.x1,y:-c.y1}),c.x2!==void 0&&o.push({x:c.x2,y:-c.y2})}r.fillStyle="blue",i(s,e,t,a),r.fillStyle="red",i(o,e,t,a)};ga.prototype.drawMetrics=function(r,e,t,n){var i;e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:24,i=1/this.path.unitsPerEm*n,r.lineWidth=1,r.strokeStyle="black",dl.line(r,e,-1e4,e,1e4),dl.line(r,-1e4,t,1e4,t);var a=this.xMin||0,s=this.yMin||0,o=this.xMax||0,l=this.yMax||0,u=this.advanceWidth||0;r.strokeStyle="blue",dl.line(r,e+a*i,-1e4,e+a*i,1e4),dl.line(r,e+o*i,-1e4,e+o*i,1e4),dl.line(r,-1e4,t+-s*i,1e4,t+-s*i),dl.line(r,-1e4,t+-l*i,1e4,t+-l*i),r.strokeStyle="green",dl.line(r,e+u*i,-1e4,e+u*i,1e4)};function Jh(r,e,t){Object.defineProperty(r,e,{get:function(){return r.path,r[t]},set:function(n){r[t]=n},enumerable:!0,configurable:!0})}function p1(r,e){if(this.font=r,this.glyphs={},Array.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];n.path.unitsPerEm=r.unitsPerEm,this.glyphs[t]=n}this.length=e&&e.length||0}p1.prototype.get=function(r){if(this.glyphs[r]===void 0){this.font._push(r),typeof this.glyphs[r]=="function"&&(this.glyphs[r]=this.glyphs[r]());var e=this.glyphs[r],t=this.font._IndexToUnicodeMap[r];if(t)for(var n=0;n<t.unicodes.length;n++)e.addUnicode(t.unicodes[n]);this.font.cffEncoding?this.font.isCIDFont?e.name="gid"+r:e.name=this.font.cffEncoding.charset[r]:this.font.glyphNames.names&&(e.name=this.font.glyphNames.glyphIndexToName(r)),this.glyphs[r].advanceWidth=this.font._hmtxTableData[r].advanceWidth,this.glyphs[r].leftSideBearing=this.font._hmtxTableData[r].leftSideBearing}else typeof this.glyphs[r]=="function"&&(this.glyphs[r]=this.glyphs[r]());return this.glyphs[r]};p1.prototype.push=function(r,e){this.glyphs[r]=e,this.length++};function R5(r,e){return new ga({index:e,font:r})}function O5(r,e,t,n,i,a){return function(){var s=new ga({index:e,font:r});return s.path=function(){t(s,n,i);var o=a(r.glyphs,s);return o.unitsPerEm=r.unitsPerEm,o},Jh(s,"xMin","_xMin"),Jh(s,"xMax","_xMax"),Jh(s,"yMin","_yMin"),Jh(s,"yMax","_yMax"),s}}function B5(r,e,t,n){return function(){var i=new ga({index:e,font:r});return i.path=function(){var a=t(r,i,n);return a.unitsPerEm=r.unitsPerEm,a},i}}var os={GlyphSet:p1,glyphLoader:R5,ttfGlyphLoader:O5,cffGlyphLoader:B5};function JT(r,e){if(r===e)return!0;if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t+=1)if(!JT(r[t],e[t]))return!1;return!0}else return!1}function Ky(r){var e;return r.length<1240?e=107:r.length<33900?e=1131:e=32768,e}function no(r,e,t){var n=[],i=[],a=vt.getCard16(r,e),s,o;if(a!==0){var l=vt.getByte(r,e+2);s=e+(a+1)*l+2;for(var u=e+3,c=0;c<a+1;c+=1)n.push(vt.getOffset(r,u,l)),u+=l;o=s+n[a]}else o=e+2;for(var f=0;f<n.length-1;f+=1){var d=vt.getBytes(r,s+n[f],s+n[f+1]);t&&(d=t(d)),i.push(d)}return{objects:i,startOffset:e,endOffset:o}}function M5(r,e){var t=[],n=vt.getCard16(r,e),i,a;if(n!==0){var s=vt.getByte(r,e+2);i=e+(n+1)*s+2;for(var o=e+3,l=0;l<n+1;l+=1)t.push(vt.getOffset(r,o,s)),o+=s;a=i+t[n]}else a=e+2;return{offsets:t,startOffset:e,endOffset:a}}function _5(r,e,t,n,i){var a=vt.getCard16(t,n),s=0;if(a!==0){var o=vt.getByte(t,n+2);s=n+(a+1)*o+2}var l=vt.getBytes(t,s+e[r],s+e[r+1]);return l}function N5(r){for(var e="",t=15,n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var i=r.parseByte(),a=i>>4,s=i&15;if(a===t||(e+=n[a],s===t))break;e+=n[s]}return parseFloat(e)}function L5(r,e){var t,n,i,a;if(e===28)return t=r.parseByte(),n=r.parseByte(),t<<8|n;if(e===29)return t=r.parseByte(),n=r.parseByte(),i=r.parseByte(),a=r.parseByte(),t<<24|n<<16|i<<8|a;if(e===30)return N5(r);if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return t=r.parseByte(),(e-247)*256+t+108;if(e>=251&&e<=254)return t=r.parseByte(),-(e-251)*256-t-108;throw new Error("Invalid b0 "+e)}function U5(r){for(var e={},t=0;t<r.length;t+=1){var n=r[t][0],i=r[t][1],a=void 0;if(i.length===1?a=i[0]:a=i,e.hasOwnProperty(n)&&!isNaN(e[n]))throw new Error("Object "+e+" already has key "+n);e[n]=a}return e}function KT(r,e,t){e=e!==void 0?e:0;var n=new vt.Parser(r,e),i=[],a=[];for(t=t!==void 0?t:r.length;n.relativeOffset<t;){var s=n.parseByte();s<=21?(s===12&&(s=1200+n.parseByte()),i.push([s,a]),a=[]):a.push(L5(n,s))}return U5(i)}function Xd(r,e){return e<=390?e=Gp[e]:e=r[e-391],e}function ZT(r,e,t){for(var n={},i,a=0;a<e.length;a+=1){var s=e[a];if(Array.isArray(s.type)){var o=[];o.length=s.type.length;for(var l=0;l<s.type.length;l++)i=r[s.op]!==void 0?r[s.op][l]:void 0,i===void 0&&(i=s.value!==void 0&&s.value[l]!==void 0?s.value[l]:null),s.type[l]==="SID"&&(i=Xd(t,i)),o[l]=i;n[s.name]=o}else i=r[s.op],i===void 0&&(i=s.value!==void 0?s.value:null),s.type==="SID"&&(i=Xd(t,i)),n[s.name]=i}return n}function V5(r,e){var t={};return t.formatMajor=vt.getCard8(r,e),t.formatMinor=vt.getCard8(r,e+1),t.size=vt.getCard8(r,e+2),t.offsetSize=vt.getCard8(r,e+3),t.startOffset=e,t.endOffset=e+4,t}var eF=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],tF=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];function z5(r,e){var t=KT(r,0,r.byteLength);return ZT(t,eF,e)}function rF(r,e,t,n){var i=KT(r,e,t);return ZT(i,tF,n)}function cx(r,e,t,n){for(var i=[],a=0;a<t.length;a+=1){var s=new DataView(new Uint8Array(t[a]).buffer),o=z5(s,n);o._subrs=[],o._subrsBias=0,o._defaultWidthX=0,o._nominalWidthX=0;var l=o.private[0],u=o.private[1];if(l!==0&&u!==0){var c=rF(r,u+e,l,n);if(o._defaultWidthX=c.defaultWidthX,o._nominalWidthX=c.nominalWidthX,c.subrs!==0){var f=u+c.subrs,d=no(r,f+e);o._subrs=d.objects,o._subrsBias=Ky(o._subrs)}o._privateDict=c}i.push(o)}return i}function $5(r,e,t,n){var i,a,s=new vt.Parser(r,e);t-=1;var o=[".notdef"],l=s.parseCard8();if(l===0)for(var u=0;u<t;u+=1)i=s.parseSID(),o.push(Xd(n,i));else if(l===1)for(;o.length<=t;){i=s.parseSID(),a=s.parseCard8();for(var c=0;c<=a;c+=1)o.push(Xd(n,i)),i+=1}else if(l===2)for(;o.length<=t;){i=s.parseSID(),a=s.parseCard16();for(var f=0;f<=a;f+=1)o.push(Xd(n,i)),i+=1}else throw new Error("Unknown charset format "+l);return o}function H5(r,e,t){var n,i={},a=new vt.Parser(r,e),s=a.parseCard8();if(s===0)for(var o=a.parseCard8(),l=0;l<o;l+=1)n=a.parseCard8(),i[n]=l;else if(s===1){var u=a.parseCard8();n=1;for(var c=0;c<u;c+=1)for(var f=a.parseCard8(),d=a.parseCard8(),h=f;h<=f+d;h+=1)i[h]=n,n+=1}else throw new Error("Unknown encoding format "+s);return new dg(i,t)}function dx(r,e,t){var n,i,a,s,o=new fi,l=[],u=0,c=!1,f=!1,d=0,h=0,g,v,y,A;if(r.isCIDFont){var C=r.tables.cff.topDict._fdSelect[e.index],S=r.tables.cff.topDict._fdArray[C];g=S._subrs,v=S._subrsBias,y=S._defaultWidthX,A=S._nominalWidthX}else g=r.tables.cff.topDict._subrs,v=r.tables.cff.topDict._subrsBias,y=r.tables.cff.topDict._defaultWidthX,A=r.tables.cff.topDict._nominalWidthX;var F=y;function E(G,j){f&&o.closePath(),o.moveTo(G,j),f=!0}function R(){var G;G=l.length%2!==0,G&&!c&&(F=l.shift()+A),u+=l.length>>1,l.length=0,c=!0}function B(G){for(var j,ie,q,Y,J,ae,oe,he,ye,Ue,Re,Oe,ee=0;ee<G.length;){var re=G[ee];switch(ee+=1,re){case 1:R();break;case 3:R();break;case 4:l.length>1&&!c&&(F=l.shift()+A,c=!0),h+=l.pop(),E(d,h);break;case 5:for(;l.length>0;)d+=l.shift(),h+=l.shift(),o.lineTo(d,h);break;case 6:for(;l.length>0&&(d+=l.shift(),o.lineTo(d,h),l.length!==0);)h+=l.shift(),o.lineTo(d,h);break;case 7:for(;l.length>0&&(h+=l.shift(),o.lineTo(d,h),l.length!==0);)d+=l.shift(),o.lineTo(d,h);break;case 8:for(;l.length>0;)n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+l.shift(),o.curveTo(n,i,a,s,d,h);break;case 10:J=l.pop()+v,ae=g[J],ae&&B(ae);break;case 11:return;case 12:switch(re=G[ee],ee+=1,re){case 35:n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),oe=a+l.shift(),he=s+l.shift(),ye=oe+l.shift(),Ue=he+l.shift(),Re=ye+l.shift(),Oe=Ue+l.shift(),d=Re+l.shift(),h=Oe+l.shift(),l.shift(),o.curveTo(n,i,a,s,oe,he),o.curveTo(ye,Ue,Re,Oe,d,h);break;case 34:n=d+l.shift(),i=h,a=n+l.shift(),s=i+l.shift(),oe=a+l.shift(),he=s,ye=oe+l.shift(),Ue=s,Re=ye+l.shift(),Oe=h,d=Re+l.shift(),o.curveTo(n,i,a,s,oe,he),o.curveTo(ye,Ue,Re,Oe,d,h);break;case 36:n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),oe=a+l.shift(),he=s,ye=oe+l.shift(),Ue=s,Re=ye+l.shift(),Oe=Ue+l.shift(),d=Re+l.shift(),o.curveTo(n,i,a,s,oe,he),o.curveTo(ye,Ue,Re,Oe,d,h);break;case 37:n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),oe=a+l.shift(),he=s+l.shift(),ye=oe+l.shift(),Ue=he+l.shift(),Re=ye+l.shift(),Oe=Ue+l.shift(),Math.abs(Re-d)>Math.abs(Oe-h)?d=Re+l.shift():h=Oe+l.shift(),o.curveTo(n,i,a,s,oe,he),o.curveTo(ye,Ue,Re,Oe,d,h);break;default:console.log("Glyph "+e.index+": unknown operator 1200"+re),l.length=0}break;case 14:l.length>0&&!c&&(F=l.shift()+A,c=!0),f&&(o.closePath(),f=!1);break;case 18:R();break;case 19:case 20:R(),ee+=u+7>>3;break;case 21:l.length>2&&!c&&(F=l.shift()+A,c=!0),h+=l.pop(),d+=l.pop(),E(d,h);break;case 22:l.length>1&&!c&&(F=l.shift()+A,c=!0),d+=l.pop(),E(d,h);break;case 23:R();break;case 24:for(;l.length>2;)n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+l.shift(),o.curveTo(n,i,a,s,d,h);d+=l.shift(),h+=l.shift(),o.lineTo(d,h);break;case 25:for(;l.length>6;)d+=l.shift(),h+=l.shift(),o.lineTo(d,h);n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+l.shift(),o.curveTo(n,i,a,s,d,h);break;case 26:for(l.length%2&&(d+=l.shift());l.length>0;)n=d,i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a,h=s+l.shift(),o.curveTo(n,i,a,s,d,h);break;case 27:for(l.length%2&&(h+=l.shift());l.length>0;)n=d+l.shift(),i=h,a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s,o.curveTo(n,i,a,s,d,h);break;case 28:j=G[ee],ie=G[ee+1],l.push((j<<24|ie<<16)>>16),ee+=2;break;case 29:J=l.pop()+r.gsubrsBias,ae=r.gsubrs[J],ae&&B(ae);break;case 30:for(;l.length>0&&(n=d,i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+(l.length===1?l.shift():0),o.curveTo(n,i,a,s,d,h),l.length!==0);)n=d+l.shift(),i=h,a=n+l.shift(),s=i+l.shift(),h=s+l.shift(),d=a+(l.length===1?l.shift():0),o.curveTo(n,i,a,s,d,h);break;case 31:for(;l.length>0&&(n=d+l.shift(),i=h,a=n+l.shift(),s=i+l.shift(),h=s+l.shift(),d=a+(l.length===1?l.shift():0),o.curveTo(n,i,a,s,d,h),l.length!==0);)n=d,i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+(l.length===1?l.shift():0),o.curveTo(n,i,a,s,d,h);break;default:re<32?console.log("Glyph "+e.index+": unknown operator "+re):re<247?l.push(re-139):re<251?(j=G[ee],ee+=1,l.push((re-247)*256+j+108)):re<255?(j=G[ee],ee+=1,l.push(-(re-251)*256-j-108)):(j=G[ee],ie=G[ee+1],q=G[ee+2],Y=G[ee+3],ee+=4,l.push((j<<24|ie<<16|q<<8|Y)/65536))}}}return B(t),e.advanceWidth=F,o}function G5(r,e,t,n){var i=[],a,s=new vt.Parser(r,e),o=s.parseCard8();if(o===0)for(var l=0;l<t;l++){if(a=s.parseCard8(),a>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+n+")");i.push(a)}else if(o===3){var u=s.parseCard16(),c=s.parseCard16();if(c!==0)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+c);for(var f,d=0;d<u;d++){if(a=s.parseCard8(),f=s.parseCard16(),a>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+n+")");if(f>t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+f);for(;c<f;c++)i.push(a);c=f}if(f!==t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+f)}else throw new Error("CFF Table CID Font FDSelect table has unsupported format "+o);return i}function j5(r,e,t,n){t.tables.cff={};var i=V5(r,e),a=no(r,i.endOffset,vt.bytesToString),s=no(r,a.endOffset),o=no(r,s.endOffset,vt.bytesToString),l=no(r,o.endOffset);t.gsubrs=l.objects,t.gsubrsBias=Ky(t.gsubrs);var u=cx(r,e,s.objects,o.objects);if(u.length!==1)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+u.length);var c=u[0];if(t.tables.cff.topDict=c,c._privateDict&&(t.defaultWidthX=c._privateDict.defaultWidthX,t.nominalWidthX=c._privateDict.nominalWidthX),c.ros[0]!==void 0&&c.ros[1]!==void 0&&(t.isCIDFont=!0),t.isCIDFont){var f=c.fdArray,d=c.fdSelect;if(f===0||d===0)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");f+=e;var h=no(r,f),g=cx(r,e,h.objects,o.objects);c._fdArray=g,d+=e,c._fdSelect=G5(r,d,t.numGlyphs,g.length)}var v=e+c.private[1],y=rF(r,v,c.private[0],o.objects);if(t.defaultWidthX=y.defaultWidthX,t.nominalWidthX=y.nominalWidthX,y.subrs!==0){var A=v+y.subrs,C=no(r,A);t.subrs=C.objects,t.subrsBias=Ky(t.subrs)}else t.subrs=[],t.subrsBias=0;var S;n.lowMemory?(S=M5(r,e+c.charStrings),t.nGlyphs=S.offsets.length):(S=no(r,e+c.charStrings),t.nGlyphs=S.objects.length);var F=$5(r,e+c.charset,t.nGlyphs,o.objects);if(c.encoding===0?t.cffEncoding=new dg(E5,F):c.encoding===1?t.cffEncoding=new dg(k5,F):t.cffEncoding=H5(r,e+c.encoding,F),t.encoding=t.encoding||t.cffEncoding,t.glyphs=new os.GlyphSet(t),n.lowMemory)t._push=function(B){var G=_5(B,S.offsets,r,e+c.charStrings);t.glyphs.push(B,os.cffGlyphLoader(t,B,dx,G))};else for(var E=0;E<t.nGlyphs;E+=1){var R=S.objects[E];t.glyphs.push(E,os.cffGlyphLoader(t,E,dx,R))}}function nF(r,e){var t,n=Gp.indexOf(r);return n>=0&&(t=n),n=e.indexOf(r),n>=0?t=n+Gp.length:(t=Gp.length+e.length,e.push(r)),t}function q5(){return new dt.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function W5(r){var e=new dt.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);e.names=[];for(var t=0;t<r.length;t+=1)e.names.push({name:"name_"+t,type:"NAME",value:r[t]});return e}function iF(r,e,t){for(var n={},i=0;i<r.length;i+=1){var a=r[i],s=e[a.name];s!==void 0&&!JT(s,a.value)&&(a.type==="SID"&&(s=nF(s,t)),n[a.op]={name:a.name,type:a.type,value:s})}return n}function fx(r,e){var t=new dt.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=iF(eF,r,e),t}function hx(r){var e=new dt.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return e.topDicts=[{name:"topDict_0",type:"TABLE",value:r}],e}function Q5(r){var e=new dt.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);e.strings=[];for(var t=0;t<r.length;t+=1)e.strings.push({name:"string_"+t,type:"STRING",value:r[t]});return e}function Y5(){return new dt.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function X5(r,e){for(var t=new dt.Record("Charsets",[{name:"format",type:"Card8",value:0}]),n=0;n<r.length;n+=1){var i=r[n],a=nF(i,e);t.fields.push({name:"glyph_"+n,type:"SID",value:a})}return t}function J5(r){var e=[],t=r.path;e.push({name:"width",type:"NUMBER",value:r.advanceWidth});for(var n=0,i=0,a=0;a<t.commands.length;a+=1){var s=void 0,o=void 0,l=t.commands[a];if(l.type==="Q"){var u=.3333333333333333,c=2/3;l={type:"C",x:l.x,y:l.y,x1:Math.round(u*n+c*l.x1),y1:Math.round(u*i+c*l.y1),x2:Math.round(u*l.x+c*l.x1),y2:Math.round(u*l.y+c*l.y1)}}if(l.type==="M")s=Math.round(l.x-n),o=Math.round(l.y-i),e.push({name:"dx",type:"NUMBER",value:s}),e.push({name:"dy",type:"NUMBER",value:o}),e.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(l.x),i=Math.round(l.y);else if(l.type==="L")s=Math.round(l.x-n),o=Math.round(l.y-i),e.push({name:"dx",type:"NUMBER",value:s}),e.push({name:"dy",type:"NUMBER",value:o}),e.push({name:"rlineto",type:"OP",value:5}),n=Math.round(l.x),i=Math.round(l.y);else if(l.type==="C"){var f=Math.round(l.x1-n),d=Math.round(l.y1-i),h=Math.round(l.x2-l.x1),g=Math.round(l.y2-l.y1);s=Math.round(l.x-l.x2),o=Math.round(l.y-l.y2),e.push({name:"dx1",type:"NUMBER",value:f}),e.push({name:"dy1",type:"NUMBER",value:d}),e.push({name:"dx2",type:"NUMBER",value:h}),e.push({name:"dy2",type:"NUMBER",value:g}),e.push({name:"dx",type:"NUMBER",value:s}),e.push({name:"dy",type:"NUMBER",value:o}),e.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(l.x),i=Math.round(l.y)}}return e.push({name:"endchar",type:"OP",value:14}),e}function K5(r){for(var e=new dt.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),t=0;t<r.length;t+=1){var n=r.get(t),i=J5(n);e.charStrings.push({name:n.name,type:"CHARSTRING",value:i})}return e}function Z5(r,e){var t=new dt.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=iF(tF,r,e),t}function eN(r,e){for(var t=new dt.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),n=1/e.unitsPerEm,i={version:e.version,fullName:e.fullName,familyName:e.familyName,weight:e.weightName,fontBBox:e.fontBBox||[0,0,0,0],fontMatrix:[n,0,0,n,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},a={},s=[],o,l=1;l<r.length;l+=1)o=r.get(l),s.push(o.name);var u=[];t.header=q5(),t.nameIndex=W5([e.postScriptName]);var c=fx(i,u);t.topDictIndex=hx(c),t.globalSubrIndex=Y5(),t.charsets=X5(s,u),t.charStringsIndex=K5(r),t.privateDict=Z5(a,u),t.stringIndex=Q5(u);var f=t.header.sizeOf()+t.nameIndex.sizeOf()+t.topDictIndex.sizeOf()+t.stringIndex.sizeOf()+t.globalSubrIndex.sizeOf();return i.charset=f,i.encoding=0,i.charStrings=i.charset+t.charsets.sizeOf(),i.private[1]=i.charStrings+t.charStringsIndex.sizeOf(),c=fx(i,u),t.topDictIndex=hx(c),t}var aF={parse:j5,make:eN};function tN(r,e){var t={},n=new vt.Parser(r,e);return t.version=n.parseVersion(),t.fontRevision=Math.round(n.parseFixed()*1e3)/1e3,t.checkSumAdjustment=n.parseULong(),t.magicNumber=n.parseULong(),Gt.argument(t.magicNumber===1594834165,"Font header has wrong magic number."),t.flags=n.parseUShort(),t.unitsPerEm=n.parseUShort(),t.created=n.parseLongDateTime(),t.modified=n.parseLongDateTime(),t.xMin=n.parseShort(),t.yMin=n.parseShort(),t.xMax=n.parseShort(),t.yMax=n.parseShort(),t.macStyle=n.parseUShort(),t.lowestRecPPEM=n.parseUShort(),t.fontDirectionHint=n.parseShort(),t.indexToLocFormat=n.parseShort(),t.glyphDataFormat=n.parseShort(),t}function rN(r){var e=Math.round(new Date().getTime()/1e3)+2082844800,t=e;return r.createdTimestamp&&(t=r.createdTimestamp+2082844800),new dt.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:t},{name:"modified",type:"LONGDATETIME",value:e},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],r)}var sF={parse:tN,make:rN};function nN(r,e){var t={},n=new vt.Parser(r,e);return t.version=n.parseVersion(),t.ascender=n.parseShort(),t.descender=n.parseShort(),t.lineGap=n.parseShort(),t.advanceWidthMax=n.parseUShort(),t.minLeftSideBearing=n.parseShort(),t.minRightSideBearing=n.parseShort(),t.xMaxExtent=n.parseShort(),t.caretSlopeRise=n.parseShort(),t.caretSlopeRun=n.parseShort(),t.caretOffset=n.parseShort(),n.relativeOffset+=8,t.metricDataFormat=n.parseShort(),t.numberOfHMetrics=n.parseUShort(),t}function iN(r){return new dt.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],r)}var oF={parse:nN,make:iN};function aN(r,e,t,n,i){for(var a,s,o=new vt.Parser(r,e),l=0;l<n;l+=1){l<t&&(a=o.parseUShort(),s=o.parseShort());var u=i.get(l);u.advanceWidth=a,u.leftSideBearing=s}}function sN(r,e,t,n,i){r._hmtxTableData={};for(var a,s,o=new vt.Parser(e,t),l=0;l<i;l+=1)l<n&&(a=o.parseUShort(),s=o.parseShort()),r._hmtxTableData[l]={advanceWidth:a,leftSideBearing:s}}function oN(r,e,t,n,i,a,s){s.lowMemory?sN(r,e,t,n,i):aN(e,t,n,i,a)}function lN(r){for(var e=new dt.Table("hmtx",[]),t=0;t<r.length;t+=1){var n=r.get(t),i=n.advanceWidth||0,a=n.leftSideBearing||0;e.fields.push({name:"advanceWidth_"+t,type:"USHORT",value:i}),e.fields.push({name:"leftSideBearing_"+t,type:"SHORT",value:a})}return e}var lF={parse:oN,make:lN};function uN(r){for(var e=new dt.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:r.length}]),t="",n=12+r.length*4,i=0;i<r.length;++i){var a=t.indexOf(r[i]);a<0&&(a=t.length,t+=r[i]),e.fields.push({name:"offset "+i,type:"USHORT",value:n+a}),e.fields.push({name:"length "+i,type:"USHORT",value:r[i].length})}return e.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),e}function cN(r,e){var t=new vt.Parser(r,e),n=t.parseULong();Gt.argument(n===1,"Unsupported ltag table version."),t.skip("uLong",1);for(var i=t.parseULong(),a=[],s=0;s<i;s++){for(var o="",l=e+t.parseUShort(),u=t.parseUShort(),c=l;c<l+u;++c)o+=String.fromCharCode(r.getInt8(c));a.push(o)}return a}var uF={make:uN,parse:cN};function dN(r,e){var t={},n=new vt.Parser(r,e);return t.version=n.parseVersion(),t.numGlyphs=n.parseUShort(),t.version===1&&(t.maxPoints=n.parseUShort(),t.maxContours=n.parseUShort(),t.maxCompositePoints=n.parseUShort(),t.maxCompositeContours=n.parseUShort(),t.maxZones=n.parseUShort(),t.maxTwilightPoints=n.parseUShort(),t.maxStorage=n.parseUShort(),t.maxFunctionDefs=n.parseUShort(),t.maxInstructionDefs=n.parseUShort(),t.maxStackElements=n.parseUShort(),t.maxSizeOfInstructions=n.parseUShort(),t.maxComponentElements=n.parseUShort(),t.maxComponentDepth=n.parseUShort()),t}function fN(r){return new dt.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:r}])}var cF={parse:dN,make:fN},dF=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],fF={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},hN={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},hF={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"};function pN(r,e,t){switch(r){case 0:if(e===65535)return"und";if(t)return t[e];break;case 1:return fF[e];case 3:return hF[e]}}var Zy="utf-16",gN={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},mN={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"};function pF(r,e,t){switch(r){case 0:return Zy;case 1:return mN[t]||gN[e];case 3:if(e===1||e===10)return Zy;break}}function vN(r,e,t){for(var n={},i=new vt.Parser(r,e),a=i.parseUShort(),s=i.parseUShort(),o=i.offset+i.parseUShort(),l=0;l<s;l++){var u=i.parseUShort(),c=i.parseUShort(),f=i.parseUShort(),d=i.parseUShort(),h=dF[d]||d,g=i.parseUShort(),v=i.parseUShort(),y=pN(u,f,t),A=pF(u,c,f);if(A!==void 0&&y!==void 0){var C=void 0;if(A===Zy?C=nc.UTF16(r,o+v,g):C=nc.MACSTRING(r,o+v,g,A),C){var S=n[h];S===void 0&&(S=n[h]={}),S[y]=C}}}return a===1&&i.parseUShort(),n}function I0(r){var e={};for(var t in r)e[r[t]]=parseInt(t);return e}function px(r,e,t,n,i,a){return new dt.Record("NameRecord",[{name:"platformID",type:"USHORT",value:r},{name:"encodingID",type:"USHORT",value:e},{name:"languageID",type:"USHORT",value:t},{name:"nameID",type:"USHORT",value:n},{name:"length",type:"USHORT",value:i},{name:"offset",type:"USHORT",value:a}])}function yN(r,e){var t=r.length,n=e.length-t+1;e:for(var i=0;i<n;i++)for(;i<n;i++){for(var a=0;a<t;a++)if(e[i+a]!==r[a])continue e;return i}return-1}function gx(r,e){var t=yN(r,e);if(t<0){t=e.length;for(var n=0,i=r.length;n<i;++n)e.push(r[n])}return t}function AN(r,e){var t,n=[],i={},a=I0(dF);for(var s in r){var o=a[s];if(o===void 0&&(o=s),t=parseInt(o),isNaN(t))throw new Error('Name table entry "'+s+'" does not exist, see nameTableNames for complete list.');i[t]=r[s],n.push(t)}for(var l=I0(fF),u=I0(hF),c=[],f=[],d=0;d<n.length;d++){t=n[d];var h=i[t];for(var g in h){var v=h[g],y=1,A=l[g],C=hN[A],S=pF(y,C,A),F=it.MACSTRING(v,S);F===void 0&&(y=0,A=e.indexOf(g),A<0&&(A=e.length,e.push(g)),C=4,F=it.UTF16(v));var E=gx(F,f);c.push(px(y,C,A,t,F.length,E));var R=u[g];if(R!==void 0){var B=it.UTF16(v),G=gx(B,f);c.push(px(3,1,R,t,B.length,G))}}}c.sort(function(q,Y){return q.platformID-Y.platformID||q.encodingID-Y.encodingID||q.languageID-Y.languageID||q.nameID-Y.nameID});for(var j=new dt.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:c.length},{name:"stringOffset",type:"USHORT",value:6+c.length*12}]),ie=0;ie<c.length;ie++)j.fields.push({name:"record_"+ie,type:"RECORD",value:c[ie]});return j.fields.push({name:"strings",type:"LITERAL",value:f}),j}var gF={parse:vN,make:AN},eA=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];function wN(r){for(var e=0;e<eA.length;e+=1){var t=eA[e];if(r>=t.begin&&r<t.end)return e}return-1}function bN(r,e){var t={},n=new vt.Parser(r,e);t.version=n.parseUShort(),t.xAvgCharWidth=n.parseShort(),t.usWeightClass=n.parseUShort(),t.usWidthClass=n.parseUShort(),t.fsType=n.parseUShort(),t.ySubscriptXSize=n.parseShort(),t.ySubscriptYSize=n.parseShort(),t.ySubscriptXOffset=n.parseShort(),t.ySubscriptYOffset=n.parseShort(),t.ySuperscriptXSize=n.parseShort(),t.ySuperscriptYSize=n.parseShort(),t.ySuperscriptXOffset=n.parseShort(),t.ySuperscriptYOffset=n.parseShort(),t.yStrikeoutSize=n.parseShort(),t.yStrikeoutPosition=n.parseShort(),t.sFamilyClass=n.parseShort(),t.panose=[];for(var i=0;i<10;i++)t.panose[i]=n.parseByte();return t.ulUnicodeRange1=n.parseULong(),t.ulUnicodeRange2=n.parseULong(),t.ulUnicodeRange3=n.parseULong(),t.ulUnicodeRange4=n.parseULong(),t.achVendID=String.fromCharCode(n.parseByte(),n.parseByte(),n.parseByte(),n.parseByte()),t.fsSelection=n.parseUShort(),t.usFirstCharIndex=n.parseUShort(),t.usLastCharIndex=n.parseUShort(),t.sTypoAscender=n.parseShort(),t.sTypoDescender=n.parseShort(),t.sTypoLineGap=n.parseShort(),t.usWinAscent=n.parseUShort(),t.usWinDescent=n.parseUShort(),t.version>=1&&(t.ulCodePageRange1=n.parseULong(),t.ulCodePageRange2=n.parseULong()),t.version>=2&&(t.sxHeight=n.parseShort(),t.sCapHeight=n.parseShort(),t.usDefaultChar=n.parseUShort(),t.usBreakChar=n.parseUShort(),t.usMaxContent=n.parseUShort()),t}function CN(r){return new dt.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],r)}var tA={parse:bN,make:CN,unicodeRanges:eA,getUnicodeRange:wN};function xN(r,e){var t={},n=new vt.Parser(r,e);switch(t.version=n.parseVersion(),t.italicAngle=n.parseFixed(),t.underlinePosition=n.parseShort(),t.underlineThickness=n.parseShort(),t.isFixedPitch=n.parseULong(),t.minMemType42=n.parseULong(),t.maxMemType42=n.parseULong(),t.minMemType1=n.parseULong(),t.maxMemType1=n.parseULong(),t.version){case 1:t.names=ml.slice();break;case 2:t.numberOfGlyphs=n.parseUShort(),t.glyphNameIndex=new Array(t.numberOfGlyphs);for(var i=0;i<t.numberOfGlyphs;i++)t.glyphNameIndex[i]=n.parseUShort();t.names=[];for(var a=0;a<t.numberOfGlyphs;a++)if(t.glyphNameIndex[a]>=ml.length){var s=n.parseChar();t.names.push(n.parseString(s))}break;case 2.5:t.numberOfGlyphs=n.parseUShort(),t.offset=new Array(t.numberOfGlyphs);for(var o=0;o<t.numberOfGlyphs;o++)t.offset[o]=n.parseChar();break}return t}function SN(){return new dt.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}var mF={parse:xN,make:SN},Da=new Array(9);Da[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(be.coverage),deltaGlyphId:this.parseUShort()};if(t===2)return{substFormat:2,coverage:this.parsePointer(be.coverage),substitute:this.parseOffset16List()};Gt.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")};Da[2]=function(){var e=this.parseUShort();return Gt.argument(e===1,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(be.coverage),sequences:this.parseListOfLists()}};Da[3]=function(){var e=this.parseUShort();return Gt.argument(e===1,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(be.coverage),alternateSets:this.parseListOfLists()}};Da[4]=function(){var e=this.parseUShort();return Gt.argument(e===1,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(be.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var Hu={sequenceIndex:be.uShort,lookupListIndex:be.uShort};Da[5]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:t,coverage:this.parsePointer(be.coverage),ruleSets:this.parseListOfLists(function(){var a=this.parseUShort(),s=this.parseUShort();return{input:this.parseUShortList(a-1),lookupRecords:this.parseRecordList(s,Hu)}})};if(t===2)return{substFormat:t,coverage:this.parsePointer(be.coverage),classDef:this.parsePointer(be.classDef),classSets:this.parseListOfLists(function(){var a=this.parseUShort(),s=this.parseUShort();return{classes:this.parseUShortList(a-1),lookupRecords:this.parseRecordList(s,Hu)}})};if(t===3){var n=this.parseUShort(),i=this.parseUShort();return{substFormat:t,coverages:this.parseList(n,be.pointer(be.coverage)),lookupRecords:this.parseRecordList(i,Hu)}}Gt.assert(!1,"0x"+e.toString(16)+": lookup type 5 format must be 1, 2 or 3.")};Da[6]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(be.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Hu)}})};if(t===2)return{substFormat:2,coverage:this.parsePointer(be.coverage),backtrackClassDef:this.parsePointer(be.classDef),inputClassDef:this.parsePointer(be.classDef),lookaheadClassDef:this.parsePointer(be.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Hu)}})};if(t===3)return{substFormat:3,backtrackCoverage:this.parseList(be.pointer(be.coverage)),inputCoverage:this.parseList(be.pointer(be.coverage)),lookaheadCoverage:this.parseList(be.pointer(be.coverage)),lookupRecords:this.parseRecordList(Hu)};Gt.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")};Da[7]=function(){var e=this.parseUShort();Gt.argument(e===1,"GSUB Extension Substitution subtable identifier-format must be 1");var t=this.parseUShort(),n=new be(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:Da[t].call(n)}};Da[8]=function(){var e=this.parseUShort();return Gt.argument(e===1,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(be.coverage),backtrackCoverage:this.parseList(be.pointer(be.coverage)),lookaheadCoverage:this.parseList(be.pointer(be.coverage)),substitutes:this.parseUShortList()}};function EN(r,e){e=e||0;var t=new be(r,e),n=t.parseVersion(1);return Gt.argument(n===1||n===1.1,"Unsupported GSUB table version."),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(Da)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(Da),variations:t.parseFeatureVariationsList()}}var gc=new Array(9);gc[1]=function(e){return e.substFormat===1?new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)},{name:"deltaGlyphID",type:"USHORT",value:e.deltaGlyphId}]):new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.ushortList("substitute",e.substitute)))};gc[2]=function(e){return Gt.assert(e.substFormat===1,"Lookup type 2 substFormat must be 1."),new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.tableList("seqSet",e.sequences,function(t){return new dt.Table("sequenceSetTable",dt.ushortList("sequence",t))})))};gc[3]=function(e){return Gt.assert(e.substFormat===1,"Lookup type 3 substFormat must be 1."),new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.tableList("altSet",e.alternateSets,function(t){return new dt.Table("alternateSetTable",dt.ushortList("alternate",t))})))};gc[4]=function(e){return Gt.assert(e.substFormat===1,"Lookup type 4 substFormat must be 1."),new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.tableList("ligSet",e.ligatureSets,function(t){return new dt.Table("ligatureSetTable",dt.tableList("ligature",t,function(n){return new dt.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:n.ligGlyph}].concat(dt.ushortList("component",n.components,n.components.length+1)))}))})))};gc[6]=function(e){if(e.substFormat===1){var t=new dt.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.tableList("chainRuleSet",e.chainRuleSets,function(a){return new dt.Table("chainRuleSetTable",dt.tableList("chainRule",a,function(s){var o=dt.ushortList("backtrackGlyph",s.backtrack,s.backtrack.length).concat(dt.ushortList("inputGlyph",s.input,s.input.length+1)).concat(dt.ushortList("lookaheadGlyph",s.lookahead,s.lookahead.length)).concat(dt.ushortList("substitution",[],s.lookupRecords.length));return s.lookupRecords.forEach(function(l,u){o=o.concat({name:"sequenceIndex"+u,type:"USHORT",value:l.sequenceIndex}).concat({name:"lookupListIndex"+u,type:"USHORT",value:l.lookupListIndex})}),new dt.Table("chainRuleTable",o)}))})));return t}else if(e.substFormat===2)Gt.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(e.substFormat===3){var n=[{name:"substFormat",type:"USHORT",value:e.substFormat}];n.push({name:"backtrackGlyphCount",type:"USHORT",value:e.backtrackCoverage.length}),e.backtrackCoverage.forEach(function(a,s){n.push({name:"backtrackCoverage"+s,type:"TABLE",value:new dt.Coverage(a)})}),n.push({name:"inputGlyphCount",type:"USHORT",value:e.inputCoverage.length}),e.inputCoverage.forEach(function(a,s){n.push({name:"inputCoverage"+s,type:"TABLE",value:new dt.Coverage(a)})}),n.push({name:"lookaheadGlyphCount",type:"USHORT",value:e.lookaheadCoverage.length}),e.lookaheadCoverage.forEach(function(a,s){n.push({name:"lookaheadCoverage"+s,type:"TABLE",value:new dt.Coverage(a)})}),n.push({name:"substitutionCount",type:"USHORT",value:e.lookupRecords.length}),e.lookupRecords.forEach(function(a,s){n=n.concat({name:"sequenceIndex"+s,type:"USHORT",value:a.sequenceIndex}).concat({name:"lookupListIndex"+s,type:"USHORT",value:a.lookupListIndex})});var i=new dt.Table("chainContextTable",n);return i}Gt.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};function kN(r){return new dt.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new dt.ScriptList(r.scripts)},{name:"features",type:"TABLE",value:new dt.FeatureList(r.features)},{name:"lookups",type:"TABLE",value:new dt.LookupList(r.lookups,gc)}])}var vF={parse:EN,make:kN};function TN(r,e){var t=new vt.Parser(r,e),n=t.parseULong();Gt.argument(n===1,"Unsupported META table version."),t.parseULong(),t.parseULong();for(var i=t.parseULong(),a={},s=0;s<i;s++){var o=t.parseTag(),l=t.parseULong(),u=t.parseULong(),c=nc.UTF8(r,e+l,u);a[o]=c}return a}function FN(r){var e=Object.keys(r).length,t="",n=16+e*12,i=new dt.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:n},{name:"numTags",type:"ULONG",value:e}]);for(var a in r){var s=t.length;t+=r[a],i.fields.push({name:"tag "+a,type:"TAG",value:a}),i.fields.push({name:"offset "+a,type:"ULONG",value:n+s}),i.fields.push({name:"length "+a,type:"ULONG",value:r[a].length})}return i.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),i}var yF={parse:TN,make:FN};function mx(r){return Math.log(r)/Math.log(2)|0}function g1(r){for(;r.length%4!==0;)r.push(0);for(var e=0,t=0;t<r.length;t+=4)e+=(r[t]<<24)+(r[t+1]<<16)+(r[t+2]<<8)+r[t+3];return e%=Math.pow(2,32),e}function vx(r,e,t,n){return new dt.Record("Table Record",[{name:"tag",type:"TAG",value:r!==void 0?r:""},{name:"checkSum",type:"ULONG",value:e!==void 0?e:0},{name:"offset",type:"ULONG",value:t!==void 0?t:0},{name:"length",type:"ULONG",value:n!==void 0?n:0}])}function AF(r){var e=new dt.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);e.tables=r,e.numTables=r.length;var t=Math.pow(2,mx(e.numTables));e.searchRange=16*t,e.entrySelector=mx(t),e.rangeShift=e.numTables*16-e.searchRange;for(var n=[],i=[],a=e.sizeOf()+vx().sizeOf()*e.numTables;a%4!==0;)a+=1,i.push({name:"padding",type:"BYTE",value:0});for(var s=0;s<r.length;s+=1){var o=r[s];Gt.argument(o.tableName.length===4,"Table name"+o.tableName+" is invalid.");var l=o.sizeOf(),u=vx(o.tableName,g1(o.encode()),a,l);for(n.push({name:u.tag+" Table Record",type:"RECORD",value:u}),i.push({name:o.tableName+" table",type:"RECORD",value:o}),a+=l,Gt.argument(!isNaN(a),"Something went wrong calculating the offset.");a%4!==0;)a+=1,i.push({name:"padding",type:"BYTE",value:0})}return n.sort(function(c,f){return c.value.tag>f.value.tag?1:-1}),e.fields=e.fields.concat(n),e.fields=e.fields.concat(i),e}function yx(r,e,t){for(var n=0;n<e.length;n+=1){var i=r.charToGlyphIndex(e[n]);if(i>0){var a=r.glyphs.get(i);return a.getMetrics()}}return t}function IN(r){for(var e=0,t=0;t<r.length;t+=1)e+=r[t];return e/r.length}function PN(r){for(var e=[],t=[],n=[],i=[],a=[],s=[],o=[],l,u=0,c=0,f=0,d=0,h=0,g=0;g<r.glyphs.length;g+=1){var v=r.glyphs.get(g),y=v.unicode|0;if(isNaN(v.advanceWidth))throw new Error("Glyph "+v.name+" ("+g+"): advanceWidth is not a number.");(l>y||l===void 0)&&y>0&&(l=y),u<y&&(u=y);var A=tA.getUnicodeRange(y);if(A<32)c|=1<<A;else if(A<64)f|=1<<A-32;else if(A<96)d|=1<<A-64;else if(A<123)h|=1<<A-96;else throw new Error("Unicode ranges bits > 123 are reserved for internal usage");if(v.name!==".notdef"){var C=v.getMetrics();e.push(C.xMin),t.push(C.yMin),n.push(C.xMax),i.push(C.yMax),s.push(C.leftSideBearing),o.push(C.rightSideBearing),a.push(v.advanceWidth)}}var S={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,n),yMax:Math.max.apply(null,i),advanceWidthMax:Math.max.apply(null,a),advanceWidthAvg:IN(a),minLeftSideBearing:Math.min.apply(null,s),maxLeftSideBearing:Math.max.apply(null,s),minRightSideBearing:Math.min.apply(null,o)};S.ascender=r.ascender,S.descender=r.descender;var F=sF.make({flags:3,unitsPerEm:r.unitsPerEm,xMin:S.xMin,yMin:S.yMin,xMax:S.xMax,yMax:S.yMax,lowestRecPPEM:3,createdTimestamp:r.createdTimestamp}),E=oF.make({ascender:S.ascender,descender:S.descender,advanceWidthMax:S.advanceWidthMax,minLeftSideBearing:S.minLeftSideBearing,minRightSideBearing:S.minRightSideBearing,xMaxExtent:S.maxLeftSideBearing+(S.xMax-S.xMin),numberOfHMetrics:r.glyphs.length}),R=cF.make(r.glyphs.length),B=tA.make(Object.assign({xAvgCharWidth:Math.round(S.advanceWidthAvg),usFirstCharIndex:l,usLastCharIndex:u,ulUnicodeRange1:c,ulUnicodeRange2:f,ulUnicodeRange3:d,ulUnicodeRange4:h,sTypoAscender:S.ascender,sTypoDescender:S.descender,sTypoLineGap:0,usWinAscent:S.yMax,usWinDescent:Math.abs(S.yMin),ulCodePageRange1:1,sxHeight:yx(r,"xyvw",{yMax:Math.round(S.ascender/2)}).yMax,sCapHeight:yx(r,"HIKLEFJMNTZBDPRAGOQSUVWXY",S).yMax,usDefaultChar:r.hasChar(" ")?32:0,usBreakChar:r.hasChar(" ")?32:0},r.tables.os2)),G=lF.make(r.glyphs),j=QT.make(r.glyphs),ie=r.getEnglishName("fontFamily"),q=r.getEnglishName("fontSubfamily"),Y=ie+" "+q,J=r.getEnglishName("postScriptName");J||(J=ie.replace(/\s/g,"")+"-"+q);var ae={};for(var oe in r.names)ae[oe]=r.names[oe];ae.uniqueID||(ae.uniqueID={en:r.getEnglishName("manufacturer")+":"+Y}),ae.postScriptName||(ae.postScriptName={en:J}),ae.preferredFamily||(ae.preferredFamily=r.names.fontFamily),ae.preferredSubfamily||(ae.preferredSubfamily=r.names.fontSubfamily);var he=[],ye=gF.make(ae,he),Ue=he.length>0?uF.make(he):void 0,Re=mF.make(),Oe=aF.make(r.glyphs,{version:r.getEnglishName("version"),fullName:Y,familyName:ie,weightName:q,postScriptName:J,unitsPerEm:r.unitsPerEm,fontBBox:[0,S.yMin,S.ascender,S.advanceWidthMax]}),ee=r.metas&&Object.keys(r.metas).length>0?yF.make(r.metas):void 0,re=[F,E,R,B,ye,j,Re,Oe,G];Ue&&re.push(Ue),r.tables.gsub&&re.push(vF.make(r.tables.gsub)),ee&&re.push(ee);for(var fe=AF(re),Be=fe.encode(),ke=g1(Be),$e=fe.fields,Ge=!1,qe=0;qe<$e.length;qe+=1)if($e[qe].name==="head table"){$e[qe].value.checkSumAdjustment=2981146554-ke,Ge=!0;break}if(!Ge)throw new Error("Could not find head table with checkSum to adjust.");return fe}var DN={make:AF,fontToTable:PN,computeCheckSum:g1};function P0(r,e){for(var t=0,n=r.length-1;t<=n;){var i=t+n>>>1,a=r[i].tag;if(a===e)return i;a<e?t=i+1:n=i-1}return-t-1}function Ax(r,e){for(var t=0,n=r.length-1;t<=n;){var i=t+n>>>1,a=r[i];if(a===e)return i;a<e?t=i+1:n=i-1}return-t-1}function wx(r,e){for(var t,n=0,i=r.length-1;n<=i;){var a=n+i>>>1;t=r[a];var s=t.start;if(s===e)return t;s<e?n=a+1:i=a-1}if(n>0)return t=r[n-1],e>t.end?0:t}function Hf(r,e){this.font=r,this.tableName=e}Hf.prototype={searchTag:P0,binSearch:Ax,getTable:function(r){var e=this.font.tables[this.tableName];return!e&&r&&(e=this.font.tables[this.tableName]=this.createDefaultTable()),e},getScriptNames:function(){var r=this.getTable();return r?r.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var r=this.getTable();if(r){for(var e=!1,t=0;t<r.scripts.length;t++){var n=r.scripts[t].tag;if(n==="DFLT")return n;n==="latn"&&(e=!0)}if(e)return"latn"}},getScriptTable:function(r,e){var t=this.getTable(e);if(t){r=r||"DFLT";var n=t.scripts,i=P0(t.scripts,r);if(i>=0)return n[i].script;if(e){var a={tag:r,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return n.splice(-1-i,0,a),a.script}}},getLangSysTable:function(r,e,t){var n=this.getScriptTable(r,t);if(n){if(!e||e==="dflt"||e==="DFLT")return n.defaultLangSys;var i=P0(n.langSysRecords,e);if(i>=0)return n.langSysRecords[i].langSys;if(t){var a={tag:e,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return n.langSysRecords.splice(-1-i,0,a),a.langSys}}},getFeatureTable:function(r,e,t,n){var i=this.getLangSysTable(r,e,n);if(i){for(var a,s=i.featureIndexes,o=this.font.tables[this.tableName].features,l=0;l<s.length;l++)if(a=o[s[l]],a.tag===t)return a.feature;if(n){var u=o.length;return Gt.assert(u===0||t>=o[u-1].tag,"Features must be added in alphabetical order."),a={tag:t,feature:{params:0,lookupListIndexes:[]}},o.push(a),s.push(u),a.feature}}},getLookupTables:function(r,e,t,n,i){var a=this.getFeatureTable(r,e,t,i),s=[];if(a){for(var o,l=a.lookupListIndexes,u=this.font.tables[this.tableName].lookups,c=0;c<l.length;c++)o=u[l[c]],o.lookupType===n&&s.push(o);if(s.length===0&&i){o={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0};var f=u.length;return u.push(o),l.push(f),[o]}}return s},getGlyphClass:function(r,e){switch(r.format){case 1:return r.startGlyph<=e&&e<r.startGlyph+r.classes.length?r.classes[e-r.startGlyph]:0;case 2:var t=wx(r.ranges,e);return t?t.classId:0}},getCoverageIndex:function(r,e){switch(r.format){case 1:var t=Ax(r.glyphs,e);return t>=0?t:-1;case 2:var n=wx(r.ranges,e);return n?n.index+e-n.start:-1}},expandCoverage:function(r){if(r.format===1)return r.glyphs;for(var e=[],t=r.ranges,n=0;n<t.length;n++)for(var i=t[n],a=i.start,s=i.end,o=a;o<=s;o++)e.push(o);return e}};function Gf(r){Hf.call(this,r,"gpos")}Gf.prototype=Hf.prototype;Gf.prototype.init=function(){var r=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(r)};Gf.prototype.getKerningValue=function(r,e,t){for(var n=0;n<r.length;n++)for(var i=r[n].subtables,a=0;a<i.length;a++){var s=i[a],o=this.getCoverageIndex(s.coverage,e);if(!(o<0))switch(s.posFormat){case 1:for(var l=s.pairSets[o],u=0;u<l.length;u++){var c=l[u];if(c.secondGlyph===t)return c.value1&&c.value1.xAdvance||0}break;case 2:var f=this.getGlyphClass(s.classDef1,e),d=this.getGlyphClass(s.classDef2,t),h=s.classRecords[f][d];return h.value1&&h.value1.xAdvance||0}}return 0};Gf.prototype.getKerningTables=function(r,e){if(this.font.tables.gpos)return this.getLookupTables(r,e,"kern",2)};function ia(r){Hf.call(this,r,"gsub")}function RN(r,e){var t=r.length;if(t!==e.length)return!1;for(var n=0;n<t;n++)if(r[n]!==e[n])return!1;return!0}function m1(r,e,t){for(var n=r.subtables,i=0;i<n.length;i++){var a=n[i];if(a.substFormat===e)return a}if(t)return n.push(t),t}ia.prototype=Hf.prototype;ia.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}};ia.prototype.getSingle=function(r,e,t){for(var n=[],i=this.getLookupTables(e,t,r,1),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++){var l=s[o],u=this.expandCoverage(l.coverage),c=void 0;if(l.substFormat===1){var f=l.deltaGlyphId;for(c=0;c<u.length;c++){var d=u[c];n.push({sub:d,by:d+f})}}else{var h=l.substitute;for(c=0;c<u.length;c++)n.push({sub:u[c],by:h[c]})}}return n};ia.prototype.getMultiple=function(r,e,t){for(var n=[],i=this.getLookupTables(e,t,r,2),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++){var l=s[o],u=this.expandCoverage(l.coverage),c=void 0;for(c=0;c<u.length;c++){var f=u[c],d=l.sequences[c];n.push({sub:f,by:d})}}return n};ia.prototype.getAlternates=function(r,e,t){for(var n=[],i=this.getLookupTables(e,t,r,3),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++)for(var l=s[o],u=this.expandCoverage(l.coverage),c=l.alternateSets,f=0;f<u.length;f++)n.push({sub:u[f],by:c[f]});return n};ia.prototype.getLigatures=function(r,e,t){for(var n=[],i=this.getLookupTables(e,t,r,4),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++)for(var l=s[o],u=this.expandCoverage(l.coverage),c=l.ligatureSets,f=0;f<u.length;f++)for(var d=u[f],h=c[f],g=0;g<h.length;g++){var v=h[g];n.push({sub:[d].concat(v.components),by:v.ligGlyph})}return n};ia.prototype.addSingle=function(r,e,t,n){var i=this.getLookupTables(t,n,r,1,!0)[0],a=m1(i,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});Gt.assert(a.coverage.format===1,"Single: unable to modify coverage table format "+a.coverage.format);var s=e.sub,o=this.binSearch(a.coverage.glyphs,s);o<0&&(o=-1-o,a.coverage.glyphs.splice(o,0,s),a.substitute.splice(o,0,0)),a.substitute[o]=e.by};ia.prototype.addMultiple=function(r,e,t,n){Gt.assert(e.by instanceof Array&&e.by.length>1,'Multiple: "by" must be an array of two or more ids');var i=this.getLookupTables(t,n,r,2,!0)[0],a=m1(i,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});Gt.assert(a.coverage.format===1,"Multiple: unable to modify coverage table format "+a.coverage.format);var s=e.sub,o=this.binSearch(a.coverage.glyphs,s);o<0&&(o=-1-o,a.coverage.glyphs.splice(o,0,s),a.sequences.splice(o,0,0)),a.sequences[o]=e.by};ia.prototype.addAlternate=function(r,e,t,n){var i=this.getLookupTables(t,n,r,3,!0)[0],a=m1(i,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});Gt.assert(a.coverage.format===1,"Alternate: unable to modify coverage table format "+a.coverage.format);var s=e.sub,o=this.binSearch(a.coverage.glyphs,s);o<0&&(o=-1-o,a.coverage.glyphs.splice(o,0,s),a.alternateSets.splice(o,0,0)),a.alternateSets[o]=e.by};ia.prototype.addLigature=function(r,e,t,n){var i=this.getLookupTables(t,n,r,4,!0)[0],a=i.subtables[0];a||(a={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},i.subtables[0]=a),Gt.assert(a.coverage.format===1,"Ligature: unable to modify coverage table format "+a.coverage.format);var s=e.sub[0],o=e.sub.slice(1),l={ligGlyph:e.by,components:o},u=this.binSearch(a.coverage.glyphs,s);if(u>=0){for(var c=a.ligatureSets[u],f=0;f<c.length;f++)if(RN(c[f].components,o))return;c.push(l)}else u=-1-u,a.coverage.glyphs.splice(u,0,s),a.ligatureSets.splice(u,0,[l])};ia.prototype.getFeature=function(r,e,t){if(/ss\d\d/.test(r))return this.getSingle(r,e,t);switch(r){case"aalt":case"salt":return this.getSingle(r,e,t).concat(this.getAlternates(r,e,t));case"dlig":case"liga":case"rlig":return this.getLigatures(r,e,t);case"ccmp":return this.getMultiple(r,e,t).concat(this.getLigatures(r,e,t));case"stch":return this.getMultiple(r,e,t)}};ia.prototype.add=function(r,e,t,n){if(/ss\d\d/.test(r))return this.addSingle(r,e,t,n);switch(r){case"aalt":case"salt":return typeof e.by=="number"?this.addSingle(r,e,t,n):this.addAlternate(r,e,t,n);case"dlig":case"liga":case"rlig":return this.addLigature(r,e,t,n);case"ccmp":return e.by instanceof Array?this.addMultiple(r,e,t,n):this.addLigature(r,e,t,n)}};function ON(){return typeof window<"u"}function BN(r){for(var e=new Buffer(r.byteLength),t=new Uint8Array(r),n=0;n<e.length;++n)e[n]=t[n];return e}function pd(r,e){if(!r)throw e}function bx(r,e,t,n,i){var a;return(e&n)>0?(a=r.parseByte(),(e&i)===0&&(a=-a),a=t+a):(e&i)>0?a=t:a=t+r.parseShort(),a}function wF(r,e,t){var n=new vt.Parser(e,t);r.numberOfContours=n.parseShort(),r._xMin=n.parseShort(),r._yMin=n.parseShort(),r._xMax=n.parseShort(),r._yMax=n.parseShort();var i,a;if(r.numberOfContours>0){for(var s=r.endPointIndices=[],o=0;o<r.numberOfContours;o+=1)s.push(n.parseUShort());r.instructionLength=n.parseUShort(),r.instructions=[];for(var l=0;l<r.instructionLength;l+=1)r.instructions.push(n.parseByte());var u=s[s.length-1]+1;i=[];for(var c=0;c<u;c+=1)if(a=n.parseByte(),i.push(a),(a&8)>0)for(var f=n.parseByte(),d=0;d<f;d+=1)i.push(a),c+=1;if(Gt.argument(i.length===u,"Bad flags."),s.length>0){var h=[],g;if(u>0){for(var v=0;v<u;v+=1)a=i[v],g={},g.onCurve=!!(a&1),g.lastPointOfContour=s.indexOf(v)>=0,h.push(g);for(var y=0,A=0;A<u;A+=1)a=i[A],g=h[A],g.x=bx(n,a,y,2,16),y=g.x;for(var C=0,S=0;S<u;S+=1)a=i[S],g=h[S],g.y=bx(n,a,C,4,32),C=g.y}r.points=h}else r.points=[]}else if(r.numberOfContours===0)r.points=[];else{r.isComposite=!0,r.points=[],r.components=[];for(var F=!0;F;){i=n.parseUShort();var E={glyphIndex:n.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(i&1)>0?(i&2)>0?(E.dx=n.parseShort(),E.dy=n.parseShort()):E.matchedPoints=[n.parseUShort(),n.parseUShort()]:(i&2)>0?(E.dx=n.parseChar(),E.dy=n.parseChar()):E.matchedPoints=[n.parseByte(),n.parseByte()],(i&8)>0?E.xScale=E.yScale=n.parseF2Dot14():(i&64)>0?(E.xScale=n.parseF2Dot14(),E.yScale=n.parseF2Dot14()):(i&128)>0&&(E.xScale=n.parseF2Dot14(),E.scale01=n.parseF2Dot14(),E.scale10=n.parseF2Dot14(),E.yScale=n.parseF2Dot14()),r.components.push(E),F=!!(i&32)}if(i&256){r.instructionLength=n.parseUShort(),r.instructions=[];for(var R=0;R<r.instructionLength;R+=1)r.instructions.push(n.parseByte())}}}function D0(r,e){for(var t=[],n=0;n<r.length;n+=1){var i=r[n],a={x:e.xScale*i.x+e.scale01*i.y+e.dx,y:e.scale10*i.x+e.yScale*i.y+e.dy,onCurve:i.onCurve,lastPointOfContour:i.lastPointOfContour};t.push(a)}return t}function MN(r){for(var e=[],t=[],n=0;n<r.length;n+=1){var i=r[n];t.push(i),i.lastPointOfContour&&(e.push(t),t=[])}return Gt.argument(t.length===0,"There are still points left in the current contour."),e}function bF(r){var e=new fi;if(!r)return e;for(var t=MN(r),n=0;n<t.length;++n){var i=t[n],a=null,s=i[i.length-1],o=i[0];if(s.onCurve)e.moveTo(s.x,s.y);else if(o.onCurve)e.moveTo(o.x,o.y);else{var l={x:(s.x+o.x)*.5,y:(s.y+o.y)*.5};e.moveTo(l.x,l.y)}for(var u=0;u<i.length;++u)if(a=s,s=o,o=i[(u+1)%i.length],s.onCurve)e.lineTo(s.x,s.y);else{var c=o;a.onCurve||((s.x+a.x)*.5,(s.y+a.y)*.5),o.onCurve||(c={x:(s.x+o.x)*.5,y:(s.y+o.y)*.5}),e.quadraticCurveTo(s.x,s.y,c.x,c.y)}e.closePath()}return e}function CF(r,e){if(e.isComposite)for(var t=0;t<e.components.length;t+=1){var n=e.components[t],i=r.get(n.glyphIndex);if(i.getPath(),i.points){var a=void 0;if(n.matchedPoints===void 0)a=D0(i.points,n);else{if(n.matchedPoints[0]>e.points.length-1||n.matchedPoints[1]>i.points.length-1)throw Error("Matched points out of range in "+e.name);var s=e.points[n.matchedPoints[0]],o=i.points[n.matchedPoints[1]],l={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};o=D0([o],l)[0],l.dx=s.x-o.x,l.dy=s.y-o.y,a=D0(i.points,l)}e.points=e.points.concat(a)}}return bF(e.points)}function _N(r,e,t,n){for(var i=new os.GlyphSet(n),a=0;a<t.length-1;a+=1){var s=t[a],o=t[a+1];s!==o?i.push(a,os.ttfGlyphLoader(n,a,wF,r,e+s,CF)):i.push(a,os.glyphLoader(n,a))}return i}function NN(r,e,t,n){var i=new os.GlyphSet(n);return n._push=function(a){var s=t[a],o=t[a+1];s!==o?i.push(a,os.ttfGlyphLoader(n,a,wF,r,e+s,CF)):i.push(a,os.glyphLoader(n,a))},i}function LN(r,e,t,n,i){return i.lowMemory?NN(r,e,t,n):_N(r,e,t,n)}var xF={getPath:bF,parse:LN},SF,El,EF,rA;function kF(r){this.font=r,this.getCommands=function(e){return xF.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function UN(r){return r}function TF(r){return Math.sign(r)*Math.round(Math.abs(r))}function VN(r){return Math.sign(r)*Math.round(Math.abs(r*2))/2}function zN(r){return Math.sign(r)*(Math.round(Math.abs(r)+.5)-.5)}function $N(r){return Math.sign(r)*Math.ceil(Math.abs(r))}function HN(r){return Math.sign(r)*Math.floor(Math.abs(r))}var FF=function(r){var e=this.srPeriod,t=this.srPhase,n=this.srThreshold,i=1;return r<0&&(r=-r,i=-1),r+=n-t,r=Math.trunc(r/e)*e,r+=t,r<0?t*i:r*i},rs={x:1,y:0,axis:"x",distance:function(r,e,t,n){return(t?r.xo:r.x)-(n?e.xo:e.x)},interpolate:function(r,e,t,n){var i,a,s,o,l,u,c;if(!n||n===this){if(i=r.xo-e.xo,a=r.xo-t.xo,l=e.x-e.xo,u=t.x-t.xo,s=Math.abs(i),o=Math.abs(a),c=s+o,c===0){r.x=r.xo+(l+u)/2;return}r.x=r.xo+(l*o+u*s)/c;return}if(i=n.distance(r,e,!0,!0),a=n.distance(r,t,!0,!0),l=n.distance(e,e,!1,!0),u=n.distance(t,t,!1,!0),s=Math.abs(i),o=Math.abs(a),c=s+o,c===0){rs.setRelative(r,r,(l+u)/2,n,!0);return}rs.setRelative(r,r,(l*o+u*s)/c,n,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(r,e,t,n,i){if(!n||n===this){r.x=(i?e.xo:e.x)+t;return}var a=i?e.xo:e.x,s=i?e.yo:e.y,o=a+t*n.x,l=s+t*n.y;r.x=o+(r.y-l)/n.normalSlope},slope:0,touch:function(r){r.xTouched=!0},touched:function(r){return r.xTouched},untouch:function(r){r.xTouched=!1}},Rs={x:0,y:1,axis:"y",distance:function(r,e,t,n){return(t?r.yo:r.y)-(n?e.yo:e.y)},interpolate:function(r,e,t,n){var i,a,s,o,l,u,c;if(!n||n===this){if(i=r.yo-e.yo,a=r.yo-t.yo,l=e.y-e.yo,u=t.y-t.yo,s=Math.abs(i),o=Math.abs(a),c=s+o,c===0){r.y=r.yo+(l+u)/2;return}r.y=r.yo+(l*o+u*s)/c;return}if(i=n.distance(r,e,!0,!0),a=n.distance(r,t,!0,!0),l=n.distance(e,e,!1,!0),u=n.distance(t,t,!1,!0),s=Math.abs(i),o=Math.abs(a),c=s+o,c===0){Rs.setRelative(r,r,(l+u)/2,n,!0);return}Rs.setRelative(r,r,(l*o+u*s)/c,n,!0)},normalSlope:0,setRelative:function(r,e,t,n,i){if(!n||n===this){r.y=(i?e.yo:e.y)+t;return}var a=i?e.xo:e.x,s=i?e.yo:e.y,o=a+t*n.x,l=s+t*n.y;r.y=l+n.normalSlope*(r.x-o)},slope:Number.POSITIVE_INFINITY,touch:function(r){r.yTouched=!0},touched:function(r){return r.yTouched},untouch:function(r){r.yTouched=!1}};Object.freeze(rs);Object.freeze(Rs);function jf(r,e){this.x=r,this.y=e,this.axis=void 0,this.slope=e/r,this.normalSlope=-r/e,Object.freeze(this)}jf.prototype.distance=function(r,e,t,n){return this.x*rs.distance(r,e,t,n)+this.y*Rs.distance(r,e,t,n)};jf.prototype.interpolate=function(r,e,t,n){var i,a,s,o,l,u,c;if(s=n.distance(r,e,!0,!0),o=n.distance(r,t,!0,!0),i=n.distance(e,e,!1,!0),a=n.distance(t,t,!1,!0),l=Math.abs(s),u=Math.abs(o),c=l+u,c===0){this.setRelative(r,r,(i+a)/2,n,!0);return}this.setRelative(r,r,(i*u+a*l)/c,n,!0)};jf.prototype.setRelative=function(r,e,t,n,i){n=n||this;var a=i?e.xo:e.x,s=i?e.yo:e.y,o=a+t*n.x,l=s+t*n.y,u=n.normalSlope,c=this.slope,f=r.x,d=r.y;r.x=(c*f-u*o+l-d)/(c-u),r.y=c*(r.x-f)+d};jf.prototype.touch=function(r){r.xTouched=!0,r.yTouched=!0};function qf(r,e){var t=Math.sqrt(r*r+e*e);return r/=t,e/=t,r===1&&e===0?rs:r===0&&e===1?Rs:new jf(r,e)}function Os(r,e,t,n){this.x=this.xo=Math.round(r*64)/64,this.y=this.yo=Math.round(e*64)/64,this.lastPointOfContour=t,this.onCurve=n,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Os.prototype.nextTouched=function(r){for(var e=this.nextPointOnContour;!r.touched(e)&&e!==this;)e=e.nextPointOnContour;return e};Os.prototype.prevTouched=function(r){for(var e=this.prevPointOnContour;!r.touched(e)&&e!==this;)e=e.prevPointOnContour;return e};var bf=Object.freeze(new Os(0,0)),GN={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function fo(r,e){switch(this.env=r,this.stack=[],this.prog=e,r){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=rs,this.round=TF}}kF.prototype.exec=function(r,e){if(typeof e!="number")throw new Error("Point size is not a number!");if(!(this._errorState>2)){var t=this.font,n=this._prepState;if(!n||n.ppem!==e){var i=this._fpgmState;if(!i){fo.prototype=GN,i=this._fpgmState=new fo("fpgm",t.tables.fpgm),i.funcs=[],i.font=t,exports.DEBUG&&(console.log("---EXEC FPGM---"),i.step=-1);try{El(i)}catch(u){console.log("Hinting error in FPGM:"+u),this._errorState=3;return}}fo.prototype=i,n=this._prepState=new fo("prep",t.tables.prep),n.ppem=e;var a=t.tables.cvt;if(a)for(var s=n.cvt=new Array(a.length),o=e/t.unitsPerEm,l=0;l<a.length;l++)s[l]=a[l]*o;else n.cvt=[];exports.DEBUG&&(console.log("---EXEC PREP---"),n.step=-1);try{El(n)}catch(u){this._errorState<2&&console.log("Hinting error in PREP:"+u),this._errorState=2}}if(!(this._errorState>1))try{return EF(r,n)}catch(u){this._errorState<1&&(console.log("Hinting error:"+u),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}}};EF=function(r,e){var t=e.ppem/e.font.unitsPerEm,n=t,i=r.components,a,s,o;if(fo.prototype=e,!i)o=new fo("glyf",r.instructions),exports.DEBUG&&(console.log("---EXEC GLYPH---"),o.step=-1),rA(r,o,t,n),s=o.gZone;else{var l=e.font;s=[],a=[];for(var u=0;u<i.length;u++){var c=i[u],f=l.glyphs.get(c.glyphIndex);o=new fo("glyf",f.instructions),exports.DEBUG&&(console.log("---EXEC COMP "+u+"---"),o.step=-1),rA(f,o,t,n);for(var d=Math.round(c.dx*t),h=Math.round(c.dy*n),g=o.gZone,v=o.contours,y=0;y<g.length;y++){var A=g[y];A.xTouched=A.yTouched=!1,A.xo=A.x=A.x+d,A.yo=A.y=A.y+h}var C=s.length;s.push.apply(s,g);for(var S=0;S<v.length;S++)a.push(v[S]+C)}r.instructions&&!o.inhibitGridFit&&(o=new fo("glyf",r.instructions),o.gZone=o.z0=o.z1=o.z2=s,o.contours=a,s.push(new Os(0,0),new Os(Math.round(r.advanceWidth*t),0)),exports.DEBUG&&(console.log("---EXEC COMPOSITE---"),o.step=-1),El(o),s.length-=2)}return s};rA=function(r,e,t,n){for(var i=r.points||[],a=i.length,s=e.gZone=e.z0=e.z1=e.z2=[],o=e.contours=[],l,u=0;u<a;u++)l=i[u],s[u]=new Os(l.x*t,l.y*n,l.lastPointOfContour,l.onCurve);for(var c,f,d=0;d<a;d++)l=s[d],c||(c=l,o.push(d)),l.lastPointOfContour?(l.nextPointOnContour=c,c.prevPointOnContour=l,c=void 0):(f=s[d+1],l.nextPointOnContour=f,f.prevPointOnContour=l);if(!e.inhibitGridFit){if(exports.DEBUG){console.log("PROCESSING GLYPH",e.stack);for(var h=0;h<a;h++)console.log(h,s[h].x,s[h].y)}if(s.push(new Os(0,0),new Os(Math.round(r.advanceWidth*t),0)),El(e),s.length-=2,exports.DEBUG){console.log("FINISHED GLYPH",e.stack);for(var g=0;g<a;g++)console.log(g,s[g].x,s[g].y)}}};El=function(r){var e=r.prog;if(e){var t=e.length,n;for(r.ip=0;r.ip<t;r.ip++){if(exports.DEBUG&&r.step++,n=SF[e[r.ip]],!n)throw new Error("unknown instruction: 0x"+Number(e[r.ip]).toString(16));n(r)}}};function qg(r){for(var e=r.tZone=new Array(r.gZone.length),t=0;t<e.length;t++)e[t]=new Os(0,0)}function IF(r,e){var t=r.prog,n=r.ip,i=1,a;do if(a=t[++n],a===88)i++;else if(a===89)i--;else if(a===64)n+=t[n+1]+1;else if(a===65)n+=2*t[n+1]+1;else if(a>=176&&a<=183)n+=a-176+1;else if(a>=184&&a<=191)n+=(a-184+1)*2;else if(e&&i===1&&a===27)break;while(i>0);r.ip=n}function Cx(r,e){exports.DEBUG&&console.log(e.step,"SVTCA["+r.axis+"]"),e.fv=e.pv=e.dpv=r}function xx(r,e){exports.DEBUG&&console.log(e.step,"SPVTCA["+r.axis+"]"),e.pv=e.dpv=r}function Sx(r,e){exports.DEBUG&&console.log(e.step,"SFVTCA["+r.axis+"]"),e.fv=r}function Ex(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z2[n],s=e.z1[i];exports.DEBUG&&console.log("SPVTL["+r+"]",n,i);var o,l;r?(o=a.y-s.y,l=s.x-a.x):(o=s.x-a.x,l=s.y-a.y),e.pv=e.dpv=qf(o,l)}function kx(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z2[n],s=e.z1[i];exports.DEBUG&&console.log("SFVTL["+r+"]",n,i);var o,l;r?(o=a.y-s.y,l=s.x-a.x):(o=s.x-a.x,l=s.y-a.y),e.fv=qf(o,l)}function jN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"SPVFS[]",t,n),r.pv=r.dpv=qf(n,t)}function qN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"SPVFS[]",t,n),r.fv=qf(n,t)}function WN(r){var e=r.stack,t=r.pv;exports.DEBUG&&console.log(r.step,"GPV[]"),e.push(t.x*16384),e.push(t.y*16384)}function QN(r){var e=r.stack,t=r.fv;exports.DEBUG&&console.log(r.step,"GFV[]"),e.push(t.x*16384),e.push(t.y*16384)}function YN(r){r.fv=r.pv,exports.DEBUG&&console.log(r.step,"SFVTPV[]")}function XN(r){var e=r.stack,t=e.pop(),n=e.pop(),i=e.pop(),a=e.pop(),s=e.pop(),o=r.z0,l=r.z1,u=o[t],c=o[n],f=l[i],d=l[a],h=r.z2[s];exports.DEBUG&&console.log("ISECT[], ",t,n,i,a,s);var g=u.x,v=u.y,y=c.x,A=c.y,C=f.x,S=f.y,F=d.x,E=d.y,R=(g-y)*(S-E)-(v-A)*(C-F),B=g*A-v*y,G=C*E-S*F;h.x=(B*(C-F)-G*(g-y))/R,h.y=(B*(S-E)-G*(v-A))/R}function JN(r){r.rp0=r.stack.pop(),exports.DEBUG&&console.log(r.step,"SRP0[]",r.rp0)}function KN(r){r.rp1=r.stack.pop(),exports.DEBUG&&console.log(r.step,"SRP1[]",r.rp1)}function ZN(r){r.rp2=r.stack.pop(),exports.DEBUG&&console.log(r.step,"SRP2[]",r.rp2)}function e6(r){var e=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"SZP0[]",e),r.zp0=e,e){case 0:r.tZone||qg(r),r.z0=r.tZone;break;case 1:r.z0=r.gZone;break;default:throw new Error("Invalid zone pointer")}}function t6(r){var e=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"SZP1[]",e),r.zp1=e,e){case 0:r.tZone||qg(r),r.z1=r.tZone;break;case 1:r.z1=r.gZone;break;default:throw new Error("Invalid zone pointer")}}function r6(r){var e=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"SZP2[]",e),r.zp2=e,e){case 0:r.tZone||qg(r),r.z2=r.tZone;break;case 1:r.z2=r.gZone;break;default:throw new Error("Invalid zone pointer")}}function n6(r){var e=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"SZPS[]",e),r.zp0=r.zp1=r.zp2=e,e){case 0:r.tZone||qg(r),r.z0=r.z1=r.z2=r.tZone;break;case 1:r.z0=r.z1=r.z2=r.gZone;break;default:throw new Error("Invalid zone pointer")}}function i6(r){r.loop=r.stack.pop(),exports.DEBUG&&console.log(r.step,"SLOOP[]",r.loop)}function a6(r){exports.DEBUG&&console.log(r.step,"RTG[]"),r.round=TF}function s6(r){exports.DEBUG&&console.log(r.step,"RTHG[]"),r.round=zN}function o6(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SMD[]",e),r.minDis=e/64}function l6(r){exports.DEBUG&&console.log(r.step,"ELSE[]"),IF(r,!1)}function u6(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"JMPR[]",e),r.ip+=e-1}function c6(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SCVTCI[]",e),r.cvCutIn=e/64}function d6(r){var e=r.stack;exports.DEBUG&&console.log(r.step,"DUP[]"),e.push(e[e.length-1])}function R0(r){exports.DEBUG&&console.log(r.step,"POP[]"),r.stack.pop()}function f6(r){exports.DEBUG&&console.log(r.step,"CLEAR[]"),r.stack.length=0}function h6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"SWAP[]"),e.push(t),e.push(n)}function p6(r){var e=r.stack;exports.DEBUG&&console.log(r.step,"DEPTH[]"),e.push(e.length)}function g6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"LOOPCALL[]",t,n);var i=r.ip,a=r.prog;r.prog=r.funcs[t];for(var s=0;s<n;s++)El(r),exports.DEBUG&&console.log(++r.step,s+1<n?"next loopcall":"done loopcall",s);r.ip=i,r.prog=a}function m6(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"CALL[]",e);var t=r.ip,n=r.prog;r.prog=r.funcs[e],El(r),r.ip=t,r.prog=n,exports.DEBUG&&console.log(++r.step,"returning from",e)}function v6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"CINDEX[]",t),e.push(e[e.length-t])}function y6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"MINDEX[]",t),e.push(e.splice(e.length-t,1)[0])}function A6(r){if(r.env!=="fpgm")throw new Error("FDEF not allowed here");var e=r.stack,t=r.prog,n=r.ip,i=e.pop(),a=n;for(exports.DEBUG&&console.log(r.step,"FDEF[]",i);t[++n]!==45;);r.ip=n,r.funcs[i]=t.slice(a+1,n)}function Tx(r,e){var t=e.stack.pop(),n=e.z0[t],i=e.fv,a=e.pv;exports.DEBUG&&console.log(e.step,"MDAP["+r+"]",t);var s=a.distance(n,bf);r&&(s=e.round(s)),i.setRelative(n,bf,s,a),i.touch(n),e.rp0=e.rp1=t}function Fx(r,e){var t=e.z2,n=t.length-2,i,a,s;exports.DEBUG&&console.log(e.step,"IUP["+r.axis+"]");for(var o=0;o<n;o++)i=t[o],!r.touched(i)&&(a=i.prevTouched(r),a!==i&&(s=i.nextTouched(r),a===s&&r.setRelative(i,i,r.distance(a,a,!1,!0),r,!0),r.interpolate(i,a,s,r)))}function Ix(r,e){for(var t=e.stack,n=r?e.rp1:e.rp2,i=(r?e.z0:e.z1)[n],a=e.fv,s=e.pv,o=e.loop,l=e.z2;o--;){var u=t.pop(),c=l[u],f=s.distance(i,i,!1,!0);a.setRelative(c,c,f,s),a.touch(c),exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-o)+": ":"")+"SHP["+(r?"rp1":"rp2")+"]",u)}e.loop=1}function Px(r,e){var t=e.stack,n=r?e.rp1:e.rp2,i=(r?e.z0:e.z1)[n],a=e.fv,s=e.pv,o=t.pop(),l=e.z2[e.contours[o]],u=l;exports.DEBUG&&console.log(e.step,"SHC["+r+"]",o);var c=s.distance(i,i,!1,!0);do u!==i&&a.setRelative(u,u,c,s),u=u.nextPointOnContour;while(u!==l)}function Dx(r,e){var t=e.stack,n=r?e.rp1:e.rp2,i=(r?e.z0:e.z1)[n],a=e.fv,s=e.pv,o=t.pop();exports.DEBUG&&console.log(e.step,"SHZ["+r+"]",o);var l;switch(o){case 0:l=e.tZone;break;case 1:l=e.gZone;break;default:throw new Error("Invalid zone")}for(var u,c=s.distance(i,i,!1,!0),f=l.length-2,d=0;d<f;d++)u=l[d],a.setRelative(u,u,c,s)}function w6(r){for(var e=r.stack,t=r.loop,n=r.fv,i=e.pop()/64,a=r.z2;t--;){var s=e.pop(),o=a[s];exports.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-t)+": ":"")+"SHPIX[]",s,i),n.setRelative(o,o,i),n.touch(o)}r.loop=1}function b6(r){for(var e=r.stack,t=r.rp1,n=r.rp2,i=r.loop,a=r.z0[t],s=r.z1[n],o=r.fv,l=r.dpv,u=r.z2;i--;){var c=e.pop(),f=u[c];exports.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-i)+": ":"")+"IP[]",c,t,"<->",n),o.interpolate(f,a,s,l),o.touch(f)}r.loop=1}function Rx(r,e){var t=e.stack,n=t.pop()/64,i=t.pop(),a=e.z1[i],s=e.z0[e.rp0],o=e.fv,l=e.pv;o.setRelative(a,s,n,l),o.touch(a),exports.DEBUG&&console.log(e.step,"MSIRP["+r+"]",n,i),e.rp1=e.rp0,e.rp2=i,r&&(e.rp0=i)}function C6(r){for(var e=r.stack,t=r.rp0,n=r.z0[t],i=r.loop,a=r.fv,s=r.pv,o=r.z1;i--;){var l=e.pop(),u=o[l];exports.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-i)+": ":"")+"ALIGNRP[]",l),a.setRelative(u,n,0,s),a.touch(u)}r.loop=1}function x6(r){exports.DEBUG&&console.log(r.step,"RTDG[]"),r.round=VN}function Ox(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z0[i],s=e.fv,o=e.pv,l=e.cvt[n];exports.DEBUG&&console.log(e.step,"MIAP["+r+"]",n,"(",l,")",i);var u=o.distance(a,bf);r&&(Math.abs(u-l)<e.cvCutIn&&(u=l),u=e.round(u)),s.setRelative(a,bf,u,o),e.zp0===0&&(a.xo=a.x,a.yo=a.y),s.touch(a),e.rp0=e.rp1=i}function S6(r){var e=r.prog,t=r.ip,n=r.stack,i=e[++t];exports.DEBUG&&console.log(r.step,"NPUSHB[]",i);for(var a=0;a<i;a++)n.push(e[++t]);r.ip=t}function E6(r){var e=r.ip,t=r.prog,n=r.stack,i=t[++e];exports.DEBUG&&console.log(r.step,"NPUSHW[]",i);for(var a=0;a<i;a++){var s=t[++e]<<8|t[++e];s&32768&&(s=-((s^65535)+1)),n.push(s)}r.ip=e}function k6(r){var e=r.stack,t=r.store;t||(t=r.store=[]);var n=e.pop(),i=e.pop();exports.DEBUG&&console.log(r.step,"WS",n,i),t[i]=n}function T6(r){var e=r.stack,t=r.store,n=e.pop();exports.DEBUG&&console.log(r.step,"RS",n);var i=t&&t[n]||0;e.push(i)}function F6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"WCVTP",t,n),r.cvt[n]=t/64}function I6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"RCVT",t),e.push(r.cvt[t]*64)}function Bx(r,e){var t=e.stack,n=t.pop(),i=e.z2[n];exports.DEBUG&&console.log(e.step,"GC["+r+"]",n),t.push(e.dpv.distance(i,bf,r,!1)*64)}function Mx(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z1[n],s=e.z0[i],o=e.dpv.distance(s,a,r,r);exports.DEBUG&&console.log(e.step,"MD["+r+"]",n,i,"->",o),e.stack.push(Math.round(o*64))}function P6(r){exports.DEBUG&&console.log(r.step,"MPPEM[]"),r.stack.push(r.ppem)}function D6(r){exports.DEBUG&&console.log(r.step,"FLIPON[]"),r.autoFlip=!0}function R6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"LT[]",t,n),e.push(n<t?1:0)}function O6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"LTEQ[]",t,n),e.push(n<=t?1:0)}function B6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"GT[]",t,n),e.push(n>t?1:0)}function M6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"GTEQ[]",t,n),e.push(n>=t?1:0)}function _6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"EQ[]",t,n),e.push(t===n?1:0)}function N6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"NEQ[]",t,n),e.push(t!==n?1:0)}function L6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"ODD[]",t),e.push(Math.trunc(t)%2?1:0)}function U6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"EVEN[]",t),e.push(Math.trunc(t)%2?0:1)}function V6(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"IF[]",e),e||(IF(r,!0),exports.DEBUG&&console.log(r.step,"EIF[]"))}function z6(r){exports.DEBUG&&console.log(r.step,"EIF[]")}function $6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"AND[]",t,n),e.push(t&&n?1:0)}function H6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"OR[]",t,n),e.push(t||n?1:0)}function G6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"NOT[]",t),e.push(t?0:1)}function O0(r,e){var t=e.stack,n=t.pop(),i=e.fv,a=e.pv,s=e.ppem,o=e.deltaBase+(r-1)*16,l=e.deltaShift,u=e.z0;exports.DEBUG&&console.log(e.step,"DELTAP["+r+"]",n,t);for(var c=0;c<n;c++){var f=t.pop(),d=t.pop(),h=o+((d&240)>>4);if(h===s){var g=(d&15)-8;g>=0&&g++,exports.DEBUG&&console.log(e.step,"DELTAPFIX",f,"by",g*l);var v=u[f];i.setRelative(v,v,g*l,a)}}}function j6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"SDB[]",t),r.deltaBase=t}function q6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"SDS[]",t),r.deltaShift=Math.pow(.5,t)}function W6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"ADD[]",t,n),e.push(n+t)}function Q6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"SUB[]",t,n),e.push(n-t)}function Y6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"DIV[]",t,n),e.push(n*64/t)}function X6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"MUL[]",t,n),e.push(n*t/64)}function J6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"ABS[]",t),e.push(Math.abs(t))}function K6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"NEG[]",t),e.push(-t)}function Z6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"FLOOR[]",t),e.push(Math.floor(t/64)*64)}function e8(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"CEILING[]",t),e.push(Math.ceil(t/64)*64)}function Kh(r,e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"ROUND[]"),t.push(e.round(n/64)*64)}function t8(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"WCVTF[]",t,n),r.cvt[n]=t*r.ppem/r.font.unitsPerEm}function B0(r,e){var t=e.stack,n=t.pop(),i=e.ppem,a=e.deltaBase+(r-1)*16,s=e.deltaShift;exports.DEBUG&&console.log(e.step,"DELTAC["+r+"]",n,t);for(var o=0;o<n;o++){var l=t.pop(),u=t.pop(),c=a+((u&240)>>4);if(c===i){var f=(u&15)-8;f>=0&&f++;var d=f*s;exports.DEBUG&&console.log(e.step,"DELTACFIX",l,"by",d),e.cvt[l]+=d}}}function r8(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SROUND[]",e),r.round=FF;var t;switch(e&192){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(r.srPeriod=t,e&48){case 0:r.srPhase=0;break;case 16:r.srPhase=.25*t;break;case 32:r.srPhase=.5*t;break;case 48:r.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}e&=15,e===0?r.srThreshold=0:r.srThreshold=(e/8-.5)*t}function n8(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"S45ROUND[]",e),r.round=FF;var t;switch(e&192){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(r.srPeriod=t,e&48){case 0:r.srPhase=0;break;case 16:r.srPhase=.25*t;break;case 32:r.srPhase=.5*t;break;case 48:r.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}e&=15,e===0?r.srThreshold=0:r.srThreshold=(e/8-.5)*t}function i8(r){exports.DEBUG&&console.log(r.step,"ROFF[]"),r.round=UN}function a8(r){exports.DEBUG&&console.log(r.step,"RUTG[]"),r.round=$N}function s8(r){exports.DEBUG&&console.log(r.step,"RDTG[]"),r.round=HN}function o8(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SCANCTRL[]",e)}function _x(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z2[n],s=e.z1[i];exports.DEBUG&&console.log(e.step,"SDPVTL["+r+"]",n,i);var o,l;r?(o=a.y-s.y,l=s.x-a.x):(o=s.x-a.x,l=s.y-a.y),e.dpv=qf(o,l)}function l8(r){var e=r.stack,t=e.pop(),n=0;exports.DEBUG&&console.log(r.step,"GETINFO[]",t),t&1&&(n=35),t&32&&(n|=4096),e.push(n)}function u8(r){var e=r.stack,t=e.pop(),n=e.pop(),i=e.pop();exports.DEBUG&&console.log(r.step,"ROLL[]"),e.push(n),e.push(t),e.push(i)}function c8(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"MAX[]",t,n),e.push(Math.max(n,t))}function d8(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"MIN[]",t,n),e.push(Math.min(n,t))}function f8(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SCANTYPE[]",e)}function h8(r){var e=r.stack.pop(),t=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"INSTCTRL[]",e,t),e){case 1:r.inhibitGridFit=!!t;return;case 2:r.ignoreCvt=!!t;return;default:throw new Error("invalid INSTCTRL[] selector")}}function Ks(r,e){var t=e.stack,n=e.prog,i=e.ip;exports.DEBUG&&console.log(e.step,"PUSHB["+r+"]");for(var a=0;a<r;a++)t.push(n[++i]);e.ip=i}function Zs(r,e){var t=e.ip,n=e.prog,i=e.stack;exports.DEBUG&&console.log(e.ip,"PUSHW["+r+"]");for(var a=0;a<r;a++){var s=n[++t]<<8|n[++t];s&32768&&(s=-((s^65535)+1)),i.push(s)}e.ip=t}function gt(r,e,t,n,i,a){var s=a.stack,o=r&&s.pop(),l=s.pop(),u=a.rp0,c=a.z0[u],f=a.z1[l],d=a.minDis,h=a.fv,g=a.dpv,v,y,A,C;y=v=g.distance(f,c,!0,!0),A=y>=0?1:-1,y=Math.abs(y),r&&(C=a.cvt[o],n&&Math.abs(y-C)<a.cvCutIn&&(y=C)),t&&y<d&&(y=d),n&&(y=a.round(y)),h.setRelative(f,c,A*y,g),h.touch(f),exports.DEBUG&&console.log(a.step,(r?"MIRP[":"MDRP[")+(e?"M":"m")+(t?">":"_")+(n?"R":"_")+(i===0?"Gr":i===1?"Bl":i===2?"Wh":"")+"]",r?o+"("+a.cvt[o]+","+C+")":"",l,"(d =",v,"->",A*y,")"),a.rp1=a.rp0,a.rp2=l,e&&(a.rp0=l)}SF=[Cx.bind(void 0,Rs),Cx.bind(void 0,rs),xx.bind(void 0,Rs),xx.bind(void 0,rs),Sx.bind(void 0,Rs),Sx.bind(void 0,rs),Ex.bind(void 0,0),Ex.bind(void 0,1),kx.bind(void 0,0),kx.bind(void 0,1),jN,qN,WN,QN,YN,XN,JN,KN,ZN,e6,t6,r6,n6,i6,a6,s6,o6,l6,u6,c6,void 0,void 0,d6,R0,f6,h6,p6,v6,y6,void 0,void 0,void 0,g6,m6,A6,void 0,Tx.bind(void 0,0),Tx.bind(void 0,1),Fx.bind(void 0,Rs),Fx.bind(void 0,rs),Ix.bind(void 0,0),Ix.bind(void 0,1),Px.bind(void 0,0),Px.bind(void 0,1),Dx.bind(void 0,0),Dx.bind(void 0,1),w6,b6,Rx.bind(void 0,0),Rx.bind(void 0,1),C6,x6,Ox.bind(void 0,0),Ox.bind(void 0,1),S6,E6,k6,T6,F6,I6,Bx.bind(void 0,0),Bx.bind(void 0,1),void 0,Mx.bind(void 0,0),Mx.bind(void 0,1),P6,void 0,D6,void 0,void 0,R6,O6,B6,M6,_6,N6,L6,U6,V6,z6,$6,H6,G6,O0.bind(void 0,1),j6,q6,W6,Q6,Y6,X6,J6,K6,Z6,e8,Kh.bind(void 0,0),Kh.bind(void 0,1),Kh.bind(void 0,2),Kh.bind(void 0,3),void 0,void 0,void 0,void 0,t8,O0.bind(void 0,2),O0.bind(void 0,3),B0.bind(void 0,1),B0.bind(void 0,2),B0.bind(void 0,3),r8,n8,void 0,void 0,i8,void 0,a8,s8,R0,R0,void 0,void 0,void 0,void 0,void 0,o8,_x.bind(void 0,0),_x.bind(void 0,1),l8,void 0,u8,c8,d8,f8,h8,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Ks.bind(void 0,1),Ks.bind(void 0,2),Ks.bind(void 0,3),Ks.bind(void 0,4),Ks.bind(void 0,5),Ks.bind(void 0,6),Ks.bind(void 0,7),Ks.bind(void 0,8),Zs.bind(void 0,1),Zs.bind(void 0,2),Zs.bind(void 0,3),Zs.bind(void 0,4),Zs.bind(void 0,5),Zs.bind(void 0,6),Zs.bind(void 0,7),Zs.bind(void 0,8),gt.bind(void 0,0,0,0,0,0),gt.bind(void 0,0,0,0,0,1),gt.bind(void 0,0,0,0,0,2),gt.bind(void 0,0,0,0,0,3),gt.bind(void 0,0,0,0,1,0),gt.bind(void 0,0,0,0,1,1),gt.bind(void 0,0,0,0,1,2),gt.bind(void 0,0,0,0,1,3),gt.bind(void 0,0,0,1,0,0),gt.bind(void 0,0,0,1,0,1),gt.bind(void 0,0,0,1,0,2),gt.bind(void 0,0,0,1,0,3),gt.bind(void 0,0,0,1,1,0),gt.bind(void 0,0,0,1,1,1),gt.bind(void 0,0,0,1,1,2),gt.bind(void 0,0,0,1,1,3),gt.bind(void 0,0,1,0,0,0),gt.bind(void 0,0,1,0,0,1),gt.bind(void 0,0,1,0,0,2),gt.bind(void 0,0,1,0,0,3),gt.bind(void 0,0,1,0,1,0),gt.bind(void 0,0,1,0,1,1),gt.bind(void 0,0,1,0,1,2),gt.bind(void 0,0,1,0,1,3),gt.bind(void 0,0,1,1,0,0),gt.bind(void 0,0,1,1,0,1),gt.bind(void 0,0,1,1,0,2),gt.bind(void 0,0,1,1,0,3),gt.bind(void 0,0,1,1,1,0),gt.bind(void 0,0,1,1,1,1),gt.bind(void 0,0,1,1,1,2),gt.bind(void 0,0,1,1,1,3),gt.bind(void 0,1,0,0,0,0),gt.bind(void 0,1,0,0,0,1),gt.bind(void 0,1,0,0,0,2),gt.bind(void 0,1,0,0,0,3),gt.bind(void 0,1,0,0,1,0),gt.bind(void 0,1,0,0,1,1),gt.bind(void 0,1,0,0,1,2),gt.bind(void 0,1,0,0,1,3),gt.bind(void 0,1,0,1,0,0),gt.bind(void 0,1,0,1,0,1),gt.bind(void 0,1,0,1,0,2),gt.bind(void 0,1,0,1,0,3),gt.bind(void 0,1,0,1,1,0),gt.bind(void 0,1,0,1,1,1),gt.bind(void 0,1,0,1,1,2),gt.bind(void 0,1,0,1,1,3),gt.bind(void 0,1,1,0,0,0),gt.bind(void 0,1,1,0,0,1),gt.bind(void 0,1,1,0,0,2),gt.bind(void 0,1,1,0,0,3),gt.bind(void 0,1,1,0,1,0),gt.bind(void 0,1,1,0,1,1),gt.bind(void 0,1,1,0,1,2),gt.bind(void 0,1,1,0,1,3),gt.bind(void 0,1,1,1,0,0),gt.bind(void 0,1,1,1,0,1),gt.bind(void 0,1,1,1,0,2),gt.bind(void 0,1,1,1,0,3),gt.bind(void 0,1,1,1,1,0),gt.bind(void 0,1,1,1,1,1),gt.bind(void 0,1,1,1,1,2),gt.bind(void 0,1,1,1,1,3)];function mc(r){this.char=r,this.state={},this.activeState=null}function v1(r,e,t){this.contextName=t,this.startIndex=r,this.endOffset=e}function p8(r,e,t){this.contextName=r,this.openRange=null,this.ranges=[],this.checkStart=e,this.checkEnd=t}function Ra(r,e){this.context=r,this.index=e,this.length=r.length,this.current=r[e],this.backtrack=r.slice(0,e),this.lookahead=r.slice(e+1)}function Wg(r){this.eventId=r,this.subscribers=[]}function g8(r){var e=this,t=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];t.forEach(function(i){Object.defineProperty(e.events,i,{value:new Wg(i)})}),r&&t.forEach(function(i){var a=r[i];typeof a=="function"&&e.events[i].subscribe(a)});var n=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];n.forEach(function(i){e.events[i].subscribe(e.updateContextsRanges)})}function Gn(r){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],g8.call(this,r)}mc.prototype.setState=function(r,e){return this.state[r]=e,this.activeState={key:r,value:this.state[r]},this.activeState};mc.prototype.getState=function(r){return this.state[r]||null};Gn.prototype.inboundIndex=function(r){return r>=0&&r<this.tokens.length};Gn.prototype.composeRUD=function(r){var e=this,t=!0,n=r.map(function(a){return e[a[0]].apply(e,a.slice(1).concat(t))}),i=function(a){return typeof a=="object"&&a.hasOwnProperty("FAIL")};if(n.every(i))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:n.filter(i)};this.dispatch("composeRUD",[n.filter(function(a){return!i(a)})])};Gn.prototype.replaceRange=function(r,e,t,n){e=e!==null?e:this.tokens.length;var i=t.every(function(s){return s instanceof mc});if(!isNaN(r)&&this.inboundIndex(r)&&i){var a=this.tokens.splice.apply(this.tokens,[r,e].concat(t));return n||this.dispatch("replaceToken",[r,e,t]),[a,t]}else return{FAIL:"replaceRange: invalid tokens or startIndex."}};Gn.prototype.replaceToken=function(r,e,t){if(!isNaN(r)&&this.inboundIndex(r)&&e instanceof mc){var n=this.tokens.splice(r,1,e);return t||this.dispatch("replaceToken",[r,e]),[n[0],e]}else return{FAIL:"replaceToken: invalid token or index."}};Gn.prototype.removeRange=function(r,e,t){e=isNaN(e)?this.tokens.length:e;var n=this.tokens.splice(r,e);return t||this.dispatch("removeRange",[n,r,e]),n};Gn.prototype.removeToken=function(r,e){if(!isNaN(r)&&this.inboundIndex(r)){var t=this.tokens.splice(r,1);return e||this.dispatch("removeToken",[t,r]),t}else return{FAIL:"removeToken: invalid token index."}};Gn.prototype.insertToken=function(r,e,t){var n=r.every(function(i){return i instanceof mc});return n?(this.tokens.splice.apply(this.tokens,[e,0].concat(r)),t||this.dispatch("insertToken",[r,e]),r):{FAIL:"insertToken: invalid token(s)."}};Gn.prototype.registerModifier=function(r,e,t){this.events.newToken.subscribe(function(n,i){var a=[n,i],s=e===null||e.apply(this,a)===!0,o=[n,i];if(s){var l=t.apply(this,o);n.setState(r,l)}}),this.registeredModifiers.push(r)};Wg.prototype.subscribe=function(r){return typeof r=="function"?this.subscribers.push(r)-1:{FAIL:"invalid '"+this.eventId+"' event handler"}};Wg.prototype.unsubscribe=function(r){this.subscribers.splice(r,1)};Ra.prototype.setCurrentIndex=function(r){this.index=r,this.current=this.context[r],this.backtrack=this.context.slice(0,r),this.lookahead=this.context.slice(r+1)};Ra.prototype.get=function(r){switch(!0){case r===0:return this.current;case(r<0&&Math.abs(r)<=this.backtrack.length):return this.backtrack.slice(r)[0];case(r>0&&r<=this.lookahead.length):return this.lookahead[r-1];default:return null}};Gn.prototype.rangeToText=function(r){if(r instanceof v1)return this.getRangeTokens(r).map(function(e){return e.char}).join("")};Gn.prototype.getText=function(){return this.tokens.map(function(r){return r.char}).join("")};Gn.prototype.getContext=function(r){var e=this.registeredContexts[r];return e||null};Gn.prototype.on=function(r,e){var t=this.events[r];return t?t.subscribe(e):null};Gn.prototype.dispatch=function(r,e){var t=this,n=this.events[r];n instanceof Wg&&n.subscribers.forEach(function(i){i.apply(t,e||[])})};Gn.prototype.registerContextChecker=function(r,e,t){if(this.getContext(r))return{FAIL:"context name '"+r+"' is already registered."};if(typeof e!="function")return{FAIL:"missing context start check."};if(typeof t!="function")return{FAIL:"missing context end check."};var n=new p8(r,e,t);return this.registeredContexts[r]=n,this.contextCheckers.push(n),n};Gn.prototype.getRangeTokens=function(r){var e=r.startIndex+r.endOffset;return[].concat(this.tokens.slice(r.startIndex,e))};Gn.prototype.getContextRanges=function(r){var e=this.getContext(r);return e?e.ranges:{FAIL:"context checker '"+r+"' is not registered."}};Gn.prototype.resetContextsRanges=function(){var r=this.registeredContexts;for(var e in r)if(r.hasOwnProperty(e)){var t=r[e];t.ranges=[]}};Gn.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var r=this.tokens.map(function(n){return n.char}),e=0;e<r.length;e++){var t=new Ra(r,e);this.runContextCheck(t)}this.dispatch("updateContextsRanges",[this.registeredContexts])};Gn.prototype.setEndOffset=function(r,e){var t=this.getContext(e).openRange.startIndex,n=new v1(t,r,e),i=this.getContext(e).ranges;return n.rangeId=e+"."+i.length,i.push(n),this.getContext(e).openRange=null,n};Gn.prototype.runContextCheck=function(r){var e=this,t=r.index;this.contextCheckers.forEach(function(n){var i=n.contextName,a=e.getContext(i).openRange;if(!a&&n.checkStart(r)&&(a=new v1(t,null,i),e.getContext(i).openRange=a,e.dispatch("contextStart",[i,t])),a&&n.checkEnd(r)){var s=t-a.startIndex+1,o=e.setEndOffset(s,i);e.dispatch("contextEnd",[i,o])}})};Gn.prototype.tokenize=function(r){this.tokens=[],this.resetContextsRanges();var e=Array.from(r);this.dispatch("start");for(var t=0;t<e.length;t++){var n=e[t],i=new Ra(e,t);this.dispatch("next",[i]),this.runContextCheck(i);var a=new mc(n);this.tokens.push(a),this.dispatch("newToken",[a,i])}return this.dispatch("end",[this.tokens]),this.tokens};function vo(r){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(r)}function PF(r){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(r)}function Fo(r){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(r)}function jp(r){return/[A-z]/.test(r)}function m8(r){return/\s/.test(r)}function aa(r){this.font=r,this.features={}}function vl(r){this.id=r.id,this.tag=r.tag,this.substitution=r.substitution}function Wf(r,e){if(!r)return-1;switch(e.format){case 1:return e.glyphs.indexOf(r);case 2:for(var t=e.ranges,n=0;n<t.length;n++){var i=t[n];if(r>=i.start&&r<=i.end){var a=r-i.start;return i.index+a}}break;default:return-1}return-1}function v8(r,e){var t=Wf(r,e.coverage);return t===-1?null:r+e.deltaGlyphId}function y8(r,e){var t=Wf(r,e.coverage);return t===-1?null:e.substitute[t]}function M0(r,e){for(var t=[],n=0;n<r.length;n++){var i=r[n],a=e.current;a=Array.isArray(a)?a[0]:a;var s=Wf(a,i);s!==-1&&t.push(s)}return t.length!==r.length?-1:t}function A8(r,e){var t=e.inputCoverage.length+e.lookaheadCoverage.length+e.backtrackCoverage.length;if(r.context.length<t)return[];var n=M0(e.inputCoverage,r);if(n===-1)return[];var i=e.inputCoverage.length-1;if(r.lookahead.length<e.lookaheadCoverage.length)return[];for(var a=r.lookahead.slice(i);a.length&&Fo(a[0].char);)a.shift();var s=new Ra(a,0),o=M0(e.lookaheadCoverage,s),l=[].concat(r.backtrack);for(l.reverse();l.length&&Fo(l[0].char);)l.shift();if(l.length<e.backtrackCoverage.length)return[];var u=new Ra(l,0),c=M0(e.backtrackCoverage,u),f=n.length===e.inputCoverage.length&&o.length===e.lookaheadCoverage.length&&c.length===e.backtrackCoverage.length,d=[];if(f)for(var h=0;h<e.lookupRecords.length;h++)for(var g=e.lookupRecords[h],v=g.lookupListIndex,y=this.getLookupByIndex(v),A=0;A<y.subtables.length;A++){var C=y.subtables[A],S=this.getLookupMethod(y,C),F=this.getSubstitutionType(y,C);if(F==="12")for(var E=0;E<n.length;E++){var R=r.get(E),B=S(R);B&&d.push(B)}}return d}function w8(r,e){var t=r.current,n=Wf(t,e.coverage);if(n===-1)return null;for(var i,a=e.ligatureSets[n],s=0;s<a.length;s++){i=a[s];for(var o=0;o<i.components.length;o++){var l=r.lookahead[o],u=i.components[o];if(l!==u)break;if(o===i.components.length-1)return i}}return null}function b8(r,e){var t=Wf(r,e.coverage);return t===-1?null:e.sequences[t]}aa.prototype.getDefaultScriptFeaturesIndexes=function(){for(var r=this.font.tables.gsub.scripts,e=0;e<r.length;e++){var t=r[e];if(t.tag==="DFLT")return t.script.defaultLangSys.featureIndexes}return[]};aa.prototype.getScriptFeaturesIndexes=function(r){var e=this.font.tables;if(!e.gsub)return[];if(!r)return this.getDefaultScriptFeaturesIndexes();for(var t=this.font.tables.gsub.scripts,n=0;n<t.length;n++){var i=t[n];if(i.tag===r&&i.script.defaultLangSys)return i.script.defaultLangSys.featureIndexes;var a=i.langSysRecords;if(a)for(var s=0;s<a.length;s++){var o=a[s];if(o.tag===r){var l=o.langSys;return l.featureIndexes}}}return this.getDefaultScriptFeaturesIndexes()};aa.prototype.mapTagsToFeatures=function(r,e){for(var t={},n=0;n<r.length;n++){var i=r[n].tag,a=r[n].feature;t[i]=a}this.features[e].tags=t};aa.prototype.getScriptFeatures=function(r){var e=this.features[r];if(this.features.hasOwnProperty(r))return e;var t=this.getScriptFeaturesIndexes(r);if(!t)return null;var n=this.font.tables.gsub;return e=t.map(function(i){return n.features[i]}),this.features[r]=e,this.mapTagsToFeatures(e,r),e};aa.prototype.getSubstitutionType=function(r,e){var t=r.lookupType.toString(),n=e.substFormat.toString();return t+n};aa.prototype.getLookupMethod=function(r,e){var t=this,n=this.getSubstitutionType(r,e);switch(n){case"11":return function(i){return v8.apply(t,[i,e])};case"12":return function(i){return y8.apply(t,[i,e])};case"63":return function(i){return A8.apply(t,[i,e])};case"41":return function(i){return w8.apply(t,[i,e])};case"21":return function(i){return b8.apply(t,[i,e])};default:throw new Error("lookupType: "+r.lookupType+" - substFormat: "+e.substFormat+" is not yet supported")}};aa.prototype.lookupFeature=function(r){var e=r.contextParams,t=e.index,n=this.getFeature({tag:r.tag,script:r.script});if(!n)return new Error("font '"+this.font.names.fullName.en+"' doesn't support feature '"+r.tag+"' for script '"+r.script+"'.");for(var i=this.getFeatureLookups(n),a=[].concat(e.context),s=0;s<i.length;s++)for(var o=i[s],l=this.getLookupSubtables(o),u=0;u<l.length;u++){var c=l[u],f=this.getSubstitutionType(o,c),d=this.getLookupMethod(o,c),h=void 0;switch(f){case"11":h=d(e.current),h&&a.splice(t,1,new vl({id:11,tag:r.tag,substitution:h}));break;case"12":h=d(e.current),h&&a.splice(t,1,new vl({id:12,tag:r.tag,substitution:h}));break;case"63":h=d(e),Array.isArray(h)&&h.length&&a.splice(t,1,new vl({id:63,tag:r.tag,substitution:h}));break;case"41":h=d(e),h&&a.splice(t,1,new vl({id:41,tag:r.tag,substitution:h}));break;case"21":h=d(e.current),h&&a.splice(t,1,new vl({id:21,tag:r.tag,substitution:h}));break}e=new Ra(a,t),!(Array.isArray(h)&&!h.length)&&(h=null)}return a.length?a:null};aa.prototype.supports=function(r){if(!r.script)return!1;this.getScriptFeatures(r.script);var e=this.features.hasOwnProperty(r.script);if(!r.tag)return e;var t=this.features[r.script].some(function(n){return n.tag===r.tag});return e&&t};aa.prototype.getLookupSubtables=function(r){return r.subtables||null};aa.prototype.getLookupByIndex=function(r){var e=this.font.tables.gsub.lookups;return e[r]||null};aa.prototype.getFeatureLookups=function(r){return r.lookupListIndexes.map(this.getLookupByIndex.bind(this))};aa.prototype.getFeature=function(e){if(!this.font)return{FAIL:"No font was found"};this.features.hasOwnProperty(e.script)||this.getScriptFeatures(e.script);var t=this.features[e.script];return t?t.tags[e.tag]?this.features[e.script].tags[e.tag]:null:{FAIL:"No feature for script "+e.script}};function C8(r){var e=r.current,t=r.get(-1);return t===null&&vo(e)||!vo(t)&&vo(e)}function x8(r){var e=r.get(1);return e===null||!vo(e)}var S8={startCheck:C8,endCheck:x8};function E8(r){var e=r.current,t=r.get(-1);return(vo(e)||Fo(e))&&!vo(t)}function k8(r){var e=r.get(1);switch(!0){case e===null:return!0;case(!vo(e)&&!Fo(e)):var t=m8(e);if(!t)return!0;if(t){var n=!1;if(n=r.lookahead.some(function(i){return vo(i)||Fo(i)}),!n)return!0}break;default:return!1}}var T8={startCheck:E8,endCheck:k8};function F8(r,e,t){e[t].setState(r.tag,r.substitution)}function I8(r,e,t){e[t].setState(r.tag,r.substitution)}function P8(r,e,t){r.substitution.forEach(function(n,i){var a=e[t+i];a.setState(r.tag,n)})}function D8(r,e,t){var n=e[t];n.setState(r.tag,r.substitution.ligGlyph);for(var i=r.substitution.components.length,a=0;a<i;a++)n=e[t+a+1],n.setState("deleted",!0)}var Nx={11:F8,12:I8,63:P8,41:D8};function y1(r,e,t){r instanceof vl&&Nx[r.id]&&Nx[r.id](r,e,t)}function R8(r){for(var e=[].concat(r.backtrack),t=e.length-1;t>=0;t--){var n=e[t],i=PF(n),a=Fo(n);if(!i&&!a)return!0;if(i)return!1}return!1}function O8(r){if(PF(r.current))return!1;for(var e=0;e<r.lookahead.length;e++){var t=r.lookahead[e],n=Fo(t);if(!n)return!0}return!1}function B8(r){var e=this,t="arab",n=this.featuresTags[t],i=this.tokenizer.getRangeTokens(r);if(i.length!==1){var a=new Ra(i.map(function(o){return o.getState("glyphIndex")}),0),s=new Ra(i.map(function(o){return o.char}),0);i.forEach(function(o,l){if(!Fo(o.char)){a.setCurrentIndex(l),s.setCurrentIndex(l);var u=0;R8(s)&&(u|=1),O8(s)&&(u|=2);var c;switch(u){case 1:c="fina";break;case 2:c="init";break;case 3:c="medi";break}if(n.indexOf(c)!==-1){var f=e.query.lookupFeature({tag:c,script:t,contextParams:a});if(f instanceof Error)return console.info(f.message);f.forEach(function(d,h){d instanceof vl&&(y1(d,i,h),a.context[h]=d.substitution)})}}})}}function Lx(r,e){var t=r.map(function(n){return n.activeState.value});return new Ra(t,0)}function M8(r){var e=this,t="arab",n=this.tokenizer.getRangeTokens(r),i=Lx(n);i.context.forEach(function(a,s){i.setCurrentIndex(s);var o=e.query.lookupFeature({tag:"rlig",script:t,contextParams:i});o.length&&(o.forEach(function(l){return y1(l,n,s)}),i=Lx(n))})}function _8(r){var e=r.current,t=r.get(-1);return t===null&&jp(e)||!jp(t)&&jp(e)}function N8(r){var e=r.get(1);return e===null||!jp(e)}var L8={startCheck:_8,endCheck:N8};function Ux(r,e){var t=r.map(function(n){return n.activeState.value});return new Ra(t,0)}function U8(r){var e=this,t="latn",n=this.tokenizer.getRangeTokens(r),i=Ux(n);i.context.forEach(function(a,s){i.setCurrentIndex(s);var o=e.query.lookupFeature({tag:"liga",script:t,contextParams:i});o.length&&(o.forEach(function(l){return y1(l,n,s)}),i=Ux(n))})}function La(r){this.baseDir=r||"ltr",this.tokenizer=new Gn,this.featuresTags={}}La.prototype.setText=function(r){this.text=r};La.prototype.contextChecks={latinWordCheck:L8,arabicWordCheck:S8,arabicSentenceCheck:T8};function _0(r){var e=this.contextChecks[r+"Check"];return this.tokenizer.registerContextChecker(r,e.startCheck,e.endCheck)}function V8(){return _0.call(this,"latinWord"),_0.call(this,"arabicWord"),_0.call(this,"arabicSentence"),this.tokenizer.tokenize(this.text)}function z8(){var r=this,e=this.tokenizer.getContextRanges("arabicSentence");e.forEach(function(t){var n=r.tokenizer.getRangeTokens(t);r.tokenizer.replaceRange(t.startIndex,t.endOffset,n.reverse())})}La.prototype.registerFeatures=function(r,e){var t=this,n=e.filter(function(i){return t.query.supports({script:r,tag:i})});this.featuresTags.hasOwnProperty(r)?this.featuresTags[r]=this.featuresTags[r].concat(n):this.featuresTags[r]=n};La.prototype.applyFeatures=function(r,e){if(!r)throw new Error("No valid font was provided to apply features");this.query||(this.query=new aa(r));for(var t=0;t<e.length;t++){var n=e[t];this.query.supports({script:n.script})&&this.registerFeatures(n.script,n.tags)}};La.prototype.registerModifier=function(r,e,t){this.tokenizer.registerModifier(r,e,t)};function A1(){if(this.tokenizer.registeredModifiers.indexOf("glyphIndex")===-1)throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function $8(){var r=this,e="arab";if(this.featuresTags.hasOwnProperty(e)){A1.call(this);var t=this.tokenizer.getContextRanges("arabicWord");t.forEach(function(n){B8.call(r,n)})}}function H8(){var r=this,e="arab";if(this.featuresTags.hasOwnProperty(e)){var t=this.featuresTags[e];if(t.indexOf("rlig")!==-1){A1.call(this);var n=this.tokenizer.getContextRanges("arabicWord");n.forEach(function(i){M8.call(r,i)})}}}function G8(){var r=this,e="latn";if(this.featuresTags.hasOwnProperty(e)){var t=this.featuresTags[e];if(t.indexOf("liga")!==-1){A1.call(this);var n=this.tokenizer.getContextRanges("latinWord");n.forEach(function(i){U8.call(r,i)})}}}La.prototype.checkContextReady=function(r){return!!this.tokenizer.getContext(r)};La.prototype.applyFeaturesToContexts=function(){this.checkContextReady("arabicWord")&&($8.call(this),H8.call(this)),this.checkContextReady("latinWord")&&G8.call(this),this.checkContextReady("arabicSentence")&&z8.call(this)};La.prototype.processText=function(r){(!this.text||this.text!==r)&&(this.setText(r),V8.call(this),this.applyFeaturesToContexts())};La.prototype.getBidiText=function(r){return this.processText(r),this.tokenizer.getText()};La.prototype.getTextGlyphs=function(r){this.processText(r);for(var e=[],t=0;t<this.tokenizer.tokens.length;t++){var n=this.tokenizer.tokens[t];if(!n.state.deleted){var i=n.activeState.value;e.push(Array.isArray(i)?i[0]:i)}}return e};function hn(r){r=r||{},r.tables=r.tables||{},r.empty||(pd(r.familyName,"When creating a new Font object, familyName is required."),pd(r.styleName,"When creating a new Font object, styleName is required."),pd(r.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),pd(r.ascender,"When creating a new Font object, ascender is required."),pd(r.descender<=0,"When creating a new Font object, negative descender value is required."),this.names={fontFamily:{en:r.familyName||" "},fontSubfamily:{en:r.styleName||" "},fullName:{en:r.fullName||r.familyName+" "+r.styleName},postScriptName:{en:r.postScriptName||(r.familyName+r.styleName).replace(/\s/g,"")},designer:{en:r.designer||" "},designerURL:{en:r.designerURL||" "},manufacturer:{en:r.manufacturer||" "},manufacturerURL:{en:r.manufacturerURL||" "},license:{en:r.license||" "},licenseURL:{en:r.licenseURL||" "},version:{en:r.version||"Version 0.1"},description:{en:r.description||" "},copyright:{en:r.copyright||" "},trademark:{en:r.trademark||" "}},this.unitsPerEm=r.unitsPerEm||1e3,this.ascender=r.ascender,this.descender=r.descender,this.createdTimestamp=r.createdTimestamp,this.tables=Object.assign(r.tables,{os2:Object.assign({usWeightClass:r.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:r.widthClass||this.usWidthClasses.MEDIUM,fsSelection:r.fsSelection||this.fsSelectionValues.REGULAR},r.tables.os2)})),this.supported=!0,this.glyphs=new os.GlyphSet(this,r.glyphs||[]),this.encoding=new YT(this),this.position=new Gf(this),this.substitution=new ia(this),this.tables=this.tables||{},this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){if(this._hinting)return this._hinting;if(this.outlinesFormat==="truetype")return this._hinting=new kF(this)}})}hn.prototype.hasChar=function(r){return this.encoding.charToGlyphIndex(r)!==null};hn.prototype.charToGlyphIndex=function(r){return this.encoding.charToGlyphIndex(r)};hn.prototype.charToGlyph=function(r){var e=this.charToGlyphIndex(r),t=this.glyphs.get(e);return t||(t=this.glyphs.get(0)),t};hn.prototype.updateFeatures=function(r){return this.defaultRenderOptions.features.map(function(e){return e.script==="latn"?{script:"latn",tags:e.tags.filter(function(t){return r[t]})}:e})};hn.prototype.stringToGlyphs=function(r,e){var t=this,n=new La,i=function(f){return t.charToGlyphIndex(f.char)};n.registerModifier("glyphIndex",null,i);var a=e?this.updateFeatures(e.features):this.defaultRenderOptions.features;n.applyFeatures(this,a);for(var s=n.getTextGlyphs(r),o=s.length,l=new Array(o),u=this.glyphs.get(0),c=0;c<o;c+=1)l[c]=this.glyphs.get(s[c])||u;return l};hn.prototype.nameToGlyphIndex=function(r){return this.glyphNames.nameToGlyphIndex(r)};hn.prototype.nameToGlyph=function(r){var e=this.nameToGlyphIndex(r),t=this.glyphs.get(e);return t||(t=this.glyphs.get(0)),t};hn.prototype.glyphIndexToName=function(r){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(r):""};hn.prototype.getKerningValue=function(r,e){r=r.index||r,e=e.index||e;var t=this.position.defaultKerningTables;return t?this.position.getKerningValue(t,r,e):this.kerningPairs[r+","+e]||0};hn.prototype.defaultRenderOptions={kerning:!0,features:[{script:"arab",tags:["init","medi","fina","rlig"]},{script:"latn",tags:["liga","rlig"]}]};hn.prototype.forEachGlyph=function(r,e,t,n,i,a){e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:72,i=Object.assign({},this.defaultRenderOptions,i);var s=1/this.unitsPerEm*n,o=this.stringToGlyphs(r,i),l;if(i.kerning){var u=i.script||this.position.getDefaultScriptName();l=this.position.getKerningTables(u,i.language)}for(var c=0;c<o.length;c+=1){var f=o[c];if(a.call(this,f,e,t,n,i),f.advanceWidth&&(e+=f.advanceWidth*s),i.kerning&&c<o.length-1){var d=l?this.position.getKerningValue(l,f.index,o[c+1].index):this.getKerningValue(f,o[c+1]);e+=d*s}i.letterSpacing?e+=i.letterSpacing*n:i.tracking&&(e+=i.tracking/1e3*n)}return e};hn.prototype.getPath=function(r,e,t,n,i){var a=new fi;return this.forEachGlyph(r,e,t,n,i,function(s,o,l,u){var c=s.getPath(o,l,u,i,this);a.extend(c)}),a};hn.prototype.getPaths=function(r,e,t,n,i){var a=[];return this.forEachGlyph(r,e,t,n,i,function(s,o,l,u){var c=s.getPath(o,l,u,i,this);a.push(c)}),a};hn.prototype.getAdvanceWidth=function(r,e,t){return this.forEachGlyph(r,0,0,e,t,function(){})};hn.prototype.draw=function(r,e,t,n,i,a){this.getPath(e,t,n,i,a).draw(r)};hn.prototype.drawPoints=function(r,e,t,n,i,a){this.forEachGlyph(e,t,n,i,a,function(s,o,l,u){s.drawPoints(r,o,l,u)})};hn.prototype.drawMetrics=function(r,e,t,n,i,a){this.forEachGlyph(e,t,n,i,a,function(s,o,l,u){s.drawMetrics(r,o,l,u)})};hn.prototype.getEnglishName=function(r){var e=this.names[r];if(e)return e.en};hn.prototype.validate=function(){var r=this;function e(n,i){}function t(n){var i=r.getEnglishName(n);i&&i.trim().length>0}t("fontFamily"),t("weightName"),t("manufacturer"),t("copyright"),t("version"),this.unitsPerEm>0};hn.prototype.toTables=function(){return DN.fontToTable(this)};hn.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()};hn.prototype.toArrayBuffer=function(){for(var r=this.toTables(),e=r.encode(),t=new ArrayBuffer(e.length),n=new Uint8Array(t),i=0;i<e.length;i++)n[i]=e[i];return t};hn.prototype.download=function(r){var e=this.getEnglishName("fontFamily"),t=this.getEnglishName("fontSubfamily");r=r||e.replace(/\s/g,"")+"-"+t+".otf";var n=this.toArrayBuffer();if(ON())if(window.URL=window.URL||window.webkitURL,window.URL){var i=new DataView(n),a=new Blob([i],{type:"font/opentype"}),s=document.createElement("a");s.href=window.URL.createObjectURL(a),s.download=r;var o=document.createEvent("MouseEvents");o.initEvent("click",!0,!1),s.dispatchEvent(o)}else console.warn("Font file could not be downloaded. Try using a different browser.");else{var l=require("fs"),u=BN(n);l.writeFileSync(r,u)}};hn.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512};hn.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9};hn.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};function DF(r,e){var t=JSON.stringify(r),n=256;for(var i in e){var a=parseInt(i);if(!(!a||a<256)){if(JSON.stringify(e[i])===t)return a;n<=a&&(n=a+1)}}return e[n]=r,n}function j8(r,e,t){var n=DF(e.name,t);return[{name:"tag_"+r,type:"TAG",value:e.tag},{name:"minValue_"+r,type:"FIXED",value:e.minValue<<16},{name:"defaultValue_"+r,type:"FIXED",value:e.defaultValue<<16},{name:"maxValue_"+r,type:"FIXED",value:e.maxValue<<16},{name:"flags_"+r,type:"USHORT",value:0},{name:"nameID_"+r,type:"USHORT",value:n}]}function q8(r,e,t){var n={},i=new vt.Parser(r,e);return n.tag=i.parseTag(),n.minValue=i.parseFixed(),n.defaultValue=i.parseFixed(),n.maxValue=i.parseFixed(),i.skip("uShort",1),n.name=t[i.parseUShort()]||{},n}function W8(r,e,t,n){for(var i=DF(e.name,n),a=[{name:"nameID_"+r,type:"USHORT",value:i},{name:"flags_"+r,type:"USHORT",value:0}],s=0;s<t.length;++s){var o=t[s].tag;a.push({name:"axis_"+r+" "+o,type:"FIXED",value:e.coordinates[o]<<16})}return a}function Q8(r,e,t,n){var i={},a=new vt.Parser(r,e);i.name=n[a.parseUShort()]||{},a.skip("uShort",1),i.coordinates={};for(var s=0;s<t.length;++s)i.coordinates[t[s].tag]=a.parseFixed();return i}function Y8(r,e){var t=new dt.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:r.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:r.instances.length},{name:"instanceSize",type:"USHORT",value:4+r.axes.length*4}]);t.offsetToData=t.sizeOf();for(var n=0;n<r.axes.length;n++)t.fields=t.fields.concat(j8(n,r.axes[n],e));for(var i=0;i<r.instances.length;i++)t.fields=t.fields.concat(W8(i,r.instances[i],r.axes,e));return t}function X8(r,e,t){var n=new vt.Parser(r,e),i=n.parseULong();Gt.argument(i===65536,"Unsupported fvar table version.");var a=n.parseOffset16();n.skip("uShort",1);for(var s=n.parseUShort(),o=n.parseUShort(),l=n.parseUShort(),u=n.parseUShort(),c=[],f=0;f<s;f++)c.push(q8(r,e+a+f*o,t));for(var d=[],h=e+a+s*o,g=0;g<l;g++)d.push(Q8(r,h+g*u,c,t));return{axes:c,instances:d}}var J8={make:Y8,parse:X8},K8=function(){return{coverage:this.parsePointer(be.coverage),attachPoints:this.parseList(be.pointer(be.uShortList))}},Z8=function(){var r=this.parseUShort();if(Gt.argument(r===1||r===2||r===3,"Unsupported CaretValue table version."),r===1)return{coordinate:this.parseShort()};if(r===2)return{pointindex:this.parseShort()};if(r===3)return{coordinate:this.parseShort()}},e7=function(){return this.parseList(be.pointer(Z8))},t7=function(){return{coverage:this.parsePointer(be.coverage),ligGlyphs:this.parseList(be.pointer(e7))}},r7=function(){return this.parseUShort(),this.parseList(be.pointer(be.coverage))};function n7(r,e){e=e||0;var t=new be(r,e),n=t.parseVersion(1);Gt.argument(n===1||n===1.2||n===1.3,"Unsupported GDEF table version.");var i={version:n,classDef:t.parsePointer(be.classDef),attachList:t.parsePointer(K8),ligCaretList:t.parsePointer(t7),markAttachClassDef:t.parsePointer(be.classDef)};return n>=1.2&&(i.markGlyphSets=t.parsePointer(r7)),i}var i7={parse:n7},Oa=new Array(10);Oa[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{posFormat:1,coverage:this.parsePointer(be.coverage),value:this.parseValueRecord()};if(t===2)return{posFormat:2,coverage:this.parsePointer(be.coverage),values:this.parseValueRecordList()};Gt.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")};Oa[2]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();Gt.assert(t===1||t===2,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var n=this.parsePointer(be.coverage),i=this.parseUShort(),a=this.parseUShort();if(t===1)return{posFormat:t,coverage:n,valueFormat1:i,valueFormat2:a,pairSets:this.parseList(be.pointer(be.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(i),value2:this.parseValueRecord(a)}})))};if(t===2){var s=this.parsePointer(be.classDef),o=this.parsePointer(be.classDef),l=this.parseUShort(),u=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:i,valueFormat2:a,classDef1:s,classDef2:o,class1Count:l,class2Count:u,classRecords:this.parseList(l,be.list(u,function(){return{value1:this.parseValueRecord(i),value2:this.parseValueRecord(a)}}))}}};Oa[3]=function(){return{error:"GPOS Lookup 3 not supported"}};Oa[4]=function(){return{error:"GPOS Lookup 4 not supported"}};Oa[5]=function(){return{error:"GPOS Lookup 5 not supported"}};Oa[6]=function(){return{error:"GPOS Lookup 6 not supported"}};Oa[7]=function(){return{error:"GPOS Lookup 7 not supported"}};Oa[8]=function(){return{error:"GPOS Lookup 8 not supported"}};Oa[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function a7(r,e){e=e||0;var t=new be(r,e),n=t.parseVersion(1);return Gt.argument(n===1||n===1.1,"Unsupported GPOS table version "+n),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(Oa)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(Oa),variations:t.parseFeatureVariationsList()}}var s7=new Array(10);function o7(r){return new dt.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new dt.ScriptList(r.scripts)},{name:"features",type:"TABLE",value:new dt.FeatureList(r.features)},{name:"lookups",type:"TABLE",value:new dt.LookupList(r.lookups,s7)}])}var l7={parse:a7,make:o7};function u7(r){var e={};r.skip("uShort");var t=r.parseUShort();Gt.argument(t===0,"Unsupported kern sub-table version."),r.skip("uShort",2);var n=r.parseUShort();r.skip("uShort",3);for(var i=0;i<n;i+=1){var a=r.parseUShort(),s=r.parseUShort(),o=r.parseShort();e[a+","+s]=o}return e}function c7(r){var e={};r.skip("uShort");var t=r.parseULong();t>1&&console.warn("Only the first kern subtable is supported."),r.skip("uLong");var n=r.parseUShort(),i=n&255;if(r.skip("uShort"),i===0){var a=r.parseUShort();r.skip("uShort",3);for(var s=0;s<a;s+=1){var o=r.parseUShort(),l=r.parseUShort(),u=r.parseShort();e[o+","+l]=u}}return e}function d7(r,e){var t=new vt.Parser(r,e),n=t.parseUShort();if(n===0)return u7(t);if(n===1)return c7(t);throw new Error("Unsupported kern table version ("+n+").")}var f7={parse:d7};function h7(r,e,t,n){for(var i=new vt.Parser(r,e),a=n?i.parseUShort:i.parseULong,s=[],o=0;o<t+1;o+=1){var l=a.call(i);n&&(l*=2),s.push(l)}return s}var p7={parse:h7};function Vx(r,e){for(var t=[],n=12,i=0;i<e;i+=1){var a=vt.getTag(r,n),s=vt.getULong(r,n+4),o=vt.getULong(r,n+8),l=vt.getULong(r,n+12);t.push({tag:a,checksum:s,offset:o,length:l,compression:!1}),n+=16}return t}function g7(r,e){for(var t=[],n=44,i=0;i<e;i+=1){var a=vt.getTag(r,n),s=vt.getULong(r,n+4),o=vt.getULong(r,n+8),l=vt.getULong(r,n+12),u=void 0;o<l?u="WOFF":u=!1,t.push({tag:a,offset:s,compression:u,compressedLength:o,length:l}),n+=20}return t}function Qn(r,e){if(e.compression==="WOFF"){var t=new Uint8Array(r.buffer,e.offset+2,e.compressedLength-2),n=new Uint8Array(e.length);if(l5(t,n),n.byteLength!==e.length)throw new Error("Decompression error: "+e.tag+" decompressed length doesn't match recorded length");var i=new DataView(n.buffer,0);return{data:i,offset:0}}else return{data:r,offset:e.offset}}function nA(r,e){e=e??{};var t,n,i=new hn({empty:!0}),a=new DataView(r,0),s,o=[],l=vt.getTag(a,0);if(l==="\0\0\0"||l==="true"||l==="typ1")i.outlinesFormat="truetype",s=vt.getUShort(a,4),o=Vx(a,s);else if(l==="OTTO")i.outlinesFormat="cff",s=vt.getUShort(a,4),o=Vx(a,s);else if(l==="wOFF"){var u=vt.getTag(a,4);if(u==="\0\0\0")i.outlinesFormat="truetype";else if(u==="OTTO")i.outlinesFormat="cff";else throw new Error("Unsupported OpenType flavor "+l);s=vt.getUShort(a,12),o=g7(a,s)}else throw new Error("Unsupported OpenType signature "+l);for(var c,f,d,h,g,v,y,A,C,S,F,E,R=0;R<s;R+=1){var B=o[R],G=void 0;switch(B.tag){case"cmap":G=Qn(a,B),i.tables.cmap=QT.parse(G.data,G.offset),i.encoding=new XT(i.tables.cmap);break;case"cvt ":G=Qn(a,B),E=new vt.Parser(G.data,G.offset),i.tables.cvt=E.parseShortList(B.length/2);break;case"fvar":f=B;break;case"fpgm":G=Qn(a,B),E=new vt.Parser(G.data,G.offset),i.tables.fpgm=E.parseByteList(B.length);break;case"head":G=Qn(a,B),i.tables.head=sF.parse(G.data,G.offset),i.unitsPerEm=i.tables.head.unitsPerEm,t=i.tables.head.indexToLocFormat;break;case"hhea":G=Qn(a,B),i.tables.hhea=oF.parse(G.data,G.offset),i.ascender=i.tables.hhea.ascender,i.descender=i.tables.hhea.descender,i.numberOfHMetrics=i.tables.hhea.numberOfHMetrics;break;case"hmtx":y=B;break;case"ltag":G=Qn(a,B),n=uF.parse(G.data,G.offset);break;case"maxp":G=Qn(a,B),i.tables.maxp=cF.parse(G.data,G.offset),i.numGlyphs=i.tables.maxp.numGlyphs;break;case"name":S=B;break;case"OS/2":G=Qn(a,B),i.tables.os2=tA.parse(G.data,G.offset);break;case"post":G=Qn(a,B),i.tables.post=mF.parse(G.data,G.offset),i.glyphNames=new h1(i.tables.post);break;case"prep":G=Qn(a,B),E=new vt.Parser(G.data,G.offset),i.tables.prep=E.parseByteList(B.length);break;case"glyf":d=B;break;case"loca":C=B;break;case"CFF ":c=B;break;case"kern":A=B;break;case"GDEF":h=B;break;case"GPOS":g=B;break;case"GSUB":v=B;break;case"meta":F=B;break}}var j=Qn(a,S);if(i.tables.name=gF.parse(j.data,j.offset,n),i.names=i.tables.name,d&&C){var ie=t===0,q=Qn(a,C),Y=p7.parse(q.data,q.offset,i.numGlyphs,ie),J=Qn(a,d);i.glyphs=xF.parse(J.data,J.offset,Y,i,e)}else if(c){var ae=Qn(a,c);aF.parse(ae.data,ae.offset,i,e)}else throw new Error("Font doesn't contain TrueType or CFF outlines.");var oe=Qn(a,y);if(lF.parse(i,oe.data,oe.offset,i.numberOfHMetrics,i.numGlyphs,i.glyphs,e),I5(i,e),A){var he=Qn(a,A);i.kerningPairs=f7.parse(he.data,he.offset)}else i.kerningPairs={};if(h){var ye=Qn(a,h);i.tables.gdef=i7.parse(ye.data,ye.offset)}if(g){var Ue=Qn(a,g);i.tables.gpos=l7.parse(Ue.data,Ue.offset),i.position.init()}if(v){var Re=Qn(a,v);i.tables.gsub=vF.parse(Re.data,Re.offset)}if(f){var Oe=Qn(a,f);i.tables.fvar=J8.parse(Oe.data,Oe.offset,i.names)}if(F){var ee=Qn(a,F);i.tables.meta=yF.parse(ee.data,ee.offset),i.metas=i.tables.meta}return i}var Mu=function(){return Mu=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Mu.apply(this,arguments)},m7="~",v7="~~";function w1(r,e){for(var t={},n={},i=r.split(v7),a=!1,s=0;i.length>s;s++){for(var o=i[s].split(m7),l=0;l<o.length;l+=2){var u=o[l],c=o[l+1],f="&"+u+";";t[f]=c,a&&(t["&"+u]=c),n[c]=f}a=!0}return e?{entities:Mu(Mu({},t),e.entities),characters:Mu(Mu({},n),e.characters)}:{entities:t,characters:n}}var N0={xml:/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html4:/&notin;|&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html5:/&centerdot;|&copysr;|&divideontimes;|&gtcc;|&gtcir;|&gtdot;|&gtlPar;|&gtquest;|&gtrapprox;|&gtrarr;|&gtrdot;|&gtreqless;|&gtreqqless;|&gtrless;|&gtrsim;|&ltcc;|&ltcir;|&ltdot;|&lthree;|&ltimes;|&ltlarr;|&ltquest;|&ltrPar;|&ltri;|&ltrie;|&ltrif;|&notin;|&notinE;|&notindot;|&notinva;|&notinvb;|&notinvc;|&notni;|&notniva;|&notnivb;|&notnivc;|&parallel;|&timesb;|&timesbar;|&timesd;|&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g},ic={};ic.xml=w1(`lt~<~gt~>~quot~"~apos~'~amp~&`);ic.html4=w1(`apos~'~OElig~Œ~oelig~œ~Scaron~Š~scaron~š~Yuml~Ÿ~circ~ˆ~tilde~˜~ensp~ ~emsp~ ~thinsp~ ~zwnj~‌~zwj~‍~lrm~‎~rlm~‏~ndash~–~mdash~—~lsquo~‘~rsquo~’~sbquo~‚~ldquo~“~rdquo~”~bdquo~„~dagger~†~Dagger~‡~permil~‰~lsaquo~‹~rsaquo~›~euro~€~fnof~ƒ~Alpha~Α~Beta~Β~Gamma~Γ~Delta~Δ~Epsilon~Ε~Zeta~Ζ~Eta~Η~Theta~Θ~Iota~Ι~Kappa~Κ~Lambda~Λ~Mu~Μ~Nu~Ν~Xi~Ξ~Omicron~Ο~Pi~Π~Rho~Ρ~Sigma~Σ~Tau~Τ~Upsilon~Υ~Phi~Φ~Chi~Χ~Psi~Ψ~Omega~Ω~alpha~α~beta~β~gamma~γ~delta~δ~epsilon~ε~zeta~ζ~eta~η~theta~θ~iota~ι~kappa~κ~lambda~λ~mu~μ~nu~ν~xi~ξ~omicron~ο~pi~π~rho~ρ~sigmaf~ς~sigma~σ~tau~τ~upsilon~υ~phi~φ~chi~χ~psi~ψ~omega~ω~thetasym~ϑ~upsih~ϒ~piv~ϖ~bull~•~hellip~…~prime~′~Prime~″~oline~‾~frasl~⁄~weierp~℘~image~ℑ~real~ℜ~trade~™~alefsym~ℵ~larr~←~uarr~↑~rarr~→~darr~↓~harr~↔~crarr~↵~lArr~⇐~uArr~⇑~rArr~⇒~dArr~⇓~hArr~⇔~forall~∀~part~∂~exist~∃~empty~∅~nabla~∇~isin~∈~notin~∉~ni~∋~prod~∏~sum~∑~minus~−~lowast~∗~radic~√~prop~∝~infin~∞~ang~∠~and~∧~or~∨~cap~∩~cup~∪~int~∫~there4~∴~sim~∼~cong~≅~asymp~≈~ne~≠~equiv~≡~le~≤~ge~≥~sub~⊂~sup~⊃~nsub~⊄~sube~⊆~supe~⊇~oplus~⊕~otimes~⊗~perp~⊥~sdot~⋅~lceil~⌈~rceil~⌉~lfloor~⌊~rfloor~⌋~lang~〈~rang~〉~loz~◊~spades~♠~clubs~♣~hearts~♥~diams~♦~~nbsp~ ~iexcl~¡~cent~¢~pound~£~curren~¤~yen~¥~brvbar~¦~sect~§~uml~¨~copy~©~ordf~ª~laquo~«~not~¬~shy~­~reg~®~macr~¯~deg~°~plusmn~±~sup2~²~sup3~³~acute~´~micro~µ~para~¶~middot~·~cedil~¸~sup1~¹~ordm~º~raquo~»~frac14~¼~frac12~½~frac34~¾~iquest~¿~Agrave~À~Aacute~Á~Acirc~Â~Atilde~Ã~Auml~Ä~Aring~Å~AElig~Æ~Ccedil~Ç~Egrave~È~Eacute~É~Ecirc~Ê~Euml~Ë~Igrave~Ì~Iacute~Í~Icirc~Î~Iuml~Ï~ETH~Ð~Ntilde~Ñ~Ograve~Ò~Oacute~Ó~Ocirc~Ô~Otilde~Õ~Ouml~Ö~times~×~Oslash~Ø~Ugrave~Ù~Uacute~Ú~Ucirc~Û~Uuml~Ü~Yacute~Ý~THORN~Þ~szlig~ß~agrave~à~aacute~á~acirc~â~atilde~ã~auml~ä~aring~å~aelig~æ~ccedil~ç~egrave~è~eacute~é~ecirc~ê~euml~ë~igrave~ì~iacute~í~icirc~î~iuml~ï~eth~ð~ntilde~ñ~ograve~ò~oacute~ó~ocirc~ô~otilde~õ~ouml~ö~divide~÷~oslash~ø~ugrave~ù~uacute~ú~ucirc~û~uuml~ü~yacute~ý~thorn~þ~yuml~ÿ~quot~"~amp~&~lt~<~gt~>`);ic.html5=w1('Abreve~Ă~Acy~А~Afr~𝔄~Amacr~Ā~And~⩓~Aogon~Ą~Aopf~𝔸~ApplyFunction~⁡~Ascr~𝒜~Assign~≔~Backslash~∖~Barv~⫧~Barwed~⌆~Bcy~Б~Because~∵~Bernoullis~ℬ~Bfr~𝔅~Bopf~𝔹~Breve~˘~Bscr~ℬ~Bumpeq~≎~CHcy~Ч~Cacute~Ć~Cap~⋒~CapitalDifferentialD~ⅅ~Cayleys~ℭ~Ccaron~Č~Ccirc~Ĉ~Cconint~∰~Cdot~Ċ~Cedilla~¸~CenterDot~·~Cfr~ℭ~CircleDot~⊙~CircleMinus~⊖~CirclePlus~⊕~CircleTimes~⊗~ClockwiseContourIntegral~∲~CloseCurlyDoubleQuote~”~CloseCurlyQuote~’~Colon~∷~Colone~⩴~Congruent~≡~Conint~∯~ContourIntegral~∮~Copf~ℂ~Coproduct~∐~CounterClockwiseContourIntegral~∳~Cross~⨯~Cscr~𝒞~Cup~⋓~CupCap~≍~DD~ⅅ~DDotrahd~⤑~DJcy~Ђ~DScy~Ѕ~DZcy~Џ~Darr~↡~Dashv~⫤~Dcaron~Ď~Dcy~Д~Del~∇~Dfr~𝔇~DiacriticalAcute~´~DiacriticalDot~˙~DiacriticalDoubleAcute~˝~DiacriticalGrave~`~DiacriticalTilde~˜~Diamond~⋄~DifferentialD~ⅆ~Dopf~𝔻~Dot~¨~DotDot~⃜~DotEqual~≐~DoubleContourIntegral~∯~DoubleDot~¨~DoubleDownArrow~⇓~DoubleLeftArrow~⇐~DoubleLeftRightArrow~⇔~DoubleLeftTee~⫤~DoubleLongLeftArrow~⟸~DoubleLongLeftRightArrow~⟺~DoubleLongRightArrow~⟹~DoubleRightArrow~⇒~DoubleRightTee~⊨~DoubleUpArrow~⇑~DoubleUpDownArrow~⇕~DoubleVerticalBar~∥~DownArrow~↓~DownArrowBar~⤓~DownArrowUpArrow~⇵~DownBreve~̑~DownLeftRightVector~⥐~DownLeftTeeVector~⥞~DownLeftVector~↽~DownLeftVectorBar~⥖~DownRightTeeVector~⥟~DownRightVector~⇁~DownRightVectorBar~⥗~DownTee~⊤~DownTeeArrow~↧~Downarrow~⇓~Dscr~𝒟~Dstrok~Đ~ENG~Ŋ~Ecaron~Ě~Ecy~Э~Edot~Ė~Efr~𝔈~Element~∈~Emacr~Ē~EmptySmallSquare~◻~EmptyVerySmallSquare~▫~Eogon~Ę~Eopf~𝔼~Equal~⩵~EqualTilde~≂~Equilibrium~⇌~Escr~ℰ~Esim~⩳~Exists~∃~ExponentialE~ⅇ~Fcy~Ф~Ffr~𝔉~FilledSmallSquare~◼~FilledVerySmallSquare~▪~Fopf~𝔽~ForAll~∀~Fouriertrf~ℱ~Fscr~ℱ~GJcy~Ѓ~Gammad~Ϝ~Gbreve~Ğ~Gcedil~Ģ~Gcirc~Ĝ~Gcy~Г~Gdot~Ġ~Gfr~𝔊~Gg~⋙~Gopf~𝔾~GreaterEqual~≥~GreaterEqualLess~⋛~GreaterFullEqual~≧~GreaterGreater~⪢~GreaterLess~≷~GreaterSlantEqual~⩾~GreaterTilde~≳~Gscr~𝒢~Gt~≫~HARDcy~Ъ~Hacek~ˇ~Hat~^~Hcirc~Ĥ~Hfr~ℌ~HilbertSpace~ℋ~Hopf~ℍ~HorizontalLine~─~Hscr~ℋ~Hstrok~Ħ~HumpDownHump~≎~HumpEqual~≏~IEcy~Е~IJlig~IJ~IOcy~Ё~Icy~И~Idot~İ~Ifr~ℑ~Im~ℑ~Imacr~Ī~ImaginaryI~ⅈ~Implies~⇒~Int~∬~Integral~∫~Intersection~⋂~InvisibleComma~⁣~InvisibleTimes~⁢~Iogon~Į~Iopf~𝕀~Iscr~ℐ~Itilde~Ĩ~Iukcy~І~Jcirc~Ĵ~Jcy~Й~Jfr~𝔍~Jopf~𝕁~Jscr~𝒥~Jsercy~Ј~Jukcy~Є~KHcy~Х~KJcy~Ќ~Kcedil~Ķ~Kcy~К~Kfr~𝔎~Kopf~𝕂~Kscr~𝒦~LJcy~Љ~Lacute~Ĺ~Lang~⟪~Laplacetrf~ℒ~Larr~↞~Lcaron~Ľ~Lcedil~Ļ~Lcy~Л~LeftAngleBracket~⟨~LeftArrow~←~LeftArrowBar~⇤~LeftArrowRightArrow~⇆~LeftCeiling~⌈~LeftDoubleBracket~⟦~LeftDownTeeVector~⥡~LeftDownVector~⇃~LeftDownVectorBar~⥙~LeftFloor~⌊~LeftRightArrow~↔~LeftRightVector~⥎~LeftTee~⊣~LeftTeeArrow~↤~LeftTeeVector~⥚~LeftTriangle~⊲~LeftTriangleBar~⧏~LeftTriangleEqual~⊴~LeftUpDownVector~⥑~LeftUpTeeVector~⥠~LeftUpVector~↿~LeftUpVectorBar~⥘~LeftVector~↼~LeftVectorBar~⥒~Leftarrow~⇐~Leftrightarrow~⇔~LessEqualGreater~⋚~LessFullEqual~≦~LessGreater~≶~LessLess~⪡~LessSlantEqual~⩽~LessTilde~≲~Lfr~𝔏~Ll~⋘~Lleftarrow~⇚~Lmidot~Ŀ~LongLeftArrow~⟵~LongLeftRightArrow~⟷~LongRightArrow~⟶~Longleftarrow~⟸~Longleftrightarrow~⟺~Longrightarrow~⟹~Lopf~𝕃~LowerLeftArrow~↙~LowerRightArrow~↘~Lscr~ℒ~Lsh~↰~Lstrok~Ł~Lt~≪~Map~⤅~Mcy~М~MediumSpace~ ~Mellintrf~ℳ~Mfr~𝔐~MinusPlus~∓~Mopf~𝕄~Mscr~ℳ~NJcy~Њ~Nacute~Ń~Ncaron~Ň~Ncedil~Ņ~Ncy~Н~NegativeMediumSpace~​~NegativeThickSpace~​~NegativeThinSpace~​~NegativeVeryThinSpace~​~NestedGreaterGreater~≫~NestedLessLess~≪~NewLine~\n~Nfr~𝔑~NoBreak~⁠~NonBreakingSpace~ ~Nopf~ℕ~Not~⫬~NotCongruent~≢~NotCupCap~≭~NotDoubleVerticalBar~∦~NotElement~∉~NotEqual~≠~NotEqualTilde~≂̸~NotExists~∄~NotGreater~≯~NotGreaterEqual~≱~NotGreaterFullEqual~≧̸~NotGreaterGreater~≫̸~NotGreaterLess~≹~NotGreaterSlantEqual~⩾̸~NotGreaterTilde~≵~NotHumpDownHump~≎̸~NotHumpEqual~≏̸~NotLeftTriangle~⋪~NotLeftTriangleBar~⧏̸~NotLeftTriangleEqual~⋬~NotLess~≮~NotLessEqual~≰~NotLessGreater~≸~NotLessLess~≪̸~NotLessSlantEqual~⩽̸~NotLessTilde~≴~NotNestedGreaterGreater~⪢̸~NotNestedLessLess~⪡̸~NotPrecedes~⊀~NotPrecedesEqual~⪯̸~NotPrecedesSlantEqual~⋠~NotReverseElement~∌~NotRightTriangle~⋫~NotRightTriangleBar~⧐̸~NotRightTriangleEqual~⋭~NotSquareSubset~⊏̸~NotSquareSubsetEqual~⋢~NotSquareSuperset~⊐̸~NotSquareSupersetEqual~⋣~NotSubset~⊂⃒~NotSubsetEqual~⊈~NotSucceeds~⊁~NotSucceedsEqual~⪰̸~NotSucceedsSlantEqual~⋡~NotSucceedsTilde~≿̸~NotSuperset~⊃⃒~NotSupersetEqual~⊉~NotTilde~≁~NotTildeEqual~≄~NotTildeFullEqual~≇~NotTildeTilde~≉~NotVerticalBar~∤~Nscr~𝒩~Ocy~О~Odblac~Ő~Ofr~𝔒~Omacr~Ō~Oopf~𝕆~OpenCurlyDoubleQuote~“~OpenCurlyQuote~‘~Or~⩔~Oscr~𝒪~Otimes~⨷~OverBar~‾~OverBrace~⏞~OverBracket~⎴~OverParenthesis~⏜~PartialD~∂~Pcy~П~Pfr~𝔓~PlusMinus~±~Poincareplane~ℌ~Popf~ℙ~Pr~⪻~Precedes~≺~PrecedesEqual~⪯~PrecedesSlantEqual~≼~PrecedesTilde~≾~Product~∏~Proportion~∷~Proportional~∝~Pscr~𝒫~Qfr~𝔔~Qopf~ℚ~Qscr~𝒬~RBarr~⤐~Racute~Ŕ~Rang~⟫~Rarr~↠~Rarrtl~⤖~Rcaron~Ř~Rcedil~Ŗ~Rcy~Р~Re~ℜ~ReverseElement~∋~ReverseEquilibrium~⇋~ReverseUpEquilibrium~⥯~Rfr~ℜ~RightAngleBracket~⟩~RightArrow~→~RightArrowBar~⇥~RightArrowLeftArrow~⇄~RightCeiling~⌉~RightDoubleBracket~⟧~RightDownTeeVector~⥝~RightDownVector~⇂~RightDownVectorBar~⥕~RightFloor~⌋~RightTee~⊢~RightTeeArrow~↦~RightTeeVector~⥛~RightTriangle~⊳~RightTriangleBar~⧐~RightTriangleEqual~⊵~RightUpDownVector~⥏~RightUpTeeVector~⥜~RightUpVector~↾~RightUpVectorBar~⥔~RightVector~⇀~RightVectorBar~⥓~Rightarrow~⇒~Ropf~ℝ~RoundImplies~⥰~Rrightarrow~⇛~Rscr~ℛ~Rsh~↱~RuleDelayed~⧴~SHCHcy~Щ~SHcy~Ш~SOFTcy~Ь~Sacute~Ś~Sc~⪼~Scedil~Ş~Scirc~Ŝ~Scy~С~Sfr~𝔖~ShortDownArrow~↓~ShortLeftArrow~←~ShortRightArrow~→~ShortUpArrow~↑~SmallCircle~∘~Sopf~𝕊~Sqrt~√~Square~□~SquareIntersection~⊓~SquareSubset~⊏~SquareSubsetEqual~⊑~SquareSuperset~⊐~SquareSupersetEqual~⊒~SquareUnion~⊔~Sscr~𝒮~Star~⋆~Sub~⋐~Subset~⋐~SubsetEqual~⊆~Succeeds~≻~SucceedsEqual~⪰~SucceedsSlantEqual~≽~SucceedsTilde~≿~SuchThat~∋~Sum~∑~Sup~⋑~Superset~⊃~SupersetEqual~⊇~Supset~⋑~TRADE~™~TSHcy~Ћ~TScy~Ц~Tab~ ~Tcaron~Ť~Tcedil~Ţ~Tcy~Т~Tfr~𝔗~Therefore~∴~ThickSpace~  ~ThinSpace~ ~Tilde~∼~TildeEqual~≃~TildeFullEqual~≅~TildeTilde~≈~Topf~𝕋~TripleDot~⃛~Tscr~𝒯~Tstrok~Ŧ~Uarr~↟~Uarrocir~⥉~Ubrcy~Ў~Ubreve~Ŭ~Ucy~У~Udblac~Ű~Ufr~𝔘~Umacr~Ū~UnderBar~_~UnderBrace~⏟~UnderBracket~⎵~UnderParenthesis~⏝~Union~⋃~UnionPlus~⊎~Uogon~Ų~Uopf~𝕌~UpArrow~↑~UpArrowBar~⤒~UpArrowDownArrow~⇅~UpDownArrow~↕~UpEquilibrium~⥮~UpTee~⊥~UpTeeArrow~↥~Uparrow~⇑~Updownarrow~⇕~UpperLeftArrow~↖~UpperRightArrow~↗~Upsi~ϒ~Uring~Ů~Uscr~𝒰~Utilde~Ũ~VDash~⊫~Vbar~⫫~Vcy~В~Vdash~⊩~Vdashl~⫦~Vee~⋁~Verbar~‖~Vert~‖~VerticalBar~∣~VerticalLine~|~VerticalSeparator~❘~VerticalTilde~≀~VeryThinSpace~ ~Vfr~𝔙~Vopf~𝕍~Vscr~𝒱~Vvdash~⊪~Wcirc~Ŵ~Wedge~⋀~Wfr~𝔚~Wopf~𝕎~Wscr~𝒲~Xfr~𝔛~Xopf~𝕏~Xscr~𝒳~YAcy~Я~YIcy~Ї~YUcy~Ю~Ycirc~Ŷ~Ycy~Ы~Yfr~𝔜~Yopf~𝕐~Yscr~𝒴~ZHcy~Ж~Zacute~Ź~Zcaron~Ž~Zcy~З~Zdot~Ż~ZeroWidthSpace~​~Zfr~ℨ~Zopf~ℤ~Zscr~𝒵~abreve~ă~ac~∾~acE~∾̳~acd~∿~acy~а~af~⁡~afr~𝔞~aleph~ℵ~amacr~ā~amalg~⨿~andand~⩕~andd~⩜~andslope~⩘~andv~⩚~ange~⦤~angle~∠~angmsd~∡~angmsdaa~⦨~angmsdab~⦩~angmsdac~⦪~angmsdad~⦫~angmsdae~⦬~angmsdaf~⦭~angmsdag~⦮~angmsdah~⦯~angrt~∟~angrtvb~⊾~angrtvbd~⦝~angsph~∢~angst~Å~angzarr~⍼~aogon~ą~aopf~𝕒~ap~≈~apE~⩰~apacir~⩯~ape~≊~apid~≋~approx~≈~approxeq~≊~ascr~𝒶~ast~*~asympeq~≍~awconint~∳~awint~⨑~bNot~⫭~backcong~≌~backepsilon~϶~backprime~‵~backsim~∽~backsimeq~⋍~barvee~⊽~barwed~⌅~barwedge~⌅~bbrk~⎵~bbrktbrk~⎶~bcong~≌~bcy~б~becaus~∵~because~∵~bemptyv~⦰~bepsi~϶~bernou~ℬ~beth~ℶ~between~≬~bfr~𝔟~bigcap~⋂~bigcirc~◯~bigcup~⋃~bigodot~⨀~bigoplus~⨁~bigotimes~⨂~bigsqcup~⨆~bigstar~★~bigtriangledown~▽~bigtriangleup~△~biguplus~⨄~bigvee~⋁~bigwedge~⋀~bkarow~⤍~blacklozenge~⧫~blacksquare~▪~blacktriangle~▴~blacktriangledown~▾~blacktriangleleft~◂~blacktriangleright~▸~blank~␣~blk12~▒~blk14~░~blk34~▓~block~█~bne~=⃥~bnequiv~≡⃥~bnot~⌐~bopf~𝕓~bot~⊥~bottom~⊥~bowtie~⋈~boxDL~╗~boxDR~╔~boxDl~╖~boxDr~╓~boxH~═~boxHD~╦~boxHU~╩~boxHd~╤~boxHu~╧~boxUL~╝~boxUR~╚~boxUl~╜~boxUr~╙~boxV~║~boxVH~╬~boxVL~╣~boxVR~╠~boxVh~╫~boxVl~╢~boxVr~╟~boxbox~⧉~boxdL~╕~boxdR~╒~boxdl~┐~boxdr~┌~boxh~─~boxhD~╥~boxhU~╨~boxhd~┬~boxhu~┴~boxminus~⊟~boxplus~⊞~boxtimes~⊠~boxuL~╛~boxuR~╘~boxul~┘~boxur~└~boxv~│~boxvH~╪~boxvL~╡~boxvR~╞~boxvh~┼~boxvl~┤~boxvr~├~bprime~‵~breve~˘~bscr~𝒷~bsemi~⁏~bsim~∽~bsime~⋍~bsol~\\~bsolb~⧅~bsolhsub~⟈~bullet~•~bump~≎~bumpE~⪮~bumpe~≏~bumpeq~≏~cacute~ć~capand~⩄~capbrcup~⩉~capcap~⩋~capcup~⩇~capdot~⩀~caps~∩︀~caret~⁁~caron~ˇ~ccaps~⩍~ccaron~č~ccirc~ĉ~ccups~⩌~ccupssm~⩐~cdot~ċ~cemptyv~⦲~centerdot~·~cfr~𝔠~chcy~ч~check~✓~checkmark~✓~cir~○~cirE~⧃~circeq~≗~circlearrowleft~↺~circlearrowright~↻~circledR~®~circledS~Ⓢ~circledast~⊛~circledcirc~⊚~circleddash~⊝~cire~≗~cirfnint~⨐~cirmid~⫯~cirscir~⧂~clubsuit~♣~colon~:~colone~≔~coloneq~≔~comma~,~commat~@~comp~∁~compfn~∘~complement~∁~complexes~ℂ~congdot~⩭~conint~∮~copf~𝕔~coprod~∐~copysr~℗~cross~✗~cscr~𝒸~csub~⫏~csube~⫑~csup~⫐~csupe~⫒~ctdot~⋯~cudarrl~⤸~cudarrr~⤵~cuepr~⋞~cuesc~⋟~cularr~↶~cularrp~⤽~cupbrcap~⩈~cupcap~⩆~cupcup~⩊~cupdot~⊍~cupor~⩅~cups~∪︀~curarr~↷~curarrm~⤼~curlyeqprec~⋞~curlyeqsucc~⋟~curlyvee~⋎~curlywedge~⋏~curvearrowleft~↶~curvearrowright~↷~cuvee~⋎~cuwed~⋏~cwconint~∲~cwint~∱~cylcty~⌭~dHar~⥥~daleth~ℸ~dash~‐~dashv~⊣~dbkarow~⤏~dblac~˝~dcaron~ď~dcy~д~dd~ⅆ~ddagger~‡~ddarr~⇊~ddotseq~⩷~demptyv~⦱~dfisht~⥿~dfr~𝔡~dharl~⇃~dharr~⇂~diam~⋄~diamond~⋄~diamondsuit~♦~die~¨~digamma~ϝ~disin~⋲~div~÷~divideontimes~⋇~divonx~⋇~djcy~ђ~dlcorn~⌞~dlcrop~⌍~dollar~$~dopf~𝕕~dot~˙~doteq~≐~doteqdot~≑~dotminus~∸~dotplus~∔~dotsquare~⊡~doublebarwedge~⌆~downarrow~↓~downdownarrows~⇊~downharpoonleft~⇃~downharpoonright~⇂~drbkarow~⤐~drcorn~⌟~drcrop~⌌~dscr~𝒹~dscy~ѕ~dsol~⧶~dstrok~đ~dtdot~⋱~dtri~▿~dtrif~▾~duarr~⇵~duhar~⥯~dwangle~⦦~dzcy~џ~dzigrarr~⟿~eDDot~⩷~eDot~≑~easter~⩮~ecaron~ě~ecir~≖~ecolon~≕~ecy~э~edot~ė~ee~ⅇ~efDot~≒~efr~𝔢~eg~⪚~egs~⪖~egsdot~⪘~el~⪙~elinters~⏧~ell~ℓ~els~⪕~elsdot~⪗~emacr~ē~emptyset~∅~emptyv~∅~emsp13~ ~emsp14~ ~eng~ŋ~eogon~ę~eopf~𝕖~epar~⋕~eparsl~⧣~eplus~⩱~epsi~ε~epsiv~ϵ~eqcirc~≖~eqcolon~≕~eqsim~≂~eqslantgtr~⪖~eqslantless~⪕~equals~=~equest~≟~equivDD~⩸~eqvparsl~⧥~erDot~≓~erarr~⥱~escr~ℯ~esdot~≐~esim~≂~excl~!~expectation~ℰ~exponentiale~ⅇ~fallingdotseq~≒~fcy~ф~female~♀~ffilig~ffi~fflig~ff~ffllig~ffl~ffr~𝔣~filig~fi~fjlig~fj~flat~♭~fllig~fl~fltns~▱~fopf~𝕗~fork~⋔~forkv~⫙~fpartint~⨍~frac13~⅓~frac15~⅕~frac16~⅙~frac18~⅛~frac23~⅔~frac25~⅖~frac35~⅗~frac38~⅜~frac45~⅘~frac56~⅚~frac58~⅝~frac78~⅞~frown~⌢~fscr~𝒻~gE~≧~gEl~⪌~gacute~ǵ~gammad~ϝ~gap~⪆~gbreve~ğ~gcirc~ĝ~gcy~г~gdot~ġ~gel~⋛~geq~≥~geqq~≧~geqslant~⩾~ges~⩾~gescc~⪩~gesdot~⪀~gesdoto~⪂~gesdotol~⪄~gesl~⋛︀~gesles~⪔~gfr~𝔤~gg~≫~ggg~⋙~gimel~ℷ~gjcy~ѓ~gl~≷~glE~⪒~gla~⪥~glj~⪤~gnE~≩~gnap~⪊~gnapprox~⪊~gne~⪈~gneq~⪈~gneqq~≩~gnsim~⋧~gopf~𝕘~grave~`~gscr~ℊ~gsim~≳~gsime~⪎~gsiml~⪐~gtcc~⪧~gtcir~⩺~gtdot~⋗~gtlPar~⦕~gtquest~⩼~gtrapprox~⪆~gtrarr~⥸~gtrdot~⋗~gtreqless~⋛~gtreqqless~⪌~gtrless~≷~gtrsim~≳~gvertneqq~≩︀~gvnE~≩︀~hairsp~ ~half~½~hamilt~ℋ~hardcy~ъ~harrcir~⥈~harrw~↭~hbar~ℏ~hcirc~ĥ~heartsuit~♥~hercon~⊹~hfr~𝔥~hksearow~⤥~hkswarow~⤦~hoarr~⇿~homtht~∻~hookleftarrow~↩~hookrightarrow~↪~hopf~𝕙~horbar~―~hscr~𝒽~hslash~ℏ~hstrok~ħ~hybull~⁃~hyphen~‐~ic~⁣~icy~и~iecy~е~iff~⇔~ifr~𝔦~ii~ⅈ~iiiint~⨌~iiint~∭~iinfin~⧜~iiota~℩~ijlig~ij~imacr~ī~imagline~ℐ~imagpart~ℑ~imath~ı~imof~⊷~imped~Ƶ~in~∈~incare~℅~infintie~⧝~inodot~ı~intcal~⊺~integers~ℤ~intercal~⊺~intlarhk~⨗~intprod~⨼~iocy~ё~iogon~į~iopf~𝕚~iprod~⨼~iscr~𝒾~isinE~⋹~isindot~⋵~isins~⋴~isinsv~⋳~isinv~∈~it~⁢~itilde~ĩ~iukcy~і~jcirc~ĵ~jcy~й~jfr~𝔧~jmath~ȷ~jopf~𝕛~jscr~𝒿~jsercy~ј~jukcy~є~kappav~ϰ~kcedil~ķ~kcy~к~kfr~𝔨~kgreen~ĸ~khcy~х~kjcy~ќ~kopf~𝕜~kscr~𝓀~lAarr~⇚~lAtail~⤛~lBarr~⤎~lE~≦~lEg~⪋~lHar~⥢~lacute~ĺ~laemptyv~⦴~lagran~ℒ~langd~⦑~langle~⟨~lap~⪅~larrb~⇤~larrbfs~⤟~larrfs~⤝~larrhk~↩~larrlp~↫~larrpl~⤹~larrsim~⥳~larrtl~↢~lat~⪫~latail~⤙~late~⪭~lates~⪭︀~lbarr~⤌~lbbrk~❲~lbrace~{~lbrack~[~lbrke~⦋~lbrksld~⦏~lbrkslu~⦍~lcaron~ľ~lcedil~ļ~lcub~{~lcy~л~ldca~⤶~ldquor~„~ldrdhar~⥧~ldrushar~⥋~ldsh~↲~leftarrow~←~leftarrowtail~↢~leftharpoondown~↽~leftharpoonup~↼~leftleftarrows~⇇~leftrightarrow~↔~leftrightarrows~⇆~leftrightharpoons~⇋~leftrightsquigarrow~↭~leftthreetimes~⋋~leg~⋚~leq~≤~leqq~≦~leqslant~⩽~les~⩽~lescc~⪨~lesdot~⩿~lesdoto~⪁~lesdotor~⪃~lesg~⋚︀~lesges~⪓~lessapprox~⪅~lessdot~⋖~lesseqgtr~⋚~lesseqqgtr~⪋~lessgtr~≶~lesssim~≲~lfisht~⥼~lfr~𝔩~lg~≶~lgE~⪑~lhard~↽~lharu~↼~lharul~⥪~lhblk~▄~ljcy~љ~ll~≪~llarr~⇇~llcorner~⌞~llhard~⥫~lltri~◺~lmidot~ŀ~lmoust~⎰~lmoustache~⎰~lnE~≨~lnap~⪉~lnapprox~⪉~lne~⪇~lneq~⪇~lneqq~≨~lnsim~⋦~loang~⟬~loarr~⇽~lobrk~⟦~longleftarrow~⟵~longleftrightarrow~⟷~longmapsto~⟼~longrightarrow~⟶~looparrowleft~↫~looparrowright~↬~lopar~⦅~lopf~𝕝~loplus~⨭~lotimes~⨴~lowbar~_~lozenge~◊~lozf~⧫~lpar~(~lparlt~⦓~lrarr~⇆~lrcorner~⌟~lrhar~⇋~lrhard~⥭~lrtri~⊿~lscr~𝓁~lsh~↰~lsim~≲~lsime~⪍~lsimg~⪏~lsqb~[~lsquor~‚~lstrok~ł~ltcc~⪦~ltcir~⩹~ltdot~⋖~lthree~⋋~ltimes~⋉~ltlarr~⥶~ltquest~⩻~ltrPar~⦖~ltri~◃~ltrie~⊴~ltrif~◂~lurdshar~⥊~luruhar~⥦~lvertneqq~≨︀~lvnE~≨︀~mDDot~∺~male~♂~malt~✠~maltese~✠~map~↦~mapsto~↦~mapstodown~↧~mapstoleft~↤~mapstoup~↥~marker~▮~mcomma~⨩~mcy~м~measuredangle~∡~mfr~𝔪~mho~℧~mid~∣~midast~*~midcir~⫰~minusb~⊟~minusd~∸~minusdu~⨪~mlcp~⫛~mldr~…~mnplus~∓~models~⊧~mopf~𝕞~mp~∓~mscr~𝓂~mstpos~∾~multimap~⊸~mumap~⊸~nGg~⋙̸~nGt~≫⃒~nGtv~≫̸~nLeftarrow~⇍~nLeftrightarrow~⇎~nLl~⋘̸~nLt~≪⃒~nLtv~≪̸~nRightarrow~⇏~nVDash~⊯~nVdash~⊮~nacute~ń~nang~∠⃒~nap~≉~napE~⩰̸~napid~≋̸~napos~ʼn~napprox~≉~natur~♮~natural~♮~naturals~ℕ~nbump~≎̸~nbumpe~≏̸~ncap~⩃~ncaron~ň~ncedil~ņ~ncong~≇~ncongdot~⩭̸~ncup~⩂~ncy~н~neArr~⇗~nearhk~⤤~nearr~↗~nearrow~↗~nedot~≐̸~nequiv~≢~nesear~⤨~nesim~≂̸~nexist~∄~nexists~∄~nfr~𝔫~ngE~≧̸~nge~≱~ngeq~≱~ngeqq~≧̸~ngeqslant~⩾̸~nges~⩾̸~ngsim~≵~ngt~≯~ngtr~≯~nhArr~⇎~nharr~↮~nhpar~⫲~nis~⋼~nisd~⋺~niv~∋~njcy~њ~nlArr~⇍~nlE~≦̸~nlarr~↚~nldr~‥~nle~≰~nleftarrow~↚~nleftrightarrow~↮~nleq~≰~nleqq~≦̸~nleqslant~⩽̸~nles~⩽̸~nless~≮~nlsim~≴~nlt~≮~nltri~⋪~nltrie~⋬~nmid~∤~nopf~𝕟~notinE~⋹̸~notindot~⋵̸~notinva~∉~notinvb~⋷~notinvc~⋶~notni~∌~notniva~∌~notnivb~⋾~notnivc~⋽~npar~∦~nparallel~∦~nparsl~⫽⃥~npart~∂̸~npolint~⨔~npr~⊀~nprcue~⋠~npre~⪯̸~nprec~⊀~npreceq~⪯̸~nrArr~⇏~nrarr~↛~nrarrc~⤳̸~nrarrw~↝̸~nrightarrow~↛~nrtri~⋫~nrtrie~⋭~nsc~⊁~nsccue~⋡~nsce~⪰̸~nscr~𝓃~nshortmid~∤~nshortparallel~∦~nsim~≁~nsime~≄~nsimeq~≄~nsmid~∤~nspar~∦~nsqsube~⋢~nsqsupe~⋣~nsubE~⫅̸~nsube~⊈~nsubset~⊂⃒~nsubseteq~⊈~nsubseteqq~⫅̸~nsucc~⊁~nsucceq~⪰̸~nsup~⊅~nsupE~⫆̸~nsupe~⊉~nsupset~⊃⃒~nsupseteq~⊉~nsupseteqq~⫆̸~ntgl~≹~ntlg~≸~ntriangleleft~⋪~ntrianglelefteq~⋬~ntriangleright~⋫~ntrianglerighteq~⋭~num~#~numero~№~numsp~ ~nvDash~⊭~nvHarr~⤄~nvap~≍⃒~nvdash~⊬~nvge~≥⃒~nvgt~>⃒~nvinfin~⧞~nvlArr~⤂~nvle~≤⃒~nvlt~<⃒~nvltrie~⊴⃒~nvrArr~⤃~nvrtrie~⊵⃒~nvsim~∼⃒~nwArr~⇖~nwarhk~⤣~nwarr~↖~nwarrow~↖~nwnear~⤧~oS~Ⓢ~oast~⊛~ocir~⊚~ocy~о~odash~⊝~odblac~ő~odiv~⨸~odot~⊙~odsold~⦼~ofcir~⦿~ofr~𝔬~ogon~˛~ogt~⧁~ohbar~⦵~ohm~Ω~oint~∮~olarr~↺~olcir~⦾~olcross~⦻~olt~⧀~omacr~ō~omid~⦶~ominus~⊖~oopf~𝕠~opar~⦷~operp~⦹~orarr~↻~ord~⩝~order~ℴ~orderof~ℴ~origof~⊶~oror~⩖~orslope~⩗~orv~⩛~oscr~ℴ~osol~⊘~otimesas~⨶~ovbar~⌽~par~∥~parallel~∥~parsim~⫳~parsl~⫽~pcy~п~percnt~%~period~.~pertenk~‱~pfr~𝔭~phiv~ϕ~phmmat~ℳ~phone~☎~pitchfork~⋔~planck~ℏ~planckh~ℎ~plankv~ℏ~plus~+~plusacir~⨣~plusb~⊞~pluscir~⨢~plusdo~∔~plusdu~⨥~pluse~⩲~plussim~⨦~plustwo~⨧~pm~±~pointint~⨕~popf~𝕡~pr~≺~prE~⪳~prap~⪷~prcue~≼~pre~⪯~prec~≺~precapprox~⪷~preccurlyeq~≼~preceq~⪯~precnapprox~⪹~precneqq~⪵~precnsim~⋨~precsim~≾~primes~ℙ~prnE~⪵~prnap~⪹~prnsim~⋨~profalar~⌮~profline~⌒~profsurf~⌓~propto~∝~prsim~≾~prurel~⊰~pscr~𝓅~puncsp~ ~qfr~𝔮~qint~⨌~qopf~𝕢~qprime~⁗~qscr~𝓆~quaternions~ℍ~quatint~⨖~quest~?~questeq~≟~rAarr~⇛~rAtail~⤜~rBarr~⤏~rHar~⥤~race~∽̱~racute~ŕ~raemptyv~⦳~rangd~⦒~range~⦥~rangle~⟩~rarrap~⥵~rarrb~⇥~rarrbfs~⤠~rarrc~⤳~rarrfs~⤞~rarrhk~↪~rarrlp~↬~rarrpl~⥅~rarrsim~⥴~rarrtl~↣~rarrw~↝~ratail~⤚~ratio~∶~rationals~ℚ~rbarr~⤍~rbbrk~❳~rbrace~}~rbrack~]~rbrke~⦌~rbrksld~⦎~rbrkslu~⦐~rcaron~ř~rcedil~ŗ~rcub~}~rcy~р~rdca~⤷~rdldhar~⥩~rdquor~”~rdsh~↳~realine~ℛ~realpart~ℜ~reals~ℝ~rect~▭~rfisht~⥽~rfr~𝔯~rhard~⇁~rharu~⇀~rharul~⥬~rhov~ϱ~rightarrow~→~rightarrowtail~↣~rightharpoondown~⇁~rightharpoonup~⇀~rightleftarrows~⇄~rightleftharpoons~⇌~rightrightarrows~⇉~rightsquigarrow~↝~rightthreetimes~⋌~ring~˚~risingdotseq~≓~rlarr~⇄~rlhar~⇌~rmoust~⎱~rmoustache~⎱~rnmid~⫮~roang~⟭~roarr~⇾~robrk~⟧~ropar~⦆~ropf~𝕣~roplus~⨮~rotimes~⨵~rpar~)~rpargt~⦔~rppolint~⨒~rrarr~⇉~rscr~𝓇~rsh~↱~rsqb~]~rsquor~’~rthree~⋌~rtimes~⋊~rtri~▹~rtrie~⊵~rtrif~▸~rtriltri~⧎~ruluhar~⥨~rx~℞~sacute~ś~sc~≻~scE~⪴~scap~⪸~sccue~≽~sce~⪰~scedil~ş~scirc~ŝ~scnE~⪶~scnap~⪺~scnsim~⋩~scpolint~⨓~scsim~≿~scy~с~sdotb~⊡~sdote~⩦~seArr~⇘~searhk~⤥~searr~↘~searrow~↘~semi~;~seswar~⤩~setminus~∖~setmn~∖~sext~✶~sfr~𝔰~sfrown~⌢~sharp~♯~shchcy~щ~shcy~ш~shortmid~∣~shortparallel~∥~sigmav~ς~simdot~⩪~sime~≃~simeq~≃~simg~⪞~simgE~⪠~siml~⪝~simlE~⪟~simne~≆~simplus~⨤~simrarr~⥲~slarr~←~smallsetminus~∖~smashp~⨳~smeparsl~⧤~smid~∣~smile~⌣~smt~⪪~smte~⪬~smtes~⪬︀~softcy~ь~sol~/~solb~⧄~solbar~⌿~sopf~𝕤~spadesuit~♠~spar~∥~sqcap~⊓~sqcaps~⊓︀~sqcup~⊔~sqcups~⊔︀~sqsub~⊏~sqsube~⊑~sqsubset~⊏~sqsubseteq~⊑~sqsup~⊐~sqsupe~⊒~sqsupset~⊐~sqsupseteq~⊒~squ~□~square~□~squarf~▪~squf~▪~srarr~→~sscr~𝓈~ssetmn~∖~ssmile~⌣~sstarf~⋆~star~☆~starf~★~straightepsilon~ϵ~straightphi~ϕ~strns~¯~subE~⫅~subdot~⪽~subedot~⫃~submult~⫁~subnE~⫋~subne~⊊~subplus~⪿~subrarr~⥹~subset~⊂~subseteq~⊆~subseteqq~⫅~subsetneq~⊊~subsetneqq~⫋~subsim~⫇~subsub~⫕~subsup~⫓~succ~≻~succapprox~⪸~succcurlyeq~≽~succeq~⪰~succnapprox~⪺~succneqq~⪶~succnsim~⋩~succsim~≿~sung~♪~supE~⫆~supdot~⪾~supdsub~⫘~supedot~⫄~suphsol~⟉~suphsub~⫗~suplarr~⥻~supmult~⫂~supnE~⫌~supne~⊋~supplus~⫀~supset~⊃~supseteq~⊇~supseteqq~⫆~supsetneq~⊋~supsetneqq~⫌~supsim~⫈~supsub~⫔~supsup~⫖~swArr~⇙~swarhk~⤦~swarr~↙~swarrow~↙~swnwar~⤪~target~⌖~tbrk~⎴~tcaron~ť~tcedil~ţ~tcy~т~tdot~⃛~telrec~⌕~tfr~𝔱~therefore~∴~thetav~ϑ~thickapprox~≈~thicksim~∼~thkap~≈~thksim~∼~timesb~⊠~timesbar~⨱~timesd~⨰~tint~∭~toea~⤨~top~⊤~topbot~⌶~topcir~⫱~topf~𝕥~topfork~⫚~tosa~⤩~tprime~‴~triangle~▵~triangledown~▿~triangleleft~◃~trianglelefteq~⊴~triangleq~≜~triangleright~▹~trianglerighteq~⊵~tridot~◬~trie~≜~triminus~⨺~triplus~⨹~trisb~⧍~tritime~⨻~trpezium~⏢~tscr~𝓉~tscy~ц~tshcy~ћ~tstrok~ŧ~twixt~≬~twoheadleftarrow~↞~twoheadrightarrow~↠~uHar~⥣~ubrcy~ў~ubreve~ŭ~ucy~у~udarr~⇅~udblac~ű~udhar~⥮~ufisht~⥾~ufr~𝔲~uharl~↿~uharr~↾~uhblk~▀~ulcorn~⌜~ulcorner~⌜~ulcrop~⌏~ultri~◸~umacr~ū~uogon~ų~uopf~𝕦~uparrow~↑~updownarrow~↕~upharpoonleft~↿~upharpoonright~↾~uplus~⊎~upsi~υ~upuparrows~⇈~urcorn~⌝~urcorner~⌝~urcrop~⌎~uring~ů~urtri~◹~uscr~𝓊~utdot~⋰~utilde~ũ~utri~▵~utrif~▴~uuarr~⇈~uwangle~⦧~vArr~⇕~vBar~⫨~vBarv~⫩~vDash~⊨~vangrt~⦜~varepsilon~ϵ~varkappa~ϰ~varnothing~∅~varphi~ϕ~varpi~ϖ~varpropto~∝~varr~↕~varrho~ϱ~varsigma~ς~varsubsetneq~⊊︀~varsubsetneqq~⫋︀~varsupsetneq~⊋︀~varsupsetneqq~⫌︀~vartheta~ϑ~vartriangleleft~⊲~vartriangleright~⊳~vcy~в~vdash~⊢~vee~∨~veebar~⊻~veeeq~≚~vellip~⋮~verbar~|~vert~|~vfr~𝔳~vltri~⊲~vnsub~⊂⃒~vnsup~⊃⃒~vopf~𝕧~vprop~∝~vrtri~⊳~vscr~𝓋~vsubnE~⫋︀~vsubne~⊊︀~vsupnE~⫌︀~vsupne~⊋︀~vzigzag~⦚~wcirc~ŵ~wedbar~⩟~wedge~∧~wedgeq~≙~wfr~𝔴~wopf~𝕨~wp~℘~wr~≀~wreath~≀~wscr~𝓌~xcap~⋂~xcirc~◯~xcup~⋃~xdtri~▽~xfr~𝔵~xhArr~⟺~xharr~⟷~xlArr~⟸~xlarr~⟵~xmap~⟼~xnis~⋻~xodot~⨀~xopf~𝕩~xoplus~⨁~xotime~⨂~xrArr~⟹~xrarr~⟶~xscr~𝓍~xsqcup~⨆~xuplus~⨄~xutri~△~xvee~⋁~xwedge~⋀~yacy~я~ycirc~ŷ~ycy~ы~yfr~𝔶~yicy~ї~yopf~𝕪~yscr~𝓎~yucy~ю~zacute~ź~zcaron~ž~zcy~з~zdot~ż~zeetrf~ℨ~zfr~𝔷~zhcy~ж~zigrarr~⇝~zopf~𝕫~zscr~𝓏~~AMP~&~COPY~©~GT~>~LT~<~QUOT~"~REG~®',ic.html4);var y7={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},A7=String.fromCodePoint||function(r){return String.fromCharCode(Math.floor((r-65536)/1024)+55296,(r-65536)%1024+56320)},ac=function(){return ac=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},ac.apply(this,arguments)},w7=ac(ac({},ic),{all:ic.html5}),b7={scope:"body",level:"all"},L0=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g,U0=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g,zx={xml:{strict:L0,attribute:U0,body:N0.xml},html4:{strict:L0,attribute:U0,body:N0.html4},html5:{strict:L0,attribute:U0,body:N0.html5}},C7=ac(ac({},zx),{all:zx.html5}),RF=String.fromCharCode,x7=RF(65533);function S7(r,e,t,n){var i=r,a=r[r.length-1];if(t&&a==="=")i=r;else if(n&&a!==";")i=r;else{var s=e[r];if(s)i=s;else if(r[0]==="&"&&r[1]==="#"){var o=r[2],l=o=="x"||o=="X"?parseInt(r.substr(3),16):parseInt(r.substr(2));i=l>=1114111?x7:l>65535?A7(l):RF(y7[l]||l)}}return i}function E7(r,e){var t=b7,n=t.level,i=n===void 0?"all":n,a=t.scope,s=a===void 0?i==="xml"?"strict":"body":a;if(!r)return"";var o=C7[i][s],l=w7[i].entities,u=s==="attribute",c=s==="strict";return r.replace(o,function(f){return S7(f,l,u,c)})}const OF=new Map;class k7{constructor(e){this.font=e,this.glyphsFromText=new Map,this.kerningValues=new Map,this.height=this.calculateApproximateHeight()}getFont(){return this.font}getGlyphs(e){const t=this.glyphsFromText.get(e);if(t)return t;const n=this.font.stringToGlyphs(e);return this.glyphsFromText.set(e,n),n}getApproximateHeight(){return this.height}getExactHeight(e){const t=this.font.stringToGlyphs(e);let n=0,i=0;return t.forEach(a=>{const s=a.getMetrics();n=Math.max(n,s.yMax),i=Math.min(i,s.yMin)}),n-i}getKerningValue(e,t){if(!e.name||!t.name)return;let n=this.kerningValues.get(e.name);n||(n=new Map,this.kerningValues.set(e.name,n));let i=n.get(t.name);return i||(i=this.font.getKerningValue(e,t),n.set(t.name,i)),i}calculateApproximateHeight(){const t=this.font.stringToGlyphs("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");let n=0,i=0;return t.forEach(a=>{const s=a.getMetrics();n=Math.max(n,s.yMax),i=Math.min(i,s.yMin)}),n-i}}const T7=r=>r.substring(0,5).toLowerCase().trim()==="data:",V0=new Map,Rl=async r=>{if(V0.has(r))return V0.get(r);const t=(async()=>{try{return Io(r).getFont()}catch{if(T7(r)){const n=Yk(r),i=nA(n);return iA(r,i),i}else{const n=await Ng(r,!0),i=nA(n);return iA(r,i),await z4(i,r),i}}})();return V0.set(r,t),t},F7=r=>{const e=Yk(r),t=nA(e);return iA(r,t),t},Io=r=>{const e=OF.get(r);if(e)return e;throw new Error("Font metrics unavailable for font")},iA=(r,e)=>{const t=new k7(e);return OF.set(r,t),t},I7=async r=>{const e=us(),t=e.parseFromString(r,"image/svg+xml"),n=t.firstElementChild,i=new Map;n.querySelectorAll("style").forEach(c=>{tT.parse(c.innerHTML).stylesheet?.rules.forEach(d=>{if(d.type==="font-face"&&d.declarations){const h=d.declarations.find(y=>y.property==="font-family")?.value,v=d.declarations.find(y=>y.property==="src")?.value?.match(/'(https.*?)'/)?.[1];h&&v&&i.set(h,v)}})});const s=t.querySelectorAll("tspan");for(let c=0;c<s.length;c++){const f=s.item(c),d=f.closest("text"),h=f.closest("g"),g=d.getAttribute("font-family"),v=await Rl(i.get(g)),y=E7(f.innerHTML),A=d.getAttribute("fill"),C=d.getAttribute("stroke"),S=d.getAttribute("stroke-width"),F=v.getPath(y,0,0,parseInt(d.getAttribute("font-size")??"72")),E=F.getBoundingBox().x2-F.getBoundingBox().x1;let R=0;const B=f.getAttribute("text-anchor");B==="middle"?R=E/2:B==="end"&&(R=E);const G=v.getPath(y,parseFloat(f.getAttribute("x")??"0")-R,parseFloat(f.getAttribute("y")??"0"),parseInt(d.getAttribute("font-size")??"72"));G.fill=A,G.stroke=C,G.strokeWidth=parseFloat(S??"0");const j=G.toSVG(2),q=e.parseFromString(j,"image/svg+xml").firstElementChild;h.appendChild(q)}return t.querySelectorAll("text").forEach(c=>c.remove()),Do().serializeToString(n)},fg=(r,e,t,n)=>Math.max(O7(r.join(`
1782
+ `,children:At.jsx(UT,{id:e,x:0,y:0,rotation:0,width:r.width,height:r.height,clipPath:r.path,children:c()})})})]})};String.prototype.codePointAt||(function(){var r=(function(){try{var t={},n=Object.defineProperty,i=n(t,t,t)&&n}catch{}return i})(),e=function(t){if(this==null)throw TypeError();var n=String(this),i=n.length,a=t?Number(t):0;if(a!=a&&(a=0),!(a<0||a>=i)){var s=n.charCodeAt(a),o;return s>=55296&&s<=56319&&i>a+1&&(o=n.charCodeAt(a+1),o>=56320&&o<=57343)?(s-55296)*1024+o-56320+65536:s}};r?r(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e})();var u1=0,VT=-3;function yf(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function t5(r,e){this.source=r,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=e,this.destLen=0,this.ltree=new yf,this.dtree=new yf}var zT=new yf,$T=new yf,c1=new Uint8Array(30),d1=new Uint16Array(30),HT=new Uint8Array(30),GT=new Uint16Array(30),r5=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rx=new yf,Wa=new Uint8Array(320);function jT(r,e,t,n){var i,a;for(i=0;i<t;++i)r[i]=0;for(i=0;i<30-t;++i)r[i+t]=i/t|0;for(a=n,i=0;i<30;++i)e[i]=a,a+=1<<r[i]}function n5(r,e){var t;for(t=0;t<7;++t)r.table[t]=0;for(r.table[7]=24,r.table[8]=152,r.table[9]=112,t=0;t<24;++t)r.trans[t]=256+t;for(t=0;t<144;++t)r.trans[24+t]=t;for(t=0;t<8;++t)r.trans[168+t]=280+t;for(t=0;t<112;++t)r.trans[176+t]=144+t;for(t=0;t<5;++t)e.table[t]=0;for(e.table[5]=32,t=0;t<32;++t)e.trans[t]=t}var nx=new Uint16Array(16);function F0(r,e,t,n){var i,a;for(i=0;i<16;++i)r.table[i]=0;for(i=0;i<n;++i)r.table[e[t+i]]++;for(r.table[0]=0,a=0,i=0;i<16;++i)nx[i]=a,a+=r.table[i];for(i=0;i<n;++i)e[t+i]&&(r.trans[nx[e[t+i]]++]=i)}function i5(r){r.bitcount--||(r.tag=r.source[r.sourceIndex++],r.bitcount=7);var e=r.tag&1;return r.tag>>>=1,e}function Za(r,e,t){if(!e)return t;for(;r.bitcount<24;)r.tag|=r.source[r.sourceIndex++]<<r.bitcount,r.bitcount+=8;var n=r.tag&65535>>>16-e;return r.tag>>>=e,r.bitcount-=e,n+t}function Qy(r,e){for(;r.bitcount<24;)r.tag|=r.source[r.sourceIndex++]<<r.bitcount,r.bitcount+=8;var t=0,n=0,i=0,a=r.tag;do n=2*n+(a&1),a>>>=1,++i,t+=e.table[i],n-=e.table[i];while(n>=0);return r.tag=a,r.bitcount-=i,e.trans[t+n]}function a5(r,e,t){var n,i,a,s,o,l;for(n=Za(r,5,257),i=Za(r,5,1),a=Za(r,4,4),s=0;s<19;++s)Wa[s]=0;for(s=0;s<a;++s){var u=Za(r,3,0);Wa[r5[s]]=u}for(F0(rx,Wa,0,19),o=0;o<n+i;){var c=Qy(r,rx);switch(c){case 16:var f=Wa[o-1];for(l=Za(r,2,3);l;--l)Wa[o++]=f;break;case 17:for(l=Za(r,3,3);l;--l)Wa[o++]=0;break;case 18:for(l=Za(r,7,11);l;--l)Wa[o++]=0;break;default:Wa[o++]=c;break}}F0(e,Wa,0,n),F0(t,Wa,n,i)}function ix(r,e,t){for(;;){var n=Qy(r,e);if(n===256)return u1;if(n<256)r.dest[r.destLen++]=n;else{var i,a,s,o;for(n-=257,i=Za(r,c1[n],d1[n]),a=Qy(r,t),s=r.destLen-Za(r,HT[a],GT[a]),o=s;o<s+i;++o)r.dest[r.destLen++]=r.dest[o]}}}function s5(r){for(var e,t,n;r.bitcount>8;)r.sourceIndex--,r.bitcount-=8;if(e=r.source[r.sourceIndex+1],e=256*e+r.source[r.sourceIndex],t=r.source[r.sourceIndex+3],t=256*t+r.source[r.sourceIndex+2],e!==(~t&65535))return VT;for(r.sourceIndex+=4,n=e;n;--n)r.dest[r.destLen++]=r.source[r.sourceIndex++];return r.bitcount=0,u1}function o5(r,e){var t=new t5(r,e),n,i,a;do{switch(n=i5(t),i=Za(t,2,0),i){case 0:a=s5(t);break;case 1:a=ix(t,zT,$T);break;case 2:a5(t,t.ltree,t.dtree),a=ix(t,t.ltree,t.dtree);break;default:a=VT}if(a!==u1)throw new Error("Data error")}while(!n);return t.destLen<t.dest.length?typeof t.dest.slice=="function"?t.dest.slice(0,t.destLen):t.dest.subarray(0,t.destLen):t.dest}n5(zT,$T);jT(c1,d1,4,3);jT(HT,GT,2,1);c1[28]=0;d1[28]=258;var l5=o5;function Cu(r,e,t,n,i){return Math.pow(1-i,3)*r+3*Math.pow(1-i,2)*i*e+3*(1-i)*Math.pow(i,2)*t+Math.pow(i,3)*n}function Bo(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}Bo.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)};Bo.prototype.addPoint=function(r,e){typeof r=="number"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=r,this.x2=r),r<this.x1&&(this.x1=r),r>this.x2&&(this.x2=r)),typeof e=="number"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))};Bo.prototype.addX=function(r){this.addPoint(r,null)};Bo.prototype.addY=function(r){this.addPoint(null,r)};Bo.prototype.addBezier=function(r,e,t,n,i,a,s,o){var l=[r,e],u=[t,n],c=[i,a],f=[s,o];this.addPoint(r,e),this.addPoint(s,o);for(var d=0;d<=1;d++){var h=6*l[d]-12*u[d]+6*c[d],g=-3*l[d]+9*u[d]-9*c[d]+3*f[d],v=3*u[d]-3*l[d];if(g===0){if(h===0)continue;var y=-v/h;0<y&&y<1&&(d===0&&this.addX(Cu(l[d],u[d],c[d],f[d],y)),d===1&&this.addY(Cu(l[d],u[d],c[d],f[d],y)));continue}var A=Math.pow(h,2)-4*v*g;if(!(A<0)){var C=(-h+Math.sqrt(A))/(2*g);0<C&&C<1&&(d===0&&this.addX(Cu(l[d],u[d],c[d],f[d],C)),d===1&&this.addY(Cu(l[d],u[d],c[d],f[d],C)));var S=(-h-Math.sqrt(A))/(2*g);0<S&&S<1&&(d===0&&this.addX(Cu(l[d],u[d],c[d],f[d],S)),d===1&&this.addY(Cu(l[d],u[d],c[d],f[d],S)))}}};Bo.prototype.addQuad=function(r,e,t,n,i,a){var s=r+.6666666666666666*(t-r),o=e+2/3*(n-e),l=s+1/3*(i-r),u=o+1/3*(a-e);this.addBezier(r,e,s,o,l,u,i,a)};function fi(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}fi.prototype.moveTo=function(r,e){this.commands.push({type:"M",x:r,y:e})};fi.prototype.lineTo=function(r,e){this.commands.push({type:"L",x:r,y:e})};fi.prototype.curveTo=fi.prototype.bezierCurveTo=function(r,e,t,n,i,a){this.commands.push({type:"C",x1:r,y1:e,x2:t,y2:n,x:i,y:a})};fi.prototype.quadTo=fi.prototype.quadraticCurveTo=function(r,e,t,n){this.commands.push({type:"Q",x1:r,y1:e,x:t,y:n})};fi.prototype.close=fi.prototype.closePath=function(){this.commands.push({type:"Z"})};fi.prototype.extend=function(r){if(r.commands)r=r.commands;else if(r instanceof Bo){var e=r;this.moveTo(e.x1,e.y1),this.lineTo(e.x2,e.y1),this.lineTo(e.x2,e.y2),this.lineTo(e.x1,e.y2),this.close();return}Array.prototype.push.apply(this.commands,r)};fi.prototype.getBoundingBox=function(){for(var r=new Bo,e=0,t=0,n=0,i=0,a=0;a<this.commands.length;a++){var s=this.commands[a];switch(s.type){case"M":r.addPoint(s.x,s.y),e=n=s.x,t=i=s.y;break;case"L":r.addPoint(s.x,s.y),n=s.x,i=s.y;break;case"Q":r.addQuad(n,i,s.x1,s.y1,s.x,s.y),n=s.x,i=s.y;break;case"C":r.addBezier(n,i,s.x1,s.y1,s.x2,s.y2,s.x,s.y),n=s.x,i=s.y;break;case"Z":n=e,i=t;break;default:throw new Error("Unexpected path command "+s.type)}}return r.isEmpty()&&r.addPoint(0,0),r};fi.prototype.draw=function(r){r.beginPath();for(var e=0;e<this.commands.length;e+=1){var t=this.commands[e];t.type==="M"?r.moveTo(t.x,t.y):t.type==="L"?r.lineTo(t.x,t.y):t.type==="C"?r.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y):t.type==="Q"?r.quadraticCurveTo(t.x1,t.y1,t.x,t.y):t.type==="Z"&&r.closePath()}this.fill&&(r.fillStyle=this.fill,r.fill()),this.stroke&&(r.strokeStyle=this.stroke,r.lineWidth=this.strokeWidth,r.stroke())};fi.prototype.toPathData=function(r){r=r!==void 0?r:2;function e(s){return Math.round(s)===s?""+Math.round(s):s.toFixed(r)}function t(){for(var s=arguments,o="",l=0;l<arguments.length;l+=1){var u=s[l];u>=0&&l>0&&(o+=" "),o+=e(u)}return o}for(var n="",i=0;i<this.commands.length;i+=1){var a=this.commands[i];a.type==="M"?n+="M"+t(a.x,a.y):a.type==="L"?n+="L"+t(a.x,a.y):a.type==="C"?n+="C"+t(a.x1,a.y1,a.x2,a.y2,a.x,a.y):a.type==="Q"?n+="Q"+t(a.x1,a.y1,a.x,a.y):a.type==="Z"&&(n+="Z")}return n};fi.prototype.toSVG=function(r){var e='<path d="';return e+=this.toPathData(r),e+='"',this.fill&&this.fill!=="black"&&(this.fill===null?e+=' fill="none"':e+=' fill="'+this.fill+'"'),this.stroke&&(e+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),e+="/>",e};fi.prototype.toDOMElement=function(r){var e=this.toPathData(r),t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",e),t};function qT(r){throw new Error(r)}function ax(r,e){r||qT(e)}var Gt={fail:qT,argument:ax,assert:ax},sx=32768,ox=2147483648,nc={},it={},Qt={};function Na(r){return function(){return r}}it.BYTE=function(r){return Gt.argument(r>=0&&r<=255,"Byte value should be between 0 and 255."),[r]};Qt.BYTE=Na(1);it.CHAR=function(r){return[r.charCodeAt(0)]};Qt.CHAR=Na(1);it.CHARARRAY=function(r){typeof r>"u"&&(r="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var e=[],t=0;t<r.length;t+=1)e[t]=r.charCodeAt(t);return e};Qt.CHARARRAY=function(r){return typeof r>"u"?0:r.length};it.USHORT=function(r){return[r>>8&255,r&255]};Qt.USHORT=Na(2);it.SHORT=function(r){return r>=sx&&(r=-(2*sx-r)),[r>>8&255,r&255]};Qt.SHORT=Na(2);it.UINT24=function(r){return[r>>16&255,r>>8&255,r&255]};Qt.UINT24=Na(3);it.ULONG=function(r){return[r>>24&255,r>>16&255,r>>8&255,r&255]};Qt.ULONG=Na(4);it.LONG=function(r){return r>=ox&&(r=-(2*ox-r)),[r>>24&255,r>>16&255,r>>8&255,r&255]};Qt.LONG=Na(4);it.FIXED=it.ULONG;Qt.FIXED=Qt.ULONG;it.FWORD=it.SHORT;Qt.FWORD=Qt.SHORT;it.UFWORD=it.USHORT;Qt.UFWORD=Qt.USHORT;it.LONGDATETIME=function(r){return[0,0,0,0,r>>24&255,r>>16&255,r>>8&255,r&255]};Qt.LONGDATETIME=Na(8);it.TAG=function(r){return Gt.argument(r.length===4,"Tag should be exactly 4 ASCII characters."),[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3)]};Qt.TAG=Na(4);it.Card8=it.BYTE;Qt.Card8=Qt.BYTE;it.Card16=it.USHORT;Qt.Card16=Qt.USHORT;it.OffSize=it.BYTE;Qt.OffSize=Qt.BYTE;it.SID=it.USHORT;Qt.SID=Qt.USHORT;it.NUMBER=function(r){return r>=-107&&r<=107?[r+139]:r>=108&&r<=1131?(r=r-108,[(r>>8)+247,r&255]):r>=-1131&&r<=-108?(r=-r-108,[(r>>8)+251,r&255]):r>=-32768&&r<=32767?it.NUMBER16(r):it.NUMBER32(r)};Qt.NUMBER=function(r){return it.NUMBER(r).length};it.NUMBER16=function(r){return[28,r>>8&255,r&255]};Qt.NUMBER16=Na(3);it.NUMBER32=function(r){return[29,r>>24&255,r>>16&255,r>>8&255,r&255]};Qt.NUMBER32=Na(5);it.REAL=function(r){var e=r.toString(),t=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);if(t){var n=parseFloat("1e"+((t[2]?+t[2]:0)+t[1].length));e=(Math.round(r*n)/n).toString()}for(var i="",a=0,s=e.length;a<s;a+=1){var o=e[a];o==="e"?i+=e[++a]==="-"?"c":"b":o==="."?i+="a":o==="-"?i+="e":i+=o}i+=i.length&1?"f":"ff";for(var l=[30],u=0,c=i.length;u<c;u+=2)l.push(parseInt(i.substr(u,2),16));return l};Qt.REAL=function(r){return it.REAL(r).length};it.NAME=it.CHARARRAY;Qt.NAME=Qt.CHARARRAY;it.STRING=it.CHARARRAY;Qt.STRING=Qt.CHARARRAY;nc.UTF8=function(r,e,t){for(var n=[],i=t,a=0;a<i;a++,e+=1)n[a]=r.getUint8(e);return String.fromCharCode.apply(null,n)};nc.UTF16=function(r,e,t){for(var n=[],i=t/2,a=0;a<i;a++,e+=2)n[a]=r.getUint16(e);return String.fromCharCode.apply(null,n)};it.UTF16=function(r){for(var e=[],t=0;t<r.length;t+=1){var n=r.charCodeAt(t);e[e.length]=n>>8&255,e[e.length]=n&255}return e};Qt.UTF16=function(r){return r.length*2};var Yy={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};nc.MACSTRING=function(r,e,t,n){var i=Yy[n];if(i!==void 0){for(var a="",s=0;s<t;s++){var o=r.getUint8(e+s);o<=127?a+=String.fromCharCode(o):a+=i[o&127]}return a}};var Qh=typeof WeakMap=="function"&&new WeakMap,Yh,u5=function(r){if(!Yh){Yh={};for(var e in Yy)Yh[e]=new String(e)}var t=Yh[r];if(t!==void 0){if(Qh){var n=Qh.get(t);if(n!==void 0)return n}var i=Yy[r];if(i!==void 0){for(var a={},s=0;s<i.length;s++)a[i.charCodeAt(s)]=s+128;return Qh&&Qh.set(t,a),a}}};it.MACSTRING=function(r,e){var t=u5(e);if(t!==void 0){for(var n=[],i=0;i<r.length;i++){var a=r.charCodeAt(i);if(a>=128&&(a=t[a],a===void 0))return;n[i]=a}return n}};Qt.MACSTRING=function(r,e){var t=it.MACSTRING(r,e);return t!==void 0?t.length:0};function Xy(r){return r>=-128&&r<=127}function c5(r,e,t){for(var n=0,i=r.length;e<i&&n<64&&r[e]===0;)++e,++n;return t.push(128|n-1),e}function d5(r,e,t){for(var n=0,i=r.length,a=e;a<i&&n<64;){var s=r[a];if(!Xy(s)||s===0&&a+1<i&&r[a+1]===0)break;++a,++n}t.push(n-1);for(var o=e;o<a;++o)t.push(r[o]+256&255);return a}function f5(r,e,t){for(var n=0,i=r.length,a=e;a<i&&n<64;){var s=r[a];if(s===0||Xy(s)&&a+1<i&&Xy(r[a+1]))break;++a,++n}t.push(64|n-1);for(var o=e;o<a;++o){var l=r[o];t.push(l+65536>>8&255,l+256&255)}return a}it.VARDELTAS=function(r){for(var e=0,t=[];e<r.length;){var n=r[e];n===0?e=c5(r,e,t):n>=-128&&n<=127?e=d5(r,e,t):e=f5(r,e,t)}return t};it.INDEX=function(r){for(var e=1,t=[e],n=[],i=0;i<r.length;i+=1){var a=it.OBJECT(r[i]);Array.prototype.push.apply(n,a),e+=a.length,t.push(e)}if(n.length===0)return[0,0];for(var s=[],o=1+Math.floor(Math.log(e)/Math.log(2))/8|0,l=[void 0,it.BYTE,it.USHORT,it.UINT24,it.ULONG][o],u=0;u<t.length;u+=1){var c=l(t[u]);Array.prototype.push.apply(s,c)}return Array.prototype.concat(it.Card16(r.length),it.OffSize(o),s,n)};Qt.INDEX=function(r){return it.INDEX(r).length};it.DICT=function(r){for(var e=[],t=Object.keys(r),n=t.length,i=0;i<n;i+=1){var a=parseInt(t[i],0),s=r[a];e=e.concat(it.OPERAND(s.value,s.type)),e=e.concat(it.OPERATOR(a))}return e};Qt.DICT=function(r){return it.DICT(r).length};it.OPERATOR=function(r){return r<1200?[r]:[12,r-1200]};it.OPERAND=function(r,e){var t=[];if(Array.isArray(e))for(var n=0;n<e.length;n+=1)Gt.argument(r.length===e.length,"Not enough arguments given for type"+e),t=t.concat(it.OPERAND(r[n],e[n]));else if(e==="SID")t=t.concat(it.NUMBER(r));else if(e==="offset")t=t.concat(it.NUMBER32(r));else if(e==="number")t=t.concat(it.NUMBER(r));else if(e==="real")t=t.concat(it.REAL(r));else throw new Error("Unknown operand type "+e);return t};it.OP=it.BYTE;Qt.OP=Qt.BYTE;var Xh=typeof WeakMap=="function"&&new WeakMap;it.CHARSTRING=function(r){if(Xh){var e=Xh.get(r);if(e!==void 0)return e}for(var t=[],n=r.length,i=0;i<n;i+=1){var a=r[i];t=t.concat(it[a.type](a.value))}return Xh&&Xh.set(r,t),t};Qt.CHARSTRING=function(r){return it.CHARSTRING(r).length};it.OBJECT=function(r){var e=it[r.type];return Gt.argument(e!==void 0,"No encoding function for type "+r.type),e(r.value)};Qt.OBJECT=function(r){var e=Qt[r.type];return Gt.argument(e!==void 0,"No sizeOf function for type "+r.type),e(r.value)};it.TABLE=function(r){for(var e=[],t=r.fields.length,n=[],i=[],a=0;a<t;a+=1){var s=r.fields[a],o=it[s.type];Gt.argument(o!==void 0,"No encoding function for field type "+s.type+" ("+s.name+")");var l=r[s.name];l===void 0&&(l=s.value);var u=o(l);s.type==="TABLE"?(i.push(e.length),e=e.concat([0,0]),n.push(u)):e=e.concat(u)}for(var c=0;c<n.length;c+=1){var f=i[c],d=e.length;Gt.argument(d<65536,"Table "+r.tableName+" too big."),e[f]=d>>8,e[f+1]=d&255,e=e.concat(n[c])}return e};Qt.TABLE=function(r){for(var e=0,t=r.fields.length,n=0;n<t;n+=1){var i=r.fields[n],a=Qt[i.type];Gt.argument(a!==void 0,"No sizeOf function for field type "+i.type+" ("+i.name+")");var s=r[i.name];s===void 0&&(s=i.value),e+=a(s),i.type==="TABLE"&&(e+=2)}return e};it.RECORD=it.TABLE;Qt.RECORD=Qt.TABLE;it.LITERAL=function(r){return r};Qt.LITERAL=function(r){return r.length};function yi(r,e,t){if(e.length&&(e[0].name!=="coverageFormat"||e[0].value===1))for(var n=0;n<e.length;n+=1){var i=e[n];this[i.name]=i.value}if(this.tableName=r,this.fields=e,t)for(var a=Object.keys(t),s=0;s<a.length;s+=1){var o=a[s],l=t[o];this[o]!==void 0&&(this[o]=l)}}yi.prototype.encode=function(){return it.TABLE(this)};yi.prototype.sizeOf=function(){return Qt.TABLE(this)};function Af(r,e,t){t===void 0&&(t=e.length);var n=new Array(e.length+1);n[0]={name:r+"Count",type:"USHORT",value:t};for(var i=0;i<e.length;i++)n[i+1]={name:r+i,type:"USHORT",value:e[i]};return n}function Jy(r,e,t){var n=e.length,i=new Array(n+1);i[0]={name:r+"Count",type:"USHORT",value:n};for(var a=0;a<n;a++)i[a+1]={name:r+a,type:"TABLE",value:t(e[a],a)};return i}function wf(r,e,t){var n=e.length,i=[];i[0]={name:r+"Count",type:"USHORT",value:n};for(var a=0;a<n;a++)i=i.concat(t(e[a],a));return i}function sg(r){r.format===1?yi.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(Af("glyph",r.glyphs))):r.format===2?yi.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(wf("rangeRecord",r.ranges,function(e){return[{name:"startGlyphID",type:"USHORT",value:e.start},{name:"endGlyphID",type:"USHORT",value:e.end},{name:"startCoverageIndex",type:"USHORT",value:e.index}]}))):Gt.assert(!1,"Coverage format must be 1 or 2.")}sg.prototype=Object.create(yi.prototype);sg.prototype.constructor=sg;function og(r){yi.call(this,"scriptListTable",wf("scriptRecord",r,function(e,t){var n=e.script,i=n.defaultLangSys;return Gt.assert(!!i,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new yi("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new yi("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:i.reqFeatureIndex}].concat(Af("featureIndex",i.featureIndexes)))}].concat(wf("langSys",n.langSysRecords,function(a,s){var o=a.langSys;return[{name:"langSysTag"+s,type:"TAG",value:a.tag},{name:"langSys"+s,type:"TABLE",value:new yi("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:o.reqFeatureIndex}].concat(Af("featureIndex",o.featureIndexes)))}]})))}]}))}og.prototype=Object.create(yi.prototype);og.prototype.constructor=og;function lg(r){yi.call(this,"featureListTable",wf("featureRecord",r,function(e,t){var n=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new yi("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat(Af("lookupListIndex",n.lookupListIndexes)))}]}))}lg.prototype=Object.create(yi.prototype);lg.prototype.constructor=lg;function ug(r,e){yi.call(this,"lookupListTable",Jy("lookup",r,function(t){var n=e[t.lookupType];return Gt.assert(!!n,"Unable to write GSUB lookup type "+t.lookupType+" tables."),new yi("lookupTable",[{name:"lookupType",type:"USHORT",value:t.lookupType},{name:"lookupFlag",type:"USHORT",value:t.lookupFlag}].concat(Jy("subtable",t.subtables,n)))}))}ug.prototype=Object.create(yi.prototype);ug.prototype.constructor=ug;var dt={Table:yi,Record:yi,Coverage:sg,ScriptList:og,FeatureList:lg,LookupList:ug,ushortList:Af,tableList:Jy,recordList:wf};function lx(r,e){return r.getUint8(e)}function cg(r,e){return r.getUint16(e,!1)}function h5(r,e){return r.getInt16(e,!1)}function f1(r,e){return r.getUint32(e,!1)}function WT(r,e){var t=r.getInt16(e,!1),n=r.getUint16(e+2,!1);return t+n/65535}function p5(r,e){for(var t="",n=e;n<e+4;n+=1)t+=String.fromCharCode(r.getInt8(n));return t}function g5(r,e,t){for(var n=0,i=0;i<t;i+=1)n<<=8,n+=r.getUint8(e+i);return n}function m5(r,e,t){for(var n=[],i=e;i<t;i+=1)n.push(r.getUint8(i));return n}function v5(r){for(var e="",t=0;t<r.length;t+=1)e+=String.fromCharCode(r[t]);return e}var y5={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function be(r,e){this.data=r,this.offset=e,this.relativeOffset=0}be.prototype.parseByte=function(){var r=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,r};be.prototype.parseChar=function(){var r=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,r};be.prototype.parseCard8=be.prototype.parseByte;be.prototype.parseUShort=function(){var r=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,r};be.prototype.parseCard16=be.prototype.parseUShort;be.prototype.parseSID=be.prototype.parseUShort;be.prototype.parseOffset16=be.prototype.parseUShort;be.prototype.parseShort=function(){var r=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,r};be.prototype.parseF2Dot14=function(){var r=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,r};be.prototype.parseULong=function(){var r=f1(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,r};be.prototype.parseOffset32=be.prototype.parseULong;be.prototype.parseFixed=function(){var r=WT(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,r};be.prototype.parseString=function(r){var e=this.data,t=this.offset+this.relativeOffset,n="";this.relativeOffset+=r;for(var i=0;i<r;i++)n+=String.fromCharCode(e.getUint8(t+i));return n};be.prototype.parseTag=function(){return this.parseString(4)};be.prototype.parseLongDateTime=function(){var r=f1(this.data,this.offset+this.relativeOffset+4);return r-=2082844800,this.relativeOffset+=8,r};be.prototype.parseVersion=function(r){var e=cg(this.data,this.offset+this.relativeOffset),t=cg(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,r===void 0&&(r=4096),e+t/r/10};be.prototype.skip=function(r,e){e===void 0&&(e=1),this.relativeOffset+=y5[r]*e};be.prototype.parseULongList=function(r){r===void 0&&(r=this.parseULong());for(var e=new Array(r),t=this.data,n=this.offset+this.relativeOffset,i=0;i<r;i++)e[i]=t.getUint32(n),n+=4;return this.relativeOffset+=r*4,e};be.prototype.parseOffset16List=be.prototype.parseUShortList=function(r){r===void 0&&(r=this.parseUShort());for(var e=new Array(r),t=this.data,n=this.offset+this.relativeOffset,i=0;i<r;i++)e[i]=t.getUint16(n),n+=2;return this.relativeOffset+=r*2,e};be.prototype.parseShortList=function(r){for(var e=new Array(r),t=this.data,n=this.offset+this.relativeOffset,i=0;i<r;i++)e[i]=t.getInt16(n),n+=2;return this.relativeOffset+=r*2,e};be.prototype.parseByteList=function(r){for(var e=new Array(r),t=this.data,n=this.offset+this.relativeOffset,i=0;i<r;i++)e[i]=t.getUint8(n++);return this.relativeOffset+=r,e};be.prototype.parseList=function(r,e){e||(e=r,r=this.parseUShort());for(var t=new Array(r),n=0;n<r;n++)t[n]=e.call(this);return t};be.prototype.parseList32=function(r,e){e||(e=r,r=this.parseULong());for(var t=new Array(r),n=0;n<r;n++)t[n]=e.call(this);return t};be.prototype.parseRecordList=function(r,e){e||(e=r,r=this.parseUShort());for(var t=new Array(r),n=Object.keys(e),i=0;i<r;i++){for(var a={},s=0;s<n.length;s++){var o=n[s],l=e[o];a[o]=l.call(this)}t[i]=a}return t};be.prototype.parseRecordList32=function(r,e){e||(e=r,r=this.parseULong());for(var t=new Array(r),n=Object.keys(e),i=0;i<r;i++){for(var a={},s=0;s<n.length;s++){var o=n[s],l=e[o];a[o]=l.call(this)}t[i]=a}return t};be.prototype.parseStruct=function(r){if(typeof r=="function")return r.call(this);for(var e=Object.keys(r),t={},n=0;n<e.length;n++){var i=e[n],a=r[i];t[i]=a.call(this)}return t};be.prototype.parseValueRecord=function(r){if(r===void 0&&(r=this.parseUShort()),r!==0){var e={};return r&1&&(e.xPlacement=this.parseShort()),r&2&&(e.yPlacement=this.parseShort()),r&4&&(e.xAdvance=this.parseShort()),r&8&&(e.yAdvance=this.parseShort()),r&16&&(e.xPlaDevice=void 0,this.parseShort()),r&32&&(e.yPlaDevice=void 0,this.parseShort()),r&64&&(e.xAdvDevice=void 0,this.parseShort()),r&128&&(e.yAdvDevice=void 0,this.parseShort()),e}};be.prototype.parseValueRecordList=function(){for(var r=this.parseUShort(),e=this.parseUShort(),t=new Array(e),n=0;n<e;n++)t[n]=this.parseValueRecord(r);return t};be.prototype.parsePointer=function(r){var e=this.parseOffset16();if(e>0)return new be(this.data,this.offset+e).parseStruct(r)};be.prototype.parsePointer32=function(r){var e=this.parseOffset32();if(e>0)return new be(this.data,this.offset+e).parseStruct(r)};be.prototype.parseListOfLists=function(r){for(var e=this.parseOffset16List(),t=e.length,n=this.relativeOffset,i=new Array(t),a=0;a<t;a++){var s=e[a];if(s===0){i[a]=void 0;continue}if(this.relativeOffset=s,r){for(var o=this.parseOffset16List(),l=new Array(o.length),u=0;u<o.length;u++)this.relativeOffset=s+o[u],l[u]=r.call(this);i[a]=l}else i[a]=this.parseUShortList()}return this.relativeOffset=n,i};be.prototype.parseCoverage=function(){var r=this.offset+this.relativeOffset,e=this.parseUShort(),t=this.parseUShort();if(e===1)return{format:1,glyphs:this.parseUShortList(t)};if(e===2){for(var n=new Array(t),i=0;i<t;i++)n[i]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:n}}throw new Error("0x"+r.toString(16)+": Coverage format must be 1 or 2.")};be.prototype.parseClassDef=function(){var r=this.offset+this.relativeOffset,e=this.parseUShort();if(e===1)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(e===2)return{format:2,ranges:this.parseRecordList({start:be.uShort,end:be.uShort,classId:be.uShort})};throw new Error("0x"+r.toString(16)+": ClassDef format must be 1 or 2.")};be.list=function(r,e){return function(){return this.parseList(r,e)}};be.list32=function(r,e){return function(){return this.parseList32(r,e)}};be.recordList=function(r,e){return function(){return this.parseRecordList(r,e)}};be.recordList32=function(r,e){return function(){return this.parseRecordList32(r,e)}};be.pointer=function(r){return function(){return this.parsePointer(r)}};be.pointer32=function(r){return function(){return this.parsePointer32(r)}};be.tag=be.prototype.parseTag;be.byte=be.prototype.parseByte;be.uShort=be.offset16=be.prototype.parseUShort;be.uShortList=be.prototype.parseUShortList;be.uLong=be.offset32=be.prototype.parseULong;be.uLongList=be.prototype.parseULongList;be.struct=be.prototype.parseStruct;be.coverage=be.prototype.parseCoverage;be.classDef=be.prototype.parseClassDef;var ux={reserved:be.uShort,reqFeatureIndex:be.uShort,featureIndexes:be.uShortList};be.prototype.parseScriptList=function(){return this.parsePointer(be.recordList({tag:be.tag,script:be.pointer({defaultLangSys:be.pointer(ux),langSysRecords:be.recordList({tag:be.tag,langSys:be.pointer(ux)})})}))||[]};be.prototype.parseFeatureList=function(){return this.parsePointer(be.recordList({tag:be.tag,feature:be.pointer({featureParams:be.offset16,lookupListIndexes:be.uShortList})}))||[]};be.prototype.parseLookupList=function(r){return this.parsePointer(be.list(be.pointer(function(){var e=this.parseUShort();Gt.argument(1<=e&&e<=9,"GPOS/GSUB lookup type "+e+" unknown.");var t=this.parseUShort(),n=t&16;return{lookupType:e,lookupFlag:t,subtables:this.parseList(be.pointer(r[e])),markFilteringSet:n?this.parseUShort():void 0}})))||[]};be.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var r=this.parseUShort(),e=this.parseUShort();Gt.argument(r===1&&e<1,"GPOS/GSUB feature variations table unknown.");var t=this.parseRecordList32({conditionSetOffset:be.offset32,featureTableSubstitutionOffset:be.offset32});return t})||[]};var vt={getByte:lx,getCard8:lx,getUShort:cg,getCard16:cg,getShort:h5,getULong:f1,getFixed:WT,getTag:p5,getOffset:g5,getBytes:m5,bytesToString:v5,Parser:be};function A5(r,e){e.parseUShort(),r.length=e.parseULong(),r.language=e.parseULong();var t;r.groupCount=t=e.parseULong(),r.glyphIndexMap={};for(var n=0;n<t;n+=1)for(var i=e.parseULong(),a=e.parseULong(),s=e.parseULong(),o=i;o<=a;o+=1)r.glyphIndexMap[o]=s,s++}function w5(r,e,t,n,i){r.length=e.parseUShort(),r.language=e.parseUShort();var a;r.segCount=a=e.parseUShort()>>1,e.skip("uShort",3),r.glyphIndexMap={};for(var s=new vt.Parser(t,n+i+14),o=new vt.Parser(t,n+i+16+a*2),l=new vt.Parser(t,n+i+16+a*4),u=new vt.Parser(t,n+i+16+a*6),c=n+i+16+a*8,f=0;f<a-1;f+=1)for(var d=void 0,h=s.parseUShort(),g=o.parseUShort(),v=l.parseShort(),y=u.parseUShort(),A=g;A<=h;A+=1)y!==0?(c=u.offset+u.relativeOffset-2,c+=y,c+=(A-g)*2,d=vt.getUShort(t,c),d!==0&&(d=d+v&65535)):d=A+v&65535,r.glyphIndexMap[A]=d}function b5(r,e){var t={};t.version=vt.getUShort(r,e),Gt.argument(t.version===0,"cmap table version should be 0."),t.numTables=vt.getUShort(r,e+2);for(var n=-1,i=t.numTables-1;i>=0;i-=1){var a=vt.getUShort(r,e+4+i*8),s=vt.getUShort(r,e+4+i*8+2);if(a===3&&(s===0||s===1||s===10)||a===0&&(s===0||s===1||s===2||s===3||s===4)){n=vt.getULong(r,e+4+i*8+4);break}}if(n===-1)throw new Error("No valid cmap sub-tables found.");var o=new vt.Parser(r,e+n);if(t.format=o.parseUShort(),t.format===12)A5(t,o);else if(t.format===4)w5(t,o,r,e,n);else throw new Error("Only format 4 and 12 cmap tables are supported (found format "+t.format+").");return t}function C5(r,e,t){r.segments.push({end:e,start:e,delta:-(e-t),offset:0,glyphIndex:t})}function x5(r){r.segments.push({end:65535,start:65535,delta:1,offset:0})}function S5(r){var e=!0,t;for(t=r.length-1;t>0;t-=1){var n=r.get(t);if(n.unicode>65535){console.log("Adding CMAP format 12 (needed!)"),e=!1;break}}var i=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:e?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:e?12:20}];e||(i=i.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),i=i.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var a=new dt.Table("cmap",i);for(a.segments=[],t=0;t<r.length;t+=1){for(var s=r.get(t),o=0;o<s.unicodes.length;o+=1)C5(a,s.unicodes[o],t);a.segments=a.segments.sort(function(C,S){return C.start-S.start})}x5(a);var l=a.segments.length,u=0,c=[],f=[],d=[],h=[],g=[],v=[];for(t=0;t<l;t+=1){var y=a.segments[t];y.end<=65535&&y.start<=65535?(c=c.concat({name:"end_"+t,type:"USHORT",value:y.end}),f=f.concat({name:"start_"+t,type:"USHORT",value:y.start}),d=d.concat({name:"idDelta_"+t,type:"SHORT",value:y.delta}),h=h.concat({name:"idRangeOffset_"+t,type:"USHORT",value:y.offset}),y.glyphId!==void 0&&(g=g.concat({name:"glyph_"+t,type:"USHORT",value:y.glyphId}))):u+=1,!e&&y.glyphIndex!==void 0&&(v=v.concat({name:"cmap12Start_"+t,type:"ULONG",value:y.start}),v=v.concat({name:"cmap12End_"+t,type:"ULONG",value:y.end}),v=v.concat({name:"cmap12Glyph_"+t,type:"ULONG",value:y.glyphIndex}))}if(a.segCountX2=(l-u)*2,a.searchRange=Math.pow(2,Math.floor(Math.log(l-u)/Math.log(2)))*2,a.entrySelector=Math.log(a.searchRange/2)/Math.log(2),a.rangeShift=a.segCountX2-a.searchRange,a.fields=a.fields.concat(c),a.fields.push({name:"reservedPad",type:"USHORT",value:0}),a.fields=a.fields.concat(f),a.fields=a.fields.concat(d),a.fields=a.fields.concat(h),a.fields=a.fields.concat(g),a.cmap4Length=14+c.length*2+2+f.length*2+d.length*2+h.length*2+g.length*2,!e){var A=16+v.length*4;a.cmap12Offset=20+a.cmap4Length,a.fields=a.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:A},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:v.length/3}]),a.fields=a.fields.concat(v)}return a}var QT={parse:b5,make:S5},Gp=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],E5=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],k5=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],ml=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function YT(r){this.font=r}YT.prototype.charToGlyphIndex=function(r){var e=r.codePointAt(0),t=this.font.glyphs;if(t){for(var n=0;n<t.length;n+=1)for(var i=t.get(n),a=0;a<i.unicodes.length;a+=1)if(i.unicodes[a]===e)return n}return null};function XT(r){this.cmap=r}XT.prototype.charToGlyphIndex=function(r){return this.cmap.glyphIndexMap[r.codePointAt(0)]||0};function dg(r,e){this.encoding=r,this.charset=e}dg.prototype.charToGlyphIndex=function(r){var e=r.codePointAt(0),t=this.encoding[e];return this.charset.indexOf(t)};function h1(r){switch(r.version){case 1:this.names=ml.slice();break;case 2:this.names=new Array(r.numberOfGlyphs);for(var e=0;e<r.numberOfGlyphs;e++)r.glyphNameIndex[e]<ml.length?this.names[e]=ml[r.glyphNameIndex[e]]:this.names[e]=r.names[r.glyphNameIndex[e]-ml.length];break;case 2.5:this.names=new Array(r.numberOfGlyphs);for(var t=0;t<r.numberOfGlyphs;t++)this.names[t]=ml[t+r.glyphNameIndex[t]];break;case 3:this.names=[];break;default:this.names=[];break}}h1.prototype.nameToGlyphIndex=function(r){return this.names.indexOf(r)};h1.prototype.glyphIndexToName=function(r){return this.names[r]};function T5(r){for(var e,t=r.tables.cmap.glyphIndexMap,n=Object.keys(t),i=0;i<n.length;i+=1){var a=n[i],s=t[a];e=r.glyphs.get(s),e.addUnicode(parseInt(a))}for(var o=0;o<r.glyphs.length;o+=1)e=r.glyphs.get(o),r.cffEncoding?r.isCIDFont?e.name="gid"+o:e.name=r.cffEncoding.charset[o]:r.glyphNames.names&&(e.name=r.glyphNames.glyphIndexToName(o))}function F5(r){r._IndexToUnicodeMap={};for(var e=r.tables.cmap.glyphIndexMap,t=Object.keys(e),n=0;n<t.length;n+=1){var i=t[n],a=e[i];r._IndexToUnicodeMap[a]===void 0?r._IndexToUnicodeMap[a]={unicodes:[parseInt(i)]}:r._IndexToUnicodeMap[a].unicodes.push(parseInt(i))}}function I5(r,e){e.lowMemory?F5(r):T5(r)}function P5(r,e,t,n,i){r.beginPath(),r.moveTo(e,t),r.lineTo(n,i),r.stroke()}var dl={line:P5};function D5(r,e){var t=e||new fi;return{configurable:!0,get:function(){return typeof t=="function"&&(t=t()),t},set:function(n){t=n}}}function ga(r){this.bindConstructorValues(r)}ga.prototype.bindConstructorValues=function(r){this.index=r.index||0,this.name=r.name||null,this.unicode=r.unicode||void 0,this.unicodes=r.unicodes||r.unicode!==void 0?[r.unicode]:[],"xMin"in r&&(this.xMin=r.xMin),"yMin"in r&&(this.yMin=r.yMin),"xMax"in r&&(this.xMax=r.xMax),"yMax"in r&&(this.yMax=r.yMax),"advanceWidth"in r&&(this.advanceWidth=r.advanceWidth),Object.defineProperty(this,"path",D5(this,r.path))};ga.prototype.addUnicode=function(r){this.unicodes.length===0&&(this.unicode=r),this.unicodes.push(r)};ga.prototype.getBoundingBox=function(){return this.path.getBoundingBox()};ga.prototype.getPath=function(r,e,t,n,i){r=r!==void 0?r:0,e=e!==void 0?e:0,t=t!==void 0?t:72;var a,s;n||(n={});var o=n.xScale,l=n.yScale;if(n.hinting&&i&&i.hinting&&(s=this.path&&i.hinting.exec(this,t)),s)a=i.hinting.getCommands(s),r=Math.round(r),e=Math.round(e),o=l=1;else{a=this.path.commands;var u=1/(this.path.unitsPerEm||1e3)*t;o===void 0&&(o=u),l===void 0&&(l=u)}for(var c=new fi,f=0;f<a.length;f+=1){var d=a[f];d.type==="M"?c.moveTo(r+d.x*o,e+-d.y*l):d.type==="L"?c.lineTo(r+d.x*o,e+-d.y*l):d.type==="Q"?c.quadraticCurveTo(r+d.x1*o,e+-d.y1*l,r+d.x*o,e+-d.y*l):d.type==="C"?c.curveTo(r+d.x1*o,e+-d.y1*l,r+d.x2*o,e+-d.y2*l,r+d.x*o,e+-d.y*l):d.type==="Z"&&c.closePath()}return c};ga.prototype.getContours=function(){if(this.points===void 0)return[];for(var r=[],e=[],t=0;t<this.points.length;t+=1){var n=this.points[t];e.push(n),n.lastPointOfContour&&(r.push(e),e=[])}return Gt.argument(e.length===0,"There are still points left in the current contour."),r};ga.prototype.getMetrics=function(){for(var r=this.path.commands,e=[],t=[],n=0;n<r.length;n+=1){var i=r[n];i.type!=="Z"&&(e.push(i.x),t.push(i.y)),(i.type==="Q"||i.type==="C")&&(e.push(i.x1),t.push(i.y1)),i.type==="C"&&(e.push(i.x2),t.push(i.y2))}var a={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,e),yMax:Math.max.apply(null,t),leftSideBearing:this.leftSideBearing};return isFinite(a.xMin)||(a.xMin=0),isFinite(a.xMax)||(a.xMax=this.advanceWidth),isFinite(a.yMin)||(a.yMin=0),isFinite(a.yMax)||(a.yMax=0),a.rightSideBearing=this.advanceWidth-a.leftSideBearing-(a.xMax-a.xMin),a};ga.prototype.draw=function(r,e,t,n,i){this.getPath(e,t,n,i).draw(r)};ga.prototype.drawPoints=function(r,e,t,n){function i(f,d,h,g){r.beginPath();for(var v=0;v<f.length;v+=1)r.moveTo(d+f[v].x*g,h+f[v].y*g),r.arc(d+f[v].x*g,h+f[v].y*g,2,0,Math.PI*2,!1);r.closePath(),r.fill()}e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:24;for(var a=1/this.path.unitsPerEm*n,s=[],o=[],l=this.path,u=0;u<l.commands.length;u+=1){var c=l.commands[u];c.x!==void 0&&s.push({x:c.x,y:-c.y}),c.x1!==void 0&&o.push({x:c.x1,y:-c.y1}),c.x2!==void 0&&o.push({x:c.x2,y:-c.y2})}r.fillStyle="blue",i(s,e,t,a),r.fillStyle="red",i(o,e,t,a)};ga.prototype.drawMetrics=function(r,e,t,n){var i;e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:24,i=1/this.path.unitsPerEm*n,r.lineWidth=1,r.strokeStyle="black",dl.line(r,e,-1e4,e,1e4),dl.line(r,-1e4,t,1e4,t);var a=this.xMin||0,s=this.yMin||0,o=this.xMax||0,l=this.yMax||0,u=this.advanceWidth||0;r.strokeStyle="blue",dl.line(r,e+a*i,-1e4,e+a*i,1e4),dl.line(r,e+o*i,-1e4,e+o*i,1e4),dl.line(r,-1e4,t+-s*i,1e4,t+-s*i),dl.line(r,-1e4,t+-l*i,1e4,t+-l*i),r.strokeStyle="green",dl.line(r,e+u*i,-1e4,e+u*i,1e4)};function Jh(r,e,t){Object.defineProperty(r,e,{get:function(){return r.path,r[t]},set:function(n){r[t]=n},enumerable:!0,configurable:!0})}function p1(r,e){if(this.font=r,this.glyphs={},Array.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];n.path.unitsPerEm=r.unitsPerEm,this.glyphs[t]=n}this.length=e&&e.length||0}p1.prototype.get=function(r){if(this.glyphs[r]===void 0){this.font._push(r),typeof this.glyphs[r]=="function"&&(this.glyphs[r]=this.glyphs[r]());var e=this.glyphs[r],t=this.font._IndexToUnicodeMap[r];if(t)for(var n=0;n<t.unicodes.length;n++)e.addUnicode(t.unicodes[n]);this.font.cffEncoding?this.font.isCIDFont?e.name="gid"+r:e.name=this.font.cffEncoding.charset[r]:this.font.glyphNames.names&&(e.name=this.font.glyphNames.glyphIndexToName(r)),this.glyphs[r].advanceWidth=this.font._hmtxTableData[r].advanceWidth,this.glyphs[r].leftSideBearing=this.font._hmtxTableData[r].leftSideBearing}else typeof this.glyphs[r]=="function"&&(this.glyphs[r]=this.glyphs[r]());return this.glyphs[r]};p1.prototype.push=function(r,e){this.glyphs[r]=e,this.length++};function R5(r,e){return new ga({index:e,font:r})}function O5(r,e,t,n,i,a){return function(){var s=new ga({index:e,font:r});return s.path=function(){t(s,n,i);var o=a(r.glyphs,s);return o.unitsPerEm=r.unitsPerEm,o},Jh(s,"xMin","_xMin"),Jh(s,"xMax","_xMax"),Jh(s,"yMin","_yMin"),Jh(s,"yMax","_yMax"),s}}function B5(r,e,t,n){return function(){var i=new ga({index:e,font:r});return i.path=function(){var a=t(r,i,n);return a.unitsPerEm=r.unitsPerEm,a},i}}var os={GlyphSet:p1,glyphLoader:R5,ttfGlyphLoader:O5,cffGlyphLoader:B5};function JT(r,e){if(r===e)return!0;if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t+=1)if(!JT(r[t],e[t]))return!1;return!0}else return!1}function Ky(r){var e;return r.length<1240?e=107:r.length<33900?e=1131:e=32768,e}function no(r,e,t){var n=[],i=[],a=vt.getCard16(r,e),s,o;if(a!==0){var l=vt.getByte(r,e+2);s=e+(a+1)*l+2;for(var u=e+3,c=0;c<a+1;c+=1)n.push(vt.getOffset(r,u,l)),u+=l;o=s+n[a]}else o=e+2;for(var f=0;f<n.length-1;f+=1){var d=vt.getBytes(r,s+n[f],s+n[f+1]);t&&(d=t(d)),i.push(d)}return{objects:i,startOffset:e,endOffset:o}}function M5(r,e){var t=[],n=vt.getCard16(r,e),i,a;if(n!==0){var s=vt.getByte(r,e+2);i=e+(n+1)*s+2;for(var o=e+3,l=0;l<n+1;l+=1)t.push(vt.getOffset(r,o,s)),o+=s;a=i+t[n]}else a=e+2;return{offsets:t,startOffset:e,endOffset:a}}function _5(r,e,t,n,i){var a=vt.getCard16(t,n),s=0;if(a!==0){var o=vt.getByte(t,n+2);s=n+(a+1)*o+2}var l=vt.getBytes(t,s+e[r],s+e[r+1]);return l}function N5(r){for(var e="",t=15,n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var i=r.parseByte(),a=i>>4,s=i&15;if(a===t||(e+=n[a],s===t))break;e+=n[s]}return parseFloat(e)}function L5(r,e){var t,n,i,a;if(e===28)return t=r.parseByte(),n=r.parseByte(),t<<8|n;if(e===29)return t=r.parseByte(),n=r.parseByte(),i=r.parseByte(),a=r.parseByte(),t<<24|n<<16|i<<8|a;if(e===30)return N5(r);if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return t=r.parseByte(),(e-247)*256+t+108;if(e>=251&&e<=254)return t=r.parseByte(),-(e-251)*256-t-108;throw new Error("Invalid b0 "+e)}function U5(r){for(var e={},t=0;t<r.length;t+=1){var n=r[t][0],i=r[t][1],a=void 0;if(i.length===1?a=i[0]:a=i,e.hasOwnProperty(n)&&!isNaN(e[n]))throw new Error("Object "+e+" already has key "+n);e[n]=a}return e}function KT(r,e,t){e=e!==void 0?e:0;var n=new vt.Parser(r,e),i=[],a=[];for(t=t!==void 0?t:r.length;n.relativeOffset<t;){var s=n.parseByte();s<=21?(s===12&&(s=1200+n.parseByte()),i.push([s,a]),a=[]):a.push(L5(n,s))}return U5(i)}function Xd(r,e){return e<=390?e=Gp[e]:e=r[e-391],e}function ZT(r,e,t){for(var n={},i,a=0;a<e.length;a+=1){var s=e[a];if(Array.isArray(s.type)){var o=[];o.length=s.type.length;for(var l=0;l<s.type.length;l++)i=r[s.op]!==void 0?r[s.op][l]:void 0,i===void 0&&(i=s.value!==void 0&&s.value[l]!==void 0?s.value[l]:null),s.type[l]==="SID"&&(i=Xd(t,i)),o[l]=i;n[s.name]=o}else i=r[s.op],i===void 0&&(i=s.value!==void 0?s.value:null),s.type==="SID"&&(i=Xd(t,i)),n[s.name]=i}return n}function V5(r,e){var t={};return t.formatMajor=vt.getCard8(r,e),t.formatMinor=vt.getCard8(r,e+1),t.size=vt.getCard8(r,e+2),t.offsetSize=vt.getCard8(r,e+3),t.startOffset=e,t.endOffset=e+4,t}var eF=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],tF=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];function z5(r,e){var t=KT(r,0,r.byteLength);return ZT(t,eF,e)}function rF(r,e,t,n){var i=KT(r,e,t);return ZT(i,tF,n)}function cx(r,e,t,n){for(var i=[],a=0;a<t.length;a+=1){var s=new DataView(new Uint8Array(t[a]).buffer),o=z5(s,n);o._subrs=[],o._subrsBias=0,o._defaultWidthX=0,o._nominalWidthX=0;var l=o.private[0],u=o.private[1];if(l!==0&&u!==0){var c=rF(r,u+e,l,n);if(o._defaultWidthX=c.defaultWidthX,o._nominalWidthX=c.nominalWidthX,c.subrs!==0){var f=u+c.subrs,d=no(r,f+e);o._subrs=d.objects,o._subrsBias=Ky(o._subrs)}o._privateDict=c}i.push(o)}return i}function $5(r,e,t,n){var i,a,s=new vt.Parser(r,e);t-=1;var o=[".notdef"],l=s.parseCard8();if(l===0)for(var u=0;u<t;u+=1)i=s.parseSID(),o.push(Xd(n,i));else if(l===1)for(;o.length<=t;){i=s.parseSID(),a=s.parseCard8();for(var c=0;c<=a;c+=1)o.push(Xd(n,i)),i+=1}else if(l===2)for(;o.length<=t;){i=s.parseSID(),a=s.parseCard16();for(var f=0;f<=a;f+=1)o.push(Xd(n,i)),i+=1}else throw new Error("Unknown charset format "+l);return o}function H5(r,e,t){var n,i={},a=new vt.Parser(r,e),s=a.parseCard8();if(s===0)for(var o=a.parseCard8(),l=0;l<o;l+=1)n=a.parseCard8(),i[n]=l;else if(s===1){var u=a.parseCard8();n=1;for(var c=0;c<u;c+=1)for(var f=a.parseCard8(),d=a.parseCard8(),h=f;h<=f+d;h+=1)i[h]=n,n+=1}else throw new Error("Unknown encoding format "+s);return new dg(i,t)}function dx(r,e,t){var n,i,a,s,o=new fi,l=[],u=0,c=!1,f=!1,d=0,h=0,g,v,y,A;if(r.isCIDFont){var C=r.tables.cff.topDict._fdSelect[e.index],S=r.tables.cff.topDict._fdArray[C];g=S._subrs,v=S._subrsBias,y=S._defaultWidthX,A=S._nominalWidthX}else g=r.tables.cff.topDict._subrs,v=r.tables.cff.topDict._subrsBias,y=r.tables.cff.topDict._defaultWidthX,A=r.tables.cff.topDict._nominalWidthX;var F=y;function E(G,j){f&&o.closePath(),o.moveTo(G,j),f=!0}function R(){var G;G=l.length%2!==0,G&&!c&&(F=l.shift()+A),u+=l.length>>1,l.length=0,c=!0}function B(G){for(var j,ie,q,Y,J,ae,oe,he,ye,Ue,Re,Oe,ee=0;ee<G.length;){var re=G[ee];switch(ee+=1,re){case 1:R();break;case 3:R();break;case 4:l.length>1&&!c&&(F=l.shift()+A,c=!0),h+=l.pop(),E(d,h);break;case 5:for(;l.length>0;)d+=l.shift(),h+=l.shift(),o.lineTo(d,h);break;case 6:for(;l.length>0&&(d+=l.shift(),o.lineTo(d,h),l.length!==0);)h+=l.shift(),o.lineTo(d,h);break;case 7:for(;l.length>0&&(h+=l.shift(),o.lineTo(d,h),l.length!==0);)d+=l.shift(),o.lineTo(d,h);break;case 8:for(;l.length>0;)n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+l.shift(),o.curveTo(n,i,a,s,d,h);break;case 10:J=l.pop()+v,ae=g[J],ae&&B(ae);break;case 11:return;case 12:switch(re=G[ee],ee+=1,re){case 35:n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),oe=a+l.shift(),he=s+l.shift(),ye=oe+l.shift(),Ue=he+l.shift(),Re=ye+l.shift(),Oe=Ue+l.shift(),d=Re+l.shift(),h=Oe+l.shift(),l.shift(),o.curveTo(n,i,a,s,oe,he),o.curveTo(ye,Ue,Re,Oe,d,h);break;case 34:n=d+l.shift(),i=h,a=n+l.shift(),s=i+l.shift(),oe=a+l.shift(),he=s,ye=oe+l.shift(),Ue=s,Re=ye+l.shift(),Oe=h,d=Re+l.shift(),o.curveTo(n,i,a,s,oe,he),o.curveTo(ye,Ue,Re,Oe,d,h);break;case 36:n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),oe=a+l.shift(),he=s,ye=oe+l.shift(),Ue=s,Re=ye+l.shift(),Oe=Ue+l.shift(),d=Re+l.shift(),o.curveTo(n,i,a,s,oe,he),o.curveTo(ye,Ue,Re,Oe,d,h);break;case 37:n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),oe=a+l.shift(),he=s+l.shift(),ye=oe+l.shift(),Ue=he+l.shift(),Re=ye+l.shift(),Oe=Ue+l.shift(),Math.abs(Re-d)>Math.abs(Oe-h)?d=Re+l.shift():h=Oe+l.shift(),o.curveTo(n,i,a,s,oe,he),o.curveTo(ye,Ue,Re,Oe,d,h);break;default:console.log("Glyph "+e.index+": unknown operator 1200"+re),l.length=0}break;case 14:l.length>0&&!c&&(F=l.shift()+A,c=!0),f&&(o.closePath(),f=!1);break;case 18:R();break;case 19:case 20:R(),ee+=u+7>>3;break;case 21:l.length>2&&!c&&(F=l.shift()+A,c=!0),h+=l.pop(),d+=l.pop(),E(d,h);break;case 22:l.length>1&&!c&&(F=l.shift()+A,c=!0),d+=l.pop(),E(d,h);break;case 23:R();break;case 24:for(;l.length>2;)n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+l.shift(),o.curveTo(n,i,a,s,d,h);d+=l.shift(),h+=l.shift(),o.lineTo(d,h);break;case 25:for(;l.length>6;)d+=l.shift(),h+=l.shift(),o.lineTo(d,h);n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+l.shift(),o.curveTo(n,i,a,s,d,h);break;case 26:for(l.length%2&&(d+=l.shift());l.length>0;)n=d,i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a,h=s+l.shift(),o.curveTo(n,i,a,s,d,h);break;case 27:for(l.length%2&&(h+=l.shift());l.length>0;)n=d+l.shift(),i=h,a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s,o.curveTo(n,i,a,s,d,h);break;case 28:j=G[ee],ie=G[ee+1],l.push((j<<24|ie<<16)>>16),ee+=2;break;case 29:J=l.pop()+r.gsubrsBias,ae=r.gsubrs[J],ae&&B(ae);break;case 30:for(;l.length>0&&(n=d,i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+(l.length===1?l.shift():0),o.curveTo(n,i,a,s,d,h),l.length!==0);)n=d+l.shift(),i=h,a=n+l.shift(),s=i+l.shift(),h=s+l.shift(),d=a+(l.length===1?l.shift():0),o.curveTo(n,i,a,s,d,h);break;case 31:for(;l.length>0&&(n=d+l.shift(),i=h,a=n+l.shift(),s=i+l.shift(),h=s+l.shift(),d=a+(l.length===1?l.shift():0),o.curveTo(n,i,a,s,d,h),l.length!==0);)n=d,i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+(l.length===1?l.shift():0),o.curveTo(n,i,a,s,d,h);break;default:re<32?console.log("Glyph "+e.index+": unknown operator "+re):re<247?l.push(re-139):re<251?(j=G[ee],ee+=1,l.push((re-247)*256+j+108)):re<255?(j=G[ee],ee+=1,l.push(-(re-251)*256-j-108)):(j=G[ee],ie=G[ee+1],q=G[ee+2],Y=G[ee+3],ee+=4,l.push((j<<24|ie<<16|q<<8|Y)/65536))}}}return B(t),e.advanceWidth=F,o}function G5(r,e,t,n){var i=[],a,s=new vt.Parser(r,e),o=s.parseCard8();if(o===0)for(var l=0;l<t;l++){if(a=s.parseCard8(),a>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+n+")");i.push(a)}else if(o===3){var u=s.parseCard16(),c=s.parseCard16();if(c!==0)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+c);for(var f,d=0;d<u;d++){if(a=s.parseCard8(),f=s.parseCard16(),a>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+n+")");if(f>t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+f);for(;c<f;c++)i.push(a);c=f}if(f!==t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+f)}else throw new Error("CFF Table CID Font FDSelect table has unsupported format "+o);return i}function j5(r,e,t,n){t.tables.cff={};var i=V5(r,e),a=no(r,i.endOffset,vt.bytesToString),s=no(r,a.endOffset),o=no(r,s.endOffset,vt.bytesToString),l=no(r,o.endOffset);t.gsubrs=l.objects,t.gsubrsBias=Ky(t.gsubrs);var u=cx(r,e,s.objects,o.objects);if(u.length!==1)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+u.length);var c=u[0];if(t.tables.cff.topDict=c,c._privateDict&&(t.defaultWidthX=c._privateDict.defaultWidthX,t.nominalWidthX=c._privateDict.nominalWidthX),c.ros[0]!==void 0&&c.ros[1]!==void 0&&(t.isCIDFont=!0),t.isCIDFont){var f=c.fdArray,d=c.fdSelect;if(f===0||d===0)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");f+=e;var h=no(r,f),g=cx(r,e,h.objects,o.objects);c._fdArray=g,d+=e,c._fdSelect=G5(r,d,t.numGlyphs,g.length)}var v=e+c.private[1],y=rF(r,v,c.private[0],o.objects);if(t.defaultWidthX=y.defaultWidthX,t.nominalWidthX=y.nominalWidthX,y.subrs!==0){var A=v+y.subrs,C=no(r,A);t.subrs=C.objects,t.subrsBias=Ky(t.subrs)}else t.subrs=[],t.subrsBias=0;var S;n.lowMemory?(S=M5(r,e+c.charStrings),t.nGlyphs=S.offsets.length):(S=no(r,e+c.charStrings),t.nGlyphs=S.objects.length);var F=$5(r,e+c.charset,t.nGlyphs,o.objects);if(c.encoding===0?t.cffEncoding=new dg(E5,F):c.encoding===1?t.cffEncoding=new dg(k5,F):t.cffEncoding=H5(r,e+c.encoding,F),t.encoding=t.encoding||t.cffEncoding,t.glyphs=new os.GlyphSet(t),n.lowMemory)t._push=function(B){var G=_5(B,S.offsets,r,e+c.charStrings);t.glyphs.push(B,os.cffGlyphLoader(t,B,dx,G))};else for(var E=0;E<t.nGlyphs;E+=1){var R=S.objects[E];t.glyphs.push(E,os.cffGlyphLoader(t,E,dx,R))}}function nF(r,e){var t,n=Gp.indexOf(r);return n>=0&&(t=n),n=e.indexOf(r),n>=0?t=n+Gp.length:(t=Gp.length+e.length,e.push(r)),t}function q5(){return new dt.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function W5(r){var e=new dt.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);e.names=[];for(var t=0;t<r.length;t+=1)e.names.push({name:"name_"+t,type:"NAME",value:r[t]});return e}function iF(r,e,t){for(var n={},i=0;i<r.length;i+=1){var a=r[i],s=e[a.name];s!==void 0&&!JT(s,a.value)&&(a.type==="SID"&&(s=nF(s,t)),n[a.op]={name:a.name,type:a.type,value:s})}return n}function fx(r,e){var t=new dt.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=iF(eF,r,e),t}function hx(r){var e=new dt.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return e.topDicts=[{name:"topDict_0",type:"TABLE",value:r}],e}function Q5(r){var e=new dt.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);e.strings=[];for(var t=0;t<r.length;t+=1)e.strings.push({name:"string_"+t,type:"STRING",value:r[t]});return e}function Y5(){return new dt.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function X5(r,e){for(var t=new dt.Record("Charsets",[{name:"format",type:"Card8",value:0}]),n=0;n<r.length;n+=1){var i=r[n],a=nF(i,e);t.fields.push({name:"glyph_"+n,type:"SID",value:a})}return t}function J5(r){var e=[],t=r.path;e.push({name:"width",type:"NUMBER",value:r.advanceWidth});for(var n=0,i=0,a=0;a<t.commands.length;a+=1){var s=void 0,o=void 0,l=t.commands[a];if(l.type==="Q"){var u=.3333333333333333,c=2/3;l={type:"C",x:l.x,y:l.y,x1:Math.round(u*n+c*l.x1),y1:Math.round(u*i+c*l.y1),x2:Math.round(u*l.x+c*l.x1),y2:Math.round(u*l.y+c*l.y1)}}if(l.type==="M")s=Math.round(l.x-n),o=Math.round(l.y-i),e.push({name:"dx",type:"NUMBER",value:s}),e.push({name:"dy",type:"NUMBER",value:o}),e.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(l.x),i=Math.round(l.y);else if(l.type==="L")s=Math.round(l.x-n),o=Math.round(l.y-i),e.push({name:"dx",type:"NUMBER",value:s}),e.push({name:"dy",type:"NUMBER",value:o}),e.push({name:"rlineto",type:"OP",value:5}),n=Math.round(l.x),i=Math.round(l.y);else if(l.type==="C"){var f=Math.round(l.x1-n),d=Math.round(l.y1-i),h=Math.round(l.x2-l.x1),g=Math.round(l.y2-l.y1);s=Math.round(l.x-l.x2),o=Math.round(l.y-l.y2),e.push({name:"dx1",type:"NUMBER",value:f}),e.push({name:"dy1",type:"NUMBER",value:d}),e.push({name:"dx2",type:"NUMBER",value:h}),e.push({name:"dy2",type:"NUMBER",value:g}),e.push({name:"dx",type:"NUMBER",value:s}),e.push({name:"dy",type:"NUMBER",value:o}),e.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(l.x),i=Math.round(l.y)}}return e.push({name:"endchar",type:"OP",value:14}),e}function K5(r){for(var e=new dt.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),t=0;t<r.length;t+=1){var n=r.get(t),i=J5(n);e.charStrings.push({name:n.name,type:"CHARSTRING",value:i})}return e}function Z5(r,e){var t=new dt.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=iF(tF,r,e),t}function e6(r,e){for(var t=new dt.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),n=1/e.unitsPerEm,i={version:e.version,fullName:e.fullName,familyName:e.familyName,weight:e.weightName,fontBBox:e.fontBBox||[0,0,0,0],fontMatrix:[n,0,0,n,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},a={},s=[],o,l=1;l<r.length;l+=1)o=r.get(l),s.push(o.name);var u=[];t.header=q5(),t.nameIndex=W5([e.postScriptName]);var c=fx(i,u);t.topDictIndex=hx(c),t.globalSubrIndex=Y5(),t.charsets=X5(s,u),t.charStringsIndex=K5(r),t.privateDict=Z5(a,u),t.stringIndex=Q5(u);var f=t.header.sizeOf()+t.nameIndex.sizeOf()+t.topDictIndex.sizeOf()+t.stringIndex.sizeOf()+t.globalSubrIndex.sizeOf();return i.charset=f,i.encoding=0,i.charStrings=i.charset+t.charsets.sizeOf(),i.private[1]=i.charStrings+t.charStringsIndex.sizeOf(),c=fx(i,u),t.topDictIndex=hx(c),t}var aF={parse:j5,make:e6};function t6(r,e){var t={},n=new vt.Parser(r,e);return t.version=n.parseVersion(),t.fontRevision=Math.round(n.parseFixed()*1e3)/1e3,t.checkSumAdjustment=n.parseULong(),t.magicNumber=n.parseULong(),Gt.argument(t.magicNumber===1594834165,"Font header has wrong magic number."),t.flags=n.parseUShort(),t.unitsPerEm=n.parseUShort(),t.created=n.parseLongDateTime(),t.modified=n.parseLongDateTime(),t.xMin=n.parseShort(),t.yMin=n.parseShort(),t.xMax=n.parseShort(),t.yMax=n.parseShort(),t.macStyle=n.parseUShort(),t.lowestRecPPEM=n.parseUShort(),t.fontDirectionHint=n.parseShort(),t.indexToLocFormat=n.parseShort(),t.glyphDataFormat=n.parseShort(),t}function r6(r){var e=Math.round(new Date().getTime()/1e3)+2082844800,t=e;return r.createdTimestamp&&(t=r.createdTimestamp+2082844800),new dt.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:t},{name:"modified",type:"LONGDATETIME",value:e},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],r)}var sF={parse:t6,make:r6};function n6(r,e){var t={},n=new vt.Parser(r,e);return t.version=n.parseVersion(),t.ascender=n.parseShort(),t.descender=n.parseShort(),t.lineGap=n.parseShort(),t.advanceWidthMax=n.parseUShort(),t.minLeftSideBearing=n.parseShort(),t.minRightSideBearing=n.parseShort(),t.xMaxExtent=n.parseShort(),t.caretSlopeRise=n.parseShort(),t.caretSlopeRun=n.parseShort(),t.caretOffset=n.parseShort(),n.relativeOffset+=8,t.metricDataFormat=n.parseShort(),t.numberOfHMetrics=n.parseUShort(),t}function i6(r){return new dt.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],r)}var oF={parse:n6,make:i6};function a6(r,e,t,n,i){for(var a,s,o=new vt.Parser(r,e),l=0;l<n;l+=1){l<t&&(a=o.parseUShort(),s=o.parseShort());var u=i.get(l);u.advanceWidth=a,u.leftSideBearing=s}}function s6(r,e,t,n,i){r._hmtxTableData={};for(var a,s,o=new vt.Parser(e,t),l=0;l<i;l+=1)l<n&&(a=o.parseUShort(),s=o.parseShort()),r._hmtxTableData[l]={advanceWidth:a,leftSideBearing:s}}function o6(r,e,t,n,i,a,s){s.lowMemory?s6(r,e,t,n,i):a6(e,t,n,i,a)}function l6(r){for(var e=new dt.Table("hmtx",[]),t=0;t<r.length;t+=1){var n=r.get(t),i=n.advanceWidth||0,a=n.leftSideBearing||0;e.fields.push({name:"advanceWidth_"+t,type:"USHORT",value:i}),e.fields.push({name:"leftSideBearing_"+t,type:"SHORT",value:a})}return e}var lF={parse:o6,make:l6};function u6(r){for(var e=new dt.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:r.length}]),t="",n=12+r.length*4,i=0;i<r.length;++i){var a=t.indexOf(r[i]);a<0&&(a=t.length,t+=r[i]),e.fields.push({name:"offset "+i,type:"USHORT",value:n+a}),e.fields.push({name:"length "+i,type:"USHORT",value:r[i].length})}return e.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),e}function c6(r,e){var t=new vt.Parser(r,e),n=t.parseULong();Gt.argument(n===1,"Unsupported ltag table version."),t.skip("uLong",1);for(var i=t.parseULong(),a=[],s=0;s<i;s++){for(var o="",l=e+t.parseUShort(),u=t.parseUShort(),c=l;c<l+u;++c)o+=String.fromCharCode(r.getInt8(c));a.push(o)}return a}var uF={make:u6,parse:c6};function d6(r,e){var t={},n=new vt.Parser(r,e);return t.version=n.parseVersion(),t.numGlyphs=n.parseUShort(),t.version===1&&(t.maxPoints=n.parseUShort(),t.maxContours=n.parseUShort(),t.maxCompositePoints=n.parseUShort(),t.maxCompositeContours=n.parseUShort(),t.maxZones=n.parseUShort(),t.maxTwilightPoints=n.parseUShort(),t.maxStorage=n.parseUShort(),t.maxFunctionDefs=n.parseUShort(),t.maxInstructionDefs=n.parseUShort(),t.maxStackElements=n.parseUShort(),t.maxSizeOfInstructions=n.parseUShort(),t.maxComponentElements=n.parseUShort(),t.maxComponentDepth=n.parseUShort()),t}function f6(r){return new dt.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:r}])}var cF={parse:d6,make:f6},dF=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],fF={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},h6={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},hF={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"};function p6(r,e,t){switch(r){case 0:if(e===65535)return"und";if(t)return t[e];break;case 1:return fF[e];case 3:return hF[e]}}var Zy="utf-16",g6={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},m6={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"};function pF(r,e,t){switch(r){case 0:return Zy;case 1:return m6[t]||g6[e];case 3:if(e===1||e===10)return Zy;break}}function v6(r,e,t){for(var n={},i=new vt.Parser(r,e),a=i.parseUShort(),s=i.parseUShort(),o=i.offset+i.parseUShort(),l=0;l<s;l++){var u=i.parseUShort(),c=i.parseUShort(),f=i.parseUShort(),d=i.parseUShort(),h=dF[d]||d,g=i.parseUShort(),v=i.parseUShort(),y=p6(u,f,t),A=pF(u,c,f);if(A!==void 0&&y!==void 0){var C=void 0;if(A===Zy?C=nc.UTF16(r,o+v,g):C=nc.MACSTRING(r,o+v,g,A),C){var S=n[h];S===void 0&&(S=n[h]={}),S[y]=C}}}return a===1&&i.parseUShort(),n}function I0(r){var e={};for(var t in r)e[r[t]]=parseInt(t);return e}function px(r,e,t,n,i,a){return new dt.Record("NameRecord",[{name:"platformID",type:"USHORT",value:r},{name:"encodingID",type:"USHORT",value:e},{name:"languageID",type:"USHORT",value:t},{name:"nameID",type:"USHORT",value:n},{name:"length",type:"USHORT",value:i},{name:"offset",type:"USHORT",value:a}])}function y6(r,e){var t=r.length,n=e.length-t+1;e:for(var i=0;i<n;i++)for(;i<n;i++){for(var a=0;a<t;a++)if(e[i+a]!==r[a])continue e;return i}return-1}function gx(r,e){var t=y6(r,e);if(t<0){t=e.length;for(var n=0,i=r.length;n<i;++n)e.push(r[n])}return t}function A6(r,e){var t,n=[],i={},a=I0(dF);for(var s in r){var o=a[s];if(o===void 0&&(o=s),t=parseInt(o),isNaN(t))throw new Error('Name table entry "'+s+'" does not exist, see nameTableNames for complete list.');i[t]=r[s],n.push(t)}for(var l=I0(fF),u=I0(hF),c=[],f=[],d=0;d<n.length;d++){t=n[d];var h=i[t];for(var g in h){var v=h[g],y=1,A=l[g],C=h6[A],S=pF(y,C,A),F=it.MACSTRING(v,S);F===void 0&&(y=0,A=e.indexOf(g),A<0&&(A=e.length,e.push(g)),C=4,F=it.UTF16(v));var E=gx(F,f);c.push(px(y,C,A,t,F.length,E));var R=u[g];if(R!==void 0){var B=it.UTF16(v),G=gx(B,f);c.push(px(3,1,R,t,B.length,G))}}}c.sort(function(q,Y){return q.platformID-Y.platformID||q.encodingID-Y.encodingID||q.languageID-Y.languageID||q.nameID-Y.nameID});for(var j=new dt.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:c.length},{name:"stringOffset",type:"USHORT",value:6+c.length*12}]),ie=0;ie<c.length;ie++)j.fields.push({name:"record_"+ie,type:"RECORD",value:c[ie]});return j.fields.push({name:"strings",type:"LITERAL",value:f}),j}var gF={parse:v6,make:A6},eA=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];function w6(r){for(var e=0;e<eA.length;e+=1){var t=eA[e];if(r>=t.begin&&r<t.end)return e}return-1}function b6(r,e){var t={},n=new vt.Parser(r,e);t.version=n.parseUShort(),t.xAvgCharWidth=n.parseShort(),t.usWeightClass=n.parseUShort(),t.usWidthClass=n.parseUShort(),t.fsType=n.parseUShort(),t.ySubscriptXSize=n.parseShort(),t.ySubscriptYSize=n.parseShort(),t.ySubscriptXOffset=n.parseShort(),t.ySubscriptYOffset=n.parseShort(),t.ySuperscriptXSize=n.parseShort(),t.ySuperscriptYSize=n.parseShort(),t.ySuperscriptXOffset=n.parseShort(),t.ySuperscriptYOffset=n.parseShort(),t.yStrikeoutSize=n.parseShort(),t.yStrikeoutPosition=n.parseShort(),t.sFamilyClass=n.parseShort(),t.panose=[];for(var i=0;i<10;i++)t.panose[i]=n.parseByte();return t.ulUnicodeRange1=n.parseULong(),t.ulUnicodeRange2=n.parseULong(),t.ulUnicodeRange3=n.parseULong(),t.ulUnicodeRange4=n.parseULong(),t.achVendID=String.fromCharCode(n.parseByte(),n.parseByte(),n.parseByte(),n.parseByte()),t.fsSelection=n.parseUShort(),t.usFirstCharIndex=n.parseUShort(),t.usLastCharIndex=n.parseUShort(),t.sTypoAscender=n.parseShort(),t.sTypoDescender=n.parseShort(),t.sTypoLineGap=n.parseShort(),t.usWinAscent=n.parseUShort(),t.usWinDescent=n.parseUShort(),t.version>=1&&(t.ulCodePageRange1=n.parseULong(),t.ulCodePageRange2=n.parseULong()),t.version>=2&&(t.sxHeight=n.parseShort(),t.sCapHeight=n.parseShort(),t.usDefaultChar=n.parseUShort(),t.usBreakChar=n.parseUShort(),t.usMaxContent=n.parseUShort()),t}function C6(r){return new dt.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],r)}var tA={parse:b6,make:C6,unicodeRanges:eA,getUnicodeRange:w6};function x6(r,e){var t={},n=new vt.Parser(r,e);switch(t.version=n.parseVersion(),t.italicAngle=n.parseFixed(),t.underlinePosition=n.parseShort(),t.underlineThickness=n.parseShort(),t.isFixedPitch=n.parseULong(),t.minMemType42=n.parseULong(),t.maxMemType42=n.parseULong(),t.minMemType1=n.parseULong(),t.maxMemType1=n.parseULong(),t.version){case 1:t.names=ml.slice();break;case 2:t.numberOfGlyphs=n.parseUShort(),t.glyphNameIndex=new Array(t.numberOfGlyphs);for(var i=0;i<t.numberOfGlyphs;i++)t.glyphNameIndex[i]=n.parseUShort();t.names=[];for(var a=0;a<t.numberOfGlyphs;a++)if(t.glyphNameIndex[a]>=ml.length){var s=n.parseChar();t.names.push(n.parseString(s))}break;case 2.5:t.numberOfGlyphs=n.parseUShort(),t.offset=new Array(t.numberOfGlyphs);for(var o=0;o<t.numberOfGlyphs;o++)t.offset[o]=n.parseChar();break}return t}function S6(){return new dt.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}var mF={parse:x6,make:S6},Da=new Array(9);Da[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(be.coverage),deltaGlyphId:this.parseUShort()};if(t===2)return{substFormat:2,coverage:this.parsePointer(be.coverage),substitute:this.parseOffset16List()};Gt.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")};Da[2]=function(){var e=this.parseUShort();return Gt.argument(e===1,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(be.coverage),sequences:this.parseListOfLists()}};Da[3]=function(){var e=this.parseUShort();return Gt.argument(e===1,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(be.coverage),alternateSets:this.parseListOfLists()}};Da[4]=function(){var e=this.parseUShort();return Gt.argument(e===1,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(be.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var Hu={sequenceIndex:be.uShort,lookupListIndex:be.uShort};Da[5]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:t,coverage:this.parsePointer(be.coverage),ruleSets:this.parseListOfLists(function(){var a=this.parseUShort(),s=this.parseUShort();return{input:this.parseUShortList(a-1),lookupRecords:this.parseRecordList(s,Hu)}})};if(t===2)return{substFormat:t,coverage:this.parsePointer(be.coverage),classDef:this.parsePointer(be.classDef),classSets:this.parseListOfLists(function(){var a=this.parseUShort(),s=this.parseUShort();return{classes:this.parseUShortList(a-1),lookupRecords:this.parseRecordList(s,Hu)}})};if(t===3){var n=this.parseUShort(),i=this.parseUShort();return{substFormat:t,coverages:this.parseList(n,be.pointer(be.coverage)),lookupRecords:this.parseRecordList(i,Hu)}}Gt.assert(!1,"0x"+e.toString(16)+": lookup type 5 format must be 1, 2 or 3.")};Da[6]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(be.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Hu)}})};if(t===2)return{substFormat:2,coverage:this.parsePointer(be.coverage),backtrackClassDef:this.parsePointer(be.classDef),inputClassDef:this.parsePointer(be.classDef),lookaheadClassDef:this.parsePointer(be.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Hu)}})};if(t===3)return{substFormat:3,backtrackCoverage:this.parseList(be.pointer(be.coverage)),inputCoverage:this.parseList(be.pointer(be.coverage)),lookaheadCoverage:this.parseList(be.pointer(be.coverage)),lookupRecords:this.parseRecordList(Hu)};Gt.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")};Da[7]=function(){var e=this.parseUShort();Gt.argument(e===1,"GSUB Extension Substitution subtable identifier-format must be 1");var t=this.parseUShort(),n=new be(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:Da[t].call(n)}};Da[8]=function(){var e=this.parseUShort();return Gt.argument(e===1,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(be.coverage),backtrackCoverage:this.parseList(be.pointer(be.coverage)),lookaheadCoverage:this.parseList(be.pointer(be.coverage)),substitutes:this.parseUShortList()}};function E6(r,e){e=e||0;var t=new be(r,e),n=t.parseVersion(1);return Gt.argument(n===1||n===1.1,"Unsupported GSUB table version."),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(Da)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(Da),variations:t.parseFeatureVariationsList()}}var gc=new Array(9);gc[1]=function(e){return e.substFormat===1?new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)},{name:"deltaGlyphID",type:"USHORT",value:e.deltaGlyphId}]):new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.ushortList("substitute",e.substitute)))};gc[2]=function(e){return Gt.assert(e.substFormat===1,"Lookup type 2 substFormat must be 1."),new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.tableList("seqSet",e.sequences,function(t){return new dt.Table("sequenceSetTable",dt.ushortList("sequence",t))})))};gc[3]=function(e){return Gt.assert(e.substFormat===1,"Lookup type 3 substFormat must be 1."),new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.tableList("altSet",e.alternateSets,function(t){return new dt.Table("alternateSetTable",dt.ushortList("alternate",t))})))};gc[4]=function(e){return Gt.assert(e.substFormat===1,"Lookup type 4 substFormat must be 1."),new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.tableList("ligSet",e.ligatureSets,function(t){return new dt.Table("ligatureSetTable",dt.tableList("ligature",t,function(n){return new dt.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:n.ligGlyph}].concat(dt.ushortList("component",n.components,n.components.length+1)))}))})))};gc[6]=function(e){if(e.substFormat===1){var t=new dt.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.tableList("chainRuleSet",e.chainRuleSets,function(a){return new dt.Table("chainRuleSetTable",dt.tableList("chainRule",a,function(s){var o=dt.ushortList("backtrackGlyph",s.backtrack,s.backtrack.length).concat(dt.ushortList("inputGlyph",s.input,s.input.length+1)).concat(dt.ushortList("lookaheadGlyph",s.lookahead,s.lookahead.length)).concat(dt.ushortList("substitution",[],s.lookupRecords.length));return s.lookupRecords.forEach(function(l,u){o=o.concat({name:"sequenceIndex"+u,type:"USHORT",value:l.sequenceIndex}).concat({name:"lookupListIndex"+u,type:"USHORT",value:l.lookupListIndex})}),new dt.Table("chainRuleTable",o)}))})));return t}else if(e.substFormat===2)Gt.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(e.substFormat===3){var n=[{name:"substFormat",type:"USHORT",value:e.substFormat}];n.push({name:"backtrackGlyphCount",type:"USHORT",value:e.backtrackCoverage.length}),e.backtrackCoverage.forEach(function(a,s){n.push({name:"backtrackCoverage"+s,type:"TABLE",value:new dt.Coverage(a)})}),n.push({name:"inputGlyphCount",type:"USHORT",value:e.inputCoverage.length}),e.inputCoverage.forEach(function(a,s){n.push({name:"inputCoverage"+s,type:"TABLE",value:new dt.Coverage(a)})}),n.push({name:"lookaheadGlyphCount",type:"USHORT",value:e.lookaheadCoverage.length}),e.lookaheadCoverage.forEach(function(a,s){n.push({name:"lookaheadCoverage"+s,type:"TABLE",value:new dt.Coverage(a)})}),n.push({name:"substitutionCount",type:"USHORT",value:e.lookupRecords.length}),e.lookupRecords.forEach(function(a,s){n=n.concat({name:"sequenceIndex"+s,type:"USHORT",value:a.sequenceIndex}).concat({name:"lookupListIndex"+s,type:"USHORT",value:a.lookupListIndex})});var i=new dt.Table("chainContextTable",n);return i}Gt.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};function k6(r){return new dt.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new dt.ScriptList(r.scripts)},{name:"features",type:"TABLE",value:new dt.FeatureList(r.features)},{name:"lookups",type:"TABLE",value:new dt.LookupList(r.lookups,gc)}])}var vF={parse:E6,make:k6};function T6(r,e){var t=new vt.Parser(r,e),n=t.parseULong();Gt.argument(n===1,"Unsupported META table version."),t.parseULong(),t.parseULong();for(var i=t.parseULong(),a={},s=0;s<i;s++){var o=t.parseTag(),l=t.parseULong(),u=t.parseULong(),c=nc.UTF8(r,e+l,u);a[o]=c}return a}function F6(r){var e=Object.keys(r).length,t="",n=16+e*12,i=new dt.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:n},{name:"numTags",type:"ULONG",value:e}]);for(var a in r){var s=t.length;t+=r[a],i.fields.push({name:"tag "+a,type:"TAG",value:a}),i.fields.push({name:"offset "+a,type:"ULONG",value:n+s}),i.fields.push({name:"length "+a,type:"ULONG",value:r[a].length})}return i.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),i}var yF={parse:T6,make:F6};function mx(r){return Math.log(r)/Math.log(2)|0}function g1(r){for(;r.length%4!==0;)r.push(0);for(var e=0,t=0;t<r.length;t+=4)e+=(r[t]<<24)+(r[t+1]<<16)+(r[t+2]<<8)+r[t+3];return e%=Math.pow(2,32),e}function vx(r,e,t,n){return new dt.Record("Table Record",[{name:"tag",type:"TAG",value:r!==void 0?r:""},{name:"checkSum",type:"ULONG",value:e!==void 0?e:0},{name:"offset",type:"ULONG",value:t!==void 0?t:0},{name:"length",type:"ULONG",value:n!==void 0?n:0}])}function AF(r){var e=new dt.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);e.tables=r,e.numTables=r.length;var t=Math.pow(2,mx(e.numTables));e.searchRange=16*t,e.entrySelector=mx(t),e.rangeShift=e.numTables*16-e.searchRange;for(var n=[],i=[],a=e.sizeOf()+vx().sizeOf()*e.numTables;a%4!==0;)a+=1,i.push({name:"padding",type:"BYTE",value:0});for(var s=0;s<r.length;s+=1){var o=r[s];Gt.argument(o.tableName.length===4,"Table name"+o.tableName+" is invalid.");var l=o.sizeOf(),u=vx(o.tableName,g1(o.encode()),a,l);for(n.push({name:u.tag+" Table Record",type:"RECORD",value:u}),i.push({name:o.tableName+" table",type:"RECORD",value:o}),a+=l,Gt.argument(!isNaN(a),"Something went wrong calculating the offset.");a%4!==0;)a+=1,i.push({name:"padding",type:"BYTE",value:0})}return n.sort(function(c,f){return c.value.tag>f.value.tag?1:-1}),e.fields=e.fields.concat(n),e.fields=e.fields.concat(i),e}function yx(r,e,t){for(var n=0;n<e.length;n+=1){var i=r.charToGlyphIndex(e[n]);if(i>0){var a=r.glyphs.get(i);return a.getMetrics()}}return t}function I6(r){for(var e=0,t=0;t<r.length;t+=1)e+=r[t];return e/r.length}function P6(r){for(var e=[],t=[],n=[],i=[],a=[],s=[],o=[],l,u=0,c=0,f=0,d=0,h=0,g=0;g<r.glyphs.length;g+=1){var v=r.glyphs.get(g),y=v.unicode|0;if(isNaN(v.advanceWidth))throw new Error("Glyph "+v.name+" ("+g+"): advanceWidth is not a number.");(l>y||l===void 0)&&y>0&&(l=y),u<y&&(u=y);var A=tA.getUnicodeRange(y);if(A<32)c|=1<<A;else if(A<64)f|=1<<A-32;else if(A<96)d|=1<<A-64;else if(A<123)h|=1<<A-96;else throw new Error("Unicode ranges bits > 123 are reserved for internal usage");if(v.name!==".notdef"){var C=v.getMetrics();e.push(C.xMin),t.push(C.yMin),n.push(C.xMax),i.push(C.yMax),s.push(C.leftSideBearing),o.push(C.rightSideBearing),a.push(v.advanceWidth)}}var S={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,n),yMax:Math.max.apply(null,i),advanceWidthMax:Math.max.apply(null,a),advanceWidthAvg:I6(a),minLeftSideBearing:Math.min.apply(null,s),maxLeftSideBearing:Math.max.apply(null,s),minRightSideBearing:Math.min.apply(null,o)};S.ascender=r.ascender,S.descender=r.descender;var F=sF.make({flags:3,unitsPerEm:r.unitsPerEm,xMin:S.xMin,yMin:S.yMin,xMax:S.xMax,yMax:S.yMax,lowestRecPPEM:3,createdTimestamp:r.createdTimestamp}),E=oF.make({ascender:S.ascender,descender:S.descender,advanceWidthMax:S.advanceWidthMax,minLeftSideBearing:S.minLeftSideBearing,minRightSideBearing:S.minRightSideBearing,xMaxExtent:S.maxLeftSideBearing+(S.xMax-S.xMin),numberOfHMetrics:r.glyphs.length}),R=cF.make(r.glyphs.length),B=tA.make(Object.assign({xAvgCharWidth:Math.round(S.advanceWidthAvg),usFirstCharIndex:l,usLastCharIndex:u,ulUnicodeRange1:c,ulUnicodeRange2:f,ulUnicodeRange3:d,ulUnicodeRange4:h,sTypoAscender:S.ascender,sTypoDescender:S.descender,sTypoLineGap:0,usWinAscent:S.yMax,usWinDescent:Math.abs(S.yMin),ulCodePageRange1:1,sxHeight:yx(r,"xyvw",{yMax:Math.round(S.ascender/2)}).yMax,sCapHeight:yx(r,"HIKLEFJMNTZBDPRAGOQSUVWXY",S).yMax,usDefaultChar:r.hasChar(" ")?32:0,usBreakChar:r.hasChar(" ")?32:0},r.tables.os2)),G=lF.make(r.glyphs),j=QT.make(r.glyphs),ie=r.getEnglishName("fontFamily"),q=r.getEnglishName("fontSubfamily"),Y=ie+" "+q,J=r.getEnglishName("postScriptName");J||(J=ie.replace(/\s/g,"")+"-"+q);var ae={};for(var oe in r.names)ae[oe]=r.names[oe];ae.uniqueID||(ae.uniqueID={en:r.getEnglishName("manufacturer")+":"+Y}),ae.postScriptName||(ae.postScriptName={en:J}),ae.preferredFamily||(ae.preferredFamily=r.names.fontFamily),ae.preferredSubfamily||(ae.preferredSubfamily=r.names.fontSubfamily);var he=[],ye=gF.make(ae,he),Ue=he.length>0?uF.make(he):void 0,Re=mF.make(),Oe=aF.make(r.glyphs,{version:r.getEnglishName("version"),fullName:Y,familyName:ie,weightName:q,postScriptName:J,unitsPerEm:r.unitsPerEm,fontBBox:[0,S.yMin,S.ascender,S.advanceWidthMax]}),ee=r.metas&&Object.keys(r.metas).length>0?yF.make(r.metas):void 0,re=[F,E,R,B,ye,j,Re,Oe,G];Ue&&re.push(Ue),r.tables.gsub&&re.push(vF.make(r.tables.gsub)),ee&&re.push(ee);for(var fe=AF(re),Be=fe.encode(),ke=g1(Be),$e=fe.fields,Ge=!1,qe=0;qe<$e.length;qe+=1)if($e[qe].name==="head table"){$e[qe].value.checkSumAdjustment=2981146554-ke,Ge=!0;break}if(!Ge)throw new Error("Could not find head table with checkSum to adjust.");return fe}var D6={make:AF,fontToTable:P6,computeCheckSum:g1};function P0(r,e){for(var t=0,n=r.length-1;t<=n;){var i=t+n>>>1,a=r[i].tag;if(a===e)return i;a<e?t=i+1:n=i-1}return-t-1}function Ax(r,e){for(var t=0,n=r.length-1;t<=n;){var i=t+n>>>1,a=r[i];if(a===e)return i;a<e?t=i+1:n=i-1}return-t-1}function wx(r,e){for(var t,n=0,i=r.length-1;n<=i;){var a=n+i>>>1;t=r[a];var s=t.start;if(s===e)return t;s<e?n=a+1:i=a-1}if(n>0)return t=r[n-1],e>t.end?0:t}function Hf(r,e){this.font=r,this.tableName=e}Hf.prototype={searchTag:P0,binSearch:Ax,getTable:function(r){var e=this.font.tables[this.tableName];return!e&&r&&(e=this.font.tables[this.tableName]=this.createDefaultTable()),e},getScriptNames:function(){var r=this.getTable();return r?r.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var r=this.getTable();if(r){for(var e=!1,t=0;t<r.scripts.length;t++){var n=r.scripts[t].tag;if(n==="DFLT")return n;n==="latn"&&(e=!0)}if(e)return"latn"}},getScriptTable:function(r,e){var t=this.getTable(e);if(t){r=r||"DFLT";var n=t.scripts,i=P0(t.scripts,r);if(i>=0)return n[i].script;if(e){var a={tag:r,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return n.splice(-1-i,0,a),a.script}}},getLangSysTable:function(r,e,t){var n=this.getScriptTable(r,t);if(n){if(!e||e==="dflt"||e==="DFLT")return n.defaultLangSys;var i=P0(n.langSysRecords,e);if(i>=0)return n.langSysRecords[i].langSys;if(t){var a={tag:e,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return n.langSysRecords.splice(-1-i,0,a),a.langSys}}},getFeatureTable:function(r,e,t,n){var i=this.getLangSysTable(r,e,n);if(i){for(var a,s=i.featureIndexes,o=this.font.tables[this.tableName].features,l=0;l<s.length;l++)if(a=o[s[l]],a.tag===t)return a.feature;if(n){var u=o.length;return Gt.assert(u===0||t>=o[u-1].tag,"Features must be added in alphabetical order."),a={tag:t,feature:{params:0,lookupListIndexes:[]}},o.push(a),s.push(u),a.feature}}},getLookupTables:function(r,e,t,n,i){var a=this.getFeatureTable(r,e,t,i),s=[];if(a){for(var o,l=a.lookupListIndexes,u=this.font.tables[this.tableName].lookups,c=0;c<l.length;c++)o=u[l[c]],o.lookupType===n&&s.push(o);if(s.length===0&&i){o={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0};var f=u.length;return u.push(o),l.push(f),[o]}}return s},getGlyphClass:function(r,e){switch(r.format){case 1:return r.startGlyph<=e&&e<r.startGlyph+r.classes.length?r.classes[e-r.startGlyph]:0;case 2:var t=wx(r.ranges,e);return t?t.classId:0}},getCoverageIndex:function(r,e){switch(r.format){case 1:var t=Ax(r.glyphs,e);return t>=0?t:-1;case 2:var n=wx(r.ranges,e);return n?n.index+e-n.start:-1}},expandCoverage:function(r){if(r.format===1)return r.glyphs;for(var e=[],t=r.ranges,n=0;n<t.length;n++)for(var i=t[n],a=i.start,s=i.end,o=a;o<=s;o++)e.push(o);return e}};function Gf(r){Hf.call(this,r,"gpos")}Gf.prototype=Hf.prototype;Gf.prototype.init=function(){var r=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(r)};Gf.prototype.getKerningValue=function(r,e,t){for(var n=0;n<r.length;n++)for(var i=r[n].subtables,a=0;a<i.length;a++){var s=i[a],o=this.getCoverageIndex(s.coverage,e);if(!(o<0))switch(s.posFormat){case 1:for(var l=s.pairSets[o],u=0;u<l.length;u++){var c=l[u];if(c.secondGlyph===t)return c.value1&&c.value1.xAdvance||0}break;case 2:var f=this.getGlyphClass(s.classDef1,e),d=this.getGlyphClass(s.classDef2,t),h=s.classRecords[f][d];return h.value1&&h.value1.xAdvance||0}}return 0};Gf.prototype.getKerningTables=function(r,e){if(this.font.tables.gpos)return this.getLookupTables(r,e,"kern",2)};function ia(r){Hf.call(this,r,"gsub")}function R6(r,e){var t=r.length;if(t!==e.length)return!1;for(var n=0;n<t;n++)if(r[n]!==e[n])return!1;return!0}function m1(r,e,t){for(var n=r.subtables,i=0;i<n.length;i++){var a=n[i];if(a.substFormat===e)return a}if(t)return n.push(t),t}ia.prototype=Hf.prototype;ia.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}};ia.prototype.getSingle=function(r,e,t){for(var n=[],i=this.getLookupTables(e,t,r,1),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++){var l=s[o],u=this.expandCoverage(l.coverage),c=void 0;if(l.substFormat===1){var f=l.deltaGlyphId;for(c=0;c<u.length;c++){var d=u[c];n.push({sub:d,by:d+f})}}else{var h=l.substitute;for(c=0;c<u.length;c++)n.push({sub:u[c],by:h[c]})}}return n};ia.prototype.getMultiple=function(r,e,t){for(var n=[],i=this.getLookupTables(e,t,r,2),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++){var l=s[o],u=this.expandCoverage(l.coverage),c=void 0;for(c=0;c<u.length;c++){var f=u[c],d=l.sequences[c];n.push({sub:f,by:d})}}return n};ia.prototype.getAlternates=function(r,e,t){for(var n=[],i=this.getLookupTables(e,t,r,3),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++)for(var l=s[o],u=this.expandCoverage(l.coverage),c=l.alternateSets,f=0;f<u.length;f++)n.push({sub:u[f],by:c[f]});return n};ia.prototype.getLigatures=function(r,e,t){for(var n=[],i=this.getLookupTables(e,t,r,4),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++)for(var l=s[o],u=this.expandCoverage(l.coverage),c=l.ligatureSets,f=0;f<u.length;f++)for(var d=u[f],h=c[f],g=0;g<h.length;g++){var v=h[g];n.push({sub:[d].concat(v.components),by:v.ligGlyph})}return n};ia.prototype.addSingle=function(r,e,t,n){var i=this.getLookupTables(t,n,r,1,!0)[0],a=m1(i,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});Gt.assert(a.coverage.format===1,"Single: unable to modify coverage table format "+a.coverage.format);var s=e.sub,o=this.binSearch(a.coverage.glyphs,s);o<0&&(o=-1-o,a.coverage.glyphs.splice(o,0,s),a.substitute.splice(o,0,0)),a.substitute[o]=e.by};ia.prototype.addMultiple=function(r,e,t,n){Gt.assert(e.by instanceof Array&&e.by.length>1,'Multiple: "by" must be an array of two or more ids');var i=this.getLookupTables(t,n,r,2,!0)[0],a=m1(i,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});Gt.assert(a.coverage.format===1,"Multiple: unable to modify coverage table format "+a.coverage.format);var s=e.sub,o=this.binSearch(a.coverage.glyphs,s);o<0&&(o=-1-o,a.coverage.glyphs.splice(o,0,s),a.sequences.splice(o,0,0)),a.sequences[o]=e.by};ia.prototype.addAlternate=function(r,e,t,n){var i=this.getLookupTables(t,n,r,3,!0)[0],a=m1(i,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});Gt.assert(a.coverage.format===1,"Alternate: unable to modify coverage table format "+a.coverage.format);var s=e.sub,o=this.binSearch(a.coverage.glyphs,s);o<0&&(o=-1-o,a.coverage.glyphs.splice(o,0,s),a.alternateSets.splice(o,0,0)),a.alternateSets[o]=e.by};ia.prototype.addLigature=function(r,e,t,n){var i=this.getLookupTables(t,n,r,4,!0)[0],a=i.subtables[0];a||(a={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},i.subtables[0]=a),Gt.assert(a.coverage.format===1,"Ligature: unable to modify coverage table format "+a.coverage.format);var s=e.sub[0],o=e.sub.slice(1),l={ligGlyph:e.by,components:o},u=this.binSearch(a.coverage.glyphs,s);if(u>=0){for(var c=a.ligatureSets[u],f=0;f<c.length;f++)if(R6(c[f].components,o))return;c.push(l)}else u=-1-u,a.coverage.glyphs.splice(u,0,s),a.ligatureSets.splice(u,0,[l])};ia.prototype.getFeature=function(r,e,t){if(/ss\d\d/.test(r))return this.getSingle(r,e,t);switch(r){case"aalt":case"salt":return this.getSingle(r,e,t).concat(this.getAlternates(r,e,t));case"dlig":case"liga":case"rlig":return this.getLigatures(r,e,t);case"ccmp":return this.getMultiple(r,e,t).concat(this.getLigatures(r,e,t));case"stch":return this.getMultiple(r,e,t)}};ia.prototype.add=function(r,e,t,n){if(/ss\d\d/.test(r))return this.addSingle(r,e,t,n);switch(r){case"aalt":case"salt":return typeof e.by=="number"?this.addSingle(r,e,t,n):this.addAlternate(r,e,t,n);case"dlig":case"liga":case"rlig":return this.addLigature(r,e,t,n);case"ccmp":return e.by instanceof Array?this.addMultiple(r,e,t,n):this.addLigature(r,e,t,n)}};function O6(){return typeof window<"u"}function B6(r){for(var e=new Buffer(r.byteLength),t=new Uint8Array(r),n=0;n<e.length;++n)e[n]=t[n];return e}function pd(r,e){if(!r)throw e}function bx(r,e,t,n,i){var a;return(e&n)>0?(a=r.parseByte(),(e&i)===0&&(a=-a),a=t+a):(e&i)>0?a=t:a=t+r.parseShort(),a}function wF(r,e,t){var n=new vt.Parser(e,t);r.numberOfContours=n.parseShort(),r._xMin=n.parseShort(),r._yMin=n.parseShort(),r._xMax=n.parseShort(),r._yMax=n.parseShort();var i,a;if(r.numberOfContours>0){for(var s=r.endPointIndices=[],o=0;o<r.numberOfContours;o+=1)s.push(n.parseUShort());r.instructionLength=n.parseUShort(),r.instructions=[];for(var l=0;l<r.instructionLength;l+=1)r.instructions.push(n.parseByte());var u=s[s.length-1]+1;i=[];for(var c=0;c<u;c+=1)if(a=n.parseByte(),i.push(a),(a&8)>0)for(var f=n.parseByte(),d=0;d<f;d+=1)i.push(a),c+=1;if(Gt.argument(i.length===u,"Bad flags."),s.length>0){var h=[],g;if(u>0){for(var v=0;v<u;v+=1)a=i[v],g={},g.onCurve=!!(a&1),g.lastPointOfContour=s.indexOf(v)>=0,h.push(g);for(var y=0,A=0;A<u;A+=1)a=i[A],g=h[A],g.x=bx(n,a,y,2,16),y=g.x;for(var C=0,S=0;S<u;S+=1)a=i[S],g=h[S],g.y=bx(n,a,C,4,32),C=g.y}r.points=h}else r.points=[]}else if(r.numberOfContours===0)r.points=[];else{r.isComposite=!0,r.points=[],r.components=[];for(var F=!0;F;){i=n.parseUShort();var E={glyphIndex:n.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(i&1)>0?(i&2)>0?(E.dx=n.parseShort(),E.dy=n.parseShort()):E.matchedPoints=[n.parseUShort(),n.parseUShort()]:(i&2)>0?(E.dx=n.parseChar(),E.dy=n.parseChar()):E.matchedPoints=[n.parseByte(),n.parseByte()],(i&8)>0?E.xScale=E.yScale=n.parseF2Dot14():(i&64)>0?(E.xScale=n.parseF2Dot14(),E.yScale=n.parseF2Dot14()):(i&128)>0&&(E.xScale=n.parseF2Dot14(),E.scale01=n.parseF2Dot14(),E.scale10=n.parseF2Dot14(),E.yScale=n.parseF2Dot14()),r.components.push(E),F=!!(i&32)}if(i&256){r.instructionLength=n.parseUShort(),r.instructions=[];for(var R=0;R<r.instructionLength;R+=1)r.instructions.push(n.parseByte())}}}function D0(r,e){for(var t=[],n=0;n<r.length;n+=1){var i=r[n],a={x:e.xScale*i.x+e.scale01*i.y+e.dx,y:e.scale10*i.x+e.yScale*i.y+e.dy,onCurve:i.onCurve,lastPointOfContour:i.lastPointOfContour};t.push(a)}return t}function M6(r){for(var e=[],t=[],n=0;n<r.length;n+=1){var i=r[n];t.push(i),i.lastPointOfContour&&(e.push(t),t=[])}return Gt.argument(t.length===0,"There are still points left in the current contour."),e}function bF(r){var e=new fi;if(!r)return e;for(var t=M6(r),n=0;n<t.length;++n){var i=t[n],a=null,s=i[i.length-1],o=i[0];if(s.onCurve)e.moveTo(s.x,s.y);else if(o.onCurve)e.moveTo(o.x,o.y);else{var l={x:(s.x+o.x)*.5,y:(s.y+o.y)*.5};e.moveTo(l.x,l.y)}for(var u=0;u<i.length;++u)if(a=s,s=o,o=i[(u+1)%i.length],s.onCurve)e.lineTo(s.x,s.y);else{var c=o;a.onCurve||((s.x+a.x)*.5,(s.y+a.y)*.5),o.onCurve||(c={x:(s.x+o.x)*.5,y:(s.y+o.y)*.5}),e.quadraticCurveTo(s.x,s.y,c.x,c.y)}e.closePath()}return e}function CF(r,e){if(e.isComposite)for(var t=0;t<e.components.length;t+=1){var n=e.components[t],i=r.get(n.glyphIndex);if(i.getPath(),i.points){var a=void 0;if(n.matchedPoints===void 0)a=D0(i.points,n);else{if(n.matchedPoints[0]>e.points.length-1||n.matchedPoints[1]>i.points.length-1)throw Error("Matched points out of range in "+e.name);var s=e.points[n.matchedPoints[0]],o=i.points[n.matchedPoints[1]],l={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};o=D0([o],l)[0],l.dx=s.x-o.x,l.dy=s.y-o.y,a=D0(i.points,l)}e.points=e.points.concat(a)}}return bF(e.points)}function _6(r,e,t,n){for(var i=new os.GlyphSet(n),a=0;a<t.length-1;a+=1){var s=t[a],o=t[a+1];s!==o?i.push(a,os.ttfGlyphLoader(n,a,wF,r,e+s,CF)):i.push(a,os.glyphLoader(n,a))}return i}function N6(r,e,t,n){var i=new os.GlyphSet(n);return n._push=function(a){var s=t[a],o=t[a+1];s!==o?i.push(a,os.ttfGlyphLoader(n,a,wF,r,e+s,CF)):i.push(a,os.glyphLoader(n,a))},i}function L6(r,e,t,n,i){return i.lowMemory?N6(r,e,t,n):_6(r,e,t,n)}var xF={getPath:bF,parse:L6},SF,El,EF,rA;function kF(r){this.font=r,this.getCommands=function(e){return xF.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function U6(r){return r}function TF(r){return Math.sign(r)*Math.round(Math.abs(r))}function V6(r){return Math.sign(r)*Math.round(Math.abs(r*2))/2}function z6(r){return Math.sign(r)*(Math.round(Math.abs(r)+.5)-.5)}function $6(r){return Math.sign(r)*Math.ceil(Math.abs(r))}function H6(r){return Math.sign(r)*Math.floor(Math.abs(r))}var FF=function(r){var e=this.srPeriod,t=this.srPhase,n=this.srThreshold,i=1;return r<0&&(r=-r,i=-1),r+=n-t,r=Math.trunc(r/e)*e,r+=t,r<0?t*i:r*i},rs={x:1,y:0,axis:"x",distance:function(r,e,t,n){return(t?r.xo:r.x)-(n?e.xo:e.x)},interpolate:function(r,e,t,n){var i,a,s,o,l,u,c;if(!n||n===this){if(i=r.xo-e.xo,a=r.xo-t.xo,l=e.x-e.xo,u=t.x-t.xo,s=Math.abs(i),o=Math.abs(a),c=s+o,c===0){r.x=r.xo+(l+u)/2;return}r.x=r.xo+(l*o+u*s)/c;return}if(i=n.distance(r,e,!0,!0),a=n.distance(r,t,!0,!0),l=n.distance(e,e,!1,!0),u=n.distance(t,t,!1,!0),s=Math.abs(i),o=Math.abs(a),c=s+o,c===0){rs.setRelative(r,r,(l+u)/2,n,!0);return}rs.setRelative(r,r,(l*o+u*s)/c,n,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(r,e,t,n,i){if(!n||n===this){r.x=(i?e.xo:e.x)+t;return}var a=i?e.xo:e.x,s=i?e.yo:e.y,o=a+t*n.x,l=s+t*n.y;r.x=o+(r.y-l)/n.normalSlope},slope:0,touch:function(r){r.xTouched=!0},touched:function(r){return r.xTouched},untouch:function(r){r.xTouched=!1}},Rs={x:0,y:1,axis:"y",distance:function(r,e,t,n){return(t?r.yo:r.y)-(n?e.yo:e.y)},interpolate:function(r,e,t,n){var i,a,s,o,l,u,c;if(!n||n===this){if(i=r.yo-e.yo,a=r.yo-t.yo,l=e.y-e.yo,u=t.y-t.yo,s=Math.abs(i),o=Math.abs(a),c=s+o,c===0){r.y=r.yo+(l+u)/2;return}r.y=r.yo+(l*o+u*s)/c;return}if(i=n.distance(r,e,!0,!0),a=n.distance(r,t,!0,!0),l=n.distance(e,e,!1,!0),u=n.distance(t,t,!1,!0),s=Math.abs(i),o=Math.abs(a),c=s+o,c===0){Rs.setRelative(r,r,(l+u)/2,n,!0);return}Rs.setRelative(r,r,(l*o+u*s)/c,n,!0)},normalSlope:0,setRelative:function(r,e,t,n,i){if(!n||n===this){r.y=(i?e.yo:e.y)+t;return}var a=i?e.xo:e.x,s=i?e.yo:e.y,o=a+t*n.x,l=s+t*n.y;r.y=l+n.normalSlope*(r.x-o)},slope:Number.POSITIVE_INFINITY,touch:function(r){r.yTouched=!0},touched:function(r){return r.yTouched},untouch:function(r){r.yTouched=!1}};Object.freeze(rs);Object.freeze(Rs);function jf(r,e){this.x=r,this.y=e,this.axis=void 0,this.slope=e/r,this.normalSlope=-r/e,Object.freeze(this)}jf.prototype.distance=function(r,e,t,n){return this.x*rs.distance(r,e,t,n)+this.y*Rs.distance(r,e,t,n)};jf.prototype.interpolate=function(r,e,t,n){var i,a,s,o,l,u,c;if(s=n.distance(r,e,!0,!0),o=n.distance(r,t,!0,!0),i=n.distance(e,e,!1,!0),a=n.distance(t,t,!1,!0),l=Math.abs(s),u=Math.abs(o),c=l+u,c===0){this.setRelative(r,r,(i+a)/2,n,!0);return}this.setRelative(r,r,(i*u+a*l)/c,n,!0)};jf.prototype.setRelative=function(r,e,t,n,i){n=n||this;var a=i?e.xo:e.x,s=i?e.yo:e.y,o=a+t*n.x,l=s+t*n.y,u=n.normalSlope,c=this.slope,f=r.x,d=r.y;r.x=(c*f-u*o+l-d)/(c-u),r.y=c*(r.x-f)+d};jf.prototype.touch=function(r){r.xTouched=!0,r.yTouched=!0};function qf(r,e){var t=Math.sqrt(r*r+e*e);return r/=t,e/=t,r===1&&e===0?rs:r===0&&e===1?Rs:new jf(r,e)}function Os(r,e,t,n){this.x=this.xo=Math.round(r*64)/64,this.y=this.yo=Math.round(e*64)/64,this.lastPointOfContour=t,this.onCurve=n,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Os.prototype.nextTouched=function(r){for(var e=this.nextPointOnContour;!r.touched(e)&&e!==this;)e=e.nextPointOnContour;return e};Os.prototype.prevTouched=function(r){for(var e=this.prevPointOnContour;!r.touched(e)&&e!==this;)e=e.prevPointOnContour;return e};var bf=Object.freeze(new Os(0,0)),G6={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function fo(r,e){switch(this.env=r,this.stack=[],this.prog=e,r){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=rs,this.round=TF}}kF.prototype.exec=function(r,e){if(typeof e!="number")throw new Error("Point size is not a number!");if(!(this._errorState>2)){var t=this.font,n=this._prepState;if(!n||n.ppem!==e){var i=this._fpgmState;if(!i){fo.prototype=G6,i=this._fpgmState=new fo("fpgm",t.tables.fpgm),i.funcs=[],i.font=t,exports.DEBUG&&(console.log("---EXEC FPGM---"),i.step=-1);try{El(i)}catch(u){console.log("Hinting error in FPGM:"+u),this._errorState=3;return}}fo.prototype=i,n=this._prepState=new fo("prep",t.tables.prep),n.ppem=e;var a=t.tables.cvt;if(a)for(var s=n.cvt=new Array(a.length),o=e/t.unitsPerEm,l=0;l<a.length;l++)s[l]=a[l]*o;else n.cvt=[];exports.DEBUG&&(console.log("---EXEC PREP---"),n.step=-1);try{El(n)}catch(u){this._errorState<2&&console.log("Hinting error in PREP:"+u),this._errorState=2}}if(!(this._errorState>1))try{return EF(r,n)}catch(u){this._errorState<1&&(console.log("Hinting error:"+u),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}}};EF=function(r,e){var t=e.ppem/e.font.unitsPerEm,n=t,i=r.components,a,s,o;if(fo.prototype=e,!i)o=new fo("glyf",r.instructions),exports.DEBUG&&(console.log("---EXEC GLYPH---"),o.step=-1),rA(r,o,t,n),s=o.gZone;else{var l=e.font;s=[],a=[];for(var u=0;u<i.length;u++){var c=i[u],f=l.glyphs.get(c.glyphIndex);o=new fo("glyf",f.instructions),exports.DEBUG&&(console.log("---EXEC COMP "+u+"---"),o.step=-1),rA(f,o,t,n);for(var d=Math.round(c.dx*t),h=Math.round(c.dy*n),g=o.gZone,v=o.contours,y=0;y<g.length;y++){var A=g[y];A.xTouched=A.yTouched=!1,A.xo=A.x=A.x+d,A.yo=A.y=A.y+h}var C=s.length;s.push.apply(s,g);for(var S=0;S<v.length;S++)a.push(v[S]+C)}r.instructions&&!o.inhibitGridFit&&(o=new fo("glyf",r.instructions),o.gZone=o.z0=o.z1=o.z2=s,o.contours=a,s.push(new Os(0,0),new Os(Math.round(r.advanceWidth*t),0)),exports.DEBUG&&(console.log("---EXEC COMPOSITE---"),o.step=-1),El(o),s.length-=2)}return s};rA=function(r,e,t,n){for(var i=r.points||[],a=i.length,s=e.gZone=e.z0=e.z1=e.z2=[],o=e.contours=[],l,u=0;u<a;u++)l=i[u],s[u]=new Os(l.x*t,l.y*n,l.lastPointOfContour,l.onCurve);for(var c,f,d=0;d<a;d++)l=s[d],c||(c=l,o.push(d)),l.lastPointOfContour?(l.nextPointOnContour=c,c.prevPointOnContour=l,c=void 0):(f=s[d+1],l.nextPointOnContour=f,f.prevPointOnContour=l);if(!e.inhibitGridFit){if(exports.DEBUG){console.log("PROCESSING GLYPH",e.stack);for(var h=0;h<a;h++)console.log(h,s[h].x,s[h].y)}if(s.push(new Os(0,0),new Os(Math.round(r.advanceWidth*t),0)),El(e),s.length-=2,exports.DEBUG){console.log("FINISHED GLYPH",e.stack);for(var g=0;g<a;g++)console.log(g,s[g].x,s[g].y)}}};El=function(r){var e=r.prog;if(e){var t=e.length,n;for(r.ip=0;r.ip<t;r.ip++){if(exports.DEBUG&&r.step++,n=SF[e[r.ip]],!n)throw new Error("unknown instruction: 0x"+Number(e[r.ip]).toString(16));n(r)}}};function qg(r){for(var e=r.tZone=new Array(r.gZone.length),t=0;t<e.length;t++)e[t]=new Os(0,0)}function IF(r,e){var t=r.prog,n=r.ip,i=1,a;do if(a=t[++n],a===88)i++;else if(a===89)i--;else if(a===64)n+=t[n+1]+1;else if(a===65)n+=2*t[n+1]+1;else if(a>=176&&a<=183)n+=a-176+1;else if(a>=184&&a<=191)n+=(a-184+1)*2;else if(e&&i===1&&a===27)break;while(i>0);r.ip=n}function Cx(r,e){exports.DEBUG&&console.log(e.step,"SVTCA["+r.axis+"]"),e.fv=e.pv=e.dpv=r}function xx(r,e){exports.DEBUG&&console.log(e.step,"SPVTCA["+r.axis+"]"),e.pv=e.dpv=r}function Sx(r,e){exports.DEBUG&&console.log(e.step,"SFVTCA["+r.axis+"]"),e.fv=r}function Ex(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z2[n],s=e.z1[i];exports.DEBUG&&console.log("SPVTL["+r+"]",n,i);var o,l;r?(o=a.y-s.y,l=s.x-a.x):(o=s.x-a.x,l=s.y-a.y),e.pv=e.dpv=qf(o,l)}function kx(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z2[n],s=e.z1[i];exports.DEBUG&&console.log("SFVTL["+r+"]",n,i);var o,l;r?(o=a.y-s.y,l=s.x-a.x):(o=s.x-a.x,l=s.y-a.y),e.fv=qf(o,l)}function j6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"SPVFS[]",t,n),r.pv=r.dpv=qf(n,t)}function q6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"SPVFS[]",t,n),r.fv=qf(n,t)}function W6(r){var e=r.stack,t=r.pv;exports.DEBUG&&console.log(r.step,"GPV[]"),e.push(t.x*16384),e.push(t.y*16384)}function Q6(r){var e=r.stack,t=r.fv;exports.DEBUG&&console.log(r.step,"GFV[]"),e.push(t.x*16384),e.push(t.y*16384)}function Y6(r){r.fv=r.pv,exports.DEBUG&&console.log(r.step,"SFVTPV[]")}function X6(r){var e=r.stack,t=e.pop(),n=e.pop(),i=e.pop(),a=e.pop(),s=e.pop(),o=r.z0,l=r.z1,u=o[t],c=o[n],f=l[i],d=l[a],h=r.z2[s];exports.DEBUG&&console.log("ISECT[], ",t,n,i,a,s);var g=u.x,v=u.y,y=c.x,A=c.y,C=f.x,S=f.y,F=d.x,E=d.y,R=(g-y)*(S-E)-(v-A)*(C-F),B=g*A-v*y,G=C*E-S*F;h.x=(B*(C-F)-G*(g-y))/R,h.y=(B*(S-E)-G*(v-A))/R}function J6(r){r.rp0=r.stack.pop(),exports.DEBUG&&console.log(r.step,"SRP0[]",r.rp0)}function K6(r){r.rp1=r.stack.pop(),exports.DEBUG&&console.log(r.step,"SRP1[]",r.rp1)}function Z6(r){r.rp2=r.stack.pop(),exports.DEBUG&&console.log(r.step,"SRP2[]",r.rp2)}function eN(r){var e=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"SZP0[]",e),r.zp0=e,e){case 0:r.tZone||qg(r),r.z0=r.tZone;break;case 1:r.z0=r.gZone;break;default:throw new Error("Invalid zone pointer")}}function tN(r){var e=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"SZP1[]",e),r.zp1=e,e){case 0:r.tZone||qg(r),r.z1=r.tZone;break;case 1:r.z1=r.gZone;break;default:throw new Error("Invalid zone pointer")}}function rN(r){var e=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"SZP2[]",e),r.zp2=e,e){case 0:r.tZone||qg(r),r.z2=r.tZone;break;case 1:r.z2=r.gZone;break;default:throw new Error("Invalid zone pointer")}}function nN(r){var e=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"SZPS[]",e),r.zp0=r.zp1=r.zp2=e,e){case 0:r.tZone||qg(r),r.z0=r.z1=r.z2=r.tZone;break;case 1:r.z0=r.z1=r.z2=r.gZone;break;default:throw new Error("Invalid zone pointer")}}function iN(r){r.loop=r.stack.pop(),exports.DEBUG&&console.log(r.step,"SLOOP[]",r.loop)}function aN(r){exports.DEBUG&&console.log(r.step,"RTG[]"),r.round=TF}function sN(r){exports.DEBUG&&console.log(r.step,"RTHG[]"),r.round=z6}function oN(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SMD[]",e),r.minDis=e/64}function lN(r){exports.DEBUG&&console.log(r.step,"ELSE[]"),IF(r,!1)}function uN(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"JMPR[]",e),r.ip+=e-1}function cN(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SCVTCI[]",e),r.cvCutIn=e/64}function dN(r){var e=r.stack;exports.DEBUG&&console.log(r.step,"DUP[]"),e.push(e[e.length-1])}function R0(r){exports.DEBUG&&console.log(r.step,"POP[]"),r.stack.pop()}function fN(r){exports.DEBUG&&console.log(r.step,"CLEAR[]"),r.stack.length=0}function hN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"SWAP[]"),e.push(t),e.push(n)}function pN(r){var e=r.stack;exports.DEBUG&&console.log(r.step,"DEPTH[]"),e.push(e.length)}function gN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"LOOPCALL[]",t,n);var i=r.ip,a=r.prog;r.prog=r.funcs[t];for(var s=0;s<n;s++)El(r),exports.DEBUG&&console.log(++r.step,s+1<n?"next loopcall":"done loopcall",s);r.ip=i,r.prog=a}function mN(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"CALL[]",e);var t=r.ip,n=r.prog;r.prog=r.funcs[e],El(r),r.ip=t,r.prog=n,exports.DEBUG&&console.log(++r.step,"returning from",e)}function vN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"CINDEX[]",t),e.push(e[e.length-t])}function yN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"MINDEX[]",t),e.push(e.splice(e.length-t,1)[0])}function AN(r){if(r.env!=="fpgm")throw new Error("FDEF not allowed here");var e=r.stack,t=r.prog,n=r.ip,i=e.pop(),a=n;for(exports.DEBUG&&console.log(r.step,"FDEF[]",i);t[++n]!==45;);r.ip=n,r.funcs[i]=t.slice(a+1,n)}function Tx(r,e){var t=e.stack.pop(),n=e.z0[t],i=e.fv,a=e.pv;exports.DEBUG&&console.log(e.step,"MDAP["+r+"]",t);var s=a.distance(n,bf);r&&(s=e.round(s)),i.setRelative(n,bf,s,a),i.touch(n),e.rp0=e.rp1=t}function Fx(r,e){var t=e.z2,n=t.length-2,i,a,s;exports.DEBUG&&console.log(e.step,"IUP["+r.axis+"]");for(var o=0;o<n;o++)i=t[o],!r.touched(i)&&(a=i.prevTouched(r),a!==i&&(s=i.nextTouched(r),a===s&&r.setRelative(i,i,r.distance(a,a,!1,!0),r,!0),r.interpolate(i,a,s,r)))}function Ix(r,e){for(var t=e.stack,n=r?e.rp1:e.rp2,i=(r?e.z0:e.z1)[n],a=e.fv,s=e.pv,o=e.loop,l=e.z2;o--;){var u=t.pop(),c=l[u],f=s.distance(i,i,!1,!0);a.setRelative(c,c,f,s),a.touch(c),exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-o)+": ":"")+"SHP["+(r?"rp1":"rp2")+"]",u)}e.loop=1}function Px(r,e){var t=e.stack,n=r?e.rp1:e.rp2,i=(r?e.z0:e.z1)[n],a=e.fv,s=e.pv,o=t.pop(),l=e.z2[e.contours[o]],u=l;exports.DEBUG&&console.log(e.step,"SHC["+r+"]",o);var c=s.distance(i,i,!1,!0);do u!==i&&a.setRelative(u,u,c,s),u=u.nextPointOnContour;while(u!==l)}function Dx(r,e){var t=e.stack,n=r?e.rp1:e.rp2,i=(r?e.z0:e.z1)[n],a=e.fv,s=e.pv,o=t.pop();exports.DEBUG&&console.log(e.step,"SHZ["+r+"]",o);var l;switch(o){case 0:l=e.tZone;break;case 1:l=e.gZone;break;default:throw new Error("Invalid zone")}for(var u,c=s.distance(i,i,!1,!0),f=l.length-2,d=0;d<f;d++)u=l[d],a.setRelative(u,u,c,s)}function wN(r){for(var e=r.stack,t=r.loop,n=r.fv,i=e.pop()/64,a=r.z2;t--;){var s=e.pop(),o=a[s];exports.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-t)+": ":"")+"SHPIX[]",s,i),n.setRelative(o,o,i),n.touch(o)}r.loop=1}function bN(r){for(var e=r.stack,t=r.rp1,n=r.rp2,i=r.loop,a=r.z0[t],s=r.z1[n],o=r.fv,l=r.dpv,u=r.z2;i--;){var c=e.pop(),f=u[c];exports.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-i)+": ":"")+"IP[]",c,t,"<->",n),o.interpolate(f,a,s,l),o.touch(f)}r.loop=1}function Rx(r,e){var t=e.stack,n=t.pop()/64,i=t.pop(),a=e.z1[i],s=e.z0[e.rp0],o=e.fv,l=e.pv;o.setRelative(a,s,n,l),o.touch(a),exports.DEBUG&&console.log(e.step,"MSIRP["+r+"]",n,i),e.rp1=e.rp0,e.rp2=i,r&&(e.rp0=i)}function CN(r){for(var e=r.stack,t=r.rp0,n=r.z0[t],i=r.loop,a=r.fv,s=r.pv,o=r.z1;i--;){var l=e.pop(),u=o[l];exports.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-i)+": ":"")+"ALIGNRP[]",l),a.setRelative(u,n,0,s),a.touch(u)}r.loop=1}function xN(r){exports.DEBUG&&console.log(r.step,"RTDG[]"),r.round=V6}function Ox(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z0[i],s=e.fv,o=e.pv,l=e.cvt[n];exports.DEBUG&&console.log(e.step,"MIAP["+r+"]",n,"(",l,")",i);var u=o.distance(a,bf);r&&(Math.abs(u-l)<e.cvCutIn&&(u=l),u=e.round(u)),s.setRelative(a,bf,u,o),e.zp0===0&&(a.xo=a.x,a.yo=a.y),s.touch(a),e.rp0=e.rp1=i}function SN(r){var e=r.prog,t=r.ip,n=r.stack,i=e[++t];exports.DEBUG&&console.log(r.step,"NPUSHB[]",i);for(var a=0;a<i;a++)n.push(e[++t]);r.ip=t}function EN(r){var e=r.ip,t=r.prog,n=r.stack,i=t[++e];exports.DEBUG&&console.log(r.step,"NPUSHW[]",i);for(var a=0;a<i;a++){var s=t[++e]<<8|t[++e];s&32768&&(s=-((s^65535)+1)),n.push(s)}r.ip=e}function kN(r){var e=r.stack,t=r.store;t||(t=r.store=[]);var n=e.pop(),i=e.pop();exports.DEBUG&&console.log(r.step,"WS",n,i),t[i]=n}function TN(r){var e=r.stack,t=r.store,n=e.pop();exports.DEBUG&&console.log(r.step,"RS",n);var i=t&&t[n]||0;e.push(i)}function FN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"WCVTP",t,n),r.cvt[n]=t/64}function IN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"RCVT",t),e.push(r.cvt[t]*64)}function Bx(r,e){var t=e.stack,n=t.pop(),i=e.z2[n];exports.DEBUG&&console.log(e.step,"GC["+r+"]",n),t.push(e.dpv.distance(i,bf,r,!1)*64)}function Mx(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z1[n],s=e.z0[i],o=e.dpv.distance(s,a,r,r);exports.DEBUG&&console.log(e.step,"MD["+r+"]",n,i,"->",o),e.stack.push(Math.round(o*64))}function PN(r){exports.DEBUG&&console.log(r.step,"MPPEM[]"),r.stack.push(r.ppem)}function DN(r){exports.DEBUG&&console.log(r.step,"FLIPON[]"),r.autoFlip=!0}function RN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"LT[]",t,n),e.push(n<t?1:0)}function ON(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"LTEQ[]",t,n),e.push(n<=t?1:0)}function BN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"GT[]",t,n),e.push(n>t?1:0)}function MN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"GTEQ[]",t,n),e.push(n>=t?1:0)}function _N(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"EQ[]",t,n),e.push(t===n?1:0)}function NN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"NEQ[]",t,n),e.push(t!==n?1:0)}function LN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"ODD[]",t),e.push(Math.trunc(t)%2?1:0)}function UN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"EVEN[]",t),e.push(Math.trunc(t)%2?0:1)}function VN(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"IF[]",e),e||(IF(r,!0),exports.DEBUG&&console.log(r.step,"EIF[]"))}function zN(r){exports.DEBUG&&console.log(r.step,"EIF[]")}function $N(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"AND[]",t,n),e.push(t&&n?1:0)}function HN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"OR[]",t,n),e.push(t||n?1:0)}function GN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"NOT[]",t),e.push(t?0:1)}function O0(r,e){var t=e.stack,n=t.pop(),i=e.fv,a=e.pv,s=e.ppem,o=e.deltaBase+(r-1)*16,l=e.deltaShift,u=e.z0;exports.DEBUG&&console.log(e.step,"DELTAP["+r+"]",n,t);for(var c=0;c<n;c++){var f=t.pop(),d=t.pop(),h=o+((d&240)>>4);if(h===s){var g=(d&15)-8;g>=0&&g++,exports.DEBUG&&console.log(e.step,"DELTAPFIX",f,"by",g*l);var v=u[f];i.setRelative(v,v,g*l,a)}}}function jN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"SDB[]",t),r.deltaBase=t}function qN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"SDS[]",t),r.deltaShift=Math.pow(.5,t)}function WN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"ADD[]",t,n),e.push(n+t)}function QN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"SUB[]",t,n),e.push(n-t)}function YN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"DIV[]",t,n),e.push(n*64/t)}function XN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"MUL[]",t,n),e.push(n*t/64)}function JN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"ABS[]",t),e.push(Math.abs(t))}function KN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"NEG[]",t),e.push(-t)}function ZN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"FLOOR[]",t),e.push(Math.floor(t/64)*64)}function e8(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"CEILING[]",t),e.push(Math.ceil(t/64)*64)}function Kh(r,e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"ROUND[]"),t.push(e.round(n/64)*64)}function t8(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"WCVTF[]",t,n),r.cvt[n]=t*r.ppem/r.font.unitsPerEm}function B0(r,e){var t=e.stack,n=t.pop(),i=e.ppem,a=e.deltaBase+(r-1)*16,s=e.deltaShift;exports.DEBUG&&console.log(e.step,"DELTAC["+r+"]",n,t);for(var o=0;o<n;o++){var l=t.pop(),u=t.pop(),c=a+((u&240)>>4);if(c===i){var f=(u&15)-8;f>=0&&f++;var d=f*s;exports.DEBUG&&console.log(e.step,"DELTACFIX",l,"by",d),e.cvt[l]+=d}}}function r8(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SROUND[]",e),r.round=FF;var t;switch(e&192){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(r.srPeriod=t,e&48){case 0:r.srPhase=0;break;case 16:r.srPhase=.25*t;break;case 32:r.srPhase=.5*t;break;case 48:r.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}e&=15,e===0?r.srThreshold=0:r.srThreshold=(e/8-.5)*t}function n8(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"S45ROUND[]",e),r.round=FF;var t;switch(e&192){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(r.srPeriod=t,e&48){case 0:r.srPhase=0;break;case 16:r.srPhase=.25*t;break;case 32:r.srPhase=.5*t;break;case 48:r.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}e&=15,e===0?r.srThreshold=0:r.srThreshold=(e/8-.5)*t}function i8(r){exports.DEBUG&&console.log(r.step,"ROFF[]"),r.round=U6}function a8(r){exports.DEBUG&&console.log(r.step,"RUTG[]"),r.round=$6}function s8(r){exports.DEBUG&&console.log(r.step,"RDTG[]"),r.round=H6}function o8(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SCANCTRL[]",e)}function _x(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z2[n],s=e.z1[i];exports.DEBUG&&console.log(e.step,"SDPVTL["+r+"]",n,i);var o,l;r?(o=a.y-s.y,l=s.x-a.x):(o=s.x-a.x,l=s.y-a.y),e.dpv=qf(o,l)}function l8(r){var e=r.stack,t=e.pop(),n=0;exports.DEBUG&&console.log(r.step,"GETINFO[]",t),t&1&&(n=35),t&32&&(n|=4096),e.push(n)}function u8(r){var e=r.stack,t=e.pop(),n=e.pop(),i=e.pop();exports.DEBUG&&console.log(r.step,"ROLL[]"),e.push(n),e.push(t),e.push(i)}function c8(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"MAX[]",t,n),e.push(Math.max(n,t))}function d8(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"MIN[]",t,n),e.push(Math.min(n,t))}function f8(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SCANTYPE[]",e)}function h8(r){var e=r.stack.pop(),t=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"INSTCTRL[]",e,t),e){case 1:r.inhibitGridFit=!!t;return;case 2:r.ignoreCvt=!!t;return;default:throw new Error("invalid INSTCTRL[] selector")}}function Ks(r,e){var t=e.stack,n=e.prog,i=e.ip;exports.DEBUG&&console.log(e.step,"PUSHB["+r+"]");for(var a=0;a<r;a++)t.push(n[++i]);e.ip=i}function Zs(r,e){var t=e.ip,n=e.prog,i=e.stack;exports.DEBUG&&console.log(e.ip,"PUSHW["+r+"]");for(var a=0;a<r;a++){var s=n[++t]<<8|n[++t];s&32768&&(s=-((s^65535)+1)),i.push(s)}e.ip=t}function gt(r,e,t,n,i,a){var s=a.stack,o=r&&s.pop(),l=s.pop(),u=a.rp0,c=a.z0[u],f=a.z1[l],d=a.minDis,h=a.fv,g=a.dpv,v,y,A,C;y=v=g.distance(f,c,!0,!0),A=y>=0?1:-1,y=Math.abs(y),r&&(C=a.cvt[o],n&&Math.abs(y-C)<a.cvCutIn&&(y=C)),t&&y<d&&(y=d),n&&(y=a.round(y)),h.setRelative(f,c,A*y,g),h.touch(f),exports.DEBUG&&console.log(a.step,(r?"MIRP[":"MDRP[")+(e?"M":"m")+(t?">":"_")+(n?"R":"_")+(i===0?"Gr":i===1?"Bl":i===2?"Wh":"")+"]",r?o+"("+a.cvt[o]+","+C+")":"",l,"(d =",v,"->",A*y,")"),a.rp1=a.rp0,a.rp2=l,e&&(a.rp0=l)}SF=[Cx.bind(void 0,Rs),Cx.bind(void 0,rs),xx.bind(void 0,Rs),xx.bind(void 0,rs),Sx.bind(void 0,Rs),Sx.bind(void 0,rs),Ex.bind(void 0,0),Ex.bind(void 0,1),kx.bind(void 0,0),kx.bind(void 0,1),j6,q6,W6,Q6,Y6,X6,J6,K6,Z6,eN,tN,rN,nN,iN,aN,sN,oN,lN,uN,cN,void 0,void 0,dN,R0,fN,hN,pN,vN,yN,void 0,void 0,void 0,gN,mN,AN,void 0,Tx.bind(void 0,0),Tx.bind(void 0,1),Fx.bind(void 0,Rs),Fx.bind(void 0,rs),Ix.bind(void 0,0),Ix.bind(void 0,1),Px.bind(void 0,0),Px.bind(void 0,1),Dx.bind(void 0,0),Dx.bind(void 0,1),wN,bN,Rx.bind(void 0,0),Rx.bind(void 0,1),CN,xN,Ox.bind(void 0,0),Ox.bind(void 0,1),SN,EN,kN,TN,FN,IN,Bx.bind(void 0,0),Bx.bind(void 0,1),void 0,Mx.bind(void 0,0),Mx.bind(void 0,1),PN,void 0,DN,void 0,void 0,RN,ON,BN,MN,_N,NN,LN,UN,VN,zN,$N,HN,GN,O0.bind(void 0,1),jN,qN,WN,QN,YN,XN,JN,KN,ZN,e8,Kh.bind(void 0,0),Kh.bind(void 0,1),Kh.bind(void 0,2),Kh.bind(void 0,3),void 0,void 0,void 0,void 0,t8,O0.bind(void 0,2),O0.bind(void 0,3),B0.bind(void 0,1),B0.bind(void 0,2),B0.bind(void 0,3),r8,n8,void 0,void 0,i8,void 0,a8,s8,R0,R0,void 0,void 0,void 0,void 0,void 0,o8,_x.bind(void 0,0),_x.bind(void 0,1),l8,void 0,u8,c8,d8,f8,h8,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Ks.bind(void 0,1),Ks.bind(void 0,2),Ks.bind(void 0,3),Ks.bind(void 0,4),Ks.bind(void 0,5),Ks.bind(void 0,6),Ks.bind(void 0,7),Ks.bind(void 0,8),Zs.bind(void 0,1),Zs.bind(void 0,2),Zs.bind(void 0,3),Zs.bind(void 0,4),Zs.bind(void 0,5),Zs.bind(void 0,6),Zs.bind(void 0,7),Zs.bind(void 0,8),gt.bind(void 0,0,0,0,0,0),gt.bind(void 0,0,0,0,0,1),gt.bind(void 0,0,0,0,0,2),gt.bind(void 0,0,0,0,0,3),gt.bind(void 0,0,0,0,1,0),gt.bind(void 0,0,0,0,1,1),gt.bind(void 0,0,0,0,1,2),gt.bind(void 0,0,0,0,1,3),gt.bind(void 0,0,0,1,0,0),gt.bind(void 0,0,0,1,0,1),gt.bind(void 0,0,0,1,0,2),gt.bind(void 0,0,0,1,0,3),gt.bind(void 0,0,0,1,1,0),gt.bind(void 0,0,0,1,1,1),gt.bind(void 0,0,0,1,1,2),gt.bind(void 0,0,0,1,1,3),gt.bind(void 0,0,1,0,0,0),gt.bind(void 0,0,1,0,0,1),gt.bind(void 0,0,1,0,0,2),gt.bind(void 0,0,1,0,0,3),gt.bind(void 0,0,1,0,1,0),gt.bind(void 0,0,1,0,1,1),gt.bind(void 0,0,1,0,1,2),gt.bind(void 0,0,1,0,1,3),gt.bind(void 0,0,1,1,0,0),gt.bind(void 0,0,1,1,0,1),gt.bind(void 0,0,1,1,0,2),gt.bind(void 0,0,1,1,0,3),gt.bind(void 0,0,1,1,1,0),gt.bind(void 0,0,1,1,1,1),gt.bind(void 0,0,1,1,1,2),gt.bind(void 0,0,1,1,1,3),gt.bind(void 0,1,0,0,0,0),gt.bind(void 0,1,0,0,0,1),gt.bind(void 0,1,0,0,0,2),gt.bind(void 0,1,0,0,0,3),gt.bind(void 0,1,0,0,1,0),gt.bind(void 0,1,0,0,1,1),gt.bind(void 0,1,0,0,1,2),gt.bind(void 0,1,0,0,1,3),gt.bind(void 0,1,0,1,0,0),gt.bind(void 0,1,0,1,0,1),gt.bind(void 0,1,0,1,0,2),gt.bind(void 0,1,0,1,0,3),gt.bind(void 0,1,0,1,1,0),gt.bind(void 0,1,0,1,1,1),gt.bind(void 0,1,0,1,1,2),gt.bind(void 0,1,0,1,1,3),gt.bind(void 0,1,1,0,0,0),gt.bind(void 0,1,1,0,0,1),gt.bind(void 0,1,1,0,0,2),gt.bind(void 0,1,1,0,0,3),gt.bind(void 0,1,1,0,1,0),gt.bind(void 0,1,1,0,1,1),gt.bind(void 0,1,1,0,1,2),gt.bind(void 0,1,1,0,1,3),gt.bind(void 0,1,1,1,0,0),gt.bind(void 0,1,1,1,0,1),gt.bind(void 0,1,1,1,0,2),gt.bind(void 0,1,1,1,0,3),gt.bind(void 0,1,1,1,1,0),gt.bind(void 0,1,1,1,1,1),gt.bind(void 0,1,1,1,1,2),gt.bind(void 0,1,1,1,1,3)];function mc(r){this.char=r,this.state={},this.activeState=null}function v1(r,e,t){this.contextName=t,this.startIndex=r,this.endOffset=e}function p8(r,e,t){this.contextName=r,this.openRange=null,this.ranges=[],this.checkStart=e,this.checkEnd=t}function Ra(r,e){this.context=r,this.index=e,this.length=r.length,this.current=r[e],this.backtrack=r.slice(0,e),this.lookahead=r.slice(e+1)}function Wg(r){this.eventId=r,this.subscribers=[]}function g8(r){var e=this,t=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];t.forEach(function(i){Object.defineProperty(e.events,i,{value:new Wg(i)})}),r&&t.forEach(function(i){var a=r[i];typeof a=="function"&&e.events[i].subscribe(a)});var n=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];n.forEach(function(i){e.events[i].subscribe(e.updateContextsRanges)})}function Gn(r){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],g8.call(this,r)}mc.prototype.setState=function(r,e){return this.state[r]=e,this.activeState={key:r,value:this.state[r]},this.activeState};mc.prototype.getState=function(r){return this.state[r]||null};Gn.prototype.inboundIndex=function(r){return r>=0&&r<this.tokens.length};Gn.prototype.composeRUD=function(r){var e=this,t=!0,n=r.map(function(a){return e[a[0]].apply(e,a.slice(1).concat(t))}),i=function(a){return typeof a=="object"&&a.hasOwnProperty("FAIL")};if(n.every(i))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:n.filter(i)};this.dispatch("composeRUD",[n.filter(function(a){return!i(a)})])};Gn.prototype.replaceRange=function(r,e,t,n){e=e!==null?e:this.tokens.length;var i=t.every(function(s){return s instanceof mc});if(!isNaN(r)&&this.inboundIndex(r)&&i){var a=this.tokens.splice.apply(this.tokens,[r,e].concat(t));return n||this.dispatch("replaceToken",[r,e,t]),[a,t]}else return{FAIL:"replaceRange: invalid tokens or startIndex."}};Gn.prototype.replaceToken=function(r,e,t){if(!isNaN(r)&&this.inboundIndex(r)&&e instanceof mc){var n=this.tokens.splice(r,1,e);return t||this.dispatch("replaceToken",[r,e]),[n[0],e]}else return{FAIL:"replaceToken: invalid token or index."}};Gn.prototype.removeRange=function(r,e,t){e=isNaN(e)?this.tokens.length:e;var n=this.tokens.splice(r,e);return t||this.dispatch("removeRange",[n,r,e]),n};Gn.prototype.removeToken=function(r,e){if(!isNaN(r)&&this.inboundIndex(r)){var t=this.tokens.splice(r,1);return e||this.dispatch("removeToken",[t,r]),t}else return{FAIL:"removeToken: invalid token index."}};Gn.prototype.insertToken=function(r,e,t){var n=r.every(function(i){return i instanceof mc});return n?(this.tokens.splice.apply(this.tokens,[e,0].concat(r)),t||this.dispatch("insertToken",[r,e]),r):{FAIL:"insertToken: invalid token(s)."}};Gn.prototype.registerModifier=function(r,e,t){this.events.newToken.subscribe(function(n,i){var a=[n,i],s=e===null||e.apply(this,a)===!0,o=[n,i];if(s){var l=t.apply(this,o);n.setState(r,l)}}),this.registeredModifiers.push(r)};Wg.prototype.subscribe=function(r){return typeof r=="function"?this.subscribers.push(r)-1:{FAIL:"invalid '"+this.eventId+"' event handler"}};Wg.prototype.unsubscribe=function(r){this.subscribers.splice(r,1)};Ra.prototype.setCurrentIndex=function(r){this.index=r,this.current=this.context[r],this.backtrack=this.context.slice(0,r),this.lookahead=this.context.slice(r+1)};Ra.prototype.get=function(r){switch(!0){case r===0:return this.current;case(r<0&&Math.abs(r)<=this.backtrack.length):return this.backtrack.slice(r)[0];case(r>0&&r<=this.lookahead.length):return this.lookahead[r-1];default:return null}};Gn.prototype.rangeToText=function(r){if(r instanceof v1)return this.getRangeTokens(r).map(function(e){return e.char}).join("")};Gn.prototype.getText=function(){return this.tokens.map(function(r){return r.char}).join("")};Gn.prototype.getContext=function(r){var e=this.registeredContexts[r];return e||null};Gn.prototype.on=function(r,e){var t=this.events[r];return t?t.subscribe(e):null};Gn.prototype.dispatch=function(r,e){var t=this,n=this.events[r];n instanceof Wg&&n.subscribers.forEach(function(i){i.apply(t,e||[])})};Gn.prototype.registerContextChecker=function(r,e,t){if(this.getContext(r))return{FAIL:"context name '"+r+"' is already registered."};if(typeof e!="function")return{FAIL:"missing context start check."};if(typeof t!="function")return{FAIL:"missing context end check."};var n=new p8(r,e,t);return this.registeredContexts[r]=n,this.contextCheckers.push(n),n};Gn.prototype.getRangeTokens=function(r){var e=r.startIndex+r.endOffset;return[].concat(this.tokens.slice(r.startIndex,e))};Gn.prototype.getContextRanges=function(r){var e=this.getContext(r);return e?e.ranges:{FAIL:"context checker '"+r+"' is not registered."}};Gn.prototype.resetContextsRanges=function(){var r=this.registeredContexts;for(var e in r)if(r.hasOwnProperty(e)){var t=r[e];t.ranges=[]}};Gn.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var r=this.tokens.map(function(n){return n.char}),e=0;e<r.length;e++){var t=new Ra(r,e);this.runContextCheck(t)}this.dispatch("updateContextsRanges",[this.registeredContexts])};Gn.prototype.setEndOffset=function(r,e){var t=this.getContext(e).openRange.startIndex,n=new v1(t,r,e),i=this.getContext(e).ranges;return n.rangeId=e+"."+i.length,i.push(n),this.getContext(e).openRange=null,n};Gn.prototype.runContextCheck=function(r){var e=this,t=r.index;this.contextCheckers.forEach(function(n){var i=n.contextName,a=e.getContext(i).openRange;if(!a&&n.checkStart(r)&&(a=new v1(t,null,i),e.getContext(i).openRange=a,e.dispatch("contextStart",[i,t])),a&&n.checkEnd(r)){var s=t-a.startIndex+1,o=e.setEndOffset(s,i);e.dispatch("contextEnd",[i,o])}})};Gn.prototype.tokenize=function(r){this.tokens=[],this.resetContextsRanges();var e=Array.from(r);this.dispatch("start");for(var t=0;t<e.length;t++){var n=e[t],i=new Ra(e,t);this.dispatch("next",[i]),this.runContextCheck(i);var a=new mc(n);this.tokens.push(a),this.dispatch("newToken",[a,i])}return this.dispatch("end",[this.tokens]),this.tokens};function vo(r){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(r)}function PF(r){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(r)}function Fo(r){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(r)}function jp(r){return/[A-z]/.test(r)}function m8(r){return/\s/.test(r)}function aa(r){this.font=r,this.features={}}function vl(r){this.id=r.id,this.tag=r.tag,this.substitution=r.substitution}function Wf(r,e){if(!r)return-1;switch(e.format){case 1:return e.glyphs.indexOf(r);case 2:for(var t=e.ranges,n=0;n<t.length;n++){var i=t[n];if(r>=i.start&&r<=i.end){var a=r-i.start;return i.index+a}}break;default:return-1}return-1}function v8(r,e){var t=Wf(r,e.coverage);return t===-1?null:r+e.deltaGlyphId}function y8(r,e){var t=Wf(r,e.coverage);return t===-1?null:e.substitute[t]}function M0(r,e){for(var t=[],n=0;n<r.length;n++){var i=r[n],a=e.current;a=Array.isArray(a)?a[0]:a;var s=Wf(a,i);s!==-1&&t.push(s)}return t.length!==r.length?-1:t}function A8(r,e){var t=e.inputCoverage.length+e.lookaheadCoverage.length+e.backtrackCoverage.length;if(r.context.length<t)return[];var n=M0(e.inputCoverage,r);if(n===-1)return[];var i=e.inputCoverage.length-1;if(r.lookahead.length<e.lookaheadCoverage.length)return[];for(var a=r.lookahead.slice(i);a.length&&Fo(a[0].char);)a.shift();var s=new Ra(a,0),o=M0(e.lookaheadCoverage,s),l=[].concat(r.backtrack);for(l.reverse();l.length&&Fo(l[0].char);)l.shift();if(l.length<e.backtrackCoverage.length)return[];var u=new Ra(l,0),c=M0(e.backtrackCoverage,u),f=n.length===e.inputCoverage.length&&o.length===e.lookaheadCoverage.length&&c.length===e.backtrackCoverage.length,d=[];if(f)for(var h=0;h<e.lookupRecords.length;h++)for(var g=e.lookupRecords[h],v=g.lookupListIndex,y=this.getLookupByIndex(v),A=0;A<y.subtables.length;A++){var C=y.subtables[A],S=this.getLookupMethod(y,C),F=this.getSubstitutionType(y,C);if(F==="12")for(var E=0;E<n.length;E++){var R=r.get(E),B=S(R);B&&d.push(B)}}return d}function w8(r,e){var t=r.current,n=Wf(t,e.coverage);if(n===-1)return null;for(var i,a=e.ligatureSets[n],s=0;s<a.length;s++){i=a[s];for(var o=0;o<i.components.length;o++){var l=r.lookahead[o],u=i.components[o];if(l!==u)break;if(o===i.components.length-1)return i}}return null}function b8(r,e){var t=Wf(r,e.coverage);return t===-1?null:e.sequences[t]}aa.prototype.getDefaultScriptFeaturesIndexes=function(){for(var r=this.font.tables.gsub.scripts,e=0;e<r.length;e++){var t=r[e];if(t.tag==="DFLT")return t.script.defaultLangSys.featureIndexes}return[]};aa.prototype.getScriptFeaturesIndexes=function(r){var e=this.font.tables;if(!e.gsub)return[];if(!r)return this.getDefaultScriptFeaturesIndexes();for(var t=this.font.tables.gsub.scripts,n=0;n<t.length;n++){var i=t[n];if(i.tag===r&&i.script.defaultLangSys)return i.script.defaultLangSys.featureIndexes;var a=i.langSysRecords;if(a)for(var s=0;s<a.length;s++){var o=a[s];if(o.tag===r){var l=o.langSys;return l.featureIndexes}}}return this.getDefaultScriptFeaturesIndexes()};aa.prototype.mapTagsToFeatures=function(r,e){for(var t={},n=0;n<r.length;n++){var i=r[n].tag,a=r[n].feature;t[i]=a}this.features[e].tags=t};aa.prototype.getScriptFeatures=function(r){var e=this.features[r];if(this.features.hasOwnProperty(r))return e;var t=this.getScriptFeaturesIndexes(r);if(!t)return null;var n=this.font.tables.gsub;return e=t.map(function(i){return n.features[i]}),this.features[r]=e,this.mapTagsToFeatures(e,r),e};aa.prototype.getSubstitutionType=function(r,e){var t=r.lookupType.toString(),n=e.substFormat.toString();return t+n};aa.prototype.getLookupMethod=function(r,e){var t=this,n=this.getSubstitutionType(r,e);switch(n){case"11":return function(i){return v8.apply(t,[i,e])};case"12":return function(i){return y8.apply(t,[i,e])};case"63":return function(i){return A8.apply(t,[i,e])};case"41":return function(i){return w8.apply(t,[i,e])};case"21":return function(i){return b8.apply(t,[i,e])};default:throw new Error("lookupType: "+r.lookupType+" - substFormat: "+e.substFormat+" is not yet supported")}};aa.prototype.lookupFeature=function(r){var e=r.contextParams,t=e.index,n=this.getFeature({tag:r.tag,script:r.script});if(!n)return new Error("font '"+this.font.names.fullName.en+"' doesn't support feature '"+r.tag+"' for script '"+r.script+"'.");for(var i=this.getFeatureLookups(n),a=[].concat(e.context),s=0;s<i.length;s++)for(var o=i[s],l=this.getLookupSubtables(o),u=0;u<l.length;u++){var c=l[u],f=this.getSubstitutionType(o,c),d=this.getLookupMethod(o,c),h=void 0;switch(f){case"11":h=d(e.current),h&&a.splice(t,1,new vl({id:11,tag:r.tag,substitution:h}));break;case"12":h=d(e.current),h&&a.splice(t,1,new vl({id:12,tag:r.tag,substitution:h}));break;case"63":h=d(e),Array.isArray(h)&&h.length&&a.splice(t,1,new vl({id:63,tag:r.tag,substitution:h}));break;case"41":h=d(e),h&&a.splice(t,1,new vl({id:41,tag:r.tag,substitution:h}));break;case"21":h=d(e.current),h&&a.splice(t,1,new vl({id:21,tag:r.tag,substitution:h}));break}e=new Ra(a,t),!(Array.isArray(h)&&!h.length)&&(h=null)}return a.length?a:null};aa.prototype.supports=function(r){if(!r.script)return!1;this.getScriptFeatures(r.script);var e=this.features.hasOwnProperty(r.script);if(!r.tag)return e;var t=this.features[r.script].some(function(n){return n.tag===r.tag});return e&&t};aa.prototype.getLookupSubtables=function(r){return r.subtables||null};aa.prototype.getLookupByIndex=function(r){var e=this.font.tables.gsub.lookups;return e[r]||null};aa.prototype.getFeatureLookups=function(r){return r.lookupListIndexes.map(this.getLookupByIndex.bind(this))};aa.prototype.getFeature=function(e){if(!this.font)return{FAIL:"No font was found"};this.features.hasOwnProperty(e.script)||this.getScriptFeatures(e.script);var t=this.features[e.script];return t?t.tags[e.tag]?this.features[e.script].tags[e.tag]:null:{FAIL:"No feature for script "+e.script}};function C8(r){var e=r.current,t=r.get(-1);return t===null&&vo(e)||!vo(t)&&vo(e)}function x8(r){var e=r.get(1);return e===null||!vo(e)}var S8={startCheck:C8,endCheck:x8};function E8(r){var e=r.current,t=r.get(-1);return(vo(e)||Fo(e))&&!vo(t)}function k8(r){var e=r.get(1);switch(!0){case e===null:return!0;case(!vo(e)&&!Fo(e)):var t=m8(e);if(!t)return!0;if(t){var n=!1;if(n=r.lookahead.some(function(i){return vo(i)||Fo(i)}),!n)return!0}break;default:return!1}}var T8={startCheck:E8,endCheck:k8};function F8(r,e,t){e[t].setState(r.tag,r.substitution)}function I8(r,e,t){e[t].setState(r.tag,r.substitution)}function P8(r,e,t){r.substitution.forEach(function(n,i){var a=e[t+i];a.setState(r.tag,n)})}function D8(r,e,t){var n=e[t];n.setState(r.tag,r.substitution.ligGlyph);for(var i=r.substitution.components.length,a=0;a<i;a++)n=e[t+a+1],n.setState("deleted",!0)}var Nx={11:F8,12:I8,63:P8,41:D8};function y1(r,e,t){r instanceof vl&&Nx[r.id]&&Nx[r.id](r,e,t)}function R8(r){for(var e=[].concat(r.backtrack),t=e.length-1;t>=0;t--){var n=e[t],i=PF(n),a=Fo(n);if(!i&&!a)return!0;if(i)return!1}return!1}function O8(r){if(PF(r.current))return!1;for(var e=0;e<r.lookahead.length;e++){var t=r.lookahead[e],n=Fo(t);if(!n)return!0}return!1}function B8(r){var e=this,t="arab",n=this.featuresTags[t],i=this.tokenizer.getRangeTokens(r);if(i.length!==1){var a=new Ra(i.map(function(o){return o.getState("glyphIndex")}),0),s=new Ra(i.map(function(o){return o.char}),0);i.forEach(function(o,l){if(!Fo(o.char)){a.setCurrentIndex(l),s.setCurrentIndex(l);var u=0;R8(s)&&(u|=1),O8(s)&&(u|=2);var c;switch(u){case 1:c="fina";break;case 2:c="init";break;case 3:c="medi";break}if(n.indexOf(c)!==-1){var f=e.query.lookupFeature({tag:c,script:t,contextParams:a});if(f instanceof Error)return console.info(f.message);f.forEach(function(d,h){d instanceof vl&&(y1(d,i,h),a.context[h]=d.substitution)})}}})}}function Lx(r,e){var t=r.map(function(n){return n.activeState.value});return new Ra(t,0)}function M8(r){var e=this,t="arab",n=this.tokenizer.getRangeTokens(r),i=Lx(n);i.context.forEach(function(a,s){i.setCurrentIndex(s);var o=e.query.lookupFeature({tag:"rlig",script:t,contextParams:i});o.length&&(o.forEach(function(l){return y1(l,n,s)}),i=Lx(n))})}function _8(r){var e=r.current,t=r.get(-1);return t===null&&jp(e)||!jp(t)&&jp(e)}function N8(r){var e=r.get(1);return e===null||!jp(e)}var L8={startCheck:_8,endCheck:N8};function Ux(r,e){var t=r.map(function(n){return n.activeState.value});return new Ra(t,0)}function U8(r){var e=this,t="latn",n=this.tokenizer.getRangeTokens(r),i=Ux(n);i.context.forEach(function(a,s){i.setCurrentIndex(s);var o=e.query.lookupFeature({tag:"liga",script:t,contextParams:i});o.length&&(o.forEach(function(l){return y1(l,n,s)}),i=Ux(n))})}function La(r){this.baseDir=r||"ltr",this.tokenizer=new Gn,this.featuresTags={}}La.prototype.setText=function(r){this.text=r};La.prototype.contextChecks={latinWordCheck:L8,arabicWordCheck:S8,arabicSentenceCheck:T8};function _0(r){var e=this.contextChecks[r+"Check"];return this.tokenizer.registerContextChecker(r,e.startCheck,e.endCheck)}function V8(){return _0.call(this,"latinWord"),_0.call(this,"arabicWord"),_0.call(this,"arabicSentence"),this.tokenizer.tokenize(this.text)}function z8(){var r=this,e=this.tokenizer.getContextRanges("arabicSentence");e.forEach(function(t){var n=r.tokenizer.getRangeTokens(t);r.tokenizer.replaceRange(t.startIndex,t.endOffset,n.reverse())})}La.prototype.registerFeatures=function(r,e){var t=this,n=e.filter(function(i){return t.query.supports({script:r,tag:i})});this.featuresTags.hasOwnProperty(r)?this.featuresTags[r]=this.featuresTags[r].concat(n):this.featuresTags[r]=n};La.prototype.applyFeatures=function(r,e){if(!r)throw new Error("No valid font was provided to apply features");this.query||(this.query=new aa(r));for(var t=0;t<e.length;t++){var n=e[t];this.query.supports({script:n.script})&&this.registerFeatures(n.script,n.tags)}};La.prototype.registerModifier=function(r,e,t){this.tokenizer.registerModifier(r,e,t)};function A1(){if(this.tokenizer.registeredModifiers.indexOf("glyphIndex")===-1)throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function $8(){var r=this,e="arab";if(this.featuresTags.hasOwnProperty(e)){A1.call(this);var t=this.tokenizer.getContextRanges("arabicWord");t.forEach(function(n){B8.call(r,n)})}}function H8(){var r=this,e="arab";if(this.featuresTags.hasOwnProperty(e)){var t=this.featuresTags[e];if(t.indexOf("rlig")!==-1){A1.call(this);var n=this.tokenizer.getContextRanges("arabicWord");n.forEach(function(i){M8.call(r,i)})}}}function G8(){var r=this,e="latn";if(this.featuresTags.hasOwnProperty(e)){var t=this.featuresTags[e];if(t.indexOf("liga")!==-1){A1.call(this);var n=this.tokenizer.getContextRanges("latinWord");n.forEach(function(i){U8.call(r,i)})}}}La.prototype.checkContextReady=function(r){return!!this.tokenizer.getContext(r)};La.prototype.applyFeaturesToContexts=function(){this.checkContextReady("arabicWord")&&($8.call(this),H8.call(this)),this.checkContextReady("latinWord")&&G8.call(this),this.checkContextReady("arabicSentence")&&z8.call(this)};La.prototype.processText=function(r){(!this.text||this.text!==r)&&(this.setText(r),V8.call(this),this.applyFeaturesToContexts())};La.prototype.getBidiText=function(r){return this.processText(r),this.tokenizer.getText()};La.prototype.getTextGlyphs=function(r){this.processText(r);for(var e=[],t=0;t<this.tokenizer.tokens.length;t++){var n=this.tokenizer.tokens[t];if(!n.state.deleted){var i=n.activeState.value;e.push(Array.isArray(i)?i[0]:i)}}return e};function hn(r){r=r||{},r.tables=r.tables||{},r.empty||(pd(r.familyName,"When creating a new Font object, familyName is required."),pd(r.styleName,"When creating a new Font object, styleName is required."),pd(r.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),pd(r.ascender,"When creating a new Font object, ascender is required."),pd(r.descender<=0,"When creating a new Font object, negative descender value is required."),this.names={fontFamily:{en:r.familyName||" "},fontSubfamily:{en:r.styleName||" "},fullName:{en:r.fullName||r.familyName+" "+r.styleName},postScriptName:{en:r.postScriptName||(r.familyName+r.styleName).replace(/\s/g,"")},designer:{en:r.designer||" "},designerURL:{en:r.designerURL||" "},manufacturer:{en:r.manufacturer||" "},manufacturerURL:{en:r.manufacturerURL||" "},license:{en:r.license||" "},licenseURL:{en:r.licenseURL||" "},version:{en:r.version||"Version 0.1"},description:{en:r.description||" "},copyright:{en:r.copyright||" "},trademark:{en:r.trademark||" "}},this.unitsPerEm=r.unitsPerEm||1e3,this.ascender=r.ascender,this.descender=r.descender,this.createdTimestamp=r.createdTimestamp,this.tables=Object.assign(r.tables,{os2:Object.assign({usWeightClass:r.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:r.widthClass||this.usWidthClasses.MEDIUM,fsSelection:r.fsSelection||this.fsSelectionValues.REGULAR},r.tables.os2)})),this.supported=!0,this.glyphs=new os.GlyphSet(this,r.glyphs||[]),this.encoding=new YT(this),this.position=new Gf(this),this.substitution=new ia(this),this.tables=this.tables||{},this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){if(this._hinting)return this._hinting;if(this.outlinesFormat==="truetype")return this._hinting=new kF(this)}})}hn.prototype.hasChar=function(r){return this.encoding.charToGlyphIndex(r)!==null};hn.prototype.charToGlyphIndex=function(r){return this.encoding.charToGlyphIndex(r)};hn.prototype.charToGlyph=function(r){var e=this.charToGlyphIndex(r),t=this.glyphs.get(e);return t||(t=this.glyphs.get(0)),t};hn.prototype.updateFeatures=function(r){return this.defaultRenderOptions.features.map(function(e){return e.script==="latn"?{script:"latn",tags:e.tags.filter(function(t){return r[t]})}:e})};hn.prototype.stringToGlyphs=function(r,e){var t=this,n=new La,i=function(f){return t.charToGlyphIndex(f.char)};n.registerModifier("glyphIndex",null,i);var a=e?this.updateFeatures(e.features):this.defaultRenderOptions.features;n.applyFeatures(this,a);for(var s=n.getTextGlyphs(r),o=s.length,l=new Array(o),u=this.glyphs.get(0),c=0;c<o;c+=1)l[c]=this.glyphs.get(s[c])||u;return l};hn.prototype.nameToGlyphIndex=function(r){return this.glyphNames.nameToGlyphIndex(r)};hn.prototype.nameToGlyph=function(r){var e=this.nameToGlyphIndex(r),t=this.glyphs.get(e);return t||(t=this.glyphs.get(0)),t};hn.prototype.glyphIndexToName=function(r){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(r):""};hn.prototype.getKerningValue=function(r,e){r=r.index||r,e=e.index||e;var t=this.position.defaultKerningTables;return t?this.position.getKerningValue(t,r,e):this.kerningPairs[r+","+e]||0};hn.prototype.defaultRenderOptions={kerning:!0,features:[{script:"arab",tags:["init","medi","fina","rlig"]},{script:"latn",tags:["liga","rlig"]}]};hn.prototype.forEachGlyph=function(r,e,t,n,i,a){e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:72,i=Object.assign({},this.defaultRenderOptions,i);var s=1/this.unitsPerEm*n,o=this.stringToGlyphs(r,i),l;if(i.kerning){var u=i.script||this.position.getDefaultScriptName();l=this.position.getKerningTables(u,i.language)}for(var c=0;c<o.length;c+=1){var f=o[c];if(a.call(this,f,e,t,n,i),f.advanceWidth&&(e+=f.advanceWidth*s),i.kerning&&c<o.length-1){var d=l?this.position.getKerningValue(l,f.index,o[c+1].index):this.getKerningValue(f,o[c+1]);e+=d*s}i.letterSpacing?e+=i.letterSpacing*n:i.tracking&&(e+=i.tracking/1e3*n)}return e};hn.prototype.getPath=function(r,e,t,n,i){var a=new fi;return this.forEachGlyph(r,e,t,n,i,function(s,o,l,u){var c=s.getPath(o,l,u,i,this);a.extend(c)}),a};hn.prototype.getPaths=function(r,e,t,n,i){var a=[];return this.forEachGlyph(r,e,t,n,i,function(s,o,l,u){var c=s.getPath(o,l,u,i,this);a.push(c)}),a};hn.prototype.getAdvanceWidth=function(r,e,t){return this.forEachGlyph(r,0,0,e,t,function(){})};hn.prototype.draw=function(r,e,t,n,i,a){this.getPath(e,t,n,i,a).draw(r)};hn.prototype.drawPoints=function(r,e,t,n,i,a){this.forEachGlyph(e,t,n,i,a,function(s,o,l,u){s.drawPoints(r,o,l,u)})};hn.prototype.drawMetrics=function(r,e,t,n,i,a){this.forEachGlyph(e,t,n,i,a,function(s,o,l,u){s.drawMetrics(r,o,l,u)})};hn.prototype.getEnglishName=function(r){var e=this.names[r];if(e)return e.en};hn.prototype.validate=function(){var r=this;function e(n,i){}function t(n){var i=r.getEnglishName(n);i&&i.trim().length>0}t("fontFamily"),t("weightName"),t("manufacturer"),t("copyright"),t("version"),this.unitsPerEm>0};hn.prototype.toTables=function(){return D6.fontToTable(this)};hn.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()};hn.prototype.toArrayBuffer=function(){for(var r=this.toTables(),e=r.encode(),t=new ArrayBuffer(e.length),n=new Uint8Array(t),i=0;i<e.length;i++)n[i]=e[i];return t};hn.prototype.download=function(r){var e=this.getEnglishName("fontFamily"),t=this.getEnglishName("fontSubfamily");r=r||e.replace(/\s/g,"")+"-"+t+".otf";var n=this.toArrayBuffer();if(O6())if(window.URL=window.URL||window.webkitURL,window.URL){var i=new DataView(n),a=new Blob([i],{type:"font/opentype"}),s=document.createElement("a");s.href=window.URL.createObjectURL(a),s.download=r;var o=document.createEvent("MouseEvents");o.initEvent("click",!0,!1),s.dispatchEvent(o)}else console.warn("Font file could not be downloaded. Try using a different browser.");else{var l=require("fs"),u=B6(n);l.writeFileSync(r,u)}};hn.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512};hn.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9};hn.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};function DF(r,e){var t=JSON.stringify(r),n=256;for(var i in e){var a=parseInt(i);if(!(!a||a<256)){if(JSON.stringify(e[i])===t)return a;n<=a&&(n=a+1)}}return e[n]=r,n}function j8(r,e,t){var n=DF(e.name,t);return[{name:"tag_"+r,type:"TAG",value:e.tag},{name:"minValue_"+r,type:"FIXED",value:e.minValue<<16},{name:"defaultValue_"+r,type:"FIXED",value:e.defaultValue<<16},{name:"maxValue_"+r,type:"FIXED",value:e.maxValue<<16},{name:"flags_"+r,type:"USHORT",value:0},{name:"nameID_"+r,type:"USHORT",value:n}]}function q8(r,e,t){var n={},i=new vt.Parser(r,e);return n.tag=i.parseTag(),n.minValue=i.parseFixed(),n.defaultValue=i.parseFixed(),n.maxValue=i.parseFixed(),i.skip("uShort",1),n.name=t[i.parseUShort()]||{},n}function W8(r,e,t,n){for(var i=DF(e.name,n),a=[{name:"nameID_"+r,type:"USHORT",value:i},{name:"flags_"+r,type:"USHORT",value:0}],s=0;s<t.length;++s){var o=t[s].tag;a.push({name:"axis_"+r+" "+o,type:"FIXED",value:e.coordinates[o]<<16})}return a}function Q8(r,e,t,n){var i={},a=new vt.Parser(r,e);i.name=n[a.parseUShort()]||{},a.skip("uShort",1),i.coordinates={};for(var s=0;s<t.length;++s)i.coordinates[t[s].tag]=a.parseFixed();return i}function Y8(r,e){var t=new dt.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:r.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:r.instances.length},{name:"instanceSize",type:"USHORT",value:4+r.axes.length*4}]);t.offsetToData=t.sizeOf();for(var n=0;n<r.axes.length;n++)t.fields=t.fields.concat(j8(n,r.axes[n],e));for(var i=0;i<r.instances.length;i++)t.fields=t.fields.concat(W8(i,r.instances[i],r.axes,e));return t}function X8(r,e,t){var n=new vt.Parser(r,e),i=n.parseULong();Gt.argument(i===65536,"Unsupported fvar table version.");var a=n.parseOffset16();n.skip("uShort",1);for(var s=n.parseUShort(),o=n.parseUShort(),l=n.parseUShort(),u=n.parseUShort(),c=[],f=0;f<s;f++)c.push(q8(r,e+a+f*o,t));for(var d=[],h=e+a+s*o,g=0;g<l;g++)d.push(Q8(r,h+g*u,c,t));return{axes:c,instances:d}}var J8={make:Y8,parse:X8},K8=function(){return{coverage:this.parsePointer(be.coverage),attachPoints:this.parseList(be.pointer(be.uShortList))}},Z8=function(){var r=this.parseUShort();if(Gt.argument(r===1||r===2||r===3,"Unsupported CaretValue table version."),r===1)return{coordinate:this.parseShort()};if(r===2)return{pointindex:this.parseShort()};if(r===3)return{coordinate:this.parseShort()}},e7=function(){return this.parseList(be.pointer(Z8))},t7=function(){return{coverage:this.parsePointer(be.coverage),ligGlyphs:this.parseList(be.pointer(e7))}},r7=function(){return this.parseUShort(),this.parseList(be.pointer(be.coverage))};function n7(r,e){e=e||0;var t=new be(r,e),n=t.parseVersion(1);Gt.argument(n===1||n===1.2||n===1.3,"Unsupported GDEF table version.");var i={version:n,classDef:t.parsePointer(be.classDef),attachList:t.parsePointer(K8),ligCaretList:t.parsePointer(t7),markAttachClassDef:t.parsePointer(be.classDef)};return n>=1.2&&(i.markGlyphSets=t.parsePointer(r7)),i}var i7={parse:n7},Oa=new Array(10);Oa[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{posFormat:1,coverage:this.parsePointer(be.coverage),value:this.parseValueRecord()};if(t===2)return{posFormat:2,coverage:this.parsePointer(be.coverage),values:this.parseValueRecordList()};Gt.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")};Oa[2]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();Gt.assert(t===1||t===2,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var n=this.parsePointer(be.coverage),i=this.parseUShort(),a=this.parseUShort();if(t===1)return{posFormat:t,coverage:n,valueFormat1:i,valueFormat2:a,pairSets:this.parseList(be.pointer(be.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(i),value2:this.parseValueRecord(a)}})))};if(t===2){var s=this.parsePointer(be.classDef),o=this.parsePointer(be.classDef),l=this.parseUShort(),u=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:i,valueFormat2:a,classDef1:s,classDef2:o,class1Count:l,class2Count:u,classRecords:this.parseList(l,be.list(u,function(){return{value1:this.parseValueRecord(i),value2:this.parseValueRecord(a)}}))}}};Oa[3]=function(){return{error:"GPOS Lookup 3 not supported"}};Oa[4]=function(){return{error:"GPOS Lookup 4 not supported"}};Oa[5]=function(){return{error:"GPOS Lookup 5 not supported"}};Oa[6]=function(){return{error:"GPOS Lookup 6 not supported"}};Oa[7]=function(){return{error:"GPOS Lookup 7 not supported"}};Oa[8]=function(){return{error:"GPOS Lookup 8 not supported"}};Oa[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function a7(r,e){e=e||0;var t=new be(r,e),n=t.parseVersion(1);return Gt.argument(n===1||n===1.1,"Unsupported GPOS table version "+n),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(Oa)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(Oa),variations:t.parseFeatureVariationsList()}}var s7=new Array(10);function o7(r){return new dt.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new dt.ScriptList(r.scripts)},{name:"features",type:"TABLE",value:new dt.FeatureList(r.features)},{name:"lookups",type:"TABLE",value:new dt.LookupList(r.lookups,s7)}])}var l7={parse:a7,make:o7};function u7(r){var e={};r.skip("uShort");var t=r.parseUShort();Gt.argument(t===0,"Unsupported kern sub-table version."),r.skip("uShort",2);var n=r.parseUShort();r.skip("uShort",3);for(var i=0;i<n;i+=1){var a=r.parseUShort(),s=r.parseUShort(),o=r.parseShort();e[a+","+s]=o}return e}function c7(r){var e={};r.skip("uShort");var t=r.parseULong();t>1&&console.warn("Only the first kern subtable is supported."),r.skip("uLong");var n=r.parseUShort(),i=n&255;if(r.skip("uShort"),i===0){var a=r.parseUShort();r.skip("uShort",3);for(var s=0;s<a;s+=1){var o=r.parseUShort(),l=r.parseUShort(),u=r.parseShort();e[o+","+l]=u}}return e}function d7(r,e){var t=new vt.Parser(r,e),n=t.parseUShort();if(n===0)return u7(t);if(n===1)return c7(t);throw new Error("Unsupported kern table version ("+n+").")}var f7={parse:d7};function h7(r,e,t,n){for(var i=new vt.Parser(r,e),a=n?i.parseUShort:i.parseULong,s=[],o=0;o<t+1;o+=1){var l=a.call(i);n&&(l*=2),s.push(l)}return s}var p7={parse:h7};function Vx(r,e){for(var t=[],n=12,i=0;i<e;i+=1){var a=vt.getTag(r,n),s=vt.getULong(r,n+4),o=vt.getULong(r,n+8),l=vt.getULong(r,n+12);t.push({tag:a,checksum:s,offset:o,length:l,compression:!1}),n+=16}return t}function g7(r,e){for(var t=[],n=44,i=0;i<e;i+=1){var a=vt.getTag(r,n),s=vt.getULong(r,n+4),o=vt.getULong(r,n+8),l=vt.getULong(r,n+12),u=void 0;o<l?u="WOFF":u=!1,t.push({tag:a,offset:s,compression:u,compressedLength:o,length:l}),n+=20}return t}function Qn(r,e){if(e.compression==="WOFF"){var t=new Uint8Array(r.buffer,e.offset+2,e.compressedLength-2),n=new Uint8Array(e.length);if(l5(t,n),n.byteLength!==e.length)throw new Error("Decompression error: "+e.tag+" decompressed length doesn't match recorded length");var i=new DataView(n.buffer,0);return{data:i,offset:0}}else return{data:r,offset:e.offset}}function nA(r,e){e=e??{};var t,n,i=new hn({empty:!0}),a=new DataView(r,0),s,o=[],l=vt.getTag(a,0);if(l==="\0\0\0"||l==="true"||l==="typ1")i.outlinesFormat="truetype",s=vt.getUShort(a,4),o=Vx(a,s);else if(l==="OTTO")i.outlinesFormat="cff",s=vt.getUShort(a,4),o=Vx(a,s);else if(l==="wOFF"){var u=vt.getTag(a,4);if(u==="\0\0\0")i.outlinesFormat="truetype";else if(u==="OTTO")i.outlinesFormat="cff";else throw new Error("Unsupported OpenType flavor "+l);s=vt.getUShort(a,12),o=g7(a,s)}else throw new Error("Unsupported OpenType signature "+l);for(var c,f,d,h,g,v,y,A,C,S,F,E,R=0;R<s;R+=1){var B=o[R],G=void 0;switch(B.tag){case"cmap":G=Qn(a,B),i.tables.cmap=QT.parse(G.data,G.offset),i.encoding=new XT(i.tables.cmap);break;case"cvt ":G=Qn(a,B),E=new vt.Parser(G.data,G.offset),i.tables.cvt=E.parseShortList(B.length/2);break;case"fvar":f=B;break;case"fpgm":G=Qn(a,B),E=new vt.Parser(G.data,G.offset),i.tables.fpgm=E.parseByteList(B.length);break;case"head":G=Qn(a,B),i.tables.head=sF.parse(G.data,G.offset),i.unitsPerEm=i.tables.head.unitsPerEm,t=i.tables.head.indexToLocFormat;break;case"hhea":G=Qn(a,B),i.tables.hhea=oF.parse(G.data,G.offset),i.ascender=i.tables.hhea.ascender,i.descender=i.tables.hhea.descender,i.numberOfHMetrics=i.tables.hhea.numberOfHMetrics;break;case"hmtx":y=B;break;case"ltag":G=Qn(a,B),n=uF.parse(G.data,G.offset);break;case"maxp":G=Qn(a,B),i.tables.maxp=cF.parse(G.data,G.offset),i.numGlyphs=i.tables.maxp.numGlyphs;break;case"name":S=B;break;case"OS/2":G=Qn(a,B),i.tables.os2=tA.parse(G.data,G.offset);break;case"post":G=Qn(a,B),i.tables.post=mF.parse(G.data,G.offset),i.glyphNames=new h1(i.tables.post);break;case"prep":G=Qn(a,B),E=new vt.Parser(G.data,G.offset),i.tables.prep=E.parseByteList(B.length);break;case"glyf":d=B;break;case"loca":C=B;break;case"CFF ":c=B;break;case"kern":A=B;break;case"GDEF":h=B;break;case"GPOS":g=B;break;case"GSUB":v=B;break;case"meta":F=B;break}}var j=Qn(a,S);if(i.tables.name=gF.parse(j.data,j.offset,n),i.names=i.tables.name,d&&C){var ie=t===0,q=Qn(a,C),Y=p7.parse(q.data,q.offset,i.numGlyphs,ie),J=Qn(a,d);i.glyphs=xF.parse(J.data,J.offset,Y,i,e)}else if(c){var ae=Qn(a,c);aF.parse(ae.data,ae.offset,i,e)}else throw new Error("Font doesn't contain TrueType or CFF outlines.");var oe=Qn(a,y);if(lF.parse(i,oe.data,oe.offset,i.numberOfHMetrics,i.numGlyphs,i.glyphs,e),I5(i,e),A){var he=Qn(a,A);i.kerningPairs=f7.parse(he.data,he.offset)}else i.kerningPairs={};if(h){var ye=Qn(a,h);i.tables.gdef=i7.parse(ye.data,ye.offset)}if(g){var Ue=Qn(a,g);i.tables.gpos=l7.parse(Ue.data,Ue.offset),i.position.init()}if(v){var Re=Qn(a,v);i.tables.gsub=vF.parse(Re.data,Re.offset)}if(f){var Oe=Qn(a,f);i.tables.fvar=J8.parse(Oe.data,Oe.offset,i.names)}if(F){var ee=Qn(a,F);i.tables.meta=yF.parse(ee.data,ee.offset),i.metas=i.tables.meta}return i}var Mu=function(){return Mu=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Mu.apply(this,arguments)},m7="~",v7="~~";function w1(r,e){for(var t={},n={},i=r.split(v7),a=!1,s=0;i.length>s;s++){for(var o=i[s].split(m7),l=0;l<o.length;l+=2){var u=o[l],c=o[l+1],f="&"+u+";";t[f]=c,a&&(t["&"+u]=c),n[c]=f}a=!0}return e?{entities:Mu(Mu({},t),e.entities),characters:Mu(Mu({},n),e.characters)}:{entities:t,characters:n}}var N0={xml:/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html4:/&notin;|&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html5:/&centerdot;|&copysr;|&divideontimes;|&gtcc;|&gtcir;|&gtdot;|&gtlPar;|&gtquest;|&gtrapprox;|&gtrarr;|&gtrdot;|&gtreqless;|&gtreqqless;|&gtrless;|&gtrsim;|&ltcc;|&ltcir;|&ltdot;|&lthree;|&ltimes;|&ltlarr;|&ltquest;|&ltrPar;|&ltri;|&ltrie;|&ltrif;|&notin;|&notinE;|&notindot;|&notinva;|&notinvb;|&notinvc;|&notni;|&notniva;|&notnivb;|&notnivc;|&parallel;|&timesb;|&timesbar;|&timesd;|&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g},ic={};ic.xml=w1(`lt~<~gt~>~quot~"~apos~'~amp~&`);ic.html4=w1(`apos~'~OElig~Œ~oelig~œ~Scaron~Š~scaron~š~Yuml~Ÿ~circ~ˆ~tilde~˜~ensp~ ~emsp~ ~thinsp~ ~zwnj~‌~zwj~‍~lrm~‎~rlm~‏~ndash~–~mdash~—~lsquo~‘~rsquo~’~sbquo~‚~ldquo~“~rdquo~”~bdquo~„~dagger~†~Dagger~‡~permil~‰~lsaquo~‹~rsaquo~›~euro~€~fnof~ƒ~Alpha~Α~Beta~Β~Gamma~Γ~Delta~Δ~Epsilon~Ε~Zeta~Ζ~Eta~Η~Theta~Θ~Iota~Ι~Kappa~Κ~Lambda~Λ~Mu~Μ~Nu~Ν~Xi~Ξ~Omicron~Ο~Pi~Π~Rho~Ρ~Sigma~Σ~Tau~Τ~Upsilon~Υ~Phi~Φ~Chi~Χ~Psi~Ψ~Omega~Ω~alpha~α~beta~β~gamma~γ~delta~δ~epsilon~ε~zeta~ζ~eta~η~theta~θ~iota~ι~kappa~κ~lambda~λ~mu~μ~nu~ν~xi~ξ~omicron~ο~pi~π~rho~ρ~sigmaf~ς~sigma~σ~tau~τ~upsilon~υ~phi~φ~chi~χ~psi~ψ~omega~ω~thetasym~ϑ~upsih~ϒ~piv~ϖ~bull~•~hellip~…~prime~′~Prime~″~oline~‾~frasl~⁄~weierp~℘~image~ℑ~real~ℜ~trade~™~alefsym~ℵ~larr~←~uarr~↑~rarr~→~darr~↓~harr~↔~crarr~↵~lArr~⇐~uArr~⇑~rArr~⇒~dArr~⇓~hArr~⇔~forall~∀~part~∂~exist~∃~empty~∅~nabla~∇~isin~∈~notin~∉~ni~∋~prod~∏~sum~∑~minus~−~lowast~∗~radic~√~prop~∝~infin~∞~ang~∠~and~∧~or~∨~cap~∩~cup~∪~int~∫~there4~∴~sim~∼~cong~≅~asymp~≈~ne~≠~equiv~≡~le~≤~ge~≥~sub~⊂~sup~⊃~nsub~⊄~sube~⊆~supe~⊇~oplus~⊕~otimes~⊗~perp~⊥~sdot~⋅~lceil~⌈~rceil~⌉~lfloor~⌊~rfloor~⌋~lang~〈~rang~〉~loz~◊~spades~♠~clubs~♣~hearts~♥~diams~♦~~nbsp~ ~iexcl~¡~cent~¢~pound~£~curren~¤~yen~¥~brvbar~¦~sect~§~uml~¨~copy~©~ordf~ª~laquo~«~not~¬~shy~­~reg~®~macr~¯~deg~°~plusmn~±~sup2~²~sup3~³~acute~´~micro~µ~para~¶~middot~·~cedil~¸~sup1~¹~ordm~º~raquo~»~frac14~¼~frac12~½~frac34~¾~iquest~¿~Agrave~À~Aacute~Á~Acirc~Â~Atilde~Ã~Auml~Ä~Aring~Å~AElig~Æ~Ccedil~Ç~Egrave~È~Eacute~É~Ecirc~Ê~Euml~Ë~Igrave~Ì~Iacute~Í~Icirc~Î~Iuml~Ï~ETH~Ð~Ntilde~Ñ~Ograve~Ò~Oacute~Ó~Ocirc~Ô~Otilde~Õ~Ouml~Ö~times~×~Oslash~Ø~Ugrave~Ù~Uacute~Ú~Ucirc~Û~Uuml~Ü~Yacute~Ý~THORN~Þ~szlig~ß~agrave~à~aacute~á~acirc~â~atilde~ã~auml~ä~aring~å~aelig~æ~ccedil~ç~egrave~è~eacute~é~ecirc~ê~euml~ë~igrave~ì~iacute~í~icirc~î~iuml~ï~eth~ð~ntilde~ñ~ograve~ò~oacute~ó~ocirc~ô~otilde~õ~ouml~ö~divide~÷~oslash~ø~ugrave~ù~uacute~ú~ucirc~û~uuml~ü~yacute~ý~thorn~þ~yuml~ÿ~quot~"~amp~&~lt~<~gt~>`);ic.html5=w1('Abreve~Ă~Acy~А~Afr~𝔄~Amacr~Ā~And~⩓~Aogon~Ą~Aopf~𝔸~ApplyFunction~⁡~Ascr~𝒜~Assign~≔~Backslash~∖~Barv~⫧~Barwed~⌆~Bcy~Б~Because~∵~Bernoullis~ℬ~Bfr~𝔅~Bopf~𝔹~Breve~˘~Bscr~ℬ~Bumpeq~≎~CHcy~Ч~Cacute~Ć~Cap~⋒~CapitalDifferentialD~ⅅ~Cayleys~ℭ~Ccaron~Č~Ccirc~Ĉ~Cconint~∰~Cdot~Ċ~Cedilla~¸~CenterDot~·~Cfr~ℭ~CircleDot~⊙~CircleMinus~⊖~CirclePlus~⊕~CircleTimes~⊗~ClockwiseContourIntegral~∲~CloseCurlyDoubleQuote~”~CloseCurlyQuote~’~Colon~∷~Colone~⩴~Congruent~≡~Conint~∯~ContourIntegral~∮~Copf~ℂ~Coproduct~∐~CounterClockwiseContourIntegral~∳~Cross~⨯~Cscr~𝒞~Cup~⋓~CupCap~≍~DD~ⅅ~DDotrahd~⤑~DJcy~Ђ~DScy~Ѕ~DZcy~Џ~Darr~↡~Dashv~⫤~Dcaron~Ď~Dcy~Д~Del~∇~Dfr~𝔇~DiacriticalAcute~´~DiacriticalDot~˙~DiacriticalDoubleAcute~˝~DiacriticalGrave~`~DiacriticalTilde~˜~Diamond~⋄~DifferentialD~ⅆ~Dopf~𝔻~Dot~¨~DotDot~⃜~DotEqual~≐~DoubleContourIntegral~∯~DoubleDot~¨~DoubleDownArrow~⇓~DoubleLeftArrow~⇐~DoubleLeftRightArrow~⇔~DoubleLeftTee~⫤~DoubleLongLeftArrow~⟸~DoubleLongLeftRightArrow~⟺~DoubleLongRightArrow~⟹~DoubleRightArrow~⇒~DoubleRightTee~⊨~DoubleUpArrow~⇑~DoubleUpDownArrow~⇕~DoubleVerticalBar~∥~DownArrow~↓~DownArrowBar~⤓~DownArrowUpArrow~⇵~DownBreve~̑~DownLeftRightVector~⥐~DownLeftTeeVector~⥞~DownLeftVector~↽~DownLeftVectorBar~⥖~DownRightTeeVector~⥟~DownRightVector~⇁~DownRightVectorBar~⥗~DownTee~⊤~DownTeeArrow~↧~Downarrow~⇓~Dscr~𝒟~Dstrok~Đ~ENG~Ŋ~Ecaron~Ě~Ecy~Э~Edot~Ė~Efr~𝔈~Element~∈~Emacr~Ē~EmptySmallSquare~◻~EmptyVerySmallSquare~▫~Eogon~Ę~Eopf~𝔼~Equal~⩵~EqualTilde~≂~Equilibrium~⇌~Escr~ℰ~Esim~⩳~Exists~∃~ExponentialE~ⅇ~Fcy~Ф~Ffr~𝔉~FilledSmallSquare~◼~FilledVerySmallSquare~▪~Fopf~𝔽~ForAll~∀~Fouriertrf~ℱ~Fscr~ℱ~GJcy~Ѓ~Gammad~Ϝ~Gbreve~Ğ~Gcedil~Ģ~Gcirc~Ĝ~Gcy~Г~Gdot~Ġ~Gfr~𝔊~Gg~⋙~Gopf~𝔾~GreaterEqual~≥~GreaterEqualLess~⋛~GreaterFullEqual~≧~GreaterGreater~⪢~GreaterLess~≷~GreaterSlantEqual~⩾~GreaterTilde~≳~Gscr~𝒢~Gt~≫~HARDcy~Ъ~Hacek~ˇ~Hat~^~Hcirc~Ĥ~Hfr~ℌ~HilbertSpace~ℋ~Hopf~ℍ~HorizontalLine~─~Hscr~ℋ~Hstrok~Ħ~HumpDownHump~≎~HumpEqual~≏~IEcy~Е~IJlig~IJ~IOcy~Ё~Icy~И~Idot~İ~Ifr~ℑ~Im~ℑ~Imacr~Ī~ImaginaryI~ⅈ~Implies~⇒~Int~∬~Integral~∫~Intersection~⋂~InvisibleComma~⁣~InvisibleTimes~⁢~Iogon~Į~Iopf~𝕀~Iscr~ℐ~Itilde~Ĩ~Iukcy~І~Jcirc~Ĵ~Jcy~Й~Jfr~𝔍~Jopf~𝕁~Jscr~𝒥~Jsercy~Ј~Jukcy~Є~KHcy~Х~KJcy~Ќ~Kcedil~Ķ~Kcy~К~Kfr~𝔎~Kopf~𝕂~Kscr~𝒦~LJcy~Љ~Lacute~Ĺ~Lang~⟪~Laplacetrf~ℒ~Larr~↞~Lcaron~Ľ~Lcedil~Ļ~Lcy~Л~LeftAngleBracket~⟨~LeftArrow~←~LeftArrowBar~⇤~LeftArrowRightArrow~⇆~LeftCeiling~⌈~LeftDoubleBracket~⟦~LeftDownTeeVector~⥡~LeftDownVector~⇃~LeftDownVectorBar~⥙~LeftFloor~⌊~LeftRightArrow~↔~LeftRightVector~⥎~LeftTee~⊣~LeftTeeArrow~↤~LeftTeeVector~⥚~LeftTriangle~⊲~LeftTriangleBar~⧏~LeftTriangleEqual~⊴~LeftUpDownVector~⥑~LeftUpTeeVector~⥠~LeftUpVector~↿~LeftUpVectorBar~⥘~LeftVector~↼~LeftVectorBar~⥒~Leftarrow~⇐~Leftrightarrow~⇔~LessEqualGreater~⋚~LessFullEqual~≦~LessGreater~≶~LessLess~⪡~LessSlantEqual~⩽~LessTilde~≲~Lfr~𝔏~Ll~⋘~Lleftarrow~⇚~Lmidot~Ŀ~LongLeftArrow~⟵~LongLeftRightArrow~⟷~LongRightArrow~⟶~Longleftarrow~⟸~Longleftrightarrow~⟺~Longrightarrow~⟹~Lopf~𝕃~LowerLeftArrow~↙~LowerRightArrow~↘~Lscr~ℒ~Lsh~↰~Lstrok~Ł~Lt~≪~Map~⤅~Mcy~М~MediumSpace~ ~Mellintrf~ℳ~Mfr~𝔐~MinusPlus~∓~Mopf~𝕄~Mscr~ℳ~NJcy~Њ~Nacute~Ń~Ncaron~Ň~Ncedil~Ņ~Ncy~Н~NegativeMediumSpace~​~NegativeThickSpace~​~NegativeThinSpace~​~NegativeVeryThinSpace~​~NestedGreaterGreater~≫~NestedLessLess~≪~NewLine~\n~Nfr~𝔑~NoBreak~⁠~NonBreakingSpace~ ~Nopf~ℕ~Not~⫬~NotCongruent~≢~NotCupCap~≭~NotDoubleVerticalBar~∦~NotElement~∉~NotEqual~≠~NotEqualTilde~≂̸~NotExists~∄~NotGreater~≯~NotGreaterEqual~≱~NotGreaterFullEqual~≧̸~NotGreaterGreater~≫̸~NotGreaterLess~≹~NotGreaterSlantEqual~⩾̸~NotGreaterTilde~≵~NotHumpDownHump~≎̸~NotHumpEqual~≏̸~NotLeftTriangle~⋪~NotLeftTriangleBar~⧏̸~NotLeftTriangleEqual~⋬~NotLess~≮~NotLessEqual~≰~NotLessGreater~≸~NotLessLess~≪̸~NotLessSlantEqual~⩽̸~NotLessTilde~≴~NotNestedGreaterGreater~⪢̸~NotNestedLessLess~⪡̸~NotPrecedes~⊀~NotPrecedesEqual~⪯̸~NotPrecedesSlantEqual~⋠~NotReverseElement~∌~NotRightTriangle~⋫~NotRightTriangleBar~⧐̸~NotRightTriangleEqual~⋭~NotSquareSubset~⊏̸~NotSquareSubsetEqual~⋢~NotSquareSuperset~⊐̸~NotSquareSupersetEqual~⋣~NotSubset~⊂⃒~NotSubsetEqual~⊈~NotSucceeds~⊁~NotSucceedsEqual~⪰̸~NotSucceedsSlantEqual~⋡~NotSucceedsTilde~≿̸~NotSuperset~⊃⃒~NotSupersetEqual~⊉~NotTilde~≁~NotTildeEqual~≄~NotTildeFullEqual~≇~NotTildeTilde~≉~NotVerticalBar~∤~Nscr~𝒩~Ocy~О~Odblac~Ő~Ofr~𝔒~Omacr~Ō~Oopf~𝕆~OpenCurlyDoubleQuote~“~OpenCurlyQuote~‘~Or~⩔~Oscr~𝒪~Otimes~⨷~OverBar~‾~OverBrace~⏞~OverBracket~⎴~OverParenthesis~⏜~PartialD~∂~Pcy~П~Pfr~𝔓~PlusMinus~±~Poincareplane~ℌ~Popf~ℙ~Pr~⪻~Precedes~≺~PrecedesEqual~⪯~PrecedesSlantEqual~≼~PrecedesTilde~≾~Product~∏~Proportion~∷~Proportional~∝~Pscr~𝒫~Qfr~𝔔~Qopf~ℚ~Qscr~𝒬~RBarr~⤐~Racute~Ŕ~Rang~⟫~Rarr~↠~Rarrtl~⤖~Rcaron~Ř~Rcedil~Ŗ~Rcy~Р~Re~ℜ~ReverseElement~∋~ReverseEquilibrium~⇋~ReverseUpEquilibrium~⥯~Rfr~ℜ~RightAngleBracket~⟩~RightArrow~→~RightArrowBar~⇥~RightArrowLeftArrow~⇄~RightCeiling~⌉~RightDoubleBracket~⟧~RightDownTeeVector~⥝~RightDownVector~⇂~RightDownVectorBar~⥕~RightFloor~⌋~RightTee~⊢~RightTeeArrow~↦~RightTeeVector~⥛~RightTriangle~⊳~RightTriangleBar~⧐~RightTriangleEqual~⊵~RightUpDownVector~⥏~RightUpTeeVector~⥜~RightUpVector~↾~RightUpVectorBar~⥔~RightVector~⇀~RightVectorBar~⥓~Rightarrow~⇒~Ropf~ℝ~RoundImplies~⥰~Rrightarrow~⇛~Rscr~ℛ~Rsh~↱~RuleDelayed~⧴~SHCHcy~Щ~SHcy~Ш~SOFTcy~Ь~Sacute~Ś~Sc~⪼~Scedil~Ş~Scirc~Ŝ~Scy~С~Sfr~𝔖~ShortDownArrow~↓~ShortLeftArrow~←~ShortRightArrow~→~ShortUpArrow~↑~SmallCircle~∘~Sopf~𝕊~Sqrt~√~Square~□~SquareIntersection~⊓~SquareSubset~⊏~SquareSubsetEqual~⊑~SquareSuperset~⊐~SquareSupersetEqual~⊒~SquareUnion~⊔~Sscr~𝒮~Star~⋆~Sub~⋐~Subset~⋐~SubsetEqual~⊆~Succeeds~≻~SucceedsEqual~⪰~SucceedsSlantEqual~≽~SucceedsTilde~≿~SuchThat~∋~Sum~∑~Sup~⋑~Superset~⊃~SupersetEqual~⊇~Supset~⋑~TRADE~™~TSHcy~Ћ~TScy~Ц~Tab~ ~Tcaron~Ť~Tcedil~Ţ~Tcy~Т~Tfr~𝔗~Therefore~∴~ThickSpace~  ~ThinSpace~ ~Tilde~∼~TildeEqual~≃~TildeFullEqual~≅~TildeTilde~≈~Topf~𝕋~TripleDot~⃛~Tscr~𝒯~Tstrok~Ŧ~Uarr~↟~Uarrocir~⥉~Ubrcy~Ў~Ubreve~Ŭ~Ucy~У~Udblac~Ű~Ufr~𝔘~Umacr~Ū~UnderBar~_~UnderBrace~⏟~UnderBracket~⎵~UnderParenthesis~⏝~Union~⋃~UnionPlus~⊎~Uogon~Ų~Uopf~𝕌~UpArrow~↑~UpArrowBar~⤒~UpArrowDownArrow~⇅~UpDownArrow~↕~UpEquilibrium~⥮~UpTee~⊥~UpTeeArrow~↥~Uparrow~⇑~Updownarrow~⇕~UpperLeftArrow~↖~UpperRightArrow~↗~Upsi~ϒ~Uring~Ů~Uscr~𝒰~Utilde~Ũ~VDash~⊫~Vbar~⫫~Vcy~В~Vdash~⊩~Vdashl~⫦~Vee~⋁~Verbar~‖~Vert~‖~VerticalBar~∣~VerticalLine~|~VerticalSeparator~❘~VerticalTilde~≀~VeryThinSpace~ ~Vfr~𝔙~Vopf~𝕍~Vscr~𝒱~Vvdash~⊪~Wcirc~Ŵ~Wedge~⋀~Wfr~𝔚~Wopf~𝕎~Wscr~𝒲~Xfr~𝔛~Xopf~𝕏~Xscr~𝒳~YAcy~Я~YIcy~Ї~YUcy~Ю~Ycirc~Ŷ~Ycy~Ы~Yfr~𝔜~Yopf~𝕐~Yscr~𝒴~ZHcy~Ж~Zacute~Ź~Zcaron~Ž~Zcy~З~Zdot~Ż~ZeroWidthSpace~​~Zfr~ℨ~Zopf~ℤ~Zscr~𝒵~abreve~ă~ac~∾~acE~∾̳~acd~∿~acy~а~af~⁡~afr~𝔞~aleph~ℵ~amacr~ā~amalg~⨿~andand~⩕~andd~⩜~andslope~⩘~andv~⩚~ange~⦤~angle~∠~angmsd~∡~angmsdaa~⦨~angmsdab~⦩~angmsdac~⦪~angmsdad~⦫~angmsdae~⦬~angmsdaf~⦭~angmsdag~⦮~angmsdah~⦯~angrt~∟~angrtvb~⊾~angrtvbd~⦝~angsph~∢~angst~Å~angzarr~⍼~aogon~ą~aopf~𝕒~ap~≈~apE~⩰~apacir~⩯~ape~≊~apid~≋~approx~≈~approxeq~≊~ascr~𝒶~ast~*~asympeq~≍~awconint~∳~awint~⨑~bNot~⫭~backcong~≌~backepsilon~϶~backprime~‵~backsim~∽~backsimeq~⋍~barvee~⊽~barwed~⌅~barwedge~⌅~bbrk~⎵~bbrktbrk~⎶~bcong~≌~bcy~б~becaus~∵~because~∵~bemptyv~⦰~bepsi~϶~bernou~ℬ~beth~ℶ~between~≬~bfr~𝔟~bigcap~⋂~bigcirc~◯~bigcup~⋃~bigodot~⨀~bigoplus~⨁~bigotimes~⨂~bigsqcup~⨆~bigstar~★~bigtriangledown~▽~bigtriangleup~△~biguplus~⨄~bigvee~⋁~bigwedge~⋀~bkarow~⤍~blacklozenge~⧫~blacksquare~▪~blacktriangle~▴~blacktriangledown~▾~blacktriangleleft~◂~blacktriangleright~▸~blank~␣~blk12~▒~blk14~░~blk34~▓~block~█~bne~=⃥~bnequiv~≡⃥~bnot~⌐~bopf~𝕓~bot~⊥~bottom~⊥~bowtie~⋈~boxDL~╗~boxDR~╔~boxDl~╖~boxDr~╓~boxH~═~boxHD~╦~boxHU~╩~boxHd~╤~boxHu~╧~boxUL~╝~boxUR~╚~boxUl~╜~boxUr~╙~boxV~║~boxVH~╬~boxVL~╣~boxVR~╠~boxVh~╫~boxVl~╢~boxVr~╟~boxbox~⧉~boxdL~╕~boxdR~╒~boxdl~┐~boxdr~┌~boxh~─~boxhD~╥~boxhU~╨~boxhd~┬~boxhu~┴~boxminus~⊟~boxplus~⊞~boxtimes~⊠~boxuL~╛~boxuR~╘~boxul~┘~boxur~└~boxv~│~boxvH~╪~boxvL~╡~boxvR~╞~boxvh~┼~boxvl~┤~boxvr~├~bprime~‵~breve~˘~bscr~𝒷~bsemi~⁏~bsim~∽~bsime~⋍~bsol~\\~bsolb~⧅~bsolhsub~⟈~bullet~•~bump~≎~bumpE~⪮~bumpe~≏~bumpeq~≏~cacute~ć~capand~⩄~capbrcup~⩉~capcap~⩋~capcup~⩇~capdot~⩀~caps~∩︀~caret~⁁~caron~ˇ~ccaps~⩍~ccaron~č~ccirc~ĉ~ccups~⩌~ccupssm~⩐~cdot~ċ~cemptyv~⦲~centerdot~·~cfr~𝔠~chcy~ч~check~✓~checkmark~✓~cir~○~cirE~⧃~circeq~≗~circlearrowleft~↺~circlearrowright~↻~circledR~®~circledS~Ⓢ~circledast~⊛~circledcirc~⊚~circleddash~⊝~cire~≗~cirfnint~⨐~cirmid~⫯~cirscir~⧂~clubsuit~♣~colon~:~colone~≔~coloneq~≔~comma~,~commat~@~comp~∁~compfn~∘~complement~∁~complexes~ℂ~congdot~⩭~conint~∮~copf~𝕔~coprod~∐~copysr~℗~cross~✗~cscr~𝒸~csub~⫏~csube~⫑~csup~⫐~csupe~⫒~ctdot~⋯~cudarrl~⤸~cudarrr~⤵~cuepr~⋞~cuesc~⋟~cularr~↶~cularrp~⤽~cupbrcap~⩈~cupcap~⩆~cupcup~⩊~cupdot~⊍~cupor~⩅~cups~∪︀~curarr~↷~curarrm~⤼~curlyeqprec~⋞~curlyeqsucc~⋟~curlyvee~⋎~curlywedge~⋏~curvearrowleft~↶~curvearrowright~↷~cuvee~⋎~cuwed~⋏~cwconint~∲~cwint~∱~cylcty~⌭~dHar~⥥~daleth~ℸ~dash~‐~dashv~⊣~dbkarow~⤏~dblac~˝~dcaron~ď~dcy~д~dd~ⅆ~ddagger~‡~ddarr~⇊~ddotseq~⩷~demptyv~⦱~dfisht~⥿~dfr~𝔡~dharl~⇃~dharr~⇂~diam~⋄~diamond~⋄~diamondsuit~♦~die~¨~digamma~ϝ~disin~⋲~div~÷~divideontimes~⋇~divonx~⋇~djcy~ђ~dlcorn~⌞~dlcrop~⌍~dollar~$~dopf~𝕕~dot~˙~doteq~≐~doteqdot~≑~dotminus~∸~dotplus~∔~dotsquare~⊡~doublebarwedge~⌆~downarrow~↓~downdownarrows~⇊~downharpoonleft~⇃~downharpoonright~⇂~drbkarow~⤐~drcorn~⌟~drcrop~⌌~dscr~𝒹~dscy~ѕ~dsol~⧶~dstrok~đ~dtdot~⋱~dtri~▿~dtrif~▾~duarr~⇵~duhar~⥯~dwangle~⦦~dzcy~џ~dzigrarr~⟿~eDDot~⩷~eDot~≑~easter~⩮~ecaron~ě~ecir~≖~ecolon~≕~ecy~э~edot~ė~ee~ⅇ~efDot~≒~efr~𝔢~eg~⪚~egs~⪖~egsdot~⪘~el~⪙~elinters~⏧~ell~ℓ~els~⪕~elsdot~⪗~emacr~ē~emptyset~∅~emptyv~∅~emsp13~ ~emsp14~ ~eng~ŋ~eogon~ę~eopf~𝕖~epar~⋕~eparsl~⧣~eplus~⩱~epsi~ε~epsiv~ϵ~eqcirc~≖~eqcolon~≕~eqsim~≂~eqslantgtr~⪖~eqslantless~⪕~equals~=~equest~≟~equivDD~⩸~eqvparsl~⧥~erDot~≓~erarr~⥱~escr~ℯ~esdot~≐~esim~≂~excl~!~expectation~ℰ~exponentiale~ⅇ~fallingdotseq~≒~fcy~ф~female~♀~ffilig~ffi~fflig~ff~ffllig~ffl~ffr~𝔣~filig~fi~fjlig~fj~flat~♭~fllig~fl~fltns~▱~fopf~𝕗~fork~⋔~forkv~⫙~fpartint~⨍~frac13~⅓~frac15~⅕~frac16~⅙~frac18~⅛~frac23~⅔~frac25~⅖~frac35~⅗~frac38~⅜~frac45~⅘~frac56~⅚~frac58~⅝~frac78~⅞~frown~⌢~fscr~𝒻~gE~≧~gEl~⪌~gacute~ǵ~gammad~ϝ~gap~⪆~gbreve~ğ~gcirc~ĝ~gcy~г~gdot~ġ~gel~⋛~geq~≥~geqq~≧~geqslant~⩾~ges~⩾~gescc~⪩~gesdot~⪀~gesdoto~⪂~gesdotol~⪄~gesl~⋛︀~gesles~⪔~gfr~𝔤~gg~≫~ggg~⋙~gimel~ℷ~gjcy~ѓ~gl~≷~glE~⪒~gla~⪥~glj~⪤~gnE~≩~gnap~⪊~gnapprox~⪊~gne~⪈~gneq~⪈~gneqq~≩~gnsim~⋧~gopf~𝕘~grave~`~gscr~ℊ~gsim~≳~gsime~⪎~gsiml~⪐~gtcc~⪧~gtcir~⩺~gtdot~⋗~gtlPar~⦕~gtquest~⩼~gtrapprox~⪆~gtrarr~⥸~gtrdot~⋗~gtreqless~⋛~gtreqqless~⪌~gtrless~≷~gtrsim~≳~gvertneqq~≩︀~gvnE~≩︀~hairsp~ ~half~½~hamilt~ℋ~hardcy~ъ~harrcir~⥈~harrw~↭~hbar~ℏ~hcirc~ĥ~heartsuit~♥~hercon~⊹~hfr~𝔥~hksearow~⤥~hkswarow~⤦~hoarr~⇿~homtht~∻~hookleftarrow~↩~hookrightarrow~↪~hopf~𝕙~horbar~―~hscr~𝒽~hslash~ℏ~hstrok~ħ~hybull~⁃~hyphen~‐~ic~⁣~icy~и~iecy~е~iff~⇔~ifr~𝔦~ii~ⅈ~iiiint~⨌~iiint~∭~iinfin~⧜~iiota~℩~ijlig~ij~imacr~ī~imagline~ℐ~imagpart~ℑ~imath~ı~imof~⊷~imped~Ƶ~in~∈~incare~℅~infintie~⧝~inodot~ı~intcal~⊺~integers~ℤ~intercal~⊺~intlarhk~⨗~intprod~⨼~iocy~ё~iogon~į~iopf~𝕚~iprod~⨼~iscr~𝒾~isinE~⋹~isindot~⋵~isins~⋴~isinsv~⋳~isinv~∈~it~⁢~itilde~ĩ~iukcy~і~jcirc~ĵ~jcy~й~jfr~𝔧~jmath~ȷ~jopf~𝕛~jscr~𝒿~jsercy~ј~jukcy~є~kappav~ϰ~kcedil~ķ~kcy~к~kfr~𝔨~kgreen~ĸ~khcy~х~kjcy~ќ~kopf~𝕜~kscr~𝓀~lAarr~⇚~lAtail~⤛~lBarr~⤎~lE~≦~lEg~⪋~lHar~⥢~lacute~ĺ~laemptyv~⦴~lagran~ℒ~langd~⦑~langle~⟨~lap~⪅~larrb~⇤~larrbfs~⤟~larrfs~⤝~larrhk~↩~larrlp~↫~larrpl~⤹~larrsim~⥳~larrtl~↢~lat~⪫~latail~⤙~late~⪭~lates~⪭︀~lbarr~⤌~lbbrk~❲~lbrace~{~lbrack~[~lbrke~⦋~lbrksld~⦏~lbrkslu~⦍~lcaron~ľ~lcedil~ļ~lcub~{~lcy~л~ldca~⤶~ldquor~„~ldrdhar~⥧~ldrushar~⥋~ldsh~↲~leftarrow~←~leftarrowtail~↢~leftharpoondown~↽~leftharpoonup~↼~leftleftarrows~⇇~leftrightarrow~↔~leftrightarrows~⇆~leftrightharpoons~⇋~leftrightsquigarrow~↭~leftthreetimes~⋋~leg~⋚~leq~≤~leqq~≦~leqslant~⩽~les~⩽~lescc~⪨~lesdot~⩿~lesdoto~⪁~lesdotor~⪃~lesg~⋚︀~lesges~⪓~lessapprox~⪅~lessdot~⋖~lesseqgtr~⋚~lesseqqgtr~⪋~lessgtr~≶~lesssim~≲~lfisht~⥼~lfr~𝔩~lg~≶~lgE~⪑~lhard~↽~lharu~↼~lharul~⥪~lhblk~▄~ljcy~љ~ll~≪~llarr~⇇~llcorner~⌞~llhard~⥫~lltri~◺~lmidot~ŀ~lmoust~⎰~lmoustache~⎰~lnE~≨~lnap~⪉~lnapprox~⪉~lne~⪇~lneq~⪇~lneqq~≨~lnsim~⋦~loang~⟬~loarr~⇽~lobrk~⟦~longleftarrow~⟵~longleftrightarrow~⟷~longmapsto~⟼~longrightarrow~⟶~looparrowleft~↫~looparrowright~↬~lopar~⦅~lopf~𝕝~loplus~⨭~lotimes~⨴~lowbar~_~lozenge~◊~lozf~⧫~lpar~(~lparlt~⦓~lrarr~⇆~lrcorner~⌟~lrhar~⇋~lrhard~⥭~lrtri~⊿~lscr~𝓁~lsh~↰~lsim~≲~lsime~⪍~lsimg~⪏~lsqb~[~lsquor~‚~lstrok~ł~ltcc~⪦~ltcir~⩹~ltdot~⋖~lthree~⋋~ltimes~⋉~ltlarr~⥶~ltquest~⩻~ltrPar~⦖~ltri~◃~ltrie~⊴~ltrif~◂~lurdshar~⥊~luruhar~⥦~lvertneqq~≨︀~lvnE~≨︀~mDDot~∺~male~♂~malt~✠~maltese~✠~map~↦~mapsto~↦~mapstodown~↧~mapstoleft~↤~mapstoup~↥~marker~▮~mcomma~⨩~mcy~м~measuredangle~∡~mfr~𝔪~mho~℧~mid~∣~midast~*~midcir~⫰~minusb~⊟~minusd~∸~minusdu~⨪~mlcp~⫛~mldr~…~mnplus~∓~models~⊧~mopf~𝕞~mp~∓~mscr~𝓂~mstpos~∾~multimap~⊸~mumap~⊸~nGg~⋙̸~nGt~≫⃒~nGtv~≫̸~nLeftarrow~⇍~nLeftrightarrow~⇎~nLl~⋘̸~nLt~≪⃒~nLtv~≪̸~nRightarrow~⇏~nVDash~⊯~nVdash~⊮~nacute~ń~nang~∠⃒~nap~≉~napE~⩰̸~napid~≋̸~napos~ʼn~napprox~≉~natur~♮~natural~♮~naturals~ℕ~nbump~≎̸~nbumpe~≏̸~ncap~⩃~ncaron~ň~ncedil~ņ~ncong~≇~ncongdot~⩭̸~ncup~⩂~ncy~н~neArr~⇗~nearhk~⤤~nearr~↗~nearrow~↗~nedot~≐̸~nequiv~≢~nesear~⤨~nesim~≂̸~nexist~∄~nexists~∄~nfr~𝔫~ngE~≧̸~nge~≱~ngeq~≱~ngeqq~≧̸~ngeqslant~⩾̸~nges~⩾̸~ngsim~≵~ngt~≯~ngtr~≯~nhArr~⇎~nharr~↮~nhpar~⫲~nis~⋼~nisd~⋺~niv~∋~njcy~њ~nlArr~⇍~nlE~≦̸~nlarr~↚~nldr~‥~nle~≰~nleftarrow~↚~nleftrightarrow~↮~nleq~≰~nleqq~≦̸~nleqslant~⩽̸~nles~⩽̸~nless~≮~nlsim~≴~nlt~≮~nltri~⋪~nltrie~⋬~nmid~∤~nopf~𝕟~notinE~⋹̸~notindot~⋵̸~notinva~∉~notinvb~⋷~notinvc~⋶~notni~∌~notniva~∌~notnivb~⋾~notnivc~⋽~npar~∦~nparallel~∦~nparsl~⫽⃥~npart~∂̸~npolint~⨔~npr~⊀~nprcue~⋠~npre~⪯̸~nprec~⊀~npreceq~⪯̸~nrArr~⇏~nrarr~↛~nrarrc~⤳̸~nrarrw~↝̸~nrightarrow~↛~nrtri~⋫~nrtrie~⋭~nsc~⊁~nsccue~⋡~nsce~⪰̸~nscr~𝓃~nshortmid~∤~nshortparallel~∦~nsim~≁~nsime~≄~nsimeq~≄~nsmid~∤~nspar~∦~nsqsube~⋢~nsqsupe~⋣~nsubE~⫅̸~nsube~⊈~nsubset~⊂⃒~nsubseteq~⊈~nsubseteqq~⫅̸~nsucc~⊁~nsucceq~⪰̸~nsup~⊅~nsupE~⫆̸~nsupe~⊉~nsupset~⊃⃒~nsupseteq~⊉~nsupseteqq~⫆̸~ntgl~≹~ntlg~≸~ntriangleleft~⋪~ntrianglelefteq~⋬~ntriangleright~⋫~ntrianglerighteq~⋭~num~#~numero~№~numsp~ ~nvDash~⊭~nvHarr~⤄~nvap~≍⃒~nvdash~⊬~nvge~≥⃒~nvgt~>⃒~nvinfin~⧞~nvlArr~⤂~nvle~≤⃒~nvlt~<⃒~nvltrie~⊴⃒~nvrArr~⤃~nvrtrie~⊵⃒~nvsim~∼⃒~nwArr~⇖~nwarhk~⤣~nwarr~↖~nwarrow~↖~nwnear~⤧~oS~Ⓢ~oast~⊛~ocir~⊚~ocy~о~odash~⊝~odblac~ő~odiv~⨸~odot~⊙~odsold~⦼~ofcir~⦿~ofr~𝔬~ogon~˛~ogt~⧁~ohbar~⦵~ohm~Ω~oint~∮~olarr~↺~olcir~⦾~olcross~⦻~olt~⧀~omacr~ō~omid~⦶~ominus~⊖~oopf~𝕠~opar~⦷~operp~⦹~orarr~↻~ord~⩝~order~ℴ~orderof~ℴ~origof~⊶~oror~⩖~orslope~⩗~orv~⩛~oscr~ℴ~osol~⊘~otimesas~⨶~ovbar~⌽~par~∥~parallel~∥~parsim~⫳~parsl~⫽~pcy~п~percnt~%~period~.~pertenk~‱~pfr~𝔭~phiv~ϕ~phmmat~ℳ~phone~☎~pitchfork~⋔~planck~ℏ~planckh~ℎ~plankv~ℏ~plus~+~plusacir~⨣~plusb~⊞~pluscir~⨢~plusdo~∔~plusdu~⨥~pluse~⩲~plussim~⨦~plustwo~⨧~pm~±~pointint~⨕~popf~𝕡~pr~≺~prE~⪳~prap~⪷~prcue~≼~pre~⪯~prec~≺~precapprox~⪷~preccurlyeq~≼~preceq~⪯~precnapprox~⪹~precneqq~⪵~precnsim~⋨~precsim~≾~primes~ℙ~prnE~⪵~prnap~⪹~prnsim~⋨~profalar~⌮~profline~⌒~profsurf~⌓~propto~∝~prsim~≾~prurel~⊰~pscr~𝓅~puncsp~ ~qfr~𝔮~qint~⨌~qopf~𝕢~qprime~⁗~qscr~𝓆~quaternions~ℍ~quatint~⨖~quest~?~questeq~≟~rAarr~⇛~rAtail~⤜~rBarr~⤏~rHar~⥤~race~∽̱~racute~ŕ~raemptyv~⦳~rangd~⦒~range~⦥~rangle~⟩~rarrap~⥵~rarrb~⇥~rarrbfs~⤠~rarrc~⤳~rarrfs~⤞~rarrhk~↪~rarrlp~↬~rarrpl~⥅~rarrsim~⥴~rarrtl~↣~rarrw~↝~ratail~⤚~ratio~∶~rationals~ℚ~rbarr~⤍~rbbrk~❳~rbrace~}~rbrack~]~rbrke~⦌~rbrksld~⦎~rbrkslu~⦐~rcaron~ř~rcedil~ŗ~rcub~}~rcy~р~rdca~⤷~rdldhar~⥩~rdquor~”~rdsh~↳~realine~ℛ~realpart~ℜ~reals~ℝ~rect~▭~rfisht~⥽~rfr~𝔯~rhard~⇁~rharu~⇀~rharul~⥬~rhov~ϱ~rightarrow~→~rightarrowtail~↣~rightharpoondown~⇁~rightharpoonup~⇀~rightleftarrows~⇄~rightleftharpoons~⇌~rightrightarrows~⇉~rightsquigarrow~↝~rightthreetimes~⋌~ring~˚~risingdotseq~≓~rlarr~⇄~rlhar~⇌~rmoust~⎱~rmoustache~⎱~rnmid~⫮~roang~⟭~roarr~⇾~robrk~⟧~ropar~⦆~ropf~𝕣~roplus~⨮~rotimes~⨵~rpar~)~rpargt~⦔~rppolint~⨒~rrarr~⇉~rscr~𝓇~rsh~↱~rsqb~]~rsquor~’~rthree~⋌~rtimes~⋊~rtri~▹~rtrie~⊵~rtrif~▸~rtriltri~⧎~ruluhar~⥨~rx~℞~sacute~ś~sc~≻~scE~⪴~scap~⪸~sccue~≽~sce~⪰~scedil~ş~scirc~ŝ~scnE~⪶~scnap~⪺~scnsim~⋩~scpolint~⨓~scsim~≿~scy~с~sdotb~⊡~sdote~⩦~seArr~⇘~searhk~⤥~searr~↘~searrow~↘~semi~;~seswar~⤩~setminus~∖~setmn~∖~sext~✶~sfr~𝔰~sfrown~⌢~sharp~♯~shchcy~щ~shcy~ш~shortmid~∣~shortparallel~∥~sigmav~ς~simdot~⩪~sime~≃~simeq~≃~simg~⪞~simgE~⪠~siml~⪝~simlE~⪟~simne~≆~simplus~⨤~simrarr~⥲~slarr~←~smallsetminus~∖~smashp~⨳~smeparsl~⧤~smid~∣~smile~⌣~smt~⪪~smte~⪬~smtes~⪬︀~softcy~ь~sol~/~solb~⧄~solbar~⌿~sopf~𝕤~spadesuit~♠~spar~∥~sqcap~⊓~sqcaps~⊓︀~sqcup~⊔~sqcups~⊔︀~sqsub~⊏~sqsube~⊑~sqsubset~⊏~sqsubseteq~⊑~sqsup~⊐~sqsupe~⊒~sqsupset~⊐~sqsupseteq~⊒~squ~□~square~□~squarf~▪~squf~▪~srarr~→~sscr~𝓈~ssetmn~∖~ssmile~⌣~sstarf~⋆~star~☆~starf~★~straightepsilon~ϵ~straightphi~ϕ~strns~¯~subE~⫅~subdot~⪽~subedot~⫃~submult~⫁~subnE~⫋~subne~⊊~subplus~⪿~subrarr~⥹~subset~⊂~subseteq~⊆~subseteqq~⫅~subsetneq~⊊~subsetneqq~⫋~subsim~⫇~subsub~⫕~subsup~⫓~succ~≻~succapprox~⪸~succcurlyeq~≽~succeq~⪰~succnapprox~⪺~succneqq~⪶~succnsim~⋩~succsim~≿~sung~♪~supE~⫆~supdot~⪾~supdsub~⫘~supedot~⫄~suphsol~⟉~suphsub~⫗~suplarr~⥻~supmult~⫂~supnE~⫌~supne~⊋~supplus~⫀~supset~⊃~supseteq~⊇~supseteqq~⫆~supsetneq~⊋~supsetneqq~⫌~supsim~⫈~supsub~⫔~supsup~⫖~swArr~⇙~swarhk~⤦~swarr~↙~swarrow~↙~swnwar~⤪~target~⌖~tbrk~⎴~tcaron~ť~tcedil~ţ~tcy~т~tdot~⃛~telrec~⌕~tfr~𝔱~therefore~∴~thetav~ϑ~thickapprox~≈~thicksim~∼~thkap~≈~thksim~∼~timesb~⊠~timesbar~⨱~timesd~⨰~tint~∭~toea~⤨~top~⊤~topbot~⌶~topcir~⫱~topf~𝕥~topfork~⫚~tosa~⤩~tprime~‴~triangle~▵~triangledown~▿~triangleleft~◃~trianglelefteq~⊴~triangleq~≜~triangleright~▹~trianglerighteq~⊵~tridot~◬~trie~≜~triminus~⨺~triplus~⨹~trisb~⧍~tritime~⨻~trpezium~⏢~tscr~𝓉~tscy~ц~tshcy~ћ~tstrok~ŧ~twixt~≬~twoheadleftarrow~↞~twoheadrightarrow~↠~uHar~⥣~ubrcy~ў~ubreve~ŭ~ucy~у~udarr~⇅~udblac~ű~udhar~⥮~ufisht~⥾~ufr~𝔲~uharl~↿~uharr~↾~uhblk~▀~ulcorn~⌜~ulcorner~⌜~ulcrop~⌏~ultri~◸~umacr~ū~uogon~ų~uopf~𝕦~uparrow~↑~updownarrow~↕~upharpoonleft~↿~upharpoonright~↾~uplus~⊎~upsi~υ~upuparrows~⇈~urcorn~⌝~urcorner~⌝~urcrop~⌎~uring~ů~urtri~◹~uscr~𝓊~utdot~⋰~utilde~ũ~utri~▵~utrif~▴~uuarr~⇈~uwangle~⦧~vArr~⇕~vBar~⫨~vBarv~⫩~vDash~⊨~vangrt~⦜~varepsilon~ϵ~varkappa~ϰ~varnothing~∅~varphi~ϕ~varpi~ϖ~varpropto~∝~varr~↕~varrho~ϱ~varsigma~ς~varsubsetneq~⊊︀~varsubsetneqq~⫋︀~varsupsetneq~⊋︀~varsupsetneqq~⫌︀~vartheta~ϑ~vartriangleleft~⊲~vartriangleright~⊳~vcy~в~vdash~⊢~vee~∨~veebar~⊻~veeeq~≚~vellip~⋮~verbar~|~vert~|~vfr~𝔳~vltri~⊲~vnsub~⊂⃒~vnsup~⊃⃒~vopf~𝕧~vprop~∝~vrtri~⊳~vscr~𝓋~vsubnE~⫋︀~vsubne~⊊︀~vsupnE~⫌︀~vsupne~⊋︀~vzigzag~⦚~wcirc~ŵ~wedbar~⩟~wedge~∧~wedgeq~≙~wfr~𝔴~wopf~𝕨~wp~℘~wr~≀~wreath~≀~wscr~𝓌~xcap~⋂~xcirc~◯~xcup~⋃~xdtri~▽~xfr~𝔵~xhArr~⟺~xharr~⟷~xlArr~⟸~xlarr~⟵~xmap~⟼~xnis~⋻~xodot~⨀~xopf~𝕩~xoplus~⨁~xotime~⨂~xrArr~⟹~xrarr~⟶~xscr~𝓍~xsqcup~⨆~xuplus~⨄~xutri~△~xvee~⋁~xwedge~⋀~yacy~я~ycirc~ŷ~ycy~ы~yfr~𝔶~yicy~ї~yopf~𝕪~yscr~𝓎~yucy~ю~zacute~ź~zcaron~ž~zcy~з~zdot~ż~zeetrf~ℨ~zfr~𝔷~zhcy~ж~zigrarr~⇝~zopf~𝕫~zscr~𝓏~~AMP~&~COPY~©~GT~>~LT~<~QUOT~"~REG~®',ic.html4);var y7={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},A7=String.fromCodePoint||function(r){return String.fromCharCode(Math.floor((r-65536)/1024)+55296,(r-65536)%1024+56320)},ac=function(){return ac=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},ac.apply(this,arguments)},w7=ac(ac({},ic),{all:ic.html5}),b7={scope:"body",level:"all"},L0=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g,U0=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g,zx={xml:{strict:L0,attribute:U0,body:N0.xml},html4:{strict:L0,attribute:U0,body:N0.html4},html5:{strict:L0,attribute:U0,body:N0.html5}},C7=ac(ac({},zx),{all:zx.html5}),RF=String.fromCharCode,x7=RF(65533);function S7(r,e,t,n){var i=r,a=r[r.length-1];if(t&&a==="=")i=r;else if(n&&a!==";")i=r;else{var s=e[r];if(s)i=s;else if(r[0]==="&"&&r[1]==="#"){var o=r[2],l=o=="x"||o=="X"?parseInt(r.substr(3),16):parseInt(r.substr(2));i=l>=1114111?x7:l>65535?A7(l):RF(y7[l]||l)}}return i}function E7(r,e){var t=b7,n=t.level,i=n===void 0?"all":n,a=t.scope,s=a===void 0?i==="xml"?"strict":"body":a;if(!r)return"";var o=C7[i][s],l=w7[i].entities,u=s==="attribute",c=s==="strict";return r.replace(o,function(f){return S7(f,l,u,c)})}const OF=new Map;class k7{constructor(e){this.font=e,this.glyphsFromText=new Map,this.kerningValues=new Map,this.height=this.calculateApproximateHeight()}getFont(){return this.font}getGlyphs(e){const t=this.glyphsFromText.get(e);if(t)return t;const n=this.font.stringToGlyphs(e);return this.glyphsFromText.set(e,n),n}getApproximateHeight(){return this.height}getExactHeight(e){const t=this.font.stringToGlyphs(e);let n=0,i=0;return t.forEach(a=>{const s=a.getMetrics();n=Math.max(n,s.yMax),i=Math.min(i,s.yMin)}),n-i}getKerningValue(e,t){if(!e.name||!t.name)return;let n=this.kerningValues.get(e.name);n||(n=new Map,this.kerningValues.set(e.name,n));let i=n.get(t.name);return i||(i=this.font.getKerningValue(e,t),n.set(t.name,i)),i}calculateApproximateHeight(){const t=this.font.stringToGlyphs("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");let n=0,i=0;return t.forEach(a=>{const s=a.getMetrics();n=Math.max(n,s.yMax),i=Math.min(i,s.yMin)}),n-i}}const T7=r=>r.substring(0,5).toLowerCase().trim()==="data:",V0=new Map,Rl=async r=>{if(V0.has(r))return V0.get(r);const t=(async()=>{try{return Io(r).getFont()}catch{if(T7(r)){const n=Yk(r),i=nA(n);return iA(r,i),i}else{const n=await Ng(r,!0),i=nA(n);return iA(r,i),await z4(i,r),i}}})();return V0.set(r,t),t},F7=r=>{const e=Yk(r),t=nA(e);return iA(r,t),t},Io=r=>{const e=OF.get(r);if(e)return e;throw new Error("Font metrics unavailable for font")},iA=(r,e)=>{const t=new k7(e);return OF.set(r,t),t},I7=async r=>{const e=us(),t=e.parseFromString(r,"image/svg+xml"),n=t.firstElementChild,i=new Map;n.querySelectorAll("style").forEach(c=>{tT.parse(c.innerHTML).stylesheet?.rules.forEach(d=>{if(d.type==="font-face"&&d.declarations){const h=d.declarations.find(y=>y.property==="font-family")?.value,v=d.declarations.find(y=>y.property==="src")?.value?.match(/'(https.*?)'/)?.[1];h&&v&&i.set(h,v)}})});const s=t.querySelectorAll("tspan");for(let c=0;c<s.length;c++){const f=s.item(c),d=f.closest("text"),h=f.closest("g"),g=d.getAttribute("font-family"),v=await Rl(i.get(g)),y=E7(f.innerHTML),A=d.getAttribute("fill"),C=d.getAttribute("stroke"),S=d.getAttribute("stroke-width"),F=v.getPath(y,0,0,parseInt(d.getAttribute("font-size")??"72")),E=F.getBoundingBox().x2-F.getBoundingBox().x1;let R=0;const B=f.getAttribute("text-anchor");B==="middle"?R=E/2:B==="end"&&(R=E);const G=v.getPath(y,parseFloat(f.getAttribute("x")??"0")-R,parseFloat(f.getAttribute("y")??"0"),parseInt(d.getAttribute("font-size")??"72"));G.fill=A,G.stroke=C,G.strokeWidth=parseFloat(S??"0");const j=G.toSVG(2),q=e.parseFromString(j,"image/svg+xml").firstElementChild;h.appendChild(q)}return t.querySelectorAll("text").forEach(c=>c.remove()),Do().serializeToString(n)},fg=(r,e,t,n)=>Math.max(O7(r.join(`
1783
1783
  `),t,n),e),$x=(r,e,t,n,i,a)=>{const s=(a||_F)*i.getApproximateHeight(),o=e.split(`
1784
1784
  `);try{const l=o.flatMap(c=>qp(c,r.width,n,i)),u=l.flatMap(c=>c.lines);return{lines:u,requiredHeight:l.flatMap(c=>c.lines).length*(n*s),fontSize:t,requiredWidth:fg(u,r.width,n,i)}}catch{const u=e.split("");return{lines:u,requiredHeight:u.length*(n*s),fontSize:t,requiredWidth:fg(u,r.width,n,i)}}},qp=(r,e,t,n)=>{const i=ho(r,t,n);if(i<=e)return{lines:[r],width:i};if(!(r.indexOf(" ")>-1)){if(r.length<=1)throw new Error(`Character ${r} is wider than region`);const c=Math.floor(r.length/2),f=qp(r.slice(0,c),e,t,n),d=qp(r.slice(c),e,t,n);return{lines:[...f.lines,...d.lines],width:Math.max(f.width,d.width)}}const s=r.split(" "),o=[];let l=-1/0,u=0;for(;u<s.length;){const c=s[u];if(ho(c,t,n)>e){const f=qp(c,e,t,n);o.push(...f.lines),l=Math.max(l,f.width),u++}else{const f=[c];l=Math.max(l,ho(c,t,n));let d=u+1,h=!0;for(;d<s.length&&h;){const g=s[d],v=ho(`${f.join(" ")} ${g}`,t,n);v<=e?(f.push(g),l=Math.max(l,v),d++):h=!1}o.push(f.join(" ")),u=d}}if(l<0)throw new Error(`No max width calculated for text: ${o}.`);return{lines:o,width:l}},P7=(r,e,t,n,i,a)=>{const s=(a??_F)*e.getApproximateHeight(),o=1/t.unitsPerEm,l=BF(r,o,e),u=r.length*s*o,c=n/l,f=i/u;return Math.min(f,c)},D7=(r,e,t,n)=>{const i=Io(e.fontData.assetUrl),a=i.getFont(),s=e.fontSize/a.unitsPerEm;if(!t)return $x(e,r,e.fontSize,s,i,n);let o;if(e.text?o=e.text.split(`
1785
1785
  `):o=e.input?.split(`
@@ -2831,7 +2831,7 @@ Minimum version required to store current data is: `+q+`.
2831
2831
  }
2832
2832
  }
2833
2833
  }
2834
- `;var yg=(r=>(r.PriceBreakChanged="PriceBreakChanged",r.ProductChanged="ProductChanged",r.QuantityChanged="QuantityChanged",r.RecipientChanged="RecipientChanged",r.SelectionChanged="SelectionChanged",r.WorkflowConfigurationChanged="WorkflowConfigurationChanged",r))(yg||{});class M1{constructor(e,t){this.cachedStepHandles=new Map,this.profanityList=[],this.currentPriceBreak=1,this.renderableScenes=[],this.renderableSceneCallbacks=[],this.eventCallbacks=new Map,this.debouncedSavedDesignUpdate=DI(async()=>{await Qp.getSavedDesignByTransaction(this.getTransaction().id)&&this.save()},2500),this.getCanvasObjectURLAsync=async n=>new Promise((i,a)=>{try{n.toBlob(s=>{if(s){const o=URL.createObjectURL(s);i(o)}})}catch(s){a(s)}}),this.client=e,this.transaction=t.transaction,this.workflow=t.workflow,this.profanityList=this.transaction.product?.profanities?.map(n=>n.word)||[],this.isReadOnly=t.transaction.isOrdered||!!t.readOnly,this.graphQlClient=t.graphQlClient,this.workflowManager=new fA(this,e,n=>{try{this.debouncedSavedDesignUpdate()}catch{console.error("Failed to update saved design details.")}return t.stateMutationFunc(n)},t.graphQlClient,t.reloadedState,t.readOnly,t.modelContainer,t.isReloadedTransaction,t.singleVariantsRenderable,t.delayWorkflowStateSync),this.workflowManager.addSelectionCallback(n=>{const i=n.traversableScenes.map(a=>{const s=a.renderableSteps.map(o=>o.stepName);return{id:a.name,title:a.title,renderableSteps:s,workflowScene:a}});this.renderableScenes=i,this.renderableSceneCallbacks.forEach(a=>a(i)),this.callEvent("SelectionChanged")}),this.currentPriceBreak=this.priceBreakToBeApplied()}getTransaction(){return this.transaction}getProduct(){return this.transaction.product}getProfanityList(){return this.profanityList}async setProduct(e){this.workflow=void 0;const t=await this.graphQlClient().mutate({mutation:PE,variables:{id:this.getTransaction().id,integrationProductId:e}}),n=t.data?.transactionUpdateIntegrationProduct.product;if(!n)throw new nn("Failed to set product. No product returned from server.");if(!this.bundle)throw new nn("Cannot set product on experience that is not part of a bundle.");this.transaction.product={...this.transaction.product,...t.data?.transactionUpdateIntegrationProduct.product},this.transaction.integrationProduct={...this.transaction.integrationProduct,...t.data?.transactionUpdateIntegrationProduct.integrationProduct},this.transaction.workflowState=void 0,this.currentPriceBreak=this.priceBreakToBeApplied(),this.callEvent("ProductChanged");const i=(await this.bundle.getProductCollection().fetchProducts()).find(a=>a.getId()===n.id);try{const a=i?.getDefaultWorkflow();if(a){const s=await VP(a.getId());await this.setWorkflow(s),console.log("Setting Product - Workflow set to default for product.")}}catch{console.log("Setting Product - No default workflow available, must be set manually.")}}async clearProduct(){if(!this.bundle)throw new nn("Cannot clear product on experience that is not part of a bundle.");this.workflow=void 0,this.transaction.workflowState=void 0,this.transaction.product=void 0,this.transaction.integrationProduct=void 0,this.currentPriceBreak=this.priceBreakToBeApplied(),this.callEvent("ProductChanged"),await this.graphQlClient().mutate({mutation:PE,variables:{id:this.getTransaction().id}})}getWorkflow(){return this.workflow}async setWorkflow(e){return this.workflow=e,await this.graphQlClient().mutate({mutation:_3,variables:{id:this.getTransaction().id,workflowId:e.id}}),this.workflowManager.setWorkflow(e)}async updateWorkflowConfiguration(e){if(!this.workflow)throw new Error("No workflow set");const t={...this.workflow,...e};e.steps&&this.cachedStepHandles.clear();const n=this.convertToWorkflowUpdateRequest(e);await this.workflowManager.updateWorkflowConfiguration(n),this.workflow=t,this.callEvent("WorkflowConfigurationChanged")}convertToWorkflowUpdateRequest(e){const t={};if(e.panels){const n=this.workflow?.panels||[],i=new Set(n.map(u=>u.name)),a=new Set(e.panels.map(u=>u.name)),s=n.filter(u=>!a.has(u.name)).map(u=>u.name),o=e.panels.map((u,c)=>({item:u,index:c})).filter(({item:u})=>!i.has(u.name)),l=e.panels.filter(u=>i.has(u.name));t.panels={removed:s.length>0?s:void 0,added:o.length>0?o:void 0,changed:l.length>0?l:void 0}}if(e.steps){const n=this.workflow?.steps||[],i=new Set(n.map(u=>u.stepName)),a=new Set(e.steps.map(u=>u.stepName)),s=n.filter(u=>!a.has(u.stepName)).map(u=>u.stepName),o=e.steps.map((u,c)=>({item:u,index:c})).filter(({item:u})=>!i.has(u.stepName)),l=e.steps.filter(u=>i.has(u.stepName));t.steps={removed:s.length>0?s:void 0,added:o.length>0?o:void 0,changed:l.length>0?l:void 0}}if(e.stepGroups){const n=this.workflow?.stepGroups||[],i=c=>c.id||c.name,a=new Set(n.map(i)),s=new Set(e.stepGroups.map(i)),o=n.filter(c=>!s.has(i(c))).map(i),l=e.stepGroups.map((c,f)=>({item:c,index:f})).filter(({item:c})=>!a.has(i(c))),u=e.stepGroups.filter(c=>a.has(i(c)));t.stepGroups={removed:o.length>0?o:void 0,added:l.length>0?l:void 0,changed:u.length>0?u:void 0}}return t}async attachAddress(e,t,n,i,a,s){await this.graphQlClient().mutate({mutation:X9,variables:{transactionId:this.getTransaction().id,streetAddress:e||void 0,apartment:t||void 0,city:n||void 0,country:i||void 0,state:a||void 0,postCode:s||void 0}})}async attachOrganization(e){await this.graphQlClient().mutate({mutation:J9,variables:{transactionId:this.getTransaction().id,organizationName:e}})}getBundle(){return this.bundle}setBundle(e){this.bundle=e}getClient(){return this.client}getIsReadOnly(){return this.isReadOnly}getCommandContext(){return this.workflowManager.getCommandContext()}getWorkflowManager(){return this.workflowManager}async createPreviewImage(e,t){const n=this.getWorkflow(),i=n?.finalizeStepConfig?.lookAtAnimation;if(!n)throw new Error("Failed to generate cart preview image! No workflow is set.");if(e){if(!i)throw new Error("Failed to generate cart preview image! No camera orientation configured.");return await this.workflowManager.getPreviewService()?.renderSceneScreenshot(t??512,i)||""}let a=2048;t&&t<=2048&&(a=t);const s=Eo(a,a),o=this.workflowManager.getCommandContext().getAllLayouts(),l=n.defaultPreviewPanelIndex||0,u=n.panels[l],c=o.find(S=>S.layoutState?.layout.panelId===u?.name)||o[0],f=c.layoutState.layout.previewRegion?{x:c.layoutState.layout.previewRegion.left,y:c.layoutState.layout.previewRegion.top,width:c.layoutState.layout.previewRegion.width,height:c.layoutState.layout.previewRegion.height}:{x:0,y:0,width:c.layoutState.layout.width,height:c.layoutState.layout.height},d=this.workflowManager.getCommandContext().getLayoutById(c.layoutState.layout.id),h=s.getContext("2d");if(!h)throw new _g("Failed to obtain 2D context for preview image creation");const g=this.workflowManager.getTemplatingContext(),v=Qg(d.layoutState.layout,d.layoutState.elements,{renderingConfiguration:{purpose:Ku.Print,region:{left:f.x,top:f.y,width:f.width,height:f.height},templatingContext:g}}),y=Qk(v);await(await uo.from(h,y,{anonymousCrossOrigin:!0,ignoreDimensions:!1,createCanvas:Eo,createImage:Mf,DOMParser:YA(),fetch})).render();const C=await this.getCanvasObjectURLAsync(s);return s.toDataURL(C)}getStepById(e){const t=this.getWorkflow()?.steps.find(a=>a.stepName===e);if(!t||!this.stepHasHandle(t))return;const n=this.cachedStepHandles.get(t.stepName);if(n)return n;const i=Ep.get(this.getWorkflowManager(),t);return this.cachedStepHandles.set(t.stepName,i),i}getSteps(){return this.getScenes().flatMap(e=>this.getStepsByScene(e))}async getStepsConditionallyActive(){const e=this.getScenes();return(await Promise.all(e.map(async n=>{const i=this.getStepsByScene(n),a=await Promise.all(i.map(s=>co(s.getRaw(),this.getWorkflowManager().getStepSelections())));return i.filter((s,o)=>a[o])}))).flat()}getScenes(){return(this.getWorkflow()?.stepGroups||[]).map(t=>({id:t.id,name:t.name,stepIds:t.stepNames}))}getSelectionPriceSubunits(e){const t=this.getWorkflowManager().getWorkflowSelections();let n=0;return Object.values(t).forEach(i=>{n+=i.selections.reduce((a,s)=>a+(s.priceModifier||0),0)}),this.getPriceSubUnitsAfterPriceBreaks(n,e)}getBasePriceSubunits(e,t){const n=this.getPriceSubUnitsAfterPriceBreaks(this.getProduct()?.basePrice||0,t);if(e){const i=this.getAdditionalProductPriceSubunits(t)||0;return n+i}return n}getAdditionalProductPriceSubunits(e){const t=this.getTransaction().integrationProduct;if(t?.additionalIntegrationProduct?.product){const n=t.additionalIntegrationProduct.product.basePrice||0;return this.getPriceSubUnitsAfterPriceBreaks(n,e)}}getTotalPriceSubunits(e){return this.getBasePriceSubunits(!1,e)+this.getSelectionPriceSubunits(e)}getPriceSubUnitsAfterPriceBreaks(e,t){const n=t?1:this.priceBreakToBeApplied(),i=e*n;return Math.ceil(i)}priceBreakToBeApplied(){const e=(this.getProduct()?.priceBreaks||[]).sort((i,a)=>-(i.minQty-a.minQty)),n=[...this.getMatchingExperiencesFromBundle(),this].reduce((i,a)=>i+a.getQuantity(),0);for(const i of e)if(i.minQty<=n)return i.percentage;return 1}checkForPriceBreakChanges(){const e=this.priceBreakToBeApplied();this.currentPriceBreak!==e&&(this.updatePriceBreak(e),this.getMatchingExperiencesFromBundle().forEach(t=>t.updatePriceBreak(e)))}getMatchingExperiencesFromBundle(){return(this.bundle?.getWorkflowExperiences()||[]).filter(e=>{const t=e.getTransaction().id,n=this.getTransaction().id,i=e.getProduct()?.id,a=this.getProduct()?.id;return t!==n&&i===a})}updatePriceBreak(e){this.currentPriceBreak=e,this.callEvent("PriceBreakChanged")}async copySelectionsViaGlobalConfiguration(e,t,n){const i=await e.getGlobalProperties(),a=n?.map(u=>u.getId()),s=this.getSteps().filter(u=>a===void 0||a.includes(u.getId())),o=t.getSteps(),l=u=>i.find(c=>c.getRawProperty().name===u.aspectName);s.forEach(u=>{const c=new Set,f=u.getRaw().globalPropertyAspectConfigurations;f!==void 0&&(f.forEach(d=>c.add(JSON.stringify(d))),o.forEach(d=>{const h=d.getRaw().globalPropertyAspectConfigurations;h!==void 0&&h.forEach(g=>{const v=l(g),y=c.has(JSON.stringify(g));if(y&&v?.getType()==="Option"){const A=d.getCurrentVariant();if(!A)return;u.selectVariant(A),c.delete(JSON.stringify(g))}else if(y&&v?.getType()==="Text"){const A=d.getText();u.setText(A),c.delete(JSON.stringify(g))}})}))})}getStepByName(e){const t=this.getWorkflow()?.steps.find(n=>n.stepTitle===e);if(!(!t||!this.stepHasHandle(t)))return Ep.get(this.getWorkflowManager(),t)}getStepsByType(e){return this.getWorkflow()?.steps.filter(t=>t.type===e).map(t=>Ep.get(this.getWorkflowManager(),t))||[]}getStepsByScene(e){const t=this.getWorkflow();if(!t?.stepGroups.find(i=>i.name===e.name))throw new Error("Given scene is not present on workflow! Be careful when persisting scenes that you only use them with the relevant workflow.");return e.stepIds.map(i=>t.steps.find(a=>a.stepName===i)).filter(i=>!!i&&this.stepHasHandle(i)).map(i=>Ep.get(this.getWorkflowManager(),i))}async attachCustomerDetails(e){return this.assignCustomerDetails({emailAddress:e.email})}async assignCustomerDetails(e){const n=(await this.graphQlClient().mutate({mutation:Q9,variables:{id:this.getTransaction().id,details:e,type:"Owner"}})).data?.transactionAddStakeholder?.stakeholders?.find(i=>i.customer?.emailAddress===e.emailAddress);n?.customer&&this.assignCustomerInternal(n.customer)}assignCustomerInternal(e){this.getWorkflowManager().setTransactionCustomer(e);const t=br.getMap("transactionCustomerIds")||new Map;t.set(this.getTransaction().id,e.id),br.setMap("transactionCustomerIds",t)}attachRenderableSceneListener(e){this.renderableSceneCallbacks.push(e),e(this.renderableScenes)}detachRenderableSceneListener(e){this.renderableSceneCallbacks=this.renderableSceneCallbacks.filter(t=>t!==e)}async save(e){const t=this.getProduct(),n=this.getWorkflow(),i=this.getCommandContext().getState();if(!t)throw new nn("Product undefined!");if(!n)throw new nn("Workflow undefined!");if(!i)throw new nn("State undefined!");const s={title:await(async()=>{if(e)return e;const o=this.getTransaction().id,u=(await Qp.getSavedDesigns()).find(c=>c.transactionId===o)?.title;return u||"My design"})(),thumbnail:await this.createPreviewImage(!1,256),transactionId:this.getTransaction().id,productId:t.id,integrationProductId:this.getTransaction().integrationProduct.id,workflowName:n.name,workflowId:n.id,lastEdited:new Date};return await Qp.addDesign(s),s}async copy(){const e=mo(this.getCommandContext().getState());if(!e)throw new nn("Internal state is undefined! Cannot copy experience!");const t=JSON.stringify(e.transaction),n=this.getWorkflow();if(!n)throw new nn("Workflow is undefined! Cannot copy experience!");const i=this.getTransaction().integrationProduct?.id;if(!i)throw new nn("Integration product id is undefined!");return await this.getClient().getWorkflowExperience({type:"integration",integrationProductId:i,workflowId:n.id,workflowState:t})}async onDesignFinished(e=!0){const t=this.getTransaction(),n=this.getProduct(),i=this.getWorkflow();if(!n)throw new nn("Product undefined! Cannot finish an experience without a product.");if(!i)throw new nn("Workflow undefined! Cannot finish an experience without a workflow.");if(t.isOrdered)return{event:"",exportedData:{},lineItemImageUrl:"",optionsCost:0,transactionId:t.id,workflowViewerLink:"",workflowViewerReadOnlyLink:""};const a=await PI([{workflowManager:this.workflowManager,workflow:i,layouts:this.workflowManager.getLayouts(),getReducerState:()=>this.workflowManager.getCommandContext().getState(),product:n,transaction:t,workflowSelections:this.workflowManager.getWorkflowSelections(),workflowMetadata:this.workflowManager.getWorkflowMetadata(),designName:i.name}],s=>e?this.createPreviewImage(s,1024):Promise.resolve(void 0));return t.completed&&await this.graphQlClient().mutate({mutation:G3,variables:{transactionId:t.id}}),a[0]}stepHasHandle(e){return e.type!==Xe.SilentIllustration&&e.type!==Xe.ProductOverlay}async getExportedStepData(){const e=this.getWorkflow(),t=this.getWorkflowManager().getWorkflowMetadata(),n=this.getWorkflowManager().getWorkflowSelections(),i=[];for(const a of e?.steps||[]){const s=a.stepName,o=t[s],l=n[s]?.selections[0],u={stepId:s,title:a.stepTitle,properties:[]};if(l&&await Z9(a,n)&&u.properties.push({type:"selection",value:l.name,priceModifier:l.priceModifier}),!o){i.push(u);continue}switch(a.type){case Xe.Frame:{const c=a.data,f=o;f.image&&c.displayImageOnFinishStep&&u.properties.push({type:"image",value:f.image,priceModifier:0})}break;case Xe.Illustration:{const c=a.data,f=o;if(f&&f.colors&&f.colors.length>0&&c.displayColorsOnFinishStep){const d=f.colors.join(", ").toUpperCase();u.properties.push({type:"color",value:d,priceModifier:0})}}break;case Xe.Module:{const c=a.data,f=o;f&&f.text&&c.displayTextOnFinishStep&&u.properties.push({type:"text",value:f.text,priceModifier:0})}break;case Xe.Text:{const c=a.data,f=o;f&&f.text&&c.displayTextOnFinishStep&&u.properties.push({type:"text",value:f.text,priceModifier:0}),f&&f.color&&c.displayColorOnFinishStep&&u.properties.push({type:"color",value:f.color,priceModifier:0})}}i.push(u)}return i.filter(a=>a.properties&&a.properties.length>0)}getQuantity(){return this.getTransaction().quantity||1}async setQuantity(e){if(e<1)throw new RangeError("WorkflowExperience quantity must be greater than zero.");if(this.isReadOnly)throw new Error("Cannot update quantity on a read-only WorkflowExperience");this.getTransaction().quantity=e,this.callEvent("QuantityChanged"),this.checkForPriceBreakChanges();const t=this.getTransaction();await this.graphQlClient().mutate({mutation:M3,variables:{id:t.id,quantity:e}})}addEventListener(e,t){const n=this.eventCallbacks.get(e)||[];n.push(t),this.eventCallbacks.set(e,n)}removeEventListener(e,t){const n=this.eventCallbacks.get(e)||[];this.eventCallbacks.set(e,n.filter(i=>i!==t))}callEvent(e){(this.eventCallbacks.get(e)||[]).forEach(t=>t(this))}}const K9=r=>{if([Xe.Question,Xe.Frame,Xe.Illustration,Xe.Material,Xe.Model,Xe.Picture,Xe.Shape,Xe.Text].includes(r.type)){const t=r.data;return!!t.displaySelectionOnFinishStep||!!t.displaySelectionsOnFinishStep}return!1},Z9=async(r,e)=>{if(!K9(r))return!1;const t=await ct.getOptionForStep(r);if(t&&(t.variants||[]).length>1){const n=e[r.stepName];return!!(n&&n.selections.length>0)}return!1};class eV{constructor(e){this.handleCache={},this.bundle=e}async getHandle(e){if(this.handleCache[e.name])return this.handleCache[e.name];const t=await this.createHandle(e);return this.handleCache[e.name]=t,t}async getHandles(){if(!this.bundle.getGlobalPropertyConfiguration())return[];await this.bundle.getGlobalPropertyStateManager().getInitializationPromise();const e=this.bundle.getGlobalPropertyConfiguration();return e?Promise.all(e.aspects.map(t=>this.getHandle(t))):[]}applyConditionsFromState(e,t){return t?e.filter(n=>this.aspectConditionsSatisfied(n.getRawProperty(),t)):e}aspectConditionsSatisfied(e,t){return!e.conditions||e.conditions.length===0?!0:(e.conditionMode===Nk.AND?Array.prototype.every.bind(e.conditions):Array.prototype.some.bind(e.conditions))(i=>{const a=t.aspects.find(s=>s.name===i.targetAspectName);return a?i.requiredVariantSelections.some(s=>s===a.value):!1})}async createHandle(e){switch(e.type){case Hn.FileUpload:return new RI(this.bundle,e).initialize();case Hn.ColorOption:return new pA(this.bundle,e,e.entityId?await ct.getOption(e.entityId):void 0);case Hn.Option:{const t=e.entityId?await ct.getOption(e.entityId):void 0;return t?.type==="Color"?new pA(this.bundle,e,t):new _1(this.bundle,e,t)}case Hn.Text:return new OI(this.bundle,e);default:throw new Error("Unhandled Global Property Aspect Type")}}}class Jg{constructor(e,t){this.bundle=e,this.property=t}getName(){return this.property.name}getTitle(){return this.property.title}getDescription(){return this.property.description}getType(){return this.property.type}getRawProperty(){return this.property}isMandatory(){return!!this.property.mandatory}isMandatoryFulfilled(){return!this.property.mandatory||!!this.bundle.getGlobalPropertyStateManager().getAspectMandatoryFulfilled(this.property.name)}isSilent(){return!!this.property.silent||this.bundle.getGlobalPropertyStateManager().getAspectHidden(this.property.name)}async getSharedSteps(e){const t=e??this.bundle.getWorkflowExperiences();return(await Promise.all(t.map(a=>a.getStepsConditionallyActive()))).map(a=>a.filter(s=>s.getOverrideGlobalPropertyConfiguration(this.property.type)?!1:s.getRaw().globalPropertyAspectConfigurations?.some(o=>o.globalPropertyConfigurationId===this.bundle.getGlobalPropertyConfiguration()?.id&&o.aspectName===this.property.name))).flat()}getStateValue(){return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name)}}class RI extends Jg{constructor(e,t){super(e,t)}async initialize(){return this.property.data?.fileUpload?.colorOptionId&&(this.colorOption=await ct.getOption(this.property.data?.fileUpload?.colorOptionId)),await this.loadImageData(),this}async loadImageData(){const e=await this.getImage();if(e?.fileLink)if(e?.fileLink.endsWith(".svg")){const t=await ra(e?.fileLink),n=await S1(e?.fileLink),i=n.width,a=n.height,s=await Pa(t);this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.colors?.forEach(u=>{s.colors[u.key]={browserValue:u.browserValue,pmsValue:u.pmsValue}});const l={src:e?.fileLink,width:i,height:a,aspect:i/a,svg:s.svg,colors:s.colors};Ds.set(e?.fileLink,l),this.imageData=l}else this.imageData=void 0}async selectImage(e){const t=this.bundle.getGlobalPropertyStateManager();await Promise.all([t.setAspect(this.property.name,e.key,{...t.getAspectStorage(this.property.name)||{},originalAssetKey:e.key,backgroundRemovedAssetKey:void 0,vectorizedAssetKey:void 0,useOriginalAsset:void 0},void 0),this.applyImageSelection(e),this.loadImageData()])}async canUseAdvancedImageManipulation(){return this.bundle.getClient().canUseAddon(Bg.AdvancedImageManipulation)}async removeBackgroundFromImage(e=!0){if(!await this.canUseAdvancedImageManipulation())throw new Error("The current Integration does not have access to the Advanced Image Manipulation addon. Please call canUseAdvancedImageManipulation to ensure you disable this feature when appropriate.");const t=await this.getOriginalImage();if(!t)throw new Error("You must supply an image selection before attempting to remove the background.");const n=this.bundle.getGlobalPropertyStateManager(),i=await Ln.removeBackgroundFromAsset(t),s={...n.getAspectStorage(this.property.name),backgroundRemovedAssetKey:i.key,useOriginalAsset:!e},l=[e?n.setAspect(this.property.name,i.key,s):n.setAspectStorage(this.property.name,s)];return e&&(l.push(this.applyImageSelection(i,void 0,!1,!1)),l.push(this.loadImageData())),await Promise.all(l),this.updateSharedStepStorage(s),i}async vectorizeImage(e=!0){if(!await this.canUseAdvancedImageManipulation())throw new Error("The current Integration does not have access to the Advanced Image Manipulation addon. Please call canUseAdvancedImageManipulation to ensure you disable this feature when appropriate.");const t=await this.getOriginalImage();if(!t)throw new Error("You must supply an image selection before attempting to vectorize the image.");const n=this.bundle.getGlobalPropertyStateManager(),i=await Ln.vectorizeAsset(t),s={...n.getAspectStorage(this.property.name),vectorizedAssetKey:i.key,useOriginalAsset:!e},l=[e?n.setAspect(this.property.name,i.key,s):n.setAspectStorage(this.property.name,s)];return e&&(l.push(this.applyImageSelection(i,void 0,!1,!1)),l.push(this.loadImageData())),await Promise.all(l),this.updateSharedStepStorage(s),i}hasImage(){return!!this.getStateValue()}async getImage(){const e=this.getStateValue();if(e)return Ln.getLocalOrFromServer(e)}async getImageWithColors(){return await this.loadImageData(),this.imageData?.svg?Ug(zg(this.imageData.svg,this.imageData.colors??{},!1)):this.imageData?.src}async getOriginalImage(){const e=this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);if(e?.originalAssetKey)return Ln.getLocalOrFromServer(e.originalAssetKey)}async getBackgroundRemovedImage(){const e=this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);if(e?.backgroundRemovedAssetKey)return Ln.getLocalOrFromServer(e.backgroundRemovedAssetKey)}getUseOriginalImage(){return this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.useOriginalAsset??!1}async setUseOriginalImage(e){const t=await this.getOriginalImage();if(!t)throw new Error("You must select an image before calling setUseOriginalImage");const n=this.bundle.getGlobalPropertyStateManager(),i=n.getAspectStorage(this.property.name);if(i?.useOriginalAsset===e)return;const a={...i,useOriginalAsset:e},s=e?i?.originalAssetKey:i?.backgroundRemovedAssetKey,o=[n.setAspect(this.property.name,s||"",a)];if(e)o.push(this.applyImageSelection(t,void 0,!1,!1));else{const l=async()=>{const u=await this.getBackgroundRemovedImage();if(!u)throw new Error("You must call removeBackgroundFromImage before attempting to use that version of the image.");this.applyImageSelection(u,void 0,!1,!1)};o.push(l())}o.push(this.loadImageData()),await Promise.all(o),this.updateSharedStepStorage(a)}async applyGlobalState(e){const t=this.getStateValue();if(!t)return;const n=await Ln.getLocalOrFromServer(t);if(!n)return;await this.applyImageSelection(n,e,!1,!0);const i=this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);if(i){if(this.updateSharedStepStorage({...i}),i.colors){const a=new Map(i.colors.map(s=>[s.key,{browserValue:s.browserValue,pmsValue:s.pmsValue}])??[]);await Promise.all((await this.getSharedSteps(e)).map(async s=>{await s.changeColors(a)}))}}else this.updateSharedStepStorage({originalAssetKey:t}),await this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name,{originalAssetKey:t})}getAvailableColors(){return this.property.data?.fileUpload?.colorPickerEnabled?this.colorOption?.variants?.map(e=>({fill:e.color,stroke:e.color,variant:e,pmsValue:e.name}))??[]:[]}getCurrentColors(){return this.imageData?.colors}isColorPickerEnabled(){return this.property.data?.fileUpload?.colorPickerEnabled??!1}isPmsPickerEnabled(){return this.property.data?.fileUpload?.pmsPickerEnabled??!1}async getOriginalColors(){return this.imageData?.svg?(await Pa(this.imageData.svg)).colors:void 0}async changeColors(e){if(!this.imageData?.svg)return;const t=this.getSharedSteps(),n=new Map(Object.entries(e));await Promise.all((await t).map(async a=>{await a.changeColors(n)}));const i=this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);await Promise.all([this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name,{...i,colors:Object.entries(e).map(([a,s])=>({key:a,browserValue:s.browserValue,pmsValue:s.pmsValue}))}),await this.loadImageData()])}async applyImageSelection(e,t,n=!0,i=!0){const s=(await this.getSharedSteps(t)).map(o=>{const l=o;if(l.getFrameService())return l.selectImage(e,n,i)});await Promise.all(s)}updateSharedStepStorage(e){this.bundle.getWorkflowExperiences().forEach(n=>n.getSteps().forEach(i=>{if(i.getOverrideGlobalPropertyConfiguration(this.property.type))return;i.getRaw().globalPropertyAspectConfigurations?.some(s=>s.globalPropertyConfigurationId===this.bundle.getGlobalPropertyConfiguration()?.id&&s.aspectName===this.property.name)&&n.getWorkflowManager().updateStorage(i.getId(),{framePatternData:{originalAssetKey:e.originalAssetKey,backgroundRemovedAssetKey:e.backgroundRemovedAssetKey,useOriginalAsset:e.useOriginalAsset}})}))}}class OI extends Jg{constructor(e,t){super(e,t)}isTemplatingEnabled(){return this.property.data?.text?.templatingEnabled||!1}getText(){const e=this.getStateValue();return e||""}async setText(e){await Promise.all([this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name,e,void 0,void 0),this.applyTextSelection(e)])}async applyGlobalState(e){const t=this.getStateValue();if(!t)return Promise.resolve();await this.applyTextSelection(t,e)}async applyTextSelection(e,t){const i=(await this.getSharedSteps(t)).map(a=>{a.setText(e)});await Promise.all(i)}}class _1 extends Jg{constructor(e,t,n){super(e,t),this.optionResource=n}async ensureOptionLoaded(){if(this.optionResource?.variants)return this.optionResource;if(!this.property.entityId)return this.optionResource;const e=await ct.getOption(this.property.entityId);return e&&(this.optionResource=e),this.optionResource}async initDefaultVariant(){await this.ensureOptionLoaded();const e=this.optionResource?.variants?.find(t=>t.id===this.optionResource?.defaultVariant?.id);e&&await this.selectVariant(new Fa(e))}getCurrentVariant(){if(!this.optionResource)return;const e=this.getStateValue();if(e){const t=this.optionResource.variants?.find(n=>n.id===e);return t?new Fa(t):void 0}else{const t=this.optionResource.variants?.find(n=>n.id===this.optionResource?.defaultVariant?.id);return t?new Fa(t):void 0}}async getAvailableVariants(){return await this.ensureOptionLoaded(),(this.optionResource?.variants?.filter(t=>t.enabled)||[]).map(t=>new Fa(t))}async getAllVariants(){return await this.ensureOptionLoaded(),(this.optionResource?.variants||[]).map(t=>new Fa(t))}async selectVariant(e,t){await this.applyVariantSelection(e),await this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name,e.getId(),void 0,t)}async applyGlobalState(e){const t=this.getStateValue();if(!t)return;await this.ensureOptionLoaded();const n=this.optionResource?.variants?.find(i=>i.id===t);if(n)return this.applyVariantSelection(new Fa(n),e)}async applyVariantSelection(e,t){const i=(await this.getSharedSteps(t)).map(a=>a.selectVariant(e));await Promise.all(i)}}class pA extends _1{constructor(e,t,n){super(e,t,n)}async selectVariant(e,t){await this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name,e.getId(),void 0,t),await this.applyColorVariant(e,void 0,t)}async applyGlobalState(e){const t=this.getStateValue();if(!t)return;await this.ensureOptionLoaded();const n=this.optionResource?.variants?.find(a=>a.id===t);if(!n)return;await this.applyColorVariant(new Fa(n),e);const i=this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.customColor;i&&await this.setCustomColor(i)}async applyColorVariant(e,t,n){const a=(await this.getSharedSteps(t)).map(s=>{switch(s.getType()){case Xe.Shape:return s.selectVariant(e);case Xe.Text:return s.setFillColor({fill:e.getColor(),stroke:e.getColor(),variant:e.getResource()});case Xe.Illustration:return s.setColor(n?.toString()||"",e.getColor()||"")}});await Promise.all(a)}async setCustomColor(e){const t=this.getCurrentVariant()?.getColor();t&&t.toLowerCase()==="#custom"&&(await this.getSharedSteps()).forEach(i=>i.setCustomColor(e)),this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name,{customColor:e})}getCustomColor(){return this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.customColor||this.getCurrentVariant()?.getColor()||"#ffffff"}}const tV=(r,e,t)=>{const n=r.getWorkflowExperiences(),i=r.getGlobalPropertyConfiguration();return i?n.flatMap(s=>s.getSteps()).filter(s=>s.getGlobalPropertyAspects(i.id).includes(e)&&s.getType()===t):[]},BI=(r,e)=>{const n=tV(r,e,Xe.Illustration).map(i=>{if(!i.getCurrentVariant()?.getAssetResource()?.assetConfiguration)return 0;const s=i.getColors();return s?Object.getOwnPropertyNames(s).length:0});return Math.max(...n)};var Ud={exports:{}};Ud.exports;var DE;function rV(){return DE||(DE=1,(function(r,e){var t=200,n="Expected a function",i="__lodash_hash_undefined__",a=500,s=1,o=2,l=4,u=800,c=16,f=9007199254740991,d="[object Arguments]",h="[object Array]",g="[object AsyncFunction]",v="[object Boolean]",y="[object Date]",A="[object Error]",C="[object Function]",S="[object GeneratorFunction]",F="[object Map]",E="[object Number]",R="[object Null]",B="[object Object]",G="[object Promise]",j="[object Proxy]",ie="[object RegExp]",q="[object Set]",Y="[object String]",J="[object Symbol]",ae="[object Undefined]",oe="[object WeakMap]",he="[object ArrayBuffer]",ye="[object DataView]",Ue="[object Float32Array]",Re="[object Float64Array]",Oe="[object Int8Array]",ee="[object Int16Array]",re="[object Int32Array]",fe="[object Uint8Array]",Be="[object Uint8ClampedArray]",ke="[object Uint16Array]",$e="[object Uint32Array]",Ge=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qe=/^\w*$/,je=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wt=/[\\^$.*+?()[\]{}|]/g,rr=/\\(\\)?/g,Dr=/\w*$/,jt=/^\[object .+?Constructor\]$/,ar=/^(?:0|[1-9]\d*)$/,St={};St[Ue]=St[Re]=St[Oe]=St[ee]=St[re]=St[fe]=St[Be]=St[ke]=St[$e]=!0,St[d]=St[h]=St[he]=St[v]=St[ye]=St[y]=St[A]=St[C]=St[F]=St[E]=St[B]=St[ie]=St[q]=St[Y]=St[oe]=!1;var st={};st[d]=st[h]=st[he]=st[ye]=st[v]=st[y]=st[Ue]=st[Re]=st[Oe]=st[ee]=st[re]=st[F]=st[E]=st[B]=st[ie]=st[q]=st[Y]=st[J]=st[fe]=st[Be]=st[ke]=st[$e]=!0,st[A]=st[C]=st[oe]=!1;var Qr=typeof di=="object"&&di&&di.Object===Object&&di,Sr=typeof self=="object"&&self&&self.Object===Object&&self,mr=Qr||Sr||Function("return this")(),nr=e&&!e.nodeType&&e,dr=nr&&!0&&r&&!r.nodeType&&r,Yt=dr&&dr.exports===nr,Xt=Yt&&Qr.process,mt=(function(){try{var L=dr&&dr.require&&dr.require("util").types;return L||Xt&&Xt.binding&&Xt.binding("util")}catch{}})(),Cr=mt&&mt.isMap,sn=mt&&mt.isSet,_r=mt&&mt.isTypedArray;function ir(L,te,le){switch(le.length){case 0:return L.call(te);case 1:return L.call(te,le[0]);case 2:return L.call(te,le[0],le[1]);case 3:return L.call(te,le[0],le[1],le[2])}return L.apply(te,le)}function Yr(L,te){for(var le=-1,Ve=L==null?0:L.length;++le<Ve&&te(L[le],le,L)!==!1;);return L}function kr(L,te){for(var le=-1,Ve=L==null?0:L.length,pt=0,_t=[];++le<Ve;){var Wr=L[le];te(Wr,le,L)&&(_t[pt++]=Wr)}return _t}function Zr(L,te){for(var le=-1,Ve=L==null?0:L.length,pt=Array(Ve);++le<Ve;)pt[le]=te(L[le],le,L);return pt}function Vr(L,te){for(var le=-1,Ve=te.length,pt=L.length;++le<Ve;)L[pt+le]=te[le];return L}function pn(L,te){for(var le=-1,Ve=Array(L);++le<L;)Ve[le]=te(le);return Ve}function gn(L){return function(te){return L(te)}}function Tr(L,te){return L?.[te]}function zr(L,te){return function(le){return L(te(le))}}var en=Array.prototype,$r=Function.prototype,zt=Object.prototype,sr=mr["__core-js_shared__"],Er=$r.toString,tt=zt.hasOwnProperty,Nr=(function(){var L=/[^.]+$/.exec(sr&&sr.keys&&sr.keys.IE_PROTO||"");return L?"Symbol(src)_1."+L:""})(),Xr=zt.toString,Ee=Er.call(Object),D=RegExp("^"+Er.call(tt).replace(wt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),U=Yt?mr.Buffer:void 0,X=mr.Symbol,ue=mr.Uint8Array;U&&U.allocUnsafe;var Fe=zr(Object.getPrototypeOf,Object),We=zt.propertyIsEnumerable,bt=en.splice,Dt=X?X.isConcatSpreadable:void 0,Nt=X?X.toStringTag:void 0,or=(function(){try{var L=Ut(Object,"defineProperty");return L({},"",{}),L}catch{}})(),Lt=Object.getOwnPropertySymbols,K=U?U.isBuffer:void 0,Ie=Math.max,Qe=Date.now,Ye=Ut(mr,"DataView"),xt=Ut(mr,"Map"),ft=Ut(mr,"Promise"),Rt=Ut(mr,"Set"),Et=Ut(mr,"WeakMap"),pr=Ut(Object,"create"),tr=hi(Ye),fr=hi(xt),$t=hi(ft),Bn=hi(Rt),Pn=hi(Et),vr=X?X.prototype:void 0,xr=vr?vr.valueOf:void 0,Cn=vr?vr.toString:void 0;function Rr(L){var te=-1,le=L==null?0:L.length;for(this.clear();++te<le;){var Ve=L[te];this.set(Ve[0],Ve[1])}}function jn(){this.__data__=pr?pr(null):{},this.size=0}function xn(L){var te=this.has(L)&&delete this.__data__[L];return this.size-=te?1:0,te}function Hr(L){var te=this.__data__;if(pr){var le=te[L];return le===i?void 0:le}return tt.call(te,L)?te[L]:void 0}function Sn(L){var te=this.__data__;return pr?te[L]!==void 0:tt.call(te,L)}function cn(L,te){var le=this.__data__;return this.size+=this.has(L)?0:1,le[L]=pr&&te===void 0?i:te,this}Rr.prototype.clear=jn,Rr.prototype.delete=xn,Rr.prototype.get=Hr,Rr.prototype.has=Sn,Rr.prototype.set=cn;function tn(L){var te=-1,le=L==null?0:L.length;for(this.clear();++te<le;){var Ve=L[te];this.set(Ve[0],Ve[1])}}function Jn(){this.__data__=[],this.size=0}function si(L){var te=this.__data__,le=Jt(te,L);if(le<0)return!1;var Ve=te.length-1;return le==Ve?te.pop():bt.call(te,le,1),--this.size,!0}function En(L){var te=this.__data__,le=Jt(te,L);return le<0?void 0:te[le][1]}function mn(L){return Jt(this.__data__,L)>-1}function on(L,te){var le=this.__data__,Ve=Jt(le,L);return Ve<0?(++this.size,le.push([L,te])):le[Ve][1]=te,this}tn.prototype.clear=Jn,tn.prototype.delete=si,tn.prototype.get=En,tn.prototype.has=mn,tn.prototype.set=on;function rn(L){var te=-1,le=L==null?0:L.length;for(this.clear();++te<le;){var Ve=L[te];this.set(Ve[0],Ve[1])}}function Lr(){this.size=0,this.__data__={hash:new Rr,map:new(xt||tn),string:new Rr}}function ln(L){var te=Ht(this,L).delete(L);return this.size-=te?1:0,te}function k(L){return Ht(this,L).get(L)}function O(L){return Ht(this,L).has(L)}function z(L,te){var le=Ht(this,L),Ve=le.size;return le.set(L,te),this.size+=le.size==Ve?0:1,this}rn.prototype.clear=Lr,rn.prototype.delete=ln,rn.prototype.get=k,rn.prototype.has=O,rn.prototype.set=z;function W(L){var te=this.__data__=new tn(L);this.size=te.size}function pe(){this.__data__=new tn,this.size=0}function ce(L){var te=this.__data__,le=te.delete(L);return this.size=te.size,le}function xe(L){return this.__data__.get(L)}function _e(L){return this.__data__.has(L)}function rt(L,te){var le=this.__data__;if(le instanceof tn){var Ve=le.__data__;if(!xt||Ve.length<t-1)return Ve.push([L,te]),this.size=++le.size,this;le=this.__data__=new rn(Ve)}return le.set(L,te),this.size=le.size,this}W.prototype.clear=pe,W.prototype.delete=ce,W.prototype.get=xe,W.prototype.has=_e,W.prototype.set=rt;function ut(L,te){var le=Ti(L),Ve=!le&&ds(L),pt=!le&&!Ve&&fs(L),_t=!le&&!Ve&&!pt&&Ae(L),Wr=le||Ve||pt||_t,$n=Wr?pn(L.length,String):[],oi=$n.length;for(var zi in L)Wr&&(zi=="length"||pt&&(zi=="offset"||zi=="parent")||_t&&(zi=="buffer"||zi=="byteLength"||zi=="byteOffset")||Je(zi,oi))||$n.push(zi);return $n}function nt(L,te,le){var Ve=L[te];(!(tt.call(L,te)&&cs(Ve,le))||le===void 0&&!(te in L))&&yr(L,te,le)}function Jt(L,te){for(var le=L.length;le--;)if(cs(L[le][0],te))return le;return-1}function yr(L,te,le){te=="__proto__"&&or?or(L,te,{configurable:!0,enumerable:!0,value:le,writable:!0}):L[te]=le}function Gr(L,te,le,Ve,pt,_t){var Wr;if(le&&(Wr=pt?le(L,Ve,pt,_t):le(L)),Wr!==void 0)return Wr;if(!la(L))return L;var $n=Ti(L);if($n)Wr=we(L);else{var oi=de(L),zi=oi==C||oi==S;if(fs(L))return Zn(L);if(oi==B||oi==d||zi&&!pt)Wr={};else{if(!st[oi])return pt?L:{};Wr=Me(L,oi)}}_t||(_t=new W);var _l=_t.get(L);if(_l)return _l;_t.set(L,Wr),V(L)?L.forEach(function(ua){Wr.add(Gr(ua,te,le,ua,L,_t))}):T(L)&&L.forEach(function(ua,va){Wr.set(va,Gr(ua,te,le,va,L,_t))});var Nl=lt,Mo=$n?void 0:Nl(L);return Yr(Mo||L,function(ua,va){Mo&&(va=ua,ua=L[va]),nt(Wr,va,Gr(ua,te,le,va,L,_t))}),Wr}function dn(L,te,le,Ve,pt){var _t=-1,Wr=L.length;for(le||(le=Ke),pt||(pt=[]);++_t<Wr;){var $n=L[_t];le($n)?Vr(pt,$n):pt[pt.length]=$n}return pt}function Kn(L,te){te=kn(te,L);for(var le=0,Ve=te.length;L!=null&&le<Ve;)L=L[Yi(te[le++])];return le&&le==Ve?L:void 0}function Vn(L,te,le){var Ve=te(L);return Ti(L)?Ve:Vr(Ve,le(L))}function vn(L){return L==null?L===void 0?ae:R:Nt&&Nt in Object(L)?Br(L):jr(L)}function Or(L){return Vi(L)&&vn(L)==d}function qn(L){return Vi(L)&&de(L)==F}function Mn(L){if(!la(L)||gr(L))return!1;var te=hs(L)?D:jt;return te.test(hi(L))}function _n(L){return Vi(L)&&de(L)==q}function Ri(L){return Vi(L)&&ps(L.length)&&!!St[vn(L)]}function wi(L){if(!la(L))return Fr(L);var te=Ar(L),le=[];for(var Ve in L)Ve=="constructor"&&(te||!tt.call(L,Ve))||le.push(Ve);return le}var bi=or?function(L,te){return or(L,"toString",{configurable:!0,enumerable:!1,value:Bt(te),writable:!0})}:Kt;function Nn(L,te,le){var Ve=-1,pt=L.length;te<0&&(te=-te>pt?0:pt+te),le=le>pt?pt:le,le<0&&(le+=pt),pt=te>le?0:le-te>>>0,te>>>=0;for(var _t=Array(pt);++Ve<pt;)_t[Ve]=L[Ve+te];return _t}function ki(L){if(typeof L=="string")return L;if(Ti(L))return Zr(L,ki)+"";if(Q(L))return Cn?Cn.call(L):"";var te=L+"";return te=="0"&&1/L==-1/0?"-0":te}function zn(L,te){te=kn(te,L);var le=-1,Ve=te.length;if(!Ve)return!0;for(;++le<Ve;){var pt=Yi(te[le]);if(pt==="__proto__"&&!tt.call(L,"__proto__")||(pt==="constructor"||pt==="prototype")&&le<Ve-1)return!1}var _t=Wi(L,te);return _t==null||delete _t[Yi(Va(te))]}function kn(L,te){return Ti(L)?L:yt(L,te)?[L]:Wn(ve(L))}function Zn(L,te){return L.slice()}function lr(L){var te=new L.constructor(L.byteLength);return new ue(te).set(new ue(L)),te}function Dn(L,te){var le=lr(L.buffer);return new L.constructor(le,L.byteOffset,L.byteLength)}function Ci(L){var te=new L.constructor(L.source,Dr.exec(L));return te.lastIndex=L.lastIndex,te}function I(L){return xr?Object(xr.call(L)):{}}function $(L,te){var le=lr(L.buffer);return new L.constructor(le,L.byteOffset,L.length)}function se(L,te,le,Ve){var pt=!le;le||(le={});for(var _t=-1,Wr=te.length;++_t<Wr;){var $n=te[_t],oi=void 0;oi===void 0&&(oi=L[$n]),pt?yr(le,$n,oi):nt(le,$n,oi)}return le}function Ce(L){return _(L)?void 0:L}function ht(L){return sa(yn(L,void 0,Ua),L+"")}function lt(L){return Vn(L,Te,Z)}function Ht(L,te){var le=L.__data__;return Ot(te)?le[typeof te=="string"?"string":"hash"]:le.map}function Ut(L,te){var le=Tr(L,te);return Mn(le)?le:void 0}function Br(L){var te=tt.call(L,Nt),le=L[Nt];try{L[Nt]=void 0;var Ve=!0}catch{}var pt=Xr.call(L);return Ve&&(te?L[Nt]=le:delete L[Nt]),pt}var M=Lt?function(L){return L==null?[]:(L=Object(L),kr(Lt(L),function(te){return We.call(L,te)}))}:qt,Z=Lt?function(L){for(var te=[];L;)Vr(te,M(L)),L=Fe(L);return te}:qt,de=vn;(Ye&&de(new Ye(new ArrayBuffer(1)))!=ye||xt&&de(new xt)!=F||ft&&de(ft.resolve())!=G||Rt&&de(new Rt)!=q||Et&&de(new Et)!=oe)&&(de=function(L){var te=vn(L),le=te==B?L.constructor:void 0,Ve=le?hi(le):"";if(Ve)switch(Ve){case tr:return ye;case fr:return F;case $t:return G;case Bn:return q;case Pn:return oe}return te});function we(L){var te=L.length,le=new L.constructor(te);return te&&typeof L[0]=="string"&&tt.call(L,"index")&&(le.index=L.index,le.input=L.input),le}function Me(L,te,le){var Ve=L.constructor;switch(te){case he:return lr(L);case v:case y:return new Ve(+L);case ye:return Dn(L);case Ue:case Re:case Oe:case ee:case re:case fe:case Be:case ke:case $e:return $(L);case F:return new Ve;case E:case Y:return new Ve(L);case ie:return Ci(L);case q:return new Ve;case J:return I(L)}}function Ke(L){return Ti(L)||ds(L)||!!(Dt&&L&&L[Dt])}function Je(L,te){var le=typeof L;return te=te??f,!!te&&(le=="number"||le!="symbol"&&ar.test(L))&&L>-1&&L%1==0&&L<te}function yt(L,te){if(Ti(L))return!1;var le=typeof L;return le=="number"||le=="symbol"||le=="boolean"||L==null||Q(L)?!0:qe.test(L)||!Ge.test(L)||te!=null&&L in Object(te)}function Ot(L){var te=typeof L;return te=="string"||te=="number"||te=="symbol"||te=="boolean"?L!=="__proto__":L===null}function gr(L){return!!Nr&&Nr in L}function Ar(L){var te=L&&L.constructor,le=typeof te=="function"&&te.prototype||zt;return L===le}function ur(L){var te=oa(L,function(Ve){return le.size===a&&le.clear(),Ve}),le=te.cache;return te}function Fr(L){var te=[];if(L!=null)for(var le in Object(L))te.push(le);return te}function jr(L){return Xr.call(L)}function yn(L,te,le){return te=Ie(te===void 0?L.length-1:te,0),function(){for(var Ve=arguments,pt=-1,_t=Ie(Ve.length-te,0),Wr=Array(_t);++pt<_t;)Wr[pt]=Ve[te+pt];pt=-1;for(var $n=Array(te+1);++pt<te;)$n[pt]=Ve[pt];return $n[te]=le(Wr),ir(L,this,$n)}}function Wi(L,te){return te.length<2?L:Kn(L,Nn(te,0,-1))}var sa=Qi(bi);function Qi(L){var te=0,le=0;return function(){var Ve=Qe(),pt=c-(Ve-le);if(le=Ve,pt>0){if(++te>=u)return arguments[0]}else te=0;return L.apply(void 0,arguments)}}var Wn=ur(function(L){var te=[];return L.charCodeAt(0)===46&&te.push(""),L.replace(je,function(le,Ve,pt,_t){te.push(pt?_t.replace(rr,"$1"):Ve||le)}),te});function Yi(L){if(typeof L=="string"||Q(L))return L;var te=L+"";return te=="0"&&1/L==-1/0?"-0":te}function hi(L){if(L!=null){try{return Er.call(L)}catch{}try{return L+""}catch{}}return""}function Ua(L){var te=L==null?0:L.length;return te?dn(L):[]}function Va(L){var te=L==null?0:L.length;return te?L[te-1]:void 0}function oa(L,te){if(typeof L!="function"||te!=null&&typeof te!="function")throw new TypeError(n);var le=function(){var Ve=arguments,pt=te?te.apply(this,Ve):Ve[0],_t=le.cache;if(_t.has(pt))return _t.get(pt);var Wr=L.apply(this,Ve);return le.cache=_t.set(pt,Wr)||_t,Wr};return le.cache=new(oa.Cache||rn),le}oa.Cache=rn;function cs(L,te){return L===te||L!==L&&te!==te}var ds=Or((function(){return arguments})())?Or:function(L){return Vi(L)&&tt.call(L,"callee")&&!We.call(L,"callee")},Ti=Array.isArray;function za(L){return L!=null&&ps(L.length)&&!hs(L)}var fs=K||qr;function hs(L){if(!la(L))return!1;var te=vn(L);return te==C||te==S||te==g||te==j}function ps(L){return typeof L=="number"&&L>-1&&L%1==0&&L<=f}function la(L){var te=typeof L;return L!=null&&(te=="object"||te=="function")}function Vi(L){return L!=null&&typeof L=="object"}var T=Cr?gn(Cr):qn;function _(L){if(!Vi(L)||vn(L)!=B)return!1;var te=Fe(L);if(te===null)return!0;var le=tt.call(te,"constructor")&&te.constructor;return typeof le=="function"&&le instanceof le&&Er.call(le)==Ee}var V=sn?gn(sn):_n;function Q(L){return typeof L=="symbol"||Vi(L)&&vn(L)==J}var Ae=_r?gn(_r):Ri;function ve(L){return L==null?"":ki(L)}function Te(L){return za(L)?ut(L):wi(L)}var He=ht(function(L,te){var le={};if(L==null)return le;var Ve=!1;te=Zr(te,function(_t){return _t=kn(_t,L),Ve||(Ve=_t.length>1),_t}),se(L,lt(L),le),Ve&&(le=Gr(le,s|o|l,Ce));for(var pt=te.length;pt--;)zn(le,te[pt]);return le});function Bt(L){return function(){return L}}function Kt(L){return L}function qt(){return[]}function qr(){return!1}r.exports=He})(Ud,Ud.exports)),Ud.exports}var nV=rV();const iV=Ns(nV);function gA(r,e){function t(n){if(typeof n>"u"||!Array.isArray(n)&&!sV(n))return n;if(Array.isArray(n))return gA(n,e);let i={};for(const[a,s]of Object.entries(n))i[a]=aV(s)?s:gA(s,e);return iV(i,e)}return Array.isArray(r)?r.map(t):t(r)}function aV(r){return r==null}function sV(r){return typeof r=="object"&&!Array.isArray(r)&&r!==null}function RE(r,e){return r==null&&e==null?!0:r===e}function MI(r){const e=new Map;return r?.aspects?.forEach(t=>{t.value!==""&&e.set(t.name,!0)}),e}class oV extends Gg{constructor(e){super(),this.update=e}async execute(){await this.update(),await new Promise(e=>{window.setTimeout(()=>{e()},1e3)})}}function Ov(r){return gA(r,["__typename"])}class lV{constructor(e,t,n,i,a){this.stateUpdateQueue=new jg(1),this.mandatoryFulfilledAspects=new Map,this.bundleId=e,this.bundleOwnerId=t,this.configuration=n,this.bundleOptions=a;const s=a?.existingGlobalPropertyState;this.initPromise=s?Promise.resolve(s).then(()=>{console.log("Setting global property state to existing state."),this.globalPropertyState=Ov(s),this.recalculateMandatoryStates()}):this.createGlobalPropertyState().then(o=>{console.log("Setting global property state to new state."),this.globalPropertyState=Ov(o),this.recalculateMandatoryStates()}),this.onGlobalPropertyStateChange=i}async clearAspects(e){if(!this.globalPropertyState)throw new Error("Global property state not initialized");const t=this.globalPropertyState.aspects;this.globalPropertyState.aspects=t.filter(n=>!e.includes(n.name))}recalculateMandatoryStates(){this.mandatoryFulfilledAspects=MI(this.globalPropertyState)}setBundleOptions(e){this.bundleOptions=e}getBundleOptions(){return this.bundleOptions}setConfiguration(e){this.configuration=e}getInitializationPromise(){return this.initPromise}getGlobalPropertyState(){return this.globalPropertyState}async setGlobalPropertyState(e){this.globalPropertyState||await this.initPromise;const t=mo(this.globalPropertyState);this.globalPropertyState={...Ov(e),id:t.id},this.recalculateMandatoryStates(),this.queueGlobalPropertyStateUpdate(),await this.onGlobalPropertyStateChange(t,this.globalPropertyState)}getAspectMandatoryFulfilled(e){return this.mandatoryFulfilledAspects.get(e)}getAspectHidden(e){if(!this.globalPropertyState)throw new Error("Global property state not initialized");return!!this.globalPropertyState.aspects.find(t=>t.name===e)?.hidden}getAspect(e,t){if(!this.globalPropertyState)throw new Error("Global property state not initialized");const n=this.globalPropertyState.aspects.find(i=>i.name===e&&RE(i.channel,t));if(n)return n.value}getAspectStorage(e,t){if(!this.globalPropertyState)throw new Error("Global property state not initialized");return this.globalPropertyState.aspects.find(n=>n.name===e&&RE(n.channel,t))?.storage}async setAspect(e,t,n,i,a){if(!this.globalPropertyState)throw new Error("Global property state not initialized");if(!this.configuration)throw new Error("Global property configuration not linked to the state manager.");const s=this.configuration.aspects.find(u=>u.name===e);if(!s)throw new Error(`Failed to find configuration aspect with name: ${e}`);this.mandatoryFulfilledAspects.set(e,t!=="");const o=mo(this.globalPropertyState),l=this.globalPropertyState.aspects.filter(u=>u.name===e);if(l.length>0)if(i){const u=l.find(c=>c.channel===i);if(u)u.value=t,u.type=s.type,u.channel=i,u.hidden=a??u.hidden,n!==void 0&&(u.storage=n!==null?n:void 0);else{let c;if(i===1){const f=this.globalPropertyState.aspects.findIndex(d=>!d.channel&&d.name===e);f&&f>0&&(c=this.globalPropertyState.aspects.splice(f,1)[0].hidden)}this.globalPropertyState.aspects.push({name:e,value:t,type:s.type,storage:n!==null?n:void 0,channel:i,hidden:a??c})}}else{const u=l[0];u.value=t,u.type=s.type,u.hidden=a??u.hidden,n!==void 0&&(u.storage=n!==null?n:void 0)}else this.globalPropertyState.aspects.push({name:e,value:t,type:s.type,storage:n!==null?n:void 0,channel:i,hidden:a});vf(o,this.globalPropertyState)||(this.queueGlobalPropertyStateUpdate(),await this.onGlobalPropertyStateChange(o,this.globalPropertyState))}async setAspectStorage(e,t,n){if(!this.globalPropertyState)throw new Error("Global property state not initialized");if(!this.configuration)throw new Error("Global property configuration not linked to the state manager.");const i=this.configuration.aspects.find(o=>o.name===e);if(!i)throw new Error(`Failed to find configuration aspect with name: ${e}`);const a=mo(this.globalPropertyState),s=this.globalPropertyState.aspects.filter(o=>o.name===e);if(s.length>0)if(n){const o=s.find(l=>l.channel===n);o&&(o.storage=t!==null?t:void 0,o.type=i.type)}else{const o=s[0];o.storage=t!==null?t:void 0,o.type=i.type}else this.globalPropertyState.aspects.push({name:e,value:"",type:i.type,storage:t!==null?t:void 0,channel:n});vf(a,this.globalPropertyState)||(this.queueGlobalPropertyStateUpdate(),await this.onGlobalPropertyStateChange(a,this.globalPropertyState))}queueGlobalPropertyStateUpdate(){this.stateUpdateQueue.enqueue(new oV(async()=>{await this.updateGlobalPropertyState()}))}async updateGlobalPropertyState(){if(!this.globalPropertyState)throw new Error("Global property state not initialized");if(!(await ze.getShadowGraphqlClient().mutate({mutation:JU,variables:{id:this.globalPropertyState.id,aspects:this.globalPropertyState.aspects.map(t=>{let n=t.type&&t.storage?{}:void 0;if(n)switch(t.type){case Hn.FileUpload:{n.fileUpload=t.storage;break}case Hn.ColorOption:case Hn.Option:{n.option=t.storage;break}}return{name:t.name,value:t.value,type:t.type,storage:n,channel:t.channel,hidden:t.hidden}})},context:{headers:{bundleOwnerId:this.bundleOwnerId,...this.bundleOptions?.additionalHeaders}}})).data?.globalPropertyStateUpdate)throw new Error("Unable to update global property state")}async createGlobalPropertyState(){const e=await ze.getShadowGraphqlClient().mutate({mutation:XU,variables:{bundleId:this.bundleId},context:{headers:{bundleOwnerId:this.bundleOwnerId,...this.bundleOptions?.additionalHeaders}}});if(e.data?.globalPropertyStateCreate&&e.data.globalPropertyStateCreate.id)return e.data.globalPropertyStateCreate;throw new Error(`Unable to create global property state for bundle: ${this.bundleId}`)}}class uV{constructor(e){this.setState(e||'{"transactions": []}')}setState(e){e&&(this.state=JSON.parse(e))}getState(){return this.state}removeStateForTransaction(e){if(!this.state||!this.state.transactions)return;const t=this.state.transactions.findIndex(n=>n.transactionId===e);t!==-1&&this.state.transactions.splice(t,1)}getSerializedState(){if(this.state)return this.deleteFieldNameFromObjectRecursive(this.state,"__typename"),JSON.stringify(this.state)}deleteFieldNameFromObjectRecursive(e,t){if(!(typeof e!="object"||e===null))for(const n in e)n===t?delete e[n]:this.deleteFieldNameFromObjectRecursive(e[n],t)}}const cV=Se`
2834
+ `;var yg=(r=>(r.PriceBreakChanged="PriceBreakChanged",r.ProductChanged="ProductChanged",r.QuantityChanged="QuantityChanged",r.RecipientChanged="RecipientChanged",r.SelectionChanged="SelectionChanged",r.WorkflowConfigurationChanged="WorkflowConfigurationChanged",r))(yg||{});class M1{constructor(e,t){this.cachedStepHandles=new Map,this.profanityList=[],this.currentPriceBreak=1,this.renderableScenes=[],this.renderableSceneCallbacks=[],this.eventCallbacks=new Map,this.debouncedSavedDesignUpdate=DI(async()=>{await Qp.getSavedDesignByTransaction(this.getTransaction().id)&&this.save()},2500),this.getCanvasObjectURLAsync=async n=>new Promise((i,a)=>{try{n.toBlob(s=>{if(s){const o=URL.createObjectURL(s);i(o)}})}catch(s){a(s)}}),this.client=e,this.transaction=t.transaction,this.workflow=t.workflow,this.profanityList=this.transaction.product?.profanities?.map(n=>n.word)||[],this.isReadOnly=t.transaction.isOrdered||!!t.readOnly,this.graphQlClient=t.graphQlClient,this.workflowManager=new fA(this,e,n=>{try{this.debouncedSavedDesignUpdate()}catch{console.error("Failed to update saved design details.")}return t.stateMutationFunc(n)},t.graphQlClient,t.reloadedState,t.readOnly,t.modelContainer,t.isReloadedTransaction,t.singleVariantsRenderable,t.delayWorkflowStateSync),this.workflowManager.addSelectionCallback(n=>{const i=n.traversableScenes.map(a=>{const s=a.renderableSteps.map(o=>o.stepName);return{id:a.name,title:a.title,renderableSteps:s,workflowScene:a}});this.renderableScenes=i,this.renderableSceneCallbacks.forEach(a=>a(i)),this.callEvent("SelectionChanged")}),this.currentPriceBreak=this.priceBreakToBeApplied()}getTransaction(){return this.transaction}getProduct(){return this.transaction.product}getProfanityList(){return this.profanityList}async setProduct(e){this.workflow=void 0;const t=await this.graphQlClient().mutate({mutation:PE,variables:{id:this.getTransaction().id,integrationProductId:e}}),n=t.data?.transactionUpdateIntegrationProduct.product;if(!n)throw new nn("Failed to set product. No product returned from server.");if(!this.bundle)throw new nn("Cannot set product on experience that is not part of a bundle.");this.transaction.product={...this.transaction.product,...t.data?.transactionUpdateIntegrationProduct.product},this.transaction.integrationProduct={...this.transaction.integrationProduct,...t.data?.transactionUpdateIntegrationProduct.integrationProduct},this.transaction.workflowState=void 0,this.currentPriceBreak=this.priceBreakToBeApplied(),this.callEvent("ProductChanged");const i=(await this.bundle.getProductCollection().fetchProducts()).find(a=>a.getId()===n.id);try{const a=i?.getDefaultWorkflow();if(a){const s=await VP(a.getId());await this.setWorkflow(s),console.log("Setting Product - Workflow set to default for product.")}}catch{console.log("Setting Product - No default workflow available, must be set manually.")}}async clearProduct(){if(!this.bundle)throw new nn("Cannot clear product on experience that is not part of a bundle.");this.workflow=void 0,this.transaction.workflowState=void 0,this.transaction.product=void 0,this.transaction.integrationProduct=void 0,this.currentPriceBreak=this.priceBreakToBeApplied(),this.callEvent("ProductChanged"),await this.graphQlClient().mutate({mutation:PE,variables:{id:this.getTransaction().id}})}getWorkflow(){return this.workflow}async setWorkflow(e){return this.workflow=e,await this.graphQlClient().mutate({mutation:_3,variables:{id:this.getTransaction().id,workflowId:e.id}}),this.workflowManager.setWorkflow(e)}async updateWorkflowConfiguration(e){if(!this.workflow)throw new Error("No workflow set");e.steps&&this.cachedStepHandles.clear();const t=this.applyWorkflowChanges(this.workflow,e);await this.workflowManager.updateWorkflowConfiguration(e),this.workflow=t,this.callEvent("WorkflowConfigurationChanged")}applyWorkflowChanges(e,t){let n={...e};if(t.panels){let i=[...e.panels];if(t.panels.removed&&(i=i.filter(a=>!t.panels.removed.includes(a.name))),t.panels.changed)for(const a of t.panels.changed){const s=i.findIndex(o=>o.name===a.name);s>=0&&(i[s]=a)}if(t.panels.added)for(const{item:a,index:s}of t.panels.added)i.splice(s,0,a);n.panels=i}if(t.steps){let i=[...e.steps];if(t.steps.removed&&(i=i.filter(a=>!t.steps.removed.includes(a.stepName))),t.steps.changed)for(const a of t.steps.changed){const s=i.findIndex(o=>o.stepName===a.stepName);s>=0&&(i[s]=a)}if(t.steps.added)for(const{item:a,index:s}of t.steps.added)i.splice(s,0,a);n.steps=i}if(t.stepGroups){let i=[...e.stepGroups];if(t.stepGroups.removed&&(i=i.filter(a=>{const s=a.id||a.name;return!t.stepGroups.removed.includes(s)})),t.stepGroups.changed)for(const a of t.stepGroups.changed){const s=a.id||a.name,o=i.findIndex(l=>(l.id||l.name)===s);o>=0&&(i[o]=a)}if(t.stepGroups.added)for(const{item:a,index:s}of t.stepGroups.added)i.splice(s,0,a);n.stepGroups=i}return n}async attachAddress(e,t,n,i,a,s){await this.graphQlClient().mutate({mutation:X9,variables:{transactionId:this.getTransaction().id,streetAddress:e||void 0,apartment:t||void 0,city:n||void 0,country:i||void 0,state:a||void 0,postCode:s||void 0}})}async attachOrganization(e){await this.graphQlClient().mutate({mutation:J9,variables:{transactionId:this.getTransaction().id,organizationName:e}})}getBundle(){return this.bundle}setBundle(e){this.bundle=e}getClient(){return this.client}getIsReadOnly(){return this.isReadOnly}getCommandContext(){return this.workflowManager.getCommandContext()}getWorkflowManager(){return this.workflowManager}async createPreviewImage(e,t){const n=this.getWorkflow(),i=n?.finalizeStepConfig?.lookAtAnimation;if(!n)throw new Error("Failed to generate cart preview image! No workflow is set.");if(e){if(!i)throw new Error("Failed to generate cart preview image! No camera orientation configured.");return await this.workflowManager.getPreviewService()?.renderSceneScreenshot(t??512,i)||""}let a=2048;t&&t<=2048&&(a=t);const s=Eo(a,a),o=this.workflowManager.getCommandContext().getAllLayouts(),l=n.defaultPreviewPanelIndex||0,u=n.panels[l],c=o.find(S=>S.layoutState?.layout.panelId===u?.name)||o[0],f=c.layoutState.layout.previewRegion?{x:c.layoutState.layout.previewRegion.left,y:c.layoutState.layout.previewRegion.top,width:c.layoutState.layout.previewRegion.width,height:c.layoutState.layout.previewRegion.height}:{x:0,y:0,width:c.layoutState.layout.width,height:c.layoutState.layout.height},d=this.workflowManager.getCommandContext().getLayoutById(c.layoutState.layout.id),h=s.getContext("2d");if(!h)throw new _g("Failed to obtain 2D context for preview image creation");const g=this.workflowManager.getTemplatingContext(),v=Qg(d.layoutState.layout,d.layoutState.elements,{renderingConfiguration:{purpose:Ku.Print,region:{left:f.x,top:f.y,width:f.width,height:f.height},templatingContext:g}}),y=Qk(v);await(await uo.from(h,y,{anonymousCrossOrigin:!0,ignoreDimensions:!1,createCanvas:Eo,createImage:Mf,DOMParser:YA(),fetch})).render();const C=await this.getCanvasObjectURLAsync(s);return s.toDataURL(C)}getStepById(e){const t=this.getWorkflow()?.steps.find(a=>a.stepName===e);if(!t||!this.stepHasHandle(t))return;const n=this.cachedStepHandles.get(t.stepName);if(n)return n;const i=Ep.get(this.getWorkflowManager(),t);return this.cachedStepHandles.set(t.stepName,i),i}getSteps(){return this.getScenes().flatMap(e=>this.getStepsByScene(e))}async getStepsConditionallyActive(){const e=this.getScenes();return(await Promise.all(e.map(async n=>{const i=this.getStepsByScene(n),a=await Promise.all(i.map(s=>co(s.getRaw(),this.getWorkflowManager().getStepSelections())));return i.filter((s,o)=>a[o])}))).flat()}getScenes(){return(this.getWorkflow()?.stepGroups||[]).map(t=>({id:t.id,name:t.name,stepIds:t.stepNames}))}getSelectionPriceSubunits(e){const t=this.getWorkflowManager().getWorkflowSelections();let n=0;return Object.values(t).forEach(i=>{n+=i.selections.reduce((a,s)=>a+(s.priceModifier||0),0)}),this.getPriceSubUnitsAfterPriceBreaks(n,e)}getBasePriceSubunits(e,t){const n=this.getPriceSubUnitsAfterPriceBreaks(this.getProduct()?.basePrice||0,t);if(e){const i=this.getAdditionalProductPriceSubunits(t)||0;return n+i}return n}getAdditionalProductPriceSubunits(e){const t=this.getTransaction().integrationProduct;if(t?.additionalIntegrationProduct?.product){const n=t.additionalIntegrationProduct.product.basePrice||0;return this.getPriceSubUnitsAfterPriceBreaks(n,e)}}getTotalPriceSubunits(e){return this.getBasePriceSubunits(!1,e)+this.getSelectionPriceSubunits(e)}getPriceSubUnitsAfterPriceBreaks(e,t){const n=t?1:this.priceBreakToBeApplied(),i=e*n;return Math.ceil(i)}priceBreakToBeApplied(){const e=(this.getProduct()?.priceBreaks||[]).sort((i,a)=>-(i.minQty-a.minQty)),n=[...this.getMatchingExperiencesFromBundle(),this].reduce((i,a)=>i+a.getQuantity(),0);for(const i of e)if(i.minQty<=n)return i.percentage;return 1}checkForPriceBreakChanges(){const e=this.priceBreakToBeApplied();this.currentPriceBreak!==e&&(this.updatePriceBreak(e),this.getMatchingExperiencesFromBundle().forEach(t=>t.updatePriceBreak(e)))}getMatchingExperiencesFromBundle(){return(this.bundle?.getWorkflowExperiences()||[]).filter(e=>{const t=e.getTransaction().id,n=this.getTransaction().id,i=e.getProduct()?.id,a=this.getProduct()?.id;return t!==n&&i===a})}updatePriceBreak(e){this.currentPriceBreak=e,this.callEvent("PriceBreakChanged")}async copySelectionsViaGlobalConfiguration(e,t,n){const i=await e.getGlobalProperties(),a=n?.map(u=>u.getId()),s=this.getSteps().filter(u=>a===void 0||a.includes(u.getId())),o=t.getSteps(),l=u=>i.find(c=>c.getRawProperty().name===u.aspectName);s.forEach(u=>{const c=new Set,f=u.getRaw().globalPropertyAspectConfigurations;f!==void 0&&(f.forEach(d=>c.add(JSON.stringify(d))),o.forEach(d=>{const h=d.getRaw().globalPropertyAspectConfigurations;h!==void 0&&h.forEach(g=>{const v=l(g),y=c.has(JSON.stringify(g));if(y&&v?.getType()==="Option"){const A=d.getCurrentVariant();if(!A)return;u.selectVariant(A),c.delete(JSON.stringify(g))}else if(y&&v?.getType()==="Text"){const A=d.getText();u.setText(A),c.delete(JSON.stringify(g))}})}))})}getStepByName(e){const t=this.getWorkflow()?.steps.find(n=>n.stepTitle===e);if(!(!t||!this.stepHasHandle(t)))return Ep.get(this.getWorkflowManager(),t)}getStepsByType(e){return this.getWorkflow()?.steps.filter(t=>t.type===e).map(t=>Ep.get(this.getWorkflowManager(),t))||[]}getStepsByScene(e){const t=this.getWorkflow();if(!t?.stepGroups.find(i=>i.name===e.name))throw new Error("Given scene is not present on workflow! Be careful when persisting scenes that you only use them with the relevant workflow.");return e.stepIds.map(i=>t.steps.find(a=>a.stepName===i)).filter(i=>!!i&&this.stepHasHandle(i)).map(i=>Ep.get(this.getWorkflowManager(),i))}async attachCustomerDetails(e){return this.assignCustomerDetails({emailAddress:e.email})}async assignCustomerDetails(e){const n=(await this.graphQlClient().mutate({mutation:Q9,variables:{id:this.getTransaction().id,details:e,type:"Owner"}})).data?.transactionAddStakeholder?.stakeholders?.find(i=>i.customer?.emailAddress===e.emailAddress);n?.customer&&this.assignCustomerInternal(n.customer)}assignCustomerInternal(e){this.getWorkflowManager().setTransactionCustomer(e);const t=br.getMap("transactionCustomerIds")||new Map;t.set(this.getTransaction().id,e.id),br.setMap("transactionCustomerIds",t)}attachRenderableSceneListener(e){this.renderableSceneCallbacks.push(e),e(this.renderableScenes)}detachRenderableSceneListener(e){this.renderableSceneCallbacks=this.renderableSceneCallbacks.filter(t=>t!==e)}async save(e){const t=this.getProduct(),n=this.getWorkflow(),i=this.getCommandContext().getState();if(!t)throw new nn("Product undefined!");if(!n)throw new nn("Workflow undefined!");if(!i)throw new nn("State undefined!");const s={title:await(async()=>{if(e)return e;const o=this.getTransaction().id,u=(await Qp.getSavedDesigns()).find(c=>c.transactionId===o)?.title;return u||"My design"})(),thumbnail:await this.createPreviewImage(!1,256),transactionId:this.getTransaction().id,productId:t.id,integrationProductId:this.getTransaction().integrationProduct.id,workflowName:n.name,workflowId:n.id,lastEdited:new Date};return await Qp.addDesign(s),s}async copy(){const e=mo(this.getCommandContext().getState());if(!e)throw new nn("Internal state is undefined! Cannot copy experience!");const t=JSON.stringify(e.transaction),n=this.getWorkflow();if(!n)throw new nn("Workflow is undefined! Cannot copy experience!");const i=this.getTransaction().integrationProduct?.id;if(!i)throw new nn("Integration product id is undefined!");return await this.getClient().getWorkflowExperience({type:"integration",integrationProductId:i,workflowId:n.id,workflowState:t})}async onDesignFinished(e=!0){const t=this.getTransaction(),n=this.getProduct(),i=this.getWorkflow();if(!n)throw new nn("Product undefined! Cannot finish an experience without a product.");if(!i)throw new nn("Workflow undefined! Cannot finish an experience without a workflow.");if(t.isOrdered)return{event:"",exportedData:{},lineItemImageUrl:"",optionsCost:0,transactionId:t.id,workflowViewerLink:"",workflowViewerReadOnlyLink:""};const a=await PI([{workflowManager:this.workflowManager,workflow:i,layouts:this.workflowManager.getLayouts(),getReducerState:()=>this.workflowManager.getCommandContext().getState(),product:n,transaction:t,workflowSelections:this.workflowManager.getWorkflowSelections(),workflowMetadata:this.workflowManager.getWorkflowMetadata(),designName:i.name}],s=>e?this.createPreviewImage(s,1024):Promise.resolve(void 0));return t.completed&&await this.graphQlClient().mutate({mutation:G3,variables:{transactionId:t.id}}),a[0]}stepHasHandle(e){return e.type!==Xe.SilentIllustration&&e.type!==Xe.ProductOverlay}async getExportedStepData(){const e=this.getWorkflow(),t=this.getWorkflowManager().getWorkflowMetadata(),n=this.getWorkflowManager().getWorkflowSelections(),i=[];for(const a of e?.steps||[]){const s=a.stepName,o=t[s],l=n[s]?.selections[0],u={stepId:s,title:a.stepTitle,properties:[]};if(l&&await Z9(a,n)&&u.properties.push({type:"selection",value:l.name,priceModifier:l.priceModifier}),!o){i.push(u);continue}switch(a.type){case Xe.Frame:{const c=a.data,f=o;f.image&&c.displayImageOnFinishStep&&u.properties.push({type:"image",value:f.image,priceModifier:0})}break;case Xe.Illustration:{const c=a.data,f=o;if(f&&f.colors&&f.colors.length>0&&c.displayColorsOnFinishStep){const d=f.colors.join(", ").toUpperCase();u.properties.push({type:"color",value:d,priceModifier:0})}}break;case Xe.Module:{const c=a.data,f=o;f&&f.text&&c.displayTextOnFinishStep&&u.properties.push({type:"text",value:f.text,priceModifier:0})}break;case Xe.Text:{const c=a.data,f=o;f&&f.text&&c.displayTextOnFinishStep&&u.properties.push({type:"text",value:f.text,priceModifier:0}),f&&f.color&&c.displayColorOnFinishStep&&u.properties.push({type:"color",value:f.color,priceModifier:0})}}i.push(u)}return i.filter(a=>a.properties&&a.properties.length>0)}getQuantity(){return this.getTransaction().quantity||1}async setQuantity(e){if(e<1)throw new RangeError("WorkflowExperience quantity must be greater than zero.");if(this.isReadOnly)throw new Error("Cannot update quantity on a read-only WorkflowExperience");this.getTransaction().quantity=e,this.callEvent("QuantityChanged"),this.checkForPriceBreakChanges();const t=this.getTransaction();await this.graphQlClient().mutate({mutation:M3,variables:{id:t.id,quantity:e}})}addEventListener(e,t){const n=this.eventCallbacks.get(e)||[];n.push(t),this.eventCallbacks.set(e,n)}removeEventListener(e,t){const n=this.eventCallbacks.get(e)||[];this.eventCallbacks.set(e,n.filter(i=>i!==t))}callEvent(e){(this.eventCallbacks.get(e)||[]).forEach(t=>t(this))}}const K9=r=>{if([Xe.Question,Xe.Frame,Xe.Illustration,Xe.Material,Xe.Model,Xe.Picture,Xe.Shape,Xe.Text].includes(r.type)){const t=r.data;return!!t.displaySelectionOnFinishStep||!!t.displaySelectionsOnFinishStep}return!1},Z9=async(r,e)=>{if(!K9(r))return!1;const t=await ct.getOptionForStep(r);if(t&&(t.variants||[]).length>1){const n=e[r.stepName];return!!(n&&n.selections.length>0)}return!1};class eV{constructor(e){this.handleCache={},this.bundle=e}async getHandle(e){if(this.handleCache[e.name])return this.handleCache[e.name];const t=await this.createHandle(e);return this.handleCache[e.name]=t,t}async getHandles(){if(!this.bundle.getGlobalPropertyConfiguration())return[];await this.bundle.getGlobalPropertyStateManager().getInitializationPromise();const e=this.bundle.getGlobalPropertyConfiguration();return e?Promise.all(e.aspects.map(t=>this.getHandle(t))):[]}applyConditionsFromState(e,t){return t?e.filter(n=>this.aspectConditionsSatisfied(n.getRawProperty(),t)):e}aspectConditionsSatisfied(e,t){return!e.conditions||e.conditions.length===0?!0:(e.conditionMode===Nk.AND?Array.prototype.every.bind(e.conditions):Array.prototype.some.bind(e.conditions))(i=>{const a=t.aspects.find(s=>s.name===i.targetAspectName);return a?i.requiredVariantSelections.some(s=>s===a.value):!1})}async createHandle(e){switch(e.type){case Hn.FileUpload:return new RI(this.bundle,e).initialize();case Hn.ColorOption:return new pA(this.bundle,e,e.entityId?await ct.getOption(e.entityId):void 0);case Hn.Option:{const t=e.entityId?await ct.getOption(e.entityId):void 0;return t?.type==="Color"?new pA(this.bundle,e,t):new _1(this.bundle,e,t)}case Hn.Text:return new OI(this.bundle,e);default:throw new Error("Unhandled Global Property Aspect Type")}}}class Jg{constructor(e,t){this.bundle=e,this.property=t}getName(){return this.property.name}getTitle(){return this.property.title}getDescription(){return this.property.description}getType(){return this.property.type}getRawProperty(){return this.property}isMandatory(){return!!this.property.mandatory}isMandatoryFulfilled(){return!this.property.mandatory||!!this.bundle.getGlobalPropertyStateManager().getAspectMandatoryFulfilled(this.property.name)}isSilent(){return!!this.property.silent||this.bundle.getGlobalPropertyStateManager().getAspectHidden(this.property.name)}async getSharedSteps(e){const t=e??this.bundle.getWorkflowExperiences();return(await Promise.all(t.map(a=>a.getStepsConditionallyActive()))).map(a=>a.filter(s=>s.getOverrideGlobalPropertyConfiguration(this.property.type)?!1:s.getRaw().globalPropertyAspectConfigurations?.some(o=>o.globalPropertyConfigurationId===this.bundle.getGlobalPropertyConfiguration()?.id&&o.aspectName===this.property.name))).flat()}getStateValue(){return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name)}}class RI extends Jg{constructor(e,t){super(e,t)}async initialize(){return this.property.data?.fileUpload?.colorOptionId&&(this.colorOption=await ct.getOption(this.property.data?.fileUpload?.colorOptionId)),await this.loadImageData(),this}async loadImageData(){const e=await this.getImage();if(e?.fileLink)if(e?.fileLink.endsWith(".svg")){const t=await ra(e?.fileLink),n=await S1(e?.fileLink),i=n.width,a=n.height,s=await Pa(t);this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.colors?.forEach(u=>{s.colors[u.key]={browserValue:u.browserValue,pmsValue:u.pmsValue}});const l={src:e?.fileLink,width:i,height:a,aspect:i/a,svg:s.svg,colors:s.colors};Ds.set(e?.fileLink,l),this.imageData=l}else this.imageData=void 0}async selectImage(e){const t=this.bundle.getGlobalPropertyStateManager();await Promise.all([t.setAspect(this.property.name,e.key,{...t.getAspectStorage(this.property.name)||{},originalAssetKey:e.key,backgroundRemovedAssetKey:void 0,vectorizedAssetKey:void 0,useOriginalAsset:void 0},void 0),this.applyImageSelection(e),this.loadImageData()])}async canUseAdvancedImageManipulation(){return this.bundle.getClient().canUseAddon(Bg.AdvancedImageManipulation)}async removeBackgroundFromImage(e=!0){if(!await this.canUseAdvancedImageManipulation())throw new Error("The current Integration does not have access to the Advanced Image Manipulation addon. Please call canUseAdvancedImageManipulation to ensure you disable this feature when appropriate.");const t=await this.getOriginalImage();if(!t)throw new Error("You must supply an image selection before attempting to remove the background.");const n=this.bundle.getGlobalPropertyStateManager(),i=await Ln.removeBackgroundFromAsset(t),s={...n.getAspectStorage(this.property.name),backgroundRemovedAssetKey:i.key,useOriginalAsset:!e},l=[e?n.setAspect(this.property.name,i.key,s):n.setAspectStorage(this.property.name,s)];return e&&(l.push(this.applyImageSelection(i,void 0,!1,!1)),l.push(this.loadImageData())),await Promise.all(l),this.updateSharedStepStorage(s),i}async vectorizeImage(e=!0){if(!await this.canUseAdvancedImageManipulation())throw new Error("The current Integration does not have access to the Advanced Image Manipulation addon. Please call canUseAdvancedImageManipulation to ensure you disable this feature when appropriate.");const t=await this.getOriginalImage();if(!t)throw new Error("You must supply an image selection before attempting to vectorize the image.");const n=this.bundle.getGlobalPropertyStateManager(),i=await Ln.vectorizeAsset(t),s={...n.getAspectStorage(this.property.name),vectorizedAssetKey:i.key,useOriginalAsset:!e},l=[e?n.setAspect(this.property.name,i.key,s):n.setAspectStorage(this.property.name,s)];return e&&(l.push(this.applyImageSelection(i,void 0,!1,!1)),l.push(this.loadImageData())),await Promise.all(l),this.updateSharedStepStorage(s),i}hasImage(){return!!this.getStateValue()}async getImage(){const e=this.getStateValue();if(e)return Ln.getLocalOrFromServer(e)}async getImageWithColors(){return await this.loadImageData(),this.imageData?.svg?Ug(zg(this.imageData.svg,this.imageData.colors??{},!1)):this.imageData?.src}async getOriginalImage(){const e=this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);if(e?.originalAssetKey)return Ln.getLocalOrFromServer(e.originalAssetKey)}async getBackgroundRemovedImage(){const e=this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);if(e?.backgroundRemovedAssetKey)return Ln.getLocalOrFromServer(e.backgroundRemovedAssetKey)}getUseOriginalImage(){return this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.useOriginalAsset??!1}async setUseOriginalImage(e){const t=await this.getOriginalImage();if(!t)throw new Error("You must select an image before calling setUseOriginalImage");const n=this.bundle.getGlobalPropertyStateManager(),i=n.getAspectStorage(this.property.name);if(i?.useOriginalAsset===e)return;const a={...i,useOriginalAsset:e},s=e?i?.originalAssetKey:i?.backgroundRemovedAssetKey,o=[n.setAspect(this.property.name,s||"",a)];if(e)o.push(this.applyImageSelection(t,void 0,!1,!1));else{const l=async()=>{const u=await this.getBackgroundRemovedImage();if(!u)throw new Error("You must call removeBackgroundFromImage before attempting to use that version of the image.");this.applyImageSelection(u,void 0,!1,!1)};o.push(l())}o.push(this.loadImageData()),await Promise.all(o),this.updateSharedStepStorage(a)}async applyGlobalState(e){const t=this.getStateValue();if(!t)return;const n=await Ln.getLocalOrFromServer(t);if(!n)return;await this.applyImageSelection(n,e,!1,!0);const i=this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);if(i){if(this.updateSharedStepStorage({...i}),i.colors){const a=new Map(i.colors.map(s=>[s.key,{browserValue:s.browserValue,pmsValue:s.pmsValue}])??[]);await Promise.all((await this.getSharedSteps(e)).map(async s=>{await s.changeColors(a)}))}}else this.updateSharedStepStorage({originalAssetKey:t}),await this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name,{originalAssetKey:t})}getAvailableColors(){return this.property.data?.fileUpload?.colorPickerEnabled?this.colorOption?.variants?.map(e=>({fill:e.color,stroke:e.color,variant:e,pmsValue:e.name}))??[]:[]}getCurrentColors(){return this.imageData?.colors}isColorPickerEnabled(){return this.property.data?.fileUpload?.colorPickerEnabled??!1}isPmsPickerEnabled(){return this.property.data?.fileUpload?.pmsPickerEnabled??!1}async getOriginalColors(){return this.imageData?.svg?(await Pa(this.imageData.svg)).colors:void 0}async changeColors(e){if(!this.imageData?.svg)return;const t=this.getSharedSteps(),n=new Map(Object.entries(e));await Promise.all((await t).map(async a=>{await a.changeColors(n)}));const i=this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);await Promise.all([this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name,{...i,colors:Object.entries(e).map(([a,s])=>({key:a,browserValue:s.browserValue,pmsValue:s.pmsValue}))}),await this.loadImageData()])}async applyImageSelection(e,t,n=!0,i=!0){const s=(await this.getSharedSteps(t)).map(o=>{const l=o;if(l.getFrameService())return l.selectImage(e,n,i)});await Promise.all(s)}updateSharedStepStorage(e){this.bundle.getWorkflowExperiences().forEach(n=>n.getSteps().forEach(i=>{if(i.getOverrideGlobalPropertyConfiguration(this.property.type))return;i.getRaw().globalPropertyAspectConfigurations?.some(s=>s.globalPropertyConfigurationId===this.bundle.getGlobalPropertyConfiguration()?.id&&s.aspectName===this.property.name)&&n.getWorkflowManager().updateStorage(i.getId(),{framePatternData:{originalAssetKey:e.originalAssetKey,backgroundRemovedAssetKey:e.backgroundRemovedAssetKey,useOriginalAsset:e.useOriginalAsset}})}))}}class OI extends Jg{constructor(e,t){super(e,t)}isTemplatingEnabled(){return this.property.data?.text?.templatingEnabled||!1}getText(){const e=this.getStateValue();return e||""}async setText(e){await Promise.all([this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name,e,void 0,void 0),this.applyTextSelection(e)])}async applyGlobalState(e){const t=this.getStateValue();if(!t)return Promise.resolve();await this.applyTextSelection(t,e)}async applyTextSelection(e,t){const i=(await this.getSharedSteps(t)).map(a=>{a.setText(e)});await Promise.all(i)}}class _1 extends Jg{constructor(e,t,n){super(e,t),this.optionResource=n}async ensureOptionLoaded(){if(this.optionResource?.variants)return this.optionResource;if(!this.property.entityId)return this.optionResource;const e=await ct.getOption(this.property.entityId);return e&&(this.optionResource=e),this.optionResource}async initDefaultVariant(){await this.ensureOptionLoaded();const e=this.optionResource?.variants?.find(t=>t.id===this.optionResource?.defaultVariant?.id);e&&await this.selectVariant(new Fa(e))}getCurrentVariant(){if(!this.optionResource)return;const e=this.getStateValue();if(e){const t=this.optionResource.variants?.find(n=>n.id===e);return t?new Fa(t):void 0}else{const t=this.optionResource.variants?.find(n=>n.id===this.optionResource?.defaultVariant?.id);return t?new Fa(t):void 0}}async getAvailableVariants(){return await this.ensureOptionLoaded(),(this.optionResource?.variants?.filter(t=>t.enabled)||[]).map(t=>new Fa(t))}async getAllVariants(){return await this.ensureOptionLoaded(),(this.optionResource?.variants||[]).map(t=>new Fa(t))}async selectVariant(e,t){await this.applyVariantSelection(e),await this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name,e.getId(),void 0,t)}async applyGlobalState(e){const t=this.getStateValue();if(!t)return;await this.ensureOptionLoaded();const n=this.optionResource?.variants?.find(i=>i.id===t);if(n)return this.applyVariantSelection(new Fa(n),e)}async applyVariantSelection(e,t){const i=(await this.getSharedSteps(t)).map(a=>a.selectVariant(e));await Promise.all(i)}}class pA extends _1{constructor(e,t,n){super(e,t,n)}async selectVariant(e,t){await this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name,e.getId(),void 0,t),await this.applyColorVariant(e,void 0,t)}async applyGlobalState(e){const t=this.getStateValue();if(!t)return;await this.ensureOptionLoaded();const n=this.optionResource?.variants?.find(a=>a.id===t);if(!n)return;await this.applyColorVariant(new Fa(n),e);const i=this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.customColor;i&&await this.setCustomColor(i)}async applyColorVariant(e,t,n){const a=(await this.getSharedSteps(t)).map(s=>{switch(s.getType()){case Xe.Shape:return s.selectVariant(e);case Xe.Text:return s.setFillColor({fill:e.getColor(),stroke:e.getColor(),variant:e.getResource()});case Xe.Illustration:return s.setColor(n?.toString()||"",e.getColor()||"")}});await Promise.all(a)}async setCustomColor(e){const t=this.getCurrentVariant()?.getColor();t&&t.toLowerCase()==="#custom"&&(await this.getSharedSteps()).forEach(i=>i.setCustomColor(e)),this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name,{customColor:e})}getCustomColor(){return this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.customColor||this.getCurrentVariant()?.getColor()||"#ffffff"}}const tV=(r,e,t)=>{const n=r.getWorkflowExperiences(),i=r.getGlobalPropertyConfiguration();return i?n.flatMap(s=>s.getSteps()).filter(s=>s.getGlobalPropertyAspects(i.id).includes(e)&&s.getType()===t):[]},BI=(r,e)=>{const n=tV(r,e,Xe.Illustration).map(i=>{if(!i.getCurrentVariant()?.getAssetResource()?.assetConfiguration)return 0;const s=i.getColors();return s?Object.getOwnPropertyNames(s).length:0});return Math.max(...n)};var Ud={exports:{}};Ud.exports;var DE;function rV(){return DE||(DE=1,(function(r,e){var t=200,n="Expected a function",i="__lodash_hash_undefined__",a=500,s=1,o=2,l=4,u=800,c=16,f=9007199254740991,d="[object Arguments]",h="[object Array]",g="[object AsyncFunction]",v="[object Boolean]",y="[object Date]",A="[object Error]",C="[object Function]",S="[object GeneratorFunction]",F="[object Map]",E="[object Number]",R="[object Null]",B="[object Object]",G="[object Promise]",j="[object Proxy]",ie="[object RegExp]",q="[object Set]",Y="[object String]",J="[object Symbol]",ae="[object Undefined]",oe="[object WeakMap]",he="[object ArrayBuffer]",ye="[object DataView]",Ue="[object Float32Array]",Re="[object Float64Array]",Oe="[object Int8Array]",ee="[object Int16Array]",re="[object Int32Array]",fe="[object Uint8Array]",Be="[object Uint8ClampedArray]",ke="[object Uint16Array]",$e="[object Uint32Array]",Ge=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qe=/^\w*$/,je=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wt=/[\\^$.*+?()[\]{}|]/g,rr=/\\(\\)?/g,Dr=/\w*$/,jt=/^\[object .+?Constructor\]$/,ar=/^(?:0|[1-9]\d*)$/,St={};St[Ue]=St[Re]=St[Oe]=St[ee]=St[re]=St[fe]=St[Be]=St[ke]=St[$e]=!0,St[d]=St[h]=St[he]=St[v]=St[ye]=St[y]=St[A]=St[C]=St[F]=St[E]=St[B]=St[ie]=St[q]=St[Y]=St[oe]=!1;var st={};st[d]=st[h]=st[he]=st[ye]=st[v]=st[y]=st[Ue]=st[Re]=st[Oe]=st[ee]=st[re]=st[F]=st[E]=st[B]=st[ie]=st[q]=st[Y]=st[J]=st[fe]=st[Be]=st[ke]=st[$e]=!0,st[A]=st[C]=st[oe]=!1;var Qr=typeof di=="object"&&di&&di.Object===Object&&di,Sr=typeof self=="object"&&self&&self.Object===Object&&self,mr=Qr||Sr||Function("return this")(),nr=e&&!e.nodeType&&e,dr=nr&&!0&&r&&!r.nodeType&&r,Yt=dr&&dr.exports===nr,Xt=Yt&&Qr.process,mt=(function(){try{var L=dr&&dr.require&&dr.require("util").types;return L||Xt&&Xt.binding&&Xt.binding("util")}catch{}})(),Cr=mt&&mt.isMap,sn=mt&&mt.isSet,_r=mt&&mt.isTypedArray;function ir(L,te,le){switch(le.length){case 0:return L.call(te);case 1:return L.call(te,le[0]);case 2:return L.call(te,le[0],le[1]);case 3:return L.call(te,le[0],le[1],le[2])}return L.apply(te,le)}function Yr(L,te){for(var le=-1,Ve=L==null?0:L.length;++le<Ve&&te(L[le],le,L)!==!1;);return L}function kr(L,te){for(var le=-1,Ve=L==null?0:L.length,pt=0,_t=[];++le<Ve;){var Wr=L[le];te(Wr,le,L)&&(_t[pt++]=Wr)}return _t}function Zr(L,te){for(var le=-1,Ve=L==null?0:L.length,pt=Array(Ve);++le<Ve;)pt[le]=te(L[le],le,L);return pt}function Vr(L,te){for(var le=-1,Ve=te.length,pt=L.length;++le<Ve;)L[pt+le]=te[le];return L}function pn(L,te){for(var le=-1,Ve=Array(L);++le<L;)Ve[le]=te(le);return Ve}function gn(L){return function(te){return L(te)}}function Tr(L,te){return L?.[te]}function zr(L,te){return function(le){return L(te(le))}}var en=Array.prototype,$r=Function.prototype,zt=Object.prototype,sr=mr["__core-js_shared__"],Er=$r.toString,tt=zt.hasOwnProperty,Nr=(function(){var L=/[^.]+$/.exec(sr&&sr.keys&&sr.keys.IE_PROTO||"");return L?"Symbol(src)_1."+L:""})(),Xr=zt.toString,Ee=Er.call(Object),D=RegExp("^"+Er.call(tt).replace(wt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),U=Yt?mr.Buffer:void 0,X=mr.Symbol,ue=mr.Uint8Array;U&&U.allocUnsafe;var Fe=zr(Object.getPrototypeOf,Object),We=zt.propertyIsEnumerable,bt=en.splice,Dt=X?X.isConcatSpreadable:void 0,Nt=X?X.toStringTag:void 0,or=(function(){try{var L=Ut(Object,"defineProperty");return L({},"",{}),L}catch{}})(),Lt=Object.getOwnPropertySymbols,K=U?U.isBuffer:void 0,Ie=Math.max,Qe=Date.now,Ye=Ut(mr,"DataView"),xt=Ut(mr,"Map"),ft=Ut(mr,"Promise"),Rt=Ut(mr,"Set"),Et=Ut(mr,"WeakMap"),pr=Ut(Object,"create"),tr=hi(Ye),fr=hi(xt),$t=hi(ft),Bn=hi(Rt),Pn=hi(Et),vr=X?X.prototype:void 0,xr=vr?vr.valueOf:void 0,Cn=vr?vr.toString:void 0;function Rr(L){var te=-1,le=L==null?0:L.length;for(this.clear();++te<le;){var Ve=L[te];this.set(Ve[0],Ve[1])}}function jn(){this.__data__=pr?pr(null):{},this.size=0}function xn(L){var te=this.has(L)&&delete this.__data__[L];return this.size-=te?1:0,te}function Hr(L){var te=this.__data__;if(pr){var le=te[L];return le===i?void 0:le}return tt.call(te,L)?te[L]:void 0}function Sn(L){var te=this.__data__;return pr?te[L]!==void 0:tt.call(te,L)}function cn(L,te){var le=this.__data__;return this.size+=this.has(L)?0:1,le[L]=pr&&te===void 0?i:te,this}Rr.prototype.clear=jn,Rr.prototype.delete=xn,Rr.prototype.get=Hr,Rr.prototype.has=Sn,Rr.prototype.set=cn;function tn(L){var te=-1,le=L==null?0:L.length;for(this.clear();++te<le;){var Ve=L[te];this.set(Ve[0],Ve[1])}}function Jn(){this.__data__=[],this.size=0}function si(L){var te=this.__data__,le=Jt(te,L);if(le<0)return!1;var Ve=te.length-1;return le==Ve?te.pop():bt.call(te,le,1),--this.size,!0}function En(L){var te=this.__data__,le=Jt(te,L);return le<0?void 0:te[le][1]}function mn(L){return Jt(this.__data__,L)>-1}function on(L,te){var le=this.__data__,Ve=Jt(le,L);return Ve<0?(++this.size,le.push([L,te])):le[Ve][1]=te,this}tn.prototype.clear=Jn,tn.prototype.delete=si,tn.prototype.get=En,tn.prototype.has=mn,tn.prototype.set=on;function rn(L){var te=-1,le=L==null?0:L.length;for(this.clear();++te<le;){var Ve=L[te];this.set(Ve[0],Ve[1])}}function Lr(){this.size=0,this.__data__={hash:new Rr,map:new(xt||tn),string:new Rr}}function ln(L){var te=Ht(this,L).delete(L);return this.size-=te?1:0,te}function k(L){return Ht(this,L).get(L)}function O(L){return Ht(this,L).has(L)}function z(L,te){var le=Ht(this,L),Ve=le.size;return le.set(L,te),this.size+=le.size==Ve?0:1,this}rn.prototype.clear=Lr,rn.prototype.delete=ln,rn.prototype.get=k,rn.prototype.has=O,rn.prototype.set=z;function W(L){var te=this.__data__=new tn(L);this.size=te.size}function pe(){this.__data__=new tn,this.size=0}function ce(L){var te=this.__data__,le=te.delete(L);return this.size=te.size,le}function xe(L){return this.__data__.get(L)}function _e(L){return this.__data__.has(L)}function rt(L,te){var le=this.__data__;if(le instanceof tn){var Ve=le.__data__;if(!xt||Ve.length<t-1)return Ve.push([L,te]),this.size=++le.size,this;le=this.__data__=new rn(Ve)}return le.set(L,te),this.size=le.size,this}W.prototype.clear=pe,W.prototype.delete=ce,W.prototype.get=xe,W.prototype.has=_e,W.prototype.set=rt;function ut(L,te){var le=Ti(L),Ve=!le&&ds(L),pt=!le&&!Ve&&fs(L),_t=!le&&!Ve&&!pt&&Ae(L),Wr=le||Ve||pt||_t,$n=Wr?pn(L.length,String):[],oi=$n.length;for(var zi in L)Wr&&(zi=="length"||pt&&(zi=="offset"||zi=="parent")||_t&&(zi=="buffer"||zi=="byteLength"||zi=="byteOffset")||Je(zi,oi))||$n.push(zi);return $n}function nt(L,te,le){var Ve=L[te];(!(tt.call(L,te)&&cs(Ve,le))||le===void 0&&!(te in L))&&yr(L,te,le)}function Jt(L,te){for(var le=L.length;le--;)if(cs(L[le][0],te))return le;return-1}function yr(L,te,le){te=="__proto__"&&or?or(L,te,{configurable:!0,enumerable:!0,value:le,writable:!0}):L[te]=le}function Gr(L,te,le,Ve,pt,_t){var Wr;if(le&&(Wr=pt?le(L,Ve,pt,_t):le(L)),Wr!==void 0)return Wr;if(!la(L))return L;var $n=Ti(L);if($n)Wr=we(L);else{var oi=de(L),zi=oi==C||oi==S;if(fs(L))return Zn(L);if(oi==B||oi==d||zi&&!pt)Wr={};else{if(!st[oi])return pt?L:{};Wr=Me(L,oi)}}_t||(_t=new W);var _l=_t.get(L);if(_l)return _l;_t.set(L,Wr),V(L)?L.forEach(function(ua){Wr.add(Gr(ua,te,le,ua,L,_t))}):T(L)&&L.forEach(function(ua,va){Wr.set(va,Gr(ua,te,le,va,L,_t))});var Nl=lt,Mo=$n?void 0:Nl(L);return Yr(Mo||L,function(ua,va){Mo&&(va=ua,ua=L[va]),nt(Wr,va,Gr(ua,te,le,va,L,_t))}),Wr}function dn(L,te,le,Ve,pt){var _t=-1,Wr=L.length;for(le||(le=Ke),pt||(pt=[]);++_t<Wr;){var $n=L[_t];le($n)?Vr(pt,$n):pt[pt.length]=$n}return pt}function Kn(L,te){te=kn(te,L);for(var le=0,Ve=te.length;L!=null&&le<Ve;)L=L[Yi(te[le++])];return le&&le==Ve?L:void 0}function Vn(L,te,le){var Ve=te(L);return Ti(L)?Ve:Vr(Ve,le(L))}function vn(L){return L==null?L===void 0?ae:R:Nt&&Nt in Object(L)?Br(L):jr(L)}function Or(L){return Vi(L)&&vn(L)==d}function qn(L){return Vi(L)&&de(L)==F}function Mn(L){if(!la(L)||gr(L))return!1;var te=hs(L)?D:jt;return te.test(hi(L))}function _n(L){return Vi(L)&&de(L)==q}function Ri(L){return Vi(L)&&ps(L.length)&&!!St[vn(L)]}function wi(L){if(!la(L))return Fr(L);var te=Ar(L),le=[];for(var Ve in L)Ve=="constructor"&&(te||!tt.call(L,Ve))||le.push(Ve);return le}var bi=or?function(L,te){return or(L,"toString",{configurable:!0,enumerable:!1,value:Bt(te),writable:!0})}:Kt;function Nn(L,te,le){var Ve=-1,pt=L.length;te<0&&(te=-te>pt?0:pt+te),le=le>pt?pt:le,le<0&&(le+=pt),pt=te>le?0:le-te>>>0,te>>>=0;for(var _t=Array(pt);++Ve<pt;)_t[Ve]=L[Ve+te];return _t}function ki(L){if(typeof L=="string")return L;if(Ti(L))return Zr(L,ki)+"";if(Q(L))return Cn?Cn.call(L):"";var te=L+"";return te=="0"&&1/L==-1/0?"-0":te}function zn(L,te){te=kn(te,L);var le=-1,Ve=te.length;if(!Ve)return!0;for(;++le<Ve;){var pt=Yi(te[le]);if(pt==="__proto__"&&!tt.call(L,"__proto__")||(pt==="constructor"||pt==="prototype")&&le<Ve-1)return!1}var _t=Wi(L,te);return _t==null||delete _t[Yi(Va(te))]}function kn(L,te){return Ti(L)?L:yt(L,te)?[L]:Wn(ve(L))}function Zn(L,te){return L.slice()}function lr(L){var te=new L.constructor(L.byteLength);return new ue(te).set(new ue(L)),te}function Dn(L,te){var le=lr(L.buffer);return new L.constructor(le,L.byteOffset,L.byteLength)}function Ci(L){var te=new L.constructor(L.source,Dr.exec(L));return te.lastIndex=L.lastIndex,te}function I(L){return xr?Object(xr.call(L)):{}}function $(L,te){var le=lr(L.buffer);return new L.constructor(le,L.byteOffset,L.length)}function se(L,te,le,Ve){var pt=!le;le||(le={});for(var _t=-1,Wr=te.length;++_t<Wr;){var $n=te[_t],oi=void 0;oi===void 0&&(oi=L[$n]),pt?yr(le,$n,oi):nt(le,$n,oi)}return le}function Ce(L){return _(L)?void 0:L}function ht(L){return sa(yn(L,void 0,Ua),L+"")}function lt(L){return Vn(L,Te,Z)}function Ht(L,te){var le=L.__data__;return Ot(te)?le[typeof te=="string"?"string":"hash"]:le.map}function Ut(L,te){var le=Tr(L,te);return Mn(le)?le:void 0}function Br(L){var te=tt.call(L,Nt),le=L[Nt];try{L[Nt]=void 0;var Ve=!0}catch{}var pt=Xr.call(L);return Ve&&(te?L[Nt]=le:delete L[Nt]),pt}var M=Lt?function(L){return L==null?[]:(L=Object(L),kr(Lt(L),function(te){return We.call(L,te)}))}:qt,Z=Lt?function(L){for(var te=[];L;)Vr(te,M(L)),L=Fe(L);return te}:qt,de=vn;(Ye&&de(new Ye(new ArrayBuffer(1)))!=ye||xt&&de(new xt)!=F||ft&&de(ft.resolve())!=G||Rt&&de(new Rt)!=q||Et&&de(new Et)!=oe)&&(de=function(L){var te=vn(L),le=te==B?L.constructor:void 0,Ve=le?hi(le):"";if(Ve)switch(Ve){case tr:return ye;case fr:return F;case $t:return G;case Bn:return q;case Pn:return oe}return te});function we(L){var te=L.length,le=new L.constructor(te);return te&&typeof L[0]=="string"&&tt.call(L,"index")&&(le.index=L.index,le.input=L.input),le}function Me(L,te,le){var Ve=L.constructor;switch(te){case he:return lr(L);case v:case y:return new Ve(+L);case ye:return Dn(L);case Ue:case Re:case Oe:case ee:case re:case fe:case Be:case ke:case $e:return $(L);case F:return new Ve;case E:case Y:return new Ve(L);case ie:return Ci(L);case q:return new Ve;case J:return I(L)}}function Ke(L){return Ti(L)||ds(L)||!!(Dt&&L&&L[Dt])}function Je(L,te){var le=typeof L;return te=te??f,!!te&&(le=="number"||le!="symbol"&&ar.test(L))&&L>-1&&L%1==0&&L<te}function yt(L,te){if(Ti(L))return!1;var le=typeof L;return le=="number"||le=="symbol"||le=="boolean"||L==null||Q(L)?!0:qe.test(L)||!Ge.test(L)||te!=null&&L in Object(te)}function Ot(L){var te=typeof L;return te=="string"||te=="number"||te=="symbol"||te=="boolean"?L!=="__proto__":L===null}function gr(L){return!!Nr&&Nr in L}function Ar(L){var te=L&&L.constructor,le=typeof te=="function"&&te.prototype||zt;return L===le}function ur(L){var te=oa(L,function(Ve){return le.size===a&&le.clear(),Ve}),le=te.cache;return te}function Fr(L){var te=[];if(L!=null)for(var le in Object(L))te.push(le);return te}function jr(L){return Xr.call(L)}function yn(L,te,le){return te=Ie(te===void 0?L.length-1:te,0),function(){for(var Ve=arguments,pt=-1,_t=Ie(Ve.length-te,0),Wr=Array(_t);++pt<_t;)Wr[pt]=Ve[te+pt];pt=-1;for(var $n=Array(te+1);++pt<te;)$n[pt]=Ve[pt];return $n[te]=le(Wr),ir(L,this,$n)}}function Wi(L,te){return te.length<2?L:Kn(L,Nn(te,0,-1))}var sa=Qi(bi);function Qi(L){var te=0,le=0;return function(){var Ve=Qe(),pt=c-(Ve-le);if(le=Ve,pt>0){if(++te>=u)return arguments[0]}else te=0;return L.apply(void 0,arguments)}}var Wn=ur(function(L){var te=[];return L.charCodeAt(0)===46&&te.push(""),L.replace(je,function(le,Ve,pt,_t){te.push(pt?_t.replace(rr,"$1"):Ve||le)}),te});function Yi(L){if(typeof L=="string"||Q(L))return L;var te=L+"";return te=="0"&&1/L==-1/0?"-0":te}function hi(L){if(L!=null){try{return Er.call(L)}catch{}try{return L+""}catch{}}return""}function Ua(L){var te=L==null?0:L.length;return te?dn(L):[]}function Va(L){var te=L==null?0:L.length;return te?L[te-1]:void 0}function oa(L,te){if(typeof L!="function"||te!=null&&typeof te!="function")throw new TypeError(n);var le=function(){var Ve=arguments,pt=te?te.apply(this,Ve):Ve[0],_t=le.cache;if(_t.has(pt))return _t.get(pt);var Wr=L.apply(this,Ve);return le.cache=_t.set(pt,Wr)||_t,Wr};return le.cache=new(oa.Cache||rn),le}oa.Cache=rn;function cs(L,te){return L===te||L!==L&&te!==te}var ds=Or((function(){return arguments})())?Or:function(L){return Vi(L)&&tt.call(L,"callee")&&!We.call(L,"callee")},Ti=Array.isArray;function za(L){return L!=null&&ps(L.length)&&!hs(L)}var fs=K||qr;function hs(L){if(!la(L))return!1;var te=vn(L);return te==C||te==S||te==g||te==j}function ps(L){return typeof L=="number"&&L>-1&&L%1==0&&L<=f}function la(L){var te=typeof L;return L!=null&&(te=="object"||te=="function")}function Vi(L){return L!=null&&typeof L=="object"}var T=Cr?gn(Cr):qn;function _(L){if(!Vi(L)||vn(L)!=B)return!1;var te=Fe(L);if(te===null)return!0;var le=tt.call(te,"constructor")&&te.constructor;return typeof le=="function"&&le instanceof le&&Er.call(le)==Ee}var V=sn?gn(sn):_n;function Q(L){return typeof L=="symbol"||Vi(L)&&vn(L)==J}var Ae=_r?gn(_r):Ri;function ve(L){return L==null?"":ki(L)}function Te(L){return za(L)?ut(L):wi(L)}var He=ht(function(L,te){var le={};if(L==null)return le;var Ve=!1;te=Zr(te,function(_t){return _t=kn(_t,L),Ve||(Ve=_t.length>1),_t}),se(L,lt(L),le),Ve&&(le=Gr(le,s|o|l,Ce));for(var pt=te.length;pt--;)zn(le,te[pt]);return le});function Bt(L){return function(){return L}}function Kt(L){return L}function qt(){return[]}function qr(){return!1}r.exports=He})(Ud,Ud.exports)),Ud.exports}var nV=rV();const iV=Ns(nV);function gA(r,e){function t(n){if(typeof n>"u"||!Array.isArray(n)&&!sV(n))return n;if(Array.isArray(n))return gA(n,e);let i={};for(const[a,s]of Object.entries(n))i[a]=aV(s)?s:gA(s,e);return iV(i,e)}return Array.isArray(r)?r.map(t):t(r)}function aV(r){return r==null}function sV(r){return typeof r=="object"&&!Array.isArray(r)&&r!==null}function RE(r,e){return r==null&&e==null?!0:r===e}function MI(r){const e=new Map;return r?.aspects?.forEach(t=>{t.value!==""&&e.set(t.name,!0)}),e}class oV extends Gg{constructor(e){super(),this.update=e}async execute(){await this.update(),await new Promise(e=>{window.setTimeout(()=>{e()},1e3)})}}function Ov(r){return gA(r,["__typename"])}class lV{constructor(e,t,n,i,a){this.stateUpdateQueue=new jg(1),this.mandatoryFulfilledAspects=new Map,this.bundleId=e,this.bundleOwnerId=t,this.configuration=n,this.bundleOptions=a;const s=a?.existingGlobalPropertyState;this.initPromise=s?Promise.resolve(s).then(()=>{console.log("Setting global property state to existing state."),this.globalPropertyState=Ov(s),this.recalculateMandatoryStates()}):this.createGlobalPropertyState().then(o=>{console.log("Setting global property state to new state."),this.globalPropertyState=Ov(o),this.recalculateMandatoryStates()}),this.onGlobalPropertyStateChange=i}async clearAspects(e){if(!this.globalPropertyState)throw new Error("Global property state not initialized");const t=this.globalPropertyState.aspects;this.globalPropertyState.aspects=t.filter(n=>!e.includes(n.name))}recalculateMandatoryStates(){this.mandatoryFulfilledAspects=MI(this.globalPropertyState)}setBundleOptions(e){this.bundleOptions=e}getBundleOptions(){return this.bundleOptions}setConfiguration(e){this.configuration=e}getInitializationPromise(){return this.initPromise}getGlobalPropertyState(){return this.globalPropertyState}async setGlobalPropertyState(e){this.globalPropertyState||await this.initPromise;const t=mo(this.globalPropertyState);this.globalPropertyState={...Ov(e),id:t.id},this.recalculateMandatoryStates(),this.queueGlobalPropertyStateUpdate(),await this.onGlobalPropertyStateChange(t,this.globalPropertyState)}getAspectMandatoryFulfilled(e){return this.mandatoryFulfilledAspects.get(e)}getAspectHidden(e){if(!this.globalPropertyState)throw new Error("Global property state not initialized");return!!this.globalPropertyState.aspects.find(t=>t.name===e)?.hidden}getAspect(e,t){if(!this.globalPropertyState)throw new Error("Global property state not initialized");const n=this.globalPropertyState.aspects.find(i=>i.name===e&&RE(i.channel,t));if(n)return n.value}getAspectStorage(e,t){if(!this.globalPropertyState)throw new Error("Global property state not initialized");return this.globalPropertyState.aspects.find(n=>n.name===e&&RE(n.channel,t))?.storage}async setAspect(e,t,n,i,a){if(!this.globalPropertyState)throw new Error("Global property state not initialized");if(!this.configuration)throw new Error("Global property configuration not linked to the state manager.");const s=this.configuration.aspects.find(u=>u.name===e);if(!s)throw new Error(`Failed to find configuration aspect with name: ${e}`);this.mandatoryFulfilledAspects.set(e,t!=="");const o=mo(this.globalPropertyState),l=this.globalPropertyState.aspects.filter(u=>u.name===e);if(l.length>0)if(i){const u=l.find(c=>c.channel===i);if(u)u.value=t,u.type=s.type,u.channel=i,u.hidden=a??u.hidden,n!==void 0&&(u.storage=n!==null?n:void 0);else{let c;if(i===1){const f=this.globalPropertyState.aspects.findIndex(d=>!d.channel&&d.name===e);f&&f>0&&(c=this.globalPropertyState.aspects.splice(f,1)[0].hidden)}this.globalPropertyState.aspects.push({name:e,value:t,type:s.type,storage:n!==null?n:void 0,channel:i,hidden:a??c})}}else{const u=l[0];u.value=t,u.type=s.type,u.hidden=a??u.hidden,n!==void 0&&(u.storage=n!==null?n:void 0)}else this.globalPropertyState.aspects.push({name:e,value:t,type:s.type,storage:n!==null?n:void 0,channel:i,hidden:a});vf(o,this.globalPropertyState)||(this.queueGlobalPropertyStateUpdate(),await this.onGlobalPropertyStateChange(o,this.globalPropertyState))}async setAspectStorage(e,t,n){if(!this.globalPropertyState)throw new Error("Global property state not initialized");if(!this.configuration)throw new Error("Global property configuration not linked to the state manager.");const i=this.configuration.aspects.find(o=>o.name===e);if(!i)throw new Error(`Failed to find configuration aspect with name: ${e}`);const a=mo(this.globalPropertyState),s=this.globalPropertyState.aspects.filter(o=>o.name===e);if(s.length>0)if(n){const o=s.find(l=>l.channel===n);o&&(o.storage=t!==null?t:void 0,o.type=i.type)}else{const o=s[0];o.storage=t!==null?t:void 0,o.type=i.type}else this.globalPropertyState.aspects.push({name:e,value:"",type:i.type,storage:t!==null?t:void 0,channel:n});vf(a,this.globalPropertyState)||(this.queueGlobalPropertyStateUpdate(),await this.onGlobalPropertyStateChange(a,this.globalPropertyState))}queueGlobalPropertyStateUpdate(){this.stateUpdateQueue.enqueue(new oV(async()=>{await this.updateGlobalPropertyState()}))}async updateGlobalPropertyState(){if(!this.globalPropertyState)throw new Error("Global property state not initialized");if(!(await ze.getShadowGraphqlClient().mutate({mutation:JU,variables:{id:this.globalPropertyState.id,aspects:this.globalPropertyState.aspects.map(t=>{let n=t.type&&t.storage?{}:void 0;if(n)switch(t.type){case Hn.FileUpload:{n.fileUpload=t.storage;break}case Hn.ColorOption:case Hn.Option:{n.option=t.storage;break}}return{name:t.name,value:t.value,type:t.type,storage:n,channel:t.channel,hidden:t.hidden}})},context:{headers:{bundleOwnerId:this.bundleOwnerId,...this.bundleOptions?.additionalHeaders}}})).data?.globalPropertyStateUpdate)throw new Error("Unable to update global property state")}async createGlobalPropertyState(){const e=await ze.getShadowGraphqlClient().mutate({mutation:XU,variables:{bundleId:this.bundleId},context:{headers:{bundleOwnerId:this.bundleOwnerId,...this.bundleOptions?.additionalHeaders}}});if(e.data?.globalPropertyStateCreate&&e.data.globalPropertyStateCreate.id)return e.data.globalPropertyStateCreate;throw new Error(`Unable to create global property state for bundle: ${this.bundleId}`)}}class uV{constructor(e){this.setState(e||'{"transactions": []}')}setState(e){e&&(this.state=JSON.parse(e))}getState(){return this.state}removeStateForTransaction(e){if(!this.state||!this.state.transactions)return;const t=this.state.transactions.findIndex(n=>n.transactionId===e);t!==-1&&this.state.transactions.splice(t,1)}getSerializedState(){if(this.state)return this.deleteFieldNameFromObjectRecursive(this.state,"__typename"),JSON.stringify(this.state)}deleteFieldNameFromObjectRecursive(e,t){if(!(typeof e!="object"||e===null))for(const n in e)n===t?delete e[n]:this.deleteFieldNameFromObjectRecursive(e[n],t)}}const cV=Se`
2835
2835
  query GetManyMetafields($entityIds: [String!]!) {
2836
2836
  metafieldsMany(entityIds: $entityIds) {
2837
2837
  id
@@ -3039,7 +3039,7 @@ Minimum version required to store current data is: `+q+`.
3039
3039
  `;class EV{constructor(e,t=ze.getShadowGraphqlClient.bind(ze)){this.options=e,this.client=t}query(e){const t=this.options?.onQuery?this.options?.onQuery(e):{};return this.client().query({...t,...e,context:{...t.context??{},...e.context??{}}})}mutate(e){const t=this.options?.onMutate?this.options?.onMutate(e):{};return this.client().mutate({...t,...e,context:{...t.context??{},...e.context??{}}})}}function kV(r,e,t){return r.$source||(r.$source={}),r.$source[e]=t,r}const TV=r=>r?.body instanceof ReadableStream,fl=(r,e)=>{const t=[];if(r&&t.push(r),e)for(const n of e)t.push(n);return t},to=(r,e)=>`${r||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,wg=()=>{let r=[],e=[],t=!1;const n=new Set,i=f=>f.sort((d,h)=>BE[h.step]-BE[d.step]||ME[h.priority||"normal"]-ME[d.priority||"normal"]),a=f=>{let d=!1;const h=g=>{const v=fl(g.name,g.aliases);if(v.includes(f)){d=!0;for(const y of v)n.delete(y);return!1}return!0};return r=r.filter(h),e=e.filter(h),d},s=f=>{let d=!1;const h=g=>{if(g.middleware===f){d=!0;for(const v of fl(g.name,g.aliases))n.delete(v);return!1}return!0};return r=r.filter(h),e=e.filter(h),d},o=f=>(r.forEach(d=>{f.add(d.middleware,{...d})}),e.forEach(d=>{f.addRelativeTo(d.middleware,{...d})}),f.identifyOnResolve?.(c.identifyOnResolve()),f),l=f=>{const d=[];return f.before.forEach(h=>{h.before.length===0&&h.after.length===0?d.push(h):d.push(...l(h))}),d.push(f),f.after.reverse().forEach(h=>{h.before.length===0&&h.after.length===0?d.push(h):d.push(...l(h))}),d},u=(f=!1)=>{const d=[],h=[],g={};return r.forEach(y=>{const A={...y,before:[],after:[]};for(const C of fl(A.name,A.aliases))g[C]=A;d.push(A)}),e.forEach(y=>{const A={...y,before:[],after:[]};for(const C of fl(A.name,A.aliases))g[C]=A;h.push(A)}),h.forEach(y=>{if(y.toMiddleware){const A=g[y.toMiddleware];if(A===void 0){if(f)return;throw new Error(`${y.toMiddleware} is not found when adding ${to(y.name,y.aliases)} middleware ${y.relation} ${y.toMiddleware}`)}y.relation==="after"&&A.after.push(y),y.relation==="before"&&A.before.push(y)}}),i(d).map(l).reduce((y,A)=>(y.push(...A),y),[])},c={add:(f,d={})=>{const{name:h,override:g,aliases:v}=d,y={step:"initialize",priority:"normal",middleware:f,...d},A=fl(h,v);if(A.length>0){if(A.some(C=>n.has(C))){if(!g)throw new Error(`Duplicate middleware name '${to(h,v)}'`);for(const C of A){const S=r.findIndex(E=>E.name===C||E.aliases?.some(R=>R===C));if(S===-1)continue;const F=r[S];if(F.step!==y.step||y.priority!==F.priority)throw new Error(`"${to(F.name,F.aliases)}" middleware with ${F.priority} priority in ${F.step} step cannot be overridden by "${to(h,v)}" middleware with ${y.priority} priority in ${y.step} step.`);r.splice(S,1)}}for(const C of A)n.add(C)}r.push(y)},addRelativeTo:(f,d)=>{const{name:h,override:g,aliases:v}=d,y={middleware:f,...d},A=fl(h,v);if(A.length>0){if(A.some(C=>n.has(C))){if(!g)throw new Error(`Duplicate middleware name '${to(h,v)}'`);for(const C of A){const S=e.findIndex(E=>E.name===C||E.aliases?.some(R=>R===C));if(S===-1)continue;const F=e[S];if(F.toMiddleware!==y.toMiddleware||F.relation!==y.relation)throw new Error(`"${to(F.name,F.aliases)}" middleware ${F.relation} "${F.toMiddleware}" middleware cannot be overridden by "${to(h,v)}" middleware ${y.relation} "${y.toMiddleware}" middleware.`);e.splice(S,1)}}for(const C of A)n.add(C)}e.push(y)},clone:()=>o(wg()),use:f=>{f.applyToStack(c)},remove:f=>typeof f=="string"?a(f):s(f),removeByTag:f=>{let d=!1;const h=g=>{const{tags:v,name:y,aliases:A}=g;if(v&&v.includes(f)){const C=fl(y,A);for(const S of C)n.delete(S);return d=!0,!1}return!0};return r=r.filter(h),e=e.filter(h),d},concat:f=>{const d=o(wg());return d.use(f),d.identifyOnResolve(t||d.identifyOnResolve()||(f.identifyOnResolve?.()??!1)),d},applyToStack:o,identify:()=>u(!0).map(f=>{const d=f.step??f.relation+" "+f.toMiddleware;return to(f.name,f.aliases)+" - "+d}),identifyOnResolve(f){return typeof f=="boolean"&&(t=f),t},resolve:(f,d)=>{for(const h of u().map(g=>g.middleware).reverse())f=h(f,d);return t&&console.log(c.identify()),f}};return c},BE={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},ME={high:3,normal:2,low:1};var xf;(function(r){r.HTTP="http",r.HTTPS="https"})(xf||(xf={}));var Sf;(function(r){r.MD5="md5",r.CRC32="crc32",r.CRC32C="crc32c",r.SHA1="sha1",r.SHA256="sha256"})(Sf||(Sf={}));const vA="__smithy_context",vc=r=>r[vA]||(r[vA]={});class na{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const t=new na({...e,headers:{...e.headers}});return t.query&&(t.query=FV(t.query)),t}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&typeof t.query=="object"&&typeof t.headers=="object"}clone(){return na.clone(this)}}function FV(r){return Object.keys(r).reduce((e,t)=>{const n=r[t];return{...e,[t]:Array.isArray(n)?[...n]:n}},{})}class sc{statusCode;reason;headers;body;constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return typeof t.statusCode=="number"&&typeof t.headers=="object"}}const IV=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),Kg=(r,e=!1)=>{if(!e)return IV.test(r);const t=r.split(".");for(const n of t)if(!Kg(n))return!1;return!0},Bs=r=>{if(typeof r=="function")return r;const e=Promise.resolve(r);return()=>e};function PV(r){const e={};if(r=r.replace(/^\?/,""),r)for(const t of r.split("&")){let[n,i=null]=t.split("=");n=decodeURIComponent(n),i&&(i=decodeURIComponent(i)),n in e?Array.isArray(e[n])?e[n].push(i):e[n]=[e[n],i]:e[n]=i}return e}const bg=r=>{if(typeof r=="string")return bg(new URL(r));const{hostname:e,pathname:t,port:n,protocol:i,search:a}=r;let s;return a&&(s=PV(a)),{hostname:e,port:n?parseInt(n):void 0,protocol:i,path:t,query:s}},V1=r=>{if(typeof r=="object"){if("url"in r){const e=bg(r.url);if(r.headers){e.headers={};for(const t in r.headers)e.headers[t.toLowerCase()]=r.headers[t].join(", ")}return e}return r}return bg(r)},DV=r=>()=>Promise.reject(r);class RV{config;middlewareStack=wg();initConfig;handlers;constructor(e){this.config=e;const{protocol:t,protocolSettings:n}=e;n&&typeof t=="function"&&(e.protocol=new t(n))}send(e,t,n){const i=typeof t!="function"?t:void 0,a=typeof t=="function"?t:n,s=i===void 0&&this.config.cacheMiddleware===!0;let o;if(s){this.handlers||(this.handlers=new WeakMap);const l=this.handlers;l.has(e.constructor)?o=l.get(e.constructor):(o=e.resolveMiddleware(this.middlewareStack,this.config,i),l.set(e.constructor,o))}else delete this.handlers,o=e.resolveMiddleware(this.middlewareStack,this.config,i);if(a)o(e).then(l=>a(null,l.output),l=>a(l)).catch(()=>{});else return o(e).then(l=>l.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}const Yp=r=>typeof r=="function"?r():r,VI=(r,e,t,n,i)=>({name:e,namespace:r,traits:t,input:n,output:i}),OV=r=>(e,t)=>async n=>{const{response:i}=await e(n),{operationSchema:a}=vc(t),[,s,o,l,u,c]=a??[];try{const f=await r.protocol.deserializeResponse(VI(s,o,l,u,c),{...r,...t},i);return{response:i,output:f}}catch(f){if(Object.defineProperty(f,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in f)){const d="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{f.message+=`
3040
3040
  `+d}catch{!t.logger||t.logger?.constructor?.name==="NoOpLogger"?console.warn(d):t.logger?.warn?.(d)}typeof f.$responseBodyText<"u"&&f.$response&&(f.$response.body=f.$responseBodyText);try{if(sc.isInstance(i)){const{headers:h={},statusCode:g}=i,v=Object.entries(h);f.$metadata={httpStatusCode:g,requestId:Mv(/^x-[\w-]+-request-?id$/,v),extendedRequestId:Mv(/^x-[\w-]+-id-2$/,v),cfId:Mv(/^x-[\w-]+-cf-id$/,v)}}}catch{}}throw f}},Mv=(r,e)=>(e.find(([t])=>t.match(r))||[void 0,void 0])[1],BV=r=>(e,t)=>async n=>{const{operationSchema:i}=vc(t),[,a,s,o,l,u]=i??[],c=t.endpointV2?async()=>V1(t.endpointV2):r.endpoint,f=await r.protocol.serializeRequest(VI(a,s,o,l,u),n.input,{...r,...t,endpoint:c});return e({...n,request:f})},MV={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},_V={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function NV(r){return{applyToStack:e=>{e.add(BV(r),_V),e.add(OV(r),MV),r.protocol.setSerdeContext(r)}}}const _v=[];function zd(r){if(typeof r=="object")return r;if(r=r|0,_v[r])return _v[r];const e={};let t=0;for(const n of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(r>>t++&1)===1&&(e[n]=1);return _v[r]=e}const kd={it:Symbol.for("@smithy/nor-struct-it"),ns:Symbol.for("@smithy/ns")},Nv=[],Lv={};class vi{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=vi.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(e,t){this.ref=e,this.memberName=t;const n=[];let i=e,a=e;for(this._isMemberSchema=!1;Uv(i);)n.push(i[1]),i=i[0],a=Yp(i),this._isMemberSchema=!0;if(n.length>0){this.memberTraits={};for(let s=n.length-1;s>=0;--s){const o=n[s];Object.assign(this.memberTraits,zd(o))}}else this.memberTraits=0;if(a instanceof vi){const s=this.memberTraits;Object.assign(this,a),this.memberTraits=Object.assign({},s,a.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=t??a.memberName;return}if(this.schema=Yp(a),LV(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(a),this.traits=0),this._isMemberSchema&&!t)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){const t=this.prototype.isPrototypeOf(e);return!t&&typeof e=="object"&&e!==null?e.symbol===this.symbol:t}static of(e){const t=typeof e=="function"||typeof e=="object"&&e!==null;if(typeof e=="number"){if(Nv[e])return Nv[e]}else if(typeof e=="string"){if(Lv[e])return Lv[e]}else if(t&&e[kd.ns])return e[kd.ns];const n=Yp(e);if(n instanceof vi)return n;if(Uv(n)){const[a,s]=n;if(a instanceof vi)return Object.assign(a.getMergedTraits(),zd(s)),a;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}const i=new vi(n);return t?e[kd.ns]=i:typeof n=="string"?Lv[n]=i:typeof n=="number"?Nv[n]=i:i}getSchema(){const e=this.schema;return Array.isArray(e)&&e[0]===0?e[4]:e}getName(e=!1){const{name:t}=this;return!e&&t&&t.includes("#")?t.split("#")[1]:t||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){const e=this.getSchema();return typeof e=="number"?e>=64&&e<128:e[0]===1}isMapSchema(){const e=this.getSchema();return typeof e=="number"?e>=128&&e<=255:e[0]===2}isStructSchema(){const e=this.getSchema();if(typeof e!="object")return!1;const t=e[0];return t===3||t===-3||t===4}isUnionSchema(){const e=this.getSchema();return typeof e!="object"?!1:e[0]===4}isBlobSchema(){const e=this.getSchema();return e===21||e===42}isTimestampSchema(){const e=this.getSchema();return typeof e=="number"&&e>=4&&e<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){const{streaming:e}=this.getMergedTraits();return!!e||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return zd(this.memberTraits)}getOwnTraits(){return zd(this.traits)}getKeySchema(){const[e,t]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!t)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const n=this.getSchema(),i=e?15:n[4]??0;return Td([i,0],"key")}getValueSchema(){const e=this.getSchema(),[t,n,i]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],a=typeof e=="number"?63&e:e&&typeof e=="object"&&(n||i)?e[3+e[0]]:t?15:void 0;if(a!=null)return Td([a,0],n?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){const t=this.getSchema();if(this.isStructSchema()&&t[4].includes(e)){const n=t[4].indexOf(e),i=t[5][n];return Td(Uv(i)?i:[i,0],e)}if(this.isDocumentSchema())return Td([15,0],e);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${e}.`)}getMemberSchemas(){const e={};try{for(const[t,n]of this.structIterator())e[t]=n}catch{}return e}getEventStreamMember(){if(this.isStructSchema()){for(const[e,t]of this.structIterator())if(t.isStreaming()&&t.isStructSchema())return e}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const e=this.getSchema(),t=e[4].length;let n=e[kd.it];if(n&&t===n.length){yield*n;return}n=Array(t);for(let i=0;i<t;++i){const a=e[4][i],s=Td([e[5][i],0],a);yield n[i]=[a,s]}e[kd.it]=n}}function Td(r,e){if(r instanceof vi)return Object.assign(r,{memberName:e,_isMemberSchema:!0});const t=vi;return new t(r,e)}const Uv=r=>Array.isArray(r)&&r.length===2,LV=r=>Array.isArray(r)&&r.length>=5;class Zi{namespace;schemas;exceptions;static registries=new Map;constructor(e,t=new Map,n=new Map){this.namespace=e,this.schemas=t,this.exceptions=n}static for(e){return Zi.registries.has(e)||Zi.registries.set(e,new Zi(e)),Zi.registries.get(e)}copyFrom(e){const{schemas:t,exceptions:n}=this;for(const[i,a]of e.schemas)t.has(i)||t.set(i,a);for(const[i,a]of e.exceptions)n.has(i)||n.set(i,a)}register(e,t){const n=this.normalizeShapeId(e);for(const i of[this,Zi.for(n.split("#")[0])])i.schemas.set(n,t)}getSchema(e){const t=this.normalizeShapeId(e);if(!this.schemas.has(t)){if(!e.includes("#")){const n="#"+e,i=[];for(const[a,s]of this.schemas.entries())a.endsWith(n)&&i.push(s);if(i.length===1)return i[0]}throw new Error(`@smithy/core/schema - schema not found for ${t}`)}return this.schemas.get(t)}registerError(e,t){const n=e,i=n[1];for(const a of[this,Zi.for(i)])a.schemas.set(i+"#"+n[2],n),a.exceptions.set(n,t)}getErrorCtor(e){const t=e;return this.exceptions.has(t)?this.exceptions.get(t):Zi.for(t[1]).exceptions.get(t)}getBaseException(){for(const e of this.exceptions.keys())if(Array.isArray(e)){const[,t,n]=e,i=t+"#"+n;if(i.startsWith("smithy.ts.sdk.synthetic.")&&i.endsWith("ServiceException"))return e}}find(e){for(const t of this.schemas.values())if(e(t))return t}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){return e.includes("#")?e:this.namespace+"#"+e}}const Vv="***SensitiveInformation***";function yA(r,e){if(e==null)return e;const t=vi.of(r);if(t.getMergedTraits().sensitive)return Vv;if(t.isListSchema()){if(!!t.getValueSchema().getMergedTraits().sensitive)return Vv}else if(t.isMapSchema()){if(!!t.getKeySchema().getMergedTraits().sensitive||!!t.getValueSchema().getMergedTraits().sensitive)return Vv}else if(t.isStructSchema()&&typeof e=="object"){const n=e,i={};for(const[a,s]of t.structIterator())n[a]!=null&&(i[a]=yA(s,n[a]));return i}return e}class z1{middlewareStack=wg();schema;static classBuilder(){return new UV}resolveMiddlewareWithContext(e,t,n,{middlewareFn:i,clientName:a,commandName:s,inputFilterSensitiveLog:o,outputFilterSensitiveLog:l,smithyContext:u,additionalContext:c,CommandCtor:f}){for(const A of i.bind(this)(f,e,t,n))this.middlewareStack.use(A);const d=e.concat(this.middlewareStack),{logger:h}=t,g={logger:h,clientName:a,commandName:s,inputFilterSensitiveLog:o,outputFilterSensitiveLog:l,[vA]:{commandInstance:this,...u},...c},{requestHandler:v}=t;let y=n??{};return u.eventStream&&(y={isEventStream:!0,...y}),d.resolve(A=>v.handle(A.request,y),g)}}class UV{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,n={}){return this._smithyContext={service:e,operation:t,...n},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=n=>n,t=n=>n){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){const e=this;let t;return t=class extends z1{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[n]){super(),this.input=n??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(n,i,a){const s=e._operationSchema,o=s?.[4]??s?.input,l=s?.[5]??s?.output;return this.resolveMiddlewareWithContext(n,i,a,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(s?yA.bind(null,o):u=>u),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(s?yA.bind(null,l):u=>u),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}class Lu extends Error{$fault;$response;$retryable;$metadata;constructor(e){super(e.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;const t=e;return Lu.prototype.isPrototypeOf(t)||!!t.$fault&&!!t.$metadata&&(t.$fault==="client"||t.$fault==="server")}static[Symbol.hasInstance](e){if(!e)return!1;const t=e;return this===Lu?Lu.isInstance(e):Lu.isInstance(e)?t.name&&this.name?this.prototype.isPrototypeOf(e)||t.name===this.name:this.prototype.isPrototypeOf(e):!1}}const _E=(r,e={})=>{Object.entries(e).filter(([,n])=>n!==void 0).forEach(([n,i])=>{(r[n]==null||r[n]==="")&&(r[n]=i)});const t=r.message||r.Message||"UnknownError";return r.message=t,delete r.Message,r},VV=r=>{switch(r){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},zI=Object.values(Sf),zV=r=>{const e=[];for(const t in Sf){const n=Sf[t];r[n]!==void 0&&e.push({algorithmId:()=>n,checksumConstructor:()=>r[n]})}for(const[t,n]of Object.entries(r.checksumAlgorithms??{}))e.push({algorithmId:()=>t,checksumConstructor:()=>n});return{addChecksumAlgorithm(t){r.checksumAlgorithms=r.checksumAlgorithms??{};const n=t.algorithmId(),i=t.checksumConstructor();zI.includes(n)?r.checksumAlgorithms[n.toUpperCase()]=i:r.checksumAlgorithms[n]=i,e.push(t)},checksumAlgorithms(){return e}}},$V=r=>{const e={};return r.checksumAlgorithms().forEach(t=>{const n=t.algorithmId();zI.includes(n)&&(e[n]=t.checksumConstructor())}),e},HV=r=>({setRetryStrategy(e){r.retryStrategy=e},retryStrategy(){return r.retryStrategy}}),GV=r=>{const e={};return e.retryStrategy=r.retryStrategy(),e},jV=r=>Object.assign(zV(r),HV(r)),qV=r=>Object.assign($V(r),GV(r));class $I{trace(){}debug(){}info(){}warn(){}error(){}}const HI="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",NE=Object.entries(HI).reduce((r,[e,t])=>(r[t]=Number(e),r),{}),WV=HI.split(""),ju=6,Zd=8,QV=63,Zg=r=>{let e=r.length/4*3;r.slice(-2)==="=="?e-=2:r.slice(-1)==="="&&e--;const t=new ArrayBuffer(e),n=new DataView(t);for(let i=0;i<r.length;i+=4){let a=0,s=0;for(let u=i,c=i+3;u<=c;u++)if(r[u]!=="="){if(!(r[u]in NE))throw new TypeError(`Invalid character ${r[u]} in base64 string.`);a|=NE[r[u]]<<(c-u)*ju,s+=ju}else a>>=ju;const o=i/4*3;a>>=s%Zd;const l=Math.floor(s/Zd);for(let u=0;u<l;u++){const c=(l-u-1)*Zd;n.setUint8(o+u,(a&255<<c)>>c)}}return new Uint8Array(t)},kl=r=>new TextEncoder().encode(r);function Cg(r){let e;typeof r=="string"?e=kl(r):e=r;const t=typeof e=="object"&&typeof e.length=="number",n=typeof e=="object"&&typeof e.byteOffset=="number"&&typeof e.byteLength=="number";if(!t&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let i="";for(let a=0;a<e.length;a+=3){let s=0,o=0;for(let u=a,c=Math.min(a+3,e.length);u<c;u++)s|=e[u]<<(c-u-1)*Zd,o+=Zd;const l=Math.ceil(o/ju);s<<=l*ju-o;for(let u=1;u<=l;u++){const c=(l-u)*ju;i+=WV[(s&QV<<c)>>c]}i+="==".slice(0,4-l)}return i}function YV(r,e,t,n){return class Xp extends Uint8Array{static fromString(a,s="utf-8"){if(typeof a=="string")return s==="base64"?Xp.mutate(n(a)):Xp.mutate(e(a));throw new Error(`Unsupported conversion from ${typeof a} to Uint8ArrayBlobAdapter.`)}static mutate(a){return Object.setPrototypeOf(a,Xp.prototype),a}transformToString(a="utf-8"){return a==="base64"?t(this):r(this)}}}const em=r=>{if(typeof r=="string")return r;if(typeof r!="object"||typeof r.byteOffset!="number"||typeof r.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(r)},Ii=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function XV(r){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?()=>crypto.randomUUID():()=>{const e=new Uint8Array(16);return r(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,Ii[e[0]]+Ii[e[1]]+Ii[e[2]]+Ii[e[3]]+"-"+Ii[e[4]]+Ii[e[5]]+"-"+Ii[e[6]]+Ii[e[7]]+"-"+Ii[e[8]]+Ii[e[9]]+"-"+Ii[e[10]]+Ii[e[11]]+Ii[e[12]]+Ii[e[13]]+Ii[e[14]]+Ii[e[15]]}}const AA=r=>{if(r!=null){if(typeof r=="string"){const e=parseFloat(r);if(!Number.isNaN(e))return String(e)!==String(r)&&az.warn(iz(`Expected number but observed string: ${r}`)),e}if(typeof r=="number")return r;throw new TypeError(`Expected number, got ${typeof r}: ${r}`)}},JV=Math.ceil(2**127*(2-2**-23)),LE=r=>{const e=AA(r);if(e!==void 0&&!Number.isNaN(e)&&e!==1/0&&e!==-1/0&&Math.abs(e)>JV)throw new TypeError(`Expected 32-bit float, got ${r}`);return e},KV=r=>{if(r!=null){if(Number.isInteger(r)&&!Number.isNaN(r))return r;throw new TypeError(`Expected integer, got ${typeof r}: ${r}`)}},UE=r=>GI(r,16),VE=r=>GI(r,8),GI=(r,e)=>{const t=KV(r);if(t!==void 0&&ZV(t,e)!==t)throw new TypeError(`Expected ${e}-bit integer, got ${r}`);return t},ZV=(r,e)=>{switch(e){case 32:return Int32Array.of(r)[0];case 16:return Int16Array.of(r)[0];case 8:return Int8Array.of(r)[0]}},ez=r=>AA(typeof r=="string"?tm(r):r),tz=r=>LE(typeof r=="string"?tm(r):r),rz=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,tm=r=>{const e=r.match(rz);if(e===null||e[0].length!==r.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(r)},xg=r=>UE(typeof r=="string"?tm(r):r),nz=r=>VE(typeof r=="string"?tm(r):r),iz=r=>String(new TypeError(r).stack||r).split(`
3041
3041
  `).slice(0,5).filter(e=>!e.includes("stackTraceWarning")).join(`
3042
- `),az={warn:console.warn},sz=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],$1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function oz(r){const e=r.getUTCFullYear(),t=r.getUTCMonth(),n=r.getUTCDay(),i=r.getUTCDate(),a=r.getUTCHours(),s=r.getUTCMinutes(),o=r.getUTCSeconds(),l=i<10?`0${i}`:`${i}`,u=a<10?`0${a}`:`${a}`,c=s<10?`0${s}`:`${s}`,f=o<10?`0${o}`:`${o}`;return`${sz[n]}, ${l} ${$1[t]} ${e} ${u}:${c}:${f} GMT`}const lz=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),uz=r=>{if(r==null)return;if(typeof r!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=lz.exec(r);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[t,n,i,a,s,o,l,u,c]=e,f=xg(Ef(n)),d=yo(i,"month",1,12),h=yo(a,"day",1,31),g=Jp(f,d,h,{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u});return c.toUpperCase()!="Z"&&g.setTime(g.getTime()-bz(c)),g},cz=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),dz=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),fz=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),jI=r=>{if(r==null)return;if(typeof r!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let e=cz.exec(r);if(e){const[t,n,i,a,s,o,l,u]=e;return Jp(xg(Ef(a)),zv(i),yo(n,"day",1,31),{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u})}if(e=dz.exec(r),e){const[t,n,i,a,s,o,l,u]=e;return mz(Jp(pz(a),zv(i),yo(n,"day",1,31),{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u}))}if(e=fz.exec(r),e){const[t,n,i,a,s,o,l,u]=e;return Jp(xg(Ef(u)),zv(n),yo(i.trimLeft(),"day",1,31),{hours:a,minutes:s,seconds:o,fractionalMilliseconds:l})}throw new TypeError("Invalid RFC-7231 date-time value")},hz=r=>{if(r==null)return;let e;if(typeof r=="number")e=r;else if(typeof r=="string")e=ez(r);else if(typeof r=="object"&&r.tag===1)e=r.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(e)||e===1/0||e===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(e*1e3))},Jp=(r,e,t,n)=>{const i=e-1;return yz(r,i,t),new Date(Date.UTC(r,i,t,yo(n.hours,"hour",0,23),yo(n.minutes,"minute",0,59),yo(n.seconds,"seconds",0,60),wz(n.fractionalMilliseconds)))},pz=r=>{const e=new Date().getUTCFullYear(),t=Math.floor(e/100)*100+xg(Ef(r));return t<e?t+100:t},gz=50*365*24*60*60*1e3,mz=r=>r.getTime()-new Date().getTime()>gz?new Date(Date.UTC(r.getUTCFullYear()-100,r.getUTCMonth(),r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds())):r,zv=r=>{const e=$1.indexOf(r);if(e<0)throw new TypeError(`Invalid month: ${r}`);return e+1},vz=[31,28,31,30,31,30,31,31,30,31,30,31],yz=(r,e,t)=>{let n=vz[e];if(e===1&&Az(r)&&(n=29),t>n)throw new TypeError(`Invalid day for ${$1[e]} in ${r}: ${t}`)},Az=r=>r%4===0&&(r%100!==0||r%400===0),yo=(r,e,t,n)=>{const i=nz(Ef(r));if(i<t||i>n)throw new TypeError(`${e} must be between ${t} and ${n}, inclusive`);return i},wz=r=>r==null?0:tz("0."+r)*1e3,bz=r=>{const e=r[0];let t=1;if(e=="+")t=1;else if(e=="-")t=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);const n=Number(r.substring(1,3)),i=Number(r.substring(4,6));return t*(n*60+i)*60*1e3},Ef=r=>{let e=0;for(;e<r.length-1&&r.charAt(e)==="0";)e++;return e===0?r:r.slice(e)},po=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})};po.from=r=>r&&typeof r=="object"&&(r instanceof po||"deserializeJSON"in r)?r:typeof r=="string"||Object.getPrototypeOf(r)===String.prototype?po(String(r)):po(JSON.stringify(r));po.fromObject=po.from;const zE=/^-?\d*(\.\d+)?$/;class ns{string;type;constructor(e,t){if(this.string=e,this.type=t,!zE.test(e))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!="object")return!1;const t=e;return ns.prototype.isPrototypeOf(e)||t.type==="bigDecimal"&&zE.test(t.string)}}const qI={},wA={};for(let r=0;r<256;r++){let e=r.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),qI[r]=e,wA[e]=r}function WI(r){if(r.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(r.length/2);for(let t=0;t<r.length;t+=2){const n=r.slice(t,t+2).toLowerCase();if(n in wA)e[t/2]=wA[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return e}function Ao(r){let e="";for(let t=0;t<r.byteLength;t++)e+=qI[r[t]];return e}const $E=typeof TextEncoder=="function"?new TextEncoder:null,Cz=r=>{if(typeof r=="string"){if($E)return $E.encode(r).byteLength;let e=r.length;for(let t=e-1;t>=0;t--){const n=r.charCodeAt(t);n>127&&n<=2047?e++:n>2047&&n<=65535&&(e+=2),n>=56320&&n<=57343&&t--}return e}else{if(typeof r.byteLength=="number")return r.byteLength;if(typeof r.size=="number")return r.size}throw new Error(`Body Length computation failed for ${r}`)},kf=r=>typeof r=="string"?kl(r):ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(r),xz=r=>typeof ArrayBuffer=="function"&&r instanceof ArrayBuffer||Object.prototype.toString.call(r)==="[object ArrayBuffer]",QI=async r=>{},Sz=async r=>{const e=r?.Bucket||"";if(typeof r.Bucket=="string"&&(r.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),Iz(e)){if(r.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!Fz(e)||e.indexOf(".")!==-1&&!String(r.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(r.ForcePathStyle=!0);return r.DisableMultiRegionAccessPoints&&(r.disableMultiRegionAccessPoints=!0,r.DisableMRAP=!0),r},Ez=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,kz=/(\d+\.){3}\d+/,Tz=/\.\./,Fz=r=>Ez.test(r)&&!kz.test(r)&&!Tz.test(r),Iz=r=>{const[e,t,n,,,i]=r.split(":"),a=e==="arn"&&r.split(":").length>=6,s=!!(a&&t&&n&&i);if(a&&!s)throw new Error(`Invalid ARN: ${r} was an invalid ARN.`);return s},Pz=(r,e,t,n=!1)=>{const i=async()=>{let a;return n?a=t.clientContextParams?.[r]??t[r]??t[e]:a=t[r]??t[e],typeof a=="function"?a():a};return r==="credentialScope"||e==="CredentialScope"?async()=>{const a=typeof t.credentials=="function"?await t.credentials():t.credentials;return a?.credentialScope??a?.CredentialScope}:r==="accountId"||e==="AccountId"?async()=>{const a=typeof t.credentials=="function"?await t.credentials():t.credentials;return a?.accountId??a?.AccountId}:r==="endpoint"||e==="endpoint"?async()=>{if(t.isCustomEndpoint===!1)return;const a=await i();if(a&&typeof a=="object"){if("url"in a)return a.url.href;if("hostname"in a){const{protocol:s,hostname:o,port:l,path:u}=a;return`${s}//${o}${l?":"+l:""}${u}`}}return a}:i};function Dz(r){return async(e,t,n,i)=>{if(!n.isCustomEndpoint){let o;n.serviceConfiguredEndpoint?o=await n.serviceConfiguredEndpoint():o=await r(n.serviceId),o&&(n.endpoint=()=>Promise.resolve(V1(o)),n.isCustomEndpoint=!0)}const a=await Rz(e,t,n);if(typeof n.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");const s=n.endpointProvider(a,i);if(n.isCustomEndpoint&&n.endpoint){const o=await n.endpoint();if(o?.headers){s.headers??={};for(const[l,u]of Object.entries(o.headers))s.headers[l]=Array.isArray(u)?u:[u]}}return s}}const Rz=async(r,e,t)=>{const n={},i=e?.getEndpointParameterInstructions?.()||{};for(const[a,s]of Object.entries(i))switch(s.type){case"staticContextParams":n[a]=s.value;break;case"contextParams":n[a]=r[s.name];break;case"clientContextParams":case"builtInParams":n[a]=await Pz(s.name,a,t,s.type!=="builtInParams")();break;case"operationContextParams":n[a]=s.get(r);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(s))}return Object.keys(i).length===0&&Object.assign(n,t),String(t.serviceId).toLowerCase()==="s3"&&await Sz(n),n};function Oz(r,e,t){r.__smithy_context?r.__smithy_context.features||(r.__smithy_context.features={}):r.__smithy_context={features:{}},r.__smithy_context.features[e]=t}function Bz(r){const e=Dz(r);return({config:t,instructions:n})=>(i,a)=>async s=>{t.isCustomEndpoint&&Oz(a,"ENDPOINT_OVERRIDE","N");const o=await e(s.input,{getEndpointParameterInstructions(){return n}},{...t},a);a.endpointV2=o,a.authSchemes=o.properties?.authSchemes;const l=a.authSchemes?.[0];if(l){a.signing_region=l.signingRegion,a.signing_service=l.signingName;const c=vc(a)?.selectedHttpAuthScheme?.httpAuthOption;c&&(c.signingProperties=Object.assign(c.signingProperties||{},{signing_region:l.signingRegion,signingRegion:l.signingRegion,signing_service:l.signingName,signingName:l.signingName,signingRegionSet:l.signingRegionSet},l.properties))}return i({...s})}}const Mz={name:"serializerMiddleware"},_z={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Mz.name};function Nz(r){const e=Bz(r);return(t,n)=>({applyToStack:i=>{i.addRelativeTo(e({config:t,instructions:n}),_z)}})}function Lz(r){return e=>{const t=e.tls??!0,{endpoint:n,useDualstackEndpoint:i,useFipsEndpoint:a}=e,s=n!=null?async()=>V1(await Bs(n)()):void 0,l=Object.assign(e,{endpoint:s,tls:t,isCustomEndpoint:!!n,useDualstackEndpoint:Bs(i??!1),useFipsEndpoint:Bs(a??!1)});let u;return l.serviceConfiguredEndpoint=async()=>(e.serviceId&&!u&&(u=r(e.serviceId)),u),l}}class H1{nodes;root;conditions;results;constructor(e,t,n,i){this.nodes=e,this.root=t,this.conditions=n,this.results=i}static from(e,t,n,i){return new H1(e,t,n,i)}}class Uz{capacity;data=new Map;parameters=[];constructor({size:e,params:t}){this.capacity=e??50,t&&(this.parameters=t)}get(e,t){const n=this.hash(e);if(n===!1)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const i=this.data.keys();let a=0;for(;;){const{value:s,done:o}=i.next();if(this.data.delete(s),o||++a>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t="";const{parameters:n}=this;if(n.length===0)return!1;for(const i of n){const a=String(e[i]??"");if(a.includes("|;"))return!1;t+=a+"|;"}return t}}class Ba extends Error{constructor(e){super(e),this.name="EndpointError"}}const Vz="endpoints";function Sg(r){return typeof r!="object"||r==null?r:"ref"in r?`$${Sg(r.ref)}`:"fn"in r?`${r.fn}(${(r.argv||[]).map(Sg).join(", ")})`:JSON.stringify(r,null,2)}const G1={},zz=(r,e)=>r===e;function $z(...r){for(const e of r)if(e!=null)return e}const Hz=r=>{const e=r.split("."),t=[];for(const n of e){const i=n.indexOf("[");if(i!==-1){if(n.indexOf("]")!==n.length-1)throw new Ba(`Path: '${r}' does not end with ']'`);const a=n.slice(i+1,-1);if(Number.isNaN(parseInt(a)))throw new Ba(`Invalid array index: '${a}' in path: '${r}'`);i!==0&&t.push(n.slice(0,i)),t.push(a)}else t.push(n)}return t},YI=(r,e)=>Hz(e).reduce((t,n)=>{if(typeof t!="object")throw new Ba(`Index '${n}' in '${e}' not found in '${JSON.stringify(r)}'`);if(Array.isArray(t)){const i=parseInt(n);return t[i<0?t.length+i:i]}return t[n]},r),Gz=r=>r!=null;function jz(r,e,t){return r?e:t}const qz=r=>!r,Wz=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),XI=r=>Wz.test(r)||r.startsWith("[")&&r.endsWith("]"),$v={[xf.HTTP]:80,[xf.HTTPS]:443},Qz=r=>{const e=(()=>{try{if(r instanceof URL)return r;if(typeof r=="object"&&"hostname"in r){const{hostname:d,port:h,protocol:g="",path:v="",query:y={}}=r,A=new URL(`${g}//${d}${h?`:${h}`:""}${v}`);return A.search=Object.entries(y).map(([C,S])=>`${C}=${S}`).join("&"),A}return new URL(r)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(r)} as a whatwg URL.`),null;const t=e.href,{host:n,hostname:i,pathname:a,protocol:s,search:o}=e;if(o)return null;const l=s.slice(0,-1);if(!Object.values(xf).includes(l))return null;const u=XI(i),c=t.includes(`${n}:${$v[l]}`)||typeof r=="string"&&r.includes(`${n}:${$v[l]}`),f=`${n}${c?`:${$v[l]}`:""}`;return{scheme:l,authority:f,path:a,normalizedPath:a.endsWith("/")?a:`${a}/`,isIp:u}};function Yz(r,e,t){if(t===1)return[r];if(r==="")return[""];const n=r.split(e);return t===0?n:n.slice(0,t-1).concat(n.slice(1).join(e))}const Xz=(r,e)=>r===e,Jz=(r,e,t,n)=>r==null||e>=t||r.length<t||/[^\u0000-\u007f]/.test(r)?null:n?r.substring(r.length-t,r.length-e):r.substring(e,t),Kz=r=>encodeURIComponent(r).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Zz={booleanEquals:zz,coalesce:$z,getAttr:YI,isSet:Gz,isValidHostLabel:Kg,ite:jz,not:qz,parseURL:Qz,split:Yz,stringEquals:Xz,substring:Jz,uriEncode:Kz},JI=(r,e)=>{const t=[],{referenceRecord:n,endpointParams:i}=e;let a=0;for(;a<r.length;){const s=r.indexOf("{",a);if(s===-1){t.push(r.slice(a));break}t.push(r.slice(a,s));const o=r.indexOf("}",s);if(o===-1){t.push(r.slice(s));break}r[s+1]==="{"&&r[o+1]==="}"&&(t.push(r.slice(s+1,o)),a=o+2);const l=r.substring(s+1,o);if(l.includes("#")){const[u,c]=l.split("#");t.push(YI(n[u]??i[u],c))}else t.push(n[l]??i[l]);a=o+1}return t.join("")},e$=({ref:r},e)=>e.referenceRecord[r]??e.endpointParams[r],rm=(r,e,t)=>{if(typeof r=="string")return JI(r,t);if(r.fn)return ZI.callFunction(r,t);if(r.ref)return e$(r,t);throw new Ba(`'${e}': ${String(r)} is not a string, function or reference.`)},KI=({fn:r,argv:e},t)=>{const n=Array(e.length);for(let s=0;s<n.length;++s){const o=e[s];typeof o=="boolean"||typeof o=="number"?n[s]=o:n[s]=ZI.evaluateExpression(o,"arg",t)}const i=r.indexOf(".");if(i!==-1){const o=G1[r.slice(0,i)]?.[r.slice(i+1)];if(typeof o=="function")return o(...n)}const a=Zz[r];if(typeof a=="function")return a(...n);throw new Error(`function ${r} not loaded in endpointFunctions.`)},ZI={evaluateExpression:rm,callFunction:KI},t$=(r,e)=>{const{assign:t}=r;if(t&&t in e.referenceRecord)throw new Ba(`'${t}' is already defined in Reference Record.`);const n=KI(r,e);e.logger?.debug?.(`${Vz} evaluateCondition: ${Sg(r)} = ${Sg(n)}`);const i=n===""?!0:!!n;return t!=null?{result:i,toAssign:{name:t,value:n}}:{result:i}},r$=(r,e)=>Object.entries(r??{}).reduce((t,[n,i])=>(t[n]=i.map(a=>{const s=rm(a,"Header value entry",e);if(typeof s!="string")throw new Ba(`Header '${n}' value '${s}' is not a string`);return s}),t),{}),eP=(r,e)=>Object.entries(r).reduce((t,[n,i])=>(t[n]=rP.getEndpointProperty(i,e),t),{}),tP=(r,e)=>{if(Array.isArray(r))return r.map(t=>tP(t,e));switch(typeof r){case"string":return JI(r,e);case"object":if(r===null)throw new Ba(`Unexpected endpoint property: ${r}`);return rP.getEndpointProperties(r,e);case"boolean":return r;default:throw new Ba(`Unexpected endpoint property type: ${typeof r}`)}},rP={getEndpointProperty:tP,getEndpointProperties:eP},n$=(r,e)=>{const t=rm(r,"Endpoint URL",e);if(typeof t=="string")try{return new URL(t)}catch(n){throw console.error(`Failed to construct URL with ${t}`,n),n}throw new Ba(`Endpoint URL must be a string, got ${typeof t}`)},Hv=1e8,i$=(r,e)=>{const{nodes:t,root:n,results:i,conditions:a}=r;let s=n;const o={},l={referenceRecord:o,endpointParams:e.endpointParams,logger:e.logger};for(;s!==1&&s!==-1&&s<Hv;){const u=3*(Math.abs(s)-1),[c,f,d]=[t[u],t[u+1],t[u+2]],[h,g,v]=a[c],y=t$({fn:h,assign:v,argv:g},l);if(y.toAssign){const{name:A,value:C}=y.toAssign;o[A]=C}s=s>=0===y.result?f:d}if(s>=Hv){const u=i[s-Hv];if(u[0]===-1){const[,h]=u;throw new Ba(rm(h,"Error",l))}const[c,f,d]=u;return{url:n$(c,l),properties:eP(f,l),headers:r$(d??{},l)}}throw new Ba("No matching endpoint.")},a$=Lz(QI),nP=Nz(QI);class Gv extends YV(em,kl,Cg,Zg){}const s$=r=>crypto.getRandomValues(r),iP=XV(s$),o$=iP,bA=async(r=new Uint8Array,e)=>{if(r instanceof Uint8Array)return Gv.mutate(r);if(!r)return Gv.mutate(new Uint8Array);const t=e.streamCollector(r);return Gv.mutate(await t)};class l${serdeContext;setSerdeContext(e){this.serdeContext=e}}class u$ extends l${options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=Zi.for(e.defaultNamespace);for(const t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return na}getResponseType(){return sc}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,t){if("url"in t){e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,e.query||(e.query={});for(const[n,i]of t.url.searchParams.entries())e.query[n]=i;if(t.headers)for(const n in t.headers)e.headers[n]=t.headers[n].join(", ");return e}else{if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(const n in t.headers)e.headers[n]=t.headers[n];return e}}setHostPrefix(e,t,n){if(this.serdeContext?.disableHostPrefix)return;const i=vi.of(t.input),a=zd(t.traits??{});if(a.endpoint){let s=a.endpoint?.[0];if(typeof s=="string"){for(const[o,l]of i.structIterator()){if(!l.getMergedTraits().hostLabel)continue;const u=n[o];if(typeof u!="string")throw new Error(`@smithy/core/schema - ${o} in input must be a string as hostLabel.`);s=s.replace(`{${o}}`,u)}e.hostname=s+e.hostname}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n})}async loadEventStreamCapability(){const{EventStreamSerde:e,eventStreamSerdeProvider:t}=await Promise.resolve().then(()=>require("./index.browser-BcaHQIWS.cjs")),n=this.resolveEventStreamMarshaller(t);return new e({marshaller:n,serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}resolveEventStreamMarshaller(e){const t=this.serdeContext;return t.eventStreamMarshaller?t.eventStreamMarshaller:e(this.serdeContext)}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,t,n,i,a){return[]}getEventStreamMarshaller(){const e=this.serdeContext;if(!e.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class c$ extends u${async serializeRequest(e,t,n){const i=this.serializer,a={},s={},o=await n.endpoint(),l=vi.of(e?.input),u=l.getSchema();let c;const f=t&&typeof t=="object"?t:{},d=new na({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:a,headers:s,body:void 0});if(o&&(this.updateServiceEndpoint(d,o),this.setHostPrefix(d,e,f)),f){const h=l.getEventStreamMember();if(h){if(f[h]){const g={};for(const[v,y]of l.structIterator())v!==h&&f[v]&&(i.write(y,f[v]),g[v]=i.flush());c=await this.serializeEventStream({eventStream:f[h],requestSchema:l,initialRequest:g})}}else i.write(u,f),c=i.flush()}return d.headers=Object.assign(d.headers,s),d.query=a,d.body=c,d.method="POST",d}async deserializeResponse(e,t,n){const i=this.deserializer,a=vi.of(e.output),s={};if(n.statusCode>=300){const l=await bA(n.body,t);throw l.byteLength>0&&Object.assign(s,await i.read(15,l)),await this.handleError(e,t,n,s,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const l in n.headers){const u=n.headers[l];delete n.headers[l],n.headers[l.toLowerCase()]=u}const o=a.getEventStreamMember();if(o)s[o]=await this.deserializeEventStream({response:n,responseSchema:a,initialResponseContainer:s});else{const l=await bA(n.body,t);l.byteLength>0&&Object.assign(s,await i.read(a,l))}return s.$metadata=this.deserializeMetadata(n),s}}function aP(r,e){if(e.timestampFormat.useTrait&&r.isTimestampSchema()&&(r.getSchema()===5||r.getSchema()===6||r.getSchema()===7))return r.getSchema();const{httpLabel:t,httpPrefixHeaders:n,httpHeader:i,httpQuery:a}=r.getMergedTraits();return(e.httpBindings?typeof n=="string"||i?6:a||t?5:void 0:void 0)??e.timestampFormat.default}const d$=r=>({setHttpHandler(e){r.httpHandler=e},httpHandler(){return r.httpHandler},updateHttpClientConfig(e,t){r.httpHandler?.updateHttpClientConfig(e,t)},httpHandlerConfigs(){return r.httpHandler.httpHandlerConfigs()}}),f$=r=>({httpHandler:r.httpHandler()}),HE="content-length";function h$(r){return e=>async t=>{const n=t.request;if(na.isInstance(n)){const{body:i,headers:a}=n;if(i&&Object.keys(a).map(s=>s.toLowerCase()).indexOf(HE)===-1)try{const s=r(i);n.headers={...n.headers,[HE]:String(s)}}catch{}}return e({...t,request:n})}}const p$={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},g$=r=>({applyToStack:e=>{e.add(h$(r.bodyLengthChecker),p$)}}),Cl=r=>encodeURIComponent(r).replace(/[!'()*]/g,m$),m$=r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`;function v$(r){const e=[];for(let t of Object.keys(r).sort()){const n=r[t];if(t=Cl(t),Array.isArray(n))for(let i=0,a=n.length;i<a;i++)e.push(`${t}=${Cl(n[i])}`);else{let i=t;(n||typeof n=="string")&&(i+=`=${Cl(n)}`),e.push(i)}}return e.join("&")}const y$=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],A$=["TimeoutError","RequestTimeout","RequestTimeoutException"],w$=[500,502,503,504],b$=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],C$=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND","EAI_AGAIN"],x$=r=>r?.$retryable!==void 0,S$=r=>r.$metadata?.clockSkewCorrected,E$=r=>{const e=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return r&&r instanceof TypeError?e.has(r.message):!1},sP=r=>r.$metadata?.httpStatusCode===429||y$.includes(r.name)||r.$retryable?.throttling==!0,j1=(r,e=0)=>x$(r)||S$(r)||r.name==="InvalidSignatureException"&&r.message?.includes("Signature expired")||A$.includes(r.name)||b$.includes(r?.code||"")||C$.includes(r?.code||"")||w$.includes(r.$metadata?.httpStatusCode||0)||E$(r)||T$(r)||r.cause!==void 0&&e<=10&&j1(r.cause,e+1),k$=r=>{if(r.$metadata?.httpStatusCode!==void 0){const e=r.$metadata.httpStatusCode;return 500<=e&&e<=599&&!j1(r)}return!1};function T$(r){return r.code==="ERR_HTTP2_STREAM_ERROR"&&r.message.includes("NGHTTP2_REFUSED_STREAM")}const oP=20*1e3,GE=500,F$=1,I$="amz-sdk-invocation-id",P$="amz-sdk-request";function D$(r,e){if(sc.isInstance(r))for(const t of Object.keys(r.headers)){const n=t.toLowerCase();if(n==="retry-after"){const i=r.headers[t];let a=NaN;if(i.endsWith("GMT"))try{a=(jI(i).getTime()-Date.now())/1e3}catch(s){e?.trace?.("Failed to parse retry-after header"),e?.trace?.(s)}else i.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?a=Number(i.match(/ GMT, ([\d.]+)$/)?.[1]):i.match(/^((\d+)|(\d+\.\d+))$/)?a=Number(i):Date.parse(i)>=Date.now()&&(a=(Date.parse(i)-Date.now())/1e3);return isNaN(a)?void 0:new Date(Date.now()+a*1e3)}else if(n==="x-amz-retry-after"){const i=r.headers[t],a=Number(i);if(isNaN(a)){e?.trace?.(`Failed to parse x-amz-retry-after=${i}`);return}return new Date(Date.now()+a)}}}const R$=r=>r instanceof Error?r:r instanceof Object?Object.assign(new Error,r):typeof r=="string"?new Error(r):new Error(`AWS SDK error wrapper for ${r}`);function O$(r){return e=>(t,n)=>async i=>{let a=await e.retryStrategy();const s=await e.maxAttempts();if(M$(a)){a=a;let o=await a.acquireInitialRetryToken((n.partition_id??"")+(n.__retryLongPoll?":longpoll":"")),l=new Error,u=0,c=0;const{request:f}=i,d=na.isInstance(f);for(d&&(f.headers[I$]=iP());;)try{d&&(f.headers[P$]=`attempt=${u+1}; max=${s}`);const{response:h,output:g}=await t(i);return a.recordSuccess(o),g.$metadata.attempts=u+1,g.$metadata.totalRetryDelay=c,{response:h,output:g}}catch(h){const g=_$(h,e.logger);if(l=R$(h),d&&r(f))throw(n.logger instanceof $I?console:n.logger)?.warn("An error was encountered in a non-retryable streaming request."),l;try{o=await a.refreshRetryTokenForRetry(o,g)}catch{throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=u+1,l.$metadata.totalRetryDelay=c,l}u=o.getRetryCount();const v=o.getRetryDelay();c+=(o?.$retryLog?.acquisitionDelay??0)+v,v>0&&await B$(v)}}else return a=a,a?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",a.mode]]),a.retry(t,i)}}const B$=r=>new Promise(e=>setTimeout(e,r)),M$=r=>typeof r.acquireInitialRetryToken<"u"&&typeof r.refreshRetryTokenForRetry<"u"&&typeof r.recordSuccess<"u",_$=(r,e)=>{const t={error:r,errorType:N$(r)},n=D$(r.$response,e);return n&&(t.retryAfterHint=n),t},N$=r=>sP(r)?"THROTTLING":j1(r)?"TRANSIENT":k$(r)?"SERVER_ERROR":"CLIENT_ERROR",L$={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0};function U$(r){const e=O$(r);return t=>({applyToStack:n=>{n.add(e(t),L$)}})}class q1{static setTimeoutFn=(e,t)=>setTimeout(e,t);beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(e){let t;this.updateMeasuredRate();const n=e;if(n?.errorType==="THROTTLING"||sP(n?.error??e)){const s=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=s,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(s),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const a=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(a)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(e){if(this.enabled){for(this.refillTokenBucket();e>this.availableTokens;){const t=(e-this.availableTokens)/this.fillRate*1e3;await new Promise(n=>q1.setTimeoutFn(n,t)),this.refillTokenBucket()}this.availableTokens=this.availableTokens-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}const t=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+t),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(e*2)/2;if(this.requestCount++,t>this.lastTxRateBucket){const n=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}class Ei{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return Ei.v2026?50:100}static throttlingDelay(){return Ei.v2026?1e3:500}static cost(){return Ei.v2026?14:5}static throttlingCost(){return Ei.v2026?5:10}static modifiedCostType(){return Ei.v2026?"THROTTLING":"TRANSIENT"}}class V${x=Ei.delay();computeNextBackoffDelay(e){const i=Math.random()*Math.min(this.x*2**e,oP);return Math.floor(i)}setDelayBase(e){this.x=e}}class jE{delay;count;cost;longPoll;$retryLog={acquisitionDelay:0};constructor(e,t,n,i){this.delay=e,this.count=t,this.cost=n,this.longPoll=i}getRetryCount(){return this.count}getRetryDelay(){return Math.min(oP,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}var Po;(function(r){r.STANDARD="standard",r.ADAPTIVE="adaptive"})(Po||(Po={}));const ef=3,z$=Po.STANDARD,kp={incompatible:1,attempts:2,capacity:3};class CA{mode=Po.STANDARD;retryBackoffStrategy;capacity=GE;maxAttemptsProvider;baseDelay;constructor(e){typeof e=="number"?this.maxAttemptsProvider=async()=>e:typeof e=="function"?this.maxAttemptsProvider=e:e&&typeof e=="object"&&(this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff),this.maxAttemptsProvider??=async()=>ef,this.baseDelay??=Ei.delay(),this.retryBackoffStrategy??=new V$}async acquireInitialRetryToken(e){return new jE(Ei.delay(),0,void 0,Ei.v2026&&e.includes(":longpoll"))}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts(),i=this.retryCode(e,t,n),a=i===0,s=e.isLongPoll?.();if(a||s){const o=t.errorType;this.retryBackoffStrategy.setDelayBase(o==="THROTTLING"?Ei.throttlingDelay():this.baseDelay);const l=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount());let u=l;if(t.retryAfterHint instanceof Date&&(u=Math.max(l,Math.min(t.retryAfterHint.getTime()-Date.now(),l+5e3))),a){const c=this.getCapacityCost(o);this.capacity-=c;const f=new jE(0,e.getRetryCount()+1,c,e.isLongPoll?.()??!1);return await new Promise(d=>setTimeout(d,u)),f.$retryLog.acquisitionDelay=u,f}else{const c=Ei.v2026&&i===kp.capacity&&s?u:0;c>0&&await new Promise(f=>setTimeout(f,c))}}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.min(GE,this.capacity+(e.getRetryCost()??F$))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${ef}`),ef}}retryCode(e,t,n){const i=e.getRetryCount()+1,a=this.isRetryableError(t.errorType)?0:kp.incompatible,s=i<n?0:kp.attempts,o=this.capacity>=this.getCapacityCost(t.errorType)?0:kp.capacity;return a||s||o}getCapacityCost(e){return e===Ei.modifiedCostType()?Ei.throttlingCost():Ei.cost()}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class $${mode=Po.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(e,t){const{rateLimiter:n}=t??{};this.rateLimiter=n??new q1,this.standardRetryStrategy=t?new CA({maxAttempts:typeof e=="number"?e:3,...t}):new CA(e)}async acquireInitialRetryToken(e){const t=await this.standardRetryStrategy.acquireInitialRetryToken(e);return await this.rateLimiter.getSendToken(),t}async refreshRetryTokenForRetry(e,t){this.rateLimiter.updateClientSendingRate(t);const n=await this.standardRetryStrategy.refreshRetryTokenForRetry(e,t);return await this.rateLimiter.getSendToken(),n}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}const H$=(r,e)=>{const{retryStrategy:t,retryMode:n}=r,{defaultMaxAttempts:i=ef,defaultBaseDelay:a=Ei.delay()}={},s=Bs(r.maxAttempts??i);let o=t?Promise.resolve(t):void 0;const l=async()=>{const u=await s();return await Bs(n)()===Po.ADAPTIVE?new $$(s,{maxAttempts:u,baseDelay:a}):new CA({maxAttempts:u,baseDelay:a})};return Object.assign(r,{maxAttempts:s,retryStrategy:()=>o??=l()})},G$=U$(TV);Ei.v2026||=typeof process=="object"&&process.env?.AWS_NEW_RETRIES_2026==="true";function Is(r,e,t){r.__aws_sdk_context?r.__aws_sdk_context.features||(r.__aws_sdk_context.features={}):r.__aws_sdk_context={features:{}},r.__aws_sdk_context.features[e]=t}const j$=r=>e=>async t=>{if(!na.isInstance(t.request))return e(t);const{request:n}=t,{handlerProtocol:i=""}=r.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!n.headers[":authority"])delete n.headers.host,n.headers[":authority"]=n.hostname+(n.port?":"+n.port:"");else if(!n.headers.host){let a=n.hostname;n.port!=null&&(a+=`:${n.port}`),n.headers.host=a}return e(t)},q$={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},W$=r=>({applyToStack:e=>{e.add(j$(r),q$)}}),Q$=()=>(r,e)=>async t=>{try{const n=await r(t),{clientName:i,commandName:a,logger:s,dynamoDbDocumentClientOptions:o={}}=e,{overrideInputFilterSensitiveLog:l,overrideOutputFilterSensitiveLog:u}=o,c=l??e.inputFilterSensitiveLog,f=u??e.outputFilterSensitiveLog,{$metadata:d,...h}=n.output;return s?.info?.({clientName:i,commandName:a,input:c(t.input),output:f(h),metadata:d}),n}catch(n){const{clientName:i,commandName:a,logger:s,dynamoDbDocumentClientOptions:o={}}=e,{overrideInputFilterSensitiveLog:l}=o,u=l??e.inputFilterSensitiveLog;throw s?.error?.({clientName:i,commandName:a,input:u(t.input),error:n,metadata:n.$metadata}),n}},Y$={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},X$=r=>({applyToStack:e=>{e.add(Q$(),Y$)}}),J$=r=>({applyToStack:e=>{}}),K$=(r,e)=>{if(!e||e.length===0)return r;const t=[];for(const n of e)for(const i of r)i.schemeId.split("#")[1]===n&&t.push(i);for(const n of r)t.find(({schemeId:i})=>i===n.schemeId)||t.push(n);return t};function Z$(r){const e=new Map;for(const t of r)e.set(t.schemeId,t);return e}const eH=(r,e)=>(t,n)=>async i=>{const a=r.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(r,n,i.input)),s=r.authSchemePreference?await r.authSchemePreference():[],o=K$(a,s),l=Z$(r.httpAuthSchemes),u=vc(n),c=[];for(const f of o){const d=l.get(f.schemeId);if(!d){c.push(`HttpAuthScheme \`${f.schemeId}\` was not enabled for this service.`);continue}const h=d.identityProvider(await e.identityProviderConfigProvider(r));if(!h){c.push(`HttpAuthScheme \`${f.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:g={},signingProperties:v={}}=f.propertiesExtractor?.(r,n)||{};f.identityProperties=Object.assign(f.identityProperties||{},g),f.signingProperties=Object.assign(f.signingProperties||{},v),u.selectedHttpAuthScheme={httpAuthOption:f,identity:await h(f.identityProperties),signer:d.signer};break}if(!u.selectedHttpAuthScheme)throw new Error(c.join(`
3042
+ `),az={warn:console.warn},sz=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],$1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function oz(r){const e=r.getUTCFullYear(),t=r.getUTCMonth(),n=r.getUTCDay(),i=r.getUTCDate(),a=r.getUTCHours(),s=r.getUTCMinutes(),o=r.getUTCSeconds(),l=i<10?`0${i}`:`${i}`,u=a<10?`0${a}`:`${a}`,c=s<10?`0${s}`:`${s}`,f=o<10?`0${o}`:`${o}`;return`${sz[n]}, ${l} ${$1[t]} ${e} ${u}:${c}:${f} GMT`}const lz=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),uz=r=>{if(r==null)return;if(typeof r!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=lz.exec(r);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[t,n,i,a,s,o,l,u,c]=e,f=xg(Ef(n)),d=yo(i,"month",1,12),h=yo(a,"day",1,31),g=Jp(f,d,h,{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u});return c.toUpperCase()!="Z"&&g.setTime(g.getTime()-bz(c)),g},cz=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),dz=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),fz=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),jI=r=>{if(r==null)return;if(typeof r!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let e=cz.exec(r);if(e){const[t,n,i,a,s,o,l,u]=e;return Jp(xg(Ef(a)),zv(i),yo(n,"day",1,31),{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u})}if(e=dz.exec(r),e){const[t,n,i,a,s,o,l,u]=e;return mz(Jp(pz(a),zv(i),yo(n,"day",1,31),{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u}))}if(e=fz.exec(r),e){const[t,n,i,a,s,o,l,u]=e;return Jp(xg(Ef(u)),zv(n),yo(i.trimLeft(),"day",1,31),{hours:a,minutes:s,seconds:o,fractionalMilliseconds:l})}throw new TypeError("Invalid RFC-7231 date-time value")},hz=r=>{if(r==null)return;let e;if(typeof r=="number")e=r;else if(typeof r=="string")e=ez(r);else if(typeof r=="object"&&r.tag===1)e=r.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(e)||e===1/0||e===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(e*1e3))},Jp=(r,e,t,n)=>{const i=e-1;return yz(r,i,t),new Date(Date.UTC(r,i,t,yo(n.hours,"hour",0,23),yo(n.minutes,"minute",0,59),yo(n.seconds,"seconds",0,60),wz(n.fractionalMilliseconds)))},pz=r=>{const e=new Date().getUTCFullYear(),t=Math.floor(e/100)*100+xg(Ef(r));return t<e?t+100:t},gz=50*365*24*60*60*1e3,mz=r=>r.getTime()-new Date().getTime()>gz?new Date(Date.UTC(r.getUTCFullYear()-100,r.getUTCMonth(),r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds())):r,zv=r=>{const e=$1.indexOf(r);if(e<0)throw new TypeError(`Invalid month: ${r}`);return e+1},vz=[31,28,31,30,31,30,31,31,30,31,30,31],yz=(r,e,t)=>{let n=vz[e];if(e===1&&Az(r)&&(n=29),t>n)throw new TypeError(`Invalid day for ${$1[e]} in ${r}: ${t}`)},Az=r=>r%4===0&&(r%100!==0||r%400===0),yo=(r,e,t,n)=>{const i=nz(Ef(r));if(i<t||i>n)throw new TypeError(`${e} must be between ${t} and ${n}, inclusive`);return i},wz=r=>r==null?0:tz("0."+r)*1e3,bz=r=>{const e=r[0];let t=1;if(e=="+")t=1;else if(e=="-")t=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);const n=Number(r.substring(1,3)),i=Number(r.substring(4,6));return t*(n*60+i)*60*1e3},Ef=r=>{let e=0;for(;e<r.length-1&&r.charAt(e)==="0";)e++;return e===0?r:r.slice(e)},po=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})};po.from=r=>r&&typeof r=="object"&&(r instanceof po||"deserializeJSON"in r)?r:typeof r=="string"||Object.getPrototypeOf(r)===String.prototype?po(String(r)):po(JSON.stringify(r));po.fromObject=po.from;const zE=/^-?\d*(\.\d+)?$/;class ns{string;type;constructor(e,t){if(this.string=e,this.type=t,!zE.test(e))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!="object")return!1;const t=e;return ns.prototype.isPrototypeOf(e)||t.type==="bigDecimal"&&zE.test(t.string)}}const qI={},wA={};for(let r=0;r<256;r++){let e=r.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),qI[r]=e,wA[e]=r}function WI(r){if(r.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(r.length/2);for(let t=0;t<r.length;t+=2){const n=r.slice(t,t+2).toLowerCase();if(n in wA)e[t/2]=wA[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return e}function Ao(r){let e="";for(let t=0;t<r.byteLength;t++)e+=qI[r[t]];return e}const $E=typeof TextEncoder=="function"?new TextEncoder:null,Cz=r=>{if(typeof r=="string"){if($E)return $E.encode(r).byteLength;let e=r.length;for(let t=e-1;t>=0;t--){const n=r.charCodeAt(t);n>127&&n<=2047?e++:n>2047&&n<=65535&&(e+=2),n>=56320&&n<=57343&&t--}return e}else{if(typeof r.byteLength=="number")return r.byteLength;if(typeof r.size=="number")return r.size}throw new Error(`Body Length computation failed for ${r}`)},kf=r=>typeof r=="string"?kl(r):ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(r),xz=r=>typeof ArrayBuffer=="function"&&r instanceof ArrayBuffer||Object.prototype.toString.call(r)==="[object ArrayBuffer]",QI=async r=>{},Sz=async r=>{const e=r?.Bucket||"";if(typeof r.Bucket=="string"&&(r.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),Iz(e)){if(r.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!Fz(e)||e.indexOf(".")!==-1&&!String(r.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(r.ForcePathStyle=!0);return r.DisableMultiRegionAccessPoints&&(r.disableMultiRegionAccessPoints=!0,r.DisableMRAP=!0),r},Ez=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,kz=/(\d+\.){3}\d+/,Tz=/\.\./,Fz=r=>Ez.test(r)&&!kz.test(r)&&!Tz.test(r),Iz=r=>{const[e,t,n,,,i]=r.split(":"),a=e==="arn"&&r.split(":").length>=6,s=!!(a&&t&&n&&i);if(a&&!s)throw new Error(`Invalid ARN: ${r} was an invalid ARN.`);return s},Pz=(r,e,t,n=!1)=>{const i=async()=>{let a;return n?a=t.clientContextParams?.[r]??t[r]??t[e]:a=t[r]??t[e],typeof a=="function"?a():a};return r==="credentialScope"||e==="CredentialScope"?async()=>{const a=typeof t.credentials=="function"?await t.credentials():t.credentials;return a?.credentialScope??a?.CredentialScope}:r==="accountId"||e==="AccountId"?async()=>{const a=typeof t.credentials=="function"?await t.credentials():t.credentials;return a?.accountId??a?.AccountId}:r==="endpoint"||e==="endpoint"?async()=>{if(t.isCustomEndpoint===!1)return;const a=await i();if(a&&typeof a=="object"){if("url"in a)return a.url.href;if("hostname"in a){const{protocol:s,hostname:o,port:l,path:u}=a;return`${s}//${o}${l?":"+l:""}${u}`}}return a}:i};function Dz(r){return async(e,t,n,i)=>{if(!n.isCustomEndpoint){let o;n.serviceConfiguredEndpoint?o=await n.serviceConfiguredEndpoint():o=await r(n.serviceId),o&&(n.endpoint=()=>Promise.resolve(V1(o)),n.isCustomEndpoint=!0)}const a=await Rz(e,t,n);if(typeof n.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");const s=n.endpointProvider(a,i);if(n.isCustomEndpoint&&n.endpoint){const o=await n.endpoint();if(o?.headers){s.headers??={};for(const[l,u]of Object.entries(o.headers))s.headers[l]=Array.isArray(u)?u:[u]}}return s}}const Rz=async(r,e,t)=>{const n={},i=e?.getEndpointParameterInstructions?.()||{};for(const[a,s]of Object.entries(i))switch(s.type){case"staticContextParams":n[a]=s.value;break;case"contextParams":n[a]=r[s.name];break;case"clientContextParams":case"builtInParams":n[a]=await Pz(s.name,a,t,s.type!=="builtInParams")();break;case"operationContextParams":n[a]=s.get(r);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(s))}return Object.keys(i).length===0&&Object.assign(n,t),String(t.serviceId).toLowerCase()==="s3"&&await Sz(n),n};function Oz(r,e,t){r.__smithy_context?r.__smithy_context.features||(r.__smithy_context.features={}):r.__smithy_context={features:{}},r.__smithy_context.features[e]=t}function Bz(r){const e=Dz(r);return({config:t,instructions:n})=>(i,a)=>async s=>{t.isCustomEndpoint&&Oz(a,"ENDPOINT_OVERRIDE","N");const o=await e(s.input,{getEndpointParameterInstructions(){return n}},{...t},a);a.endpointV2=o,a.authSchemes=o.properties?.authSchemes;const l=a.authSchemes?.[0];if(l){a.signing_region=l.signingRegion,a.signing_service=l.signingName;const c=vc(a)?.selectedHttpAuthScheme?.httpAuthOption;c&&(c.signingProperties=Object.assign(c.signingProperties||{},{signing_region:l.signingRegion,signingRegion:l.signingRegion,signing_service:l.signingName,signingName:l.signingName,signingRegionSet:l.signingRegionSet},l.properties))}return i({...s})}}const Mz={name:"serializerMiddleware"},_z={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Mz.name};function Nz(r){const e=Bz(r);return(t,n)=>({applyToStack:i=>{i.addRelativeTo(e({config:t,instructions:n}),_z)}})}function Lz(r){return e=>{const t=e.tls??!0,{endpoint:n,useDualstackEndpoint:i,useFipsEndpoint:a}=e,s=n!=null?async()=>V1(await Bs(n)()):void 0,l=Object.assign(e,{endpoint:s,tls:t,isCustomEndpoint:!!n,useDualstackEndpoint:Bs(i??!1),useFipsEndpoint:Bs(a??!1)});let u;return l.serviceConfiguredEndpoint=async()=>(e.serviceId&&!u&&(u=r(e.serviceId)),u),l}}class H1{nodes;root;conditions;results;constructor(e,t,n,i){this.nodes=e,this.root=t,this.conditions=n,this.results=i}static from(e,t,n,i){return new H1(e,t,n,i)}}class Uz{capacity;data=new Map;parameters=[];constructor({size:e,params:t}){this.capacity=e??50,t&&(this.parameters=t)}get(e,t){const n=this.hash(e);if(n===!1)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const i=this.data.keys();let a=0;for(;;){const{value:s,done:o}=i.next();if(this.data.delete(s),o||++a>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t="";const{parameters:n}=this;if(n.length===0)return!1;for(const i of n){const a=String(e[i]??"");if(a.includes("|;"))return!1;t+=a+"|;"}return t}}class Ba extends Error{constructor(e){super(e),this.name="EndpointError"}}const Vz="endpoints";function Sg(r){return typeof r!="object"||r==null?r:"ref"in r?`$${Sg(r.ref)}`:"fn"in r?`${r.fn}(${(r.argv||[]).map(Sg).join(", ")})`:JSON.stringify(r,null,2)}const G1={},zz=(r,e)=>r===e;function $z(...r){for(const e of r)if(e!=null)return e}const Hz=r=>{const e=r.split("."),t=[];for(const n of e){const i=n.indexOf("[");if(i!==-1){if(n.indexOf("]")!==n.length-1)throw new Ba(`Path: '${r}' does not end with ']'`);const a=n.slice(i+1,-1);if(Number.isNaN(parseInt(a)))throw new Ba(`Invalid array index: '${a}' in path: '${r}'`);i!==0&&t.push(n.slice(0,i)),t.push(a)}else t.push(n)}return t},YI=(r,e)=>Hz(e).reduce((t,n)=>{if(typeof t!="object")throw new Ba(`Index '${n}' in '${e}' not found in '${JSON.stringify(r)}'`);if(Array.isArray(t)){const i=parseInt(n);return t[i<0?t.length+i:i]}return t[n]},r),Gz=r=>r!=null;function jz(r,e,t){return r?e:t}const qz=r=>!r,Wz=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),XI=r=>Wz.test(r)||r.startsWith("[")&&r.endsWith("]"),$v={[xf.HTTP]:80,[xf.HTTPS]:443},Qz=r=>{const e=(()=>{try{if(r instanceof URL)return r;if(typeof r=="object"&&"hostname"in r){const{hostname:d,port:h,protocol:g="",path:v="",query:y={}}=r,A=new URL(`${g}//${d}${h?`:${h}`:""}${v}`);return A.search=Object.entries(y).map(([C,S])=>`${C}=${S}`).join("&"),A}return new URL(r)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(r)} as a whatwg URL.`),null;const t=e.href,{host:n,hostname:i,pathname:a,protocol:s,search:o}=e;if(o)return null;const l=s.slice(0,-1);if(!Object.values(xf).includes(l))return null;const u=XI(i),c=t.includes(`${n}:${$v[l]}`)||typeof r=="string"&&r.includes(`${n}:${$v[l]}`),f=`${n}${c?`:${$v[l]}`:""}`;return{scheme:l,authority:f,path:a,normalizedPath:a.endsWith("/")?a:`${a}/`,isIp:u}};function Yz(r,e,t){if(t===1)return[r];if(r==="")return[""];const n=r.split(e);return t===0?n:n.slice(0,t-1).concat(n.slice(1).join(e))}const Xz=(r,e)=>r===e,Jz=(r,e,t,n)=>r==null||e>=t||r.length<t||/[^\u0000-\u007f]/.test(r)?null:n?r.substring(r.length-t,r.length-e):r.substring(e,t),Kz=r=>encodeURIComponent(r).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Zz={booleanEquals:zz,coalesce:$z,getAttr:YI,isSet:Gz,isValidHostLabel:Kg,ite:jz,not:qz,parseURL:Qz,split:Yz,stringEquals:Xz,substring:Jz,uriEncode:Kz},JI=(r,e)=>{const t=[],{referenceRecord:n,endpointParams:i}=e;let a=0;for(;a<r.length;){const s=r.indexOf("{",a);if(s===-1){t.push(r.slice(a));break}t.push(r.slice(a,s));const o=r.indexOf("}",s);if(o===-1){t.push(r.slice(s));break}r[s+1]==="{"&&r[o+1]==="}"&&(t.push(r.slice(s+1,o)),a=o+2);const l=r.substring(s+1,o);if(l.includes("#")){const[u,c]=l.split("#");t.push(YI(n[u]??i[u],c))}else t.push(n[l]??i[l]);a=o+1}return t.join("")},e$=({ref:r},e)=>e.referenceRecord[r]??e.endpointParams[r],rm=(r,e,t)=>{if(typeof r=="string")return JI(r,t);if(r.fn)return ZI.callFunction(r,t);if(r.ref)return e$(r,t);throw new Ba(`'${e}': ${String(r)} is not a string, function or reference.`)},KI=({fn:r,argv:e},t)=>{const n=Array(e.length);for(let s=0;s<n.length;++s){const o=e[s];typeof o=="boolean"||typeof o=="number"?n[s]=o:n[s]=ZI.evaluateExpression(o,"arg",t)}const i=r.indexOf(".");if(i!==-1){const o=G1[r.slice(0,i)]?.[r.slice(i+1)];if(typeof o=="function")return o(...n)}const a=Zz[r];if(typeof a=="function")return a(...n);throw new Error(`function ${r} not loaded in endpointFunctions.`)},ZI={evaluateExpression:rm,callFunction:KI},t$=(r,e)=>{const{assign:t}=r;if(t&&t in e.referenceRecord)throw new Ba(`'${t}' is already defined in Reference Record.`);const n=KI(r,e);e.logger?.debug?.(`${Vz} evaluateCondition: ${Sg(r)} = ${Sg(n)}`);const i=n===""?!0:!!n;return t!=null?{result:i,toAssign:{name:t,value:n}}:{result:i}},r$=(r,e)=>Object.entries(r??{}).reduce((t,[n,i])=>(t[n]=i.map(a=>{const s=rm(a,"Header value entry",e);if(typeof s!="string")throw new Ba(`Header '${n}' value '${s}' is not a string`);return s}),t),{}),eP=(r,e)=>Object.entries(r).reduce((t,[n,i])=>(t[n]=rP.getEndpointProperty(i,e),t),{}),tP=(r,e)=>{if(Array.isArray(r))return r.map(t=>tP(t,e));switch(typeof r){case"string":return JI(r,e);case"object":if(r===null)throw new Ba(`Unexpected endpoint property: ${r}`);return rP.getEndpointProperties(r,e);case"boolean":return r;default:throw new Ba(`Unexpected endpoint property type: ${typeof r}`)}},rP={getEndpointProperty:tP,getEndpointProperties:eP},n$=(r,e)=>{const t=rm(r,"Endpoint URL",e);if(typeof t=="string")try{return new URL(t)}catch(n){throw console.error(`Failed to construct URL with ${t}`,n),n}throw new Ba(`Endpoint URL must be a string, got ${typeof t}`)},Hv=1e8,i$=(r,e)=>{const{nodes:t,root:n,results:i,conditions:a}=r;let s=n;const o={},l={referenceRecord:o,endpointParams:e.endpointParams,logger:e.logger};for(;s!==1&&s!==-1&&s<Hv;){const u=3*(Math.abs(s)-1),[c,f,d]=[t[u],t[u+1],t[u+2]],[h,g,v]=a[c],y=t$({fn:h,assign:v,argv:g},l);if(y.toAssign){const{name:A,value:C}=y.toAssign;o[A]=C}s=s>=0===y.result?f:d}if(s>=Hv){const u=i[s-Hv];if(u[0]===-1){const[,h]=u;throw new Ba(rm(h,"Error",l))}const[c,f,d]=u;return{url:n$(c,l),properties:eP(f,l),headers:r$(d??{},l)}}throw new Ba("No matching endpoint.")},a$=Lz(QI),nP=Nz(QI);class Gv extends YV(em,kl,Cg,Zg){}const s$=r=>crypto.getRandomValues(r),iP=XV(s$),o$=iP,bA=async(r=new Uint8Array,e)=>{if(r instanceof Uint8Array)return Gv.mutate(r);if(!r)return Gv.mutate(new Uint8Array);const t=e.streamCollector(r);return Gv.mutate(await t)};class l${serdeContext;setSerdeContext(e){this.serdeContext=e}}class u$ extends l${options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=Zi.for(e.defaultNamespace);for(const t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return na}getResponseType(){return sc}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,t){if("url"in t){e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,e.query||(e.query={});for(const[n,i]of t.url.searchParams.entries())e.query[n]=i;if(t.headers)for(const n in t.headers)e.headers[n]=t.headers[n].join(", ");return e}else{if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(const n in t.headers)e.headers[n]=t.headers[n];return e}}setHostPrefix(e,t,n){if(this.serdeContext?.disableHostPrefix)return;const i=vi.of(t.input),a=zd(t.traits??{});if(a.endpoint){let s=a.endpoint?.[0];if(typeof s=="string"){for(const[o,l]of i.structIterator()){if(!l.getMergedTraits().hostLabel)continue;const u=n[o];if(typeof u!="string")throw new Error(`@smithy/core/schema - ${o} in input must be a string as hostLabel.`);s=s.replace(`{${o}}`,u)}e.hostname=s+e.hostname}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n})}async loadEventStreamCapability(){const{EventStreamSerde:e,eventStreamSerdeProvider:t}=await Promise.resolve().then(()=>require("./index.browser-DxjOGyjg.cjs")),n=this.resolveEventStreamMarshaller(t);return new e({marshaller:n,serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}resolveEventStreamMarshaller(e){const t=this.serdeContext;return t.eventStreamMarshaller?t.eventStreamMarshaller:e(this.serdeContext)}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,t,n,i,a){return[]}getEventStreamMarshaller(){const e=this.serdeContext;if(!e.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class c$ extends u${async serializeRequest(e,t,n){const i=this.serializer,a={},s={},o=await n.endpoint(),l=vi.of(e?.input),u=l.getSchema();let c;const f=t&&typeof t=="object"?t:{},d=new na({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:a,headers:s,body:void 0});if(o&&(this.updateServiceEndpoint(d,o),this.setHostPrefix(d,e,f)),f){const h=l.getEventStreamMember();if(h){if(f[h]){const g={};for(const[v,y]of l.structIterator())v!==h&&f[v]&&(i.write(y,f[v]),g[v]=i.flush());c=await this.serializeEventStream({eventStream:f[h],requestSchema:l,initialRequest:g})}}else i.write(u,f),c=i.flush()}return d.headers=Object.assign(d.headers,s),d.query=a,d.body=c,d.method="POST",d}async deserializeResponse(e,t,n){const i=this.deserializer,a=vi.of(e.output),s={};if(n.statusCode>=300){const l=await bA(n.body,t);throw l.byteLength>0&&Object.assign(s,await i.read(15,l)),await this.handleError(e,t,n,s,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const l in n.headers){const u=n.headers[l];delete n.headers[l],n.headers[l.toLowerCase()]=u}const o=a.getEventStreamMember();if(o)s[o]=await this.deserializeEventStream({response:n,responseSchema:a,initialResponseContainer:s});else{const l=await bA(n.body,t);l.byteLength>0&&Object.assign(s,await i.read(a,l))}return s.$metadata=this.deserializeMetadata(n),s}}function aP(r,e){if(e.timestampFormat.useTrait&&r.isTimestampSchema()&&(r.getSchema()===5||r.getSchema()===6||r.getSchema()===7))return r.getSchema();const{httpLabel:t,httpPrefixHeaders:n,httpHeader:i,httpQuery:a}=r.getMergedTraits();return(e.httpBindings?typeof n=="string"||i?6:a||t?5:void 0:void 0)??e.timestampFormat.default}const d$=r=>({setHttpHandler(e){r.httpHandler=e},httpHandler(){return r.httpHandler},updateHttpClientConfig(e,t){r.httpHandler?.updateHttpClientConfig(e,t)},httpHandlerConfigs(){return r.httpHandler.httpHandlerConfigs()}}),f$=r=>({httpHandler:r.httpHandler()}),HE="content-length";function h$(r){return e=>async t=>{const n=t.request;if(na.isInstance(n)){const{body:i,headers:a}=n;if(i&&Object.keys(a).map(s=>s.toLowerCase()).indexOf(HE)===-1)try{const s=r(i);n.headers={...n.headers,[HE]:String(s)}}catch{}}return e({...t,request:n})}}const p$={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},g$=r=>({applyToStack:e=>{e.add(h$(r.bodyLengthChecker),p$)}}),Cl=r=>encodeURIComponent(r).replace(/[!'()*]/g,m$),m$=r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`;function v$(r){const e=[];for(let t of Object.keys(r).sort()){const n=r[t];if(t=Cl(t),Array.isArray(n))for(let i=0,a=n.length;i<a;i++)e.push(`${t}=${Cl(n[i])}`);else{let i=t;(n||typeof n=="string")&&(i+=`=${Cl(n)}`),e.push(i)}}return e.join("&")}const y$=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],A$=["TimeoutError","RequestTimeout","RequestTimeoutException"],w$=[500,502,503,504],b$=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],C$=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND","EAI_AGAIN"],x$=r=>r?.$retryable!==void 0,S$=r=>r.$metadata?.clockSkewCorrected,E$=r=>{const e=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return r&&r instanceof TypeError?e.has(r.message):!1},sP=r=>r.$metadata?.httpStatusCode===429||y$.includes(r.name)||r.$retryable?.throttling==!0,j1=(r,e=0)=>x$(r)||S$(r)||r.name==="InvalidSignatureException"&&r.message?.includes("Signature expired")||A$.includes(r.name)||b$.includes(r?.code||"")||C$.includes(r?.code||"")||w$.includes(r.$metadata?.httpStatusCode||0)||E$(r)||T$(r)||r.cause!==void 0&&e<=10&&j1(r.cause,e+1),k$=r=>{if(r.$metadata?.httpStatusCode!==void 0){const e=r.$metadata.httpStatusCode;return 500<=e&&e<=599&&!j1(r)}return!1};function T$(r){return r.code==="ERR_HTTP2_STREAM_ERROR"&&r.message.includes("NGHTTP2_REFUSED_STREAM")}const oP=20*1e3,GE=500,F$=1,I$="amz-sdk-invocation-id",P$="amz-sdk-request";function D$(r,e){if(sc.isInstance(r))for(const t of Object.keys(r.headers)){const n=t.toLowerCase();if(n==="retry-after"){const i=r.headers[t];let a=NaN;if(i.endsWith("GMT"))try{a=(jI(i).getTime()-Date.now())/1e3}catch(s){e?.trace?.("Failed to parse retry-after header"),e?.trace?.(s)}else i.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?a=Number(i.match(/ GMT, ([\d.]+)$/)?.[1]):i.match(/^((\d+)|(\d+\.\d+))$/)?a=Number(i):Date.parse(i)>=Date.now()&&(a=(Date.parse(i)-Date.now())/1e3);return isNaN(a)?void 0:new Date(Date.now()+a*1e3)}else if(n==="x-amz-retry-after"){const i=r.headers[t],a=Number(i);if(isNaN(a)){e?.trace?.(`Failed to parse x-amz-retry-after=${i}`);return}return new Date(Date.now()+a)}}}const R$=r=>r instanceof Error?r:r instanceof Object?Object.assign(new Error,r):typeof r=="string"?new Error(r):new Error(`AWS SDK error wrapper for ${r}`);function O$(r){return e=>(t,n)=>async i=>{let a=await e.retryStrategy();const s=await e.maxAttempts();if(M$(a)){a=a;let o=await a.acquireInitialRetryToken((n.partition_id??"")+(n.__retryLongPoll?":longpoll":"")),l=new Error,u=0,c=0;const{request:f}=i,d=na.isInstance(f);for(d&&(f.headers[I$]=iP());;)try{d&&(f.headers[P$]=`attempt=${u+1}; max=${s}`);const{response:h,output:g}=await t(i);return a.recordSuccess(o),g.$metadata.attempts=u+1,g.$metadata.totalRetryDelay=c,{response:h,output:g}}catch(h){const g=_$(h,e.logger);if(l=R$(h),d&&r(f))throw(n.logger instanceof $I?console:n.logger)?.warn("An error was encountered in a non-retryable streaming request."),l;try{o=await a.refreshRetryTokenForRetry(o,g)}catch{throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=u+1,l.$metadata.totalRetryDelay=c,l}u=o.getRetryCount();const v=o.getRetryDelay();c+=(o?.$retryLog?.acquisitionDelay??0)+v,v>0&&await B$(v)}}else return a=a,a?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",a.mode]]),a.retry(t,i)}}const B$=r=>new Promise(e=>setTimeout(e,r)),M$=r=>typeof r.acquireInitialRetryToken<"u"&&typeof r.refreshRetryTokenForRetry<"u"&&typeof r.recordSuccess<"u",_$=(r,e)=>{const t={error:r,errorType:N$(r)},n=D$(r.$response,e);return n&&(t.retryAfterHint=n),t},N$=r=>sP(r)?"THROTTLING":j1(r)?"TRANSIENT":k$(r)?"SERVER_ERROR":"CLIENT_ERROR",L$={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0};function U$(r){const e=O$(r);return t=>({applyToStack:n=>{n.add(e(t),L$)}})}class q1{static setTimeoutFn=(e,t)=>setTimeout(e,t);beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(e){let t;this.updateMeasuredRate();const n=e;if(n?.errorType==="THROTTLING"||sP(n?.error??e)){const s=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=s,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(s),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const a=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(a)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(e){if(this.enabled){for(this.refillTokenBucket();e>this.availableTokens;){const t=(e-this.availableTokens)/this.fillRate*1e3;await new Promise(n=>q1.setTimeoutFn(n,t)),this.refillTokenBucket()}this.availableTokens=this.availableTokens-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}const t=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+t),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(e*2)/2;if(this.requestCount++,t>this.lastTxRateBucket){const n=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}class Ei{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return Ei.v2026?50:100}static throttlingDelay(){return Ei.v2026?1e3:500}static cost(){return Ei.v2026?14:5}static throttlingCost(){return Ei.v2026?5:10}static modifiedCostType(){return Ei.v2026?"THROTTLING":"TRANSIENT"}}class V${x=Ei.delay();computeNextBackoffDelay(e){const i=Math.random()*Math.min(this.x*2**e,oP);return Math.floor(i)}setDelayBase(e){this.x=e}}class jE{delay;count;cost;longPoll;$retryLog={acquisitionDelay:0};constructor(e,t,n,i){this.delay=e,this.count=t,this.cost=n,this.longPoll=i}getRetryCount(){return this.count}getRetryDelay(){return Math.min(oP,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}var Po;(function(r){r.STANDARD="standard",r.ADAPTIVE="adaptive"})(Po||(Po={}));const ef=3,z$=Po.STANDARD,kp={incompatible:1,attempts:2,capacity:3};class CA{mode=Po.STANDARD;retryBackoffStrategy;capacity=GE;maxAttemptsProvider;baseDelay;constructor(e){typeof e=="number"?this.maxAttemptsProvider=async()=>e:typeof e=="function"?this.maxAttemptsProvider=e:e&&typeof e=="object"&&(this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff),this.maxAttemptsProvider??=async()=>ef,this.baseDelay??=Ei.delay(),this.retryBackoffStrategy??=new V$}async acquireInitialRetryToken(e){return new jE(Ei.delay(),0,void 0,Ei.v2026&&e.includes(":longpoll"))}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts(),i=this.retryCode(e,t,n),a=i===0,s=e.isLongPoll?.();if(a||s){const o=t.errorType;this.retryBackoffStrategy.setDelayBase(o==="THROTTLING"?Ei.throttlingDelay():this.baseDelay);const l=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount());let u=l;if(t.retryAfterHint instanceof Date&&(u=Math.max(l,Math.min(t.retryAfterHint.getTime()-Date.now(),l+5e3))),a){const c=this.getCapacityCost(o);this.capacity-=c;const f=new jE(0,e.getRetryCount()+1,c,e.isLongPoll?.()??!1);return await new Promise(d=>setTimeout(d,u)),f.$retryLog.acquisitionDelay=u,f}else{const c=Ei.v2026&&i===kp.capacity&&s?u:0;c>0&&await new Promise(f=>setTimeout(f,c))}}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.min(GE,this.capacity+(e.getRetryCost()??F$))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${ef}`),ef}}retryCode(e,t,n){const i=e.getRetryCount()+1,a=this.isRetryableError(t.errorType)?0:kp.incompatible,s=i<n?0:kp.attempts,o=this.capacity>=this.getCapacityCost(t.errorType)?0:kp.capacity;return a||s||o}getCapacityCost(e){return e===Ei.modifiedCostType()?Ei.throttlingCost():Ei.cost()}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class $${mode=Po.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(e,t){const{rateLimiter:n}=t??{};this.rateLimiter=n??new q1,this.standardRetryStrategy=t?new CA({maxAttempts:typeof e=="number"?e:3,...t}):new CA(e)}async acquireInitialRetryToken(e){const t=await this.standardRetryStrategy.acquireInitialRetryToken(e);return await this.rateLimiter.getSendToken(),t}async refreshRetryTokenForRetry(e,t){this.rateLimiter.updateClientSendingRate(t);const n=await this.standardRetryStrategy.refreshRetryTokenForRetry(e,t);return await this.rateLimiter.getSendToken(),n}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}const H$=(r,e)=>{const{retryStrategy:t,retryMode:n}=r,{defaultMaxAttempts:i=ef,defaultBaseDelay:a=Ei.delay()}={},s=Bs(r.maxAttempts??i);let o=t?Promise.resolve(t):void 0;const l=async()=>{const u=await s();return await Bs(n)()===Po.ADAPTIVE?new $$(s,{maxAttempts:u,baseDelay:a}):new CA({maxAttempts:u,baseDelay:a})};return Object.assign(r,{maxAttempts:s,retryStrategy:()=>o??=l()})},G$=U$(TV);Ei.v2026||=typeof process=="object"&&process.env?.AWS_NEW_RETRIES_2026==="true";function Is(r,e,t){r.__aws_sdk_context?r.__aws_sdk_context.features||(r.__aws_sdk_context.features={}):r.__aws_sdk_context={features:{}},r.__aws_sdk_context.features[e]=t}const j$=r=>e=>async t=>{if(!na.isInstance(t.request))return e(t);const{request:n}=t,{handlerProtocol:i=""}=r.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!n.headers[":authority"])delete n.headers.host,n.headers[":authority"]=n.hostname+(n.port?":"+n.port:"");else if(!n.headers.host){let a=n.hostname;n.port!=null&&(a+=`:${n.port}`),n.headers.host=a}return e(t)},q$={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},W$=r=>({applyToStack:e=>{e.add(j$(r),q$)}}),Q$=()=>(r,e)=>async t=>{try{const n=await r(t),{clientName:i,commandName:a,logger:s,dynamoDbDocumentClientOptions:o={}}=e,{overrideInputFilterSensitiveLog:l,overrideOutputFilterSensitiveLog:u}=o,c=l??e.inputFilterSensitiveLog,f=u??e.outputFilterSensitiveLog,{$metadata:d,...h}=n.output;return s?.info?.({clientName:i,commandName:a,input:c(t.input),output:f(h),metadata:d}),n}catch(n){const{clientName:i,commandName:a,logger:s,dynamoDbDocumentClientOptions:o={}}=e,{overrideInputFilterSensitiveLog:l}=o,u=l??e.inputFilterSensitiveLog;throw s?.error?.({clientName:i,commandName:a,input:u(t.input),error:n,metadata:n.$metadata}),n}},Y$={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},X$=r=>({applyToStack:e=>{e.add(Q$(),Y$)}}),J$=r=>({applyToStack:e=>{}}),K$=(r,e)=>{if(!e||e.length===0)return r;const t=[];for(const n of e)for(const i of r)i.schemeId.split("#")[1]===n&&t.push(i);for(const n of r)t.find(({schemeId:i})=>i===n.schemeId)||t.push(n);return t};function Z$(r){const e=new Map;for(const t of r)e.set(t.schemeId,t);return e}const eH=(r,e)=>(t,n)=>async i=>{const a=r.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(r,n,i.input)),s=r.authSchemePreference?await r.authSchemePreference():[],o=K$(a,s),l=Z$(r.httpAuthSchemes),u=vc(n),c=[];for(const f of o){const d=l.get(f.schemeId);if(!d){c.push(`HttpAuthScheme \`${f.schemeId}\` was not enabled for this service.`);continue}const h=d.identityProvider(await e.identityProviderConfigProvider(r));if(!h){c.push(`HttpAuthScheme \`${f.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:g={},signingProperties:v={}}=f.propertiesExtractor?.(r,n)||{};f.identityProperties=Object.assign(f.identityProperties||{},g),f.signingProperties=Object.assign(f.signingProperties||{},v),u.selectedHttpAuthScheme={httpAuthOption:f,identity:await h(f.identityProperties),signer:d.signer};break}if(!u.selectedHttpAuthScheme)throw new Error(c.join(`
3043
3043
  `));return t(i)},tH={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},rH=(r,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:t})=>({applyToStack:n=>{n.addRelativeTo(eH(r,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:t}),tH)}}),nH=r=>e=>{throw e},iH=(r,e)=>{},aH=r=>(e,t)=>async n=>{if(!na.isInstance(n.request))return e(n);const a=vc(t).selectedHttpAuthScheme;if(!a)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:s={}},identity:o,signer:l}=a,u=await e({...n,request:await l.sign(n.request,o,s)}).catch((l.errorHandler||nH)(s));return(l.successHandler||iH)(u.response,s),u},sH={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},oH=r=>({applyToStack:e=>{e.addRelativeTo(aH(),sH)}}),tf=r=>{if(typeof r=="function")return r;const e=Promise.resolve(r);return()=>e};class lH{authSchemes=new Map;constructor(e){for(const t in e){const n=e[t];n!==void 0&&this.authSchemes.set(t,n)}}getIdentityProvider(e){return this.authSchemes.get(e)}}class uH{async sign(e,t,n){return e}}const cH=r=>function(t){return lP(t)&&t.expiration.getTime()-Date.now()<r},dH=3e5,fH=cH(dH),lP=r=>r.expiration!==void 0,hH=(r,e,t)=>{if(r===void 0)return;const n=typeof r!="function"?async()=>Promise.resolve(r):r;let i,a,s,o=!1;const l=async u=>{a||(a=n(u));try{i=await a,s=!0,o=!1}finally{a=void 0}return i};return e===void 0?async u=>((!s||u?.forceRefresh)&&(i=await l(u)),i):async u=>((!s||u?.forceRefresh)&&(i=await l(u)),o?i:t(i)?(e(i)&&await l(u),i):(o=!0,i))},pH=void 0;function gH(r){return r===void 0?!0:typeof r=="string"&&r.length<=50}function mH(r){const e=tf(r.userAgentAppId??pH),{customUserAgent:t}=r;return Object.assign(r,{customUserAgent:typeof t=="string"?[[t]]:t,userAgentAppId:async()=>{const n=await e();if(!gH(n)){const i=r.logger?.constructor?.name==="NoOpLogger"||!r.logger?console:r.logger;typeof n!="string"?i?.warn("userAgentAppId must be a string or undefined."):n.length>50&&i?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return n}})}const vH={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}]};let yH=vH;const AH=r=>{const{partitions:e}=yH;for(const n of e){const{regions:i,outputs:a}=n;for(const[s,o]of Object.entries(i))if(s===r)return{...a,...o}}for(const n of e){const{regionRegex:i,outputs:a}=n;if(new RegExp(i).test(r))return{...a}}const t=e.find(n=>n.id==="aws");if(!t)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...t.outputs}},wH=/\d{12}\.ddb/;async function bH(r,e,t){if(t.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&Is(r,"PROTOCOL_RPC_V2_CBOR","M"),typeof e.retryStrategy=="function"){const a=await e.retryStrategy();if(typeof a.mode=="string")switch(a.mode){case Po.ADAPTIVE:Is(r,"RETRY_MODE_ADAPTIVE","F");break;case Po.STANDARD:Is(r,"RETRY_MODE_STANDARD","E");break}}if(typeof e.accountIdEndpointMode=="function"){const a=r.endpointV2;switch(String(a?.url?.hostname).match(wH)&&Is(r,"ACCOUNT_ID_ENDPOINT","O"),await e.accountIdEndpointMode?.()){case"disabled":Is(r,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":Is(r,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":Is(r,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const i=r.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const a=i;a.accountId&&Is(r,"RESOLVED_ACCOUNT_ID","T");for(const[s,o]of Object.entries(a.$source??{}))Is(r,s,o)}}const qE="user-agent",jv="x-amz-user-agent",WE=" ",qv="/",CH=/[^!$%&'*+\-.^_`|~\w]/g,xH=/[^!$%&'*+\-.^_`|~\w#]/g,QE="-",SH=1024;function EH(r){let e="";for(const t in r){const n=r[t];if(e.length+n.length+1<=SH){e.length?e+=","+n:e+=n;continue}break}return e}const kH=r=>(e,t)=>async n=>{const{request:i}=n;if(!na.isInstance(i))return e(n);const{headers:a}=i,s=t?.userAgent?.map(Tp)||[],o=(await r.defaultUserAgentProvider()).map(Tp);await bH(t,r,n);const l=t;o.push(`m/${EH(Object.assign({},t.__smithy_context?.features,l.__aws_sdk_context?.features))}`);const u=r?.customUserAgent?.map(Tp)||[],c=await r.userAgentAppId();c&&o.push(Tp(["app",`${c}`]));const f=[].concat([...o,...s,...u]).join(WE),d=[...o.filter(h=>h.startsWith("aws-sdk-")),...u].join(WE);return r.runtime!=="browser"?(d&&(a[jv]=a[jv]?`${a[qE]} ${d}`:d),a[qE]=f):a[jv]=f,e({...n,request:i})},Tp=r=>{const e=r[0].split(qv).map(s=>s.replace(CH,QE)).join(qv),t=r[1]?.replace(xH,QE),n=e.indexOf(qv),i=e.substring(0,n);let a=e.substring(n+1);return i==="api"&&(a=a.toLowerCase()),[i,a,t].filter(s=>s&&s.length>0).reduce((s,o,l)=>{switch(l){case 0:return o;case 1:return`${s}/${o}`;default:return`${s}#${o}`}},"")},TH={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},FH=r=>({applyToStack:e=>{e.add(kH(r),TH)}}),IH=({serviceId:r,clientVersion:e})=>async t=>{const n=typeof window<"u"?window.navigator:void 0,i=n?.userAgent??"",a=n?.userAgentData?.platform??YE.os(i)??"other",s=void 0,o=n?.userAgentData?.brands??[],l=o[o.length-1],u=l?.brand??YE.browser(i)??"unknown",c=l?.version??"unknown",f=[["aws-sdk-js",e],["ua","2.1"],[`os/${a}`,s],["lang/js"],["md/browser",`${u}_${c}`]];r&&f.push([`api/${r}`,e]);const d=await t?.userAgentAppId?.();return d&&f.push([`app/${d}`]),f},YE={os(r){if(/iPhone|iPad|iPod/.test(r))return"iOS";if(/Macintosh|Mac OS X/.test(r))return"macOS";if(/Windows NT/.test(r))return"Windows";if(/Android/.test(r))return"Android";if(/Linux/.test(r))return"Linux"},browser(r){if(/EdgiOS|EdgA|Edg\//.test(r))return"Microsoft Edge";if(/Firefox\//.test(r))return"Firefox";if(/Chrome\//.test(r))return"Chrome";if(/Safari\//.test(r))return"Safari"}},uP=(r,e=!1)=>{if(e){for(const t of r.split("."))if(!uP(t))return!1;return!0}return!(!Kg(r)||r.length<3||r.length>63||r!==r.toLowerCase()||XI(r))},XE=":",PH="/",DH=r=>{const e=r.split(XE);if(e.length<6)return null;const[t,n,i,a,s,...o]=e;if(t!=="arn"||n===""||i===""||o.join(XE)==="")return null;const l=o.map(u=>u.split(PH)).flat();return{partition:n,service:i,region:a,accountId:s,resourceId:l}},cP={isVirtualHostableS3Bucket:uP,parseArn:DH,partition:AH};G1.aws=cP;const RH=(r,e,t)=>{let n,i,a,s=!1;const o=async()=>{i||(i=r());try{n=await i,a=!0,s=!1}finally{i=void 0}return n};return async l=>((!a||l?.forceRefresh)&&(n=await o()),n)},JE=new Set,OH=(r,e=Kg)=>{if(!JE.has(r)&&!e(r))if(r==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw new Error(`Region not accepted: region="${r}" is not a valid hostname component.`);else JE.add(r)},dP=r=>typeof r=="string"&&(r.startsWith("fips-")||r.endsWith("-fips")),BH=r=>dP(r)?["fips-aws-global","aws-fips"].includes(r)?"us-east-1":r.replace(/fips-(dkr-|prod-)?|-fips/,""):r,MH=r=>{const{region:e,useFipsEndpoint:t}=r;if(!e)throw new Error("Region is missing");return Object.assign(r,{region:async()=>{const n=typeof e=="function"?await e():e,i=BH(n);return OH(i),i},useFipsEndpoint:async()=>{const n=typeof e=="string"?e:await e();return dP(n)?!0:typeof t!="function"?Promise.resolve(!!t):t()}})},_H=["in-region","cross-region","mobile","standard","legacy"],NH=({defaultsMode:r}={})=>RH(async()=>{const e=typeof r=="function"?await r():r;switch(e?.toLowerCase()){case"auto":return Promise.resolve(LH()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(e?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${_H.join(", ")}, got ${e}`)}}),LH=()=>{const r=window?.navigator;if(r?.connection){const{effectiveType:e,rtt:t,downlink:n}=r?.connection;if(typeof e=="string"&&e!=="4g"||Number(t)>100||Number(n)<10)return!0}return r?.userAgentData?.mobile||typeof r?.maxTouchPoints=="number"&&r?.maxTouchPoints>1},UH=!1,VH=!1,zH=r=>({setRegion(e){r.region=e},region(){return r.region}}),$H=r=>({region:r.region()}),KE=r=>sc.isInstance(r)?r.headers?.date??r.headers?.Date:void 0,fP=r=>new Date(Date.now()+r),HH=(r,e)=>Math.abs(fP(e).getTime()-r)>=3e5,ZE=(r,e)=>{const t=Date.parse(r);return HH(t,e)?t-Date.now():e},rf=(r,e)=>{if(!e)throw new Error(`Property \`${r}\` is not resolved for AWS SDK SigV4Auth`);return e},GH=async r=>{const e=rf("context",r.context),t=rf("config",r.config),n=e.endpointV2?.properties?.authSchemes?.[0],a=await rf("signer",t.signer)(n),s=r?.signingRegion,o=r?.signingRegionSet,l=r?.signingName;return{config:t,signer:a,signingRegion:s,signingRegionSet:o,signingName:l}};class jH{async sign(e,t,n){if(!na.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const i=await GH(n),{config:a,signer:s}=i;let{signingRegion:o,signingName:l}=i;const u=n.context;if(u?.authSchemes?.length??!1){const[f,d]=u.authSchemes;f?.name==="sigv4a"&&d?.name==="sigv4"&&(o=d?.signingRegion??o,l=d?.signingName??l)}return n._preRequestSystemClockOffset=a.systemClockOffset,await s.sign(e,{signingDate:fP(a.systemClockOffset),signingRegion:o,signingService:l})}errorHandler(e){return t=>{const n=t,i=n.ServerTime??KE(n.$response);if(i){const a=rf("config",e.config),s=e._preRequestSystemClockOffset,o=ZE(i,a.systemClockOffset);(o!==a.systemClockOffset||s!==void 0&&s!==o)&&n.$metadata&&(a.systemClockOffset=o,n.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){const n=KE(e);if(n){const i=rf("config",t.config);i.systemClockOffset=ZE(n,i.systemClockOffset)}}}class qH{format(e){const t=[];for(const a of Object.keys(e)){const s=kl(a);t.push(Uint8Array.from([s.byteLength]),s,this.formatHeaderValue(e[a]))}const n=new Uint8Array(t.reduce((a,s)=>a+s.byteLength,0));let i=0;for(const a of t)n.set(a,i),i+=a.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const i=new Uint8Array(9);return i[0]=5,i.set(e.value.bytes,1),i;case"binary":const a=new DataView(new ArrayBuffer(3+e.value.byteLength));a.setUint8(0,6),a.setUint16(1,e.value.byteLength,!1);const s=new Uint8Array(a.buffer);return s.set(e.value,3),s;case"string":const o=kl(e.value),l=new DataView(new ArrayBuffer(3+o.byteLength));l.setUint8(0,7),l.setUint16(1,o.byteLength,!1);const u=new Uint8Array(l.buffer);return u.set(o,3),u;case"timestamp":const c=new Uint8Array(9);return c[0]=8,c.set(W1.fromNumber(e.value.valueOf()).bytes,1),c;case"uuid":if(!WH.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const f=new Uint8Array(17);return f[0]=9,f.set(WI(e.value.replace(/\-/g,"")),1),f}}}var e2;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(e2||(e2={}));const WH=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class W1{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const t=new Uint8Array(8);for(let n=7,i=Math.abs(Math.round(e));n>-1&&i>0;n--,i/=256)t[n]=i;return e<0&&t2(t),new W1(t)}valueOf(){const e=this.bytes.slice(0),t=e[0]&128;return t&&t2(e),parseInt(Ao(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function t2(r){for(let e=0;e<8;e++)r[e]^=255;for(let e=7;e>-1&&(r[e]++,r[e]===0);e--);}const QH="X-Amz-Algorithm",YH="X-Amz-Credential",hP="X-Amz-Date",XH="X-Amz-SignedHeaders",JH="X-Amz-Expires",pP="X-Amz-Signature",gP="X-Amz-Security-Token",mP="authorization",vP=hP.toLowerCase(),KH="date",ZH=[mP,vP,KH],eG=pP.toLowerCase(),xA="x-amz-content-sha256",tG=gP.toLowerCase(),rG={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},nG=/^proxy-/,iG=/^sec-/,Wv="AWS4-HMAC-SHA256",aG="AWS4-HMAC-SHA256-PAYLOAD",sG="UNSIGNED-PAYLOAD",oG=50,yP="aws4_request",lG=3600*24*7,uG=({query:r={}})=>{const e=[],t={};for(const n of Object.keys(r)){if(n.toLowerCase()===eG)continue;const i=Cl(n);e.push(i);const a=r[n];typeof a=="string"?t[i]=`${i}=${Cl(a)}`:Array.isArray(a)&&(t[i]=a.slice(0).reduce((s,o)=>s.concat([`${i}=${Cl(o)}`]),[]).sort().join("&"))}return e.sort().map(n=>t[n]).filter(n=>n).join("&")},cG=r=>dG(r).toISOString().replace(/\.\d{3}Z$/,"Z"),dG=r=>typeof r=="number"?new Date(r*1e3):typeof r=="string"?Number(r)?new Date(Number(r)*1e3):new Date(r):r;class fG{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:t,region:n,service:i,sha256:a,uriEscapePath:s=!0}){this.service=i,this.sha256=a,this.uriEscapePath=s,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=Bs(n),this.credentialProvider=Bs(t)}createCanonicalRequest(e,t,n){const i=Object.keys(t).sort();return`${e.method}
3044
3044
  ${this.getCanonicalPath(e)}
3045
3045
  ${uG(e)}
@@ -3053,7 +3053,7 @@ ${t}
3053
3053
  ${Ao(s)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const t=[];for(const a of e.split("/"))a?.length!==0&&a!=="."&&(a===".."?t.pop():t.push(a));const n=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return Cl(n).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(e){const t=cG(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}}const Fp={},Qv=[],Yv=(r,e,t)=>`${r}/${e}/${t}/${yP}`,hG=async(r,e,t,n,i)=>{const a=await r2(r,e.secretAccessKey,e.accessKeyId),s=`${t}:${n}:${i}:${Ao(a)}:${e.sessionToken}`;if(s in Fp)return Fp[s];for(Qv.push(s);Qv.length>oG;)delete Fp[Qv.shift()];let o=`AWS4${e.secretAccessKey}`;for(const l of[t,n,i,yP])o=await r2(r,o,l);return Fp[s]=o},r2=(r,e,t)=>{const n=new r(e);return n.update(kf(t)),n.digest()},n2=({headers:r},e,t)=>{const n={};for(const i of Object.keys(r).sort()){if(r[i]==null)continue;const a=i.toLowerCase();(a in rG||e?.has(a)||nG.test(a)||iG.test(a))&&(!t||t&&!t.has(a))||(n[a]=r[i].trim().replace(/\s+/g," "))}return n},Xv=async({headers:r,body:e},t)=>{for(const n of Object.keys(r))if(n.toLowerCase()===xA)return r[n];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||xz(e)){const n=new t;return n.update(kf(e)),Ao(await n.digest())}return sG},pG=(r,e)=>{r=r.toLowerCase();for(const t of Object.keys(e))if(r===t.toLowerCase())return!0;return!1},gG=(r,e={})=>{const{headers:t,query:n={}}=na.clone(r);for(const i of Object.keys(t)){const a=i.toLowerCase();(a.slice(0,6)==="x-amz-"&&!e.unhoistableHeaders?.has(a)||e.hoistableHeaders?.has(a))&&(n[i]=t[i],delete t[i])}return{...r,headers:t,query:n}},i2=r=>{r=na.clone(r);for(const e of Object.keys(r.headers))ZH.indexOf(e.toLowerCase())>-1&&delete r.headers[e];return r};class a2 extends fG{headerFormatter=new qH;constructor({applyChecksum:e,credentials:t,region:n,service:i,sha256:a,uriEscapePath:s=!0}){super({applyChecksum:e,credentials:t,region:n,service:i,sha256:a,uriEscapePath:s})}async presign(e,t={}){const{signingDate:n=new Date,expiresIn:i=3600,unsignableHeaders:a,unhoistableHeaders:s,signableHeaders:o,hoistableHeaders:l,signingRegion:u,signingService:c}=t,f=await this.credentialProvider();this.validateResolvedCredentials(f);const d=u??await this.regionProvider(),{longDate:h,shortDate:g}=this.formatDate(n);if(i>lG)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const v=Yv(g,d,c??this.service),y=gG(i2(e),{unhoistableHeaders:s,hoistableHeaders:l});f.sessionToken&&(y.query[gP]=f.sessionToken),y.query[QH]=Wv,y.query[YH]=`${f.accessKeyId}/${v}`,y.query[hP]=h,y.query[JH]=i.toString(10);const A=n2(y,a,o);return y.query[XH]=this.getCanonicalHeaderList(A),y.query[pP]=await this.getSignature(h,v,this.getSigningKey(f,d,g,c),this.createCanonicalRequest(y,A,await Xv(e,this.sha256))),y}async sign(e,t){return typeof e=="string"?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:n=new Date,priorSignature:i,signingRegion:a,signingService:s,eventStreamCredentials:o}){const l=a??await this.regionProvider(),{shortDate:u,longDate:c}=this.formatDate(n),f=Yv(u,l,s??this.service),d=await Xv({headers:{},body:t},this.sha256),h=new this.sha256;h.update(e);const g=Ao(await h.digest()),v=[aG,c,f,i,g,d].join(`
3054
3054
  `);return this.signString(v,{signingDate:n,signingRegion:l,signingService:s,eventStreamCredentials:o})}async signMessage(e,{signingDate:t=new Date,signingRegion:n,signingService:i,eventStreamCredentials:a}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:n,signingService:i,priorSignature:e.priorSignature,eventStreamCredentials:a}).then(o=>({message:e.message,signature:o}))}async signString(e,{signingDate:t=new Date,signingRegion:n,signingService:i,eventStreamCredentials:a}={}){const s=a??await this.credentialProvider();this.validateResolvedCredentials(s);const o=n??await this.regionProvider(),{shortDate:l}=this.formatDate(t),u=new this.sha256(await this.getSigningKey(s,o,l,i));return u.update(kf(e)),Ao(await u.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:n,unsignableHeaders:i,signingRegion:a,signingService:s}={}){const o=await this.credentialProvider();this.validateResolvedCredentials(o);const l=a??await this.regionProvider(),u=i2(e),{longDate:c,shortDate:f}=this.formatDate(t),d=Yv(f,l,s??this.service);u.headers[vP]=c,o.sessionToken&&(u.headers[tG]=o.sessionToken);const h=await Xv(u,this.sha256);!pG(xA,u.headers)&&this.applyChecksum&&(u.headers[xA]=h);const g=n2(u,i,n),v=await this.getSignature(c,d,this.getSigningKey(o,l,f,s),this.createCanonicalRequest(u,g,h));return u.headers[mP]=`${Wv} Credential=${o.accessKeyId}/${d}, SignedHeaders=${this.getCanonicalHeaderList(g)}, Signature=${v}`,u}async getSignature(e,t,n,i){const a=await this.createStringToSign(e,t,i,Wv),s=new this.sha256(await n);return s.update(kf(a)),Ao(await s.digest())}getSigningKey(e,t,n,i){return hG(this.sha256,e,n,t,i||this.service)}}const mG=r=>{let e=r.credentials,t=!!r.credentials,n;Object.defineProperty(r,"credentials",{set(u){u&&u!==e&&u!==n&&(t=!0),e=u;const c=vG(r,{credentials:e,credentialDefaultProvider:r.credentialDefaultProvider}),f=yG(r,c);if(t&&!f.attributed){const d=typeof e=="object"&&e!==null;n=async h=>{const v=await f(h);return d&&(!v.$source||Object.keys(v.$source).length===0)?kV(v,"CREDENTIALS_CODE","e"):v},n.memoized=f.memoized,n.configBound=f.configBound,n.attributed=!0}else n=f},get(){return n},enumerable:!0,configurable:!0}),r.credentials=e;const{signingEscapePath:i=!0,systemClockOffset:a=r.systemClockOffset||0,sha256:s}=r;let o;return r.signer?o=tf(r.signer):r.regionInfoProvider?o=()=>tf(r.region)().then(async u=>[await r.regionInfoProvider(u,{useFipsEndpoint:await r.useFipsEndpoint(),useDualstackEndpoint:await r.useDualstackEndpoint()})||{},u]).then(([u,c])=>{const{signingRegion:f,signingService:d}=u;r.signingRegion=r.signingRegion||f||c,r.signingName=r.signingName||d||r.serviceId;const h={...r,credentials:r.credentials,region:r.signingRegion,service:r.signingName,sha256:s,uriEscapePath:i},g=r.signerConstructor||a2;return new g(h)}):o=async u=>{u=Object.assign({},{name:"sigv4",signingName:r.signingName||r.defaultSigningName,signingRegion:await tf(r.region)(),properties:{}},u);const c=u.signingRegion,f=u.signingName;r.signingRegion=r.signingRegion||c,r.signingName=r.signingName||f||r.serviceId;const d={...r,credentials:r.credentials,region:r.signingRegion,service:r.signingName,sha256:s,uriEscapePath:i},h=r.signerConstructor||a2;return new h(d)},Object.assign(r,{systemClockOffset:a,signingEscapePath:i,signer:o})};function vG(r,{credentials:e,credentialDefaultProvider:t}){let n;return e?e?.memoized?n=e:n=hH(e,fH,lP):t?n=tf(t(Object.assign({},r,{parentClientConfig:r}))):n=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},n.memoized=!0,n}function yG(r,e){if(e.configBound)return e;const t=async n=>e({...n,callerClientConfig:r});return t.memoized=e.memoized,t.configBound=!0,t}const AG=async(r,e,t)=>({operation:vc(e).operation,region:await Bs(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function wG(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-idp",region:r.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function Ur(r){return{schemeId:"smithy.api#noAuth"}}const bG=r=>{const e=[];switch(r.operation){case"AssociateSoftwareToken":{e.push(Ur());break}case"ChangePassword":{e.push(Ur());break}case"CompleteWebAuthnRegistration":{e.push(Ur());break}case"ConfirmDevice":{e.push(Ur());break}case"ConfirmForgotPassword":{e.push(Ur());break}case"ConfirmSignUp":{e.push(Ur());break}case"DeleteUser":{e.push(Ur());break}case"DeleteUserAttributes":{e.push(Ur());break}case"DeleteWebAuthnCredential":{e.push(Ur());break}case"ForgetDevice":{e.push(Ur());break}case"ForgotPassword":{e.push(Ur());break}case"GetDevice":{e.push(Ur());break}case"GetTokensFromRefreshToken":{e.push(Ur());break}case"GetUser":{e.push(Ur());break}case"GetUserAttributeVerificationCode":{e.push(Ur());break}case"GetUserAuthFactors":{e.push(Ur());break}case"GlobalSignOut":{e.push(Ur());break}case"InitiateAuth":{e.push(Ur());break}case"ListDevices":{e.push(Ur());break}case"ListWebAuthnCredentials":{e.push(Ur());break}case"ResendConfirmationCode":{e.push(Ur());break}case"RespondToAuthChallenge":{e.push(Ur());break}case"RevokeToken":{e.push(Ur());break}case"SetUserMFAPreference":{e.push(Ur());break}case"SetUserSettings":{e.push(Ur());break}case"SignUp":{e.push(Ur());break}case"StartWebAuthnRegistration":{e.push(Ur());break}case"UpdateAuthEventFeedback":{e.push(Ur());break}case"UpdateDeviceStatus":{e.push(Ur());break}case"UpdateUserAttributes":{e.push(Ur());break}case"VerifySoftwareToken":{e.push(Ur());break}case"VerifyUserAttribute":{e.push(Ur());break}default:e.push(wG(r))}return e},CG=r=>{const e=mG(r);return Object.assign(e,{authSchemePreference:Bs(r.authSchemePreference??[])})},xG=r=>Object.assign(r,{useDualstackEndpoint:r.useDualstackEndpoint??!1,useFipsEndpoint:r.useFipsEndpoint??!1,defaultSigningName:"cognito-idp"}),AP={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},SG="3.1075.0",EG={version:SG},kG=r=>new TextEncoder().encode(r);var TG=typeof Buffer<"u"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:kG;function Tf(r){return r instanceof Uint8Array?r:typeof r=="string"?TG(r):ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(r)}function SA(r){return typeof r=="string"?r.length===0:r.byteLength===0}var wP={name:"SHA-256"},s2={name:"HMAC",hash:wP},FG=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]);const IG={};function Kp(){return typeof window<"u"?window:typeof self<"u"?self:IG}var PG=(function(){function r(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return r.prototype.update=function(e){if(!SA(e)){var t=Tf(e),n=new Uint8Array(this.toHash.byteLength+t.byteLength);n.set(this.toHash,0),n.set(t,this.toHash.byteLength),this.toHash=n}},r.prototype.digest=function(){var e=this;return this.key?this.key.then(function(t){return Kp().crypto.subtle.sign(s2,t,e.toHash).then(function(n){return new Uint8Array(n)})}):SA(this.toHash)?Promise.resolve(FG):Promise.resolve().then(function(){return Kp().crypto.subtle.digest(wP,e.toHash)}).then(function(t){return Promise.resolve(new Uint8Array(t))})},r.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(t,n){Kp().crypto.subtle.importKey("raw",Tf(e.secret),s2,!1,["sign"]).then(t,n)}),this.key.catch(function(){}))},r})(),ha=64,DG=32,RG=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),OG=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],BG=Math.pow(2,53)-1,Zp=(function(){function r(){this.state=Int32Array.from(OG),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return r.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,this.bytesHashed*8>BG)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===ha&&(this.hashBuffer(),this.bufferLength=0)},r.prototype.digest=function(){if(!this.finished){var e=this.bytesHashed*8,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%ha>=ha-8){for(var i=this.bufferLength;i<ha;i++)t.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(var i=this.bufferLength;i<ha-8;i++)t.setUint8(i,0);t.setUint32(ha-8,Math.floor(e/4294967296),!0),t.setUint32(ha-4,e),this.hashBuffer(),this.finished=!0}for(var a=new Uint8Array(DG),i=0;i<8;i++)a[i*4]=this.state[i]>>>24&255,a[i*4+1]=this.state[i]>>>16&255,a[i*4+2]=this.state[i]>>>8&255,a[i*4+3]=this.state[i]>>>0&255;return a},r.prototype.hashBuffer=function(){for(var e=this,t=e.buffer,n=e.state,i=n[0],a=n[1],s=n[2],o=n[3],l=n[4],u=n[5],c=n[6],f=n[7],d=0;d<ha;d++){if(d<16)this.temp[d]=(t[d*4]&255)<<24|(t[d*4+1]&255)<<16|(t[d*4+2]&255)<<8|t[d*4+3]&255;else{var h=this.temp[d-2],g=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10;h=this.temp[d-15];var v=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;this.temp[d]=(g+this.temp[d-7]|0)+(v+this.temp[d-16]|0)}var y=(((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&u^~l&c)|0)+(f+(RG[d]+this.temp[d]|0)|0)|0,A=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&a^i&s^a&s)|0;f=c,c=u,u=l,l=o+y|0,o=s,s=a,a=i,i=y+A|0}n[0]+=i,n[1]+=a,n[2]+=s,n[3]+=o,n[4]+=l,n[5]+=u,n[6]+=c,n[7]+=f},r})(),MG=(function(){function r(e){this.secret=e,this.hash=new Zp,this.reset()}return r.prototype.update=function(e){if(!(SA(e)||this.error))try{this.hash.update(Tf(e))}catch(t){this.error=t}},r.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},r.prototype.digest=function(){return es(this,void 0,void 0,function(){return ts(this,function(e){return[2,this.digestSync()]})})},r.prototype.reset=function(){if(this.hash=new Zp,this.secret){this.outer=new Zp;var e=_G(this.secret),t=new Uint8Array(ha);t.set(e);for(var n=0;n<ha;n++)e[n]^=54,t[n]^=92;this.hash.update(e),this.outer.update(t);for(var n=0;n<e.byteLength;n++)e[n]=0}},r})();function _G(r){var e=Tf(r);if(e.byteLength>ha){var t=new Zp;t.update(e),e=t.digest()}var n=new Uint8Array(ha);return n.set(e),n}var NG=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function LG(r){if(UG(r)&&typeof r.crypto.subtle=="object"){var e=r.crypto.subtle;return VG(e)}return!1}function UG(r){if(typeof r=="object"&&typeof r.crypto=="object"){var e=r.crypto.getRandomValues;return typeof e=="function"}return!1}function VG(r){return r&&NG.every(function(e){return typeof r[e]=="function"})}var zG=(function(){function r(e){LG(Kp())?this.hash=new PG(e):this.hash=new MG(e)}return r.prototype.update=function(e,t){this.hash.update(Tf(e))},r.prototype.digest=function(){return this.hash.digest()},r.prototype.reset=function(){this.hash.reset()},r})();function o2(r,e){return new Request(r,e)}function $G(r=0){return new Promise((e,t)=>{r&&setTimeout(()=>{const n=new Error(`Request did not complete within ${r} ms`);n.name="TimeoutError",t(n)},r)})}const Jv={supported:void 0};class Q1{config;configProvider;static create(e){return typeof e?.handle=="function"?e:new Q1(e)}constructor(e){typeof e=="function"?this.configProvider=e().then(t=>t||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),Jv.supported===void 0&&(Jv.supported=typeof Request<"u"&&"keepalive"in o2("https://[::1]"))}destroy(){}async handle(e,{abortSignal:t,requestTimeout:n}={}){this.config||(this.config=await this.configProvider);const i=n??this.config.requestTimeout,a=this.config.keepAlive===!0,s=this.config.credentials;if(t?.aborted){const C=l2(t);return Promise.reject(C)}let o=e.path;const l=v$(e.query||{});l&&(o+=`?${l}`),e.fragment&&(o+=`#${e.fragment}`);let u="";if(e.username!=null||e.password!=null){const C=e.username??"",S=e.password??"";u=`${C}:${S}@`}const{port:c,method:f}=e,d=`${e.protocol}//${u}${e.hostname}${c?`:${c}`:""}${o}`,h=f==="GET"||f==="HEAD"?void 0:e.body,g={body:h,headers:new Headers(e.headers),method:f,credentials:s};this.config?.cache&&(g.cache=this.config.cache),h&&(g.duplex="half"),typeof AbortController<"u"&&(g.signal=t),Jv.supported&&(g.keepalive=a),typeof this.config.requestInit=="function"&&Object.assign(g,this.config.requestInit(e));let v=()=>{};const y=o2(d,g),A=[fetch(y).then(C=>{const S=C.headers,F={};for(const R of S.entries())F[R[0]]=R[1];return C.body!=null?{response:new sc({headers:F,reason:C.statusText,statusCode:C.status,body:C.body})}:C.blob().then(R=>({response:new sc({headers:F,reason:C.statusText,statusCode:C.status,body:R})}))}),$G(i)];return t&&A.push(new Promise((C,S)=>{const F=()=>{const E=l2(t);S(E)};if(typeof t.addEventListener=="function"){const E=t;E.addEventListener("abort",F,{once:!0}),v=()=>E.removeEventListener("abort",F)}else t.onabort=F})),Promise.race(A).finally(v)}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[e]=t,n))}httpHandlerConfigs(){return this.config??{}}}function l2(r){const e=r&&typeof r=="object"&&"reason"in r?r.reason:void 0;if(e){if(e instanceof Error){const i=new Error("Request aborted");return i.name="AbortError",i.cause=e,i}const n=new Error(String(e));return n.name="AbortError",n}const t=new Error("Request aborted");return t.name="AbortError",t}const HG=async r=>typeof Blob=="function"&&r instanceof Blob||r.constructor?.name==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await r.arrayBuffer()):GG(r):jG(r);async function GG(r){const e=await qG(r),t=Zg(e);return new Uint8Array(t)}async function jG(r){const e=[],t=r.getReader();let n=!1,i=0;for(;!n;){const{done:o,value:l}=await t.read();l&&(e.push(l),i+=l.length),n=o}const a=new Uint8Array(i);let s=0;for(const o of e)a.set(o,s),s+=o.length;return a}function qG(r){return new Promise((e,t)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return t(new Error("Reader aborted too early"));const i=n.result??"",a=i.indexOf(","),s=a>-1?a+1:i.length;e(i.substring(s))},n.onabort=()=>t(new Error("Read aborted")),n.onerror=()=>t(n.error),n.readAsDataURL(r)})}class WG{queryCompat;errorRegistry;constructor(e=!1){this.queryCompat=e}resolveRestContentType(e,t){const n=t.getMemberSchemas(),i=Object.values(n).find(a=>!!a.getMergedTraits().httpPayload);if(i){const a=i.getMergedTraits().mediaType;return a||(i.isStringSchema()?"text/plain":i.isBlobSchema()?"application/octet-stream":e)}else if(!t.isUnitSchema()&&Object.values(n).find(s=>{const{httpQuery:o,httpQueryParams:l,httpHeader:u,httpLabel:c,httpPrefixHeaders:f}=s.getMergedTraits();return!o&&!l&&!u&&!c&&f===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,t,n,i,a,s){let o=e;e.includes("#")&&([,o]=e.split("#"));const l={$metadata:a,$fault:n.statusCode<500?"client":"server"};if(!this.errorRegistry)throw new Error("@aws-sdk/core/protocols - error handler not initialized.");try{return{errorSchema:s?.(this.errorRegistry,o)??this.errorRegistry.getSchema(e),errorMetadata:l}}catch{i.message=i.message??i.Message??"UnknownError";const c=this.errorRegistry,f=c.getBaseException();if(f){const g=c.getErrorCtor(f)??Error;throw this.decorateServiceException(Object.assign(new g({name:o}),l),i)}const d=i,h=d?.message??d?.Message??d?.Error?.Message??d?.Error?.message;throw this.decorateServiceException(Object.assign(new Error(h),{name:o},l),i)}}compose(e,t,n){let i=n;t.includes("#")&&([i]=t.split("#"));const a=Zi.for(i),s=Zi.for("smithy.ts.sdk.synthetic."+n);e.copyFrom(a),e.copyFrom(s),this.errorRegistry=e}decorateServiceException(e,t={}){if(this.queryCompat){const n=e.Message??t.Message,i=_E(e,t);n&&(i.message=n);const a=i.Error??{};a.Type=i.Error?.Type,a.Code=i.Error?.Code,a.Message=i.Error?.message??i.Error?.Message??n,i.Error=a;const s=i.$metadata.requestId;return s&&(i.RequestId=s),i}return _E(e,t)}setQueryCompatError(e,t){const n=t.headers?.["x-amzn-query-error"];if(e!==void 0&&n!=null){const[i,a]=n.split(";"),s=Object.keys(e),o={Code:i,Type:a};e.Code=i,e.Type=a;for(let l=0;l<s.length;l++){const u=s[l];o[u==="message"?"Message":u]=e[u]}delete o.__type,e.Error=o}}queryCompatOutput(e,t){e.Error&&(t.Error=e.Error),e.Type&&(t.Type=e.Type),e.Code&&(t.Code=e.Code)}findQueryCompatibleError(e,t){try{return e.getSchema(t)}catch{return e.find(i=>vi.of(i).getMergedTraits().awsQueryError?.[0]===t)}}}class Y1{serdeContext;setSerdeContext(e){this.serdeContext=e}}class QG{from;to;keys;constructor(e,t){this.from=e,this.to=t;const n=Object.keys(this.from),i=new Set(n);i.delete("__type"),this.keys=i}mark(e){this.keys.delete(e)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){const e=this.keys.values().next().value,t=this.from[e];this.to.$unknown=[e,t]}}}function YG(r,e,t){if(t?.source){const n=t.source;if(typeof e=="number"&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER||n!==String(e)))return n.includes(".")?new ns(n,"bigDecimal"):BigInt(n)}return e}const XG=(r,e)=>bA(r,e).then(t=>(e?.utf8Encoder??em)(t)),JG=(r,e)=>XG(r,e).then(t=>{if(t.length)try{return JSON.parse(t)}catch(n){throw n?.name==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:t}),n}return{}}),u2=(r,e)=>Object.keys(r).find(t=>t.toLowerCase()===e.toLowerCase()),Kv=r=>{let e=r;return typeof e=="number"&&(e=e.toString()),e.indexOf(",")>=0&&(e=e.split(",")[0]),e.indexOf(":")>=0&&(e=e.split(":")[0]),e.indexOf("#")>=0&&(e=e.split("#")[1]),e},KG=(r,e,t=!1)=>ZG(r,e,t?["code","header","type"]:["type","code","header"]),ZG=({headers:r},e,t)=>{for(;t.length>0;)switch(t.shift()){case"header":const i=u2(r??{},"x-amzn-errortype");if(i!==void 0)return Kv(r[i]);break;case"code":const a=u2(e??{},"code");if(a&&e[a]!==void 0)return Kv(e[a]);break;case"type":if(e?.__type!==void 0)return Kv(e.__type);break}};class ej extends Y1{settings;constructor(e){super(),this.settings=e}async read(e,t){return this._read(e,typeof t=="string"?JSON.parse(t,YG):await JG(t,this.serdeContext))}readObject(e,t){return this._read(e,t)}_read(e,t){const n=t!==null&&typeof t=="object",i=vi.of(e);if(n){if(i.isStructSchema()){const s=t,o=i.isUnionSchema(),l={};let u;const{jsonName:c}=this.settings;c&&(u={});let f;o&&(f=new QG(s,l));for(const[d,h]of i.structIterator()){let g=d;c&&(g=h.getMergedTraits().jsonName??g,u[g]=d),o&&f.mark(g),s[g]!=null&&(l[d]=this._read(h,s[g]))}if(o)f.writeUnknown();else if(typeof s.__type=="string")for(const d in s){const h=s[d],g=c?u[d]??d:d;g in l||(l[g]=h)}return l}if(Array.isArray(t)&&i.isListSchema()){const s=i.getValueSchema(),o=[];for(const l of t)o.push(this._read(s,l));return o}if(i.isMapSchema()){const s=i.getValueSchema(),o={};for(const l in t)o[l]=this._read(s,t[l]);return o}}if(i.isBlobSchema()&&typeof t=="string")return Zg(t);const a=i.getMergedTraits().mediaType;if(i.isStringSchema()&&typeof t=="string"&&a)return a==="application/json"||a.endsWith("+json")?po.from(t):t;if(i.isTimestampSchema()&&t!=null)switch(aP(i,this.settings)){case 5:return uz(t);case 6:return jI(t);case 7:return hz(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}if(i.isBigIntegerSchema()&&(typeof t=="number"||typeof t=="string"))return BigInt(t);if(i.isBigDecimalSchema()&&t!=null){if(t instanceof ns)return t;const s=t;return s.type==="bigDecimal"&&"string"in s?new ns(s.string,s.type):new ns(String(t),"bigDecimal")}if(i.isNumericSchema()&&typeof t=="string"){switch(t){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return t}if(i.isDocumentSchema())if(n){const s=Array.isArray(t)?[]:{};for(const o in t){const l=t[o];l instanceof ns?s[o]=l:s[o]=this._read(i,l)}return s}else return structuredClone(t);return t}}const c2="Ν";class tj{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(e,t)=>{if(t instanceof ns){const n=`${c2+"nv"+this.counter++}_`+t.string;return this.values.set(`"${n}"`,t.string),n}if(typeof t=="bigint"){const n=t.toString(),i=`${c2+"b"+this.counter++}_`+n;return this.values.set(`"${i}"`,n),i}return t}}replaceInJson(e){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return e;for(const[t,n]of this.values)e=e.replace(t,n);return e}}class rj extends Y1{settings;buffer;useReplacer=!1;rootSchema;constructor(e){super(),this.settings=e}write(e,t){this.rootSchema=vi.of(e),this.buffer=this._write(this.rootSchema,t)}flush(){const{rootSchema:e,useReplacer:t}=this;if(this.rootSchema=void 0,this.useReplacer=!1,e?.isStructSchema()||e?.isDocumentSchema()){if(!t)return JSON.stringify(this.buffer);const n=new tj;return n.replaceInJson(JSON.stringify(this.buffer,n.createReplacer(),0))}return this.buffer}writeDiscriminatedDocument(e,t){this.write(e,t),typeof this.buffer=="object"&&(this.buffer.__type=vi.of(e).getName(!0))}_write(e,t,n){const i=t!==null&&typeof t=="object",a=vi.of(e);if(i){if(a.isStructSchema()){const s=t,o={},{jsonName:l}=this.settings;let u;l&&(u={});let c=0;for(const[f,d]of a.structIterator()){const h=this._write(d,s[f],a);if(h!==void 0){let g=f;l&&(g=d.getMergedTraits().jsonName??f,u[f]=g),o[g]=h,c++}}if(a.isUnionSchema()&&c===0){const{$unknown:f}=s;if(Array.isArray(f)){const[d,h]=f;o[d]=this._write(15,h)}}else if(typeof s.__type=="string")for(const f in s){const d=s[f],h=l?u[f]??f:f;h in o||(o[h]=this._write(15,d))}return o}if(Array.isArray(t)&&a.isListSchema()){const s=a.getValueSchema(),o=[],l=!!a.getMergedTraits().sparse;for(const u of t)(l||u!=null)&&o.push(this._write(s,u));return o}if(a.isMapSchema()){const s=a.getValueSchema(),o={},l=!!a.getMergedTraits().sparse;for(const u in t){const c=t[u];(l||c!=null)&&(o[u]=this._write(s,c))}return o}if(t instanceof Uint8Array&&(a.isBlobSchema()||a.isDocumentSchema()))return a===this.rootSchema?t:(this.serdeContext?.base64Encoder??Cg)(t);if(t instanceof Date&&(a.isTimestampSchema()||a.isDocumentSchema()))switch(aP(a,this.settings)){case 5:return t.toISOString().replace(".000Z","Z");case 6:return oz(t);case 7:return t.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",t),t.getTime()/1e3}t instanceof ns&&(this.useReplacer=!0)}if(!(t===null&&n?.isStructSchema())){if(a.isStringSchema()){if(typeof t>"u"&&a.isIdempotencyToken())return o$();const s=a.getMergedTraits().mediaType;return t!=null&&s&&(s==="application/json"||s.endsWith("+json"))?po.from(t):t}if(typeof t=="number"&&a.isNumericSchema())return Math.abs(t)===1/0||isNaN(t)?String(t):t;if(typeof t=="string"&&a.isBlobSchema())return a===this.rootSchema?t:(this.serdeContext?.base64Encoder??Cg)(t);if(typeof t=="bigint"&&(this.useReplacer=!0),a.isDocumentSchema())if(i){const s=Array.isArray(t)?[]:{};for(const o in t){const l=t[o];l instanceof ns?(this.useReplacer=!0,s[o]=l):s[o]=this._write(a,l)}return s}else return structuredClone(t);return t}}}class nj extends Y1{settings;constructor(e){super(),this.settings=e}createSerializer(){const e=new rj(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){const e=new ej(this.settings);return e.setSerdeContext(this.serdeContext),e}}class ij extends c${serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:i,jsonCodec:a}){super({defaultNamespace:e,errorTypeRegistries:t}),this.serviceTarget=n,this.codec=a??new nj({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!i,this.mixin=new WG(this.awsQueryCompatible)}async serializeRequest(e,t,n){const i=await super.serializeRequest(e,t,n);return i.path.endsWith("/")||(i.path+="/"),i.headers["content-type"]=`application/x-amz-json-${this.getJsonRpcVersion()}`,i.headers["x-amz-target"]=`${this.serviceTarget}.${e.name}`,this.awsQueryCompatible&&(i.headers["x-amzn-query-mode"]="true"),(Yp(e.input)==="unit"||!i.body)&&(i.body="{}"),i}getPayloadCodec(){return this.codec}async handleError(e,t,n,i,a){const{awsQueryCompatible:s}=this;s&&this.mixin.setQueryCompatError(i,n);const o=KG(n,i,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace);const{errorSchema:l,errorMetadata:u}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,n,i,a,s?this.mixin.findQueryCompatibleError:void 0),c=vi.of(l),f=i.message??i.Message??"UnknownError",d=this.compositeErrorRegistry.getErrorCtor(l)??Error,h=new d({}),g={},v=this.codec.createDeserializer();for(const[y,A]of c.structIterator())i[y]!=null&&(g[y]=v.readObject(A,i[y]));throw s&&this.mixin.queryCompatOutput(i,g),this.mixin.decorateServiceException(Object.assign(h,u,{$fault:c.getMergedTraits().error,message:f},g),i)}}class aj extends ij{constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:i,jsonCodec:a}){super({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:i,jsonCodec:a})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}const Ff="ref",hl=-1,Ip=!0,d2="isSet",bP="PartitionResult",Pp="booleanEquals",Zv="getAttr",Fd="stringEquals",f2={[Ff]:"Endpoint"},ey={[Ff]:bP},$d={[Ff]:"Region"},Ya={},h2=[$d],p2={conditions:[[d2,[f2]],[d2,h2],["aws.partition",h2,bP],[Pp,[{[Ff]:"UseFIPS"},Ip]],[Pp,[{fn:Zv,argv:[ey,"supportsFIPS"]},Ip]],[Pp,[{[Ff]:"UseDualStack"},Ip]],[Pp,[{fn:Zv,argv:[ey,"supportsDualStack"]},Ip]],[Fd,[{fn:Zv,argv:[ey,"name"]},"aws"]],[Fd,[$d,"us-east-1"]],[Fd,[$d,"us-east-2"]],[Fd,[$d,"us-west-1"]],[Fd,[$d,"us-west-2"]]],results:[[hl],[hl,"Invalid Configuration: FIPS and custom endpoint are not supported"],[hl,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[f2,Ya],["https://cognito-idp-fips.us-east-1.amazonaws.com",Ya],["https://cognito-idp-fips.us-east-2.amazonaws.com",Ya],["https://cognito-idp-fips.us-west-1.amazonaws.com",Ya],["https://cognito-idp-fips.us-west-2.amazonaws.com",Ya],["https://cognito-idp-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",Ya],[hl,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://cognito-idp-fips.{Region}.{PartitionResult#dnsSuffix}",Ya],[hl,"FIPS is enabled but this partition does not support FIPS"],["https://cognito-idp.{Region}.amazonaws.com",Ya],["https://cognito-idp.{Region}.{PartitionResult#dualStackDnsSuffix}",Ya],[hl,"DualStack is enabled but this partition does not support DualStack"],["https://cognito-idp.{Region}.{PartitionResult#dnsSuffix}",Ya],[hl,"Invalid Configuration: Missing Region"]]},sj=2,pi=1e8,oj=new Int32Array([-1,1,-1,0,17,3,1,4,pi+16,2,5,pi+16,3,9,6,5,7,pi+15,6,8,pi+14,7,pi+12,pi+13,4,11,10,5,pi+9,pi+11,5,12,pi+10,6,13,pi+9,8,pi+4,14,9,pi+5,15,10,pi+6,16,11,pi+7,pi+8,3,pi+1,18,5,pi+2,pi+3]),lj=H1.from(oj,sj,p2.conditions,p2.results),uj=new Uz({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),cj=(r,e={})=>uj.get(r,()=>i$(lj,{endpointParams:r,logger:e.logger}));G1.aws=cP;class Ct extends Lu{constructor(e){super(e),Object.setPrototypeOf(this,Ct.prototype)}}class X1 extends Ct{name="AccessDeniedException";$fault="client";constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,X1.prototype)}}class J1 extends Ct{name="InternalErrorException";$fault="server";constructor(e){super({name:"InternalErrorException",$fault:"server",...e}),Object.setPrototypeOf(this,J1.prototype)}}class K1 extends Ct{name="InvalidParameterException";$fault="client";reasonCode;constructor(e){super({name:"InvalidParameterException",$fault:"client",...e}),Object.setPrototypeOf(this,K1.prototype),this.reasonCode=e.reasonCode}}class Z1 extends Ct{name="NotAuthorizedException";$fault="client";constructor(e){super({name:"NotAuthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,Z1.prototype)}}class ew extends Ct{name="OperationNotEnabledException";$fault="client";constructor(e){super({name:"OperationNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,ew.prototype)}}class tw extends Ct{name="ResourceNotFoundException";$fault="client";constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,tw.prototype)}}class rw extends Ct{name="TooManyRequestsException";$fault="client";constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),Object.setPrototypeOf(this,rw.prototype)}}class nw extends Ct{name="UserImportInProgressException";$fault="client";constructor(e){super({name:"UserImportInProgressException",$fault:"client",...e}),Object.setPrototypeOf(this,nw.prototype)}}class iw extends Ct{name="InternalServerException";$fault="server";constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,iw.prototype)}}class aw extends Ct{name="LimitExceededException";$fault="client";constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),Object.setPrototypeOf(this,aw.prototype)}}class sw extends Ct{name="UserNotFoundException";$fault="client";constructor(e){super({name:"UserNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,sw.prototype)}}class ow extends Ct{name="InvalidLambdaResponseException";$fault="client";constructor(e){super({name:"InvalidLambdaResponseException",$fault:"client",...e}),Object.setPrototypeOf(this,ow.prototype)}}class lw extends Ct{name="TooManyFailedAttemptsException";$fault="client";constructor(e){super({name:"TooManyFailedAttemptsException",$fault:"client",...e}),Object.setPrototypeOf(this,lw.prototype)}}class uw extends Ct{name="UnexpectedLambdaException";$fault="client";constructor(e){super({name:"UnexpectedLambdaException",$fault:"client",...e}),Object.setPrototypeOf(this,uw.prototype)}}class cw extends Ct{name="UserLambdaValidationException";$fault="client";constructor(e){super({name:"UserLambdaValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,cw.prototype)}}class dw extends Ct{name="CodeDeliveryFailureException";$fault="client";constructor(e){super({name:"CodeDeliveryFailureException",$fault:"client",...e}),Object.setPrototypeOf(this,dw.prototype)}}class fw extends Ct{name="InvalidPasswordException";$fault="client";constructor(e){super({name:"InvalidPasswordException",$fault:"client",...e}),Object.setPrototypeOf(this,fw.prototype)}}class hw extends Ct{name="InvalidSmsRoleAccessPolicyException";$fault="client";constructor(e){super({name:"InvalidSmsRoleAccessPolicyException",$fault:"client",...e}),Object.setPrototypeOf(this,hw.prototype)}}class pw extends Ct{name="InvalidSmsRoleTrustRelationshipException";$fault="client";constructor(e){super({name:"InvalidSmsRoleTrustRelationshipException",$fault:"client",...e}),Object.setPrototypeOf(this,pw.prototype)}}class gw extends Ct{name="PreconditionNotMetException";$fault="client";constructor(e){super({name:"PreconditionNotMetException",$fault:"client",...e}),Object.setPrototypeOf(this,gw.prototype)}}class mw extends Ct{name="UnsupportedUserStateException";$fault="client";constructor(e){super({name:"UnsupportedUserStateException",$fault:"client",...e}),Object.setPrototypeOf(this,mw.prototype)}}class vw extends Ct{name="UsernameExistsException";$fault="client";constructor(e){super({name:"UsernameExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,vw.prototype)}}class yw extends Ct{name="AliasExistsException";$fault="client";constructor(e){super({name:"AliasExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,yw.prototype)}}class Aw extends Ct{name="InvalidUserPoolConfigurationException";$fault="client";constructor(e){super({name:"InvalidUserPoolConfigurationException",$fault:"client",...e}),Object.setPrototypeOf(this,Aw.prototype)}}class ww extends Ct{name="InvalidEmailRoleAccessPolicyException";$fault="client";constructor(e){super({name:"InvalidEmailRoleAccessPolicyException",$fault:"client",...e}),Object.setPrototypeOf(this,ww.prototype)}}class bw extends Ct{name="MFAMethodNotFoundException";$fault="client";constructor(e){super({name:"MFAMethodNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,bw.prototype)}}class Cw extends Ct{name="PasswordResetRequiredException";$fault="client";constructor(e){super({name:"PasswordResetRequiredException",$fault:"client",...e}),Object.setPrototypeOf(this,Cw.prototype)}}class xw extends Ct{name="UnsupportedOperationException";$fault="client";constructor(e){super({name:"UnsupportedOperationException",$fault:"client",...e}),Object.setPrototypeOf(this,xw.prototype)}}class Sw extends Ct{name="UserNotConfirmedException";$fault="client";constructor(e){super({name:"UserNotConfirmedException",$fault:"client",...e}),Object.setPrototypeOf(this,Sw.prototype)}}class Ew extends Ct{name="UserPoolAddOnNotEnabledException";$fault="client";constructor(e){super({name:"UserPoolAddOnNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,Ew.prototype)}}class kw extends Ct{name="CodeMismatchException";$fault="client";constructor(e){super({name:"CodeMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,kw.prototype)}}class Tw extends Ct{name="ExpiredCodeException";$fault="client";constructor(e){super({name:"ExpiredCodeException",$fault:"client",...e}),Object.setPrototypeOf(this,Tw.prototype)}}class Fw extends Ct{name="PasswordHistoryPolicyViolationException";$fault="client";constructor(e){super({name:"PasswordHistoryPolicyViolationException",$fault:"client",...e}),Object.setPrototypeOf(this,Fw.prototype)}}class Iw extends Ct{name="SoftwareTokenMFANotFoundException";$fault="client";constructor(e){super({name:"SoftwareTokenMFANotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,Iw.prototype)}}class Pw extends Ct{name="ConcurrentModificationException";$fault="client";constructor(e){super({name:"ConcurrentModificationException",$fault:"client",...e}),Object.setPrototypeOf(this,Pw.prototype)}}class Dw extends Ct{name="ForbiddenException";$fault="client";constructor(e){super({name:"ForbiddenException",$fault:"client",...e}),Object.setPrototypeOf(this,Dw.prototype)}}class Rw extends Ct{name="WebAuthnChallengeNotFoundException";$fault="client";constructor(e){super({name:"WebAuthnChallengeNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,Rw.prototype)}}class Ow extends Ct{name="WebAuthnClientMismatchException";$fault="client";constructor(e){super({name:"WebAuthnClientMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,Ow.prototype)}}class Bw extends Ct{name="WebAuthnCredentialNotSupportedException";$fault="client";constructor(e){super({name:"WebAuthnCredentialNotSupportedException",$fault:"client",...e}),Object.setPrototypeOf(this,Bw.prototype)}}class Mw extends Ct{name="WebAuthnNotEnabledException";$fault="client";constructor(e){super({name:"WebAuthnNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,Mw.prototype)}}class _w extends Ct{name="WebAuthnOriginNotAllowedException";$fault="client";constructor(e){super({name:"WebAuthnOriginNotAllowedException",$fault:"client",...e}),Object.setPrototypeOf(this,_w.prototype)}}class Nw extends Ct{name="WebAuthnRelyingPartyMismatchException";$fault="client";constructor(e){super({name:"WebAuthnRelyingPartyMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,Nw.prototype)}}class Lw extends Ct{name="DeviceKeyExistsException";$fault="client";constructor(e){super({name:"DeviceKeyExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,Lw.prototype)}}class Uw extends Ct{name="GroupExistsException";$fault="client";constructor(e){super({name:"GroupExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,Uw.prototype)}}class Vw extends Ct{name="DuplicateProviderException";$fault="client";constructor(e){super({name:"DuplicateProviderException",$fault:"client",...e}),Object.setPrototypeOf(this,Vw.prototype)}}class zw extends Ct{name="ManagedLoginBrandingExistsException";$fault="client";constructor(e){super({name:"ManagedLoginBrandingExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,zw.prototype)}}class $w extends Ct{name="TermsExistsException";$fault="client";constructor(e){super({name:"TermsExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,$w.prototype)}}class Hw extends Ct{name="FeatureUnavailableInTierException";$fault="client";constructor(e){super({name:"FeatureUnavailableInTierException",$fault:"client",...e}),Object.setPrototypeOf(this,Hw.prototype)}}class Gw extends Ct{name="TierChangeNotAllowedException";$fault="client";constructor(e){super({name:"TierChangeNotAllowedException",$fault:"client",...e}),Object.setPrototypeOf(this,Gw.prototype)}}class jw extends Ct{name="UserPoolTaggingException";$fault="client";constructor(e){super({name:"UserPoolTaggingException",$fault:"client",...e}),Object.setPrototypeOf(this,jw.prototype)}}class qw extends Ct{name="InvalidOAuthFlowException";$fault="client";constructor(e){super({name:"InvalidOAuthFlowException",$fault:"client",...e}),Object.setPrototypeOf(this,qw.prototype)}}class Ww extends Ct{name="ScopeDoesNotExistException";$fault="client";constructor(e){super({name:"ScopeDoesNotExistException",$fault:"client",...e}),Object.setPrototypeOf(this,Ww.prototype)}}class Qw extends Ct{name="UnsupportedIdentityProviderException";$fault="client";constructor(e){super({name:"UnsupportedIdentityProviderException",$fault:"client",...e}),Object.setPrototypeOf(this,Qw.prototype)}}class Yw extends Ct{name="RefreshTokenReuseException";$fault="client";constructor(e){super({name:"RefreshTokenReuseException",$fault:"client",...e}),Object.setPrototypeOf(this,Yw.prototype)}}class Xw extends Ct{name="UnauthorizedException";$fault="client";constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,Xw.prototype)}}class Jw extends Ct{name="UnsupportedTokenTypeException";$fault="client";constructor(e){super({name:"UnsupportedTokenTypeException",$fault:"client",...e}),Object.setPrototypeOf(this,Jw.prototype)}}class Kw extends Ct{name="WebAuthnConfigurationMissingException";$fault="client";constructor(e){super({name:"WebAuthnConfigurationMissingException",$fault:"client",...e}),Object.setPrototypeOf(this,Kw.prototype)}}class Zw extends Ct{name="EnableSoftwareTokenMFAException";$fault="client";constructor(e){super({name:"EnableSoftwareTokenMFAException",$fault:"client",...e}),Object.setPrototypeOf(this,Zw.prototype)}}const dj="AvailableChallenges",fj="AccessDeniedException",hj="AliasExistsException",pj="AnalyticsEndpointId",gj="AuthFlow",CP="AnalyticsMetadata",mj="AnalyticsMetadataType",vj="AuthParameters",yj="AuthParametersType",xP="AuthenticationResult",Aj="AuthenticationResultType",wj="AccessToken",bj="CodeDeliveryFailureException",SP="ClientId",Cj="ClientIdType",EP="ClientMetadata",xj="CodeMismatchException",Sj="ConcurrentModificationException",eb="ChallengeName",kP="ChallengeParameters",Ej="ChallengeResponses",kj="ChallengeResponsesType",Tj="DeviceGroupKey",Fj="DeviceKey",Ij="DeviceKeyExistsException",Pj="DuplicateProviderException",Dj="ExpiredCodeException",Rj="EncodedData",Oj="ExpiresIn",Bj="EnableSoftwareTokenMFAException",Mj="ForbiddenException",_j="FeatureUnavailableInTierException",Nj="GroupExistsException",Lj="IpAddress",Uj="InitiateAuthRequest",Vj="InitiateAuthResponse",zj="InitiateAuth",$j="InternalErrorException",Hj="InvalidEmailRoleAccessPolicyException",Gj="InvalidLambdaResponseException",jj="InvalidOAuthFlowException",qj="InvalidParameterException",Wj="InvalidPasswordException",Qj="InternalServerException",Yj="InvalidSmsRoleAccessPolicyException",Xj="InvalidSmsRoleTrustRelationshipException",Jj="IdToken",Kj="InvalidUserPoolConfigurationException",Zj="LimitExceededException",eq="MFAMethodNotFoundException",tq="ManagedLoginBrandingExistsException",rq="NotAuthorizedException",nq="NewDeviceMetadata",iq="NewDeviceMetadataType",aq="OperationNotEnabledException",sq="PasswordHistoryPolicyViolationException",oq="PreconditionNotMetException",lq="PasswordResetRequiredException",uq="ResourceNotFoundException",cq="RefreshToken",dq="RespondToAuthChallenge",fq="RespondToAuthChallengeRequest",hq="RespondToAuthChallengeResponse",pq="RefreshTokenReuseException",nm="Session",gq="ScopeDoesNotExistException",mq="SessionType",vq="SoftwareTokenMFANotFoundException",yq="TierChangeNotAllowedException",Aq="TermsExistsException",wq="TooManyFailedAttemptsException",bq="TooManyRequestsException",Cq="TokenModelType",xq="TokenType",Sq="UserContextDataType",TP="UserContextData",Eq="UnauthorizedException",kq="UsernameExistsException",Tq="UserImportInProgressException",Fq="UnsupportedIdentityProviderException",Iq="UnexpectedLambdaException",Pq="UserLambdaValidationException",Dq="UserNotConfirmedException",Rq="UserNotFoundException",Oq="UnsupportedOperationException",Bq="UserPoolAddOnNotEnabledException",Mq="UserPoolTaggingException",_q="UnsupportedTokenTypeException",Nq="UnsupportedUserStateException",Lq="WebAuthnClientMismatchException",Uq="WebAuthnConfigurationMissingException",Vq="WebAuthnChallengeNotFoundException",zq="WebAuthnCredentialNotSupportedException",$q="WebAuthnNotEnabledException",Hq="WebAuthnOriginNotAllowedException",Gq="WebAuthnRelyingPartyMismatchException",It="client",Tt="error",Pt="httpError",Ft="message",jq="reasonCode",FP="smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentityprovider",IP="server",at="com.amazonaws.cognitoidentityprovider",PP=Zi.for(FP);var qq=[-3,FP,"CognitoIdentityProviderServiceException",0,[],[]];PP.registerError(qq,Ct);const kt=Zi.for(at);var Wq=[-3,at,fj,{[Tt]:It,[Pt]:403},[Ft],[0]];kt.registerError(Wq,X1);var Qq=[-3,at,hj,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(Qq,yw);var Yq=[-3,at,bj,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(Yq,dw);var Xq=[-3,at,xj,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(Xq,kw);var Jq=[-3,at,Sj,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(Jq,Pw);var Kq=[-3,at,Ij,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(Kq,Lw);var Zq=[-3,at,Pj,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(Zq,Vw);var eW=[-3,at,Bj,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(eW,Zw);var tW=[-3,at,Dj,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(tW,Tw);var rW=[-3,at,_j,{[Tt]:It,[Pt]:403},[Ft],[0]];kt.registerError(rW,Hw);var nW=[-3,at,Mj,{[Tt]:It,[Pt]:403},[Ft],[0]];kt.registerError(nW,Dw);var iW=[-3,at,Nj,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(iW,Uw);var aW=[-3,at,$j,{[Tt]:IP},[Ft],[0]];kt.registerError(aW,J1);var sW=[-3,at,Qj,{[Tt]:IP},[Ft],[0]];kt.registerError(sW,iw);var oW=[-3,at,Hj,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(oW,ww);var lW=[-3,at,Gj,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(lW,ow);var uW=[-3,at,jj,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(uW,qw);var cW=[-3,at,qj,{[Tt]:It,[Pt]:400},[Ft,jq],[0,0]];kt.registerError(cW,K1);var dW=[-3,at,Wj,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(dW,fw);var fW=[-3,at,Yj,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(fW,hw);var hW=[-3,at,Xj,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(hW,pw);var pW=[-3,at,Kj,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(pW,Aw);var gW=[-3,at,Zj,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(gW,aw);var mW=[-3,at,tq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(mW,zw);var vW=[-3,at,eq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(vW,bw);var yW=[-3,at,rq,{[Tt]:It,[Pt]:403},[Ft],[0]];kt.registerError(yW,Z1);var AW=[-3,at,aq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(AW,ew);var wW=[-3,at,sq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(wW,Fw);var bW=[-3,at,lq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(bW,Cw);var CW=[-3,at,oq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(CW,gw);var xW=[-3,at,pq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(xW,Yw);var SW=[-3,at,uq,{[Tt]:It,[Pt]:404},[Ft],[0]];kt.registerError(SW,tw);var EW=[-3,at,gq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(EW,Ww);var kW=[-3,at,vq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(kW,Iw);var TW=[-3,at,Aq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(TW,$w);var FW=[-3,at,yq,{[Tt]:It,[Pt]:403},[Ft],[0]];kt.registerError(FW,Gw);var IW=[-3,at,wq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(IW,lw);var PW=[-3,at,bq,{[Tt]:It,[Pt]:429},[Ft],[0]];kt.registerError(PW,rw);var DW=[-3,at,Eq,{[Tt]:It,[Pt]:401},[Ft],[0]];kt.registerError(DW,Xw);var RW=[-3,at,Iq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(RW,uw);var OW=[-3,at,Fq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(OW,Qw);var BW=[-3,at,Oq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(BW,xw);var MW=[-3,at,_q,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(MW,Jw);var _W=[-3,at,Nq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(_W,mw);var NW=[-3,at,Tq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(NW,nw);var LW=[-3,at,Pq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(LW,cw);var UW=[-3,at,kq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(UW,vw);var VW=[-3,at,Dq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(VW,Sw);var zW=[-3,at,Rq,{[Tt]:It,[Pt]:404},[Ft],[0]];kt.registerError(zW,sw);var $W=[-3,at,Bq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError($W,Ew);var HW=[-3,at,Mq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(HW,jw);var GW=[-3,at,Vq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(GW,Rw);var jW=[-3,at,Lq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(jW,Ow);var qW=[-3,at,Uq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(qW,Kw);var WW=[-3,at,zq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(WW,Bw);var QW=[-3,at,$q,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(QW,Mw);var YW=[-3,at,Hq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(YW,_w);var XW=[-3,at,Gq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(XW,Nw);const JW=[PP,kt];var DP=[0,at,Cj,8,0],im=[0,at,mq,8,0],ty=[0,at,Cq,8,0],RP=[3,at,mj,0,[pj],[0]],OP=[3,at,Aj,0,[wj,Oj,xq,cq,Jj,nq],[[()=>ty,0],1,0,[()=>ty,0],[()=>ty,0],()=>eQ]],KW=[3,at,Uj,0,[gj,SP,vj,EP,CP,TP,nm],[0,[()=>DP,0],[()=>nQ,0],128,()=>RP,[()=>BP,0],[()=>im,0]],2],ZW=[3,at,Vj,0,[eb,nm,kP,xP,dj],[0,[()=>im,0],128,[()=>OP,0],64]],eQ=[3,at,iq,0,[Fj,Tj],[0,0]],tQ=[3,at,fq,0,[SP,eb,nm,Ej,CP,TP,EP],[[()=>DP,0],0,[()=>im,0],[()=>iQ,0],()=>RP,[()=>BP,0],128],2],rQ=[3,at,hq,0,[eb,nm,kP,xP],[0,[()=>im,0],128,[()=>OP,0]]],BP=[3,at,Sq,8,[Lj,Rj],[0,0]],nQ=[2,at,yj,8,0,0],iQ=[2,at,kj,8,0,0],aQ=[9,at,zj,0,()=>KW,()=>ZW],sQ=[9,at,dq,0,()=>tQ,()=>rQ];const oQ=r=>({apiVersion:"2016-04-18",base64Decoder:r?.base64Decoder??Zg,base64Encoder:r?.base64Encoder??Cg,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??cj,extensions:r?.extensions??[],httpAuthSchemeProvider:r?.httpAuthSchemeProvider??bG,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new jH},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new uH}],logger:r?.logger??new $I,protocol:r?.protocol??aj,protocolSettings:r?.protocolSettings??{defaultNamespace:"com.amazonaws.cognitoidentityprovider",errorTypeRegistries:JW,xmlNamespace:"http://cognito-idp.amazonaws.com/doc/2016-04-18/",version:"2016-04-18",serviceTarget:"AWSCognitoIdentityProviderService"},serviceId:r?.serviceId??"Cognito Identity Provider",urlParser:r?.urlParser??bg,utf8Decoder:r?.utf8Decoder??kl,utf8Encoder:r?.utf8Encoder??em}),lQ=r=>{const e=NH(r),t=()=>e().then(VV),n=oQ(r);return{...n,...r,runtime:"browser",defaultsMode:e,bodyLengthChecker:r?.bodyLengthChecker??Cz,credentialDefaultProvider:r?.credentialDefaultProvider??(i=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:r?.defaultUserAgentProvider??IH({serviceId:n.serviceId,clientVersion:EG.version}),maxAttempts:r?.maxAttempts??ef,region:r?.region??DV("Region is missing"),requestHandler:Q1.create(r?.requestHandler??t),retryMode:r?.retryMode??(async()=>(await t()).retryMode||z$),sha256:r?.sha256??zG,streamCollector:r?.streamCollector??HG,useDualstackEndpoint:r?.useDualstackEndpoint??(()=>Promise.resolve(UH)),useFipsEndpoint:r?.useFipsEndpoint??(()=>Promise.resolve(VH))}},uQ=r=>{const e=r.httpAuthSchemes;let t=r.httpAuthSchemeProvider,n=r.credentials;return{setHttpAuthScheme(i){const a=e.findIndex(s=>s.schemeId===i.schemeId);a===-1?e.push(i):e.splice(a,1,i)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(i){t=i},httpAuthSchemeProvider(){return t},setCredentials(i){n=i},credentials(){return n}}},cQ=r=>({httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}),dQ=(r,e)=>{const t=Object.assign(zH(r),jV(r),d$(r),uQ(r));return e.forEach(n=>n.configure(t)),Object.assign(r,$H(t),qV(t),f$(t),cQ(t))};class fQ extends RV{config;constructor(...[e]){const t=lQ(e||{});super(t),this.initConfig=t;const n=xG(t),i=mH(n),a=H$(i),s=MH(a),o=s,l=a$(o),u=CG(l),c=dQ(u,e?.extensions||[]);this.config=c,this.middlewareStack.use(NV(this.config)),this.middlewareStack.use(FH(this.config)),this.middlewareStack.use(G$(this.config)),this.middlewareStack.use(g$(this.config)),this.middlewareStack.use(W$(this.config)),this.middlewareStack.use(X$(this.config)),this.middlewareStack.use(J$(this.config)),this.middlewareStack.use(rH(this.config,{httpAuthSchemeParametersProvider:AG,identityProviderConfigProvider:async f=>new lH({"aws.auth#sigv4":f.credentials})})),this.middlewareStack.use(oH(this.config))}destroy(){super.destroy()}}class g2 extends z1.classBuilder().ep(AP).m(function(e,t,n,i){return[nP(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","InitiateAuth",{}).n("CognitoIdentityProviderClient","InitiateAuthCommand").sc(aQ).build(){}class hQ extends z1.classBuilder().ep(AP).m(function(e,t,n,i){return[nP(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","RespondToAuthChallenge",{}).n("CognitoIdentityProviderClient","RespondToAuthChallengeCommand").sc(sQ).build(){}class pQ{init(e,t,n){this.cognitoClient=new fQ({region:t}),this.spiffRegion=e,this.userPoolClientId=n}async generateCode(e){const t=await this.cognitoClient?.send(new g2({AuthFlow:"CUSTOM_AUTH",ClientId:this.userPoolClientId,AuthParameters:{USERNAME:e}}));t?.ChallengeName==="CUSTOM_CHALLENGE"&&(this.challengeSession=t.Session)}async verifyCode(e,t,n){const i=await this.cognitoClient?.send(new hQ({ClientId:this.userPoolClientId,ChallengeName:"CUSTOM_CHALLENGE",Session:this.challengeSession,ChallengeResponses:{USERNAME:e,ANSWER:t},ClientMetadata:{partnerId:n,environment:(this.spiffRegion||"").toLowerCase()}}));return i?.ChallengeName==="CUSTOM_CHALLENGE"&&(this.challengeSession=i.Session),i}async refreshTokens(){const e=localStorage.getItem("cognito-tokens");if(!e)throw new Error("Failed to find existing tokens.");const t=JSON.parse(e);return await this.cognitoClient?.send(new g2({AuthFlow:"REFRESH_TOKEN_AUTH",ClientId:this.userPoolClientId,AuthParameters:{REFRESH_TOKEN:t.RefreshToken||""}}))}}const Id=new pQ;var gQ={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},mQ={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function nf(r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?nf=function(e){return typeof e}:nf=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nf(r)}function m2(r){return vQ(r)||yQ(r)||AQ(r)||wQ()}function vQ(r){if(Array.isArray(r))return r}function yQ(r){if(typeof Symbol<"u"&&Symbol.iterator in Object(r))return Array.from(r)}function AQ(r,e){if(r){if(typeof r=="string")return v2(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return v2(r,e)}}function v2(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function wQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3055
3055
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var bQ={normalizePrecision:function(e){var t=e.reduce(function(n,i){return Math.max(n.getPrecision(),i.getPrecision())});return e.map(function(n){return n.getPrecision()!==t?n.convertPrecision(t):n})},minimum:function(e){var t=m2(e),n=t[0],i=t.slice(1),a=n;return i.forEach(function(s){a=a.lessThan(s)?a:s}),a},maximum:function(e){var t=m2(e),n=t[0],i=t.slice(1),a=n;return i.forEach(function(s){a=a.greaterThan(s)?a:s}),a}};function MP(r){return!isNaN(parseInt(r))&&isFinite(r)}function CQ(r){return MP(r)&&r<=100&&r>=0}function xQ(r){return r.length>0&&r.every(function(e){return e>=0})&&r.some(function(e){return e>0})}function y2(r){return r%2===0}function A2(r){return MP(r)&&!Number.isInteger(r)}function SQ(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=r.toString();if(e.indexOf("e-")>0)return parseInt(e.split("e-")[1]);var t=e.split(".")[1];return t?t.length:0}function Pd(r){return Math.abs(r)%1===.5}function EQ(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(t,n){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){i.readyState===4&&(i.status>=200&&i.status<400?t(JSON.parse(i.responseText)):n(new Error(i.statusText)))},onerror:function(){n(new Error("Network error"))}});i.open("GET",r,!0),kQ(i,e.headers),i.send()})}function kQ(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var t in e)r.setRequestHeader(t,e[t]);return r}function Hd(r){return typeof r>"u"}function _P(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",t={};return Object.entries(r).forEach(function(n){if(nf(n[1])==="object"){var i=_P(n[1]);Object.entries(i).forEach(function(a){t[n[0]+e+a[0]]=a[1]})}else t[n[0]]=n[1]}),t}function TQ(r){return!!r&&(nf(r)==="object"||typeof r=="function")&&typeof r.then=="function"}function NP(){var r=function(n,i){var a=function(l){return Math.pow(10,SQ(l))},s=Math.max(a(n),a(i));return Math.round(n*s)*Math.round(i*s)/(s*s)},e={HALF_ODD:function(n){var i=Math.round(n);return Pd(n)&&y2(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return Pd(n)?y2(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return Pd(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return Pd(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return Pd(n)?Math.sign(n)*Math.ceil(Math.abs(n)):Math.round(n)},DOWN:function(n){return Math.floor(n)}};return{add:function(n,i){return n+i},subtract:function(n,i){return n-i},multiply:function(n,i){return A2(n)||A2(i)?r(n,i):n*i},divide:function(n,i){return n/i},modulo:function(n,i){return n%i},round:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return e[i](n)}}}var FQ=NP();function IQ(r){var e=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(r);return{getMatches:function(){return e!==null?e.slice(1).filter(function(n){return!Hd(n)}):[]},getMinimumFractionDigits:function(){var n=function(a){return a==="."};return Hd(this.getMatches().find(n))?0:this.getMatches()[FQ.add(this.getMatches().findIndex(n),1)].split("").length},getCurrencyDisplay:function(){var n={USD:"code",dollar:"name",$:"symbol"};return n[this.getMatches().find(function(i){return i==="USD"||i==="dollar"||i==="$"})]},getStyle:function(){return Hd(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Hd(this.getMatches().find(function(n){return n===","}))}}}function PQ(r){var e=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;for(var s in a)i=i.replace("{{".concat(s,"}}"),a[s]);return i},t=function(i,a){return EQ(e(r.endpoint,{from:i,to:a}),{headers:r.headers})};return{getExchangeRate:function(i,a){return(TQ(r.endpoint)?r.endpoint:t(i,a)).then(function(s){return _P(s)[e(r.propertyPath,{from:i,to:a})]})}}}function If(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!r)throw new t(e)}function DQ(r){If(CQ(r),"You must provide a numeric value between 0 and 100.",RangeError)}function RQ(r){If(xQ(r),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function ry(r){If(Number.isInteger(r),"You must provide an integer.",TypeError)}var Tn=NP(),OQ=function r(e){var t=Object.assign({},{amount:r.defaultAmount,currency:r.defaultCurrency,precision:r.defaultPrecision},e),n=t.amount,i=t.currency,a=t.precision;ry(n),ry(a);var s=r.globalLocale,o=r.globalFormat,l=r.globalRoundingMode,u=r.globalFormatRoundingMode,c=Object.assign({},r.globalExchangeRatesApi),f=function(g){var v=Object.assign({},Object.assign({},{amount:n,currency:i,precision:a},g),Object.assign({},{locale:this.locale},g));return Object.assign(r({amount:v.amount,currency:v.currency,precision:v.precision}),{locale:v.locale})},d=function(g){If(this.hasSameCurrency(g),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return n},getCurrency:function(){return i},getLocale:function(){return this.locale||s},setLocale:function(g){return f.call(this,{locale:g})},getPrecision:function(){return a},convertPrecision:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;ry(g);var y=this.getPrecision(),A=g>y,C=A?Tn.multiply:Tn.divide,S=A?[g,y]:[y,g],F=Math.pow(10,Tn.subtract.apply(Tn,S));return f.call(this,{amount:Tn.round(C(this.getAmount(),F),v),precision:g})},add:function(g){d.call(this,g);var v=r.normalizePrecision([this,g]);return f.call(this,{amount:Tn.add(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},subtract:function(g){d.call(this,g);var v=r.normalizePrecision([this,g]);return f.call(this,{amount:Tn.subtract(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},multiply:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return f.call(this,{amount:Tn.round(Tn.multiply(this.getAmount(),g),v)})},divide:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return f.call(this,{amount:Tn.round(Tn.divide(this.getAmount(),g),v)})},percentage:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return DQ(g),this.multiply(Tn.divide(g,100),v)},allocate:function(g){var v=this;RQ(g);for(var y=g.reduce(function(F,E){return Tn.add(F,E)}),A=this.getAmount(),C=g.map(function(F){var E=Math.floor(Tn.divide(Tn.multiply(v.getAmount(),F),y));return A=Tn.subtract(A,E),f.call(v,{amount:E})}),S=0;A>0;)g[S]>0&&(C[S]=C[S].add(f.call(this,{amount:1})),A=Tn.subtract(A,1)),S+=1;return C},convert:function(g){var v=this,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=y.endpoint,C=A===void 0?c.endpoint:A,S=y.propertyPath,F=S===void 0?c.propertyPath||"rates.{{to}}":S,E=y.headers,R=E===void 0?c.headers:E,B=y.roundingMode,G=B===void 0?l:B,j=Object.assign({},{endpoint:C,propertyPath:F,headers:R,roundingMode:G});return PQ(j).getExchangeRate(this.getCurrency(),g).then(function(ie){return If(!Hd(ie),'No rate was found for the destination currency "'.concat(g,'".'),TypeError),f.call(v,{amount:Tn.round(Tn.multiply(v.getAmount(),parseFloat(ie)),j.roundingMode),currency:g})})},equalsTo:function(g){return this.hasSameAmount(g)&&this.hasSameCurrency(g)},lessThan:function(g){d.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()<v[1].getAmount()},lessThanOrEqual:function(g){d.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()<=v[1].getAmount()},greaterThan:function(g){d.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()>v[1].getAmount()},greaterThanOrEqual:function(g){d.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()>=v[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return Tn.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return Tn.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(g){return this.getCurrency()===g.getCurrency()},hasSameAmount:function(g){var v=r.normalizePrecision([this,g]);return v[0].getAmount()===v[1].getAmount()},toFormat:function(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=IQ(g);return this.toRoundedUnit(y.getMinimumFractionDigits(),v).toLocaleString(this.getLocale(),{currencyDisplay:y.getCurrencyDisplay(),useGrouping:y.getUseGrouping(),minimumFractionDigits:y.getMinimumFractionDigits(),style:y.getStyle(),currency:this.getCurrency()})},toUnit:function(){return Tn.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=Math.pow(10,g);return Tn.divide(Tn.round(Tn.multiply(this.toUnit(),y),v),y)},toObject:function(){return{amount:n,currency:i,precision:a}},toJSON:function(){return this.toObject()}}},BQ=Object.assign(OQ,gQ,mQ,bQ),Xa={},ny,w2;function MQ(){if(w2)return ny;w2=1;function r(t){return t}function e(t,a,s){for(var a=a||r,s=s||t,o=0,l=t.length;o<l;o+=1)if(a.call(s,t[o],o))return t[o]}return ny=e,ny}var iy={exports:{}},b2;function _Q(){if(b2)return iy.exports;b2=1;var r=iy.exports=function(e,t){if(typeof e=="function"||t)return r.by(e,t);for(var n={object:[],function:[],string:{},number:{},boolean:{},undefined:{}},i=[],a=0;a<e.length;a++){var s=e[a],o=s==="__proto__"?n.objects:n[typeof s]||n.objects;Array.isArray(o)?o.indexOf(s)<0&&(o.push(s),i.push(s)):Object.hasOwnProperty.call(o,s)||(o[s]=!0,i.push(s))}return i};return r.by=function(e,t){if(typeof e=="function"){var n=t;t=e,e=n}for(var i=[],a=0;a<e.length;a++){for(var s=e[a],o=!1,l=0;l<i.length;l++){var u=i[l];if(t.call(i,s,u)){o=!0;break}}o||i.push(s)}return i},iy.exports}var ay,C2;function NQ(){return C2||(C2=1,ay=[{code:"AED",number:"784",digits:2,currency:"UAE Dirham",countries:["United Arab Emirates (The)"]},{code:"AFN",number:"971",digits:2,currency:"Afghani",countries:["Afghanistan"]},{code:"ALL",number:"008",digits:2,currency:"Lek",countries:["Albania"]},{code:"AMD",number:"051",digits:2,currency:"Armenian Dram",countries:["Armenia"]},{code:"ANG",number:"532",digits:2,currency:"Netherlands Antillean Guilder",countries:["Curaçao","Sint Maarten (Dutch Part)"]},{code:"AOA",number:"973",digits:2,currency:"Kwanza",countries:["Angola"]},{code:"ARS",number:"032",digits:2,currency:"Argentine Peso",countries:["Argentina"]},{code:"AUD",number:"036",digits:2,currency:"Australian Dollar",countries:["Australia","Christmas Island","Cocos (Keeling) Islands (The)","Heard Island and Mcdonald Islands","Kiribati","Nauru","Norfolk Island","Tuvalu"]},{code:"AWG",number:"533",digits:2,currency:"Aruban Florin",countries:["Aruba"]},{code:"AZN",number:"944",digits:2,currency:"Azerbaijan Manat",countries:["Azerbaijan"]},{code:"BAM",number:"977",digits:2,currency:"Convertible Mark",countries:["Bosnia and Herzegovina"]},{code:"BBD",number:"052",digits:2,currency:"Barbados Dollar",countries:["Barbados"]},{code:"BDT",number:"050",digits:2,currency:"Taka",countries:["Bangladesh"]},{code:"BGN",number:"975",digits:2,currency:"Bulgarian Lev",countries:["Bulgaria"]},{code:"BHD",number:"048",digits:3,currency:"Bahraini Dinar",countries:["Bahrain"]},{code:"BIF",number:"108",digits:0,currency:"Burundi Franc",countries:["Burundi"]},{code:"BMD",number:"060",digits:2,currency:"Bermudian Dollar",countries:["Bermuda"]},{code:"BND",number:"096",digits:2,currency:"Brunei Dollar",countries:["Brunei Darussalam"]},{code:"BOB",number:"068",digits:2,currency:"Boliviano",countries:["Bolivia (Plurinational State Of)"]},{code:"BOV",number:"984",digits:2,currency:"Mvdol",countries:["Bolivia (Plurinational State Of)"]},{code:"BRL",number:"986",digits:2,currency:"Brazilian Real",countries:["Brazil"]},{code:"BSD",number:"044",digits:2,currency:"Bahamian Dollar",countries:["Bahamas (The)"]},{code:"BTN",number:"064",digits:2,currency:"Ngultrum",countries:["Bhutan"]},{code:"BWP",number:"072",digits:2,currency:"Pula",countries:["Botswana"]},{code:"BYN",number:"933",digits:2,currency:"Belarusian Ruble",countries:["Belarus"]},{code:"BZD",number:"084",digits:2,currency:"Belize Dollar",countries:["Belize"]},{code:"CAD",number:"124",digits:2,currency:"Canadian Dollar",countries:["Canada"]},{code:"CDF",number:"976",digits:2,currency:"Congolese Franc",countries:["Congo (The Democratic Republic of The)"]},{code:"CHE",number:"947",digits:2,currency:"WIR Euro",countries:["Switzerland"]},{code:"CHF",number:"756",digits:2,currency:"Swiss Franc",countries:["Liechtenstein","Switzerland"]},{code:"CHW",number:"948",digits:2,currency:"WIR Franc",countries:["Switzerland"]},{code:"CLF",number:"990",digits:4,currency:"Unidad de Fomento",countries:["Chile"]},{code:"CLP",number:"152",digits:0,currency:"Chilean Peso",countries:["Chile"]},{code:"CNY",number:"156",digits:2,currency:"Yuan Renminbi",countries:["China"]},{code:"COP",number:"170",digits:2,currency:"Colombian Peso",countries:["Colombia"]},{code:"COU",number:"970",digits:2,currency:"Unidad de Valor Real",countries:["Colombia"]},{code:"CRC",number:"188",digits:2,currency:"Costa Rican Colon",countries:["Costa Rica"]},{code:"CUC",number:"931",digits:2,currency:"Peso Convertible",countries:["Cuba"]},{code:"CUP",number:"192",digits:2,currency:"Cuban Peso",countries:["Cuba"]},{code:"CVE",number:"132",digits:2,currency:"Cabo Verde Escudo",countries:["Cabo Verde"]},{code:"CZK",number:"203",digits:2,currency:"Czech Koruna",countries:["Czechia"]},{code:"DJF",number:"262",digits:0,currency:"Djibouti Franc",countries:["Djibouti"]},{code:"DKK",number:"208",digits:2,currency:"Danish Krone",countries:["Denmark","Faroe Islands (The)","Greenland"]},{code:"DOP",number:"214",digits:2,currency:"Dominican Peso",countries:["Dominican Republic (The)"]},{code:"DZD",number:"012",digits:2,currency:"Algerian Dinar",countries:["Algeria"]},{code:"EGP",number:"818",digits:2,currency:"Egyptian Pound",countries:["Egypt"]},{code:"ERN",number:"232",digits:2,currency:"Nakfa",countries:["Eritrea"]},{code:"ETB",number:"230",digits:2,currency:"Ethiopian Birr",countries:["Ethiopia"]},{code:"EUR",number:"978",digits:2,currency:"Euro",countries:["Åland Islands","Andorra","Austria","Belgium","Croatia","Cyprus","Estonia","European Union","Finland","France","French Guiana","French Southern Territories (The)","Germany","Greece","Guadeloupe","Holy See (The)","Ireland","Italy","Latvia","Lithuania","Luxembourg","Malta","Martinique","Mayotte","Monaco","Montenegro","Netherlands (The)","Portugal","Réunion","Saint Barthélemy","Saint Martin (French Part)","Saint Pierre and Miquelon","San Marino","Slovakia","Slovenia","Spain"]},{code:"FJD",number:"242",digits:2,currency:"Fiji Dollar",countries:["Fiji"]},{code:"FKP",number:"238",digits:2,currency:"Falkland Islands Pound",countries:["Falkland Islands (The) [Malvinas]"]},{code:"GBP",number:"826",digits:2,currency:"Pound Sterling",countries:["Guernsey","Isle of Man","Jersey","United Kingdom of Great Britain and Northern Ireland (The)"]},{code:"GEL",number:"981",digits:2,currency:"Lari",countries:["Georgia"]},{code:"GHS",number:"936",digits:2,currency:"Ghana Cedi",countries:["Ghana"]},{code:"GIP",number:"292",digits:2,currency:"Gibraltar Pound",countries:["Gibraltar"]},{code:"GMD",number:"270",digits:2,currency:"Dalasi",countries:["Gambia (The)"]},{code:"GNF",number:"324",digits:0,currency:"Guinean Franc",countries:["Guinea"]},{code:"GTQ",number:"320",digits:2,currency:"Quetzal",countries:["Guatemala"]},{code:"GYD",number:"328",digits:2,currency:"Guyana Dollar",countries:["Guyana"]},{code:"HKD",number:"344",digits:2,currency:"Hong Kong Dollar",countries:["Hong Kong"]},{code:"HNL",number:"340",digits:2,currency:"Lempira",countries:["Honduras"]},{code:"HTG",number:"332",digits:2,currency:"Gourde",countries:["Haiti"]},{code:"HUF",number:"348",digits:2,currency:"Forint",countries:["Hungary"]},{code:"IDR",number:"360",digits:2,currency:"Rupiah",countries:["Indonesia"]},{code:"ILS",number:"376",digits:2,currency:"New Israeli Sheqel",countries:["Israel"]},{code:"INR",number:"356",digits:2,currency:"Indian Rupee",countries:["Bhutan","India"]},{code:"IQD",number:"368",digits:3,currency:"Iraqi Dinar",countries:["Iraq"]},{code:"IRR",number:"364",digits:2,currency:"Iranian Rial",countries:["Iran (Islamic Republic Of)"]},{code:"ISK",number:"352",digits:0,currency:"Iceland Krona",countries:["Iceland"]},{code:"JMD",number:"388",digits:2,currency:"Jamaican Dollar",countries:["Jamaica"]},{code:"JOD",number:"400",digits:3,currency:"Jordanian Dinar",countries:["Jordan"]},{code:"JPY",number:"392",digits:0,currency:"Yen",countries:["Japan"]},{code:"KES",number:"404",digits:2,currency:"Kenyan Shilling",countries:["Kenya"]},{code:"KGS",number:"417",digits:2,currency:"Som",countries:["Kyrgyzstan"]},{code:"KHR",number:"116",digits:2,currency:"Riel",countries:["Cambodia"]},{code:"KMF",number:"174",digits:0,currency:"Comorian Franc ",countries:["Comoros (The)"]},{code:"KPW",number:"408",digits:2,currency:"North Korean Won",countries:["Korea (The Democratic People’s Republic Of)"]},{code:"KRW",number:"410",digits:0,currency:"Won",countries:["Korea (The Republic Of)"]},{code:"KWD",number:"414",digits:3,currency:"Kuwaiti Dinar",countries:["Kuwait"]},{code:"KYD",number:"136",digits:2,currency:"Cayman Islands Dollar",countries:["Cayman Islands (The)"]},{code:"KZT",number:"398",digits:2,currency:"Tenge",countries:["Kazakhstan"]},{code:"LAK",number:"418",digits:2,currency:"Lao Kip",countries:["Lao People’s Democratic Republic (The)"]},{code:"LBP",number:"422",digits:2,currency:"Lebanese Pound",countries:["Lebanon"]},{code:"LKR",number:"144",digits:2,currency:"Sri Lanka Rupee",countries:["Sri Lanka"]},{code:"LRD",number:"430",digits:2,currency:"Liberian Dollar",countries:["Liberia"]},{code:"LSL",number:"426",digits:2,currency:"Loti",countries:["Lesotho"]},{code:"LYD",number:"434",digits:3,currency:"Libyan Dinar",countries:["Libya"]},{code:"MAD",number:"504",digits:2,currency:"Moroccan Dirham",countries:["Morocco","Western Sahara"]},{code:"MDL",number:"498",digits:2,currency:"Moldovan Leu",countries:["Moldova (The Republic Of)"]},{code:"MGA",number:"969",digits:2,currency:"Malagasy Ariary",countries:["Madagascar"]},{code:"MKD",number:"807",digits:2,currency:"Denar",countries:["North Macedonia"]},{code:"MMK",number:"104",digits:2,currency:"Kyat",countries:["Myanmar"]},{code:"MNT",number:"496",digits:2,currency:"Tugrik",countries:["Mongolia"]},{code:"MOP",number:"446",digits:2,currency:"Pataca",countries:["Macao"]},{code:"MRU",number:"929",digits:2,currency:"Ouguiya",countries:["Mauritania"]},{code:"MUR",number:"480",digits:2,currency:"Mauritius Rupee",countries:["Mauritius"]},{code:"MVR",number:"462",digits:2,currency:"Rufiyaa",countries:["Maldives"]},{code:"MWK",number:"454",digits:2,currency:"Malawi Kwacha",countries:["Malawi"]},{code:"MXN",number:"484",digits:2,currency:"Mexican Peso",countries:["Mexico"]},{code:"MXV",number:"979",digits:2,currency:"Mexican Unidad de Inversion (UDI)",countries:["Mexico"]},{code:"MYR",number:"458",digits:2,currency:"Malaysian Ringgit",countries:["Malaysia"]},{code:"MZN",number:"943",digits:2,currency:"Mozambique Metical",countries:["Mozambique"]},{code:"NAD",number:"516",digits:2,currency:"Namibia Dollar",countries:["Namibia"]},{code:"NGN",number:"566",digits:2,currency:"Naira",countries:["Nigeria"]},{code:"NIO",number:"558",digits:2,currency:"Cordoba Oro",countries:["Nicaragua"]},{code:"NOK",number:"578",digits:2,currency:"Norwegian Krone",countries:["Bouvet Island","Norway","Svalbard and Jan Mayen"]},{code:"NPR",number:"524",digits:2,currency:"Nepalese Rupee",countries:["Nepal"]},{code:"NZD",number:"554",digits:2,currency:"New Zealand Dollar",countries:["Cook Islands (The)","New Zealand","Niue","Pitcairn","Tokelau"]},{code:"OMR",number:"512",digits:3,currency:"Rial Omani",countries:["Oman"]},{code:"PAB",number:"590",digits:2,currency:"Balboa",countries:["Panama"]},{code:"PEN",number:"604",digits:2,currency:"Sol",countries:["Peru"]},{code:"PGK",number:"598",digits:2,currency:"Kina",countries:["Papua New Guinea"]},{code:"PHP",number:"608",digits:2,currency:"Philippine Peso",countries:["Philippines (The)"]},{code:"PKR",number:"586",digits:2,currency:"Pakistan Rupee",countries:["Pakistan"]},{code:"PLN",number:"985",digits:2,currency:"Zloty",countries:["Poland"]},{code:"PYG",number:"600",digits:0,currency:"Guarani",countries:["Paraguay"]},{code:"QAR",number:"634",digits:2,currency:"Qatari Rial",countries:["Qatar"]},{code:"RON",number:"946",digits:2,currency:"Romanian Leu",countries:["Romania"]},{code:"RSD",number:"941",digits:2,currency:"Serbian Dinar",countries:["Serbia"]},{code:"RUB",number:"643",digits:2,currency:"Russian Ruble",countries:["Russian Federation (The)"]},{code:"RWF",number:"646",digits:0,currency:"Rwanda Franc",countries:["Rwanda"]},{code:"SAR",number:"682",digits:2,currency:"Saudi Riyal",countries:["Saudi Arabia"]},{code:"SBD",number:"090",digits:2,currency:"Solomon Islands Dollar",countries:["Solomon Islands"]},{code:"SCR",number:"690",digits:2,currency:"Seychelles Rupee",countries:["Seychelles"]},{code:"SDG",number:"938",digits:2,currency:"Sudanese Pound",countries:["Sudan (The)"]},{code:"SEK",number:"752",digits:2,currency:"Swedish Krona",countries:["Sweden"]},{code:"SGD",number:"702",digits:2,currency:"Singapore Dollar",countries:["Singapore"]},{code:"SHP",number:"654",digits:2,currency:"Saint Helena Pound",countries:["Saint Helena, Ascension and Tristan Da Cunha"]},{code:"SLE",number:"925",digits:2,currency:"Leone",countries:["Sierra Leone"]},{code:"SOS",number:"706",digits:2,currency:"Somali Shilling",countries:["Somalia"]},{code:"SRD",number:"968",digits:2,currency:"Surinam Dollar",countries:["Suriname"]},{code:"SSP",number:"728",digits:2,currency:"South Sudanese Pound",countries:["South Sudan"]},{code:"STN",number:"930",digits:2,currency:"Dobra",countries:["Sao Tome and Principe"]},{code:"SVC",number:"222",digits:2,currency:"El Salvador Colon",countries:["El Salvador"]},{code:"SYP",number:"760",digits:2,currency:"Syrian Pound",countries:["Syrian Arab Republic"]},{code:"SZL",number:"748",digits:2,currency:"Lilangeni",countries:["Eswatini"]},{code:"THB",number:"764",digits:2,currency:"Baht",countries:["Thailand"]},{code:"TJS",number:"972",digits:2,currency:"Somoni",countries:["Tajikistan"]},{code:"TMT",number:"934",digits:2,currency:"Turkmenistan New Manat",countries:["Turkmenistan"]},{code:"TND",number:"788",digits:3,currency:"Tunisian Dinar",countries:["Tunisia"]},{code:"TOP",number:"776",digits:2,currency:"Pa’anga",countries:["Tonga"]},{code:"TRY",number:"949",digits:2,currency:"Turkish Lira",countries:["Türki̇ye"]},{code:"TTD",number:"780",digits:2,currency:"Trinidad and Tobago Dollar",countries:["Trinidad and Tobago"]},{code:"TWD",number:"901",digits:2,currency:"New Taiwan Dollar",countries:["Taiwan (Province of China)"]},{code:"TZS",number:"834",digits:2,currency:"Tanzanian Shilling",countries:["Tanzania, United Republic Of"]},{code:"UAH",number:"980",digits:2,currency:"Hryvnia",countries:["Ukraine"]},{code:"UGX",number:"800",digits:0,currency:"Uganda Shilling",countries:["Uganda"]},{code:"USD",number:"840",digits:2,currency:"US Dollar",countries:["American Samoa","Bonaire, Sint Eustatius and Saba","British Indian Ocean Territory (The)","Ecuador","El Salvador","Guam","Haiti","Marshall Islands (The)","Micronesia (Federated States Of)","Northern Mariana Islands (The)","Palau","Panama","Puerto Rico","Timor-Leste","Turks and Caicos Islands (The)","United States Minor Outlying Islands (The)","United States of America (The)","Virgin Islands (British)","Virgin Islands (u.s.)"]},{code:"USN",number:"997",digits:2,currency:"US Dollar (Next day)",countries:["United States of America (The)"]},{code:"UYI",number:"940",digits:0,currency:"Uruguay Peso en Unidades Indexadas (UI)",countries:["Uruguay"]},{code:"UYU",number:"858",digits:2,currency:"Peso Uruguayo",countries:["Uruguay"]},{code:"UYW",number:"927",digits:4,currency:"Unidad Previsional",countries:["Uruguay"]},{code:"UZS",number:"860",digits:2,currency:"Uzbekistan Sum",countries:["Uzbekistan"]},{code:"VED",number:"926",digits:2,currency:"Bolívar Soberano",countries:["Venezuela (Bolivarian Republic Of)"]},{code:"VES",number:"928",digits:2,currency:"Bolívar Soberano",countries:["Venezuela (Bolivarian Republic Of)"]},{code:"VND",number:"704",digits:0,currency:"Dong",countries:["Viet Nam"]},{code:"VUV",number:"548",digits:0,currency:"Vatu",countries:["Vanuatu"]},{code:"WST",number:"882",digits:2,currency:"Tala",countries:["Samoa"]},{code:"XAF",number:"950",digits:0,currency:"CFA Franc BEAC",countries:["Cameroon","Central African Republic (The)","Chad","Congo (The)","Equatorial Guinea","Gabon"]},{code:"XAG",number:"961",digits:0,currency:"Silver",countries:["Zz11_silver"]},{code:"XAU",number:"959",digits:0,currency:"Gold",countries:["Zz08_gold"]},{code:"XBA",number:"955",digits:0,currency:"Bond Markets Unit European Composite Unit (EURCO)",countries:["Zz01_bond Markets Unit European_eurco"]},{code:"XBB",number:"956",digits:0,currency:"Bond Markets Unit European Monetary Unit (E.M.U.-6)",countries:["Zz02_bond Markets Unit European_emu-6"]},{code:"XBC",number:"957",digits:0,currency:"Bond Markets Unit European Unit of Account 9 (E.U.A.-9)",countries:["Zz03_bond Markets Unit European_eua-9"]},{code:"XBD",number:"958",digits:0,currency:"Bond Markets Unit European Unit of Account 17 (E.U.A.-17)",countries:["Zz04_bond Markets Unit European_eua-17"]},{code:"XCD",number:"951",digits:2,currency:"East Caribbean Dollar",countries:["Anguilla","Antigua and Barbuda","Dominica","Grenada","Montserrat","Saint Kitts and Nevis","Saint Lucia","Saint Vincent and the Grenadines"]},{code:"XDR",number:"960",digits:0,currency:"SDR (Special Drawing Right)",countries:["International Monetary Fund (Imf) "]},{code:"XOF",number:"952",digits:0,currency:"CFA Franc BCEAO",countries:["Benin","Burkina Faso","Côte D'ivoire","Guinea-Bissau","Mali","Niger (The)","Senegal","Togo"]},{code:"XPD",number:"964",digits:0,currency:"Palladium",countries:["Zz09_palladium"]},{code:"XPF",number:"953",digits:0,currency:"CFP Franc",countries:["French Polynesia","New Caledonia","Wallis and Futuna"]},{code:"XPT",number:"962",digits:0,currency:"Platinum",countries:["Zz10_platinum"]},{code:"XSU",number:"994",digits:0,currency:"Sucre",countries:['Sistema Unitario De Compensacion Regional De Pagos "Sucre"']},{code:"XTS",number:"963",digits:0,currency:"Codes specifically reserved for testing purposes",countries:["Zz06_testing_code"]},{code:"XUA",number:"965",digits:0,currency:"ADB Unit of Account",countries:["Member Countries of the African Development Bank Group"]},{code:"XXX",number:"999",digits:0,currency:"The codes assigned for transactions where no currency is involved",countries:["Zz07_no_currency"]},{code:"YER",number:"886",digits:2,currency:"Yemeni Rial",countries:["Yemen"]},{code:"ZAR",number:"710",digits:2,currency:"Rand",countries:["Lesotho","Namibia","South Africa"]},{code:"ZMW",number:"967",digits:2,currency:"Zambian Kwacha",countries:["Zambia"]},{code:"ZWG",number:"924",digits:2,currency:"Zimbabwe Gold",countries:["Zimbabwe"]}]),ay}var sy,x2;function LQ(){return x2||(x2=1,sy="2024-06-25"),sy}var S2;function UQ(){if(S2)return Xa;S2=1;var r=MQ(),e=_Q(),t=NQ(),n=LQ(),i=function(c){return c=c.toUpperCase(),r(t,function(f){return f.code===c})},a=function(c){return c=c.toLowerCase(),t.filter(function(f){return(f.countries.map(function(d){return d.toLowerCase()})||[]).indexOf(c)>-1})},s=function(c){return r(t,function(f){return f.number===String(c)})},o=function(){return t.map(function(c){return c.code})},l=function(){var c=t.map(function(f){return f.number});return c.filter(function(f){if(f)return f})},u=function(){var c=t.filter(function(f){return f.countries}).map(function(f){return f.countries});return e(Array.prototype.concat.apply([],c))};return Xa.code=i,Xa.country=a,Xa.number=s,Xa.codes=o,Xa.numbers=l,Xa.countries=u,Xa.publishDate=n,Xa.data=t,Xa}var E2=UQ();class LP{formatCurrencyForDisplay(e,t){const n={amount:t||0,currency:e,precision:this.getPrecisionForCurrency(e)};return BQ(n).toFormat(this.getSpecialFormat(e))}getPrecisionForCurrency(e){const t=e,n=E2.code(t);return n?n.digits:2}getSpecialFormat(e){const t=e;if(E2.code(t)?.code==="CLP")return"USD0,0"}}const k2=new LP;class UP{constructor(e,t,n,i){this.presentmentCurrency=void 0,this.presentmentCurrency=i,this.partnerCurrency=n,this.rateFrom=e,this.rateTo=t}code(){return this.presentmentCurrency?this.presentmentCurrency:this.partnerCurrency}conversionRequired(){return this.presentmentCurrency!==void 0&&this.code()!==this.partnerCurrency}getConvertedSubunits(e){return this.conversionRequired()?Math.ceil(this.subunits(this.units(e,this.partnerCurrency)/this.rateFrom*this.rateTo,this.code())):e}units(e,t){return e/Math.pow(10,k2.getPrecisionForCurrency(t))}subunits(e,t){return e*Math.pow(10,k2.getPrecisionForCurrency(t))}}const VQ=async(r,e)=>{const t=Y3(e?.assets?.metadata||!1),n={ids:r};console.log("[getWorkflowsInternal] Requesting workflows.",{url:`${ss.getServerUrl()}/graphql`,variables:JSON.stringify(n)}),console.log(`[getWorkflowsInternal] Query:
3056
- ${V2(t)}`);const i=await ze.getShadowGraphqlClient().query({query:t,errorPolicy:"all",variables:n,context:{logRequestHeaders:!0}});if(i.error)throw console.log("[getWorkflowsInternal] Response errored."),i.error;if(i.errors)throw i.errors.forEach(s=>console.error(s)),new Error("Unable to read workflows. Consult GraphQL errors.");if(!i.data.workflows||i.data.workflows.length!==r.length)throw new Error(`Unable to read workflows: ${i.errors??"Length mismatch in response"}`);const a=mo(i.data.workflows);return a.forEach(s=>{s.finalizeStepConfig||(s.finalizeStepConfig={}),s.finalizeStepConfig.termsMarkdown=s.finalizeStepConfig.termsMarkdown||s.partner.termsMarkdown}),a},zQ=async(r,e)=>{const n=(await e).find(i=>i.id===r);if(!n)throw new Error(`Workflow not found: ${r}`);return n},tb=async(r,e)=>{const t=r.map(o=>mf.get({id:o,options:e})),n=r.filter((o,l)=>t[l]===void 0);if(n.length===0)return Promise.all(t);const i=VQ(n,e),a=n.map(o=>mf.set({id:o,options:e},zQ(o,i))),s=t.filter(o=>o!==void 0);return await Promise.all(s.concat(a))},VP=async(r,e)=>(await tb([r],e))[0],zP=async r=>{const e=await ze.getShadowGraphqlClient().query({query:wT,variables:{ids:r},errorPolicy:"all",fetchPolicy:"no-cache"});return e.errors&&console.error(e.errors),e.data.integrationProducts||[]};class $Q{constructor(e){this.activeIntegration=void 0,this.updateTransactionState=async t=>{try{return ze.getShadowGraphqlClient().mutate({...t,mutation:B3})}catch(n){throw console.error(n),new lo("Critical - Unable to synchronize workflow state with server.")}},this.options=e,this.options.applicationKey&&Jk(this.options.applicationKey),console.debug("------------------------"),console.debug("Spiff Commerce Core SDK"),console.debug("Version: 44.5.6-alpha.1"),console.debug(`Application Key Provided: ${!!this.options.applicationKey}`),console.debug("------------------------")}configure(e){ss.setHubUrl(e.hubUrl),ss.setServerUrl(e.serverUrl),ss.setServicesApiUrl(e.servicesApiUrl),this.marketplaceThemeInstallId=e.marketplaceThemeInstallId,this.marketplaceThemeInstallConfigurationId=e.marketplaceThemeInstallConfigurationId,this.userPoolClientId=e.userPoolClientId,this.userPoolRegion=e.userPoolRegion,this.spiffRegion=e.spiffRegion,e.bearerAuthenticationToken&&Zk(e.bearerAuthenticationToken),this.options.applicationKey&&this.getIntegration(),this.spiffRegion&&this.userPoolRegion&&this.userPoolClientId&&Id.init(this.spiffRegion,this.userPoolRegion,this.userPoolClientId)}getVersion(){return"44.5.6-alpha.1"}getAssetManager(){return Ln}async getBetaEnabled(){return this.options.enableBetaFeatures?!0:(await this.getIntegration()).partner.beta===!0}getFlowService(){if(!eB())throw new Error("Application key required to use Flow Service.");return new NI}async getCurrencyContext(e){const n=(await this.getIntegration()).partner.currencyCode,a=await ze.getShadowGraphqlClient().query({query:tM,errorPolicy:"all",fetchPolicy:"cache-first",variables:{from:n,to:e}}),{rateFrom:s,rateTo:o}=a.data.currencyConversion;return new UP(s,o,n,e)}async getIntegration(){if(this.activeIntegration)return this.activeIntegration;if(!this.options.applicationKey)throw new Error("Cannot get current Integration without specifying an Application Key.");return this.activeIntegration=$P(this.options.applicationKey),this.activeIntegration}async canUseAddon(e){try{return(await this.getIntegration()).partner.activeAddons?.includes(e)??!1}catch(t){return console.error(t),!1}}clearCustomer(){this.customer=void 0}clearCustomerForTransaction(e){const t=br.getMap("transactionCustomerIds");t?.has(e)&&(t.delete(e),br.setMap("transactionCustomerIds",t))}async customerHasBundleTemplates(e){const i=(await ze.getShadowGraphqlClient().query({query:Bv,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e}})).data.customer;return i.id?i.hasBundleTemplates??!1:!1}getStakeholderTypeForTransaction(e){const t=this.customer?.stakeholders?.find(n=>n.transaction?.id===e);if(t)return t.type}async getOrCreateCustomer(e){this.customer=void 0;const t=ze.getShadowGraphqlClient(),i=(await t.query({query:Bv,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e}})).data.customer;if(!i.id){const o=(await t.mutate({mutation:bV,errorPolicy:"all",fetchPolicy:"no-cache",variables:{details:{emailAddress:e}}})).data?.customerCreate;if(!o)throw new Error("Unable to create customer.");return this.storeCustomer(o),this.customer=o,{customer:o,isAuthenticated:!1}}this.storeCustomer(i);const a=await this.reloadLoggedInCustomer();return{customer:this.customer||i,isAuthenticated:a}}getCustomer(){return this.customer}async reloadLoggedInCustomer(){const e=localStorage.getItem("last-refreshed-cognito-tokens"),t=localStorage.getItem("cognito-tokens"),n=localStorage.getItem("cognito-email");if(!e||!t||!n)return!1;const i=JSON.parse(t),a=new Date().getTime()/1e3;if(!i.ExpiresIn||i.ExpiresIn<a-parseInt(e)){const u=await Id.refreshTokens();if(u?.AuthenticationResult)localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),i.AccessToken=u.AuthenticationResult.AccessToken,localStorage.setItem("cognito-tokens",JSON.stringify(i));else return this.logOut(),console.error("Failed to refresh tokens."),!1}const s=localStorage.getItem("customer-login-token");s&&p0(s);const l=(await ze.getShadowGraphqlClient().query({query:Bv,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:n}})).data.customer;return l.id?(this.customer=l,!0):(console.error("Failed to get customer."),!1)}async generateVerificationCode(e){await ze.getShadowGraphqlClient().mutate({mutation:CV,variables:{emailAddress:e}}),await Id.generateCode(e)}async verifyCode(e,t){const n=(await this.getIntegration()).partner.id||"",i=await Id.verifyCode(e,t,n);if(i?.AuthenticationResult){localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),localStorage.setItem("cognito-tokens",JSON.stringify(i.AuthenticationResult)),localStorage.setItem("cognito-email",e);const s=(await ze.getShadowGraphqlClient().mutate({mutation:xV,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e,verificationCode:t}})).data?.customerVerifyCode;if(!s?.id)throw new Error("Failed to get customer.");return this.customer=s,s.loginToken&&(localStorage.setItem("customer-login-token",s.loginToken),p0(s.loginToken)),!0}else throw new Error}async logOut(){localStorage.removeItem("last-refreshed-cognito-tokens"),localStorage.removeItem("cognito-tokens"),localStorage.removeItem("cognito-email"),localStorage.removeItem("customer-login-token"),p0(""),this.clearCustomer()}async loggedInBearerToken(){const e=localStorage.getItem("last-refreshed-cognito-tokens"),t=localStorage.getItem("cognito-tokens");if(!e||!t)throw new Error("No token data in storage.");const n=JSON.parse(t),i=new Date().getTime()/1e3,a=!n?.AccessToken||vg(n.AccessToken);if(!n.ExpiresIn||n.ExpiresIn<i-parseInt(e)||a){const s=await Id.refreshTokens();if(s?.AuthenticationResult)localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),n.AccessToken=s.AuthenticationResult.AccessToken,localStorage.setItem("cognito-tokens",JSON.stringify(n));else throw this.logOut(),new Error("Failed to refresh tokens.")}if(!n.AccessToken)throw new Error("No bearer token in storage.");return n.AccessToken}async getCustomerMetafields(){if(!this.customer?.id)throw new Error("Customer must be logged in before calling this function.");return(await ze.getShadowGraphqlClient().query({query:SV,variables:{id:this.customer.id}})).data.metafields}async getNewBundle(e,t,n,i){const s=(await ze.getShadowGraphqlClient().mutate({mutation:s9(n?.graphql?.productCollection?.eagerFetchProducts||!1),variables:{collectionId:e,initialMetadata:t?Object.entries(t).map((c,f)=>({key:c[0],value:c[1]})):void 0,marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId,activationId:i,test:n?.test},fetchPolicy:"no-cache"})).data?.bundleCreate;if(!s?.id)throw new Error("Unable to create bundle");const o=br.getMap("bundlePartnerIds")||new Map;o.set(s.id,s.partner.id),br.setMap("bundlePartnerIds",o);const l=br.getMap("bundleOwnerIds")||new Map;l.set(s.id,s.bundleOwnerId),br.setMap("bundleOwnerIds",l);const u=new OE(this,s,void 0,void 0,s.bundleOwnerId,{eagerFetchProducts:n?.graphql?.productCollection?.eagerFetchProducts});return await u.getInitializationPromise(),u}async getExistingBundle(e,t,n,i,a){const o=br.getMap("bundleOwnerIds")?.get(e),l={};try{const g=await this.loggedInBearerToken();l.Authorization=`Bearer ${g}`}catch{const y=Object.entries(localStorage).find(([C,S])=>C.startsWith("CognitoIdentityServiceProvider")&&C.endsWith("idToken"))?.[0]||"",A=localStorage.getItem(y);A&&!vg(A)&&(l.Authorization=`Bearer ${A}`)}const u={bundleOwnerId:o,...l,...i?.graphql?.additionalHeaders},c=await ze.getShadowGraphqlClient().query({query:r9(i?.graphql?.productCollection?.eagerFetchProducts||!1),variables:{id:e},fetchPolicy:"no-cache",context:{headers:u}});if(!c.data?.bundles||c.data?.bundles.length===0||!c.data?.bundles[0])throw new Error(`Unable to find bundle: ${e}`);const f=c.data?.bundles[0],d=br.getMap("bundlePartnerIds")||new Map;d.set(f.id,f.partner.id),br.setMap("bundlePartnerIds",d);const h=new OE(this,f,t,n,o,{additionalHeaders:i?.graphql?.additionalHeaders,eagerFetchProducts:i?.graphql?.productCollection?.eagerFetchProducts,existingGlobalPropertyState:c.data.globalPropertyState,readonly:i?.readonly},a);return await h.getInitializationPromise(),h}async duplicateBundle(e,t,n,i){const s={...await jP(e),...i?.graphql?.additionalHeaders},l=(await ze.getShadowGraphqlClient().mutate({mutation:o9(),variables:{id:e,template:t,marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId,duplicateTransactions:n,test:i?.test},context:{headers:s},fetchPolicy:"no-cache"})).data?.bundleDuplicate;if(!l?.id)throw new Error("Unable to duplicate bundle");const u=br.getMap("bundlePartnerIds")||new Map;u.set(l.id,l.partner.id),br.setMap("bundlePartnerIds",u);const c=br.getMap("bundleOwnerIds")||new Map;return c.set(l.id,l.bundleOwnerId),br.setMap("bundleOwnerIds",c),async()=>await this.getExistingBundle(l.id,void 0,void 0,{graphql:{productCollection:{eagerFetchProducts:i?.graphql?.productCollection?.eagerFetchProducts||!1}}})}async getBundlesForCustomer(e){if(!this.customer?.id)throw new Error("Customer not authenticated.");const{includeMetadata:t,...n}=e;return(await ze.getShadowGraphqlClient().query({query:y9(t??!1),variables:{...n,id:this.customer.id},fetchPolicy:"no-cache"})).data.customerBundlesFeed}async getBundleStakeholders(){if(!this.customer)throw new Error("Customer not authenticated.");const e=await ze.getShadowGraphqlClient().query({query:n9,variables:{id:this.customer.id},fetchPolicy:"no-cache"});if(!e.data?.customers||e.data.customers.length===0)throw new Error("Unable to find customer.");const n=e.data.customers[0].bundleStakeholders||[],i=br.getMap("bundlePartnerIds")||new Map;return n.forEach(a=>{a.bundle?.id&&a.bundle.partner?.id&&i.set(a.bundle.id,a.bundle.partner.id)}),br.setMap("bundlePartnerIds",i),n}async getWorkflowExperience(e,t){if(!e)throw new Error("getWorkflowExperience has been called without an options object! This is not supported.");const n=await this.getWorkflowExperiences([e],e.graphql),i=n[0],a=i.getWorkflow();return t&&!a&&console.error("No workflow instantiated when trying to create preview service."),t&&a&&await i.getWorkflowManager().injectIntoPreviewService(t(a)),n[0]}async getWorkflowExperiences(e,t,n,i){if(e.length===0)throw new lo("No options provided!");const a=e.map((q,Y)=>({option:q,index:Y})),s=a.filter(q=>q.option.type==="transaction"),o=a.filter(q=>q.option.type==="integration"||q.option.type==="external"||q.option.type==="blank"),l=50,u=hA(s,l),c=hA(o,l);let f=0;const d=ze.getShadowGraphqlClient(),h=async q=>{if(q.length===0)return[];const Y=q.map(oe=>oe.option.transactionId),J=await d.query({query:O3,variables:{ids:Y},errorPolicy:"all",fetchPolicy:"no-cache"}),ae=J.data.transactions;if(f=f+ae.length,i&&i(f,s.length),ae.length!==q.length){const oe=J.errors?.[0]?.message||"Unknown error";throw new lo(`Not all transactions were found: ${oe}`)}return!this.activeIntegration&&ae[0].integrationProduct?.integration&&(this.activeIntegration=Promise.resolve(ae[0].integrationProduct.integration)),ae.map((oe,he)=>({transaction:oe,workflowId:oe.workflowId,readOnly:q.find(ye=>ye.option.transactionId===oe.id)?.option.readOnly??!1,index:q[he].index}))},g=async q=>{if(q.length===0)return[];const Y=await d.mutate({mutation:R3,variables:{inputs:q.map(ae=>({integrationProductId:ae.option.type==="integration"?ae.option.integrationProductId:void 0,externalIntegrationId:ae.option.type==="external"?ae.option.externalIntegrationId:void 0,externalProductId:ae.option.type==="external"?ae.option.externalProductId:void 0,workflowId:ae.option.workflowId,designName:ae.option.designName,claim:!0,quantity:ae.option.quantity,recipient:ae.option.recipient,parentTransactionId:ae.option.parentTransactionId})),marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId},errorPolicy:"all",fetchPolicy:"no-cache",context:this.getCreateTransactionContext(q,t)}),J=Y.data?.transactionCreateMany;if(!J||J.length===0){const ae=Y.errors?.[0]?.message||"Unknown error";throw new lo(`Failed to create transactions: ${ae}`)}return f=f+J.length,i&&i(f,s.length),J.map((ae,oe)=>({transaction:ae,workflowId:ae.workflowId,readOnly:!1,index:q[oe].index}))},v=(await Promise.all([...u.map(h),...c.map(g)])).flat();let y=[...new Set(v.map(q=>q.transaction.integrationProductId))].filter(q=>!!q);y=y.filter(q=>!!q);let A=[...new Set(v.map(q=>q.workflowId))].filter(q=>!!q);A=A.filter(q=>!!q);const[C,S]=await Promise.all([(async()=>y.length>0?await zP(y):[])(),(async()=>A.length>0?await tb(A,t):[])()]),F=new Map(C.map(q=>[q.id,q])),E=new Map(S.map(q=>[q.id,q])),R=v.map(async q=>{const{transaction:Y,workflowId:J,readOnly:ae,index:oe}=q,he=J?E.get(J):void 0,ye=e[oe];if(Y.integrationProductId){const re=F.get(Y.integrationProductId);Y.integrationProduct=re,Y.product=re?.product,Y.integrationProduct||console.error("failed to find transaction's product")}const Ue=br.getMap("transactionOwnerIds")||new Map;!Ue.get(Y.id)&&Y.transactionOwnerId&&(Ue.set(Y.id,Y.transactionOwnerId),br.setMap("transactionOwnerIds",Ue));const Re=Ue.get(Y.id)||void 0,Oe=new EV({onMutate:()=>({context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}}),onQuery:()=>({context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}})}),ee={workflow:he,transaction:Y,singleVariantsRenderable:ye?.workflowConfiguration?.singleVariantsRenderable,stateMutationFunc:ae?async()=>{throw new nn("State mutation is forbidden in read only mode!")}:async re=>this.updateTransactionState({...re,context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}}),graphQlClient:()=>Oe,readOnly:ae,isReloadedTransaction:ye.type==="transaction"};if(ye.type==="transaction"&&Y.workflowState){const re=JSON.parse(Y.workflowState);await oA(re),ee.reloadedState=re}else if(!ae&&ye.workflowState){const re=JSON.parse(ye.workflowState);await oA(re),ee.reloadedState=re}return ee.delayWorkflowStateSync=!0,{experienceOptions:ee,index:oe,options:ye}}),G=(await Promise.all(R)).sort((q,Y)=>q.index-Y.index);let j=[],ie=[];for(const q of G){const{experienceOptions:Y,options:J}=q,ae=new M1(this,Y);await ae.getWorkflowManager().getInitializationPromise(),n&&n(),J.type!=="transaction"&&this.customer&&ie.push(ae),j=[...j,ae],ae.getWorkflowManager().setWorkflowStateSyncEnabled(!0)}if(ie.length>0){const q=this.customer.emailAddress,Y=ie.map(oe=>oe.getTransaction().id),ae=(await d.mutate({mutation:Y9,variables:{ids:Y,details:{emailAddress:q},type:"Owner"},errorPolicy:"all"})).data?.transactionsAddStakeholder;if(ae&&ae?.length>0){const oe=ae[0].stakeholders?.find(he=>he.customer?.emailAddress===q);if(oe?.customer)for(const he of ie)he.assignCustomerInternal(oe.customer)}}return j}getCreateTransactionContext(e,t){const n=e.find(s=>s.option.parentTransactionId)?.option.parentTransactionId;if(!n&&!t?.bundleOwnerId)return;const i=br.getMap("transactionOwnerIds")||new Map,a=n?i.get(n):void 0;return{...a?{transactionOwnerId:a}:{},...t?.bundleOwnerId?{bundleOwnerId:t.bundleOwnerId}:{}}}storeCustomer(e){const t=br.getMap("partnerCustomerIds")||new Map;t.set(e.partner.id,e.id),br.setMap("partnerCustomerIds",t)}async getIntegrationProductById(e,t){const a=(await ze.getShadowGraphqlClient().query({query:z3(t),variables:{ids:[e]},fetchPolicy:"no-cache",errorPolicy:"all"})).data?.integrationProducts;if(!a||a.length===0||!a[0]?.id)throw new Error("Integration product not found.");return new mA(a[0])}async getIntegrationProductFromExternalIds(e,t,n){const s=(await ze.getShadowGraphqlClient().query({query:$3(n),variables:{externalProductId:t,externalIntegrationId:e},fetchPolicy:"no-cache",errorPolicy:"all"})).data?.integrationProductFromExternalIds;if(!s?.id)throw new Error("Integration product not found.");return new mA(s)}async getIntegrationProduct(e){return e.type==="integration"?this.getIntegrationProductById(e.integrationProductId):this.getIntegrationProductFromExternalIds(e.externalIntegrationId,e.externalProductId)}async getShareActionsForTransaction(e){const n=(br.getMap("transactionOwnerIds")||new Map).get(e)||void 0,i=await ze.getShadowGraphqlClient().query({query:U3,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:e},context:{transactionOwnerId:n}});if(!i.data.transactions||i.data.transactions.length!==1)throw new Error(`Failed to fetch share actions for transaction: ${e}`);return i.data.transactions[0].transactionShareActions}async placeOrder(e){const t=await ze.getShadowGraphqlClient().mutate({mutation:eM,variables:{orderItems:e}});if(t.errors)throw new Error(t.errors[0].message);if(!t.data)throw new Error("Failed to create order: No order data in response.");return{id:t.data.orderCreate.id,internalId:t.data.orderCreate.internalId}}}const $P=async(r,e)=>(await ze.getShadowGraphqlClient().query({query:J3,errorPolicy:"all",fetchPolicy:"no-cache",context:{headers:{"x-application-key":r},skipIntegrationCheck:!0},variables:{themeConfigurationId:e}})).data.currentIntegration,HQ=async r=>{const t=await ze.getShadowGraphqlClient().query({query:L3,errorPolicy:"all",fetchPolicy:"network-only",variables:{id:r}});if(t.data.transactions.length!==0)return t.data.transactions[0]},GQ=async(r,e)=>(await ze.getShadowGraphqlClient().query({query:X3,errorPolicy:"all",variables:{themeConfigurationId:r,themeInstallId:e}})).data?.marketplaceThemeInstallConfiguration,jQ=async r=>(await ze.getShadowGraphqlClient().query({query:Z3,errorPolicy:"all",variables:{id:r}})).data?.bundles?.[0]?.marketplaceThemeInstallConfiguration,qQ=async r=>(await ze.getShadowGraphqlClient().query({query:K3,errorPolicy:"all",variables:{id:r}})).data?.transactions?.[0]?.marketplaceThemeInstallConfiguration,HP=async(r,e)=>(await ze.getShadowGraphqlClient().query({query:lM(!!e),errorPolicy:"all",variables:{id:r,productIds:e}})).data?.activation,WQ=async r=>(await HP(r))?.marketplaceThemeInstallConfiguration;async function GP(){const r={};try{const e=await this.loggedInBearerToken();r.Authorization=`Bearer ${e}`}catch{const n=Object.entries(localStorage).find(([a,s])=>a.startsWith("CognitoIdentityServiceProvider")&&a.endsWith("idToken"))?.[0]||"",i=localStorage.getItem(n);i&&!vg(i)&&(r.Authorization=`Bearer ${i}`)}return r}async function jP(r){const t=br.getMap("bundleOwnerIds")?.get(r),n=await GP();return{bundleOwnerId:t,...n}}async function QQ(r){const t=br.getMap("transactionOwnerIds")?.get(r),n=await GP();return{transactionOwnerId:t,...n}}const YQ=async r=>{const e=await jP(r),t=await ze.getShadowGraphqlClient().mutate({mutation:T9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:r},context:{headers:e}});if(t.data?.bundleDelete!==r)throw new Error(`Failed to delete bundle: ${t.errors}`)},XQ=async r=>{const e=await QQ(r),t=await ze.getShadowGraphqlClient().mutate({mutation:F9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{ids:[r]},context:{headers:e}});if(!t.data?.transactions||t.data.transactions.length!==1||t.data.transactions[0].id!==r)throw new Error(`Failed to find transaction to read bundle id: ${JSON.stringify(t.errors)}`);return t.data.transactions[0].bundle?.id};function qP(r,e,t,n){const i=t.width*r.zoom,a=t.height*r.zoom;if(n){const s=Math.max(e.width/t.width,e.height/t.height),o=Math.max(s,r.zoom),l=t.width*o,u=t.height*o;return{...r,x:Dp(r.x,e.width-l,0),y:Dp(r.y,e.height-u,0),zoom:o}}return{...r,x:Dp(r.x,-i,e.width),y:Dp(r.y,-a,e.height)}}function Dp(r,e,t){return Math.min(Math.max(r,e),t)}class WP{constructor(e,t){this.minZoomScale=[.03],this.maxZoomScale=[20],this._debouncedUpdateFrameOffsets=DI(this.updateFrameOffsets,200),this.targetElements=[],this.onFrameDataChangeListeners=[],this.onZoomChangeListeners=[],this.onRotationChangeListeners=[],this.forceImageCover=e,this.initialZoom=t,this.thresholdSettings={useThreshold:!1,invertThreshold:!1,threshold:128,thresholdSaturation:.5}}connectWorkflowManager(e,t){t&&e.addStepSpecificStorageCallback(async n=>{if(n){const i=n;if(i.currentFrameSources){let a=!1;for(let s=0;s<i.currentFrameSources.length;s++){const o=i.currentFrameSources[s],l=await Xf(o),u=this.frameData?this.frameData[s]:void 0;vf(l,u)||(this.frameData||(this.frameData=new Array(i.currentFrameSources.length)),this.frameData[s]=l,a=!0)}a&&(this.onFrameDataChangeListeners.forEach(s=>s(this.frameData)),this.frameData&&this.imageData&&(this.recalculateOffsets(this.imageData),this.updateOffsets(this.offsets),this.recalculateZoomLimits(this.imageData,this.frameData)))}}},t),this.workflowManager=e,this.stepName=t}setTargetElements(e){this.targetElements=e}getFrameData(){return this.frameData}setFrameData(e){if(!e){this.frameData=void 0;return}e.forEach((t,n)=>{const i=_u.get(t);i&&(this.frameData||(this.frameData=new Array(e.length)),this.frameData[n]=i)})}getImageData(){return this.imageData}getImageSrc(){if(this.imageData){if(this.imageData.svg){const e=zg(this.imageData.svg,this.imageData.colors||{},!1);return Ug(e)}return this.imageData.src}}getOffsets(){return this.offsets}setOffsets(e){this.offsets=e}setZoom(e,t,n,i){if(this.imageData&&this.offsets&&this.frameData){(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length));const a=this.frameData.map((s,o)=>{const l=(t[o]-this.offsets[o].x)/this.offsets[o].zoom,u=(n[o]-this.offsets[o].y)/this.offsets[o].zoom,c=t[o]-l*e[o],f=n[o]-u*e[o];return{x:c,y:f,zoom:this.imageData.width*e[o]/this.imageData.width,rotation:this.offsets[o].rotation}});this.updateOffsets(a,i),this.onZoomChangeListeners.forEach(s=>s(e))}}setRotation(e,t){if(this.imageData&&this.offsets&&this.frameData){(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length));const n=this.frameData.map((i,a)=>({...this.offsets[a],rotation:e[a]}));this.updateOffsets(n,t),this.onRotationChangeListeners.forEach(i=>i(e))}}setPatternData(e,t=!0){this.imageData=e,e&&this.frameData&&((t||!this.offsets)&&this.recalculateOffsets(e,t),this.updateOffsets(this.offsets,void 0,!0)),this.imageData&&this.frameData&&this.recalculateZoomLimits(this.imageData,this.frameData)}updateOffsets(e,t,n){const i=this.imageData;if(!i||!this.frameData)return;if(this.frameData.length!==e.length)throw new nn("Frame data and offsets are not the same length. This is a bug. Please report it.");if(!this.offsets.some((s,o)=>!(e[o].x===s.x&&e[o].y===s.y&&e[o].zoom===s.zoom&&e[o].rotation===s.rotation))&&!n){t&&t();return}(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length)),this.frameData.forEach((s,o)=>{this.offsets[o]=qP(e[o],s,this.imageData,this.forceImageCover)}),this._debouncedUpdateFrameOffsets(this.offsets,i,this.frameData,this.thresholdSettings,t)}getThresholdSettings(){return this.thresholdSettings}setThresholdSettings(e){this.thresholdSettings=e,this.imageData&&this.frameData&&this._debouncedUpdateFrameOffsets(this.offsets,this.imageData,this.frameData,e)}onFrameDataChanged(e){e(this.frameData),this.onFrameDataChangeListeners.push(e)}onZoom(e){this.onZoomChangeListeners.push(e)}onRotation(e){this.onRotationChangeListeners.push(e)}updateFrameOffsets(e,t,n,i,a){if(!n||n.length===0||n.some(l=>!l))throw new nn("Frame data not set. This is a bug");if(!this.workflowManager)throw new nn("No workflow manager set, cannot update offsets.");const s=this.workflowManager.getRegionElements(this.stepName||""),o=this.workflowManager.getCommandDispatcher();this.targetElements.forEach((l,u)=>{let c=s.find(f=>f.id===l)?.regionIndex??u;c>=e.length&&(c=u);try{o(new In([new SL(l,t,e[c]),new EL(l,i.useThreshold,i.invertThreshold,i.threshold,i.thresholdSaturation)]))}catch{}}),this.stepName&&this.workflowManager.updateStorage(this.stepName,{frameOffsetsList:e}),a&&a()}recalculateZoomLimits(e,t){(this.minZoomScale.length!==t.length||this.maxZoomScale.length!==t.length)&&(this.minZoomScale=new Array(t.length),this.maxZoomScale=new Array(t.length)),t.forEach((n,i)=>{const a=Math.max(n.width/e.width,n.height/e.height);this.forceImageCover?(this.minZoomScale[i]=a,this.maxZoomScale[i]=a*2.5):(this.minZoomScale[i]=a/10,this.maxZoomScale[i]=a*2.5)})}recalculateOffsets(e,t=!0){this.frameData&&((!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length)),this.frameData.forEach((n,i)=>{const a=t?0:this.offsets[i]?.rotation||0;this.offsets[i]={...x1(e,n,this.initialZoom&&!this.forceImageCover?{scale:this.initialZoom}:void 0,this.forceImageCover),rotation:a}}),this._debouncedUpdateFrameOffsets(this.offsets,e,this.frameData,this.thresholdSettings))}}class JQ{traversableScenes(){throw new Error("Method not implemented.")}updateRecipient(e,t,n,i,a,s,o,l,u,c,f,d,h,g,v,y,A){throw new Error("Method not implemented.")}approveTransaction(e){throw new Error("Method not implemented.")}rejectTransaction(e){throw new Error("Method not implemented.")}getClient(){return this.client??{}}getWorkflowExperience(){return{}}setClient(e){this.client=e}getInitializationPromise(){return Promise.resolve()}async updateWorkflowConfiguration(e){throw new Error("Method not implemented.")}isInitialized(){return!0}getInformationResults(){return[]}async reset(){}updateStateWithServer(e){}async outstandingRequestsPromise(){}async updateStateWithServerImmediate(e){}addPoller(e){}addConfirmCallback(e){}addEditedCallback(e){}addElementsCallback(e){}addInformationResultCallback(e){}addInitCallback(e){}addMakingAdjustmentsCallback(e){}addMandatoryCallback(e){}addMetadataCallback(e){}addSelectionCallback(e){}addStepSpecificStorageCallback(e,t){}addStorageCallback(e){}getCommandDispatcher(){return e=>{}}getLayouts(){return[]}getLayoutPreviewService(){return{getAll:()=>new Map}}getPreviewService(){}getModelContainer(){}getRegionElements(e){return[]}getSerializedStep(e,t){}getStepSpecificServices(e){}getTransaction(){return{id:""}}getTransactionCustomer(){}setTransactionCustomer(){}setTransactionCustomerDetails(){}getInitialOptionIds(){return new Promise(()=>new Set)}getWorkflow(){return{id:"",name:"",panels:[],steps:[],showModelOnFinishStep:!1,allowProofDownload:!1,introduction:"",stepGroups:[]}}markStepsAsInitialised(e){}markUpdateCompleted(e){}markUpdatePending(){return"123"}getWorkflowSelections(){return{}}getStepSelections(){return{}}setCurrentAdjustingStepId(e){}setEditedStatus(e,t){}setInformationResults(e){}setMandatoryFulfilled(e,t){}async setSelectionsAndElements(e,t,n){}toggleDesignConfirmed(){}updateMetadata(e,t){}async updateStorage(e,t){}injectIntoPreviewService(e){return Promise.resolve()}ejectFromPreviewService(){}setWorkflowStateSyncEnabled(e){}async updateTransactionShareActions(){}addValidationCallback(e){}setStepError(e,t,n){}getStepErrors(e){}getValidationErrors(){return{steps:new Map}}async updateTransactionStakeholders(){}getStepTags(e){return[]}}var QP=(r=>(r.SelectFrame="SelectFrame",r.SelectImage="SelectImage",r.Position="Position",r))(QP||{}),YP=(r=>(r.Original="original",r.BackgroundRemoved="backgroundRemoved",r.Optimized="optimized",r))(YP||{});class XP extends Ui{constructor(e,t,n){super(e,t,n);const i=t.data;this.frameService=new WP(i.forceImageCover,i.initialZoomLevel),this.frameService.connectWorkflowManager(e,t.stepName)}selectVariant(e){const t=this.manager.getRegionElements(this.step.stepName);return so.selectVariant(this.step,e.getResource(),t,this.manager,n=>this.setUpdateState(n))}onFrameDataChanged(e){this.frameService&&this.frameService.onFrameDataChanged(t=>{t&&e(t)})}async selectImage(e,t=!0,n=!0){await so.selectImage(this.step,e,this.manager,n),t&&this.manager.updateStorage(this.step.stepName,{framePatternData:{originalAssetKey:e.key,backgroundRemovedAssetKey:void 0,vectorizedAssetKey:void 0,enhancedAssetKey:void 0,useOriginalAsset:void 0}})}async canUseAdvancedImageManipulation(){return this.manager.getClient().canUseAddon(Bg.AdvancedImageManipulation)}async canRemoveBackground(){return await this.canUseAdvancedImageManipulation()&&this.hasOriginalImageSelection()&&!!this.frameService?.getImageData()?.src&&!this.frameService?.getImageData()?.svg}async removeBackgroundFromImageSelection(e=!0){if(!await this.canUseAdvancedImageManipulation())throw new Error("The current Integration does not have access to the Background Remover. Please call canUseAdvancedImageManipulation to ensure you disable this feature when appropriate.");const t=await this.getOriginalImageSelection();if(!t)throw new Error("You must supply an image selection before attempting to remove the background.");const n=await Ln.removeBackgroundFromAsset(t);e&&await so.selectImage(this.step,n,this.manager,!1);const i=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{...i,backgroundRemovedAssetKey:n.key,useOriginalAsset:!e}}),n}async vectorize(e,t=void 0){const n=e??await this.getOriginalImageSelection();if(!n)throw new Error("You must supply an image selection before attempting to vectorize the image.");const i=await Ln.vectorizeAsset(n,t);await this.selectImage(i,!1);const a=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{...a,vectorizedAssetKey:i.key,useOriginalAsset:!1}}),i}async enhanceWithAI(e,t){const n=e??await this.getOriginalImageSelection();if(!n)throw new Error("You must supply an image selection before attempting to enhance the image with AI.");const i=await Ln.enhanceWithAI(n,t);await this.selectImage(i,!1);const a=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{originalAssetKey:a.originalAssetKey,backgroundRemovedAssetKey:a.backgroundRemovedAssetKey,vectorizedAssetKey:a.vectorizedAssetKey,enhancedAssetKey:i.key,useOriginalAsset:!1}}),i}async getBackgroundRemovedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.backgroundRemovedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}async getVectorizedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.vectorizedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}async getEnhancedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.enhancedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}hasOriginalImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.originalAssetKey}hasBackgroundRemovedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.backgroundRemovedAssetKey}hasVectorizedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.vectorizedAssetKey}hasEnhancedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.enhancedAssetKey}async changeColors(e){await so.changeColors(this.step,this.manager,e)}getImageData(){if(this.frameService)return this.frameService.getImageData()}async getColorOption(){return await ct.ensureFullOption(this.step.data.colorOption)}getAvailableColors(){return this.step.data.colorPickerEnabled?so.availableColors(this.step,this.manager):Promise.resolve([])}isColorPickerEnabled(){return this.step.data.colorPickerEnabled??!1}async getOriginalImageColors(){const e=this.getImageData();return e?.svg?(await Pa(e.svg)).colors:void 0}async mergeColors(e,t,n){const i=this.frameService.getImageData();if(!i?.svg||!i.colors)throw new Error("Cannot merge colors on non-SVG image or image without color information");const{svg:a,colors:s}=pT(i.svg,i.colors,e,t,n);this.frameService.setPatternData({...i,svg:a,colors:s},!1),this.manager.updateStorage(this.step.stepName,{colors:s})}async unmergeColors(e,t,n,i){const a=this.frameService.getImageData();if(!a?.svg||!a.colors)throw new Error("Cannot unmerge colors on non-SVG image or image without color information");this.frameService.setPatternData({...a,svg:i,colors:n},!1),this.manager.updateStorage(this.step.stepName,{colors:n})}getShouldVectorize(){return this.step.data.shouldVectorize??!1}getVectorizeMaxColors(){return this.step.data.vectorizeMaxColors}getMinimumPixelThresholdForOptimization(){return this.step.data.vectorizationMinimumPixelThreshold}getMaxAllowedColors(){return this.step.data.maxColors}getUniqueColorCount(){return so.getUniqueColorCount(this.step,this.manager)}getCurrentFrameStep(e,t,n,i){return i&&i.length>1&&e===void 0?"SelectFrame":t||n||this.getImageData()?"Position":"SelectImage"}getFrameService(){return this.frameService}hasOverlayImageKey(){return this.step.data.overlayImageKey}hasOverlayImageUrl(){return this.step.data.overlayImageUrl}getWhitelistedExtensions(){return[...this.step.data.whitelistedExtensions,...this.step.data.whitelistedExtensions.includes(".jpg")?[".jpeg"]:[]]}async getOriginalImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.originalAssetKey;if(e)return Ln.getLocalOrFromServer(e)}getCurrentImageState(){const e=this.getFrameStepStorage()?.framePatternData;return e?e.vectorizedAssetKey&&!e.useOriginalAsset?"optimized":e.useOriginalAsset!==!1?"original":"backgroundRemoved":"original"}async setImageState(e){const t=this.getFrameStepStorage()?.framePatternData||{};let n,i;switch(e){case"original":if(n=await this.getOriginalImageSelection(),!n)throw new Error("No original image available");i=!0;break;case"backgroundRemoved":if(n=await this.getBackgroundRemovedImageSelection(),!n)throw new Error("No background-removed image available. Call removeBackgroundFromImageSelection first.");i=!1;break;case"optimized":if(n=await this.getVectorizedImageSelection(),!n)throw new Error("No optimized image available. Call vectorize first.");i=!1;break}await this.selectImage(n,!1,!0),this.manager.updateStorage(this.step.stepName,{framePatternData:{...t,useOriginalAsset:i}})}getUseOriginalImageSelection(){return this.getFrameStepStorage()?.framePatternData?.useOriginalAsset??!1}async setUseOriginalImageSelection(e){const t=this.getFrameStepStorage()?.framePatternData||{};if(t.useOriginalAsset===e)return;const n=await this.getOriginalImageSelection();if(!n)throw new Error("You must provide an image selection before calling setUseOriginalImageSelection");if(e)await this.selectImage(n,!1,!1);else{const i=await this.getBackgroundRemovedImageSelection();if(!i)throw new Error("You must call removeBackgroundFromImageSelection before attempting to apply the image.");await this.selectImage(i,!1,!1)}this.manager.updateStorage(this.step.stepName,{framePatternData:{...t,useOriginalAsset:e}})}getFrameStepStorage(){return this.manager.getStepStorage(this.step.stepName)}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}const KQ=Se`
3056
+ ${V2(t)}`);const i=await ze.getShadowGraphqlClient().query({query:t,errorPolicy:"all",variables:n,context:{logRequestHeaders:!0}});if(i.error)throw console.log("[getWorkflowsInternal] Response errored."),i.error;if(i.errors)throw i.errors.forEach(s=>console.error(s)),new Error("Unable to read workflows. Consult GraphQL errors.");if(!i.data.workflows||i.data.workflows.length!==r.length)throw new Error(`Unable to read workflows: ${i.errors??"Length mismatch in response"}`);const a=mo(i.data.workflows);return a.forEach(s=>{s.finalizeStepConfig||(s.finalizeStepConfig={}),s.finalizeStepConfig.termsMarkdown=s.finalizeStepConfig.termsMarkdown||s.partner.termsMarkdown}),a},zQ=async(r,e)=>{const n=(await e).find(i=>i.id===r);if(!n)throw new Error(`Workflow not found: ${r}`);return n},tb=async(r,e)=>{const t=r.map(o=>mf.get({id:o,options:e})),n=r.filter((o,l)=>t[l]===void 0);if(n.length===0)return Promise.all(t);const i=VQ(n,e),a=n.map(o=>mf.set({id:o,options:e},zQ(o,i))),s=t.filter(o=>o!==void 0);return await Promise.all(s.concat(a))},VP=async(r,e)=>(await tb([r],e))[0],zP=async r=>{const e=await ze.getShadowGraphqlClient().query({query:wT,variables:{ids:r},errorPolicy:"all",fetchPolicy:"no-cache"});return e.errors&&console.error(e.errors),e.data.integrationProducts||[]};class $Q{constructor(e){this.activeIntegration=void 0,this.updateTransactionState=async t=>{try{return ze.getShadowGraphqlClient().mutate({...t,mutation:B3})}catch(n){throw console.error(n),new lo("Critical - Unable to synchronize workflow state with server.")}},this.options=e,this.options.applicationKey&&Jk(this.options.applicationKey),console.debug("------------------------"),console.debug("Spiff Commerce Core SDK"),console.debug("Version: 44.5.6-alpha.2"),console.debug(`Application Key Provided: ${!!this.options.applicationKey}`),console.debug("------------------------")}configure(e){ss.setHubUrl(e.hubUrl),ss.setServerUrl(e.serverUrl),ss.setServicesApiUrl(e.servicesApiUrl),this.marketplaceThemeInstallId=e.marketplaceThemeInstallId,this.marketplaceThemeInstallConfigurationId=e.marketplaceThemeInstallConfigurationId,this.userPoolClientId=e.userPoolClientId,this.userPoolRegion=e.userPoolRegion,this.spiffRegion=e.spiffRegion,e.bearerAuthenticationToken&&Zk(e.bearerAuthenticationToken),this.options.applicationKey&&this.getIntegration(),this.spiffRegion&&this.userPoolRegion&&this.userPoolClientId&&Id.init(this.spiffRegion,this.userPoolRegion,this.userPoolClientId)}getVersion(){return"44.5.6-alpha.2"}getAssetManager(){return Ln}async getBetaEnabled(){return this.options.enableBetaFeatures?!0:(await this.getIntegration()).partner.beta===!0}getFlowService(){if(!eB())throw new Error("Application key required to use Flow Service.");return new NI}async getCurrencyContext(e){const n=(await this.getIntegration()).partner.currencyCode,a=await ze.getShadowGraphqlClient().query({query:tM,errorPolicy:"all",fetchPolicy:"cache-first",variables:{from:n,to:e}}),{rateFrom:s,rateTo:o}=a.data.currencyConversion;return new UP(s,o,n,e)}async getIntegration(){if(this.activeIntegration)return this.activeIntegration;if(!this.options.applicationKey)throw new Error("Cannot get current Integration without specifying an Application Key.");return this.activeIntegration=$P(this.options.applicationKey),this.activeIntegration}async canUseAddon(e){try{return(await this.getIntegration()).partner.activeAddons?.includes(e)??!1}catch(t){return console.error(t),!1}}clearCustomer(){this.customer=void 0}clearCustomerForTransaction(e){const t=br.getMap("transactionCustomerIds");t?.has(e)&&(t.delete(e),br.setMap("transactionCustomerIds",t))}async customerHasBundleTemplates(e){const i=(await ze.getShadowGraphqlClient().query({query:Bv,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e}})).data.customer;return i.id?i.hasBundleTemplates??!1:!1}getStakeholderTypeForTransaction(e){const t=this.customer?.stakeholders?.find(n=>n.transaction?.id===e);if(t)return t.type}async getOrCreateCustomer(e){this.customer=void 0;const t=ze.getShadowGraphqlClient(),i=(await t.query({query:Bv,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e}})).data.customer;if(!i.id){const o=(await t.mutate({mutation:bV,errorPolicy:"all",fetchPolicy:"no-cache",variables:{details:{emailAddress:e}}})).data?.customerCreate;if(!o)throw new Error("Unable to create customer.");return this.storeCustomer(o),this.customer=o,{customer:o,isAuthenticated:!1}}this.storeCustomer(i);const a=await this.reloadLoggedInCustomer();return{customer:this.customer||i,isAuthenticated:a}}getCustomer(){return this.customer}async reloadLoggedInCustomer(){const e=localStorage.getItem("last-refreshed-cognito-tokens"),t=localStorage.getItem("cognito-tokens"),n=localStorage.getItem("cognito-email");if(!e||!t||!n)return!1;const i=JSON.parse(t),a=new Date().getTime()/1e3;if(!i.ExpiresIn||i.ExpiresIn<a-parseInt(e)){const u=await Id.refreshTokens();if(u?.AuthenticationResult)localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),i.AccessToken=u.AuthenticationResult.AccessToken,localStorage.setItem("cognito-tokens",JSON.stringify(i));else return this.logOut(),console.error("Failed to refresh tokens."),!1}const s=localStorage.getItem("customer-login-token");s&&p0(s);const l=(await ze.getShadowGraphqlClient().query({query:Bv,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:n}})).data.customer;return l.id?(this.customer=l,!0):(console.error("Failed to get customer."),!1)}async generateVerificationCode(e){await ze.getShadowGraphqlClient().mutate({mutation:CV,variables:{emailAddress:e}}),await Id.generateCode(e)}async verifyCode(e,t){const n=(await this.getIntegration()).partner.id||"",i=await Id.verifyCode(e,t,n);if(i?.AuthenticationResult){localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),localStorage.setItem("cognito-tokens",JSON.stringify(i.AuthenticationResult)),localStorage.setItem("cognito-email",e);const s=(await ze.getShadowGraphqlClient().mutate({mutation:xV,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e,verificationCode:t}})).data?.customerVerifyCode;if(!s?.id)throw new Error("Failed to get customer.");return this.customer=s,s.loginToken&&(localStorage.setItem("customer-login-token",s.loginToken),p0(s.loginToken)),!0}else throw new Error}async logOut(){localStorage.removeItem("last-refreshed-cognito-tokens"),localStorage.removeItem("cognito-tokens"),localStorage.removeItem("cognito-email"),localStorage.removeItem("customer-login-token"),p0(""),this.clearCustomer()}async loggedInBearerToken(){const e=localStorage.getItem("last-refreshed-cognito-tokens"),t=localStorage.getItem("cognito-tokens");if(!e||!t)throw new Error("No token data in storage.");const n=JSON.parse(t),i=new Date().getTime()/1e3,a=!n?.AccessToken||vg(n.AccessToken);if(!n.ExpiresIn||n.ExpiresIn<i-parseInt(e)||a){const s=await Id.refreshTokens();if(s?.AuthenticationResult)localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),n.AccessToken=s.AuthenticationResult.AccessToken,localStorage.setItem("cognito-tokens",JSON.stringify(n));else throw this.logOut(),new Error("Failed to refresh tokens.")}if(!n.AccessToken)throw new Error("No bearer token in storage.");return n.AccessToken}async getCustomerMetafields(){if(!this.customer?.id)throw new Error("Customer must be logged in before calling this function.");return(await ze.getShadowGraphqlClient().query({query:SV,variables:{id:this.customer.id}})).data.metafields}async getNewBundle(e,t,n,i){const s=(await ze.getShadowGraphqlClient().mutate({mutation:s9(n?.graphql?.productCollection?.eagerFetchProducts||!1),variables:{collectionId:e,initialMetadata:t?Object.entries(t).map((c,f)=>({key:c[0],value:c[1]})):void 0,marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId,activationId:i,test:n?.test},fetchPolicy:"no-cache"})).data?.bundleCreate;if(!s?.id)throw new Error("Unable to create bundle");const o=br.getMap("bundlePartnerIds")||new Map;o.set(s.id,s.partner.id),br.setMap("bundlePartnerIds",o);const l=br.getMap("bundleOwnerIds")||new Map;l.set(s.id,s.bundleOwnerId),br.setMap("bundleOwnerIds",l);const u=new OE(this,s,void 0,void 0,s.bundleOwnerId,{eagerFetchProducts:n?.graphql?.productCollection?.eagerFetchProducts});return await u.getInitializationPromise(),u}async getExistingBundle(e,t,n,i,a){const o=br.getMap("bundleOwnerIds")?.get(e),l={};try{const g=await this.loggedInBearerToken();l.Authorization=`Bearer ${g}`}catch{const y=Object.entries(localStorage).find(([C,S])=>C.startsWith("CognitoIdentityServiceProvider")&&C.endsWith("idToken"))?.[0]||"",A=localStorage.getItem(y);A&&!vg(A)&&(l.Authorization=`Bearer ${A}`)}const u={bundleOwnerId:o,...l,...i?.graphql?.additionalHeaders},c=await ze.getShadowGraphqlClient().query({query:r9(i?.graphql?.productCollection?.eagerFetchProducts||!1),variables:{id:e},fetchPolicy:"no-cache",context:{headers:u}});if(!c.data?.bundles||c.data?.bundles.length===0||!c.data?.bundles[0])throw new Error(`Unable to find bundle: ${e}`);const f=c.data?.bundles[0],d=br.getMap("bundlePartnerIds")||new Map;d.set(f.id,f.partner.id),br.setMap("bundlePartnerIds",d);const h=new OE(this,f,t,n,o,{additionalHeaders:i?.graphql?.additionalHeaders,eagerFetchProducts:i?.graphql?.productCollection?.eagerFetchProducts,existingGlobalPropertyState:c.data.globalPropertyState,readonly:i?.readonly},a);return await h.getInitializationPromise(),h}async duplicateBundle(e,t,n,i){const s={...await jP(e),...i?.graphql?.additionalHeaders},l=(await ze.getShadowGraphqlClient().mutate({mutation:o9(),variables:{id:e,template:t,marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId,duplicateTransactions:n,test:i?.test},context:{headers:s},fetchPolicy:"no-cache"})).data?.bundleDuplicate;if(!l?.id)throw new Error("Unable to duplicate bundle");const u=br.getMap("bundlePartnerIds")||new Map;u.set(l.id,l.partner.id),br.setMap("bundlePartnerIds",u);const c=br.getMap("bundleOwnerIds")||new Map;return c.set(l.id,l.bundleOwnerId),br.setMap("bundleOwnerIds",c),async()=>await this.getExistingBundle(l.id,void 0,void 0,{graphql:{productCollection:{eagerFetchProducts:i?.graphql?.productCollection?.eagerFetchProducts||!1}}})}async getBundlesForCustomer(e){if(!this.customer?.id)throw new Error("Customer not authenticated.");const{includeMetadata:t,...n}=e;return(await ze.getShadowGraphqlClient().query({query:y9(t??!1),variables:{...n,id:this.customer.id},fetchPolicy:"no-cache"})).data.customerBundlesFeed}async getBundleStakeholders(){if(!this.customer)throw new Error("Customer not authenticated.");const e=await ze.getShadowGraphqlClient().query({query:n9,variables:{id:this.customer.id},fetchPolicy:"no-cache"});if(!e.data?.customers||e.data.customers.length===0)throw new Error("Unable to find customer.");const n=e.data.customers[0].bundleStakeholders||[],i=br.getMap("bundlePartnerIds")||new Map;return n.forEach(a=>{a.bundle?.id&&a.bundle.partner?.id&&i.set(a.bundle.id,a.bundle.partner.id)}),br.setMap("bundlePartnerIds",i),n}async getWorkflowExperience(e,t){if(!e)throw new Error("getWorkflowExperience has been called without an options object! This is not supported.");const n=await this.getWorkflowExperiences([e],e.graphql),i=n[0],a=i.getWorkflow();return t&&!a&&console.error("No workflow instantiated when trying to create preview service."),t&&a&&await i.getWorkflowManager().injectIntoPreviewService(t(a)),n[0]}async getWorkflowExperiences(e,t,n,i){if(e.length===0)throw new lo("No options provided!");const a=e.map((q,Y)=>({option:q,index:Y})),s=a.filter(q=>q.option.type==="transaction"),o=a.filter(q=>q.option.type==="integration"||q.option.type==="external"||q.option.type==="blank"),l=50,u=hA(s,l),c=hA(o,l);let f=0;const d=ze.getShadowGraphqlClient(),h=async q=>{if(q.length===0)return[];const Y=q.map(oe=>oe.option.transactionId),J=await d.query({query:O3,variables:{ids:Y},errorPolicy:"all",fetchPolicy:"no-cache"}),ae=J.data.transactions;if(f=f+ae.length,i&&i(f,s.length),ae.length!==q.length){const oe=J.errors?.[0]?.message||"Unknown error";throw new lo(`Not all transactions were found: ${oe}`)}return!this.activeIntegration&&ae[0].integrationProduct?.integration&&(this.activeIntegration=Promise.resolve(ae[0].integrationProduct.integration)),ae.map((oe,he)=>({transaction:oe,workflowId:oe.workflowId,readOnly:q.find(ye=>ye.option.transactionId===oe.id)?.option.readOnly??!1,index:q[he].index}))},g=async q=>{if(q.length===0)return[];const Y=await d.mutate({mutation:R3,variables:{inputs:q.map(ae=>({integrationProductId:ae.option.type==="integration"?ae.option.integrationProductId:void 0,externalIntegrationId:ae.option.type==="external"?ae.option.externalIntegrationId:void 0,externalProductId:ae.option.type==="external"?ae.option.externalProductId:void 0,workflowId:ae.option.workflowId,designName:ae.option.designName,claim:!0,quantity:ae.option.quantity,recipient:ae.option.recipient,parentTransactionId:ae.option.parentTransactionId})),marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId},errorPolicy:"all",fetchPolicy:"no-cache",context:this.getCreateTransactionContext(q,t)}),J=Y.data?.transactionCreateMany;if(!J||J.length===0){const ae=Y.errors?.[0]?.message||"Unknown error";throw new lo(`Failed to create transactions: ${ae}`)}return f=f+J.length,i&&i(f,s.length),J.map((ae,oe)=>({transaction:ae,workflowId:ae.workflowId,readOnly:!1,index:q[oe].index}))},v=(await Promise.all([...u.map(h),...c.map(g)])).flat();let y=[...new Set(v.map(q=>q.transaction.integrationProductId))].filter(q=>!!q);y=y.filter(q=>!!q);let A=[...new Set(v.map(q=>q.workflowId))].filter(q=>!!q);A=A.filter(q=>!!q);const[C,S]=await Promise.all([(async()=>y.length>0?await zP(y):[])(),(async()=>A.length>0?await tb(A,t):[])()]),F=new Map(C.map(q=>[q.id,q])),E=new Map(S.map(q=>[q.id,q])),R=v.map(async q=>{const{transaction:Y,workflowId:J,readOnly:ae,index:oe}=q,he=J?E.get(J):void 0,ye=e[oe];if(Y.integrationProductId){const re=F.get(Y.integrationProductId);Y.integrationProduct=re,Y.product=re?.product,Y.integrationProduct||console.error("failed to find transaction's product")}const Ue=br.getMap("transactionOwnerIds")||new Map;!Ue.get(Y.id)&&Y.transactionOwnerId&&(Ue.set(Y.id,Y.transactionOwnerId),br.setMap("transactionOwnerIds",Ue));const Re=Ue.get(Y.id)||void 0,Oe=new EV({onMutate:()=>({context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}}),onQuery:()=>({context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}})}),ee={workflow:he,transaction:Y,singleVariantsRenderable:ye?.workflowConfiguration?.singleVariantsRenderable,stateMutationFunc:ae?async()=>{throw new nn("State mutation is forbidden in read only mode!")}:async re=>this.updateTransactionState({...re,context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}}),graphQlClient:()=>Oe,readOnly:ae,isReloadedTransaction:ye.type==="transaction"};if(ye.type==="transaction"&&Y.workflowState){const re=JSON.parse(Y.workflowState);await oA(re),ee.reloadedState=re}else if(!ae&&ye.workflowState){const re=JSON.parse(ye.workflowState);await oA(re),ee.reloadedState=re}return ee.delayWorkflowStateSync=!0,{experienceOptions:ee,index:oe,options:ye}}),G=(await Promise.all(R)).sort((q,Y)=>q.index-Y.index);let j=[],ie=[];for(const q of G){const{experienceOptions:Y,options:J}=q,ae=new M1(this,Y);await ae.getWorkflowManager().getInitializationPromise(),n&&n(),J.type!=="transaction"&&this.customer&&ie.push(ae),j=[...j,ae],ae.getWorkflowManager().setWorkflowStateSyncEnabled(!0)}if(ie.length>0){const q=this.customer.emailAddress,Y=ie.map(oe=>oe.getTransaction().id),ae=(await d.mutate({mutation:Y9,variables:{ids:Y,details:{emailAddress:q},type:"Owner"},errorPolicy:"all"})).data?.transactionsAddStakeholder;if(ae&&ae?.length>0){const oe=ae[0].stakeholders?.find(he=>he.customer?.emailAddress===q);if(oe?.customer)for(const he of ie)he.assignCustomerInternal(oe.customer)}}return j}getCreateTransactionContext(e,t){const n=e.find(s=>s.option.parentTransactionId)?.option.parentTransactionId;if(!n&&!t?.bundleOwnerId)return;const i=br.getMap("transactionOwnerIds")||new Map,a=n?i.get(n):void 0;return{...a?{transactionOwnerId:a}:{},...t?.bundleOwnerId?{bundleOwnerId:t.bundleOwnerId}:{}}}storeCustomer(e){const t=br.getMap("partnerCustomerIds")||new Map;t.set(e.partner.id,e.id),br.setMap("partnerCustomerIds",t)}async getIntegrationProductById(e,t){const a=(await ze.getShadowGraphqlClient().query({query:z3(t),variables:{ids:[e]},fetchPolicy:"no-cache",errorPolicy:"all"})).data?.integrationProducts;if(!a||a.length===0||!a[0]?.id)throw new Error("Integration product not found.");return new mA(a[0])}async getIntegrationProductFromExternalIds(e,t,n){const s=(await ze.getShadowGraphqlClient().query({query:$3(n),variables:{externalProductId:t,externalIntegrationId:e},fetchPolicy:"no-cache",errorPolicy:"all"})).data?.integrationProductFromExternalIds;if(!s?.id)throw new Error("Integration product not found.");return new mA(s)}async getIntegrationProduct(e){return e.type==="integration"?this.getIntegrationProductById(e.integrationProductId):this.getIntegrationProductFromExternalIds(e.externalIntegrationId,e.externalProductId)}async getShareActionsForTransaction(e){const n=(br.getMap("transactionOwnerIds")||new Map).get(e)||void 0,i=await ze.getShadowGraphqlClient().query({query:U3,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:e},context:{transactionOwnerId:n}});if(!i.data.transactions||i.data.transactions.length!==1)throw new Error(`Failed to fetch share actions for transaction: ${e}`);return i.data.transactions[0].transactionShareActions}async placeOrder(e){const t=await ze.getShadowGraphqlClient().mutate({mutation:eM,variables:{orderItems:e}});if(t.errors)throw new Error(t.errors[0].message);if(!t.data)throw new Error("Failed to create order: No order data in response.");return{id:t.data.orderCreate.id,internalId:t.data.orderCreate.internalId}}}const $P=async(r,e)=>(await ze.getShadowGraphqlClient().query({query:J3,errorPolicy:"all",fetchPolicy:"no-cache",context:{headers:{"x-application-key":r},skipIntegrationCheck:!0},variables:{themeConfigurationId:e}})).data.currentIntegration,HQ=async r=>{const t=await ze.getShadowGraphqlClient().query({query:L3,errorPolicy:"all",fetchPolicy:"network-only",variables:{id:r}});if(t.data.transactions.length!==0)return t.data.transactions[0]},GQ=async(r,e)=>(await ze.getShadowGraphqlClient().query({query:X3,errorPolicy:"all",variables:{themeConfigurationId:r,themeInstallId:e}})).data?.marketplaceThemeInstallConfiguration,jQ=async r=>(await ze.getShadowGraphqlClient().query({query:Z3,errorPolicy:"all",variables:{id:r}})).data?.bundles?.[0]?.marketplaceThemeInstallConfiguration,qQ=async r=>(await ze.getShadowGraphqlClient().query({query:K3,errorPolicy:"all",variables:{id:r}})).data?.transactions?.[0]?.marketplaceThemeInstallConfiguration,HP=async(r,e)=>(await ze.getShadowGraphqlClient().query({query:lM(!!e),errorPolicy:"all",variables:{id:r,productIds:e}})).data?.activation,WQ=async r=>(await HP(r))?.marketplaceThemeInstallConfiguration;async function GP(){const r={};try{const e=await this.loggedInBearerToken();r.Authorization=`Bearer ${e}`}catch{const n=Object.entries(localStorage).find(([a,s])=>a.startsWith("CognitoIdentityServiceProvider")&&a.endsWith("idToken"))?.[0]||"",i=localStorage.getItem(n);i&&!vg(i)&&(r.Authorization=`Bearer ${i}`)}return r}async function jP(r){const t=br.getMap("bundleOwnerIds")?.get(r),n=await GP();return{bundleOwnerId:t,...n}}async function QQ(r){const t=br.getMap("transactionOwnerIds")?.get(r),n=await GP();return{transactionOwnerId:t,...n}}const YQ=async r=>{const e=await jP(r),t=await ze.getShadowGraphqlClient().mutate({mutation:T9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:r},context:{headers:e}});if(t.data?.bundleDelete!==r)throw new Error(`Failed to delete bundle: ${t.errors}`)},XQ=async r=>{const e=await QQ(r),t=await ze.getShadowGraphqlClient().mutate({mutation:F9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{ids:[r]},context:{headers:e}});if(!t.data?.transactions||t.data.transactions.length!==1||t.data.transactions[0].id!==r)throw new Error(`Failed to find transaction to read bundle id: ${JSON.stringify(t.errors)}`);return t.data.transactions[0].bundle?.id};function qP(r,e,t,n){const i=t.width*r.zoom,a=t.height*r.zoom;if(n){const s=Math.max(e.width/t.width,e.height/t.height),o=Math.max(s,r.zoom),l=t.width*o,u=t.height*o;return{...r,x:Dp(r.x,e.width-l,0),y:Dp(r.y,e.height-u,0),zoom:o}}return{...r,x:Dp(r.x,-i,e.width),y:Dp(r.y,-a,e.height)}}function Dp(r,e,t){return Math.min(Math.max(r,e),t)}class WP{constructor(e,t){this.minZoomScale=[.03],this.maxZoomScale=[20],this._debouncedUpdateFrameOffsets=DI(this.updateFrameOffsets,200),this.targetElements=[],this.onFrameDataChangeListeners=[],this.onZoomChangeListeners=[],this.onRotationChangeListeners=[],this.forceImageCover=e,this.initialZoom=t,this.thresholdSettings={useThreshold:!1,invertThreshold:!1,threshold:128,thresholdSaturation:.5}}connectWorkflowManager(e,t){t&&e.addStepSpecificStorageCallback(async n=>{if(n){const i=n;if(i.currentFrameSources){let a=!1;for(let s=0;s<i.currentFrameSources.length;s++){const o=i.currentFrameSources[s],l=await Xf(o),u=this.frameData?this.frameData[s]:void 0;vf(l,u)||(this.frameData||(this.frameData=new Array(i.currentFrameSources.length)),this.frameData[s]=l,a=!0)}a&&(this.onFrameDataChangeListeners.forEach(s=>s(this.frameData)),this.frameData&&this.imageData&&(this.recalculateOffsets(this.imageData),this.updateOffsets(this.offsets),this.recalculateZoomLimits(this.imageData,this.frameData)))}}},t),this.workflowManager=e,this.stepName=t}setTargetElements(e){this.targetElements=e}getFrameData(){return this.frameData}setFrameData(e){if(!e){this.frameData=void 0;return}e.forEach((t,n)=>{const i=_u.get(t);i&&(this.frameData||(this.frameData=new Array(e.length)),this.frameData[n]=i)})}getImageData(){return this.imageData}getImageSrc(){if(this.imageData){if(this.imageData.svg){const e=zg(this.imageData.svg,this.imageData.colors||{},!1);return Ug(e)}return this.imageData.src}}getOffsets(){return this.offsets}setOffsets(e){this.offsets=e}setZoom(e,t,n,i){if(this.imageData&&this.offsets&&this.frameData){(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length));const a=this.frameData.map((s,o)=>{const l=(t[o]-this.offsets[o].x)/this.offsets[o].zoom,u=(n[o]-this.offsets[o].y)/this.offsets[o].zoom,c=t[o]-l*e[o],f=n[o]-u*e[o];return{x:c,y:f,zoom:this.imageData.width*e[o]/this.imageData.width,rotation:this.offsets[o].rotation}});this.updateOffsets(a,i),this.onZoomChangeListeners.forEach(s=>s(e))}}setRotation(e,t){if(this.imageData&&this.offsets&&this.frameData){(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length));const n=this.frameData.map((i,a)=>({...this.offsets[a],rotation:e[a]}));this.updateOffsets(n,t),this.onRotationChangeListeners.forEach(i=>i(e))}}setPatternData(e,t=!0){this.imageData=e,e&&this.frameData&&((t||!this.offsets)&&this.recalculateOffsets(e,t),this.updateOffsets(this.offsets,void 0,!0)),this.imageData&&this.frameData&&this.recalculateZoomLimits(this.imageData,this.frameData)}updateOffsets(e,t,n){const i=this.imageData;if(!i||!this.frameData)return;if(this.frameData.length!==e.length)throw new nn("Frame data and offsets are not the same length. This is a bug. Please report it.");if(!this.offsets.some((s,o)=>!(e[o].x===s.x&&e[o].y===s.y&&e[o].zoom===s.zoom&&e[o].rotation===s.rotation))&&!n){t&&t();return}(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length)),this.frameData.forEach((s,o)=>{this.offsets[o]=qP(e[o],s,this.imageData,this.forceImageCover)}),this._debouncedUpdateFrameOffsets(this.offsets,i,this.frameData,this.thresholdSettings,t)}getThresholdSettings(){return this.thresholdSettings}setThresholdSettings(e){this.thresholdSettings=e,this.imageData&&this.frameData&&this._debouncedUpdateFrameOffsets(this.offsets,this.imageData,this.frameData,e)}onFrameDataChanged(e){e(this.frameData),this.onFrameDataChangeListeners.push(e)}onZoom(e){this.onZoomChangeListeners.push(e)}onRotation(e){this.onRotationChangeListeners.push(e)}updateFrameOffsets(e,t,n,i,a){if(!n||n.length===0||n.some(l=>!l))throw new nn("Frame data not set. This is a bug");if(!this.workflowManager)throw new nn("No workflow manager set, cannot update offsets.");const s=this.workflowManager.getRegionElements(this.stepName||""),o=this.workflowManager.getCommandDispatcher();this.targetElements.forEach((l,u)=>{let c=s.find(f=>f.id===l)?.regionIndex??u;c>=e.length&&(c=u);try{o(new In([new SL(l,t,e[c]),new EL(l,i.useThreshold,i.invertThreshold,i.threshold,i.thresholdSaturation)]))}catch{}}),this.stepName&&this.workflowManager.updateStorage(this.stepName,{frameOffsetsList:e}),a&&a()}recalculateZoomLimits(e,t){(this.minZoomScale.length!==t.length||this.maxZoomScale.length!==t.length)&&(this.minZoomScale=new Array(t.length),this.maxZoomScale=new Array(t.length)),t.forEach((n,i)=>{const a=Math.max(n.width/e.width,n.height/e.height);this.forceImageCover?(this.minZoomScale[i]=a,this.maxZoomScale[i]=a*2.5):(this.minZoomScale[i]=a/10,this.maxZoomScale[i]=a*2.5)})}recalculateOffsets(e,t=!0){this.frameData&&((!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length)),this.frameData.forEach((n,i)=>{const a=t?0:this.offsets[i]?.rotation||0;this.offsets[i]={...x1(e,n,this.initialZoom&&!this.forceImageCover?{scale:this.initialZoom}:void 0,this.forceImageCover),rotation:a}}),this._debouncedUpdateFrameOffsets(this.offsets,e,this.frameData,this.thresholdSettings))}}class JQ{traversableScenes(){throw new Error("Method not implemented.")}updateRecipient(e,t,n,i,a,s,o,l,u,c,f,d,h,g,v,y,A){throw new Error("Method not implemented.")}approveTransaction(e){throw new Error("Method not implemented.")}rejectTransaction(e){throw new Error("Method not implemented.")}getClient(){return this.client??{}}getWorkflowExperience(){return{}}setClient(e){this.client=e}getInitializationPromise(){return Promise.resolve()}async updateWorkflowConfiguration(e){throw new Error("Method not implemented.")}isInitialized(){return!0}getInformationResults(){return[]}async reset(){}updateStateWithServer(e){}async outstandingRequestsPromise(){}async updateStateWithServerImmediate(e){}addPoller(e){}addConfirmCallback(e){}addEditedCallback(e){}addElementsCallback(e){}addInformationResultCallback(e){}addInitCallback(e){}addMakingAdjustmentsCallback(e){}addMandatoryCallback(e){}addMetadataCallback(e){}addSelectionCallback(e){}addStepSpecificStorageCallback(e,t){}addStorageCallback(e){}getCommandDispatcher(){return e=>{}}getLayouts(){return[]}getLayoutPreviewService(){return{getAll:()=>new Map}}getPreviewService(){}getModelContainer(){}getRegionElements(e){return[]}getSerializedStep(e,t){}getStepSpecificServices(e){}getTransaction(){return{id:""}}getTransactionCustomer(){}setTransactionCustomer(){}setTransactionCustomerDetails(){}getInitialOptionIds(){return new Promise(()=>new Set)}getWorkflow(){return{id:"",name:"",panels:[],steps:[],showModelOnFinishStep:!1,allowProofDownload:!1,introduction:"",stepGroups:[]}}markStepsAsInitialised(e){}markUpdateCompleted(e){}markUpdatePending(){return"123"}getWorkflowSelections(){return{}}getStepSelections(){return{}}setCurrentAdjustingStepId(e){}setEditedStatus(e,t){}setInformationResults(e){}setMandatoryFulfilled(e,t){}async setSelectionsAndElements(e,t,n){}toggleDesignConfirmed(){}updateMetadata(e,t){}async updateStorage(e,t){}injectIntoPreviewService(e){return Promise.resolve()}ejectFromPreviewService(){}setWorkflowStateSyncEnabled(e){}async updateTransactionShareActions(){}addValidationCallback(e){}setStepError(e,t,n){}getStepErrors(e){}getValidationErrors(){return{steps:new Map}}async updateTransactionStakeholders(){}getStepTags(e){return[]}}var QP=(r=>(r.SelectFrame="SelectFrame",r.SelectImage="SelectImage",r.Position="Position",r))(QP||{}),YP=(r=>(r.Original="original",r.BackgroundRemoved="backgroundRemoved",r.Optimized="optimized",r))(YP||{});class XP extends Ui{constructor(e,t,n){super(e,t,n);const i=t.data;this.frameService=new WP(i.forceImageCover,i.initialZoomLevel),this.frameService.connectWorkflowManager(e,t.stepName)}selectVariant(e){const t=this.manager.getRegionElements(this.step.stepName);return so.selectVariant(this.step,e.getResource(),t,this.manager,n=>this.setUpdateState(n))}onFrameDataChanged(e){this.frameService&&this.frameService.onFrameDataChanged(t=>{t&&e(t)})}async selectImage(e,t=!0,n=!0){await so.selectImage(this.step,e,this.manager,n),t&&this.manager.updateStorage(this.step.stepName,{framePatternData:{originalAssetKey:e.key,backgroundRemovedAssetKey:void 0,vectorizedAssetKey:void 0,enhancedAssetKey:void 0,useOriginalAsset:void 0}})}async canUseAdvancedImageManipulation(){return this.manager.getClient().canUseAddon(Bg.AdvancedImageManipulation)}async canRemoveBackground(){return await this.canUseAdvancedImageManipulation()&&this.hasOriginalImageSelection()&&!!this.frameService?.getImageData()?.src&&!this.frameService?.getImageData()?.svg}async removeBackgroundFromImageSelection(e=!0){if(!await this.canUseAdvancedImageManipulation())throw new Error("The current Integration does not have access to the Background Remover. Please call canUseAdvancedImageManipulation to ensure you disable this feature when appropriate.");const t=await this.getOriginalImageSelection();if(!t)throw new Error("You must supply an image selection before attempting to remove the background.");const n=await Ln.removeBackgroundFromAsset(t);e&&await so.selectImage(this.step,n,this.manager,!1);const i=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{...i,backgroundRemovedAssetKey:n.key,useOriginalAsset:!e}}),n}async vectorize(e,t=void 0){const n=e??await this.getOriginalImageSelection();if(!n)throw new Error("You must supply an image selection before attempting to vectorize the image.");const i=await Ln.vectorizeAsset(n,t);await this.selectImage(i,!1);const a=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{...a,vectorizedAssetKey:i.key,useOriginalAsset:!1}}),i}async enhanceWithAI(e,t){const n=e??await this.getOriginalImageSelection();if(!n)throw new Error("You must supply an image selection before attempting to enhance the image with AI.");const i=await Ln.enhanceWithAI(n,t);await this.selectImage(i,!1);const a=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{originalAssetKey:a.originalAssetKey,backgroundRemovedAssetKey:a.backgroundRemovedAssetKey,vectorizedAssetKey:a.vectorizedAssetKey,enhancedAssetKey:i.key,useOriginalAsset:!1}}),i}async getBackgroundRemovedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.backgroundRemovedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}async getVectorizedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.vectorizedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}async getEnhancedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.enhancedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}hasOriginalImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.originalAssetKey}hasBackgroundRemovedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.backgroundRemovedAssetKey}hasVectorizedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.vectorizedAssetKey}hasEnhancedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.enhancedAssetKey}async changeColors(e){await so.changeColors(this.step,this.manager,e)}getImageData(){if(this.frameService)return this.frameService.getImageData()}async getColorOption(){return await ct.ensureFullOption(this.step.data.colorOption)}getAvailableColors(){return this.step.data.colorPickerEnabled?so.availableColors(this.step,this.manager):Promise.resolve([])}isColorPickerEnabled(){return this.step.data.colorPickerEnabled??!1}async getOriginalImageColors(){const e=this.getImageData();return e?.svg?(await Pa(e.svg)).colors:void 0}async mergeColors(e,t,n){const i=this.frameService.getImageData();if(!i?.svg||!i.colors)throw new Error("Cannot merge colors on non-SVG image or image without color information");const{svg:a,colors:s}=pT(i.svg,i.colors,e,t,n);this.frameService.setPatternData({...i,svg:a,colors:s},!1),this.manager.updateStorage(this.step.stepName,{colors:s})}async unmergeColors(e,t,n,i){const a=this.frameService.getImageData();if(!a?.svg||!a.colors)throw new Error("Cannot unmerge colors on non-SVG image or image without color information");this.frameService.setPatternData({...a,svg:i,colors:n},!1),this.manager.updateStorage(this.step.stepName,{colors:n})}getShouldVectorize(){return this.step.data.shouldVectorize??!1}getVectorizeMaxColors(){return this.step.data.vectorizeMaxColors}getMinimumPixelThresholdForOptimization(){return this.step.data.vectorizationMinimumPixelThreshold}getMaxAllowedColors(){return this.step.data.maxColors}getUniqueColorCount(){return so.getUniqueColorCount(this.step,this.manager)}getCurrentFrameStep(e,t,n,i){return i&&i.length>1&&e===void 0?"SelectFrame":t||n||this.getImageData()?"Position":"SelectImage"}getFrameService(){return this.frameService}hasOverlayImageKey(){return this.step.data.overlayImageKey}hasOverlayImageUrl(){return this.step.data.overlayImageUrl}getWhitelistedExtensions(){return[...this.step.data.whitelistedExtensions,...this.step.data.whitelistedExtensions.includes(".jpg")?[".jpeg"]:[]]}async getOriginalImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.originalAssetKey;if(e)return Ln.getLocalOrFromServer(e)}getCurrentImageState(){const e=this.getFrameStepStorage()?.framePatternData;return e?e.vectorizedAssetKey&&!e.useOriginalAsset?"optimized":e.useOriginalAsset!==!1?"original":"backgroundRemoved":"original"}async setImageState(e){const t=this.getFrameStepStorage()?.framePatternData||{};let n,i;switch(e){case"original":if(n=await this.getOriginalImageSelection(),!n)throw new Error("No original image available");i=!0;break;case"backgroundRemoved":if(n=await this.getBackgroundRemovedImageSelection(),!n)throw new Error("No background-removed image available. Call removeBackgroundFromImageSelection first.");i=!1;break;case"optimized":if(n=await this.getVectorizedImageSelection(),!n)throw new Error("No optimized image available. Call vectorize first.");i=!1;break}await this.selectImage(n,!1,!0),this.manager.updateStorage(this.step.stepName,{framePatternData:{...t,useOriginalAsset:i}})}getUseOriginalImageSelection(){return this.getFrameStepStorage()?.framePatternData?.useOriginalAsset??!1}async setUseOriginalImageSelection(e){const t=this.getFrameStepStorage()?.framePatternData||{};if(t.useOriginalAsset===e)return;const n=await this.getOriginalImageSelection();if(!n)throw new Error("You must provide an image selection before calling setUseOriginalImageSelection");if(e)await this.selectImage(n,!1,!1);else{const i=await this.getBackgroundRemovedImageSelection();if(!i)throw new Error("You must call removeBackgroundFromImageSelection before attempting to apply the image.");await this.selectImage(i,!1,!1)}this.manager.updateStorage(this.step.stepName,{framePatternData:{...t,useOriginalAsset:e}})}getFrameStepStorage(){return this.manager.getStepStorage(this.step.stepName)}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}const KQ=Se`
3057
3057
  query GetLoggedInCustomer($email: String!) {
3058
3058
  customer(emailAddress: $email) {
3059
3059
  id
@@ -3266,4 +3266,4 @@ ${V2(t)}`);const i=await ze.getShadowGraphqlClient().query({query:t,errorPolicy:
3266
3266
  }
3267
3267
  }
3268
3268
  `,PY=async r=>(await ze.getShadowGraphqlClient().query({query:IY,variables:{ids:r}})).data.integrationProducts;function DY(r){return new M1({},{stateMutationFunc:(()=>Promise.resolve()),transaction:{id:"local-transaction",product:{modelUrl:r.modelUrl}},graphQlClient:{},workflow:r.workflow,reloadedState:r.reloadedState})}exports.AddonHandle=Bg;exports.AddressValidationJobStatus=ZP;exports.AddressValidationResultConfirmationLevel=KP;exports.AddressValidationStatus=Og;exports.ArrayInput=wV;exports.AspectType=Hn;exports.AssetNotFoundError=So;exports.AssetType=ff;exports.BringForwardCommand=PL;exports.BringToBackCommand=IL;exports.BringToFrontCommand=FL;exports.BundleDesignCreationCartAddMode=Uk;exports.CanvasCommand=bn;exports.CollectionProduct=Pu;exports.ColorOptionGlobalPropertyHandle=pA;exports.CommandContext=WF;exports.ConversionDataType=Qd;exports.CreateElementCommand=ai;exports.CreateLayoutCommand=k1;exports.CurrencyContext=UP;exports.CurrencyService=LP;exports.DeleteElementCommand=Ol;exports.DigitalContentStepHandle=kI;exports.FileUploadGlobalPropertyHandle=RI;exports.FlowExecutionNodeResult=Vd;exports.FlowExecutionResult=LI;exports.FlowService=NI;exports.FontAlignmentCommand=KF;exports.FontColorCommand=lA;exports.FontSizeCommand=JF;exports.FontSourceCommand=uA;exports.FrameService=WP;exports.FrameStep=QP;exports.FrameStepHandle=XP;exports.GlobalPropertyHandle=Jg;exports.GroupCommand=In;exports.IllustrationStepHandle=yI;exports.ImageState=YP;exports.InformationMessageType=Jf;exports.InformationStepHandle=EI;exports.IntegrationProduct=mA;exports.IntegrationType=zk;exports.LayoutElementFactory=wL;exports.LayoutElementType=er;exports.LayoutNotFoundError=Ai;exports.LayoutRenderingPurpose=Ku;exports.MaterialStepHandle=AI;exports.MisconfigurationError=as;exports.MockWorkflowManager=JQ;exports.ModelStepHandle=wI;exports.ModuleStepHandle=TI;exports.MoveCommand=bL;exports.ObjectInput=U1;exports.ObjectInputType=UI;exports.OptionGlobalPropertyHandle=_1;exports.OptionNotFoundError=hf;exports.ParseError=Al;exports.PictureStepHandle=bI;exports.ProductCameraRig=$k;exports.ProductCollection=N1;exports.ProductCollectionProductSortKey=_I;exports.ProductStepHandle=FI;exports.ProductWorkflow=oo;exports.PromiseQueue=jg;exports.QuestionStepHandle=CI;exports.QueueablePromise=Gg;exports.ResizeCommand=xL;exports.ResourceNotFoundError=Zu;exports.RotateCommand=CL;exports.ScaleAxis=gi;exports.SendBackwardsCommand=DL;exports.ShapeStepHandle=xI;exports.ShareActionType=Vk;exports.SpiffCommerceClient=$Q;exports.StakeholderType=qA;exports.StepAspectType=Lk;exports.StepHandle=Ui;exports.StepType=Xe;exports.TextAlgorithm=Fl;exports.TextChangeCommand=ZF;exports.TextGlobalPropertyHandle=OI;exports.TextInput=AV;exports.TextStepHandle=SI;exports.UnhandledBehaviorError=nn;exports.UnitOfMeasurement=Hk;exports.UpdateElementRegionCommand=eI;exports.UpdateImageSourceCommand=kL;exports.Variant=Fa;exports.WorkflowExperienceEventType=yg;exports.WorkflowExperienceImpl=M1;exports.__values=lD;exports.amtChannelsForAspect=BI;exports.assetConfigurationDeleteMutation=iM;exports.assetConfigurationUpdateMutation=nM;exports.assetConfigurationsQuery=rM;exports.assetService=Ln;exports.browserColorToHex=cT;exports.bundleEmailMutation=I9;exports.cmPerPixel=K_;exports.createLocalWorkflowExperience=DY;exports.currentDirection=Y_;exports.dataUrlFromExternalUrl=$4;exports.deleteBundle=YQ;exports.designService=Qp;exports.determineCorrectFontSizeAndLines=Kd;exports.digitalContentStepService=F1;exports.domParser=us;exports.duplicateBundle=lY;exports.duplicateTransaction=uY;exports.fetchAsString=ra;exports.findAngle=$_;exports.findElement=Un;exports.findPmsColors=s3;exports.frameDataCache=_u;exports.frameStepService=so;exports.fromHex=WI;exports.fromUtf8=kl;exports.generate=hr;exports.generateCommands=dI;exports.generateSVGWithUnknownColors=Pa;exports.generateStateFromDesignInputSteps=YU;exports.getActivation=HP;exports.getActivationThemeConfiguration=WQ;exports.getAddressValidationJobs=SY;exports.getAssetsForProductImagesQuery=aM;exports.getAttributesFromArrayBuffer=_f;exports.getAxisAlignedBoundingBox=z_;exports.getBoundedOffsets=qP;exports.getBundleIdForTransaction=XQ;exports.getBundleThemeConfiguration=jQ;exports.getCustomer=cY;exports.getCustomerBundles=dY;exports.getElementVertices=X_;exports.getFrameData=Xf;exports.getGlobalPropertyStateForBundle=ZU;exports.getIntegration=$P;exports.getIntegrationProducts=PY;exports.getLayoutCanvasSize=hI;exports.getNEPoint=W_;exports.getNWPoint=q_;exports.getOrderedTransactions=pY;exports.getOverrideThemeConfiguration=GQ;exports.getPointOfRotation=j_;exports.getProductCollections=hV;exports.getSEPoint=Q_;exports.getSvgElement=Qg;exports.getTemplateBundles=mY;exports.getTemplateTransactions=gY;exports.getTransaction=HQ;exports.getTransactionThemeConfiguration=qQ;exports.getTransactionsForBundle=fY;exports.getTransformedAssetURL=$g;exports.getTrueCoordinates=G_;exports.getUnorderedTransactions=hY;exports.getValidationJobsForWorkflowExperiences=xY;exports.getWorkflow=VP;exports.getWorkflows=tb;exports.graphQlManager=ze;exports.illustrationStepService=Jd;exports.isCloseToValue=H_;exports.loadFont=Rl;exports.matchHexToPms=n3;exports.materialStepService=I1;exports.mergeColorClasses=pT;exports.metafieldManager=Ag;exports.mmPerPixel=J_;exports.modelStepService=P1;exports.modifySVGColors=zg;exports.moduleStepService=D1;exports.nameBundle=sY;exports.nameTransaction=oY;exports.nonPotTexSupport=fI;exports.optionService=ct;exports.outlineFontsInSvg=I7;exports.overrideWorkflowExperienceRecipientAddress=TY;exports.patternImageDataCache=Ds;exports.persistenceService=br;exports.pictureStepService=R1;exports.pmsToRgb=r3;exports.promiseCache=mf;exports.questionStepService=O1;exports.registerFetchImplementation=N4;exports.registerWindowImplementation=_4;exports.rehydrateSerializedLayout=oA;exports.rgbToPms=uT;exports.rotateAroundPoint=Ld;exports.sanitizeSvgTree=Vg;exports.setApplicationKey=Jk;exports.setBearerAuthenticationToken=Zk;exports.setCanvasModule=QA;exports.shapeStepService=Nu;exports.shortenUrl=sI;exports.skipWorkflowExperienceRecipientAddress=FY;exports.spiffCoreConfiguration=ss;exports.stepAspectValuesToDesignInputSteps=QU;exports.svgColorValueToDefinition=Hy;exports.svgStringDimensions=E1;exports.svgToDataUrl=Ug;exports.textStepService=ri;exports.toHex=Ao;exports.toUtf8=em;exports.toast=lI;exports.validateWorkflowExperienceRecipient=EY;exports.validateWorkflowExperienceRecipients=kY;exports.xmlSerializer=Do;
3269
- //# sourceMappingURL=index-DxF5flbg.cjs.map
3269
+ //# sourceMappingURL=index-DGCjFyG6.cjs.map