x_ite 11.2.2 → 11.2.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.
Files changed (85) hide show
  1. package/README.md +4 -4
  2. package/dist/assets/components/AnnotationComponent.js +2 -2
  3. package/dist/assets/components/AnnotationComponent.min.js +2 -2
  4. package/dist/assets/components/CADGeometryComponent.js +72 -58
  5. package/dist/assets/components/CADGeometryComponent.min.js +2 -2
  6. package/dist/assets/components/CubeMapTexturingComponent.js +2 -2
  7. package/dist/assets/components/CubeMapTexturingComponent.min.js +2 -2
  8. package/dist/assets/components/DISComponent.js +2 -2
  9. package/dist/assets/components/DISComponent.min.js +2 -2
  10. package/dist/assets/components/EventUtilitiesComponent.js +2 -2
  11. package/dist/assets/components/EventUtilitiesComponent.min.js +2 -2
  12. package/dist/assets/components/Geometry2DComponent.js +2 -2
  13. package/dist/assets/components/Geometry2DComponent.min.js +2 -2
  14. package/dist/assets/components/GeospatialComponent.js +4 -4
  15. package/dist/assets/components/GeospatialComponent.min.js +2 -2
  16. package/dist/assets/components/HAnimComponent.js +2 -2
  17. package/dist/assets/components/HAnimComponent.min.js +2 -2
  18. package/dist/assets/components/KeyDeviceSensorComponent.js +2 -2
  19. package/dist/assets/components/KeyDeviceSensorComponent.min.js +2 -2
  20. package/dist/assets/components/LayoutComponent.js +22 -7
  21. package/dist/assets/components/LayoutComponent.min.js +2 -2
  22. package/dist/assets/components/NURBSComponent.js +2 -2
  23. package/dist/assets/components/NURBSComponent.min.js +2 -2
  24. package/dist/assets/components/ParticleSystemsComponent.js +3 -3
  25. package/dist/assets/components/ParticleSystemsComponent.min.js +2 -2
  26. package/dist/assets/components/PickingComponent.js +2 -2
  27. package/dist/assets/components/PickingComponent.min.js +2 -2
  28. package/dist/assets/components/RigidBodyPhysicsComponent.js +5 -5
  29. package/dist/assets/components/RigidBodyPhysicsComponent.min.js +2 -2
  30. package/dist/assets/components/ScriptingComponent.js +2 -2
  31. package/dist/assets/components/ScriptingComponent.min.js +2 -2
  32. package/dist/assets/components/TextComponent.js +16336 -14672
  33. package/dist/assets/components/TextComponent.min.js +2 -2
  34. package/dist/assets/components/TextureProjectionComponent.js +2 -2
  35. package/dist/assets/components/TextureProjectionComponent.min.js +2 -2
  36. package/dist/assets/components/Texturing3DComponent.js +100 -100
  37. package/dist/assets/components/Texturing3DComponent.min.js +2 -2
  38. package/dist/assets/components/VolumeRenderingComponent.js +3 -3
  39. package/dist/assets/components/VolumeRenderingComponent.min.js +2 -2
  40. package/dist/assets/components/WebXRComponent.js +121 -73
  41. package/dist/assets/components/WebXRComponent.min.js +2 -2
  42. package/dist/assets/components/X_ITEComponent.js +3 -3
  43. package/dist/assets/components/X_ITEComponent.min.js +2 -2
  44. package/dist/assets/fonts/Droid/DroidSerif-Bold.woff2 +0 -0
  45. package/dist/assets/fonts/Droid/DroidSerif-BoldItalic.woff2 +0 -0
  46. package/dist/assets/fonts/Droid/DroidSerif-Italic.woff2 +0 -0
  47. package/dist/assets/fonts/Droid/DroidSerif-Regular.woff2 +0 -0
  48. package/dist/assets/fonts/PT_Sans/PTSans-Bold.woff2 +0 -0
  49. package/dist/assets/fonts/PT_Sans/PTSans-BoldItalic.woff2 +0 -0
  50. package/dist/assets/fonts/PT_Sans/PTSans-Italic.woff2 +0 -0
  51. package/dist/assets/fonts/PT_Sans/PTSans-Regular.woff2 +0 -0
  52. package/dist/assets/fonts/Ubuntu/Ubuntu-B.woff2 +0 -0
  53. package/dist/assets/fonts/Ubuntu/Ubuntu-BI.woff2 +0 -0
  54. package/dist/assets/fonts/Ubuntu/Ubuntu-R.woff2 +0 -0
  55. package/dist/assets/fonts/Ubuntu/Ubuntu-RI.woff2 +0 -0
  56. package/dist/assets/fonts/Ubuntu/UbuntuMono-B.woff2 +0 -0
  57. package/dist/assets/fonts/Ubuntu/UbuntuMono-BI.woff2 +0 -0
  58. package/dist/assets/fonts/Ubuntu/UbuntuMono-R.woff2 +0 -0
  59. package/dist/assets/fonts/Ubuntu/UbuntuMono-RI.woff2 +0 -0
  60. package/dist/assets/lib/decompress_binding.js +1 -0
  61. package/dist/example.html +1 -1
  62. package/dist/x_ite.css +1 -1
  63. package/dist/x_ite.d.ts +1 -1
  64. package/dist/x_ite.js +56423 -56558
  65. package/dist/x_ite.min.js +2 -2
  66. package/dist/x_ite.min.mjs +2 -2
  67. package/dist/x_ite.mjs +56141 -56276
  68. package/dist/x_ite.zip +0 -0
  69. package/package.json +3 -2
  70. package/dist/assets/fonts/Droid/DroidSerif-Bold.ttf +0 -0
  71. package/dist/assets/fonts/Droid/DroidSerif-BoldItalic.ttf +0 -0
  72. package/dist/assets/fonts/Droid/DroidSerif-Italic.ttf +0 -0
  73. package/dist/assets/fonts/Droid/DroidSerif-Regular.ttf +0 -0
  74. package/dist/assets/fonts/PT_Sans/PTSans-Bold.ttf +0 -0
  75. package/dist/assets/fonts/PT_Sans/PTSans-BoldItalic.ttf +0 -0
  76. package/dist/assets/fonts/PT_Sans/PTSans-Italic.ttf +0 -0
  77. package/dist/assets/fonts/PT_Sans/PTSans-Regular.ttf +0 -0
  78. package/dist/assets/fonts/Ubuntu/Ubuntu-B.ttf +0 -0
  79. package/dist/assets/fonts/Ubuntu/Ubuntu-BI.ttf +0 -0
  80. package/dist/assets/fonts/Ubuntu/Ubuntu-R.ttf +0 -0
  81. package/dist/assets/fonts/Ubuntu/Ubuntu-RI.ttf +0 -0
  82. package/dist/assets/fonts/Ubuntu/UbuntuMono-B.ttf +0 -0
  83. package/dist/assets/fonts/Ubuntu/UbuntuMono-BI.ttf +0 -0
  84. package/dist/assets/fonts/Ubuntu/UbuntuMono-R.ttf +0 -0
  85. package/dist/assets/fonts/Ubuntu/UbuntuMono-RI.ttf +0 -0
@@ -1,2 +1,2 @@
1
- /* X_ITE v11.2.2 */
2
- const e=window[Symbol.for("X_ITE.X3D-11.2.2")];(()=>{var t={254:t=>{t.exports=e.jquery},256:()=>{},987:function(e,t,r){!function(e){var t,n;String.prototype.codePointAt||(t=function(){try{var e={},t=Object.defineProperty,r=t(e,e,e)&&t}catch(e){}return r}(),n=function(e){if(null==this)throw TypeError();var t=String(this),r=t.length,n=e?Number(e):0;if(n!=n&&(n=0),!(n<0||n>=r)){var a,s=t.charCodeAt(n);return s>=55296&&s<=56319&&r>n+1&&(a=t.charCodeAt(n+1))>=56320&&a<=57343?1024*(s-55296)+a-56320+65536:s}},t?t(String.prototype,"codePointAt",{value:n,configurable:!0,writable:!0}):String.prototype.codePointAt=n);var a=0,s=-3;function o(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function i(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new o,this.dtree=new o}var u=new o,l=new o,p=new Uint8Array(30),c=new Uint16Array(30),h=new Uint8Array(30),f=new Uint16Array(30),d=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=new o,v=new Uint8Array(320);function m(e,t,r,n){var a,s;for(a=0;a<r;++a)e[a]=0;for(a=0;a<30-r;++a)e[a+r]=a/r|0;for(s=n,a=0;a<30;++a)t[a]=s,s+=1<<e[a]}function y(e,t){var r;for(r=0;r<7;++r)e.table[r]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,r=0;r<24;++r)e.trans[r]=256+r;for(r=0;r<144;++r)e.trans[24+r]=r;for(r=0;r<8;++r)e.trans[168+r]=280+r;for(r=0;r<112;++r)e.trans[176+r]=144+r;for(r=0;r<5;++r)t.table[r]=0;for(t.table[5]=32,r=0;r<32;++r)t.trans[r]=r}var b=new Uint16Array(16);function S(e,t,r,n){var a,s;for(a=0;a<16;++a)e.table[a]=0;for(a=0;a<n;++a)e.table[t[r+a]]++;for(e.table[0]=0,s=0,a=0;a<16;++a)b[a]=s,s+=e.table[a];for(a=0;a<n;++a)t[r+a]&&(e.trans[b[t[r+a]]++]=a)}function x(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=1&e.tag;return e.tag>>>=1,t}function T(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,n+r}function U(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var r=0,n=0,a=0,s=e.tag;do{n=2*n+(1&s),s>>>=1,++a,r+=t.table[a],n-=t.table[a]}while(n>=0);return e.tag=s,e.bitcount-=a,t.trans[r+n]}function k(e,t,r){var n,a,s,o,i,u;for(n=T(e,5,257),a=T(e,5,1),s=T(e,4,4),o=0;o<19;++o)v[o]=0;for(o=0;o<s;++o){var l=T(e,3,0);v[d[o]]=l}for(S(g,v,0,19),i=0;i<n+a;){var p=U(e,g);switch(p){case 16:var c=v[i-1];for(u=T(e,2,3);u;--u)v[i++]=c;break;case 17:for(u=T(e,3,3);u;--u)v[i++]=0;break;case 18:for(u=T(e,7,11);u;--u)v[i++]=0;break;default:v[i++]=p}}S(t,v,0,n),S(r,v,n,a)}function E(e,t,r){for(;;){var n,s,o,i,u=U(e,t);if(256===u)return a;if(u<256)e.dest[e.destLen++]=u;else for(n=T(e,p[u-=257],c[u]),s=U(e,r),i=o=e.destLen-T(e,h[s],f[s]);i<o+n;++i)e.dest[e.destLen++]=e.dest[i]}}function O(e){for(var t,r;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if((t=256*(t=e.source[e.sourceIndex+1])+e.source[e.sourceIndex])!==(65535&~(256*e.source[e.sourceIndex+3]+e.source[e.sourceIndex+2])))return s;for(e.sourceIndex+=4,r=t;r;--r)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,a}function w(e,t){var r,n,o=new i(e,t);do{switch(r=x(o),T(o,2,0)){case 0:n=O(o);break;case 1:n=E(o,u,l);break;case 2:k(o,o.ltree,o.dtree),n=E(o,o.ltree,o.dtree);break;default:n=s}if(n!==a)throw new Error("Data error")}while(!r);return o.destLen<o.dest.length?"function"==typeof o.dest.slice?o.dest.slice(0,o.destLen):o.dest.subarray(0,o.destLen):o.dest}y(u,l),m(p,c,4,3),m(h,f,2,1),p[28]=0,c[28]=258;var R=w;function L(e,t,r,n,a){return Math.pow(1-a,3)*e+3*Math.pow(1-a,2)*a*t+3*(1-a)*Math.pow(a,2)*r+Math.pow(a,3)*n}function C(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}function D(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}function I(e){throw new Error(e)}function B(e,t){e||I(t)}C.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},C.prototype.addPoint=function(e,t){"number"==typeof e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,n,a,s,o,i){var u=[e,t],l=[r,n],p=[a,s],c=[o,i];this.addPoint(e,t),this.addPoint(o,i);for(var h=0;h<=1;h++){var f=6*u[h]-12*l[h]+6*p[h],d=-3*u[h]+9*l[h]-9*p[h]+3*c[h],g=3*l[h]-3*u[h];if(0!==d){var v=Math.pow(f,2)-4*g*d;if(!(v<0)){var m=(-f+Math.sqrt(v))/(2*d);0<m&&m<1&&(0===h&&this.addX(L(u[h],l[h],p[h],c[h],m)),1===h&&this.addY(L(u[h],l[h],p[h],c[h],m)));var y=(-f-Math.sqrt(v))/(2*d);0<y&&y<1&&(0===h&&this.addX(L(u[h],l[h],p[h],c[h],y)),1===h&&this.addY(L(u[h],l[h],p[h],c[h],y)))}}else{if(0===f)continue;var b=-g/f;0<b&&b<1&&(0===h&&this.addX(L(u[h],l[h],p[h],c[h],b)),1===h&&this.addY(L(u[h],l[h],p[h],c[h],b)))}}},C.prototype.addQuad=function(e,t,r,n,a,s){var o=e+2/3*(r-e),i=t+2/3*(n-t),u=o+1/3*(a-e),l=i+1/3*(s-t);this.addBezier(e,t,o,i,u,l,a,s)},D.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},D.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},D.prototype.curveTo=D.prototype.bezierCurveTo=function(e,t,r,n,a,s){this.commands.push({type:"C",x1:e,y1:t,x2:r,y2:n,x:a,y:s})},D.prototype.quadTo=D.prototype.quadraticCurveTo=function(e,t,r,n){this.commands.push({type:"Q",x1:e,y1:t,x:r,y:n})},D.prototype.close=D.prototype.closePath=function(){this.commands.push({type:"Z"})},D.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof C){var t=e;return this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close()}Array.prototype.push.apply(this.commands,e)},D.prototype.getBoundingBox=function(){for(var e=new C,t=0,r=0,n=0,a=0,s=0;s<this.commands.length;s++){var o=this.commands[s];switch(o.type){case"M":e.addPoint(o.x,o.y),t=n=o.x,r=a=o.y;break;case"L":e.addPoint(o.x,o.y),n=o.x,a=o.y;break;case"Q":e.addQuad(n,a,o.x1,o.y1,o.x,o.y),n=o.x,a=o.y;break;case"C":e.addBezier(n,a,o.x1,o.y1,o.x2,o.y2,o.x,o.y),n=o.x,a=o.y;break;case"Z":n=t,a=r;break;default:throw new Error("Unexpected path command "+o.type)}}return e.isEmpty()&&e.addPoint(0,0),e},D.prototype.draw=function(e){e.beginPath();for(var t=0;t<this.commands.length;t+=1){var r=this.commands[t];"M"===r.type?e.moveTo(r.x,r.y):"L"===r.type?e.lineTo(r.x,r.y):"C"===r.type?e.bezierCurveTo(r.x1,r.y1,r.x2,r.y2,r.x,r.y):"Q"===r.type?e.quadraticCurveTo(r.x1,r.y1,r.x,r.y):"Z"===r.type&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},D.prototype.toPathData=function(e){function t(t){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function r(){for(var e=arguments,r="",n=0;n<arguments.length;n+=1){var a=e[n];a>=0&&n>0&&(r+=" "),r+=t(a)}return r}e=void 0!==e?e:2;for(var n="",a=0;a<this.commands.length;a+=1){var s=this.commands[a];"M"===s.type?n+="M"+r(s.x,s.y):"L"===s.type?n+="L"+r(s.x,s.y):"C"===s.type?n+="C"+r(s.x1,s.y1,s.x2,s.y2,s.x,s.y):"Q"===s.type?n+="Q"+r(s.x1,s.y1,s.x,s.y):"Z"===s.type&&(n+="Z")}return n},D.prototype.toSVG=function(e){var t='<path d="';return t+=this.toPathData(e),t+='"',this.fill&&"black"!==this.fill&&(null===this.fill?t+=' fill="none"':t+=' fill="'+this.fill+'"'),this.stroke&&(t+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),t+="/>"},D.prototype.toDOMElement=function(e){var t=this.toPathData(e),r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",t),r};var F={fail:I,argument:B,assert:B},G=32768,M=2147483648,N={},A={},P={};function _(e){return function(){return e}}A.BYTE=function(e){return F.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]},P.BYTE=_(1),A.CHAR=function(e){return[e.charCodeAt(0)]},P.CHAR=_(1),A.CHARARRAY=function(e){void 0===e&&(e="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var t=[],r=0;r<e.length;r+=1)t[r]=e.charCodeAt(r);return t},P.CHARARRAY=function(e){return void 0===e?0:e.length},A.USHORT=function(e){return[e>>8&255,255&e]},P.USHORT=_(2),A.SHORT=function(e){return e>=G&&(e=-(2*G-e)),[e>>8&255,255&e]},P.SHORT=_(2),A.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},P.UINT24=_(3),A.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},P.ULONG=_(4),A.LONG=function(e){return e>=M&&(e=-(2*M-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},P.LONG=_(4),A.FIXED=A.ULONG,P.FIXED=P.ULONG,A.FWORD=A.SHORT,P.FWORD=P.SHORT,A.UFWORD=A.USHORT,P.UFWORD=P.USHORT,A.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},P.LONGDATETIME=_(8),A.TAG=function(e){return F.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},P.TAG=_(4),A.Card8=A.BYTE,P.Card8=P.BYTE,A.Card16=A.USHORT,P.Card16=P.USHORT,A.OffSize=A.BYTE,P.OffSize=P.BYTE,A.SID=A.USHORT,P.SID=P.USHORT,A.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?A.NUMBER16(e):A.NUMBER32(e)},P.NUMBER=function(e){return A.NUMBER(e).length},A.NUMBER16=function(e){return[28,e>>8&255,255&e]},P.NUMBER16=_(3),A.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},P.NUMBER32=_(5),A.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var n=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*n)/n).toString()}for(var a="",s=0,o=t.length;s<o;s+=1){var i=t[s];a+="e"===i?"-"===t[++s]?"c":"b":"."===i?"a":"-"===i?"e":i}for(var u=[30],l=0,p=(a+=1&a.length?"f":"ff").length;l<p;l+=2)u.push(parseInt(a.substr(l,2),16));return u},P.REAL=function(e){return A.REAL(e).length},A.NAME=A.CHARARRAY,P.NAME=P.CHARARRAY,A.STRING=A.CHARARRAY,P.STRING=P.CHARARRAY,N.UTF8=function(e,t,r){for(var n=[],a=r,s=0;s<a;s++,t+=1)n[s]=e.getUint8(t);return String.fromCharCode.apply(null,n)},N.UTF16=function(e,t,r){for(var n=[],a=r/2,s=0;s<a;s++,t+=2)n[s]=e.getUint16(t);return String.fromCharCode.apply(null,n)},A.UTF16=function(e){for(var t=[],r=0;r<e.length;r+=1){var n=e.charCodeAt(r);t[t.length]=n>>8&255,t[t.length]=255&n}return t},P.UTF16=function(e){return 2*e.length};var H={"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":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};N.MACSTRING=function(e,t,r,n){var a=H[n];if(void 0!==a){for(var s="",o=0;o<r;o++){var i=e.getUint8(t+o);s+=i<=127?String.fromCharCode(i):a[127&i]}return s}};var z,W="function"==typeof WeakMap&&new WeakMap,V=function(e){if(!z)for(var t in z={},H)z[t]=new String(t);var r=z[e];if(void 0!==r){if(W){var n=W.get(r);if(void 0!==n)return n}var a=H[e];if(void 0!==a){for(var s={},o=0;o<a.length;o++)s[a.charCodeAt(o)]=o+128;return W&&W.set(r,s),s}}};function q(e){return e>=-128&&e<=127}function X(e,t,r){for(var n=0,a=e.length;t<a&&n<64&&0===e[t];)++t,++n;return r.push(128|n-1),t}function j(e,t,r){for(var n=0,a=e.length,s=t;s<a&&n<64;){var o=e[s];if(!q(o))break;if(0===o&&s+1<a&&0===e[s+1])break;++s,++n}r.push(n-1);for(var i=t;i<s;++i)r.push(e[i]+256&255);return s}function Y(e,t,r){for(var n=0,a=e.length,s=t;s<a&&n<64;){var o=e[s];if(0===o)break;if(q(o)&&s+1<a&&q(e[s+1]))break;++s,++n}r.push(64|n-1);for(var i=t;i<s;++i){var u=e[i];r.push(u+65536>>8&255,u+256&255)}return s}A.MACSTRING=function(e,t){var r=V(t);if(void 0!==r){for(var n=[],a=0;a<e.length;a++){var s=e.charCodeAt(a);if(s>=128&&void 0===(s=r[s]))return;n[a]=s}return n}},P.MACSTRING=function(e,t){var r=A.MACSTRING(e,t);return void 0!==r?r.length:0},A.VARDELTAS=function(e){for(var t=0,r=[];t<e.length;){var n=e[t];t=0===n?X(e,t,r):n>=-128&&n<=127?j(e,t,r):Y(e,t,r)}return r},A.INDEX=function(e){for(var t=1,r=[t],n=[],a=0;a<e.length;a+=1){var s=A.OBJECT(e[a]);Array.prototype.push.apply(n,s),t+=s.length,r.push(t)}if(0===n.length)return[0,0];for(var o=[],i=1+Math.floor(Math.log(t)/Math.log(2))/8|0,u=[void 0,A.BYTE,A.USHORT,A.UINT24,A.ULONG][i],l=0;l<r.length;l+=1){var p=u(r[l]);Array.prototype.push.apply(o,p)}return Array.prototype.concat(A.Card16(e.length),A.OffSize(i),o,n)},P.INDEX=function(e){return A.INDEX(e).length},A.DICT=function(e){for(var t=[],r=Object.keys(e),n=r.length,a=0;a<n;a+=1){var s=parseInt(r[a],0),o=e[s];t=(t=t.concat(A.OPERAND(o.value,o.type))).concat(A.OPERATOR(s))}return t},P.DICT=function(e){return A.DICT(e).length},A.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},A.OPERAND=function(e,t){var r=[];if(Array.isArray(t))for(var n=0;n<t.length;n+=1)F.argument(e.length===t.length,"Not enough arguments given for type"+t),r=r.concat(A.OPERAND(e[n],t[n]));else if("SID"===t)r=r.concat(A.NUMBER(e));else if("offset"===t)r=r.concat(A.NUMBER32(e));else if("number"===t)r=r.concat(A.NUMBER(e));else{if("real"!==t)throw new Error("Unknown operand type "+t);r=r.concat(A.REAL(e))}return r},A.OP=A.BYTE,P.OP=P.BYTE;var Z="function"==typeof WeakMap&&new WeakMap;function Q(e,t,r){if(t.length&&("coverageFormat"!==t[0].name||1===t[0].value))for(var n=0;n<t.length;n+=1){var a=t[n];this[a.name]=a.value}if(this.tableName=e,this.fields=t,r)for(var s=Object.keys(r),o=0;o<s.length;o+=1){var i=s[o],u=r[i];void 0!==this[i]&&(this[i]=u)}}function K(e,t,r){void 0===r&&(r=t.length);var n=new Array(t.length+1);n[0]={name:e+"Count",type:"USHORT",value:r};for(var a=0;a<t.length;a++)n[a+1]={name:e+a,type:"USHORT",value:t[a]};return n}function J(e,t,r){var n=t.length,a=new Array(n+1);a[0]={name:e+"Count",type:"USHORT",value:n};for(var s=0;s<n;s++)a[s+1]={name:e+s,type:"TABLE",value:r(t[s],s)};return a}function $(e,t,r){var n=t.length,a=[];a[0]={name:e+"Count",type:"USHORT",value:n};for(var s=0;s<n;s++)a=a.concat(r(t[s],s));return a}function ee(e){1===e.format?Q.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(K("glyph",e.glyphs))):2===e.format?Q.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat($("rangeRecord",e.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}]})))):F.assert(!1,"Coverage format must be 1 or 2.")}function te(e){Q.call(this,"scriptListTable",$("scriptRecord",e,(function(e,t){var r=e.script,n=r.defaultLangSys;return F.assert(!!n,"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 Q("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new Q("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:n.reqFeatureIndex}].concat(K("featureIndex",n.featureIndexes)))}].concat($("langSys",r.langSysRecords,(function(e,t){var r=e.langSys;return[{name:"langSysTag"+t,type:"TAG",value:e.tag},{name:"langSys"+t,type:"TABLE",value:new Q("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:r.reqFeatureIndex}].concat(K("featureIndex",r.featureIndexes)))}]}))))}]})))}function re(e){Q.call(this,"featureListTable",$("featureRecord",e,(function(e,t){var r=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new Q("featureTable",[{name:"featureParams",type:"USHORT",value:r.featureParams}].concat(K("lookupListIndex",r.lookupListIndexes)))}]})))}function ne(e,t){Q.call(this,"lookupListTable",J("lookup",e,(function(e){var r=t[e.lookupType];return F.assert(!!r,"Unable to write GSUB lookup type "+e.lookupType+" tables."),new Q("lookupTable",[{name:"lookupType",type:"USHORT",value:e.lookupType},{name:"lookupFlag",type:"USHORT",value:e.lookupFlag}].concat(J("subtable",e.subtables,r)))})))}A.CHARSTRING=function(e){if(Z){var t=Z.get(e);if(void 0!==t)return t}for(var r=[],n=e.length,a=0;a<n;a+=1){var s=e[a];r=r.concat(A[s.type](s.value))}return Z&&Z.set(e,r),r},P.CHARSTRING=function(e){return A.CHARSTRING(e).length},A.OBJECT=function(e){var t=A[e.type];return F.argument(void 0!==t,"No encoding function for type "+e.type),t(e.value)},P.OBJECT=function(e){var t=P[e.type];return F.argument(void 0!==t,"No sizeOf function for type "+e.type),t(e.value)},A.TABLE=function(e){for(var t=[],r=e.fields.length,n=[],a=[],s=0;s<r;s+=1){var o=e.fields[s],i=A[o.type];F.argument(void 0!==i,"No encoding function for field type "+o.type+" ("+o.name+")");var u=e[o.name];void 0===u&&(u=o.value);var l=i(u);"TABLE"===o.type?(a.push(t.length),t=t.concat([0,0]),n.push(l)):t=t.concat(l)}for(var p=0;p<n.length;p+=1){var c=a[p],h=t.length;F.argument(h<65536,"Table "+e.tableName+" too big."),t[c]=h>>8,t[c+1]=255&h,t=t.concat(n[p])}return t},P.TABLE=function(e){for(var t=0,r=e.fields.length,n=0;n<r;n+=1){var a=e.fields[n],s=P[a.type];F.argument(void 0!==s,"No sizeOf function for field type "+a.type+" ("+a.name+")");var o=e[a.name];void 0===o&&(o=a.value),t+=s(o),"TABLE"===a.type&&(t+=2)}return t},A.RECORD=A.TABLE,P.RECORD=P.TABLE,A.LITERAL=function(e){return e},P.LITERAL=function(e){return e.length},Q.prototype.encode=function(){return A.TABLE(this)},Q.prototype.sizeOf=function(){return P.TABLE(this)},ee.prototype=Object.create(Q.prototype),ee.prototype.constructor=ee,te.prototype=Object.create(Q.prototype),te.prototype.constructor=te,re.prototype=Object.create(Q.prototype),re.prototype.constructor=re,ne.prototype=Object.create(Q.prototype),ne.prototype.constructor=ne;var ae={Table:Q,Record:Q,Coverage:ee,ScriptList:te,FeatureList:re,LookupList:ne,ushortList:K,tableList:J,recordList:$};function se(e,t){return e.getUint8(t)}function oe(e,t){return e.getUint16(t,!1)}function ie(e,t){return e.getInt16(t,!1)}function ue(e,t){return e.getUint32(t,!1)}function le(e,t){return e.getInt16(t,!1)+e.getUint16(t+2,!1)/65535}function pe(e,t){for(var r="",n=t;n<t+4;n+=1)r+=String.fromCharCode(e.getInt8(n));return r}function ce(e,t,r){for(var n=0,a=0;a<r;a+=1)n<<=8,n+=e.getUint8(t+a);return n}function he(e,t,r){for(var n=[],a=t;a<r;a+=1)n.push(e.getUint8(a));return n}function fe(e){for(var t="",r=0;r<e.length;r+=1)t+=String.fromCharCode(e[r]);return t}var de={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function ge(e,t){this.data=e,this.offset=t,this.relativeOffset=0}ge.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},ge.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},ge.prototype.parseCard8=ge.prototype.parseByte,ge.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},ge.prototype.parseCard16=ge.prototype.parseUShort,ge.prototype.parseSID=ge.prototype.parseUShort,ge.prototype.parseOffset16=ge.prototype.parseUShort,ge.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},ge.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},ge.prototype.parseULong=function(){var e=ue(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},ge.prototype.parseOffset32=ge.prototype.parseULong,ge.prototype.parseFixed=function(){var e=le(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},ge.prototype.parseString=function(e){var t=this.data,r=this.offset+this.relativeOffset,n="";this.relativeOffset+=e;for(var a=0;a<e;a++)n+=String.fromCharCode(t.getUint8(r+a));return n},ge.prototype.parseTag=function(){return this.parseString(4)},ge.prototype.parseLongDateTime=function(){var e=ue(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},ge.prototype.parseVersion=function(e){var t=oe(this.data,this.offset+this.relativeOffset),r=oe(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,void 0===e&&(e=4096),t+r/e/10},ge.prototype.skip=function(e,t){void 0===t&&(t=1),this.relativeOffset+=de[e]*t},ge.prototype.parseULongList=function(e){void 0===e&&(e=this.parseULong());for(var t=new Array(e),r=this.data,n=this.offset+this.relativeOffset,a=0;a<e;a++)t[a]=r.getUint32(n),n+=4;return this.relativeOffset+=4*e,t},ge.prototype.parseOffset16List=ge.prototype.parseUShortList=function(e){void 0===e&&(e=this.parseUShort());for(var t=new Array(e),r=this.data,n=this.offset+this.relativeOffset,a=0;a<e;a++)t[a]=r.getUint16(n),n+=2;return this.relativeOffset+=2*e,t},ge.prototype.parseShortList=function(e){for(var t=new Array(e),r=this.data,n=this.offset+this.relativeOffset,a=0;a<e;a++)t[a]=r.getInt16(n),n+=2;return this.relativeOffset+=2*e,t},ge.prototype.parseByteList=function(e){for(var t=new Array(e),r=this.data,n=this.offset+this.relativeOffset,a=0;a<e;a++)t[a]=r.getUint8(n++);return this.relativeOffset+=e,t},ge.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());for(var r=new Array(e),n=0;n<e;n++)r[n]=t.call(this);return r},ge.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());for(var r=new Array(e),n=0;n<e;n++)r[n]=t.call(this);return r},ge.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());for(var r=new Array(e),n=Object.keys(t),a=0;a<e;a++){for(var s={},o=0;o<n.length;o++){var i=n[o],u=t[i];s[i]=u.call(this)}r[a]=s}return r},ge.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());for(var r=new Array(e),n=Object.keys(t),a=0;a<e;a++){for(var s={},o=0;o<n.length;o++){var i=n[o],u=t[i];s[i]=u.call(this)}r[a]=s}return r},ge.prototype.parseStruct=function(e){if("function"==typeof e)return e.call(this);for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var a=t[n],s=e[a];r[a]=s.call(this)}return r},ge.prototype.parseValueRecord=function(e){if(void 0===e&&(e=this.parseUShort()),0!==e){var t={};return 1&e&&(t.xPlacement=this.parseShort()),2&e&&(t.yPlacement=this.parseShort()),4&e&&(t.xAdvance=this.parseShort()),8&e&&(t.yAdvance=this.parseShort()),16&e&&(t.xPlaDevice=void 0,this.parseShort()),32&e&&(t.yPlaDevice=void 0,this.parseShort()),64&e&&(t.xAdvDevice=void 0,this.parseShort()),128&e&&(t.yAdvDevice=void 0,this.parseShort()),t}},ge.prototype.parseValueRecordList=function(){for(var e=this.parseUShort(),t=this.parseUShort(),r=new Array(t),n=0;n<t;n++)r[n]=this.parseValueRecord(e);return r},ge.prototype.parsePointer=function(e){var t=this.parseOffset16();if(t>0)return new ge(this.data,this.offset+t).parseStruct(e)},ge.prototype.parsePointer32=function(e){var t=this.parseOffset32();if(t>0)return new ge(this.data,this.offset+t).parseStruct(e)},ge.prototype.parseListOfLists=function(e){for(var t=this.parseOffset16List(),r=t.length,n=this.relativeOffset,a=new Array(r),s=0;s<r;s++){var o=t[s];if(0!==o)if(this.relativeOffset=o,e){for(var i=this.parseOffset16List(),u=new Array(i.length),l=0;l<i.length;l++)this.relativeOffset=o+i[l],u[l]=e.call(this);a[s]=u}else a[s]=this.parseUShortList();else a[s]=void 0}return this.relativeOffset=n,a},ge.prototype.parseCoverage=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort(),r=this.parseUShort();if(1===t)return{format:1,glyphs:this.parseUShortList(r)};if(2===t){for(var n=new Array(r),a=0;a<r;a++)n[a]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:n}}throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.")},ge.prototype.parseClassDef=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(2===t)return{format:2,ranges:this.parseRecordList({start:ge.uShort,end:ge.uShort,classId:ge.uShort})};throw new Error("0x"+e.toString(16)+": ClassDef format must be 1 or 2.")},ge.list=function(e,t){return function(){return this.parseList(e,t)}},ge.list32=function(e,t){return function(){return this.parseList32(e,t)}},ge.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},ge.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},ge.pointer=function(e){return function(){return this.parsePointer(e)}},ge.pointer32=function(e){return function(){return this.parsePointer32(e)}},ge.tag=ge.prototype.parseTag,ge.byte=ge.prototype.parseByte,ge.uShort=ge.offset16=ge.prototype.parseUShort,ge.uShortList=ge.prototype.parseUShortList,ge.uLong=ge.offset32=ge.prototype.parseULong,ge.uLongList=ge.prototype.parseULongList,ge.struct=ge.prototype.parseStruct,ge.coverage=ge.prototype.parseCoverage,ge.classDef=ge.prototype.parseClassDef;var ve={reserved:ge.uShort,reqFeatureIndex:ge.uShort,featureIndexes:ge.uShortList};ge.prototype.parseScriptList=function(){return this.parsePointer(ge.recordList({tag:ge.tag,script:ge.pointer({defaultLangSys:ge.pointer(ve),langSysRecords:ge.recordList({tag:ge.tag,langSys:ge.pointer(ve)})})}))||[]},ge.prototype.parseFeatureList=function(){return this.parsePointer(ge.recordList({tag:ge.tag,feature:ge.pointer({featureParams:ge.offset16,lookupListIndexes:ge.uShortList})}))||[]},ge.prototype.parseLookupList=function(e){return this.parsePointer(ge.list(ge.pointer((function(){var t=this.parseUShort();F.argument(1<=t&&t<=9,"GPOS/GSUB lookup type "+t+" unknown.");var r=this.parseUShort(),n=16&r;return{lookupType:t,lookupFlag:r,subtables:this.parseList(ge.pointer(e[t])),markFilteringSet:n?this.parseUShort():void 0}}))))||[]},ge.prototype.parseFeatureVariationsList=function(){return this.parsePointer32((function(){var e=this.parseUShort(),t=this.parseUShort();return F.argument(1===e&&t<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:ge.offset32,featureTableSubstitutionOffset:ge.offset32})}))||[]};var me={getByte:se,getCard8:se,getUShort:oe,getCard16:oe,getShort:ie,getULong:ue,getFixed:le,getTag:pe,getOffset:ce,getBytes:he,bytesToString:fe,Parser:ge};function ye(e,t){var r;t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong(),e.groupCount=r=t.parseULong(),e.glyphIndexMap={};for(var n=0;n<r;n+=1)for(var a=t.parseULong(),s=t.parseULong(),o=t.parseULong(),i=a;i<=s;i+=1)e.glyphIndexMap[i]=o,o++}function be(e,t,r,n,a){var s;e.length=t.parseUShort(),e.language=t.parseUShort(),e.segCount=s=t.parseUShort()>>1,t.skip("uShort",3),e.glyphIndexMap={};for(var o=new me.Parser(r,n+a+14),i=new me.Parser(r,n+a+16+2*s),u=new me.Parser(r,n+a+16+4*s),l=new me.Parser(r,n+a+16+6*s),p=n+a+16+8*s,c=0;c<s-1;c+=1)for(var h=void 0,f=o.parseUShort(),d=i.parseUShort(),g=u.parseShort(),v=l.parseUShort(),m=d;m<=f;m+=1)0!==v?(p=l.offset+l.relativeOffset-2,p+=v,p+=2*(m-d),0!==(h=me.getUShort(r,p))&&(h=h+g&65535)):h=m+g&65535,e.glyphIndexMap[m]=h}function Se(e,t){var r={};r.version=me.getUShort(e,t),F.argument(0===r.version,"cmap table version should be 0."),r.numTables=me.getUShort(e,t+2);for(var n=-1,a=r.numTables-1;a>=0;a-=1){var s=me.getUShort(e,t+4+8*a),o=me.getUShort(e,t+4+8*a+2);if(3===s&&(0===o||1===o||10===o)||0===s&&(0===o||1===o||2===o||3===o||4===o)){n=me.getULong(e,t+4+8*a+4);break}}if(-1===n)throw new Error("No valid cmap sub-tables found.");var i=new me.Parser(e,t+n);if(r.format=i.parseUShort(),12===r.format)ye(r,i);else{if(4!==r.format)throw new Error("Only format 4 and 12 cmap tables are supported (found format "+r.format+").");be(r,i,e,t,n)}return r}function xe(e,t,r){e.segments.push({end:t,start:t,delta:-(t-r),offset:0,glyphIndex:r})}function Te(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}function Ue(e){var t,r=!0;for(t=e.length-1;t>0;t-=1)if(e.get(t).unicode>65535){console.log("Adding CMAP format 12 (needed!)"),r=!1;break}var n=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:r?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:r?12:20}];r||(n=n.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),n=n.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 ae.Table("cmap",n);for(a.segments=[],t=0;t<e.length;t+=1){for(var s=e.get(t),o=0;o<s.unicodes.length;o+=1)xe(a,s.unicodes[o],t);a.segments=a.segments.sort((function(e,t){return e.start-t.start}))}Te(a);var i=a.segments.length,u=0,l=[],p=[],c=[],h=[],f=[],d=[];for(t=0;t<i;t+=1){var g=a.segments[t];g.end<=65535&&g.start<=65535?(l=l.concat({name:"end_"+t,type:"USHORT",value:g.end}),p=p.concat({name:"start_"+t,type:"USHORT",value:g.start}),c=c.concat({name:"idDelta_"+t,type:"SHORT",value:g.delta}),h=h.concat({name:"idRangeOffset_"+t,type:"USHORT",value:g.offset}),void 0!==g.glyphId&&(f=f.concat({name:"glyph_"+t,type:"USHORT",value:g.glyphId}))):u+=1,r||void 0===g.glyphIndex||(d=(d=(d=d.concat({name:"cmap12Start_"+t,type:"ULONG",value:g.start})).concat({name:"cmap12End_"+t,type:"ULONG",value:g.end})).concat({name:"cmap12Glyph_"+t,type:"ULONG",value:g.glyphIndex}))}if(a.segCountX2=2*(i-u),a.searchRange=2*Math.pow(2,Math.floor(Math.log(i-u)/Math.log(2))),a.entrySelector=Math.log(a.searchRange/2)/Math.log(2),a.rangeShift=a.segCountX2-a.searchRange,a.fields=a.fields.concat(l),a.fields.push({name:"reservedPad",type:"USHORT",value:0}),a.fields=a.fields.concat(p),a.fields=a.fields.concat(c),a.fields=a.fields.concat(h),a.fields=a.fields.concat(f),a.cmap4Length=14+2*l.length+2+2*p.length+2*c.length+2*h.length+2*f.length,!r){var v=16+4*d.length;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:v},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:d.length/3}]),a.fields=a.fields.concat(d)}return a}var ke={parse:Se,make:Ue},Ee=[".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"],Oe=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],we=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],Re=[".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 Le(e){this.font=e}function Ce(e){this.cmap=e}function De(e,t){this.encoding=e,this.charset=t}function Ie(e){switch(e.version){case 1:this.names=Re.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(var t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<Re.length?this.names[t]=Re[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-Re.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(var r=0;r<e.numberOfGlyphs;r++)this.names[r]=Re[r+e.glyphNameIndex[r]];break;default:this.names=[]}}function Be(e){for(var t,r=e.tables.cmap.glyphIndexMap,n=Object.keys(r),a=0;a<n.length;a+=1){var s=n[a],o=r[s];(t=e.glyphs.get(o)).addUnicode(parseInt(s))}for(var i=0;i<e.glyphs.length;i+=1)t=e.glyphs.get(i),e.cffEncoding?e.isCIDFont?t.name="gid"+i:t.name=e.cffEncoding.charset[i]:e.glyphNames.names&&(t.name=e.glyphNames.glyphIndexToName(i))}function Fe(e){e._IndexToUnicodeMap={};for(var t=e.tables.cmap.glyphIndexMap,r=Object.keys(t),n=0;n<r.length;n+=1){var a=r[n],s=t[a];void 0===e._IndexToUnicodeMap[s]?e._IndexToUnicodeMap[s]={unicodes:[parseInt(a)]}:e._IndexToUnicodeMap[s].unicodes.push(parseInt(a))}}function Ge(e,t){t.lowMemory?Fe(e):Be(e)}function Me(e,t,r,n,a){e.beginPath(),e.moveTo(t,r),e.lineTo(n,a),e.stroke()}Le.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),r=this.font.glyphs;if(r)for(var n=0;n<r.length;n+=1)for(var a=r.get(n),s=0;s<a.unicodes.length;s+=1)if(a.unicodes[s]===t)return n;return null},Ce.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0},De.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),r=this.encoding[t];return this.charset.indexOf(r)},Ie.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},Ie.prototype.glyphIndexToName=function(e){return this.names[e]};var Ne={line:Me};function Ae(e,t){var r=t||new D;return{configurable:!0,get:function(){return"function"==typeof r&&(r=r()),r},set:function(e){r=e}}}function Pe(e){this.bindConstructorValues(e)}function _e(e,t,r){Object.defineProperty(e,t,{get:function(){return e.path,e[r]},set:function(t){e[r]=t},enumerable:!0,configurable:!0})}function He(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(var r=0;r<t.length;r++){var n=t[r];n.path.unitsPerEm=e.unitsPerEm,this.glyphs[r]=n}this.length=t&&t.length||0}function ze(e,t){return new Pe({index:t,font:e})}function We(e,t,r,n,a,s){return function(){var o=new Pe({index:t,font:e});return o.path=function(){r(o,n,a);var t=s(e.glyphs,o);return t.unitsPerEm=e.unitsPerEm,t},_e(o,"xMin","_xMin"),_e(o,"xMax","_xMax"),_e(o,"yMin","_yMin"),_e(o,"yMax","_yMax"),o}}function Ve(e,t,r,n){return function(){var a=new Pe({index:t,font:e});return a.path=function(){var t=r(e,a,n);return t.unitsPerEm=e.unitsPerEm,t},a}}Pe.prototype.bindConstructorValues=function(e){this.index=e.index||0,this.name=e.name||null,this.unicode=e.unicode||void 0,this.unicodes=e.unicodes||void 0!==e.unicode?[e.unicode]:[],"xMin"in e&&(this.xMin=e.xMin),"yMin"in e&&(this.yMin=e.yMin),"xMax"in e&&(this.xMax=e.xMax),"yMax"in e&&(this.yMax=e.yMax),"advanceWidth"in e&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",Ae(this,e.path))},Pe.prototype.addUnicode=function(e){0===this.unicodes.length&&(this.unicode=e),this.unicodes.push(e)},Pe.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},Pe.prototype.getPath=function(e,t,r,n,a){var s,o;e=void 0!==e?e:0,t=void 0!==t?t:0,r=void 0!==r?r:72,n||(n={});var i=n.xScale,u=n.yScale;if(n.hinting&&a&&a.hinting&&(o=this.path&&a.hinting.exec(this,r)),o)s=a.hinting.getCommands(o),e=Math.round(e),t=Math.round(t),i=u=1;else{s=this.path.commands;var l=1/(this.path.unitsPerEm||1e3)*r;void 0===i&&(i=l),void 0===u&&(u=l)}for(var p=new D,c=0;c<s.length;c+=1){var h=s[c];"M"===h.type?p.moveTo(e+h.x*i,t+-h.y*u):"L"===h.type?p.lineTo(e+h.x*i,t+-h.y*u):"Q"===h.type?p.quadraticCurveTo(e+h.x1*i,t+-h.y1*u,e+h.x*i,t+-h.y*u):"C"===h.type?p.curveTo(e+h.x1*i,t+-h.y1*u,e+h.x2*i,t+-h.y2*u,e+h.x*i,t+-h.y*u):"Z"===h.type&&p.closePath()}return p},Pe.prototype.getContours=function(){if(void 0===this.points)return[];for(var e=[],t=[],r=0;r<this.points.length;r+=1){var n=this.points[r];t.push(n),n.lastPointOfContour&&(e.push(t),t=[])}return F.argument(0===t.length,"There are still points left in the current contour."),e},Pe.prototype.getMetrics=function(){for(var e=this.path.commands,t=[],r=[],n=0;n<e.length;n+=1){var a=e[n];"Z"!==a.type&&(t.push(a.x),r.push(a.y)),"Q"!==a.type&&"C"!==a.type||(t.push(a.x1),r.push(a.y1)),"C"===a.type&&(t.push(a.x2),r.push(a.y2))}var s={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,r),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,r),leftSideBearing:this.leftSideBearing};return isFinite(s.xMin)||(s.xMin=0),isFinite(s.xMax)||(s.xMax=this.advanceWidth),isFinite(s.yMin)||(s.yMin=0),isFinite(s.yMax)||(s.yMax=0),s.rightSideBearing=this.advanceWidth-s.leftSideBearing-(s.xMax-s.xMin),s},Pe.prototype.draw=function(e,t,r,n,a){this.getPath(t,r,n,a).draw(e)},Pe.prototype.drawPoints=function(e,t,r,n){function a(t,r,n,a){e.beginPath();for(var s=0;s<t.length;s+=1)e.moveTo(r+t[s].x*a,n+t[s].y*a),e.arc(r+t[s].x*a,n+t[s].y*a,2,0,2*Math.PI,!1);e.closePath(),e.fill()}t=void 0!==t?t:0,r=void 0!==r?r:0,n=void 0!==n?n:24;for(var s=1/this.path.unitsPerEm*n,o=[],i=[],u=this.path,l=0;l<u.commands.length;l+=1){var p=u.commands[l];void 0!==p.x&&o.push({x:p.x,y:-p.y}),void 0!==p.x1&&i.push({x:p.x1,y:-p.y1}),void 0!==p.x2&&i.push({x:p.x2,y:-p.y2})}e.fillStyle="blue",a(o,t,r,s),e.fillStyle="red",a(i,t,r,s)},Pe.prototype.drawMetrics=function(e,t,r,n){var a;t=void 0!==t?t:0,r=void 0!==r?r:0,n=void 0!==n?n:24,a=1/this.path.unitsPerEm*n,e.lineWidth=1,e.strokeStyle="black",Ne.line(e,t,-1e4,t,1e4),Ne.line(e,-1e4,r,1e4,r);var s=this.xMin||0,o=this.yMin||0,i=this.xMax||0,u=this.yMax||0,l=this.advanceWidth||0;e.strokeStyle="blue",Ne.line(e,t+s*a,-1e4,t+s*a,1e4),Ne.line(e,t+i*a,-1e4,t+i*a,1e4),Ne.line(e,-1e4,r+-o*a,1e4,r+-o*a),Ne.line(e,-1e4,r+-u*a,1e4,r+-u*a),e.strokeStyle="green",Ne.line(e,t+l*a,-1e4,t+l*a,1e4)},He.prototype.get=function(e){if(void 0===this.glyphs[e]){this.font._push(e),"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]());var t=this.glyphs[e],r=this.font._IndexToUnicodeMap[e];if(r)for(var n=0;n<r.unicodes.length;n++)t.addUnicode(r.unicodes[n]);this.font.cffEncoding?this.font.isCIDFont?t.name="gid"+e:t.name=this.font.cffEncoding.charset[e]:this.font.glyphNames.names&&(t.name=this.font.glyphNames.glyphIndexToName(e)),this.glyphs[e].advanceWidth=this.font._hmtxTableData[e].advanceWidth,this.glyphs[e].leftSideBearing=this.font._hmtxTableData[e].leftSideBearing}else"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]());return this.glyphs[e]},He.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};var qe={GlyphSet:He,glyphLoader:ze,ttfGlyphLoader:We,cffGlyphLoader:Ve};function Xe(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r+=1)if(!Xe(e[r],t[r]))return!1;return!0}return!1}function je(e){return e.length<1240?107:e.length<33900?1131:32768}function Ye(e,t,r){var n,a,s=[],o=[],i=me.getCard16(e,t);if(0!==i){var u=me.getByte(e,t+2);n=t+(i+1)*u+2;for(var l=t+3,p=0;p<i+1;p+=1)s.push(me.getOffset(e,l,u)),l+=u;a=n+s[i]}else a=t+2;for(var c=0;c<s.length-1;c+=1){var h=me.getBytes(e,n+s[c],n+s[c+1]);r&&(h=r(h)),o.push(h)}return{objects:o,startOffset:t,endOffset:a}}function Ze(e,t){var r,n,a=[],s=me.getCard16(e,t);if(0!==s){var o=me.getByte(e,t+2);r=t+(s+1)*o+2;for(var i=t+3,u=0;u<s+1;u+=1)a.push(me.getOffset(e,i,o)),i+=o;n=r+a[s]}else n=t+2;return{offsets:a,startOffset:t,endOffset:n}}function Qe(e,t,r,n,a){var s=me.getCard16(r,n),o=0;0!==s&&(o=n+(s+1)*me.getByte(r,n+2)+2);var i=me.getBytes(r,o+t[e],o+t[e+1]);return a&&(i=a(i)),i}function Ke(e){for(var t="",r=15,n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var a=e.parseByte(),s=a>>4,o=15&a;if(s===r)break;if(t+=n[s],o===r)break;t+=n[o]}return parseFloat(t)}function Je(e,t){if(28===t)return e.parseByte()<<8|e.parseByte();if(29===t)return e.parseByte()<<24|e.parseByte()<<16|e.parseByte()<<8|e.parseByte();if(30===t)return Ke(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return 256*(t-247)+e.parseByte()+108;if(t>=251&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function $e(e){for(var t={},r=0;r<e.length;r+=1){var n=e[r][0],a=e[r][1],s=void 0;if(s=1===a.length?a[0]:a,t.hasOwnProperty(n)&&!isNaN(t[n]))throw new Error("Object "+t+" already has key "+n);t[n]=s}return t}function et(e,t,r){t=void 0!==t?t:0;var n=new me.Parser(e,t),a=[],s=[];for(r=void 0!==r?r:e.length;n.relativeOffset<r;){var o=n.parseByte();o<=21?(12===o&&(o=1200+n.parseByte()),a.push([o,s]),s=[]):s.push(Je(n,o))}return $e(a)}function tt(e,t){return t=t<=390?Ee[t]:e[t-391]}function rt(e,t,r){for(var n,a={},s=0;s<t.length;s+=1){var o=t[s];if(Array.isArray(o.type)){var i=[];i.length=o.type.length;for(var u=0;u<o.type.length;u++)void 0===(n=void 0!==e[o.op]?e[o.op][u]:void 0)&&(n=void 0!==o.value&&void 0!==o.value[u]?o.value[u]:null),"SID"===o.type[u]&&(n=tt(r,n)),i[u]=n;a[o.name]=i}else void 0===(n=e[o.op])&&(n=void 0!==o.value?o.value:null),"SID"===o.type&&(n=tt(r,n)),a[o.name]=n}return a}function nt(e,t){var r={};return r.formatMajor=me.getCard8(e,t),r.formatMinor=me.getCard8(e,t+1),r.size=me.getCard8(e,t+2),r.offsetSize=me.getCard8(e,t+3),r.startOffset=t,r.endOffset=t+4,r}var at=[{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"}],st=[{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 ot(e,t){return rt(et(e,0,e.byteLength),at,t)}function it(e,t,r,n){return rt(et(e,t,r),st,n)}function ut(e,t,r,n){for(var a=[],s=0;s<r.length;s+=1){var o=ot(new DataView(new Uint8Array(r[s]).buffer),n);o._subrs=[],o._subrsBias=0,o._defaultWidthX=0,o._nominalWidthX=0;var i=o.private[0],u=o.private[1];if(0!==i&&0!==u){var l=it(e,u+t,i,n);if(o._defaultWidthX=l.defaultWidthX,o._nominalWidthX=l.nominalWidthX,0!==l.subrs){var p=Ye(e,u+l.subrs+t);o._subrs=p.objects,o._subrsBias=je(o._subrs)}o._privateDict=l}a.push(o)}return a}function lt(e,t,r,n){var a,s,o=new me.Parser(e,t);r-=1;var i=[".notdef"],u=o.parseCard8();if(0===u)for(var l=0;l<r;l+=1)a=o.parseSID(),i.push(tt(n,a));else if(1===u)for(;i.length<=r;){a=o.parseSID(),s=o.parseCard8();for(var p=0;p<=s;p+=1)i.push(tt(n,a)),a+=1}else{if(2!==u)throw new Error("Unknown charset format "+u);for(;i.length<=r;){a=o.parseSID(),s=o.parseCard16();for(var c=0;c<=s;c+=1)i.push(tt(n,a)),a+=1}}return i}function pt(e,t,r){var n,a={},s=new me.Parser(e,t),o=s.parseCard8();if(0===o)for(var i=s.parseCard8(),u=0;u<i;u+=1)a[n=s.parseCard8()]=u;else{if(1!==o)throw new Error("Unknown encoding format "+o);var l=s.parseCard8();n=1;for(var p=0;p<l;p+=1)for(var c=s.parseCard8(),h=s.parseCard8(),f=c;f<=c+h;f+=1)a[f]=n,n+=1}return new De(a,r)}function ct(e,t,r){var n,a,s,o,i,u,l,p,c=new D,h=[],f=0,d=!1,g=!1,v=0,m=0;if(e.isCIDFont){var y=e.tables.cff.topDict._fdSelect[t.index],b=e.tables.cff.topDict._fdArray[y];i=b._subrs,u=b._subrsBias,l=b._defaultWidthX,p=b._nominalWidthX}else i=e.tables.cff.topDict._subrs,u=e.tables.cff.topDict._subrsBias,l=e.tables.cff.topDict._defaultWidthX,p=e.tables.cff.topDict._nominalWidthX;var S=l;function x(e,t){g&&c.closePath(),c.moveTo(e,t),g=!0}function T(){h.length%2!=0&&!d&&(S=h.shift()+p),f+=h.length>>1,h.length=0,d=!0}function U(r){for(var l,y,b,k,E,O,w,R,L,C,D,I,B=0;B<r.length;){var F=r[B];switch(B+=1,F){case 1:case 3:case 18:case 23:T();break;case 4:h.length>1&&!d&&(S=h.shift()+p,d=!0),m+=h.pop(),x(v,m);break;case 5:for(;h.length>0;)v+=h.shift(),m+=h.shift(),c.lineTo(v,m);break;case 6:for(;h.length>0&&(v+=h.shift(),c.lineTo(v,m),0!==h.length);)m+=h.shift(),c.lineTo(v,m);break;case 7:for(;h.length>0&&(m+=h.shift(),c.lineTo(v,m),0!==h.length);)v+=h.shift(),c.lineTo(v,m);break;case 8:for(;h.length>0;)n=v+h.shift(),a=m+h.shift(),s=n+h.shift(),o=a+h.shift(),v=s+h.shift(),m=o+h.shift(),c.curveTo(n,a,s,o,v,m);break;case 10:E=h.pop()+u,(O=i[E])&&U(O);break;case 11:return;case 12:switch(F=r[B],B+=1,F){case 35:n=v+h.shift(),a=m+h.shift(),s=n+h.shift(),o=a+h.shift(),w=s+h.shift(),R=o+h.shift(),L=w+h.shift(),C=R+h.shift(),D=L+h.shift(),I=C+h.shift(),v=D+h.shift(),m=I+h.shift(),h.shift(),c.curveTo(n,a,s,o,w,R),c.curveTo(L,C,D,I,v,m);break;case 34:n=v+h.shift(),a=m,s=n+h.shift(),o=a+h.shift(),w=s+h.shift(),R=o,L=w+h.shift(),C=o,D=L+h.shift(),I=m,v=D+h.shift(),c.curveTo(n,a,s,o,w,R),c.curveTo(L,C,D,I,v,m);break;case 36:n=v+h.shift(),a=m+h.shift(),s=n+h.shift(),o=a+h.shift(),w=s+h.shift(),R=o,L=w+h.shift(),C=o,D=L+h.shift(),I=C+h.shift(),v=D+h.shift(),c.curveTo(n,a,s,o,w,R),c.curveTo(L,C,D,I,v,m);break;case 37:n=v+h.shift(),a=m+h.shift(),s=n+h.shift(),o=a+h.shift(),w=s+h.shift(),R=o+h.shift(),L=w+h.shift(),C=R+h.shift(),D=L+h.shift(),I=C+h.shift(),Math.abs(D-v)>Math.abs(I-m)?v=D+h.shift():m=I+h.shift(),c.curveTo(n,a,s,o,w,R),c.curveTo(L,C,D,I,v,m);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+F),h.length=0}break;case 14:h.length>0&&!d&&(S=h.shift()+p,d=!0),g&&(c.closePath(),g=!1);break;case 19:case 20:T(),B+=f+7>>3;break;case 21:h.length>2&&!d&&(S=h.shift()+p,d=!0),m+=h.pop(),x(v+=h.pop(),m);break;case 22:h.length>1&&!d&&(S=h.shift()+p,d=!0),x(v+=h.pop(),m);break;case 24:for(;h.length>2;)n=v+h.shift(),a=m+h.shift(),s=n+h.shift(),o=a+h.shift(),v=s+h.shift(),m=o+h.shift(),c.curveTo(n,a,s,o,v,m);v+=h.shift(),m+=h.shift(),c.lineTo(v,m);break;case 25:for(;h.length>6;)v+=h.shift(),m+=h.shift(),c.lineTo(v,m);n=v+h.shift(),a=m+h.shift(),s=n+h.shift(),o=a+h.shift(),v=s+h.shift(),m=o+h.shift(),c.curveTo(n,a,s,o,v,m);break;case 26:for(h.length%2&&(v+=h.shift());h.length>0;)n=v,a=m+h.shift(),s=n+h.shift(),o=a+h.shift(),v=s,m=o+h.shift(),c.curveTo(n,a,s,o,v,m);break;case 27:for(h.length%2&&(m+=h.shift());h.length>0;)n=v+h.shift(),a=m,s=n+h.shift(),o=a+h.shift(),v=s+h.shift(),m=o,c.curveTo(n,a,s,o,v,m);break;case 28:l=r[B],y=r[B+1],h.push((l<<24|y<<16)>>16),B+=2;break;case 29:E=h.pop()+e.gsubrsBias,(O=e.gsubrs[E])&&U(O);break;case 30:for(;h.length>0&&(n=v,a=m+h.shift(),s=n+h.shift(),o=a+h.shift(),v=s+h.shift(),m=o+(1===h.length?h.shift():0),c.curveTo(n,a,s,o,v,m),0!==h.length);)n=v+h.shift(),a=m,s=n+h.shift(),o=a+h.shift(),m=o+h.shift(),v=s+(1===h.length?h.shift():0),c.curveTo(n,a,s,o,v,m);break;case 31:for(;h.length>0&&(n=v+h.shift(),a=m,s=n+h.shift(),o=a+h.shift(),m=o+h.shift(),v=s+(1===h.length?h.shift():0),c.curveTo(n,a,s,o,v,m),0!==h.length);)n=v,a=m+h.shift(),s=n+h.shift(),o=a+h.shift(),v=s+h.shift(),m=o+(1===h.length?h.shift():0),c.curveTo(n,a,s,o,v,m);break;default:F<32?console.log("Glyph "+t.index+": unknown operator "+F):F<247?h.push(F-139):F<251?(l=r[B],B+=1,h.push(256*(F-247)+l+108)):F<255?(l=r[B],B+=1,h.push(256*-(F-251)-l-108)):(l=r[B],y=r[B+1],b=r[B+2],k=r[B+3],B+=4,h.push((l<<24|y<<16|b<<8|k)/65536))}}}return U(r),t.advanceWidth=S,c}function ht(e,t,r,n){var a,s=[],o=new me.Parser(e,t),i=o.parseCard8();if(0===i)for(var u=0;u<r;u++){if((a=o.parseCard8())>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+n+")");s.push(a)}else{if(3!==i)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+i);var l,p=o.parseCard16(),c=o.parseCard16();if(0!==c)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+c);for(var h=0;h<p;h++){if(a=o.parseCard8(),l=o.parseCard16(),a>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+n+")");if(l>r)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+l);for(;c<l;c++)s.push(a);c=l}if(l!==r)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+l)}return s}function ft(e,t,r,n){r.tables.cff={};var a=nt(e,t),s=Ye(e,a.endOffset,me.bytesToString),o=Ye(e,s.endOffset),i=Ye(e,o.endOffset,me.bytesToString),u=Ye(e,i.endOffset);r.gsubrs=u.objects,r.gsubrsBias=je(r.gsubrs);var l=ut(e,t,o.objects,i.objects);if(1!==l.length)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+l.length);var p=l[0];if(r.tables.cff.topDict=p,p._privateDict&&(r.defaultWidthX=p._privateDict.defaultWidthX,r.nominalWidthX=p._privateDict.nominalWidthX),void 0!==p.ros[0]&&void 0!==p.ros[1]&&(r.isCIDFont=!0),r.isCIDFont){var c=p.fdArray,h=p.fdSelect;if(0===c||0===h)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");var f=Ye(e,c+=t),d=ut(e,t,f.objects,i.objects);p._fdArray=d,h+=t,p._fdSelect=ht(e,h,r.numGlyphs,d.length)}var g,v=t+p.private[1],m=it(e,v,p.private[0],i.objects);if(r.defaultWidthX=m.defaultWidthX,r.nominalWidthX=m.nominalWidthX,0!==m.subrs){var y=v+m.subrs,b=Ye(e,y);r.subrs=b.objects,r.subrsBias=je(r.subrs)}else r.subrs=[],r.subrsBias=0;n.lowMemory?(g=Ze(e,t+p.charStrings),r.nGlyphs=g.offsets.length):(g=Ye(e,t+p.charStrings),r.nGlyphs=g.objects.length);var S=lt(e,t+p.charset,r.nGlyphs,i.objects);if(0===p.encoding?r.cffEncoding=new De(Oe,S):1===p.encoding?r.cffEncoding=new De(we,S):r.cffEncoding=pt(e,t+p.encoding,S),r.encoding=r.encoding||r.cffEncoding,r.glyphs=new qe.GlyphSet(r),n.lowMemory)r._push=function(n){var a=Qe(n,g.offsets,e,t+p.charStrings);r.glyphs.push(n,qe.cffGlyphLoader(r,n,ct,a))};else for(var x=0;x<r.nGlyphs;x+=1){var T=g.objects[x];r.glyphs.push(x,qe.cffGlyphLoader(r,x,ct,T))}}function dt(e,t){var r,n=Ee.indexOf(e);return n>=0&&(r=n),(n=t.indexOf(e))>=0?r=n+Ee.length:(r=Ee.length+t.length,t.push(e)),r}function gt(){return new ae.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 vt(e){var t=new ae.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);t.names=[];for(var r=0;r<e.length;r+=1)t.names.push({name:"name_"+r,type:"NAME",value:e[r]});return t}function mt(e,t,r){for(var n={},a=0;a<e.length;a+=1){var s=e[a],o=t[s.name];void 0===o||Xe(o,s.value)||("SID"===s.type&&(o=dt(o,r)),n[s.op]={name:s.name,type:s.type,value:o})}return n}function yt(e,t){var r=new ae.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return r.dict=mt(at,e,t),r}function bt(e){var t=new ae.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}function St(e){var t=new ae.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);t.strings=[];for(var r=0;r<e.length;r+=1)t.strings.push({name:"string_"+r,type:"STRING",value:e[r]});return t}function xt(){return new ae.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function Tt(e,t){for(var r=new ae.Record("Charsets",[{name:"format",type:"Card8",value:0}]),n=0;n<e.length;n+=1){var a=dt(e[n],t);r.fields.push({name:"glyph_"+n,type:"SID",value:a})}return r}function Ut(e){var t=[],r=e.path;t.push({name:"width",type:"NUMBER",value:e.advanceWidth});for(var n=0,a=0,s=0;s<r.commands.length;s+=1){var o=void 0,i=void 0,u=r.commands[s];if("Q"===u.type){var l=1/3,p=2/3;u={type:"C",x:u.x,y:u.y,x1:Math.round(l*n+p*u.x1),y1:Math.round(l*a+p*u.y1),x2:Math.round(l*u.x+p*u.x1),y2:Math.round(l*u.y+p*u.y1)}}if("M"===u.type)o=Math.round(u.x-n),i=Math.round(u.y-a),t.push({name:"dx",type:"NUMBER",value:o}),t.push({name:"dy",type:"NUMBER",value:i}),t.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(u.x),a=Math.round(u.y);else if("L"===u.type)o=Math.round(u.x-n),i=Math.round(u.y-a),t.push({name:"dx",type:"NUMBER",value:o}),t.push({name:"dy",type:"NUMBER",value:i}),t.push({name:"rlineto",type:"OP",value:5}),n=Math.round(u.x),a=Math.round(u.y);else if("C"===u.type){var c=Math.round(u.x1-n),h=Math.round(u.y1-a),f=Math.round(u.x2-u.x1),d=Math.round(u.y2-u.y1);o=Math.round(u.x-u.x2),i=Math.round(u.y-u.y2),t.push({name:"dx1",type:"NUMBER",value:c}),t.push({name:"dy1",type:"NUMBER",value:h}),t.push({name:"dx2",type:"NUMBER",value:f}),t.push({name:"dy2",type:"NUMBER",value:d}),t.push({name:"dx",type:"NUMBER",value:o}),t.push({name:"dy",type:"NUMBER",value:i}),t.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(u.x),a=Math.round(u.y)}}return t.push({name:"endchar",type:"OP",value:14}),t}function kt(e){for(var t=new ae.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),r=0;r<e.length;r+=1){var n=e.get(r),a=Ut(n);t.charStrings.push({name:n.name,type:"CHARSTRING",value:a})}return t}function Et(e,t){var r=new ae.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return r.dict=mt(st,e,t),r}function Ot(e,t){for(var r,n=new ae.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"}]),a=1/t.unitsPerEm,s={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[a,0,0,a,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},o={},i=[],u=1;u<e.length;u+=1)r=e.get(u),i.push(r.name);var l=[];n.header=gt(),n.nameIndex=vt([t.postScriptName]);var p=yt(s,l);n.topDictIndex=bt(p),n.globalSubrIndex=xt(),n.charsets=Tt(i,l),n.charStringsIndex=kt(e),n.privateDict=Et(o,l),n.stringIndex=St(l);var c=n.header.sizeOf()+n.nameIndex.sizeOf()+n.topDictIndex.sizeOf()+n.stringIndex.sizeOf()+n.globalSubrIndex.sizeOf();return s.charset=c,s.encoding=0,s.charStrings=s.charset+n.charsets.sizeOf(),s.private[1]=s.charStrings+n.charStringsIndex.sizeOf(),p=yt(s,l),n.topDictIndex=bt(p),n}var wt={parse:ft,make:Ot};function Rt(e,t){var r={},n=new me.Parser(e,t);return r.version=n.parseVersion(),r.fontRevision=Math.round(1e3*n.parseFixed())/1e3,r.checkSumAdjustment=n.parseULong(),r.magicNumber=n.parseULong(),F.argument(1594834165===r.magicNumber,"Font header has wrong magic number."),r.flags=n.parseUShort(),r.unitsPerEm=n.parseUShort(),r.created=n.parseLongDateTime(),r.modified=n.parseLongDateTime(),r.xMin=n.parseShort(),r.yMin=n.parseShort(),r.xMax=n.parseShort(),r.yMax=n.parseShort(),r.macStyle=n.parseUShort(),r.lowestRecPPEM=n.parseUShort(),r.fontDirectionHint=n.parseShort(),r.indexToLocFormat=n.parseShort(),r.glyphDataFormat=n.parseShort(),r}function Lt(e){var t=Math.round((new Date).getTime()/1e3)+2082844800,r=t;return e.createdTimestamp&&(r=e.createdTimestamp+2082844800),new ae.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:r},{name:"modified",type:"LONGDATETIME",value:t},{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}],e)}var Ct={parse:Rt,make:Lt};function Dt(e,t){var r={},n=new me.Parser(e,t);return r.version=n.parseVersion(),r.ascender=n.parseShort(),r.descender=n.parseShort(),r.lineGap=n.parseShort(),r.advanceWidthMax=n.parseUShort(),r.minLeftSideBearing=n.parseShort(),r.minRightSideBearing=n.parseShort(),r.xMaxExtent=n.parseShort(),r.caretSlopeRise=n.parseShort(),r.caretSlopeRun=n.parseShort(),r.caretOffset=n.parseShort(),n.relativeOffset+=8,r.metricDataFormat=n.parseShort(),r.numberOfHMetrics=n.parseUShort(),r}function It(e){return new ae.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}],e)}var Bt={parse:Dt,make:It};function Ft(e,t,r,n,a){for(var s,o,i=new me.Parser(e,t),u=0;u<n;u+=1){u<r&&(s=i.parseUShort(),o=i.parseShort());var l=a.get(u);l.advanceWidth=s,l.leftSideBearing=o}}function Gt(e,t,r,n,a){var s,o;e._hmtxTableData={};for(var i=new me.Parser(t,r),u=0;u<a;u+=1)u<n&&(s=i.parseUShort(),o=i.parseShort()),e._hmtxTableData[u]={advanceWidth:s,leftSideBearing:o}}function Mt(e,t,r,n,a,s,o){o.lowMemory?Gt(e,t,r,n,a):Ft(t,r,n,a,s)}function Nt(e){for(var t=new ae.Table("hmtx",[]),r=0;r<e.length;r+=1){var n=e.get(r),a=n.advanceWidth||0,s=n.leftSideBearing||0;t.fields.push({name:"advanceWidth_"+r,type:"USHORT",value:a}),t.fields.push({name:"leftSideBearing_"+r,type:"SHORT",value:s})}return t}var At={parse:Mt,make:Nt};function Pt(e){for(var t=new ae.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]),r="",n=12+4*e.length,a=0;a<e.length;++a){var s=r.indexOf(e[a]);s<0&&(s=r.length,r+=e[a]),t.fields.push({name:"offset "+a,type:"USHORT",value:n+s}),t.fields.push({name:"length "+a,type:"USHORT",value:e[a].length})}return t.fields.push({name:"stringPool",type:"CHARARRAY",value:r}),t}function _t(e,t){var r=new me.Parser(e,t),n=r.parseULong();F.argument(1===n,"Unsupported ltag table version."),r.skip("uLong",1);for(var a=r.parseULong(),s=[],o=0;o<a;o++){for(var i="",u=t+r.parseUShort(),l=r.parseUShort(),p=u;p<u+l;++p)i+=String.fromCharCode(e.getInt8(p));s.push(i)}return s}var Ht={make:Pt,parse:_t};function zt(e,t){var r={},n=new me.Parser(e,t);return r.version=n.parseVersion(),r.numGlyphs=n.parseUShort(),1===r.version&&(r.maxPoints=n.parseUShort(),r.maxContours=n.parseUShort(),r.maxCompositePoints=n.parseUShort(),r.maxCompositeContours=n.parseUShort(),r.maxZones=n.parseUShort(),r.maxTwilightPoints=n.parseUShort(),r.maxStorage=n.parseUShort(),r.maxFunctionDefs=n.parseUShort(),r.maxInstructionDefs=n.parseUShort(),r.maxStackElements=n.parseUShort(),r.maxSizeOfInstructions=n.parseUShort(),r.maxComponentElements=n.parseUShort(),r.maxComponentDepth=n.parseUShort()),r}function Wt(e){return new ae.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])}var Vt={parse:zt,make:Wt},qt=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],Xt={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"},jt={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},Yt={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 Zt(e,t,r){switch(e){case 0:if(65535===t)return"und";if(r)return r[t];break;case 1:return Xt[t];case 3:return Yt[t]}}var Qt="utf-16",Kt={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"},Jt={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 $t(e,t,r){switch(e){case 0:return Qt;case 1:return Jt[r]||Kt[t];case 3:if(1===t||10===t)return Qt}}function er(e,t,r){for(var n={},a=new me.Parser(e,t),s=a.parseUShort(),o=a.parseUShort(),i=a.offset+a.parseUShort(),u=0;u<o;u++){var l=a.parseUShort(),p=a.parseUShort(),c=a.parseUShort(),h=a.parseUShort(),f=qt[h]||h,d=a.parseUShort(),g=a.parseUShort(),v=Zt(l,c,r),m=$t(l,p,c);if(void 0!==m&&void 0!==v){var y=void 0;if(y=m===Qt?N.UTF16(e,i+g,d):N.MACSTRING(e,i+g,d,m)){var b=n[f];void 0===b&&(b=n[f]={}),b[v]=y}}}return 1===s&&a.parseUShort(),n}function tr(e){var t={};for(var r in e)t[e[r]]=parseInt(r);return t}function rr(e,t,r,n,a,s){return new ae.Record("NameRecord",[{name:"platformID",type:"USHORT",value:e},{name:"encodingID",type:"USHORT",value:t},{name:"languageID",type:"USHORT",value:r},{name:"nameID",type:"USHORT",value:n},{name:"length",type:"USHORT",value:a},{name:"offset",type:"USHORT",value:s}])}function nr(e,t){var r=e.length,n=t.length-r+1;e:for(var a=0;a<n;a++)for(;a<n;a++){for(var s=0;s<r;s++)if(t[a+s]!==e[s])continue e;return a}return-1}function ar(e,t){var r=nr(e,t);if(r<0){r=t.length;for(var n=0,a=e.length;n<a;++n)t.push(e[n])}return r}function sr(e,t){var r,n=[],a={},s=tr(qt);for(var o in e){var i=s[o];if(void 0===i&&(i=o),r=parseInt(i),isNaN(r))throw new Error('Name table entry "'+o+'" does not exist, see nameTableNames for complete list.');a[r]=e[o],n.push(r)}for(var u=tr(Xt),l=tr(Yt),p=[],c=[],h=0;h<n.length;h++){var f=a[r=n[h]];for(var d in f){var g=f[d],v=1,m=u[d],y=jt[m],b=$t(v,y,m),S=A.MACSTRING(g,b);void 0===S&&(v=0,(m=t.indexOf(d))<0&&(m=t.length,t.push(d)),y=4,S=A.UTF16(g));var x=ar(S,c);p.push(rr(v,y,m,r,S.length,x));var T=l[d];if(void 0!==T){var U=A.UTF16(g),k=ar(U,c);p.push(rr(3,1,T,r,U.length,k))}}}p.sort((function(e,t){return e.platformID-t.platformID||e.encodingID-t.encodingID||e.languageID-t.languageID||e.nameID-t.nameID}));for(var E=new ae.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:p.length},{name:"stringOffset",type:"USHORT",value:6+12*p.length}]),O=0;O<p.length;O++)E.fields.push({name:"record_"+O,type:"RECORD",value:p[O]});return E.fields.push({name:"strings",type:"LITERAL",value:c}),E}var or={parse:er,make:sr},ir=[{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 ur(e){for(var t=0;t<ir.length;t+=1){var r=ir[t];if(e>=r.begin&&e<r.end)return t}return-1}function lr(e,t){var r={},n=new me.Parser(e,t);r.version=n.parseUShort(),r.xAvgCharWidth=n.parseShort(),r.usWeightClass=n.parseUShort(),r.usWidthClass=n.parseUShort(),r.fsType=n.parseUShort(),r.ySubscriptXSize=n.parseShort(),r.ySubscriptYSize=n.parseShort(),r.ySubscriptXOffset=n.parseShort(),r.ySubscriptYOffset=n.parseShort(),r.ySuperscriptXSize=n.parseShort(),r.ySuperscriptYSize=n.parseShort(),r.ySuperscriptXOffset=n.parseShort(),r.ySuperscriptYOffset=n.parseShort(),r.yStrikeoutSize=n.parseShort(),r.yStrikeoutPosition=n.parseShort(),r.sFamilyClass=n.parseShort(),r.panose=[];for(var a=0;a<10;a++)r.panose[a]=n.parseByte();return r.ulUnicodeRange1=n.parseULong(),r.ulUnicodeRange2=n.parseULong(),r.ulUnicodeRange3=n.parseULong(),r.ulUnicodeRange4=n.parseULong(),r.achVendID=String.fromCharCode(n.parseByte(),n.parseByte(),n.parseByte(),n.parseByte()),r.fsSelection=n.parseUShort(),r.usFirstCharIndex=n.parseUShort(),r.usLastCharIndex=n.parseUShort(),r.sTypoAscender=n.parseShort(),r.sTypoDescender=n.parseShort(),r.sTypoLineGap=n.parseShort(),r.usWinAscent=n.parseUShort(),r.usWinDescent=n.parseUShort(),r.version>=1&&(r.ulCodePageRange1=n.parseULong(),r.ulCodePageRange2=n.parseULong()),r.version>=2&&(r.sxHeight=n.parseShort(),r.sCapHeight=n.parseShort(),r.usDefaultChar=n.parseUShort(),r.usBreakChar=n.parseUShort(),r.usMaxContent=n.parseUShort()),r}function pr(e){return new ae.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}],e)}var cr={parse:lr,make:pr,unicodeRanges:ir,getUnicodeRange:ur};function hr(e,t){var r={},n=new me.Parser(e,t);switch(r.version=n.parseVersion(),r.italicAngle=n.parseFixed(),r.underlinePosition=n.parseShort(),r.underlineThickness=n.parseShort(),r.isFixedPitch=n.parseULong(),r.minMemType42=n.parseULong(),r.maxMemType42=n.parseULong(),r.minMemType1=n.parseULong(),r.maxMemType1=n.parseULong(),r.version){case 1:r.names=Re.slice();break;case 2:r.numberOfGlyphs=n.parseUShort(),r.glyphNameIndex=new Array(r.numberOfGlyphs);for(var a=0;a<r.numberOfGlyphs;a++)r.glyphNameIndex[a]=n.parseUShort();r.names=[];for(var s=0;s<r.numberOfGlyphs;s++)if(r.glyphNameIndex[s]>=Re.length){var o=n.parseChar();r.names.push(n.parseString(o))}break;case 2.5:r.numberOfGlyphs=n.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var i=0;i<r.numberOfGlyphs;i++)r.offset[i]=n.parseChar()}return r}function fr(){return new ae.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 dr={parse:hr,make:fr},gr=new Array(9);gr[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(ge.coverage),deltaGlyphId:this.parseUShort()}:2===t?{substFormat:2,coverage:this.parsePointer(ge.coverage),substitute:this.parseOffset16List()}:void F.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")},gr[2]=function(){var e=this.parseUShort();return F.argument(1===e,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(ge.coverage),sequences:this.parseListOfLists()}},gr[3]=function(){var e=this.parseUShort();return F.argument(1===e,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(ge.coverage),alternateSets:this.parseListOfLists()}},gr[4]=function(){var e=this.parseUShort();return F.argument(1===e,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(ge.coverage),ligatureSets:this.parseListOfLists((function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}}))}};var vr={sequenceIndex:ge.uShort,lookupListIndex:ge.uShort};function mr(e,t){var r=new ge(e,t=t||0),n=r.parseVersion(1);return F.argument(1===n||1.1===n,"Unsupported GSUB table version."),1===n?{version:n,scripts:r.parseScriptList(),features:r.parseFeatureList(),lookups:r.parseLookupList(gr)}:{version:n,scripts:r.parseScriptList(),features:r.parseFeatureList(),lookups:r.parseLookupList(gr),variations:r.parseFeatureVariationsList()}}gr[5]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{substFormat:t,coverage:this.parsePointer(ge.coverage),ruleSets:this.parseListOfLists((function(){var e=this.parseUShort(),t=this.parseUShort();return{input:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,vr)}}))};if(2===t)return{substFormat:t,coverage:this.parsePointer(ge.coverage),classDef:this.parsePointer(ge.classDef),classSets:this.parseListOfLists((function(){var e=this.parseUShort(),t=this.parseUShort();return{classes:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,vr)}}))};if(3===t){var r=this.parseUShort(),n=this.parseUShort();return{substFormat:t,coverages:this.parseList(r,ge.pointer(ge.coverage)),lookupRecords:this.parseRecordList(n,vr)}}F.assert(!1,"0x"+e.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},gr[6]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(ge.coverage),chainRuleSets:this.parseListOfLists((function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(vr)}}))}:2===t?{substFormat:2,coverage:this.parsePointer(ge.coverage),backtrackClassDef:this.parsePointer(ge.classDef),inputClassDef:this.parsePointer(ge.classDef),lookaheadClassDef:this.parsePointer(ge.classDef),chainClassSet:this.parseListOfLists((function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(vr)}}))}:3===t?{substFormat:3,backtrackCoverage:this.parseList(ge.pointer(ge.coverage)),inputCoverage:this.parseList(ge.pointer(ge.coverage)),lookaheadCoverage:this.parseList(ge.pointer(ge.coverage)),lookupRecords:this.parseRecordList(vr)}:void F.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},gr[7]=function(){var e=this.parseUShort();F.argument(1===e,"GSUB Extension Substitution subtable identifier-format must be 1");var t=this.parseUShort(),r=new ge(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:gr[t].call(r)}},gr[8]=function(){var e=this.parseUShort();return F.argument(1===e,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(ge.coverage),backtrackCoverage:this.parseList(ge.pointer(ge.coverage)),lookaheadCoverage:this.parseList(ge.pointer(ge.coverage)),substitutes:this.parseUShortList()}};var yr=new Array(9);function br(e){return new ae.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new ae.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new ae.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new ae.LookupList(e.lookups,yr)}])}yr[1]=function(e){return 1===e.substFormat?new ae.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new ae.Coverage(e.coverage)},{name:"deltaGlyphID",type:"USHORT",value:e.deltaGlyphId}]):new ae.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new ae.Coverage(e.coverage)}].concat(ae.ushortList("substitute",e.substitute)))},yr[2]=function(e){return F.assert(1===e.substFormat,"Lookup type 2 substFormat must be 1."),new ae.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new ae.Coverage(e.coverage)}].concat(ae.tableList("seqSet",e.sequences,(function(e){return new ae.Table("sequenceSetTable",ae.ushortList("sequence",e))}))))},yr[3]=function(e){return F.assert(1===e.substFormat,"Lookup type 3 substFormat must be 1."),new ae.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new ae.Coverage(e.coverage)}].concat(ae.tableList("altSet",e.alternateSets,(function(e){return new ae.Table("alternateSetTable",ae.ushortList("alternate",e))}))))},yr[4]=function(e){return F.assert(1===e.substFormat,"Lookup type 4 substFormat must be 1."),new ae.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new ae.Coverage(e.coverage)}].concat(ae.tableList("ligSet",e.ligatureSets,(function(e){return new ae.Table("ligatureSetTable",ae.tableList("ligature",e,(function(e){return new ae.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:e.ligGlyph}].concat(ae.ushortList("component",e.components,e.components.length+1)))})))}))))},yr[6]=function(e){if(1===e.substFormat){var t=new ae.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new ae.Coverage(e.coverage)}].concat(ae.tableList("chainRuleSet",e.chainRuleSets,(function(e){return new ae.Table("chainRuleSetTable",ae.tableList("chainRule",e,(function(e){var t=ae.ushortList("backtrackGlyph",e.backtrack,e.backtrack.length).concat(ae.ushortList("inputGlyph",e.input,e.input.length+1)).concat(ae.ushortList("lookaheadGlyph",e.lookahead,e.lookahead.length)).concat(ae.ushortList("substitution",[],e.lookupRecords.length));return e.lookupRecords.forEach((function(e,r){t=t.concat({name:"sequenceIndex"+r,type:"USHORT",value:e.sequenceIndex}).concat({name:"lookupListIndex"+r,type:"USHORT",value:e.lookupListIndex})})),new ae.Table("chainRuleTable",t)})))}))));return t}if(2===e.substFormat)F.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(3===e.substFormat){var r=[{name:"substFormat",type:"USHORT",value:e.substFormat}];return r.push({name:"backtrackGlyphCount",type:"USHORT",value:e.backtrackCoverage.length}),e.backtrackCoverage.forEach((function(e,t){r.push({name:"backtrackCoverage"+t,type:"TABLE",value:new ae.Coverage(e)})})),r.push({name:"inputGlyphCount",type:"USHORT",value:e.inputCoverage.length}),e.inputCoverage.forEach((function(e,t){r.push({name:"inputCoverage"+t,type:"TABLE",value:new ae.Coverage(e)})})),r.push({name:"lookaheadGlyphCount",type:"USHORT",value:e.lookaheadCoverage.length}),e.lookaheadCoverage.forEach((function(e,t){r.push({name:"lookaheadCoverage"+t,type:"TABLE",value:new ae.Coverage(e)})})),r.push({name:"substitutionCount",type:"USHORT",value:e.lookupRecords.length}),e.lookupRecords.forEach((function(e,t){r=r.concat({name:"sequenceIndex"+t,type:"USHORT",value:e.sequenceIndex}).concat({name:"lookupListIndex"+t,type:"USHORT",value:e.lookupListIndex})})),new ae.Table("chainContextTable",r)}F.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};var Sr={parse:mr,make:br};function xr(e,t){var r=new me.Parser(e,t),n=r.parseULong();F.argument(1===n,"Unsupported META table version."),r.parseULong(),r.parseULong();for(var a=r.parseULong(),s={},o=0;o<a;o++){var i=r.parseTag(),u=r.parseULong(),l=r.parseULong(),p=N.UTF8(e,t+u,l);s[i]=p}return s}function Tr(e){var t=Object.keys(e).length,r="",n=16+12*t,a=new ae.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:t}]);for(var s in e){var o=r.length;r+=e[s],a.fields.push({name:"tag "+s,type:"TAG",value:s}),a.fields.push({name:"offset "+s,type:"ULONG",value:n+o}),a.fields.push({name:"length "+s,type:"ULONG",value:e[s].length})}return a.fields.push({name:"stringPool",type:"CHARARRAY",value:r}),a}var Ur={parse:xr,make:Tr};function kr(e){return Math.log(e)/Math.log(2)|0}function Er(e){for(;e.length%4!=0;)e.push(0);for(var t=0,r=0;r<e.length;r+=4)t+=(e[r]<<24)+(e[r+1]<<16)+(e[r+2]<<8)+e[r+3];return t%=Math.pow(2,32)}function Or(e,t,r,n){return new ae.Record("Table Record",[{name:"tag",type:"TAG",value:void 0!==e?e:""},{name:"checkSum",type:"ULONG",value:void 0!==t?t:0},{name:"offset",type:"ULONG",value:void 0!==r?r:0},{name:"length",type:"ULONG",value:void 0!==n?n:0}])}function wr(e){var t=new ae.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}]);t.tables=e,t.numTables=e.length;var r=Math.pow(2,kr(t.numTables));t.searchRange=16*r,t.entrySelector=kr(r),t.rangeShift=16*t.numTables-t.searchRange;for(var n=[],a=[],s=t.sizeOf()+Or().sizeOf()*t.numTables;s%4!=0;)s+=1,a.push({name:"padding",type:"BYTE",value:0});for(var o=0;o<e.length;o+=1){var i=e[o];F.argument(4===i.tableName.length,"Table name"+i.tableName+" is invalid.");var u=i.sizeOf(),l=Or(i.tableName,Er(i.encode()),s,u);for(n.push({name:l.tag+" Table Record",type:"RECORD",value:l}),a.push({name:i.tableName+" table",type:"RECORD",value:i}),s+=u,F.argument(!isNaN(s),"Something went wrong calculating the offset.");s%4!=0;)s+=1,a.push({name:"padding",type:"BYTE",value:0})}return n.sort((function(e,t){return e.value.tag>t.value.tag?1:-1})),t.fields=t.fields.concat(n),t.fields=t.fields.concat(a),t}function Rr(e,t,r){for(var n=0;n<t.length;n+=1){var a=e.charToGlyphIndex(t[n]);if(a>0)return e.glyphs.get(a).getMetrics()}return r}function Lr(e){for(var t=0,r=0;r<e.length;r+=1)t+=e[r];return t/e.length}function Cr(e){for(var t,r=[],n=[],a=[],s=[],o=[],i=[],u=[],l=0,p=0,c=0,h=0,f=0,d=0;d<e.glyphs.length;d+=1){var g=e.glyphs.get(d),v=0|g.unicode;if(isNaN(g.advanceWidth))throw new Error("Glyph "+g.name+" ("+d+"): advanceWidth is not a number.");(t>v||void 0===t)&&v>0&&(t=v),l<v&&(l=v);var m=cr.getUnicodeRange(v);if(m<32)p|=1<<m;else if(m<64)c|=1<<m-32;else if(m<96)h|=1<<m-64;else{if(!(m<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");f|=1<<m-96}if(".notdef"!==g.name){var y=g.getMetrics();r.push(y.xMin),n.push(y.yMin),a.push(y.xMax),s.push(y.yMax),i.push(y.leftSideBearing),u.push(y.rightSideBearing),o.push(g.advanceWidth)}}var b={xMin:Math.min.apply(null,r),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,a),yMax:Math.max.apply(null,s),advanceWidthMax:Math.max.apply(null,o),advanceWidthAvg:Lr(o),minLeftSideBearing:Math.min.apply(null,i),maxLeftSideBearing:Math.max.apply(null,i),minRightSideBearing:Math.min.apply(null,u)};b.ascender=e.ascender,b.descender=e.descender;var S=Ct.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:b.xMin,yMin:b.yMin,xMax:b.xMax,yMax:b.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp}),x=Bt.make({ascender:b.ascender,descender:b.descender,advanceWidthMax:b.advanceWidthMax,minLeftSideBearing:b.minLeftSideBearing,minRightSideBearing:b.minRightSideBearing,xMaxExtent:b.maxLeftSideBearing+(b.xMax-b.xMin),numberOfHMetrics:e.glyphs.length}),T=Vt.make(e.glyphs.length),U=cr.make(Object.assign({xAvgCharWidth:Math.round(b.advanceWidthAvg),usFirstCharIndex:t,usLastCharIndex:l,ulUnicodeRange1:p,ulUnicodeRange2:c,ulUnicodeRange3:h,ulUnicodeRange4:f,sTypoAscender:b.ascender,sTypoDescender:b.descender,sTypoLineGap:0,usWinAscent:b.yMax,usWinDescent:Math.abs(b.yMin),ulCodePageRange1:1,sxHeight:Rr(e,"xyvw",{yMax:Math.round(b.ascender/2)}).yMax,sCapHeight:Rr(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",b).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0},e.tables.os2)),k=At.make(e.glyphs),E=ke.make(e.glyphs),O=e.getEnglishName("fontFamily"),w=e.getEnglishName("fontSubfamily"),R=O+" "+w,L=e.getEnglishName("postScriptName");L||(L=O.replace(/\s/g,"")+"-"+w);var C={};for(var D in e.names)C[D]=e.names[D];C.uniqueID||(C.uniqueID={en:e.getEnglishName("manufacturer")+":"+R}),C.postScriptName||(C.postScriptName={en:L}),C.preferredFamily||(C.preferredFamily=e.names.fontFamily),C.preferredSubfamily||(C.preferredSubfamily=e.names.fontSubfamily);var I=[],B=or.make(C,I),F=I.length>0?Ht.make(I):void 0,G=dr.make(),M=wt.make(e.glyphs,{version:e.getEnglishName("version"),fullName:R,familyName:O,weightName:w,postScriptName:L,unitsPerEm:e.unitsPerEm,fontBBox:[0,b.yMin,b.ascender,b.advanceWidthMax]}),N=e.metas&&Object.keys(e.metas).length>0?Ur.make(e.metas):void 0,A=[S,x,T,U,B,E,G,M,k];F&&A.push(F),e.tables.gsub&&A.push(Sr.make(e.tables.gsub)),N&&A.push(N);for(var P=wr(A),_=Er(P.encode()),H=P.fields,z=!1,W=0;W<H.length;W+=1)if("head table"===H[W].name){H[W].value.checkSumAdjustment=2981146554-_,z=!0;break}if(!z)throw new Error("Could not find head table with checkSum to adjust.");return P}var Dr={make:wr,fontToTable:Cr,computeCheckSum:Er};function Ir(e,t){for(var r=0,n=e.length-1;r<=n;){var a=r+n>>>1,s=e[a].tag;if(s===t)return a;s<t?r=a+1:n=a-1}return-r-1}function Br(e,t){for(var r=0,n=e.length-1;r<=n;){var a=r+n>>>1,s=e[a];if(s===t)return a;s<t?r=a+1:n=a-1}return-r-1}function Fr(e,t){for(var r,n=0,a=e.length-1;n<=a;){var s=n+a>>>1,o=(r=e[s]).start;if(o===t)return r;o<t?n=s+1:a=s-1}if(n>0)return t>(r=e[n-1]).end?0:r}function Gr(e,t){this.font=e,this.tableName=t}function Mr(e){Gr.call(this,e,"gpos")}function Nr(e){Gr.call(this,e,"gsub")}function Ar(e,t){var r=e.length;if(r!==t.length)return!1;for(var n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}function Pr(e,t,r){for(var n=e.subtables,a=0;a<n.length;a++){var s=n[a];if(s.substFormat===t)return s}if(r)return n.push(r),r}function _r(){return"undefined"!=typeof window}function Hr(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n<e.length;++n)r[n]=e[n];return t}function zr(e){for(var t=new Buffer(e.byteLength),r=new Uint8Array(e),n=0;n<t.length;++n)t[n]=r[n];return t}function Wr(e,t){if(!e)throw t}function Vr(e,t,r,n,a){var s;return(t&n)>0?(s=e.parseByte(),t&a||(s=-s),s=r+s):s=(t&a)>0?r:r+e.parseShort(),s}function qr(e,t,r){var n,a,s=new me.Parser(t,r);if(e.numberOfContours=s.parseShort(),e._xMin=s.parseShort(),e._yMin=s.parseShort(),e._xMax=s.parseShort(),e._yMax=s.parseShort(),e.numberOfContours>0){for(var o=e.endPointIndices=[],i=0;i<e.numberOfContours;i+=1)o.push(s.parseUShort());e.instructionLength=s.parseUShort(),e.instructions=[];for(var u=0;u<e.instructionLength;u+=1)e.instructions.push(s.parseByte());var l=o[o.length-1]+1;n=[];for(var p=0;p<l;p+=1)if(a=s.parseByte(),n.push(a),(8&a)>0)for(var c=s.parseByte(),h=0;h<c;h+=1)n.push(a),p+=1;if(F.argument(n.length===l,"Bad flags."),o.length>0){var f,d=[];if(l>0){for(var g=0;g<l;g+=1)a=n[g],(f={}).onCurve=!!(1&a),f.lastPointOfContour=o.indexOf(g)>=0,d.push(f);for(var v=0,m=0;m<l;m+=1)a=n[m],(f=d[m]).x=Vr(s,a,v,2,16),v=f.x;for(var y=0,b=0;b<l;b+=1)a=n[b],(f=d[b]).y=Vr(s,a,y,4,32),y=f.y}e.points=d}else e.points=[]}else if(0===e.numberOfContours)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];for(var S=!0;S;){n=s.parseUShort();var x={glyphIndex:s.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(1&n)>0?(2&n)>0?(x.dx=s.parseShort(),x.dy=s.parseShort()):x.matchedPoints=[s.parseUShort(),s.parseUShort()]:(2&n)>0?(x.dx=s.parseChar(),x.dy=s.parseChar()):x.matchedPoints=[s.parseByte(),s.parseByte()],(8&n)>0?x.xScale=x.yScale=s.parseF2Dot14():(64&n)>0?(x.xScale=s.parseF2Dot14(),x.yScale=s.parseF2Dot14()):(128&n)>0&&(x.xScale=s.parseF2Dot14(),x.scale01=s.parseF2Dot14(),x.scale10=s.parseF2Dot14(),x.yScale=s.parseF2Dot14()),e.components.push(x),S=!!(32&n)}if(256&n){e.instructionLength=s.parseUShort(),e.instructions=[];for(var T=0;T<e.instructionLength;T+=1)e.instructions.push(s.parseByte())}}}function Xr(e,t){for(var r=[],n=0;n<e.length;n+=1){var a=e[n],s={x:t.xScale*a.x+t.scale01*a.y+t.dx,y:t.scale10*a.x+t.yScale*a.y+t.dy,onCurve:a.onCurve,lastPointOfContour:a.lastPointOfContour};r.push(s)}return r}function jr(e){for(var t=[],r=[],n=0;n<e.length;n+=1){var a=e[n];r.push(a),a.lastPointOfContour&&(t.push(r),r=[])}return F.argument(0===r.length,"There are still points left in the current contour."),t}function Yr(e){var t=new D;if(!e)return t;for(var r=jr(e),n=0;n<r.length;++n){var a=r[n],s=null,o=a[a.length-1],i=a[0];if(o.onCurve)t.moveTo(o.x,o.y);else if(i.onCurve)t.moveTo(i.x,i.y);else{var u={x:.5*(o.x+i.x),y:.5*(o.y+i.y)};t.moveTo(u.x,u.y)}for(var l=0;l<a.length;++l)if(s=o,o=i,i=a[(l+1)%a.length],o.onCurve)t.lineTo(o.x,o.y);else{var p=i;s.onCurve||(o.x,s.x,o.y,s.y),i.onCurve||(p={x:.5*(o.x+i.x),y:.5*(o.y+i.y)}),t.quadraticCurveTo(o.x,o.y,p.x,p.y)}t.closePath()}return t}function Zr(e,t){if(t.isComposite)for(var r=0;r<t.components.length;r+=1){var n=t.components[r],a=e.get(n.glyphIndex);if(a.getPath(),a.points){var s=void 0;if(void 0===n.matchedPoints)s=Xr(a.points,n);else{if(n.matchedPoints[0]>t.points.length-1||n.matchedPoints[1]>a.points.length-1)throw Error("Matched points out of range in "+t.name);var o=t.points[n.matchedPoints[0]],i=a.points[n.matchedPoints[1]],u={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};i=Xr([i],u)[0],u.dx=o.x-i.x,u.dy=o.y-i.y,s=Xr(a.points,u)}t.points=t.points.concat(s)}}return Yr(t.points)}function Qr(e,t,r,n){for(var a=new qe.GlyphSet(n),s=0;s<r.length-1;s+=1){var o=r[s];o!==r[s+1]?a.push(s,qe.ttfGlyphLoader(n,s,qr,e,t+o,Zr)):a.push(s,qe.glyphLoader(n,s))}return a}function Kr(e,t,r,n){var a=new qe.GlyphSet(n);return n._push=function(s){var o=r[s];o!==r[s+1]?a.push(s,qe.ttfGlyphLoader(n,s,qr,e,t+o,Zr)):a.push(s,qe.glyphLoader(n,s))},a}function Jr(e,t,r,n,a){return a.lowMemory?Kr(e,t,r,n):Qr(e,t,r,n)}Gr.prototype={searchTag:Ir,binSearch:Br,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map((function(e){return e.tag})):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r<e.scripts.length;r++){var n=e.scripts[r].tag;if("DFLT"===n)return n;"latn"===n&&(t=!0)}return t?"latn":void 0}},getScriptTable:function(e,t){var r=this.getTable(t);if(r){e=e||"DFLT";var n=r.scripts,a=Ir(r.scripts,e);if(a>=0)return n[a].script;if(t){var s={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return n.splice(-1-a,0,s),s.script}}},getLangSysTable:function(e,t,r){var n=this.getScriptTable(e,r);if(n){if(!t||"dflt"===t||"DFLT"===t)return n.defaultLangSys;var a=Ir(n.langSysRecords,t);if(a>=0)return n.langSysRecords[a].langSys;if(r){var s={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return n.langSysRecords.splice(-1-a,0,s),s.langSys}}},getFeatureTable:function(e,t,r,n){var a=this.getLangSysTable(e,t,n);if(a){for(var s,o=a.featureIndexes,i=this.font.tables[this.tableName].features,u=0;u<o.length;u++)if((s=i[o[u]]).tag===r)return s.feature;if(n){var l=i.length;return F.assert(0===l||r>=i[l-1].tag,"Features must be added in alphabetical order."),s={tag:r,feature:{params:0,lookupListIndexes:[]}},i.push(s),o.push(l),s.feature}}},getLookupTables:function(e,t,r,n,a){var s=this.getFeatureTable(e,t,r,a),o=[];if(s){for(var i,u=s.lookupListIndexes,l=this.font.tables[this.tableName].lookups,p=0;p<u.length;p++)(i=l[u[p]]).lookupType===n&&o.push(i);if(0===o.length&&a){i={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0};var c=l.length;return l.push(i),u.push(c),[i]}}return o},getGlyphClass:function(e,t){switch(e.format){case 1:return e.startGlyph<=t&&t<e.startGlyph+e.classes.length?e.classes[t-e.startGlyph]:0;case 2:var r=Fr(e.ranges,t);return r?r.classId:0}},getCoverageIndex:function(e,t){switch(e.format){case 1:var r=Br(e.glyphs,t);return r>=0?r:-1;case 2:var n=Fr(e.ranges,t);return n?n.index+t-n.start:-1}},expandCoverage:function(e){if(1===e.format)return e.glyphs;for(var t=[],r=e.ranges,n=0;n<r.length;n++)for(var a=r[n],s=a.start,o=a.end,i=s;i<=o;i++)t.push(i);return t}},Mr.prototype=Gr.prototype,Mr.prototype.init=function(){var e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},Mr.prototype.getKerningValue=function(e,t,r){for(var n=0;n<e.length;n++)for(var a=e[n].subtables,s=0;s<a.length;s++){var o=a[s],i=this.getCoverageIndex(o.coverage,t);if(!(i<0))switch(o.posFormat){case 1:for(var u=o.pairSets[i],l=0;l<u.length;l++){var p=u[l];if(p.secondGlyph===r)return p.value1&&p.value1.xAdvance||0}break;case 2:var c=this.getGlyphClass(o.classDef1,t),h=this.getGlyphClass(o.classDef2,r),f=o.classRecords[c][h];return f.value1&&f.value1.xAdvance||0}}return 0},Mr.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,"kern",2)},Nr.prototype=Gr.prototype,Nr.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},Nr.prototype.getSingle=function(e,t,r){for(var n=[],a=this.getLookupTables(t,r,e,1),s=0;s<a.length;s++)for(var o=a[s].subtables,i=0;i<o.length;i++){var u=o[i],l=this.expandCoverage(u.coverage),p=void 0;if(1===u.substFormat){var c=u.deltaGlyphId;for(p=0;p<l.length;p++){var h=l[p];n.push({sub:h,by:h+c})}}else{var f=u.substitute;for(p=0;p<l.length;p++)n.push({sub:l[p],by:f[p]})}}return n},Nr.prototype.getMultiple=function(e,t,r){for(var n=[],a=this.getLookupTables(t,r,e,2),s=0;s<a.length;s++)for(var o=a[s].subtables,i=0;i<o.length;i++){var u=o[i],l=this.expandCoverage(u.coverage),p=void 0;for(p=0;p<l.length;p++){var c=l[p],h=u.sequences[p];n.push({sub:c,by:h})}}return n},Nr.prototype.getAlternates=function(e,t,r){for(var n=[],a=this.getLookupTables(t,r,e,3),s=0;s<a.length;s++)for(var o=a[s].subtables,i=0;i<o.length;i++)for(var u=o[i],l=this.expandCoverage(u.coverage),p=u.alternateSets,c=0;c<l.length;c++)n.push({sub:l[c],by:p[c]});return n},Nr.prototype.getLigatures=function(e,t,r){for(var n=[],a=this.getLookupTables(t,r,e,4),s=0;s<a.length;s++)for(var o=a[s].subtables,i=0;i<o.length;i++)for(var u=o[i],l=this.expandCoverage(u.coverage),p=u.ligatureSets,c=0;c<l.length;c++)for(var h=l[c],f=p[c],d=0;d<f.length;d++){var g=f[d];n.push({sub:[h].concat(g.components),by:g.ligGlyph})}return n},Nr.prototype.addSingle=function(e,t,r,n){var a=Pr(this.getLookupTables(r,n,e,1,!0)[0],2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});F.assert(1===a.coverage.format,"Single: unable to modify coverage table format "+a.coverage.format);var s=t.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]=t.by},Nr.prototype.addMultiple=function(e,t,r,n){F.assert(t.by instanceof Array&&t.by.length>1,'Multiple: "by" must be an array of two or more ids');var a=Pr(this.getLookupTables(r,n,e,2,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});F.assert(1===a.coverage.format,"Multiple: unable to modify coverage table format "+a.coverage.format);var s=t.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]=t.by},Nr.prototype.addAlternate=function(e,t,r,n){var a=Pr(this.getLookupTables(r,n,e,3,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});F.assert(1===a.coverage.format,"Alternate: unable to modify coverage table format "+a.coverage.format);var s=t.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]=t.by},Nr.prototype.addLigature=function(e,t,r,n){var a=this.getLookupTables(r,n,e,4,!0)[0],s=a.subtables[0];s||(s={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},a.subtables[0]=s),F.assert(1===s.coverage.format,"Ligature: unable to modify coverage table format "+s.coverage.format);var o=t.sub[0],i=t.sub.slice(1),u={ligGlyph:t.by,components:i},l=this.binSearch(s.coverage.glyphs,o);if(l>=0){for(var p=s.ligatureSets[l],c=0;c<p.length;c++)if(Ar(p[c].components,i))return;p.push(u)}else l=-1-l,s.coverage.glyphs.splice(l,0,o),s.ligatureSets.splice(l,0,[u])},Nr.prototype.getFeature=function(e,t,r){if(/ss\d\d/.test(e))return this.getSingle(e,t,r);switch(e){case"aalt":case"salt":return this.getSingle(e,t,r).concat(this.getAlternates(e,t,r));case"dlig":case"liga":case"rlig":return this.getLigatures(e,t,r);case"ccmp":return this.getMultiple(e,t,r).concat(this.getLigatures(e,t,r));case"stch":return this.getMultiple(e,t,r)}},Nr.prototype.add=function(e,t,r,n){if(/ss\d\d/.test(e))return this.addSingle(e,t,r,n);switch(e){case"aalt":case"salt":return"number"==typeof t.by?this.addSingle(e,t,r,n):this.addAlternate(e,t,r,n);case"dlig":case"liga":case"rlig":return this.addLigature(e,t,r,n);case"ccmp":return t.by instanceof Array?this.addMultiple(e,t,r,n):this.addLigature(e,t,r,n)}};var $r,en,tn,rn,nn={getPath:Yr,parse:Jr};function an(e){this.font=e,this.getCommands=function(e){return nn.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function sn(e){return e}function on(e){return Math.sign(e)*Math.round(Math.abs(e))}function un(e){return Math.sign(e)*Math.round(Math.abs(2*e))/2}function ln(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function pn(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function cn(e){return Math.sign(e)*Math.floor(Math.abs(e))}var hn=function(e){var t=this.srPeriod,r=this.srPhase,n=1;return e<0&&(e=-e,n=-1),e+=this.srThreshold-r,e=Math.trunc(e/t)*t,(e+=r)<0?r*n:e*n},fn={x:1,y:0,axis:"x",distance:function(e,t,r,n){return(r?e.xo:e.x)-(n?t.xo:t.x)},interpolate:function(e,t,r,n){var a,s,o,i,u,l,p;if(!n||n===this)return a=e.xo-t.xo,s=e.xo-r.xo,u=t.x-t.xo,l=r.x-r.xo,0===(p=(o=Math.abs(a))+(i=Math.abs(s)))?void(e.x=e.xo+(u+l)/2):void(e.x=e.xo+(u*i+l*o)/p);a=n.distance(e,t,!0,!0),s=n.distance(e,r,!0,!0),u=n.distance(t,t,!1,!0),l=n.distance(r,r,!1,!0),0!==(p=(o=Math.abs(a))+(i=Math.abs(s)))?fn.setRelative(e,e,(u*i+l*o)/p,n,!0):fn.setRelative(e,e,(u+l)/2,n,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,r,n,a){if(n&&n!==this){var s=a?t.xo:t.x,o=a?t.yo:t.y,i=s+r*n.x,u=o+r*n.y;e.x=i+(e.y-u)/n.normalSlope}else e.x=(a?t.xo:t.x)+r},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},dn={x:0,y:1,axis:"y",distance:function(e,t,r,n){return(r?e.yo:e.y)-(n?t.yo:t.y)},interpolate:function(e,t,r,n){var a,s,o,i,u,l,p;if(!n||n===this)return a=e.yo-t.yo,s=e.yo-r.yo,u=t.y-t.yo,l=r.y-r.yo,0===(p=(o=Math.abs(a))+(i=Math.abs(s)))?void(e.y=e.yo+(u+l)/2):void(e.y=e.yo+(u*i+l*o)/p);a=n.distance(e,t,!0,!0),s=n.distance(e,r,!0,!0),u=n.distance(t,t,!1,!0),l=n.distance(r,r,!1,!0),0!==(p=(o=Math.abs(a))+(i=Math.abs(s)))?dn.setRelative(e,e,(u*i+l*o)/p,n,!0):dn.setRelative(e,e,(u+l)/2,n,!0)},normalSlope:0,setRelative:function(e,t,r,n,a){if(n&&n!==this){var s=a?t.xo:t.x,o=a?t.yo:t.y,i=s+r*n.x,u=o+r*n.y;e.y=u+n.normalSlope*(e.x-i)}else e.y=(a?t.yo:t.y)+r},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};function gn(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}function vn(e,t){var r=Math.sqrt(e*e+t*t);return t/=r,1==(e/=r)&&0===t?fn:0===e&&1===t?dn:new gn(e,t)}function mn(e,t,r,n){this.x=this.xo=Math.round(64*e)/64,this.y=this.yo=Math.round(64*t)/64,this.lastPointOfContour=r,this.onCurve=n,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Object.freeze(fn),Object.freeze(dn),gn.prototype.distance=function(e,t,r,n){return this.x*fn.distance(e,t,r,n)+this.y*dn.distance(e,t,r,n)},gn.prototype.interpolate=function(e,t,r,n){var a,s,o,i,u,l,p;o=n.distance(e,t,!0,!0),i=n.distance(e,r,!0,!0),a=n.distance(t,t,!1,!0),s=n.distance(r,r,!1,!0),0!==(p=(u=Math.abs(o))+(l=Math.abs(i)))?this.setRelative(e,e,(a*l+s*u)/p,n,!0):this.setRelative(e,e,(a+s)/2,n,!0)},gn.prototype.setRelative=function(e,t,r,n,a){n=n||this;var s=a?t.xo:t.x,o=a?t.yo:t.y,i=s+r*n.x,u=o+r*n.y,l=n.normalSlope,p=this.slope,c=e.x,h=e.y;e.x=(p*c-l*i+u-h)/(p-l),e.y=p*(e.x-c)+h},gn.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0},mn.prototype.nextTouched=function(e){for(var t=this.nextPointOnContour;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},mn.prototype.prevTouched=function(e){for(var t=this.prevPointOnContour;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var yn=Object.freeze(new mn(0,0)),bn={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function Sn(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=fn,this.round=on}}function xn(e){for(var t=e.tZone=new Array(e.gZone.length),r=0;r<t.length;r++)t[r]=new mn(0,0)}function Tn(e,t){var r,n=e.prog,a=e.ip,s=1;do{if(88===(r=n[++a]))s++;else if(89===r)s--;else if(64===r)a+=n[a+1]+1;else if(65===r)a+=2*n[a+1]+1;else if(r>=176&&r<=183)a+=r-176+1;else if(r>=184&&r<=191)a+=2*(r-184+1);else if(t&&1===s&&27===r)break}while(s>0);e.ip=a}function Un(t,r){e.DEBUG&&console.log(r.step,"SVTCA["+t.axis+"]"),r.fv=r.pv=r.dpv=t}function kn(t,r){e.DEBUG&&console.log(r.step,"SPVTCA["+t.axis+"]"),r.pv=r.dpv=t}function En(t,r){e.DEBUG&&console.log(r.step,"SFVTCA["+t.axis+"]"),r.fv=t}function On(t,r){var n,a,s=r.stack,o=s.pop(),i=s.pop(),u=r.z2[o],l=r.z1[i];e.DEBUG&&console.log("SPVTL["+t+"]",o,i),t?(n=u.y-l.y,a=l.x-u.x):(n=l.x-u.x,a=l.y-u.y),r.pv=r.dpv=vn(n,a)}function wn(t,r){var n,a,s=r.stack,o=s.pop(),i=s.pop(),u=r.z2[o],l=r.z1[i];e.DEBUG&&console.log("SFVTL["+t+"]",o,i),t?(n=u.y-l.y,a=l.x-u.x):(n=l.x-u.x,a=l.y-u.y),r.fv=vn(n,a)}function Rn(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"SPVFS[]",n,a),t.pv=t.dpv=vn(a,n)}function Ln(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"SPVFS[]",n,a),t.fv=vn(a,n)}function Cn(t){var r=t.stack,n=t.pv;e.DEBUG&&console.log(t.step,"GPV[]"),r.push(16384*n.x),r.push(16384*n.y)}function Dn(t){var r=t.stack,n=t.fv;e.DEBUG&&console.log(t.step,"GFV[]"),r.push(16384*n.x),r.push(16384*n.y)}function In(t){t.fv=t.pv,e.DEBUG&&console.log(t.step,"SFVTPV[]")}function Bn(t){var r=t.stack,n=r.pop(),a=r.pop(),s=r.pop(),o=r.pop(),i=r.pop(),u=t.z0,l=t.z1,p=u[n],c=u[a],h=l[s],f=l[o],d=t.z2[i];e.DEBUG&&console.log("ISECT[], ",n,a,s,o,i);var g=p.x,v=p.y,m=c.x,y=c.y,b=h.x,S=h.y,x=f.x,T=f.y,U=(g-m)*(S-T)-(v-y)*(b-x),k=g*y-v*m,E=b*T-S*x;d.x=(k*(b-x)-E*(g-m))/U,d.y=(k*(S-T)-E*(v-y))/U}function Fn(t){t.rp0=t.stack.pop(),e.DEBUG&&console.log(t.step,"SRP0[]",t.rp0)}function Gn(t){t.rp1=t.stack.pop(),e.DEBUG&&console.log(t.step,"SRP1[]",t.rp1)}function Mn(t){t.rp2=t.stack.pop(),e.DEBUG&&console.log(t.step,"SRP2[]",t.rp2)}function Nn(t){var r=t.stack.pop();switch(e.DEBUG&&console.log(t.step,"SZP0[]",r),t.zp0=r,r){case 0:t.tZone||xn(t),t.z0=t.tZone;break;case 1:t.z0=t.gZone;break;default:throw new Error("Invalid zone pointer")}}function An(t){var r=t.stack.pop();switch(e.DEBUG&&console.log(t.step,"SZP1[]",r),t.zp1=r,r){case 0:t.tZone||xn(t),t.z1=t.tZone;break;case 1:t.z1=t.gZone;break;default:throw new Error("Invalid zone pointer")}}function Pn(t){var r=t.stack.pop();switch(e.DEBUG&&console.log(t.step,"SZP2[]",r),t.zp2=r,r){case 0:t.tZone||xn(t),t.z2=t.tZone;break;case 1:t.z2=t.gZone;break;default:throw new Error("Invalid zone pointer")}}function _n(t){var r=t.stack.pop();switch(e.DEBUG&&console.log(t.step,"SZPS[]",r),t.zp0=t.zp1=t.zp2=r,r){case 0:t.tZone||xn(t),t.z0=t.z1=t.z2=t.tZone;break;case 1:t.z0=t.z1=t.z2=t.gZone;break;default:throw new Error("Invalid zone pointer")}}function Hn(t){t.loop=t.stack.pop(),e.DEBUG&&console.log(t.step,"SLOOP[]",t.loop)}function zn(t){e.DEBUG&&console.log(t.step,"RTG[]"),t.round=on}function Wn(t){e.DEBUG&&console.log(t.step,"RTHG[]"),t.round=ln}function Vn(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"SMD[]",r),t.minDis=r/64}function qn(t){e.DEBUG&&console.log(t.step,"ELSE[]"),Tn(t,!1)}function Xn(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"JMPR[]",r),t.ip+=r-1}function jn(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"SCVTCI[]",r),t.cvCutIn=r/64}function Yn(t){var r=t.stack;e.DEBUG&&console.log(t.step,"DUP[]"),r.push(r[r.length-1])}function Zn(t){e.DEBUG&&console.log(t.step,"POP[]"),t.stack.pop()}function Qn(t){e.DEBUG&&console.log(t.step,"CLEAR[]"),t.stack.length=0}function Kn(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"SWAP[]"),r.push(n),r.push(a)}function Jn(t){var r=t.stack;e.DEBUG&&console.log(t.step,"DEPTH[]"),r.push(r.length)}function $n(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"LOOPCALL[]",n,a);var s=t.ip,o=t.prog;t.prog=t.funcs[n];for(var i=0;i<a;i++)en(t),e.DEBUG&&console.log(++t.step,i+1<a?"next loopcall":"done loopcall",i);t.ip=s,t.prog=o}function ea(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"CALL[]",r);var n=t.ip,a=t.prog;t.prog=t.funcs[r],en(t),t.ip=n,t.prog=a,e.DEBUG&&console.log(++t.step,"returning from",r)}function ta(t){var r=t.stack,n=r.pop();e.DEBUG&&console.log(t.step,"CINDEX[]",n),r.push(r[r.length-n])}function ra(t){var r=t.stack,n=r.pop();e.DEBUG&&console.log(t.step,"MINDEX[]",n),r.push(r.splice(r.length-n,1)[0])}function na(t){if("fpgm"!==t.env)throw new Error("FDEF not allowed here");var r=t.stack,n=t.prog,a=t.ip,s=r.pop(),o=a;for(e.DEBUG&&console.log(t.step,"FDEF[]",s);45!==n[++a];);t.ip=a,t.funcs[s]=n.slice(o+1,a)}function aa(t,r){var n=r.stack.pop(),a=r.z0[n],s=r.fv,o=r.pv;e.DEBUG&&console.log(r.step,"MDAP["+t+"]",n);var i=o.distance(a,yn);t&&(i=r.round(i)),s.setRelative(a,yn,i,o),s.touch(a),r.rp0=r.rp1=n}function sa(t,r){var n,a,s,o=r.z2,i=o.length-2;e.DEBUG&&console.log(r.step,"IUP["+t.axis+"]");for(var u=0;u<i;u++)n=o[u],t.touched(n)||(a=n.prevTouched(t))!==n&&(a===(s=n.nextTouched(t))&&t.setRelative(n,n,t.distance(a,a,!1,!0),t,!0),t.interpolate(n,a,s,t))}function oa(t,r){for(var n=r.stack,a=t?r.rp1:r.rp2,s=(t?r.z0:r.z1)[a],o=r.fv,i=r.pv,u=r.loop,l=r.z2;u--;){var p=n.pop(),c=l[p],h=i.distance(s,s,!1,!0);o.setRelative(c,c,h,i),o.touch(c),e.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-u)+": ":"")+"SHP["+(t?"rp1":"rp2")+"]",p)}r.loop=1}function ia(t,r){var n=r.stack,a=t?r.rp1:r.rp2,s=(t?r.z0:r.z1)[a],o=r.fv,i=r.pv,u=n.pop(),l=r.z2[r.contours[u]],p=l;e.DEBUG&&console.log(r.step,"SHC["+t+"]",u);var c=i.distance(s,s,!1,!0);do{p!==s&&o.setRelative(p,p,c,i),p=p.nextPointOnContour}while(p!==l)}function ua(t,r){var n,a,s=r.stack,o=t?r.rp1:r.rp2,i=(t?r.z0:r.z1)[o],u=r.fv,l=r.pv,p=s.pop();switch(e.DEBUG&&console.log(r.step,"SHZ["+t+"]",p),p){case 0:n=r.tZone;break;case 1:n=r.gZone;break;default:throw new Error("Invalid zone")}for(var c=l.distance(i,i,!1,!0),h=n.length-2,f=0;f<h;f++)a=n[f],u.setRelative(a,a,c,l)}function la(t){for(var r=t.stack,n=t.loop,a=t.fv,s=r.pop()/64,o=t.z2;n--;){var i=r.pop(),u=o[i];e.DEBUG&&console.log(t.step,(t.loop>1?"loop "+(t.loop-n)+": ":"")+"SHPIX[]",i,s),a.setRelative(u,u,s),a.touch(u)}t.loop=1}function pa(t){for(var r=t.stack,n=t.rp1,a=t.rp2,s=t.loop,o=t.z0[n],i=t.z1[a],u=t.fv,l=t.dpv,p=t.z2;s--;){var c=r.pop(),h=p[c];e.DEBUG&&console.log(t.step,(t.loop>1?"loop "+(t.loop-s)+": ":"")+"IP[]",c,n,"<->",a),u.interpolate(h,o,i,l),u.touch(h)}t.loop=1}function ca(t,r){var n=r.stack,a=n.pop()/64,s=n.pop(),o=r.z1[s],i=r.z0[r.rp0],u=r.fv,l=r.pv;u.setRelative(o,i,a,l),u.touch(o),e.DEBUG&&console.log(r.step,"MSIRP["+t+"]",a,s),r.rp1=r.rp0,r.rp2=s,t&&(r.rp0=s)}function ha(t){for(var r=t.stack,n=t.rp0,a=t.z0[n],s=t.loop,o=t.fv,i=t.pv,u=t.z1;s--;){var l=r.pop(),p=u[l];e.DEBUG&&console.log(t.step,(t.loop>1?"loop "+(t.loop-s)+": ":"")+"ALIGNRP[]",l),o.setRelative(p,a,0,i),o.touch(p)}t.loop=1}function fa(t){e.DEBUG&&console.log(t.step,"RTDG[]"),t.round=un}function da(t,r){var n=r.stack,a=n.pop(),s=n.pop(),o=r.z0[s],i=r.fv,u=r.pv,l=r.cvt[a];e.DEBUG&&console.log(r.step,"MIAP["+t+"]",a,"(",l,")",s);var p=u.distance(o,yn);t&&(Math.abs(p-l)<r.cvCutIn&&(p=l),p=r.round(p)),i.setRelative(o,yn,p,u),0===r.zp0&&(o.xo=o.x,o.yo=o.y),i.touch(o),r.rp0=r.rp1=s}function ga(t){var r=t.prog,n=t.ip,a=t.stack,s=r[++n];e.DEBUG&&console.log(t.step,"NPUSHB[]",s);for(var o=0;o<s;o++)a.push(r[++n]);t.ip=n}function va(t){var r=t.ip,n=t.prog,a=t.stack,s=n[++r];e.DEBUG&&console.log(t.step,"NPUSHW[]",s);for(var o=0;o<s;o++){var i=n[++r]<<8|n[++r];32768&i&&(i=-(1+(65535^i))),a.push(i)}t.ip=r}function ma(t){var r=t.stack,n=t.store;n||(n=t.store=[]);var a=r.pop(),s=r.pop();e.DEBUG&&console.log(t.step,"WS",a,s),n[s]=a}function ya(t){var r=t.stack,n=t.store,a=r.pop();e.DEBUG&&console.log(t.step,"RS",a);var s=n&&n[a]||0;r.push(s)}function ba(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"WCVTP",n,a),t.cvt[a]=n/64}function Sa(t){var r=t.stack,n=r.pop();e.DEBUG&&console.log(t.step,"RCVT",n),r.push(64*t.cvt[n])}function xa(t,r){var n=r.stack,a=n.pop(),s=r.z2[a];e.DEBUG&&console.log(r.step,"GC["+t+"]",a),n.push(64*r.dpv.distance(s,yn,t,!1))}function Ta(t,r){var n=r.stack,a=n.pop(),s=n.pop(),o=r.z1[a],i=r.z0[s],u=r.dpv.distance(i,o,t,t);e.DEBUG&&console.log(r.step,"MD["+t+"]",a,s,"->",u),r.stack.push(Math.round(64*u))}function Ua(t){e.DEBUG&&console.log(t.step,"MPPEM[]"),t.stack.push(t.ppem)}function ka(t){e.DEBUG&&console.log(t.step,"FLIPON[]"),t.autoFlip=!0}function Ea(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"LT[]",n,a),r.push(a<n?1:0)}function Oa(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"LTEQ[]",n,a),r.push(a<=n?1:0)}function wa(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"GT[]",n,a),r.push(a>n?1:0)}function Ra(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"GTEQ[]",n,a),r.push(a>=n?1:0)}function La(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"EQ[]",n,a),r.push(n===a?1:0)}function Ca(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"NEQ[]",n,a),r.push(n!==a?1:0)}function Da(t){var r=t.stack,n=r.pop();e.DEBUG&&console.log(t.step,"ODD[]",n),r.push(Math.trunc(n)%2?1:0)}function Ia(t){var r=t.stack,n=r.pop();e.DEBUG&&console.log(t.step,"EVEN[]",n),r.push(Math.trunc(n)%2?0:1)}function Ba(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"IF[]",r),r||(Tn(t,!0),e.DEBUG&&console.log(t.step,"EIF[]"))}function Fa(t){e.DEBUG&&console.log(t.step,"EIF[]")}function Ga(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"AND[]",n,a),r.push(n&&a?1:0)}function Ma(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"OR[]",n,a),r.push(n||a?1:0)}function Na(t){var r=t.stack,n=r.pop();e.DEBUG&&console.log(t.step,"NOT[]",n),r.push(n?0:1)}function Aa(t,r){var n=r.stack,a=n.pop(),s=r.fv,o=r.pv,i=r.ppem,u=r.deltaBase+16*(t-1),l=r.deltaShift,p=r.z0;e.DEBUG&&console.log(r.step,"DELTAP["+t+"]",a,n);for(var c=0;c<a;c++){var h=n.pop(),f=n.pop();if(u+((240&f)>>4)===i){var d=(15&f)-8;d>=0&&d++,e.DEBUG&&console.log(r.step,"DELTAPFIX",h,"by",d*l);var g=p[h];s.setRelative(g,g,d*l,o)}}}function Pa(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"SDB[]",r),t.deltaBase=r}function _a(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"SDS[]",r),t.deltaShift=Math.pow(.5,r)}function Ha(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"ADD[]",n,a),r.push(a+n)}function za(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"SUB[]",n,a),r.push(a-n)}function Wa(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"DIV[]",n,a),r.push(64*a/n)}function Va(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"MUL[]",n,a),r.push(a*n/64)}function qa(t){var r=t.stack,n=r.pop();e.DEBUG&&console.log(t.step,"ABS[]",n),r.push(Math.abs(n))}function Xa(t){var r=t.stack,n=r.pop();e.DEBUG&&console.log(t.step,"NEG[]",n),r.push(-n)}function ja(t){var r=t.stack,n=r.pop();e.DEBUG&&console.log(t.step,"FLOOR[]",n),r.push(64*Math.floor(n/64))}function Ya(t){var r=t.stack,n=r.pop();e.DEBUG&&console.log(t.step,"CEILING[]",n),r.push(64*Math.ceil(n/64))}function Za(t,r){var n=r.stack,a=n.pop();e.DEBUG&&console.log(r.step,"ROUND[]"),n.push(64*r.round(a/64))}function Qa(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"WCVTF[]",n,a),t.cvt[a]=n*t.ppem/t.font.unitsPerEm}function Ka(t,r){var n=r.stack,a=n.pop(),s=r.ppem,o=r.deltaBase+16*(t-1),i=r.deltaShift;e.DEBUG&&console.log(r.step,"DELTAC["+t+"]",a,n);for(var u=0;u<a;u++){var l=n.pop(),p=n.pop();if(o+((240&p)>>4)===s){var c=(15&p)-8;c>=0&&c++;var h=c*i;e.DEBUG&&console.log(r.step,"DELTACFIX",l,"by",h),r.cvt[l]+=h}}}function Ja(t){var r,n=t.stack.pop();switch(e.DEBUG&&console.log(t.step,"SROUND[]",n),t.round=hn,192&n){case 0:r=.5;break;case 64:r=1;break;case 128:r=2;break;default:throw new Error("invalid SROUND value")}switch(t.srPeriod=r,48&n){case 0:t.srPhase=0;break;case 16:t.srPhase=.25*r;break;case 32:t.srPhase=.5*r;break;case 48:t.srPhase=.75*r;break;default:throw new Error("invalid SROUND value")}n&=15,t.srThreshold=0===n?0:(n/8-.5)*r}function $a(t){var r,n=t.stack.pop();switch(e.DEBUG&&console.log(t.step,"S45ROUND[]",n),t.round=hn,192&n){case 0:r=Math.sqrt(2)/2;break;case 64:r=Math.sqrt(2);break;case 128:r=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(t.srPeriod=r,48&n){case 0:t.srPhase=0;break;case 16:t.srPhase=.25*r;break;case 32:t.srPhase=.5*r;break;case 48:t.srPhase=.75*r;break;default:throw new Error("invalid S45ROUND value")}n&=15,t.srThreshold=0===n?0:(n/8-.5)*r}function es(t){e.DEBUG&&console.log(t.step,"ROFF[]"),t.round=sn}function ts(t){e.DEBUG&&console.log(t.step,"RUTG[]"),t.round=pn}function rs(t){e.DEBUG&&console.log(t.step,"RDTG[]"),t.round=cn}function ns(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"SCANCTRL[]",r)}function as(t,r){var n,a,s=r.stack,o=s.pop(),i=s.pop(),u=r.z2[o],l=r.z1[i];e.DEBUG&&console.log(r.step,"SDPVTL["+t+"]",o,i),t?(n=u.y-l.y,a=l.x-u.x):(n=l.x-u.x,a=l.y-u.y),r.dpv=vn(n,a)}function ss(t){var r=t.stack,n=r.pop(),a=0;e.DEBUG&&console.log(t.step,"GETINFO[]",n),1&n&&(a=35),32&n&&(a|=4096),r.push(a)}function os(t){var r=t.stack,n=r.pop(),a=r.pop(),s=r.pop();e.DEBUG&&console.log(t.step,"ROLL[]"),r.push(a),r.push(n),r.push(s)}function is(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"MAX[]",n,a),r.push(Math.max(a,n))}function us(t){var r=t.stack,n=r.pop(),a=r.pop();e.DEBUG&&console.log(t.step,"MIN[]",n,a),r.push(Math.min(a,n))}function ls(t){var r=t.stack.pop();e.DEBUG&&console.log(t.step,"SCANTYPE[]",r)}function ps(t){var r=t.stack.pop(),n=t.stack.pop();switch(e.DEBUG&&console.log(t.step,"INSTCTRL[]",r,n),r){case 1:return void(t.inhibitGridFit=!!n);case 2:return void(t.ignoreCvt=!!n);default:throw new Error("invalid INSTCTRL[] selector")}}function cs(t,r){var n=r.stack,a=r.prog,s=r.ip;e.DEBUG&&console.log(r.step,"PUSHB["+t+"]");for(var o=0;o<t;o++)n.push(a[++s]);r.ip=s}function hs(t,r){var n=r.ip,a=r.prog,s=r.stack;e.DEBUG&&console.log(r.ip,"PUSHW["+t+"]");for(var o=0;o<t;o++){var i=a[++n]<<8|a[++n];32768&i&&(i=-(1+(65535^i))),s.push(i)}r.ip=n}function fs(t,r,n,a,s,o){var i,u,l,p,c=o.stack,h=t&&c.pop(),f=c.pop(),d=o.rp0,g=o.z0[d],v=o.z1[f],m=o.minDis,y=o.fv,b=o.dpv;l=(u=i=b.distance(v,g,!0,!0))>=0?1:-1,u=Math.abs(u),t&&(p=o.cvt[h],a&&Math.abs(u-p)<o.cvCutIn&&(u=p)),n&&u<m&&(u=m),a&&(u=o.round(u)),y.setRelative(v,g,l*u,b),y.touch(v),e.DEBUG&&console.log(o.step,(t?"MIRP[":"MDRP[")+(r?"M":"m")+(n?">":"_")+(a?"R":"_")+(0===s?"Gr":1===s?"Bl":2===s?"Wh":"")+"]",t?h+"("+o.cvt[h]+","+p+")":"",f,"(d =",i,"->",l*u,")"),o.rp1=o.rp0,o.rp2=f,r&&(o.rp0=f)}function ds(e){this.char=e,this.state={},this.activeState=null}function gs(e,t,r){this.contextName=r,this.startIndex=e,this.endOffset=t}function vs(e,t,r){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=t,this.checkEnd=r}function ms(e,t){this.context=e,this.index=t,this.length=e.length,this.current=e[t],this.backtrack=e.slice(0,t),this.lookahead=e.slice(t+1)}function ys(e){this.eventId=e,this.subscribers=[]}function bs(e){var t=this,r=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];r.forEach((function(e){Object.defineProperty(t.events,e,{value:new ys(e)})})),e&&r.forEach((function(r){var n=e[r];"function"==typeof n&&t.events[r].subscribe(n)})),["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"].forEach((function(e){t.events[e].subscribe(t.updateContextsRanges)}))}function Ss(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],bs.call(this,e)}function xs(e){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e)}function Ts(e){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(e)}function Us(e){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e)}function ks(e){return/[A-z]/.test(e)}function Es(e){return/\s/.test(e)}function Os(e){this.font=e,this.features={}}function ws(e){this.id=e.id,this.tag=e.tag,this.substitution=e.substitution}function Rs(e,t){if(!e)return-1;switch(t.format){case 1:return t.glyphs.indexOf(e);case 2:for(var r=t.ranges,n=0;n<r.length;n++){var a=r[n];if(e>=a.start&&e<=a.end){var s=e-a.start;return a.index+s}}break;default:return-1}return-1}function Ls(e,t){return-1===Rs(e,t.coverage)?null:e+t.deltaGlyphId}function Cs(e,t){var r=Rs(e,t.coverage);return-1===r?null:t.substitute[r]}function Ds(e,t){for(var r=[],n=0;n<e.length;n++){var a=e[n],s=t.current,o=Rs(s=Array.isArray(s)?s[0]:s,a);-1!==o&&r.push(o)}return r.length!==e.length?-1:r}function Is(e,t){var r=t.inputCoverage.length+t.lookaheadCoverage.length+t.backtrackCoverage.length;if(e.context.length<r)return[];var n=Ds(t.inputCoverage,e);if(-1===n)return[];var a=t.inputCoverage.length-1;if(e.lookahead.length<t.lookaheadCoverage.length)return[];for(var s=e.lookahead.slice(a);s.length&&Us(s[0].char);)s.shift();var o=new ms(s,0),i=Ds(t.lookaheadCoverage,o),u=[].concat(e.backtrack);for(u.reverse();u.length&&Us(u[0].char);)u.shift();if(u.length<t.backtrackCoverage.length)return[];var l=new ms(u,0),p=Ds(t.backtrackCoverage,l),c=[];if(n.length===t.inputCoverage.length&&i.length===t.lookaheadCoverage.length&&p.length===t.backtrackCoverage.length)for(var h=0;h<t.lookupRecords.length;h++)for(var f=t.lookupRecords[h].lookupListIndex,d=this.getLookupByIndex(f),g=0;g<d.subtables.length;g++){var v=d.subtables[g],m=this.getLookupMethod(d,v);if("12"===this.getSubstitutionType(d,v))for(var y=0;y<n.length;y++){var b=m(e.get(y));b&&c.push(b)}}return c}function Bs(e,t){var r,n=Rs(e.current,t.coverage);if(-1===n)return null;for(var a=t.ligatureSets[n],s=0;s<a.length;s++){r=a[s];for(var o=0;o<r.components.length&&e.lookahead[o]===r.components[o];o++)if(o===r.components.length-1)return r}return null}function Fs(e,t){var r=Rs(e,t.coverage);return-1===r?null:t.sequences[r]}function Gs(e){var t=e.current,r=e.get(-1);return null===r&&xs(t)||!xs(r)&&xs(t)}function Ms(e){var t=e.get(1);return null===t||!xs(t)}an.prototype.exec=function(t,r){if("number"!=typeof r)throw new Error("Point size is not a number!");if(!(this._errorState>2)){var n=this.font,a=this._prepState;if(!a||a.ppem!==r){var s=this._fpgmState;if(!s){Sn.prototype=bn,(s=this._fpgmState=new Sn("fpgm",n.tables.fpgm)).funcs=[],s.font=n,e.DEBUG&&(console.log("---EXEC FPGM---"),s.step=-1);try{en(s)}catch(e){return console.log("Hinting error in FPGM:"+e),void(this._errorState=3)}}Sn.prototype=s,(a=this._prepState=new Sn("prep",n.tables.prep)).ppem=r;var o=n.tables.cvt;if(o)for(var i=a.cvt=new Array(o.length),u=r/n.unitsPerEm,l=0;l<o.length;l++)i[l]=o[l]*u;else a.cvt=[];e.DEBUG&&(console.log("---EXEC PREP---"),a.step=-1);try{en(a)}catch(e){this._errorState<2&&console.log("Hinting error in PREP:"+e),this._errorState=2}}if(!(this._errorState>1))try{return tn(t,a)}catch(e){return this._errorState<1&&(console.log("Hinting error:"+e),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}}},tn=function(t,r){var n,a,s,o=r.ppem/r.font.unitsPerEm,i=o,u=t.components;if(Sn.prototype=r,u){var l=r.font;a=[],n=[];for(var p=0;p<u.length;p++){var c=u[p],h=l.glyphs.get(c.glyphIndex);s=new Sn("glyf",h.instructions),e.DEBUG&&(console.log("---EXEC COMP "+p+"---"),s.step=-1),rn(h,s,o,i);for(var f=Math.round(c.dx*o),d=Math.round(c.dy*i),g=s.gZone,v=s.contours,m=0;m<g.length;m++){var y=g[m];y.xTouched=y.yTouched=!1,y.xo=y.x=y.x+f,y.yo=y.y=y.y+d}var b=a.length;a.push.apply(a,g);for(var S=0;S<v.length;S++)n.push(v[S]+b)}t.instructions&&!s.inhibitGridFit&&((s=new Sn("glyf",t.instructions)).gZone=s.z0=s.z1=s.z2=a,s.contours=n,a.push(new mn(0,0),new mn(Math.round(t.advanceWidth*o),0)),e.DEBUG&&(console.log("---EXEC COMPOSITE---"),s.step=-1),en(s),a.length-=2)}else s=new Sn("glyf",t.instructions),e.DEBUG&&(console.log("---EXEC GLYPH---"),s.step=-1),rn(t,s,o,i),a=s.gZone;return a},rn=function(t,r,n,a){for(var s,o,i,u=t.points||[],l=u.length,p=r.gZone=r.z0=r.z1=r.z2=[],c=r.contours=[],h=0;h<l;h++)s=u[h],p[h]=new mn(s.x*n,s.y*a,s.lastPointOfContour,s.onCurve);for(var f=0;f<l;f++)s=p[f],o||(o=s,c.push(f)),s.lastPointOfContour?(s.nextPointOnContour=o,o.prevPointOnContour=s,o=void 0):(i=p[f+1],s.nextPointOnContour=i,i.prevPointOnContour=s);if(!r.inhibitGridFit){if(e.DEBUG){console.log("PROCESSING GLYPH",r.stack);for(var d=0;d<l;d++)console.log(d,p[d].x,p[d].y)}if(p.push(new mn(0,0),new mn(Math.round(t.advanceWidth*n),0)),en(r),p.length-=2,e.DEBUG){console.log("FINISHED GLYPH",r.stack);for(var g=0;g<l;g++)console.log(g,p[g].x,p[g].y)}}},en=function(t){var r=t.prog;if(r){var n,a=r.length;for(t.ip=0;t.ip<a;t.ip++){if(e.DEBUG&&t.step++,!(n=$r[r[t.ip]]))throw new Error("unknown instruction: 0x"+Number(r[t.ip]).toString(16));n(t)}}},$r=[Un.bind(void 0,dn),Un.bind(void 0,fn),kn.bind(void 0,dn),kn.bind(void 0,fn),En.bind(void 0,dn),En.bind(void 0,fn),On.bind(void 0,0),On.bind(void 0,1),wn.bind(void 0,0),wn.bind(void 0,1),Rn,Ln,Cn,Dn,In,Bn,Fn,Gn,Mn,Nn,An,Pn,_n,Hn,zn,Wn,Vn,qn,Xn,jn,void 0,void 0,Yn,Zn,Qn,Kn,Jn,ta,ra,void 0,void 0,void 0,$n,ea,na,void 0,aa.bind(void 0,0),aa.bind(void 0,1),sa.bind(void 0,dn),sa.bind(void 0,fn),oa.bind(void 0,0),oa.bind(void 0,1),ia.bind(void 0,0),ia.bind(void 0,1),ua.bind(void 0,0),ua.bind(void 0,1),la,pa,ca.bind(void 0,0),ca.bind(void 0,1),ha,fa,da.bind(void 0,0),da.bind(void 0,1),ga,va,ma,ya,ba,Sa,xa.bind(void 0,0),xa.bind(void 0,1),void 0,Ta.bind(void 0,0),Ta.bind(void 0,1),Ua,void 0,ka,void 0,void 0,Ea,Oa,wa,Ra,La,Ca,Da,Ia,Ba,Fa,Ga,Ma,Na,Aa.bind(void 0,1),Pa,_a,Ha,za,Wa,Va,qa,Xa,ja,Ya,Za.bind(void 0,0),Za.bind(void 0,1),Za.bind(void 0,2),Za.bind(void 0,3),void 0,void 0,void 0,void 0,Qa,Aa.bind(void 0,2),Aa.bind(void 0,3),Ka.bind(void 0,1),Ka.bind(void 0,2),Ka.bind(void 0,3),Ja,$a,void 0,void 0,es,void 0,ts,rs,Zn,Zn,void 0,void 0,void 0,void 0,void 0,ns,as.bind(void 0,0),as.bind(void 0,1),ss,void 0,os,is,us,ls,ps,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,cs.bind(void 0,1),cs.bind(void 0,2),cs.bind(void 0,3),cs.bind(void 0,4),cs.bind(void 0,5),cs.bind(void 0,6),cs.bind(void 0,7),cs.bind(void 0,8),hs.bind(void 0,1),hs.bind(void 0,2),hs.bind(void 0,3),hs.bind(void 0,4),hs.bind(void 0,5),hs.bind(void 0,6),hs.bind(void 0,7),hs.bind(void 0,8),fs.bind(void 0,0,0,0,0,0),fs.bind(void 0,0,0,0,0,1),fs.bind(void 0,0,0,0,0,2),fs.bind(void 0,0,0,0,0,3),fs.bind(void 0,0,0,0,1,0),fs.bind(void 0,0,0,0,1,1),fs.bind(void 0,0,0,0,1,2),fs.bind(void 0,0,0,0,1,3),fs.bind(void 0,0,0,1,0,0),fs.bind(void 0,0,0,1,0,1),fs.bind(void 0,0,0,1,0,2),fs.bind(void 0,0,0,1,0,3),fs.bind(void 0,0,0,1,1,0),fs.bind(void 0,0,0,1,1,1),fs.bind(void 0,0,0,1,1,2),fs.bind(void 0,0,0,1,1,3),fs.bind(void 0,0,1,0,0,0),fs.bind(void 0,0,1,0,0,1),fs.bind(void 0,0,1,0,0,2),fs.bind(void 0,0,1,0,0,3),fs.bind(void 0,0,1,0,1,0),fs.bind(void 0,0,1,0,1,1),fs.bind(void 0,0,1,0,1,2),fs.bind(void 0,0,1,0,1,3),fs.bind(void 0,0,1,1,0,0),fs.bind(void 0,0,1,1,0,1),fs.bind(void 0,0,1,1,0,2),fs.bind(void 0,0,1,1,0,3),fs.bind(void 0,0,1,1,1,0),fs.bind(void 0,0,1,1,1,1),fs.bind(void 0,0,1,1,1,2),fs.bind(void 0,0,1,1,1,3),fs.bind(void 0,1,0,0,0,0),fs.bind(void 0,1,0,0,0,1),fs.bind(void 0,1,0,0,0,2),fs.bind(void 0,1,0,0,0,3),fs.bind(void 0,1,0,0,1,0),fs.bind(void 0,1,0,0,1,1),fs.bind(void 0,1,0,0,1,2),fs.bind(void 0,1,0,0,1,3),fs.bind(void 0,1,0,1,0,0),fs.bind(void 0,1,0,1,0,1),fs.bind(void 0,1,0,1,0,2),fs.bind(void 0,1,0,1,0,3),fs.bind(void 0,1,0,1,1,0),fs.bind(void 0,1,0,1,1,1),fs.bind(void 0,1,0,1,1,2),fs.bind(void 0,1,0,1,1,3),fs.bind(void 0,1,1,0,0,0),fs.bind(void 0,1,1,0,0,1),fs.bind(void 0,1,1,0,0,2),fs.bind(void 0,1,1,0,0,3),fs.bind(void 0,1,1,0,1,0),fs.bind(void 0,1,1,0,1,1),fs.bind(void 0,1,1,0,1,2),fs.bind(void 0,1,1,0,1,3),fs.bind(void 0,1,1,1,0,0),fs.bind(void 0,1,1,1,0,1),fs.bind(void 0,1,1,1,0,2),fs.bind(void 0,1,1,1,0,3),fs.bind(void 0,1,1,1,1,0),fs.bind(void 0,1,1,1,1,1),fs.bind(void 0,1,1,1,1,2),fs.bind(void 0,1,1,1,1,3)],ds.prototype.setState=function(e,t){return this.state[e]=t,this.activeState={key:e,value:this.state[e]},this.activeState},ds.prototype.getState=function(e){return this.state[e]||null},Ss.prototype.inboundIndex=function(e){return e>=0&&e<this.tokens.length},Ss.prototype.composeRUD=function(e){var t=this,r=!0,n=e.map((function(e){return t[e[0]].apply(t,e.slice(1).concat(r))})),a=function(e){return"object"==typeof e&&e.hasOwnProperty("FAIL")};if(n.every(a))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:n.filter(a)};this.dispatch("composeRUD",[n.filter((function(e){return!a(e)}))])},Ss.prototype.replaceRange=function(e,t,r,n){t=null!==t?t:this.tokens.length;var a=r.every((function(e){return e instanceof ds}));if(!isNaN(e)&&this.inboundIndex(e)&&a){var s=this.tokens.splice.apply(this.tokens,[e,t].concat(r));return n||this.dispatch("replaceToken",[e,t,r]),[s,r]}return{FAIL:"replaceRange: invalid tokens or startIndex."}},Ss.prototype.replaceToken=function(e,t,r){if(!isNaN(e)&&this.inboundIndex(e)&&t instanceof ds){var n=this.tokens.splice(e,1,t);return r||this.dispatch("replaceToken",[e,t]),[n[0],t]}return{FAIL:"replaceToken: invalid token or index."}},Ss.prototype.removeRange=function(e,t,r){t=isNaN(t)?this.tokens.length:t;var n=this.tokens.splice(e,t);return r||this.dispatch("removeRange",[n,e,t]),n},Ss.prototype.removeToken=function(e,t){if(!isNaN(e)&&this.inboundIndex(e)){var r=this.tokens.splice(e,1);return t||this.dispatch("removeToken",[r,e]),r}return{FAIL:"removeToken: invalid token index."}},Ss.prototype.insertToken=function(e,t,r){return e.every((function(e){return e instanceof ds}))?(this.tokens.splice.apply(this.tokens,[t,0].concat(e)),r||this.dispatch("insertToken",[e,t]),e):{FAIL:"insertToken: invalid token(s)."}},Ss.prototype.registerModifier=function(e,t,r){this.events.newToken.subscribe((function(n,a){var s=[n,a],o=[n,a];if(null===t||!0===t.apply(this,s)){var i=r.apply(this,o);n.setState(e,i)}})),this.registeredModifiers.push(e)},ys.prototype.subscribe=function(e){return"function"==typeof e?this.subscribers.push(e)-1:{FAIL:"invalid '"+this.eventId+"' event handler"}},ys.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)},ms.prototype.setCurrentIndex=function(e){this.index=e,this.current=this.context[e],this.backtrack=this.context.slice(0,e),this.lookahead=this.context.slice(e+1)},ms.prototype.get=function(e){switch(!0){case 0===e:return this.current;case e<0&&Math.abs(e)<=this.backtrack.length:return this.backtrack.slice(e)[0];case e>0&&e<=this.lookahead.length:return this.lookahead[e-1];default:return null}},Ss.prototype.rangeToText=function(e){if(e instanceof gs)return this.getRangeTokens(e).map((function(e){return e.char})).join("")},Ss.prototype.getText=function(){return this.tokens.map((function(e){return e.char})).join("")},Ss.prototype.getContext=function(e){var t=this.registeredContexts[e];return t||null},Ss.prototype.on=function(e,t){var r=this.events[e];return r?r.subscribe(t):null},Ss.prototype.dispatch=function(e,t){var r=this,n=this.events[e];n instanceof ys&&n.subscribers.forEach((function(e){e.apply(r,t||[])}))},Ss.prototype.registerContextChecker=function(e,t,r){if(this.getContext(e))return{FAIL:"context name '"+e+"' is already registered."};if("function"!=typeof t)return{FAIL:"missing context start check."};if("function"!=typeof r)return{FAIL:"missing context end check."};var n=new vs(e,t,r);return this.registeredContexts[e]=n,this.contextCheckers.push(n),n},Ss.prototype.getRangeTokens=function(e){var t=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,t))},Ss.prototype.getContextRanges=function(e){var t=this.getContext(e);return t?t.ranges:{FAIL:"context checker '"+e+"' is not registered."}},Ss.prototype.resetContextsRanges=function(){var e=this.registeredContexts;for(var t in e)e.hasOwnProperty(t)&&(e[t].ranges=[])},Ss.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var e=this.tokens.map((function(e){return e.char})),t=0;t<e.length;t++){var r=new ms(e,t);this.runContextCheck(r)}this.dispatch("updateContextsRanges",[this.registeredContexts])},Ss.prototype.setEndOffset=function(e,t){var r=new gs(this.getContext(t).openRange.startIndex,e,t),n=this.getContext(t).ranges;return r.rangeId=t+"."+n.length,n.push(r),this.getContext(t).openRange=null,r},Ss.prototype.runContextCheck=function(e){var t=this,r=e.index;this.contextCheckers.forEach((function(n){var a=n.contextName,s=t.getContext(a).openRange;if(!s&&n.checkStart(e)&&(s=new gs(r,null,a),t.getContext(a).openRange=s,t.dispatch("contextStart",[a,r])),s&&n.checkEnd(e)){var o=r-s.startIndex+1,i=t.setEndOffset(o,a);t.dispatch("contextEnd",[a,i])}}))},Ss.prototype.tokenize=function(e){this.tokens=[],this.resetContextsRanges();var t=Array.from(e);this.dispatch("start");for(var r=0;r<t.length;r++){var n=t[r],a=new ms(t,r);this.dispatch("next",[a]),this.runContextCheck(a);var s=new ds(n);this.tokens.push(s),this.dispatch("newToken",[s,a])}return this.dispatch("end",[this.tokens]),this.tokens},Os.prototype.getDefaultScriptFeaturesIndexes=function(){for(var e=this.font.tables.gsub.scripts,t=0;t<e.length;t++){var r=e[t];if("DFLT"===r.tag)return r.script.defaultLangSys.featureIndexes}return[]},Os.prototype.getScriptFeaturesIndexes=function(e){if(!this.font.tables.gsub)return[];if(!e)return this.getDefaultScriptFeaturesIndexes();for(var t=this.font.tables.gsub.scripts,r=0;r<t.length;r++){var n=t[r];if(n.tag===e&&n.script.defaultLangSys)return n.script.defaultLangSys.featureIndexes;var a=n.langSysRecords;if(a)for(var s=0;s<a.length;s++){var o=a[s];if(o.tag===e)return o.langSys.featureIndexes}}return this.getDefaultScriptFeaturesIndexes()},Os.prototype.mapTagsToFeatures=function(e,t){for(var r={},n=0;n<e.length;n++){var a=e[n].tag,s=e[n].feature;r[a]=s}this.features[t].tags=r},Os.prototype.getScriptFeatures=function(e){var t=this.features[e];if(this.features.hasOwnProperty(e))return t;var r=this.getScriptFeaturesIndexes(e);if(!r)return null;var n=this.font.tables.gsub;return t=r.map((function(e){return n.features[e]})),this.features[e]=t,this.mapTagsToFeatures(t,e),t},Os.prototype.getSubstitutionType=function(e,t){return e.lookupType.toString()+t.substFormat.toString()},Os.prototype.getLookupMethod=function(e,t){var r=this;switch(this.getSubstitutionType(e,t)){case"11":return function(e){return Ls.apply(r,[e,t])};case"12":return function(e){return Cs.apply(r,[e,t])};case"63":return function(e){return Is.apply(r,[e,t])};case"41":return function(e){return Bs.apply(r,[e,t])};case"21":return function(e){return Fs.apply(r,[e,t])};default:throw new Error("lookupType: "+e.lookupType+" - substFormat: "+t.substFormat+" is not yet supported")}},Os.prototype.lookupFeature=function(e){var t=e.contextParams,r=t.index,n=this.getFeature({tag:e.tag,script:e.script});if(!n)return new Error("font '"+this.font.names.fullName.en+"' doesn't support feature '"+e.tag+"' for script '"+e.script+"'.");for(var a=this.getFeatureLookups(n),s=[].concat(t.context),o=0;o<a.length;o++)for(var i=a[o],u=this.getLookupSubtables(i),l=0;l<u.length;l++){var p=u[l],c=this.getSubstitutionType(i,p),h=this.getLookupMethod(i,p),f=void 0;switch(c){case"11":(f=h(t.current))&&s.splice(r,1,new ws({id:11,tag:e.tag,substitution:f}));break;case"12":(f=h(t.current))&&s.splice(r,1,new ws({id:12,tag:e.tag,substitution:f}));break;case"63":f=h(t),Array.isArray(f)&&f.length&&s.splice(r,1,new ws({id:63,tag:e.tag,substitution:f}));break;case"41":(f=h(t))&&s.splice(r,1,new ws({id:41,tag:e.tag,substitution:f}));break;case"21":(f=h(t.current))&&s.splice(r,1,new ws({id:21,tag:e.tag,substitution:f}))}t=new ms(s,r),Array.isArray(f)&&!f.length||(f=null)}return s.length?s:null},Os.prototype.supports=function(e){if(!e.script)return!1;this.getScriptFeatures(e.script);var t=this.features.hasOwnProperty(e.script);if(!e.tag)return t;var r=this.features[e.script].some((function(t){return t.tag===e.tag}));return t&&r},Os.prototype.getLookupSubtables=function(e){return e.subtables||null},Os.prototype.getLookupByIndex=function(e){return this.font.tables.gsub.lookups[e]||null},Os.prototype.getFeatureLookups=function(e){return e.lookupListIndexes.map(this.getLookupByIndex.bind(this))},Os.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}};var Ns={startCheck:Gs,endCheck:Ms};function As(e){var t=e.current,r=e.get(-1);return(xs(t)||Us(t))&&!xs(r)}function Ps(e){var t=e.get(1);switch(!0){case null===t:return!0;case!xs(t)&&!Us(t):var r=Es(t);if(!r)return!0;if(r&&!e.lookahead.some((function(e){return xs(e)||Us(e)})))return!0;break;default:return!1}}var _s={startCheck:As,endCheck:Ps};function Hs(e,t,r){t[r].setState(e.tag,e.substitution)}function zs(e,t,r){t[r].setState(e.tag,e.substitution)}function Ws(e,t,r){e.substitution.forEach((function(n,a){t[r+a].setState(e.tag,n)}))}function Vs(e,t,r){var n=t[r];n.setState(e.tag,e.substitution.ligGlyph);for(var a=e.substitution.components.length,s=0;s<a;s++)(n=t[r+s+1]).setState("deleted",!0)}var qs={11:Hs,12:zs,63:Ws,41:Vs};function Xs(e,t,r){e instanceof ws&&qs[e.id]&&qs[e.id](e,t,r)}function js(e){for(var t=[].concat(e.backtrack),r=t.length-1;r>=0;r--){var n=t[r],a=Ts(n),s=Us(n);if(!a&&!s)return!0;if(a)return!1}return!1}function Ys(e){if(Ts(e.current))return!1;for(var t=0;t<e.lookahead.length;t++)if(!Us(e.lookahead[t]))return!0;return!1}function Zs(e){var t=this,r="arab",n=this.featuresTags[r],a=this.tokenizer.getRangeTokens(e);if(1!==a.length){var s=new ms(a.map((function(e){return e.getState("glyphIndex")})),0),o=new ms(a.map((function(e){return e.char})),0);a.forEach((function(e,i){if(!Us(e.char)){s.setCurrentIndex(i),o.setCurrentIndex(i);var u,l=0;switch(js(o)&&(l|=1),Ys(o)&&(l|=2),l){case 1:u="fina";break;case 2:u="init";break;case 3:u="medi"}if(-1!==n.indexOf(u)){var p=t.query.lookupFeature({tag:u,script:r,contextParams:s});if(p instanceof Error)return console.info(p.message);p.forEach((function(e,t){e instanceof ws&&(Xs(e,a,t),s.context[t]=e.substitution)}))}}}))}}function Qs(e,t){return new ms(e.map((function(e){return e.activeState.value})),t||0)}function Ks(e){var t=this,r="arab",n=this.tokenizer.getRangeTokens(e),a=Qs(n);a.context.forEach((function(e,s){a.setCurrentIndex(s);var o=t.query.lookupFeature({tag:"rlig",script:r,contextParams:a});o.length&&(o.forEach((function(e){return Xs(e,n,s)})),a=Qs(n))}))}function Js(e){var t=e.current,r=e.get(-1);return null===r&&ks(t)||!ks(r)&&ks(t)}function $s(e){var t=e.get(1);return null===t||!ks(t)}var eo={startCheck:Js,endCheck:$s};function to(e,t){return new ms(e.map((function(e){return e.activeState.value})),t||0)}function ro(e){var t=this,r="latn",n=this.tokenizer.getRangeTokens(e),a=to(n);a.context.forEach((function(e,s){a.setCurrentIndex(s);var o=t.query.lookupFeature({tag:"liga",script:r,contextParams:a});o.length&&(o.forEach((function(e){return Xs(e,n,s)})),a=to(n))}))}function no(e){this.baseDir=e||"ltr",this.tokenizer=new Ss,this.featuresTags={}}function ao(e){var t=this.contextChecks[e+"Check"];return this.tokenizer.registerContextChecker(e,t.startCheck,t.endCheck)}function so(){return ao.call(this,"latinWord"),ao.call(this,"arabicWord"),ao.call(this,"arabicSentence"),this.tokenizer.tokenize(this.text)}function oo(){var e=this;this.tokenizer.getContextRanges("arabicSentence").forEach((function(t){var r=e.tokenizer.getRangeTokens(t);e.tokenizer.replaceRange(t.startIndex,t.endOffset,r.reverse())}))}function io(){if(-1===this.tokenizer.registeredModifiers.indexOf("glyphIndex"))throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function uo(){var e=this,t="arab";this.featuresTags.hasOwnProperty(t)&&(io.call(this),this.tokenizer.getContextRanges("arabicWord").forEach((function(t){Zs.call(e,t)})))}function lo(){var e=this,t="arab";this.featuresTags.hasOwnProperty(t)&&-1!==this.featuresTags[t].indexOf("rlig")&&(io.call(this),this.tokenizer.getContextRanges("arabicWord").forEach((function(t){Ks.call(e,t)})))}function po(){var e=this,t="latn";this.featuresTags.hasOwnProperty(t)&&-1!==this.featuresTags[t].indexOf("liga")&&(io.call(this),this.tokenizer.getContextRanges("latinWord").forEach((function(t){ro.call(e,t)})))}function co(e){(e=e||{}).tables=e.tables||{},e.empty||(Wr(e.familyName,"When creating a new Font object, familyName is required."),Wr(e.styleName,"When creating a new Font object, styleName is required."),Wr(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Wr(e.ascender,"When creating a new Font object, ascender is required."),Wr(e.descender<=0,"When creating a new Font object, negative descender value is required."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||(e.familyName+e.styleName).replace(/\s/g,"")},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables=Object.assign(e.tables,{os2:Object.assign({usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR},e.tables.os2)})),this.supported=!0,this.glyphs=new qe.GlyphSet(this,e.glyphs||[]),this.encoding=new Le(this),this.position=new Mr(this),this.substitution=new Nr(this),this.tables=this.tables||{},this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new an(this):void 0}})}function ho(e,t){var r=JSON.stringify(e),n=256;for(var a in t){var s=parseInt(a);if(s&&!(s<256)){if(JSON.stringify(t[a])===r)return s;n<=s&&(n=s+1)}}return t[n]=e,n}function fo(e,t,r){var n=ho(t.name,r);return[{name:"tag_"+e,type:"TAG",value:t.tag},{name:"minValue_"+e,type:"FIXED",value:t.minValue<<16},{name:"defaultValue_"+e,type:"FIXED",value:t.defaultValue<<16},{name:"maxValue_"+e,type:"FIXED",value:t.maxValue<<16},{name:"flags_"+e,type:"USHORT",value:0},{name:"nameID_"+e,type:"USHORT",value:n}]}function go(e,t,r){var n={},a=new me.Parser(e,t);return n.tag=a.parseTag(),n.minValue=a.parseFixed(),n.defaultValue=a.parseFixed(),n.maxValue=a.parseFixed(),a.skip("uShort",1),n.name=r[a.parseUShort()]||{},n}function vo(e,t,r,n){for(var a=[{name:"nameID_"+e,type:"USHORT",value:ho(t.name,n)},{name:"flags_"+e,type:"USHORT",value:0}],s=0;s<r.length;++s){var o=r[s].tag;a.push({name:"axis_"+e+" "+o,type:"FIXED",value:t.coordinates[o]<<16})}return a}function mo(e,t,r,n){var a={},s=new me.Parser(e,t);a.name=n[s.parseUShort()]||{},s.skip("uShort",1),a.coordinates={};for(var o=0;o<r.length;++o)a.coordinates[r[o].tag]=s.parseFixed();return a}function yo(e,t){var r=new ae.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:e.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:e.instances.length},{name:"instanceSize",type:"USHORT",value:4+4*e.axes.length}]);r.offsetToData=r.sizeOf();for(var n=0;n<e.axes.length;n++)r.fields=r.fields.concat(fo(n,e.axes[n],t));for(var a=0;a<e.instances.length;a++)r.fields=r.fields.concat(vo(a,e.instances[a],e.axes,t));return r}function bo(e,t,r){var n=new me.Parser(e,t),a=n.parseULong();F.argument(65536===a,"Unsupported fvar table version.");var s=n.parseOffset16();n.skip("uShort",1);for(var o=n.parseUShort(),i=n.parseUShort(),u=n.parseUShort(),l=n.parseUShort(),p=[],c=0;c<o;c++)p.push(go(e,t+s+c*i,r));for(var h=[],f=t+s+o*i,d=0;d<u;d++)h.push(mo(e,f+d*l,p,r));return{axes:p,instances:h}}no.prototype.setText=function(e){this.text=e},no.prototype.contextChecks={latinWordCheck:eo,arabicWordCheck:Ns,arabicSentenceCheck:_s},no.prototype.registerFeatures=function(e,t){var r=this,n=t.filter((function(t){return r.query.supports({script:e,tag:t})}));this.featuresTags.hasOwnProperty(e)?this.featuresTags[e]=this.featuresTags[e].concat(n):this.featuresTags[e]=n},no.prototype.applyFeatures=function(e,t){if(!e)throw new Error("No valid font was provided to apply features");this.query||(this.query=new Os(e));for(var r=0;r<t.length;r++){var n=t[r];this.query.supports({script:n.script})&&this.registerFeatures(n.script,n.tags)}},no.prototype.registerModifier=function(e,t,r){this.tokenizer.registerModifier(e,t,r)},no.prototype.checkContextReady=function(e){return!!this.tokenizer.getContext(e)},no.prototype.applyFeaturesToContexts=function(){this.checkContextReady("arabicWord")&&(uo.call(this),lo.call(this)),this.checkContextReady("latinWord")&&po.call(this),this.checkContextReady("arabicSentence")&&oo.call(this)},no.prototype.processText=function(e){this.text&&this.text===e||(this.setText(e),so.call(this),this.applyFeaturesToContexts())},no.prototype.getBidiText=function(e){return this.processText(e),this.tokenizer.getText()},no.prototype.getTextGlyphs=function(e){this.processText(e);for(var t=[],r=0;r<this.tokenizer.tokens.length;r++){var n=this.tokenizer.tokens[r];if(!n.state.deleted){var a=n.activeState.value;t.push(Array.isArray(a)?a[0]:a)}}return t},co.prototype.hasChar=function(e){return null!==this.encoding.charToGlyphIndex(e)},co.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},co.prototype.charToGlyph=function(e){var t=this.charToGlyphIndex(e),r=this.glyphs.get(t);return r||(r=this.glyphs.get(0)),r},co.prototype.updateFeatures=function(e){return this.defaultRenderOptions.features.map((function(t){return"latn"===t.script?{script:"latn",tags:t.tags.filter((function(t){return e[t]}))}:t}))},co.prototype.stringToGlyphs=function(e,t){var r=this,n=new no,a=function(e){return r.charToGlyphIndex(e.char)};n.registerModifier("glyphIndex",null,a);var s=t?this.updateFeatures(t.features):this.defaultRenderOptions.features;n.applyFeatures(this,s);for(var o=n.getTextGlyphs(e),i=o.length,u=new Array(i),l=this.glyphs.get(0),p=0;p<i;p+=1)u[p]=this.glyphs.get(o[p])||l;return u},co.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},co.prototype.nameToGlyph=function(e){var t=this.nameToGlyphIndex(e),r=this.glyphs.get(t);return r||(r=this.glyphs.get(0)),r},co.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},co.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;var r=this.position.defaultKerningTables;return r?this.position.getKerningValue(r,e,t):this.kerningPairs[e+","+t]||0},co.prototype.defaultRenderOptions={kerning:!0,features:[{script:"arab",tags:["init","medi","fina","rlig"]},{script:"latn",tags:["liga","rlig"]}]},co.prototype.forEachGlyph=function(e,t,r,n,a,s){t=void 0!==t?t:0,r=void 0!==r?r:0,n=void 0!==n?n:72,a=Object.assign({},this.defaultRenderOptions,a);var o,i=1/this.unitsPerEm*n,u=this.stringToGlyphs(e,a);if(a.kerning){var l=a.script||this.position.getDefaultScriptName();o=this.position.getKerningTables(l,a.language)}for(var p=0;p<u.length;p+=1){var c=u[p];s.call(this,c,t,r,n,a),c.advanceWidth&&(t+=c.advanceWidth*i),a.kerning&&p<u.length-1&&(t+=(o?this.position.getKerningValue(o,c.index,u[p+1].index):this.getKerningValue(c,u[p+1]))*i),a.letterSpacing?t+=a.letterSpacing*n:a.tracking&&(t+=a.tracking/1e3*n)}return t},co.prototype.getPath=function(e,t,r,n,a){var s=new D;return this.forEachGlyph(e,t,r,n,a,(function(e,t,r,n){var o=e.getPath(t,r,n,a,this);s.extend(o)})),s},co.prototype.getPaths=function(e,t,r,n,a){var s=[];return this.forEachGlyph(e,t,r,n,a,(function(e,t,r,n){var o=e.getPath(t,r,n,a,this);s.push(o)})),s},co.prototype.getAdvanceWidth=function(e,t,r){return this.forEachGlyph(e,0,0,t,r,(function(){}))},co.prototype.draw=function(e,t,r,n,a,s){this.getPath(t,r,n,a,s).draw(e)},co.prototype.drawPoints=function(e,t,r,n,a,s){this.forEachGlyph(t,r,n,a,s,(function(t,r,n,a){t.drawPoints(e,r,n,a)}))},co.prototype.drawMetrics=function(e,t,r,n,a,s){this.forEachGlyph(t,r,n,a,s,(function(t,r,n,a){t.drawMetrics(e,r,n,a)}))},co.prototype.getEnglishName=function(e){var t=this.names[e];if(t)return t.en},co.prototype.validate=function(){var e=this;function t(e,t){}function r(r){var n=e.getEnglishName(r);t(n&&n.trim().length>0)}r("fontFamily"),r("weightName"),r("manufacturer"),r("copyright"),r("version"),t(this.unitsPerEm>0)},co.prototype.toTables=function(){return Dr.fontToTable(this)},co.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},co.prototype.toArrayBuffer=function(){for(var e=this.toTables().encode(),t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n<e.length;n++)r[n]=e[n];return t},co.prototype.download=function(e){var t=this.getEnglishName("fontFamily"),n=this.getEnglishName("fontSubfamily");e=e||t.replace(/\s/g,"")+"-"+n+".otf";var a=this.toArrayBuffer();if(_r())if(window.URL=window.URL||window.webkitURL,window.URL){var s=new DataView(a),o=new Blob([s],{type:"font/opentype"}),i=document.createElement("a");i.href=window.URL.createObjectURL(o),i.download=e;var u=document.createEvent("MouseEvents");u.initEvent("click",!0,!1),i.dispatchEvent(u)}else console.warn("Font file could not be downloaded. Try using a different browser.");else{var l=r(256),p=zr(a);l.writeFileSync(e,p)}},co.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},co.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},co.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var So={make:yo,parse:bo},xo=function(){return{coverage:this.parsePointer(ge.coverage),attachPoints:this.parseList(ge.pointer(ge.uShortList))}},To=function(){var e=this.parseUShort();return F.argument(1===e||2===e||3===e,"Unsupported CaretValue table version."),1===e?{coordinate:this.parseShort()}:2===e?{pointindex:this.parseShort()}:3===e?{coordinate:this.parseShort()}:void 0},Uo=function(){return this.parseList(ge.pointer(To))},ko=function(){return{coverage:this.parsePointer(ge.coverage),ligGlyphs:this.parseList(ge.pointer(Uo))}},Eo=function(){return this.parseUShort(),this.parseList(ge.pointer(ge.coverage))};function Oo(e,t){var r=new ge(e,t=t||0),n=r.parseVersion(1);F.argument(1===n||1.2===n||1.3===n,"Unsupported GDEF table version.");var a={version:n,classDef:r.parsePointer(ge.classDef),attachList:r.parsePointer(xo),ligCaretList:r.parsePointer(ko),markAttachClassDef:r.parsePointer(ge.classDef)};return n>=1.2&&(a.markGlyphSets=r.parsePointer(Eo)),a}var wo={parse:Oo},Ro=new Array(10);function Lo(e,t){var r=new ge(e,t=t||0),n=r.parseVersion(1);return F.argument(1===n||1.1===n,"Unsupported GPOS table version "+n),1===n?{version:n,scripts:r.parseScriptList(),features:r.parseFeatureList(),lookups:r.parseLookupList(Ro)}:{version:n,scripts:r.parseScriptList(),features:r.parseFeatureList(),lookups:r.parseLookupList(Ro),variations:r.parseFeatureVariationsList()}}Ro[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{posFormat:1,coverage:this.parsePointer(ge.coverage),value:this.parseValueRecord()}:2===t?{posFormat:2,coverage:this.parsePointer(ge.coverage),values:this.parseValueRecordList()}:void F.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},Ro[2]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();F.assert(1===t||2===t,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var r=this.parsePointer(ge.coverage),n=this.parseUShort(),a=this.parseUShort();if(1===t)return{posFormat:t,coverage:r,valueFormat1:n,valueFormat2:a,pairSets:this.parseList(ge.pointer(ge.list((function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(n),value2:this.parseValueRecord(a)}}))))};if(2===t){var s=this.parsePointer(ge.classDef),o=this.parsePointer(ge.classDef),i=this.parseUShort(),u=this.parseUShort();return{posFormat:t,coverage:r,valueFormat1:n,valueFormat2:a,classDef1:s,classDef2:o,class1Count:i,class2Count:u,classRecords:this.parseList(i,ge.list(u,(function(){return{value1:this.parseValueRecord(n),value2:this.parseValueRecord(a)}})))}}},Ro[3]=function(){return{error:"GPOS Lookup 3 not supported"}},Ro[4]=function(){return{error:"GPOS Lookup 4 not supported"}},Ro[5]=function(){return{error:"GPOS Lookup 5 not supported"}},Ro[6]=function(){return{error:"GPOS Lookup 6 not supported"}},Ro[7]=function(){return{error:"GPOS Lookup 7 not supported"}},Ro[8]=function(){return{error:"GPOS Lookup 8 not supported"}},Ro[9]=function(){return{error:"GPOS Lookup 9 not supported"}};var Co=new Array(10);function Do(e){return new ae.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new ae.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new ae.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new ae.LookupList(e.lookups,Co)}])}var Io={parse:Lo,make:Do};function Bo(e){var t={};e.skip("uShort");var r=e.parseUShort();F.argument(0===r,"Unsupported kern sub-table version."),e.skip("uShort",2);var n=e.parseUShort();e.skip("uShort",3);for(var a=0;a<n;a+=1){var s=e.parseUShort(),o=e.parseUShort(),i=e.parseShort();t[s+","+o]=i}return t}function Fo(e){var t={};e.skip("uShort"),e.parseULong()>1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");var r=255&e.parseUShort();if(e.skip("uShort"),0===r){var n=e.parseUShort();e.skip("uShort",3);for(var a=0;a<n;a+=1){var s=e.parseUShort(),o=e.parseUShort(),i=e.parseShort();t[s+","+o]=i}}return t}function Go(e,t){var r=new me.Parser(e,t),n=r.parseUShort();if(0===n)return Bo(r);if(1===n)return Fo(r);throw new Error("Unsupported kern table version ("+n+").")}var Mo={parse:Go};function No(e,t,r,n){for(var a=new me.Parser(e,t),s=n?a.parseUShort:a.parseULong,o=[],i=0;i<r+1;i+=1){var u=s.call(a);n&&(u*=2),o.push(u)}return o}var Ao={parse:No};function Po(e,t){r(256).readFile(e,(function(e,r){if(e)return t(e.message);t(null,Hr(r))}))}function _o(e,t){var r=new XMLHttpRequest;r.open("get",e,!0),r.responseType="arraybuffer",r.onload=function(){return r.response?t(null,r.response):t("Font could not be loaded: "+r.statusText)},r.onerror=function(){t("Font could not be loaded")},r.send()}function Ho(e,t){for(var r=[],n=12,a=0;a<t;a+=1){var s=me.getTag(e,n),o=me.getULong(e,n+4),i=me.getULong(e,n+8),u=me.getULong(e,n+12);r.push({tag:s,checksum:o,offset:i,length:u,compression:!1}),n+=16}return r}function zo(e,t){for(var r=[],n=44,a=0;a<t;a+=1){var s=me.getTag(e,n),o=me.getULong(e,n+4),i=me.getULong(e,n+8),u=me.getULong(e,n+12),l=void 0;l=i<u&&"WOFF",r.push({tag:s,offset:o,compression:l,compressedLength:i,length:u}),n+=20}return r}function Wo(e,t){if("WOFF"===t.compression){var r=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),n=new Uint8Array(t.length);if(R(r,n),n.byteLength!==t.length)throw new Error("Decompression error: "+t.tag+" decompressed length doesn't match recorded length");return{data:new DataView(n.buffer,0),offset:0}}return{data:e,offset:t.offset}}function Vo(e,t){var r,n;t=null==t?{}:t;var a,s,o,i,u,l,p,c,h,f,d,g,v,m=new co({empty:!0}),y=new DataView(e,0),b=[],S=me.getTag(y,0);if(S===String.fromCharCode(0,1,0,0)||"true"===S||"typ1"===S)m.outlinesFormat="truetype",b=Ho(y,a=me.getUShort(y,4));else if("OTTO"===S)m.outlinesFormat="cff",b=Ho(y,a=me.getUShort(y,4));else{if("wOFF"!==S)throw new Error("Unsupported OpenType signature "+S);var x=me.getTag(y,4);if(x===String.fromCharCode(0,1,0,0))m.outlinesFormat="truetype";else{if("OTTO"!==x)throw new Error("Unsupported OpenType flavor "+S);m.outlinesFormat="cff"}b=zo(y,a=me.getUShort(y,12))}for(var T=0;T<a;T+=1){var U=b[T],k=void 0;switch(U.tag){case"cmap":k=Wo(y,U),m.tables.cmap=ke.parse(k.data,k.offset),m.encoding=new Ce(m.tables.cmap);break;case"cvt ":k=Wo(y,U),v=new me.Parser(k.data,k.offset),m.tables.cvt=v.parseShortList(U.length/2);break;case"fvar":o=U;break;case"fpgm":k=Wo(y,U),v=new me.Parser(k.data,k.offset),m.tables.fpgm=v.parseByteList(U.length);break;case"head":k=Wo(y,U),m.tables.head=Ct.parse(k.data,k.offset),m.unitsPerEm=m.tables.head.unitsPerEm,r=m.tables.head.indexToLocFormat;break;case"hhea":k=Wo(y,U),m.tables.hhea=Bt.parse(k.data,k.offset),m.ascender=m.tables.hhea.ascender,m.descender=m.tables.hhea.descender,m.numberOfHMetrics=m.tables.hhea.numberOfHMetrics;break;case"hmtx":c=U;break;case"ltag":k=Wo(y,U),n=Ht.parse(k.data,k.offset);break;case"maxp":k=Wo(y,U),m.tables.maxp=Vt.parse(k.data,k.offset),m.numGlyphs=m.tables.maxp.numGlyphs;break;case"name":d=U;break;case"OS/2":k=Wo(y,U),m.tables.os2=cr.parse(k.data,k.offset);break;case"post":k=Wo(y,U),m.tables.post=dr.parse(k.data,k.offset),m.glyphNames=new Ie(m.tables.post);break;case"prep":k=Wo(y,U),v=new me.Parser(k.data,k.offset),m.tables.prep=v.parseByteList(U.length);break;case"glyf":i=U;break;case"loca":f=U;break;case"CFF ":s=U;break;case"kern":h=U;break;case"GDEF":u=U;break;case"GPOS":l=U;break;case"GSUB":p=U;break;case"meta":g=U}}var E=Wo(y,d);if(m.tables.name=or.parse(E.data,E.offset,n),m.names=m.tables.name,i&&f){var O=0===r,w=Wo(y,f),R=Ao.parse(w.data,w.offset,m.numGlyphs,O),L=Wo(y,i);m.glyphs=nn.parse(L.data,L.offset,R,m,t)}else{if(!s)throw new Error("Font doesn't contain TrueType or CFF outlines.");var C=Wo(y,s);wt.parse(C.data,C.offset,m,t)}var D=Wo(y,c);if(At.parse(m,D.data,D.offset,m.numberOfHMetrics,m.numGlyphs,m.glyphs,t),Ge(m,t),h){var I=Wo(y,h);m.kerningPairs=Mo.parse(I.data,I.offset)}else m.kerningPairs={};if(u){var B=Wo(y,u);m.tables.gdef=wo.parse(B.data,B.offset)}if(l){var F=Wo(y,l);m.tables.gpos=Io.parse(F.data,F.offset),m.position.init()}if(p){var G=Wo(y,p);m.tables.gsub=Sr.parse(G.data,G.offset)}if(o){var M=Wo(y,o);m.tables.fvar=So.parse(M.data,M.offset,m.names)}if(g){var N=Wo(y,g);m.tables.meta=Ur.parse(N.data,N.offset),m.metas=m.tables.meta}return m}function qo(e,t,r){r=null==r?{}:r;var n="undefined"!=typeof window||r.isUrl?_o:Po;return new Promise((function(a,s){n(e,(function(e,n){if(e){if(t)return t(e);s(e)}var o;try{o=Vo(n,r)}catch(e){if(t)return t(e,null);s(e)}if(t)return t(null,o);a(o)}))}))}function Xo(e,t){return Vo(Hr(r(256).readFileSync(e)),t)}var jo=Object.freeze({__proto__:null,Font:co,Glyph:Pe,Path:D,BoundingBox:C,_parse:me,parse:Vo,load:qo,loadSync:Xo});e.BoundingBox=C,e.Font=co,e.Glyph=Pe,e.Path=D,e._parse=me,e.default=jo,e.load=qo,e.loadSync=Xo,e.parse=Vo,Object.defineProperty(e,"__esModule",{value:!0})}(t)}},r={};function n(e){var a=r[e];if(void 0!==a)return a.exports;var s=r[e]={exports:{}};return t[e].call(s.exports,s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const t=e.Components;var r=n.n(t);const a=e.Fields;var s=n.n(a);const o=e.X3DFieldDefinition;var i=n.n(o);const u=e.FieldDefinitionArray;var l=n.n(u);const p=e.X3DNode;var c=n.n(p);const h=e.X3DUrlObject;var f=n.n(h);const d=e.Namespace;var g=n.n(d);let v=0;const m={BEGIN:++v,FIRST:++v,MIDDLE:++v,END:++v},y=g().add("TextAlignment",m),b=(e.FileLoader,e.X3DConstants);var S=n.n(b);const x=e.URLs;var T=n.n(x);const U=new Map([["SERIF",new Map([["PLAIN",T().getFontsURL("Droid/DroidSerif-Regular.ttf")],["ITALIC",T().getFontsURL("Droid/DroidSerif-Italic.ttf")],["BOLD",T().getFontsURL("Droid/DroidSerif-Bold.ttf")],["BOLDITALIC",T().getFontsURL("Droid/DroidSerif-BoldItalic.ttf")]])],["SANS",new Map([["PLAIN",T().getFontsURL("Ubuntu/Ubuntu-R.ttf")],["ITALIC",T().getFontsURL("Ubuntu/Ubuntu-RI.ttf")],["BOLD",T().getFontsURL("Ubuntu/Ubuntu-B.ttf")],["BOLDITALIC",T().getFontsURL("Ubuntu/Ubuntu-BI.ttf")]])],["TYPEWRITER",new Map([["PLAIN",T().getFontsURL("Ubuntu/UbuntuMono-R.ttf")],["ITALIC",T().getFontsURL("Ubuntu/UbuntuMono-RI.ttf")],["BOLD",T().getFontsURL("Ubuntu/UbuntuMono-B.ttf")],["BOLDITALIC",T().getFontsURL("Ubuntu/UbuntuMono-BI.ttf")]])]]);function k(e){c().call(this,e),f().call(this,e),this.addType(S().X3DFontStyleNode),this.addChildObjects(S().inputOutput,"description",new(s().SFString),S().inputOutput,"url",this._family,S().inputOutput,"load",new(s().SFBool)(!0),S().inputOutput,"autoRefresh",new(s().SFTime)(0),S().inputOutput,"autoRefreshTimeLimit",new(s().SFTime)(3600)),this._family.setName("family"),this.familyStack=[],this.alignments=[]}Object.assign(Object.setPrototypeOf(k.prototype,c().prototype),f().prototype,{initialize(){c().prototype.initialize.call(this),f().prototype.initialize.call(this),this._style.addInterest("set_style__",this),this._justify.addInterest("set_justify__",this),this.font=null,this.familyIndex=0,this.set_justify__(),this.requestImmediateLoad().catch(Function.prototype)},set_style__(){this._load.getValue()&&(this.setLoadState(S().NOT_STARTED_STATE),this.requestImmediateLoad().catch(Function.prototype))},set_justify__(){const e=this._horizontal.getValue()?this._leftToRight.getValue():this._topToBottom.getValue();this.alignments[0]=this._justify.length>0?this.getAlignment(0,e):e?y.BEGIN:y.END;const t=this._horizontal.getValue()?this._topToBottom.getValue():this._leftToRight.getValue();this.alignments[1]=this._justify.length>1?this.getAlignment(1,t):t?y.FIRST:y.END},getMajorAlignment(){return this.alignments[0]},getMinorAlignment(){return this.alignments[1]},getAlignment(e,t){if(t)switch(this._justify[e]){case"FIRST":return y.FIRST;case"BEGIN":return y.BEGIN;case"MIDDLE":return y.MIDDLE;case"END":return y.END}else switch(this._justify[e]){case"FIRST":case"BEGIN":return y.END;case"MIDDLE":return y.MIDDLE;case"END":return y.BEGIN}return e?y.FIRST:y.BEGIN},getDefaultFont(e){const t=U.get(e);if(t)return t.get(this._style.getValue())??t.get("PLAIN")},loadData(){const e=this._url.copy();e.push("SERIF"),this.familyStack.length=0;for(const t of e)this.familyStack.push(this.getDefaultFont(t)??t);this.loadNext()},loadNext(){if(0===this.familyStack.length)return this.setLoadState(S().FAILED_STATE),void(this.font=null);this.family=this.familyStack.shift(),this.URL=new URL(this.family,this.getExecutionContext().getBaseURL()),this.getBrowser().getFont(this.URL,this.getCache()).then(this.setFont.bind(this)).catch(this.setError.bind(this))},setError(e){"data:"!==this.URL.protocol&&console.warn(`Error loading font '${decodeURI(this.URL.href)}':`,e),this.loadNext()},setFont(e){this.font=e,this.setLoadState(S().COMPLETE_STATE),this.addNodeEvent()},getFont(){return this.font},dispose(){f().prototype.dispose.call(this),c().prototype.dispose.call(this)}}),Object.defineProperties(k,c().getStaticProperties("X3DFontStyleNode","Text",1));const E=k,O=g().add("X3DFontStyleNode",E),w=e.PrimitiveQuality;var R=n.n(w);const L=e.TextCompression;var C=n.n(L);const D=e.Box2;var I=n.n(D);const B=e.Box3;var F=n.n(B);const G=e.Vector2;var M=n.n(G);const N=e.Vector3;var A=n.n(N);const P=e.Matrix3;var _=n.n(P);const H=new(I()),z=new(I()),W=new(M()),V=new(M()),q=new(M()),X=new(M()),j=new(A()),Y=new(A()),Z=new(M()),Q=new(M()),K=new(M()),J=new(M()),$=new(M()),ee=new(M()),te=new(A()),re=new(I()),ne=new(M()),ae=new(A());function se(e,t){this.browser=e.getBrowser(),this.text=e,this.fontStyle=t,this.glyphs=[],this.minorAlignment=new(M()),this.lineIndices=[],this.translations=[],this.charSpacings=[],this.scales=[],this.bearing=new(M()),this.bbox=new(F())}Object.assign(se.prototype,{getBrowser(){return this.browser},getText(){return this.text},getFontStyle(){return this.fontStyle},getGlyphs(){return this.glyphs},getMinorAlignment(){return this.minorAlignment},getTranslations(){return this.translations},getCharSpacings(){return this.charSpacings},getScales(){return this.scales},getBearing(){return this.bearing},getBBox(){return this.bbox},update(){const e=this.text,t=this.fontStyle,r=e._string.length;if(e._lineBounds.length=r,this.glyphs.length=0,0===r||!t.getFont())return e._origin.setValue(ae),e._textBounds.setValue(ne),void this.bbox.set();if(t._horizontal.getValue())this.resizeArray(this.translations,r),this.lineIndices.length=0,this.charSpacings.length=r,this.scales.length=r,this.horizontal(e,t);else{const n=e._string.reduce(((e,t)=>e+t.length),0);this.resizeArray(this.translations,n),this.lineIndices.length=n,this.charSpacings.length=r,this.scales.length=r,this.vertical(e,t)}},resizeArray(e,t){for(var r=e.length;r<t;++r)e.push(new(M()));e.length=t},horizontal(e,t){const r=t.getFont(),n=e._string,a=n.length,s=Math.max(0,e._maxExtent.getValue()),o=t._topToBottom.getValue(),i=t.getScale(),u=t._spacing.getValue(),l=this.getBrowser().getBrowserOptions().getTextCompression();H.set();const p=o?a:-1,c=o?1:-1;for(let s=o?0:a-1,h=0;s!==p;s+=c,++h){const a=n[s],o=this.getHorizontalLineExtents(t,a,W,V,h);Z.assign(V).subtract(W);const p=e.getLength(s),c=Z.x*i;let f=0;switch(ee.set(c,0==h?V.y-r.descender/r.unitsPerEm*i:u),p&&(l===C().CHAR_SPACING&&o.length>1&&(f=(p-ee.x)/(o.length-1)),ee.x=p,Z.x=p/i),this.charSpacings[h]=f,this.scales[h]=l===C().SCALING?ee.x/c:1,e._lineBounds[s]=ee,t.getMajorAlignment()){case y.BEGIN:case y.FIRST:this.translations[h].set(0,-h*u);break;case y.MIDDLE:this.translations[h].set(-W.x-Z.x/2,-h*u);break;case y.END:this.translations[h].set(-W.x-Z.x,-h*u)}this.translations[h].multiply(i),Q.assign(W).add(K.assign(Z).divide(2)),H.add(re.set(Z.multiply(i),Q.multiply(i).add(this.translations[h])))}if(s){const t=e._lineBounds.reduce(((e,t)=>Math.max(e,t.x)),0);if(t>s){const r=s/t;switch(l){case C().CHAR_SPACING:for(const t of this.charSpacings.keys())e._string[t].length<2||(this.charSpacings[t]-=(e._lineBounds[t].x-e._lineBounds[t].x*r)/(e._string[t].length-1));break;case C().SCALING:for(const e of this.scales.keys())this.scales[e]*=r}for(const e of this.translations.keys())this.translations[e].x*=r;for(const t of e._lineBounds.keys())e._lineBounds[t].x*=r;H.multRight(new(_())(r,0,0,0,1,0,0,0,0))}}switch(H.getExtents(W,V),Z.assign(V).subtract(W),e._textBounds=Z,this.bearing.set(0,-V.y),t.getMinorAlignment()){case y.BEGIN:this.minorAlignment.assign(this.bearing);break;case y.FIRST:this.minorAlignment.set(0,0);break;case y.MIDDLE:this.minorAlignment.set(0,Z.y/2-V.y);break;case y.END:this.minorAlignment.set(0,(a-1)*u*i)}W.add(this.minorAlignment),V.add(this.minorAlignment),e._origin.setValue(te.set(W.x,V.y,0)),this.bbox.setExtents(j.set(W.x,W.y,0),Y.set(V.x,V.y,0))},vertical(e,t){const r=t.getFont(),n=e._string,a=n.length,s=Math.max(0,e._maxExtent.getValue()),o=t._leftToRight.getValue(),i=t._topToBottom.getValue(),u=t.getScale(),l=t._spacing.getValue(),p=this.getBrowser().getBrowserOptions().getPrimitiveQuality(),c=this.getBrowser().getBrowserOptions().getTextCompression();H.set();const h=o?a:-1,f=o?1:-1;let d=0;for(let s=o?0:a-1;s!==h;s+=f){const h=this.stringToGlyphs(r,n[s],!0,s),f=d,g=h.length;z.set();const v=i?g:-1,m=i?1:-1;for(let e=i?0:g-1;e!==v;e+=m,++d){const t=h[e];this.getGlyphExtents(r,t,p,W,V),Z.assign(V).subtract(W);const n=i?e:g-e-1;this.lineIndices[d]=s,this.translations[d].set((l-Z.x-W.x)/2,-n),Q.assign(W).add(K.assign(Z).divide(2)).add(this.translations[d]),z.add(re.set(Z,Q))}z.getExtents(W,V),Z.assign(V).subtract(W);const b=o?s:a-s-1,S=(l-Z.x)/2,x=e.getLength(s);let T=0;ee.set(0===s?l-S:l,g?Z.y:0).multiply(u);const U=ee.y;switch(x&&(c===C().CHAR_SPACING&&h.length>1&&(T=(x-ee.y)/(h.length-1)),ee.y=x,Z.y=x/u,W.y=V.y-Z.y),this.charSpacings[s]=T,this.scales[s]=c===C().SCALING?ee.y/U:1,e._lineBounds[s]=ee,t.getMajorAlignment()){case y.BEGIN:case y.FIRST:$.assign(J.set(b*l,-V.y));break;case y.MIDDLE:$.assign(J.set(b*l,Z.y/2-V.y));break;case y.END:J.set(b*l,Z.y/this.scales[s]-V.y),$.set(b*l,Z.y-V.y)}for(let e=f;e<d;++e)this.translations[e].add(J).multiply(u);Q.assign(W).add(K.assign(Z).divide(2)),H.add(re.set(Z.multiply(u),Q.add($).multiply(u)))}if(s){const r=e._lineBounds.reduce(((e,t)=>Math.max(e,t.y)),0);if(r>s){const n=s/r;switch(c){case C().CHAR_SPACING:for(const t of this.charSpacings.keys())e._string[t].length<2||(this.charSpacings[t]-=(e._lineBounds[t].y-e._lineBounds[t].y*n)/(e._string[t].length-1));switch(t.getMajorAlignment()){case y.MIDDLE:for(const t of this.translations.keys()){const r=this.lineIndices[t];this.translations[t].y-=(e._lineBounds[r].y-e._lineBounds[r].y*n)/2}break;case y.END:for(const t of this.translations.keys()){const r=this.lineIndices[t];this.translations[t].y-=e._lineBounds[r].y-e._lineBounds[r].y*n}}break;case C().SCALING:for(const e of this.scales.keys())this.scales[e]*=n}for(const t of e._lineBounds.keys())e._lineBounds[t].y*=n;H.multRight(new(_())(1,0,0,0,n,0,0,0,0))}}switch(H.getExtents(W,V),Z.assign(V).subtract(W),e._textBounds=Z,t.getMajorAlignment()){case y.BEGIN:case y.FIRST:this.bearing.set(-W.x,V.y);break;case y.MIDDLE:this.bearing.set(-W.x,0);break;case y.END:this.bearing.set(-W.x,W.y)}switch(t.getMinorAlignment()){case y.BEGIN:case y.FIRST:this.minorAlignment.set(-W.x,0);break;case y.MIDDLE:this.minorAlignment.set(-W.x-Z.x/2,0);break;case y.END:this.minorAlignment.set(-W.x-Z.x,0)}W.add(this.minorAlignment),V.add(this.minorAlignment),e._origin.setValue(te.set(W.x,V.y,0)),this.bbox.setExtents(j.set(W.x,W.y,0),Y.set(V.x,V.y,0))},stringToGlyphs(e,t,r,n){const a=this.glyphs[n]??(this.glyphs[n]=[]);a.length=t.length;const s=r?0:t.length-1,o=r?t.length:-1,i=r?1:-1;for(let r=s,n=0;r!==o;r+=i,++n)a[n]=e.charToGlyph(t[r]);return a},getHorizontalLineExtents(e,t,r,n,a){const s=e.getFont(),o=e._horizontal.getValue()?e._leftToRight.getValue():e._topToBottom.getValue(),i=this.stringToGlyphs(s,t,o,a),u=i.length,l=this.getBrowser().getBrowserOptions().getPrimitiveQuality();let p=0,c=0,h=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY;for(let e=0;e<u;++e){const t=i[e],r=i[e+1],n=r?s.getKerningValue(t,r):0;this.getGlyphExtents(s,t,l,q,X),c+=t.advanceWidth+n,h=Math.min(h,q.y),f=Math.max(f,X.y)}switch(i.length?(this.getGlyphExtents(s,i[0],l,q,X),p=q.x):(h=0,f=0),r.set(p,h),n.set(c/s.unitsPerEm,f),e.getMajorAlignment()){case y.BEGIN:case y.FIRST:r.x=0}return i},traverse(e,t){}});const oe=se,ie=g().add("X3DTextGeometry",oe),ue=e.Matrix4;var le=n.n(ue);const pe=e.Bezier;var ce=n.n(pe);const he=e.libtess;var fe=n.n(he);function de(e,t){ie.call(this,e,t),e.setTransparent(!1)}Object.assign(Object.setPrototypeOf(de.prototype,ie.prototype),{getMatrix:()=>le().Identity,build:(()=>{const e=new(A()),t=new(A());return function(){const r=this.getFontStyle(),n=r.getFont();if(!n)return;const a=this.getText(),s=this.getGlyphs(),o=this.getMinorAlignment(),i=this.getTranslations(),u=this.getCharSpacings(),l=this.getScales(),p=r.getScale(),c=r._spacing.getValue(),h=a._origin.getValue(),f=p/n.unitsPerEm,d=this.getBrowser().getBrowserOptions().getPrimitiveQuality(),g=a.getTexCoords(),v=a.getNormals(),m=a.getVertices();if(a.getMultiTexCoords().push(g),this.getBBox().getExtents(e,t),a.getMin().assign(e),a.getMax().assign(t),r._horizontal.getValue())for(let e=0,t=s.length;e<t;++e){const t=s[e],r=i[e],a=u[e],y=l[e];let b=0;for(let e=0,s=t.length;e<s;++e){const s=t[e],i=this.getGlyphGeometry(n,s,d),u=o.x+r.x+b*y+e*a,l=o.y+r.y;for(const{x:e,y:t}of i){const r=e*p*y+u,n=t*p+l;g.push((r-h.x)/c,(n-h.y)/c,0,1),v.push(0,0,1),m.push(r,n,0,1)}let S=0;e+1<t.length&&(S=n.getKerningValue(s,t[e+1])),b+=(s.advanceWidth+S)*f}}else{const e=r._leftToRight.getValue(),t=r._topToBottom.getValue(),f=e?0:a._string.length-1,y=e?a._string.length:-1,b=e?1:-1;for(let e=f,r=0;e!==y;e+=b){const a=s[e],f=a.length,y=t?0:f-1,b=t?f:-1,S=t?1:-1,x=u[e],T=l[e];for(let e=y;e!==b;e+=S,++r){const t=i[r],s=this.getGlyphGeometry(n,a[e],d);for(const{x:r,y:n}of s){const a=r*p+o.x+t.x,s=n*p*T+o.y+t.y*T-e*x;g.push((a-h.x)/c,(s-h.y)/c,0,1),v.push(0,0,1),m.push(a,s,0,1)}}}}}})(),getGlyphExtents(e,t,r,n,a){const s=this.getBrowser().getGlyph(e,r,t.index),o=s.extents;if(o)n.assign(o.min),a.assign(o.max);else{const o=this.getGlyphGeometry(e,t,r);o.length?(n.assign(o[0]).min(...o),a.assign(o[0]).max(...o)):(n.set(0,0,0),a.set(0,0,0));const i=s.extents={};i.min=n.copy(),i.max=a.copy()}},getGlyphGeometry(e,t,r){const n=this.getBrowser().getGlyph(e,r,t.index),a=n.geometry;if(a)return a;{const e=n.geometry=[];return this.createGlyphGeometry(t,e,r),e}},createGlyphGeometry(e,t,r){const n=this.getBezierSteps(r),a=e.getPath(0,0,1);let s=[],o=[],i=0,u=0;for(const{type:e,x1:t,y1:r,x2:l,y2:p,x:c,y:h}of a.commands){switch(e){case"M":case"Z":o.length>2&&s.push(o),o=[],"M"===e&&o.push(new(A())(c,-h,0));break;case"L":o.push(new(A())(c,-h,0));break;case"Q":ce().quadric(i,-u,0,t,-r,0,c,-h,0,n,o);break;case"C":ce().cubic(i,-u,0,t,-r,0,l,-p,0,c,-h,0,n,o);break;default:continue}i=c,u=h}return this.triangulatePolygon(s,t)},getBezierSteps(e){switch(e){case R().LOW:return 3;case R().HIGH:return 7;default:return 5}},triangulatePolygon:(()=>{const e=new(fe().GluTesselator);return e.gluTessCallback(fe().gluEnum.GLU_TESS_VERTEX_DATA,(function(e,t){t.push(e)})),e.gluTessCallback(fe().gluEnum.GLU_TESS_COMBINE,(function(e,t,r){return new(A())(...e)})),e.gluTessProperty(fe().gluEnum.GLU_TESS_WINDING_RULE,fe().windingRule.GLU_TESS_WINDING_NONZERO),e.gluTessNormal(0,0,1),function(t,r){e.gluTessBeginPolygon(r);for(const r of t){e.gluTessBeginContour();for(const t of r)e.gluTessVertex(t,t);e.gluTessEndContour()}return e.gluTessEndPolygon(),r}})(),display(e,t){},transformLine(e){},transformMatrix(e){}});const ge=de,ve=g().add("PolygonText",ge);function me(e){O.call(this,e),this.addType(S().FontStyle),this._size.setUnit("length")}Object.assign(Object.setPrototypeOf(me.prototype,O.prototype),{getTextGeometry(e){return new ve(e,this)},getScale(){return this._size.getValue()}}),Object.defineProperties(me,{...c().getStaticProperties("FontStyle","Text",1,"fontStyle","2.0"),fieldDefinitions:{value:new(l())([new(i())(S().inputOutput,"metadata",new(s().SFNode)),new(i())(S().inputOutput,"language",new(s().SFString)),new(i())(S().inputOutput,"family",new(s().MFString)("SERIF")),new(i())(S().inputOutput,"style",new(s().SFString)("PLAIN")),new(i())(S().inputOutput,"size",new(s().SFFloat)(1)),new(i())(S().inputOutput,"spacing",new(s().SFFloat)(1)),new(i())(S().inputOutput,"horizontal",new(s().SFBool)(!0)),new(i())(S().inputOutput,"leftToRight",new(s().SFBool)(!0)),new(i())(S().inputOutput,"topToBottom",new(s().SFBool)(!0)),new(i())(S().inputOutput,"justify",new(s().MFString)("BEGIN"))]),enumerable:!0}});const ye=me,be=g().add("FontStyle",ye);var Se=n(254),xe=n(987);const Te=Symbol(),Ue=Symbol(),ke=Symbol();function Ee(){this[Ue]=new Map,this[ke]=new Map}Object.assign(Ee.prototype,{getDefaultFontStyle(){return this[Te]=new be(this.getPrivateScene()),this[Te].setPrivate(!0),this[Te].setup(),this.getDefaultFontStyle=function(){return this[Te]},Object.defineProperty(this,"getDefaultFontStyle",{enumerable:!1}),this[Te]},getFont(e,t=!0){return new Promise((async(r,n)=>{e=e.toString();let a=this[Ue].get(e);if(!a)try{this[Ue].set(e,a=Se.Deferred());const r=await fetch(e,{cache:t?"default":"reload"});if(!r.ok)throw new Error(r.statusText||r.status);{const e=await r.arrayBuffer(),t=xe.parse(e);a.resolve(t)}}catch(e){a.reject(e)}a.done(r).fail(n)}))},getGlyph(e,t,r){let n=this[ke].get(e);n||this[ke].set(e,n=[]);let a=n[t];a||(a=n[t]=[]);let s=a[r];return s||(s=a[r]={}),s}});const Oe=Ee,we=g().add("X3DTextContext",Oe),Re=e.X3DGeometryNode;var Le=n.n(Re);const Ce=e.X3DCast;var De=n.n(Ce);function Ie(e){Le().call(this,e),this.addType(S().Text),this._length.setUnit("length"),this._maxExtent.setUnit("length"),this._origin.setUnit("length"),this._textBounds.setUnit("length"),this._lineBounds.setUnit("length")}Object.assign(Object.setPrototypeOf(Ie.prototype,Le().prototype),{initialize(){Le().prototype.initialize.call(this),this._fontStyle.addInterest("set_fontStyle__",this),this.set_fontStyle__()},getMatrix(){return this.textGeometry.getMatrix()},getLength(e){return e<this._length.length?Math.max(0,this._length[e]):0},set_live__(){Le().prototype.set_live__.call(this);const e=this.getBrowser(),t=this.isLive()&&e.getBrowserOption("AlwaysUpdateGeometries");this.getLive().getValue()||t?(e.getBrowserOptions()._PrimitiveQuality.addInterest("requestRebuild",this),e.getBrowserOptions()._TextCompression.addInterest("requestRebuild",this)):(e.getBrowserOptions()._PrimitiveQuality.removeInterest("requestRebuild",this),e.getBrowserOptions()._TextCompression.removeInterest("requestRebuild",this))},set_fontStyle__(){this.fontStyleNode?.removeInterest("requestRebuild",this),this.fontStyleNode=De()(S().X3DFontStyleNode,this._fontStyle)??this.getBrowser().getDefaultFontStyle(),this.fontStyleNode.addInterest("requestRebuild",this),this.textGeometry=this.fontStyleNode.getTextGeometry(this)},build(){this.textGeometry.update(),this.textGeometry.build(),this.setSolid(this._solid.getValue())},traverse(e,t){this.textGeometry.traverse(e,t),Le().prototype.traverse.call(this,e,t)},display(e,t){this.textGeometry.display(e,t),Le().prototype.display.call(this,e,t),t.textureNode=null},transformLine(e){return this.textGeometry.transformLine(e)},transformMatrix(e){return this.textGeometry.transformMatrix(e)}}),Object.defineProperties(Ie,{...c().getStaticProperties("Text","Text",1,"geometry","2.0"),fieldDefinitions:{value:new(l())([new(i())(S().inputOutput,"metadata",new(s().SFNode)),new(i())(S().inputOutput,"string",new(s().MFString)),new(i())(S().inputOutput,"length",new(s().MFFloat)),new(i())(S().inputOutput,"maxExtent",new(s().SFFloat)),new(i())(S().initializeOnly,"solid",new(s().SFBool)),new(i())(S().outputOnly,"origin",new(s().SFVec3f)),new(i())(S().outputOnly,"textBounds",new(s().SFVec2f)),new(i())(S().outputOnly,"lineBounds",new(s().MFVec2f)),new(i())(S().inputOutput,"fontStyle",new(s().SFNode))]),enumerable:!0}});const Be=Ie,Fe=g().add("Text",Be);r().add({name:"Text",concreteNodes:[be,Fe],abstractNodes:[O],browserContext:we});g().add("TextComponent",undefined)})()})();
1
+ /* X_ITE v11.2.3 */
2
+ const e=window[Symbol.for("X_ITE.X3D-11.2.3")];(()=>{var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var s in n)t.o(n,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:n[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const n=e.Components;var s=t.n(n);const r=e.Fields;var o=t.n(r);const a=e.X3DFieldDefinition;var i=t.n(a);const l=e.FieldDefinitionArray;var u=t.n(l);const c=e.X3DNode;var p=t.n(c);const h=e.X3DUrlObject;var f=t.n(h);const d=e.Namespace;var g=t.n(d);let m=0;const y={BEGIN:++m,FIRST:++m,MIDDLE:++m,END:++m},v=g().add("TextAlignment",y),b=e.X3DConstants;var S=t.n(b);const x=e.URLs;var T=t.n(x);const O=new Map([["SERIF",new Map([["PLAIN",T().getFontsURL("Droid/DroidSerif-Regular.woff2")],["ITALIC",T().getFontsURL("Droid/DroidSerif-Italic.woff2")],["BOLD",T().getFontsURL("Droid/DroidSerif-Bold.woff2")],["BOLDITALIC",T().getFontsURL("Droid/DroidSerif-BoldItalic.woff2")]])],["SANS",new Map([["PLAIN",T().getFontsURL("Ubuntu/Ubuntu-R.woff2")],["ITALIC",T().getFontsURL("Ubuntu/Ubuntu-RI.woff2")],["BOLD",T().getFontsURL("Ubuntu/Ubuntu-B.woff2")],["BOLDITALIC",T().getFontsURL("Ubuntu/Ubuntu-BI.woff2")]])],["TYPEWRITER",new Map([["PLAIN",T().getFontsURL("Ubuntu/UbuntuMono-R.woff2")],["ITALIC",T().getFontsURL("Ubuntu/UbuntuMono-RI.woff2")],["BOLD",T().getFontsURL("Ubuntu/UbuntuMono-B.woff2")],["BOLDITALIC",T().getFontsURL("Ubuntu/UbuntuMono-BI.woff2")]])]]);function k(e){p().call(this,e),f().call(this,e),this.addType(S().X3DFontStyleNode),this.addChildObjects(S().inputOutput,"description",new(o().SFString),S().inputOutput,"url",this._family,S().inputOutput,"load",new(o().SFBool)(!0),S().inputOutput,"autoRefresh",new(o().SFTime)(0),S().inputOutput,"autoRefreshTimeLimit",new(o().SFTime)(3600)),this._family.setName("family"),this.familyStack=[],this.alignments=[]}Object.assign(Object.setPrototypeOf(k.prototype,p().prototype),f().prototype,{initialize(){p().prototype.initialize.call(this),f().prototype.initialize.call(this),this._style.addInterest("set_style__",this),this._justify.addInterest("set_justify__",this),this.font=null,this.familyIndex=0,this.set_justify__(),this.requestImmediateLoad().catch(Function.prototype)},set_style__(){this._load.getValue()&&(this.setLoadState(S().NOT_STARTED_STATE),this.requestImmediateLoad().catch(Function.prototype))},set_justify__(){const e=this._horizontal.getValue()?this._leftToRight.getValue():this._topToBottom.getValue();this.alignments[0]=this._justify.length>0?this.getAlignment(0,e):e?v.BEGIN:v.END;const t=this._horizontal.getValue()?this._topToBottom.getValue():this._leftToRight.getValue();this.alignments[1]=this._justify.length>1?this.getAlignment(1,t):t?v.FIRST:v.END},getMajorAlignment(){return this.alignments[0]},getMinorAlignment(){return this.alignments[1]},getAlignment(e,t){if(t)switch(this._justify[e]){case"FIRST":return v.FIRST;case"BEGIN":return v.BEGIN;case"MIDDLE":return v.MIDDLE;case"END":return v.END}else switch(this._justify[e]){case"FIRST":case"BEGIN":return v.END;case"MIDDLE":return v.MIDDLE;case"END":return v.BEGIN}return e?v.FIRST:v.BEGIN},getDefaultFont(e){const t=O.get(e);if(t)return t.get(this._style.getValue())??t.get("PLAIN")},loadData(){const e=this._url.copy();e.push("SERIF"),this.familyStack.length=0;for(const t of e)this.familyStack.push(this.getDefaultFont(t)??t);this.loadNext()},loadNext(){if(0===this.familyStack.length)return this.setLoadState(S().FAILED_STATE),void(this.font=null);this.family=this.familyStack.shift(),this.URL=new URL(this.family,this.getExecutionContext().getBaseURL()),this.getBrowser().getFont(this.URL,this.getCache()).then(this.setFont.bind(this)).catch(this.setError.bind(this))},setError(e){"data:"!==this.URL.protocol&&console.warn(`Error loading font '${decodeURI(this.URL.href)}':`,e),this.loadNext()},setFont(e){this.font=e,this.setLoadState(S().COMPLETE_STATE),this.addNodeEvent()},getFont(){return this.font},dispose(){f().prototype.dispose.call(this),p().prototype.dispose.call(this)}}),Object.defineProperties(k,p().getStaticProperties("X3DFontStyleNode","Text",1));const w=k,I=g().add("X3DFontStyleNode",w),R=e.PrimitiveQuality;var U=t.n(R);const L=e.TextCompression;var C=t.n(L);const E=e.Box2;var D=t.n(E);const M=e.Box3;var F=t.n(M);const A=e.Vector2;var N=t.n(A);const P=e.Vector3;var B=t.n(P);const G=e.Matrix3;var _=t.n(G);const H=new(D()),V=new(D()),z=new(N()),q=new(N()),j=new(N()),W=new(N()),$=new(B()),X=new(B()),Y=new(N()),Z=new(N()),Q=new(N()),K=new(N()),J=new(N()),ee=new(N()),te=new(B()),ne=new(D()),se=new(N()),re=new(B());function oe(e,t){this.browser=e.getBrowser(),this.text=e,this.fontStyle=t,this.glyphs=[],this.minorAlignment=new(N()),this.lineIndices=[],this.translations=[],this.charSpacings=[],this.scales=[],this.bearing=new(N()),this.bbox=new(F())}Object.assign(oe.prototype,{getBrowser(){return this.browser},getText(){return this.text},getFontStyle(){return this.fontStyle},getGlyphs(){return this.glyphs},getMinorAlignment(){return this.minorAlignment},getTranslations(){return this.translations},getCharSpacings(){return this.charSpacings},getScales(){return this.scales},getBearing(){return this.bearing},getBBox(){return this.bbox},update(){const e=this.text,t=this.fontStyle,n=e._string.length;if(e._lineBounds.length=n,this.glyphs.length=0,0===n||!t.getFont())return e._origin.setValue(re),e._textBounds.setValue(se),void this.bbox.set();if(t._horizontal.getValue())this.resizeArray(this.translations,n),this.lineIndices.length=0,this.charSpacings.length=n,this.scales.length=n,this.horizontal(e,t);else{const s=e._string.reduce(((e,t)=>e+t.length),0);this.resizeArray(this.translations,s),this.lineIndices.length=s,this.charSpacings.length=n,this.scales.length=n,this.vertical(e,t)}},resizeArray(e,t){for(var n=e.length;n<t;++n)e.push(new(N()));e.length=t},horizontal(e,t){const n=t.getFont(),s=e._string,r=s.length,o=Math.max(0,e._maxExtent.getValue()),a=t._topToBottom.getValue(),i=t.getScale(),l=t.getContentScale(),u=t._spacing.getValue(),c=this.getBrowser().getBrowserOptions().getTextCompression();H.set();const p=a?r:-1,h=a?1:-1;for(let o=a?0:r-1,f=0;o!==p;o+=h,++f){const r=s[o],a=this.getHorizontalLineExtents(t,r,z,q,f);Y.assign(q).subtract(z);const p=e.getLength(o)*l,h=Y.x*i;let d=0;switch(ee.set(h,0==f?q.y-n.descender/n.unitsPerEm*i:u),p&&(c===C().CHAR_SPACING&&a.length>1&&(d=(p-ee.x)/(a.length-1)),ee.x=p,Y.x=p/i),this.charSpacings[f]=d,this.scales[f]=c===C().SCALING?ee.x/h:1,e._lineBounds[o]=ee,t.getMajorAlignment()){case v.BEGIN:case v.FIRST:this.translations[f].set(0,-f*u);break;case v.MIDDLE:this.translations[f].set(-z.x-Y.x/2,-f*u);break;case v.END:this.translations[f].set(-z.x-Y.x,-f*u)}this.translations[f].multiply(i),Z.assign(z).add(Q.assign(Y).divide(2)),H.add(ne.set(Y.multiply(i),Z.multiply(i).add(this.translations[f])))}if(o){const t=e._lineBounds.reduce(((e,t)=>Math.max(e,t.x)),0);if(t>o){const n=o*l/t;switch(c){case C().CHAR_SPACING:for(const t of this.charSpacings.keys())e._string[t].length<2||(this.charSpacings[t]-=(e._lineBounds[t].x-e._lineBounds[t].x*n)/(e._string[t].length-1));break;case C().SCALING:for(const e of this.scales.keys())this.scales[e]*=n}for(const e of this.translations.keys())this.translations[e].x*=n;for(const t of e._lineBounds.keys())e._lineBounds[t].x*=n;H.multRight(new(_())(n,0,0,0,1,0,0,0,0))}}switch(H.getExtents(z,q),Y.assign(q).subtract(z),e._textBounds=Y,this.bearing.set(0,-q.y),t.getMinorAlignment()){case v.BEGIN:this.minorAlignment.assign(this.bearing);break;case v.FIRST:this.minorAlignment.set(0,0);break;case v.MIDDLE:this.minorAlignment.set(0,Y.y/2-q.y);break;case v.END:this.minorAlignment.set(0,(r-1)*u*i)}z.add(this.minorAlignment),q.add(this.minorAlignment),e._origin.setValue(te.set(z.x,q.y,0)),this.bbox.setExtents($.set(z.x,z.y,0),X.set(q.x,q.y,0))},vertical(e,t){const n=t.getFont(),s=e._string,r=s.length,o=Math.max(0,e._maxExtent.getValue()),a=t._leftToRight.getValue(),i=t._topToBottom.getValue(),l=t.getScale(),u=t.getContentScale(),c=t._spacing.getValue(),p=this.getBrowser().getBrowserOptions().getPrimitiveQuality(),h=this.getBrowser().getBrowserOptions().getTextCompression();H.set();const f=a?r:-1,d=a?1:-1;let g=0;for(let o=a?0:r-1;o!==f;o+=d){const f=this.stringToGlyphs(n,s[o],!0,o),d=g,m=f.length;V.set();const y=i?m:-1,b=i?1:-1;for(let e=i?0:m-1;e!==y;e+=b,++g){const t=f[e];this.getGlyphExtents(n,t,p,z,q),Y.assign(q).subtract(z);const s=i?e:m-e-1;this.lineIndices[g]=o,this.translations[g].set((c-Y.x-z.x)/2,-s),Z.assign(z).add(Q.assign(Y).divide(2)).add(this.translations[g]),V.add(ne.set(Y,Z))}V.getExtents(z,q),Y.assign(q).subtract(z);const S=a?o:r-o-1,x=(c-Y.x)/2,T=e.getLength(o)*u;let O=0;ee.set(0===o?c-x:c,m?Y.y:0).multiply(l);const k=ee.y;switch(T&&(h===C().CHAR_SPACING&&f.length>1&&(O=(T-ee.y)/(f.length-1)),ee.y=T,Y.y=T/l,z.y=q.y-Y.y),this.charSpacings[o]=O,this.scales[o]=h===C().SCALING?ee.y/k:1,e._lineBounds[o]=ee,t.getMajorAlignment()){case v.BEGIN:case v.FIRST:J.assign(K.set(S*c,-q.y));break;case v.MIDDLE:J.assign(K.set(S*c,Y.y/2-q.y));break;case v.END:K.set(S*c,Y.y/this.scales[o]-q.y),J.set(S*c,Y.y-q.y)}for(let e=d;e<g;++e)this.translations[e].add(K).multiply(l);Z.assign(z).add(Q.assign(Y).divide(2)),H.add(ne.set(Y.multiply(l),Z.add(J).multiply(l)))}if(o){const n=e._lineBounds.reduce(((e,t)=>Math.max(e,t.y)),0);if(n>o){const s=o*u/n;switch(h){case C().CHAR_SPACING:for(const t of this.charSpacings.keys())e._string[t].length<2||(this.charSpacings[t]-=(e._lineBounds[t].y-e._lineBounds[t].y*s)/(e._string[t].length-1));switch(t.getMajorAlignment()){case v.MIDDLE:for(const t of this.translations.keys()){const n=this.lineIndices[t];this.translations[t].y-=(e._lineBounds[n].y-e._lineBounds[n].y*s)/2}break;case v.END:for(const t of this.translations.keys()){const n=this.lineIndices[t];this.translations[t].y-=e._lineBounds[n].y-e._lineBounds[n].y*s}}break;case C().SCALING:for(const e of this.scales.keys())this.scales[e]*=s}for(const t of e._lineBounds.keys())e._lineBounds[t].y*=s;H.multRight(new(_())(1,0,0,0,s,0,0,0,0))}}switch(H.getExtents(z,q),Y.assign(q).subtract(z),e._textBounds=Y,t.getMajorAlignment()){case v.BEGIN:case v.FIRST:this.bearing.set(-z.x,q.y);break;case v.MIDDLE:this.bearing.set(-z.x,0);break;case v.END:this.bearing.set(-z.x,z.y)}switch(t.getMinorAlignment()){case v.BEGIN:case v.FIRST:this.minorAlignment.set(-z.x,0);break;case v.MIDDLE:this.minorAlignment.set(-z.x-Y.x/2,0);break;case v.END:this.minorAlignment.set(-z.x-Y.x,0)}z.add(this.minorAlignment),q.add(this.minorAlignment),e._origin.setValue(te.set(z.x,q.y,0)),this.bbox.setExtents($.set(z.x,z.y,0),X.set(q.x,q.y,0))},stringToGlyphs(e,t,n,s){const r=this.glyphs[s]??(this.glyphs[s]=[]);r.length=t.length;const o=n?0:t.length-1,a=n?t.length:-1,i=n?1:-1;for(let n=o,s=0;n!==a;n+=i,++s)r[s]=e.charToGlyph(t[n]);return r},getHorizontalLineExtents(e,t,n,s,r){const o=e.getFont(),a=e._horizontal.getValue()?e._leftToRight.getValue():e._topToBottom.getValue(),i=this.stringToGlyphs(o,t,a,r),l=i.length,u=this.getBrowser().getBrowserOptions().getPrimitiveQuality();let c=0,p=0,h=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY;for(let e=0;e<l;++e){const t=i[e],n=i[e+1],s=n?o.getKerningValue(t,n):0;this.getGlyphExtents(o,t,u,j,W),p+=e<l-1?t.advanceWidth+s:W.x*o.unitsPerEm,h=Math.min(h,j.y),f=Math.max(f,W.y)}switch(i.length?(this.getGlyphExtents(o,i[0],u,j,W),c=j.x):(h=0,f=0),n.set(c,h),s.set(p/o.unitsPerEm,f),e.getMajorAlignment()){case v.BEGIN:case v.FIRST:n.x=0}return i},traverse(e,t){}});const ae=oe,ie=g().add("X3DTextGeometry",ae),le=e.Matrix4;var ue=t.n(le);const ce=e.Bezier;var pe=t.n(ce);const he=e.libtess;var fe=t.n(he);function de(e,t){ie.call(this,e,t),e.setTransparent(!1)}Object.assign(Object.setPrototypeOf(de.prototype,ie.prototype),{getMatrix:()=>ue().Identity,build:(()=>{const e=new(B()),t=new(B());return function(){const n=this.getFontStyle(),s=n.getFont();if(!s)return;const r=this.getText(),o=this.getGlyphs(),a=this.getMinorAlignment(),i=this.getTranslations(),l=this.getCharSpacings(),u=this.getScales(),c=n.getScale(),p=n._spacing.getValue(),h=r._origin.getValue(),f=c/s.unitsPerEm,d=this.getBrowser().getBrowserOptions().getPrimitiveQuality(),g=r.getTexCoords(),m=r.getNormals(),y=r.getVertices();if(r.getMultiTexCoords().push(g),this.getBBox().getExtents(e,t),r.getMin().assign(e),r.getMax().assign(t),n._horizontal.getValue())for(let e=0,t=o.length;e<t;++e){const t=o[e],n=i[e],r=l[e],v=u[e];let b=0;for(let e=0,o=t.length;e<o;++e){const o=t[e],i=this.getGlyphGeometry(s,o,d),l=a.x+n.x+b*v+e*r,u=a.y+n.y;for(const{x:e,y:t}of i){const n=e*c*v+l,s=t*c+u;g.push((n-h.x)/p,(s-h.y)/p,0,1),m.push(0,0,1),y.push(n,s,0,1)}let S=0;e+1<t.length&&(S=s.getKerningValue(o,t[e+1])),b+=(o.advanceWidth+S)*f}}else{const e=n._leftToRight.getValue(),t=n._topToBottom.getValue(),f=e?0:r._string.length-1,v=e?r._string.length:-1,b=e?1:-1;for(let e=f,n=0;e!==v;e+=b){const r=o[e],f=r.length,v=t?0:f-1,b=t?f:-1,S=t?1:-1,x=l[e],T=u[e];for(let e=v;e!==b;e+=S,++n){const t=i[n],o=this.getGlyphGeometry(s,r[e],d);for(const{x:n,y:s}of o){const r=n*c+a.x+t.x,o=s*c*T+a.y+t.y*T-e*x;g.push((r-h.x)/p,(o-h.y)/p,0,1),m.push(0,0,1),y.push(r,o,0,1)}}}}}})(),getGlyphExtents(e,t,n,s,r){const o=this.getBrowser().getGlyph(e,n,t.index),a=o.extents;if(a)s.assign(a.min),r.assign(a.max);else{const a=this.getGlyphGeometry(e,t,n);a.length?(s.assign(a[0]).min(...a),r.assign(a[0]).max(...a)):(s.set(0,0,0),r.set(0,0,0));const i=o.extents={};i.min=s.copy(),i.max=r.copy()}},getGlyphGeometry(e,t,n){const s=this.getBrowser().getGlyph(e,n,t.index),r=s.geometry;if(r)return r;{const e=s.geometry=[];return this.createGlyphGeometry(t,e,n),e}},createGlyphGeometry(e,t,n){const s=this.getBezierSteps(n),r=e.getPath(0,0,1),o=[];let a=[],i=0,l=0;r.commands.push({type:"Z"});for(const{type:e,x1:t,y1:n,x2:u,y2:c,x:p,y:h}of r.commands){switch(e){case"M":case"Z":a.length>2&&o.push(a),a=[],"M"===e&&a.push(new(B())(p,-h,0));break;case"L":a.push(new(B())(p,-h,0));break;case"Q":pe().quadric(i,-l,0,t,-n,0,p,-h,0,s,a);break;case"C":pe().cubic(i,-l,0,t,-n,0,u,-c,0,p,-h,0,s,a);break;default:continue}i=p,l=h}return this.triangulatePolygon(o,t)},getBezierSteps(e){switch(e){case U().LOW:return 3;case U().HIGH:return 7;default:return 5}},triangulatePolygon:(()=>{const e=new(fe().GluTesselator);return e.gluTessCallback(fe().gluEnum.GLU_TESS_VERTEX_DATA,(function(e,t){t.push(e)})),e.gluTessCallback(fe().gluEnum.GLU_TESS_COMBINE,(function(e,t,n){return new(B())(...e)})),e.gluTessProperty(fe().gluEnum.GLU_TESS_WINDING_RULE,fe().windingRule.GLU_TESS_WINDING_NONZERO),e.gluTessNormal(0,0,1),function(t,n){e.gluTessBeginPolygon(n);for(const n of t){e.gluTessBeginContour();for(const t of n)e.gluTessVertex(t,t);e.gluTessEndContour()}return e.gluTessEndPolygon(),n}})(),displaySimple(e,t){},display(e,t){},transformLine(e){},transformMatrix(e){}});const ge=de,me=g().add("PolygonText",ge);function ye(e){I.call(this,e),this.addType(S().FontStyle),this._size.setUnit("length")}Object.assign(Object.setPrototypeOf(ye.prototype,I.prototype),{getTextGeometry(e){return new me(e,this)},getScale(){return this._size.getValue()},getContentScale:()=>1}),Object.defineProperties(ye,{...p().getStaticProperties("FontStyle","Text",1,"fontStyle","2.0"),fieldDefinitions:{value:new(u())([new(i())(S().inputOutput,"metadata",new(o().SFNode)),new(i())(S().inputOutput,"language",new(o().SFString)),new(i())(S().inputOutput,"family",new(o().MFString)("SERIF")),new(i())(S().inputOutput,"style",new(o().SFString)("PLAIN")),new(i())(S().inputOutput,"size",new(o().SFFloat)(1)),new(i())(S().inputOutput,"spacing",new(o().SFFloat)(1)),new(i())(S().inputOutput,"horizontal",new(o().SFBool)(!0)),new(i())(S().inputOutput,"leftToRight",new(o().SFBool)(!0)),new(i())(S().inputOutput,"topToBottom",new(o().SFBool)(!0)),new(i())(S().inputOutput,"justify",new(o().MFString)("BEGIN"))]),enumerable:!0}});const ve=ye,be=g().add("FontStyle",ve);function Se(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function xe(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new Se,this.dtree=new Se}var Te=new Se,Oe=new Se,ke=new Uint8Array(30),we=new Uint16Array(30),Ie=new Uint8Array(30),Re=new Uint16Array(30),Ue=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Le=new Se,Ce=new Uint8Array(320);function Ee(e,t,n,s){var r,o;for(r=0;r<n;++r)e[r]=0;for(r=0;r<30-n;++r)e[r+n]=r/n|0;for(o=s,r=0;r<30;++r)t[r]=o,o+=1<<e[r]}var De=new Uint16Array(16);function Me(e,t,n,s){var r,o;for(r=0;r<16;++r)e.table[r]=0;for(r=0;r<s;++r)e.table[t[n+r]]++;for(e.table[0]=0,o=0,r=0;r<16;++r)De[r]=o,o+=e.table[r];for(r=0;r<s;++r)t[n+r]&&(e.trans[De[t[n+r]]++]=r)}function Fe(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=1&e.tag;return e.tag>>>=1,t}function Ae(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var s=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,s+n}function Ne(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=0,s=0,r=0,o=e.tag;do{s=2*s+(1&o),o>>>=1,++r,n+=t.table[r],s-=t.table[r]}while(s>=0);return e.tag=o,e.bitcount-=r,t.trans[n+s]}function Pe(e,t,n){var s,r,o,a,i,l;for(s=Ae(e,5,257),r=Ae(e,5,1),o=Ae(e,4,4),a=0;a<19;++a)Ce[a]=0;for(a=0;a<o;++a){var u=Ae(e,3,0);Ce[Ue[a]]=u}for(Me(Le,Ce,0,19),i=0;i<s+r;){var c=Ne(e,Le);switch(c){case 16:var p=Ce[i-1];for(l=Ae(e,2,3);l;--l)Ce[i++]=p;break;case 17:for(l=Ae(e,3,3);l;--l)Ce[i++]=0;break;case 18:for(l=Ae(e,7,11);l;--l)Ce[i++]=0;break;default:Ce[i++]=c}}Me(t,Ce,0,s),Me(n,Ce,s,r)}function Be(e,t,n){for(;;){var s,r,o,a,i=Ne(e,t);if(256===i)return 0;if(i<256)e.dest[e.destLen++]=i;else for(s=Ae(e,ke[i-=257],we[i]),r=Ne(e,n),a=o=e.destLen-Ae(e,Ie[r],Re[r]);a<o+s;++a)e.dest[e.destLen++]=e.dest[a]}}function Ge(e){for(var t,n;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if((t=256*(t=e.source[e.sourceIndex+1])+e.source[e.sourceIndex])!==(65535&~(256*e.source[e.sourceIndex+3]+e.source[e.sourceIndex+2])))return-3;for(e.sourceIndex+=4,n=t;n;--n)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,0}function _e(e,t){var n,s,r=new xe(e,t);do{switch(n=Fe(r),Ae(r,2,0)){case 0:s=Ge(r);break;case 1:s=Be(r,Te,Oe);break;case 2:Pe(r,r.ltree,r.dtree),s=Be(r,r.ltree,r.dtree);break;default:s=-3}if(0!==s)throw new Error("Data error")}while(!n);return r.destLen<r.dest.length?"function"==typeof r.dest.slice?r.dest.slice(0,r.destLen):r.dest.subarray(0,r.destLen):r.dest}function He(e,t,n,s,r){return Math.pow(1-r,3)*e+3*Math.pow(1-r,2)*r*t+3*(1-r)*Math.pow(r,2)*n+Math.pow(r,3)*s}function Ve(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}!function(e,t){var n;for(n=0;n<7;++n)e.table[n]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,n=0;n<24;++n)e.trans[n]=256+n;for(n=0;n<144;++n)e.trans[24+n]=n;for(n=0;n<8;++n)e.trans[168+n]=280+n;for(n=0;n<112;++n)e.trans[176+n]=144+n;for(n=0;n<5;++n)t.table[n]=0;for(t.table[5]=32,n=0;n<32;++n)t.trans[n]=n}(Te,Oe),Ee(ke,we,4,3),Ee(Ie,Re,2,1),ke[28]=0,we[28]=258,Ve.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},Ve.prototype.addPoint=function(e,t){"number"==typeof e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},Ve.prototype.addX=function(e){this.addPoint(e,null)},Ve.prototype.addY=function(e){this.addPoint(null,e)},Ve.prototype.addBezier=function(e,t,n,s,r,o,a,i){const l=[e,t],u=[n,s],c=[r,o],p=[a,i];this.addPoint(e,t),this.addPoint(a,i);for(let e=0;e<=1;e++){const t=6*l[e]-12*u[e]+6*c[e],n=-3*l[e]+9*u[e]-9*c[e]+3*p[e],s=3*u[e]-3*l[e];if(0===n){if(0===t)continue;const n=-s/t;0<n&&n<1&&(0===e&&this.addX(He(l[e],u[e],c[e],p[e],n)),1===e&&this.addY(He(l[e],u[e],c[e],p[e],n)));continue}const r=Math.pow(t,2)-4*s*n;if(r<0)continue;const o=(-t+Math.sqrt(r))/(2*n);0<o&&o<1&&(0===e&&this.addX(He(l[e],u[e],c[e],p[e],o)),1===e&&this.addY(He(l[e],u[e],c[e],p[e],o)));const a=(-t-Math.sqrt(r))/(2*n);0<a&&a<1&&(0===e&&this.addX(He(l[e],u[e],c[e],p[e],a)),1===e&&this.addY(He(l[e],u[e],c[e],p[e],a)))}},Ve.prototype.addQuad=function(e,t,n,s,r,o){const a=e+2/3*(n-e),i=t+2/3*(s-t),l=a+1/3*(r-e),u=i+1/3*(o-t);this.addBezier(e,t,a,i,l,u,r,o)};var ze=Ve;function qe(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}var je={};function We(e,t){const n=Math.floor(e),s=e-n;if(je[t]||(je[t]={}),void 0!==je[t][s]){return n+je[t][s]}const r=+(Math.round(s+"e+"+t)+"e-"+t);return je[t][s]=r,n+r}function $e(e){let t=[[]],n=0,s=0;for(let r=0;r<e.length;r+=1){const o=t[t.length-1],a=e[r],i=o[0],l=o[1],u=o[o.length-1],c=e[r+1];o.push(a),"M"===a.type?(n=a.x,s=a.y):"L"!==a.type||c&&"Z"!==c.command?"L"===a.type&&u&&u.x===a.x&&u.y===a.y?o.pop():"Z"===a.type&&(i&&l&&u&&"M"===i.type&&"L"===l.type&&"L"===u.type&&u.x===i.x&&u.y===i.y&&(o.shift(),o[0].type="M"),r+1<e.length&&t.push([])):Math.abs(a.x-n)>1||Math.abs(a.y-s)>1||o.pop()}return e=[].concat.apply([],t)}qe.prototype.fromSVG=function(e,t={}){"undefined"!=typeof SVGPathElement&&e instanceof SVGPathElement&&(e=e.getAttribute("d")),t=function(e){return Object.assign({},{decimalPlaces:2,optimize:!0,flipY:!0,flipYBase:void 0,scale:1,x:0,y:0},e)}(t),this.commands=[];const n="MmLlQqCcZzHhVv";let s={},r=[""],o=!1;function a(e){if(!this.commands.length)return e;const t=this.commands[this.commands.length-1];for(let n=0;n<e.length;n++)e[n]+=t[1&n?"y":"x"];return e}function i(){if(void 0===s.type)return;const e=s.type.toUpperCase(),n="Z"!==e&&s.type.toUpperCase()!==s.type;let o=r.filter((e=>e.length)).map((e=>{let n=parseFloat(e);return(t.decimalPlaces||0===t.decimalPlaces)&&(n=We(n,t.decimalPlaces)),n}));if(r=[""],!o.length&&"Z"!==e)return;n&&"H"!==e&&"V"!==e&&(o=a.apply(this,[o]));const i=this.commands.length&&this.commands[this.commands.length-1].x||0,l=this.commands.length&&this.commands[this.commands.length-1].y||0;switch(e){case"M":this.moveTo(...o);break;case"L":this.lineTo(...o);break;case"V":for(let e=0;e<o.length;e++){let t=0;n&&(t=this.commands.length&&this.commands[this.commands.length-1].y||0),this.lineTo(i,o[e]+t)}break;case"H":for(let e=0;e<o.length;e++){let t=0;n&&(t=this.commands.length&&this.commands[this.commands.length-1].x||0),this.lineTo(o[e]+t,l)}break;case"C":this.bezierCurveTo(...o);break;case"Q":this.quadraticCurveTo(...o);break;case"Z":(this.commands.length<1||"Z"!==this.commands[this.commands.length-1].type)&&this.close()}if(this.commands.length)for(const e in this.commands[this.commands.length-1])void 0===this.commands[this.commands.length-1][e]&&(this.commands[this.commands.length-1][e]=0)}for(let t=0;t<e.length;t++){const a=e.charAt(t),l=r[r.length-1];if("0123456789".indexOf(a)>-1)r[r.length-1]+=a;else if("-+".indexOf(a)>-1)if(s.type||this.commands.length||(s.type="L"),"-"===a)!s.type||l.indexOf("-")>0?o=!0:l.length?r.push("-"):r[r.length-1]=a;else{if(s.type&&!(l.length>0))continue;o=!0}else if(n.indexOf(a)>-1)s.type?(i.apply(this),s={type:a}):s.type=a;else{if("SsTtAa".indexOf(a)>-1)throw new Error("Unsupported path command: "+a+". Currently supported commands are "+n.split("").join(", ")+".");" ,\t\n\r\f\v".indexOf(a)>-1?r.push(""):"."===a?!s.type||l.indexOf(a)>-1?o=!0:r[r.length-1]+=a:o=!0}if(o)throw new Error("Unexpected character: "+a+" at offset "+t)}i.apply(this),t.optimize&&(this.commands=$e(this.commands));const l=t.flipY;let u=t.flipYBase;if(!0===l&&void 0===t.flipYBase){const e=this.getBoundingBox();u=e.y1+e.y2}for(const e in this.commands){const n=this.commands[e];for(const s in n)["x","x1","x2"].includes(s)?this.commands[e][s]=t.x+n[s]*t.scale:["y","y1","y2"].includes(s)&&(this.commands[e][s]=t.y+(l?u-n[s]:n[s])*t.scale)}return this},qe.fromSVG=function(e,t){return(new qe).fromSVG(e,t)},qe.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},qe.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},qe.prototype.curveTo=qe.prototype.bezierCurveTo=function(e,t,n,s,r,o){this.commands.push({type:"C",x1:e,y1:t,x2:n,y2:s,x:r,y:o})},qe.prototype.quadTo=qe.prototype.quadraticCurveTo=function(e,t,n,s){this.commands.push({type:"Q",x1:e,y1:t,x:n,y:s})},qe.prototype.close=qe.prototype.closePath=function(){this.commands.push({type:"Z"})},qe.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof ze){const t=e;return this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close()}Array.prototype.push.apply(this.commands,e)},qe.prototype.getBoundingBox=function(){const e=new ze;let t=0,n=0,s=0,r=0;for(let o=0;o<this.commands.length;o++){const a=this.commands[o];switch(a.type){case"M":e.addPoint(a.x,a.y),t=s=a.x,n=r=a.y;break;case"L":e.addPoint(a.x,a.y),s=a.x,r=a.y;break;case"Q":e.addQuad(s,r,a.x1,a.y1,a.x,a.y),s=a.x,r=a.y;break;case"C":e.addBezier(s,r,a.x1,a.y1,a.x2,a.y2,a.x,a.y),s=a.x,r=a.y;break;case"Z":s=t,r=n;break;default:throw new Error("Unexpected path command "+a.type)}}return e.isEmpty()&&e.addPoint(0,0),e},qe.prototype.draw=function(e){const t=this._layers;if(t&&t.length){for(let n=0;n<t.length;n++)this.draw.call(t[n],e);return}const n=this._image;if(n)e.drawImage(n.image,n.x,n.y,n.width,n.height);else{e.beginPath();for(let t=0;t<this.commands.length;t+=1){const n=this.commands[t];"M"===n.type?e.moveTo(n.x,n.y):"L"===n.type?e.lineTo(n.x,n.y):"C"===n.type?e.bezierCurveTo(n.x1,n.y1,n.x2,n.y2,n.x,n.y):"Q"===n.type?e.quadraticCurveTo(n.x1,n.y1,n.x,n.y):"Z"===n.type&&this.stroke&&this.strokeWidth&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())}},qe.prototype.toPathData=function(e){function t(t){const n=We(t,e.decimalPlaces);return Math.round(t)===n?""+n:n.toFixed(e.decimalPlaces)}function n(){let e="";for(let n=0;n<arguments.length;n+=1){const s=arguments[n];s>=0&&n>0&&(e+=" "),e+=t(s)}return e}e=function(e){return parseInt(e)===e&&(e={decimalPlaces:e,flipY:!1}),Object.assign({},{decimalPlaces:2,optimize:!0,flipY:!0,flipYBase:void 0},e)}(e);let s=this.commands;e.optimize&&(s=JSON.parse(JSON.stringify(this.commands)),s=$e(s));const r=e.flipY;let o=e.flipYBase;if(!0===r&&void 0===o){const e=new qe;e.extend(s);const t=e.getBoundingBox();o=t.y1+t.y2}let a="";for(let e=0;e<s.length;e+=1){const t=s[e];"M"===t.type?a+="M"+n(t.x,r?o-t.y:t.y):"L"===t.type?a+="L"+n(t.x,r?o-t.y:t.y):"C"===t.type?a+="C"+n(t.x1,r?o-t.y1:t.y1,t.x2,r?o-t.y2:t.y2,t.x,r?o-t.y:t.y):"Q"===t.type?a+="Q"+n(t.x1,r?o-t.y1:t.y1,t.x,r?o-t.y:t.y):"Z"===t.type&&(a+="Z")}return a},qe.prototype.toSVG=function(e,t){this._layers&&this._layers.length&&console.warn("toSVG() does not support colr font layers yet"),this._image&&console.warn("toSVG() does not support SVG glyphs yet"),t||(t=this.toPathData(e));let n='<path d="';return n+=t,n+='"',void 0!==this.fill&&"black"!==this.fill&&(null===this.fill?n+=' fill="none"':n+=' fill="'+this.fill+'"'),this.stroke&&(n+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),n+="/>",n},qe.prototype.toDOMElement=function(e,t){this._layers&&this._layers.length&&console.warn("toDOMElement() does not support colr font layers yet"),t||(t=this.toPathData(e));const n=t,s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("d",n),void 0!==this.fill&&"black"!==this.fill&&(null===this.fill?s.setAttribute("fill","none"):s.setAttribute("fill",this.fill)),this.stroke&&(s.setAttribute("stroke",this.stroke),s.setAttribute("stroke-width",this.strokeWidth)),s};var Xe=qe;function Ye(e){throw new Error(e)}function Ze(e,t){e||Ye(t)}var Qe={fail:Ye,argument:Ze,assert:Ze},Ke=2147483648,Je={},et={},tt={};function nt(e){return function(){return e}}et.BYTE=function(e){return Qe.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]},tt.BYTE=nt(1),et.CHAR=function(e){return[e.charCodeAt(0)]},tt.CHAR=nt(1),et.CHARARRAY=function(e){null==e&&(e="",console.warn("CHARARRAY with undefined or null value encountered and treated as an empty string. This is probably caused by a missing glyph name."));const t=[];for(let n=0;n<e.length;n+=1)t[n]=e.charCodeAt(n);return t},tt.CHARARRAY=function(e){return void 0===e?0:e.length},et.USHORT=function(e){return[e>>8&255,255&e]},tt.USHORT=nt(2),et.SHORT=function(e){return e>=32768&&(e=-(65536-e)),[e>>8&255,255&e]},tt.SHORT=nt(2),et.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},tt.UINT24=nt(3),et.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},tt.ULONG=nt(4),et.LONG=function(e){return e>=Ke&&(e=-(2*Ke-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},tt.LONG=nt(4),et.FLOAT=function(e){if(e>32767.00001525879||e<-32768)throw new Error(`Value ${e} is outside the range of representable values in 16.16 format`);const t=Math.round(65536*e)|0;return et.ULONG(t)},tt.FLOAT=tt.ULONG,et.FIXED=et.ULONG,tt.FIXED=tt.ULONG,et.FWORD=et.SHORT,tt.FWORD=tt.SHORT,et.UFWORD=et.USHORT,tt.UFWORD=tt.USHORT,et.F2DOT14=function(e){return et.USHORT(16384*e)},tt.F2DOT14=tt.USHORT,et.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},tt.LONGDATETIME=nt(8),et.TAG=function(e){return Qe.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},tt.TAG=nt(4),et.Card8=et.BYTE,tt.Card8=tt.BYTE,et.Card16=et.USHORT,tt.Card16=tt.USHORT,et.OffSize=et.BYTE,tt.OffSize=tt.BYTE,et.SID=et.USHORT,tt.SID=tt.USHORT,et.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?et.NUMBER16(e):et.NUMBER32(e)},tt.NUMBER=function(e){return et.NUMBER(e).length},et.NUMBER16=function(e){return[28,e>>8&255,255&e]},tt.NUMBER16=nt(3),et.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},tt.NUMBER32=nt(5),et.REAL=function(e){let t=e.toString();const n=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(n){const s=parseFloat("1e"+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*s)/s).toString()}let s="";for(let e=0,n=t.length;e<n;e+=1){const n=t[e];s+="e"===n?"-"===t[++e]?"c":"b":"."===n?"a":"-"===n?"e":n}s+=1&s.length?"f":"ff";const r=[30];for(let e=0,t=s.length;e<t;e+=2)r.push(parseInt(s.substr(e,2),16));return r},tt.REAL=function(e){return et.REAL(e).length},et.NAME=et.CHARARRAY,tt.NAME=tt.CHARARRAY,et.STRING=et.CHARARRAY,tt.STRING=tt.CHARARRAY,Je.UTF8=function(e,t,n){const s=[],r=n;for(let n=0;n<r;n++,t+=1)s[n]=e.getUint8(t);return String.fromCharCode.apply(null,s)},Je.UTF16=function(e,t,n){const s=[],r=n/2;for(let n=0;n<r;n++,t+=2)s[n]=e.getUint16(t);return String.fromCharCode.apply(null,s)},et.UTF16=function(e){const t=[];for(let n=0;n<e.length;n+=1){const s=e.charCodeAt(n);t[t.length]=s>>8&255,t[t.length]=255&s}return t},tt.UTF16=function(e){return 2*e.length};var st={"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":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};Je.MACSTRING=function(e,t,n,s){const r=st[s];if(void 0===r)return;let o="";for(let s=0;s<n;s++){const n=e.getUint8(t+s);o+=n<=127?String.fromCharCode(n):r[127&n]}return o};var rt,ot="function"==typeof WeakMap&&new WeakMap;function at(e){return e>=-128&&e<=127}function it(e,t,n){let s=0;const r=e.length;for(;t<r&&s<64&&0===e[t];)++t,++s;return n.push(128|s-1),t}function lt(e,t,n){let s=0;const r=e.length;let o=t;for(;o<r&&s<64;){const t=e[o];if(!at(t))break;if(0===t&&o+1<r&&0===e[o+1])break;++o,++s}n.push(s-1);for(let s=t;s<o;++s)n.push(e[s]+256&255);return o}function ut(e,t,n){let s=0;const r=e.length;let o=t;for(;o<r&&s<64;){const t=e[o];if(0===t)break;if(at(t)&&o+1<r&&at(e[o+1]))break;++o,++s}n.push(64|s-1);for(let s=t;s<o;++s){const t=e[s];n.push(t+65536>>8&255,t+256&255)}return o}et.MACSTRING=function(e,t){const n=function(e){if(!rt){rt={};for(let e in st)rt[e]=new String(e)}const t=rt[e];if(void 0===t)return;if(ot){const e=ot.get(t);if(void 0!==e)return e}const n=st[e];if(void 0===n)return;const s={};for(let e=0;e<n.length;e++)s[n.charCodeAt(e)]=e+128;return ot&&ot.set(t,s),s}(t);if(void 0===n)return;const s=[];for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>=128&&(r=n[r],void 0===r))return;s[t]=r}return s},tt.MACSTRING=function(e,t){const n=et.MACSTRING(e,t);return void 0!==n?n.length:0},et.VARDELTAS=function(e){let t=0;const n=[];for(;t<e.length;){const s=e[t];t=0===s?it(e,t,n):s>=-128&&s<=127?lt(e,t,n):ut(e,t,n)}return n},et.INDEX=function(e){let t=1;const n=[t],s=[];for(let r=0;r<e.length;r+=1){const o=et.OBJECT(e[r]);Array.prototype.push.apply(s,o),t+=o.length,n.push(t)}if(0===s.length)return[0,0];const r=[],o=1+Math.floor(Math.log(t)/Math.log(2))/8|0,a=[void 0,et.BYTE,et.USHORT,et.UINT24,et.ULONG][o];for(let e=0;e<n.length;e+=1){const t=a(n[e]);Array.prototype.push.apply(r,t)}return Array.prototype.concat(et.Card16(e.length),et.OffSize(o),r,s)},tt.INDEX=function(e){return et.INDEX(e).length},et.DICT=function(e){let t=[];const n=Object.keys(e),s=n.length;for(let r=0;r<s;r+=1){const s=parseInt(n[r],0),o=e[s],a=et.OPERAND(o.value,o.type),i=et.OPERATOR(s);for(let e=0;e<a.length;e++)t.push(a[e]);for(let e=0;e<i.length;e++)t.push(i[e])}return t},tt.DICT=function(e){return et.DICT(e).length},et.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},et.OPERAND=function(e,t){let n=[];if(Array.isArray(t))for(let s=0;s<t.length;s+=1){Qe.argument(e.length===t.length,"Not enough arguments given for type"+t);const r=et.OPERAND(e[s],t[s]);for(let e=0;e<r.length;e++)n.push(r[e])}else if("SID"===t){const t=et.NUMBER(e);for(let e=0;e<t.length;e++)n.push(t[e])}else if("offset"===t){const t=et.NUMBER32(e);for(let e=0;e<t.length;e++)n.push(t[e])}else if("number"===t){const t=et.NUMBER(e);for(let e=0;e<t.length;e++)n.push(t[e])}else{if("real"!==t)throw new Error("Unknown operand type "+t);{const t=et.REAL(e);for(let e=0;e<t.length;e++)n.push(t[e])}}return n},et.OP=et.BYTE,tt.OP=tt.BYTE;var ct="function"==typeof WeakMap&&new WeakMap;function pt(e,t,n){if(t&&t.length)for(let e=0;e<t.length;e+=1){const n=t[e];this[n.name]=n.value}if(this.tableName=e,this.fields=t,n){const e=Object.keys(n);for(let t=0;t<e.length;t+=1){const s=e[t],r=n[s];void 0!==this[s]&&(this[s]=r)}}}function ht(e,t,n){void 0===n&&(n=t.length);const s=new Array(t.length+1);s[0]={name:e+"Count",type:"USHORT",value:n};for(let n=0;n<t.length;n++)s[n+1]={name:e+n,type:"USHORT",value:t[n]};return s}function ft(e,t,n){const s=t.length,r=new Array(s+1);r[0]={name:e+"Count",type:"USHORT",value:s};for(let o=0;o<s;o++)r[o+1]={name:e+o,type:"TABLE",value:n(t[o],o)};return r}function dt(e,t,n){const s=t.length;let r=[];r[0]={name:e+"Count",type:"USHORT",value:s};for(let e=0;e<s;e++)r=r.concat(n(t[e],e));return r}function gt(e){1===e.format?pt.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(ht("glyph",e.glyphs))):2===e.format?pt.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(dt("rangeRecord",e.ranges,(function(e,t){return[{name:"startGlyphID"+t,type:"USHORT",value:e.start},{name:"endGlyphID"+t,type:"USHORT",value:e.end},{name:"startCoverageIndex"+t,type:"USHORT",value:e.index}]})))):Qe.assert(!1,"Coverage format must be 1 or 2.")}function mt(e){pt.call(this,"scriptListTable",dt("scriptRecord",e,(function(e,t){const n=e.script;let s=n.defaultLangSys;return Qe.assert(!!s,"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 pt("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new pt("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:s.reqFeatureIndex}].concat(ht("featureIndex",s.featureIndexes)))}].concat(dt("langSys",n.langSysRecords,(function(e,t){const n=e.langSys;return[{name:"langSysTag"+t,type:"TAG",value:e.tag},{name:"langSys"+t,type:"TABLE",value:new pt("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:n.reqFeatureIndex}].concat(ht("featureIndex",n.featureIndexes)))}]}))))}]})))}function yt(e){pt.call(this,"featureListTable",dt("featureRecord",e,(function(e,t){const n=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new pt("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat(ht("lookupListIndex",n.lookupListIndexes)))}]})))}function vt(e,t){pt.call(this,"lookupListTable",ft("lookup",e,(function(e){let n=t[e.lookupType];return Qe.assert(!!n,"Unable to write GSUB lookup type "+e.lookupType+" tables."),new pt("lookupTable",[{name:"lookupType",type:"USHORT",value:e.lookupType},{name:"lookupFlag",type:"USHORT",value:e.lookupFlag}].concat(ft("subtable",e.subtables,n)))})))}function bt(e){1===e.format?pt.call(this,"classDefTable",[{name:"classFormat",type:"USHORT",value:1},{name:"startGlyphID",type:"USHORT",value:e.startGlyph}].concat(ht("glyph",e.classes))):2===e.format?pt.call(this,"classDefTable",[{name:"classFormat",type:"USHORT",value:2}].concat(dt("rangeRecord",e.ranges,(function(e,t){return[{name:"startGlyphID"+t,type:"USHORT",value:e.start},{name:"endGlyphID"+t,type:"USHORT",value:e.end},{name:"class"+t,type:"USHORT",value:e.classId}]})))):Qe.assert(!1,"Class format must be 1 or 2.")}et.CHARSTRING=function(e){if(ct){const t=ct.get(e);if(void 0!==t)return t}let t=[];const n=e.length;for(let s=0;s<n;s+=1){const n=e[s],r=et[n.type](n.value);for(let e=0;e<r.length;e++)t.push(r[e])}return ct&&ct.set(e,t),t},tt.CHARSTRING=function(e){return et.CHARSTRING(e).length},et.OBJECT=function(e){const t=et[e.type];return Qe.argument(void 0!==t,"No encoding function for type "+e.type),t(e.value)},tt.OBJECT=function(e){const t=tt[e.type];return Qe.argument(void 0!==t,"No sizeOf function for type "+e.type),t(e.value)},et.TABLE=function(e){let t=[];const n=(e.fields||[]).length,s=[],r=[];for(let o=0;o<n;o+=1){const n=e.fields[o],a=et[n.type];Qe.argument(void 0!==a,"No encoding function for field type "+n.type+" ("+n.name+")");let i=e[n.name];void 0===i&&(i=n.value);const l=a(i);if("TABLE"===n.type)null!==i.fields&&(r.push(t.length),s.push(l)),t.push(0,0);else for(let e=0;e<l.length;e++)t.push(l[e])}for(let n=0;n<s.length;n+=1){const o=r[n],a=t.length;Qe.argument(a<65536,"Table "+e.tableName+" too big."),t[o]=a>>8,t[o+1]=255&a;for(let e=0;e<s[n].length;e++)t.push(s[n][e])}return t},tt.TABLE=function(e){let t=0;const n=(e.fields||[]).length;for(let s=0;s<n;s+=1){const n=e.fields[s],r=tt[n.type];Qe.argument(void 0!==r,"No sizeOf function for field type "+n.type+" ("+n.name+")");let o=e[n.name];void 0===o&&(o=n.value),t+=r(o),"TABLE"===n.type&&(t+=2)}return t},et.RECORD=et.TABLE,tt.RECORD=tt.TABLE,et.LITERAL=function(e){return e},tt.LITERAL=function(e){return e.length},pt.prototype.encode=function(){return et.TABLE(this)},pt.prototype.sizeOf=function(){return tt.TABLE(this)},gt.prototype=Object.create(pt.prototype),gt.prototype.constructor=gt,mt.prototype=Object.create(pt.prototype),mt.prototype.constructor=mt,yt.prototype=Object.create(pt.prototype),yt.prototype.constructor=yt,vt.prototype=Object.create(pt.prototype),vt.prototype.constructor=vt,bt.prototype=Object.create(pt.prototype),bt.prototype.constructor=bt;var St={Table:pt,Record:pt,Coverage:gt,ClassDef:bt,ScriptList:mt,FeatureList:yt,LookupList:vt,ushortList:ht,tableList:ft,recordList:dt};function xt(e,t){return e.getUint8(t)}function Tt(e,t){return e.getUint16(t,!1)}function Ot(e,t){return(e.getUint16(t)<<8)+e.getUint8(t+2)}function kt(e,t){return e.getUint32(t,!1)}function wt(e,t){return e.getInt16(t,!1)+e.getUint16(t+2,!1)/65535}var It={byte:1,uShort:2,f2dot14:2,short:2,uInt24:3,uLong:4,fixed:4,longDateTime:8,tag:4},Rt=32768,Ut=32767,Lt=32768,Ct=4095,Et=32768,Dt=16384,Mt=8192,Ft=4095,At=128,Nt=127,Pt=128,Bt=64,Gt=63,_t=15,Ht=48;function Vt(e,t){this.data=e,this.offset=t,this.relativeOffset=0}Vt.prototype.parseByte=function(){const e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},Vt.prototype.parseChar=function(){const e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},Vt.prototype.parseCard8=Vt.prototype.parseByte,Vt.prototype.parseUShort=function(){const e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},Vt.prototype.parseCard16=Vt.prototype.parseUShort,Vt.prototype.parseSID=Vt.prototype.parseUShort,Vt.prototype.parseOffset16=Vt.prototype.parseUShort,Vt.prototype.parseShort=function(){const e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},Vt.prototype.parseF2Dot14=function(){const e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},Vt.prototype.parseUInt24=function(){const e=Ot(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=3,e},Vt.prototype.parseULong=function(){const e=kt(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},Vt.prototype.parseLong=function(){const e=(t=this.data,n=this.offset+this.relativeOffset,t.getInt32(n,!1));var t,n;return this.relativeOffset+=4,e},Vt.prototype.parseOffset32=Vt.prototype.parseULong,Vt.prototype.parseFixed=function(){const e=wt(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},Vt.prototype.parseString=function(e){const t=this.data,n=this.offset+this.relativeOffset;let s="";this.relativeOffset+=e;for(let r=0;r<e;r++)s+=String.fromCharCode(t.getUint8(n+r));return s},Vt.prototype.parseTag=function(){return this.parseString(4)},Vt.prototype.parseLongDateTime=function(){let e=kt(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},Vt.prototype.parseVersion=function(e){const t=Tt(this.data,this.offset+this.relativeOffset),n=Tt(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,void 0===e&&(e=4096),t+n/e/10},Vt.prototype.skip=function(e,t){void 0===t&&(t=1),this.relativeOffset+=It[e]*t},Vt.prototype.parseULongList=function(e){void 0===e&&(e=this.parseULong());const t=new Array(e),n=this.data;let s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint32(s),s+=4;return this.relativeOffset+=4*e,t},Vt.prototype.parseOffset16List=Vt.prototype.parseUShortList=function(e){void 0===e&&(e=this.parseUShort());const t=new Array(e),n=this.data;let s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint16(s),s+=2;return this.relativeOffset+=2*e,t},Vt.prototype.parseShortList=function(e){const t=new Array(e),n=this.data;let s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getInt16(s),s+=2;return this.relativeOffset+=2*e,t},Vt.prototype.parseByteList=function(e){const t=new Array(e),n=this.data;let s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint8(s++);return this.relativeOffset+=e,t},Vt.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());const n=new Array(e);for(let s=0;s<e;s++)n[s]=t.call(this);return n},Vt.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());const n=new Array(e);for(let s=0;s<e;s++)n[s]=t.call(this);return n},Vt.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());const n=new Array(e),s=Object.keys(t);for(let r=0;r<e;r++){const e={};for(let n=0;n<s.length;n++){const r=s[n],o=t[r];e[r]=o.call(this)}n[r]=e}return n},Vt.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());const n=new Array(e),s=Object.keys(t);for(let r=0;r<e;r++){const e={};for(let n=0;n<s.length;n++){const r=s[n],o=t[r];e[r]=o.call(this)}n[r]=e}return n},Vt.prototype.parseTupleRecords=function(e,t){let n=[];for(let s=0;s<e;s++){let e=[];for(let n=0;n<t;n++)e.push(this.parseF2Dot14());n.push(e)}return n},Vt.prototype.parseStruct=function(e){if("function"==typeof e)return e.call(this);{const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const r=t[s],o=e[r];n[r]=o.call(this)}return n}},Vt.prototype.parseValueRecord=function(e){if(void 0===e&&(e=this.parseUShort()),0===e)return;const t={};return 1&e&&(t.xPlacement=this.parseShort()),2&e&&(t.yPlacement=this.parseShort()),4&e&&(t.xAdvance=this.parseShort()),8&e&&(t.yAdvance=this.parseShort()),16&e&&(t.xPlaDevice=void 0,this.parseShort()),32&e&&(t.yPlaDevice=void 0,this.parseShort()),64&e&&(t.xAdvDevice=void 0,this.parseShort()),128&e&&(t.yAdvDevice=void 0,this.parseShort()),t},Vt.prototype.parseValueRecordList=function(){const e=this.parseUShort(),t=this.parseUShort(),n=new Array(t);for(let s=0;s<t;s++)n[s]=this.parseValueRecord(e);return n},Vt.prototype.parsePointer=function(e){const t=this.parseOffset16();if(t>0)return new Vt(this.data,this.offset+t).parseStruct(e)},Vt.prototype.parsePointer32=function(e){const t=this.parseOffset32();if(t>0)return new Vt(this.data,this.offset+t).parseStruct(e)},Vt.prototype.parseListOfLists=function(e){const t=this.parseOffset16List(),n=t.length,s=this.relativeOffset,r=new Array(n);for(let s=0;s<n;s++){const n=t[s];if(0!==n)if(this.relativeOffset=n,e){const t=this.parseOffset16List(),o=new Array(t.length);for(let s=0;s<t.length;s++)this.relativeOffset=n+t[s],o[s]=e.call(this);r[s]=o}else r[s]=this.parseUShortList();else r[s]=void 0}return this.relativeOffset=s,r},Vt.prototype.parseCoverage=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort(),n=this.parseUShort();if(1===t)return{format:1,glyphs:this.parseUShortList(n)};if(2===t){const e=new Array(n);for(let t=0;t<n;t++)e[t]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:e}}throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.")},Vt.prototype.parseClassDef=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()}:2===t?{format:2,ranges:this.parseRecordList({start:Vt.uShort,end:Vt.uShort,classId:Vt.uShort})}:(console.warn(`0x${e.toString(16)}: This font file uses an invalid ClassDef format of ${t}. It might be corrupted and should be reacquired if it doesn't display as intended.`),{format:t})},Vt.list=function(e,t){return function(){return this.parseList(e,t)}},Vt.list32=function(e,t){return function(){return this.parseList32(e,t)}},Vt.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},Vt.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},Vt.pointer=function(e){return function(){return this.parsePointer(e)}},Vt.pointer32=function(e){return function(){return this.parsePointer32(e)}},Vt.tag=Vt.prototype.parseTag,Vt.byte=Vt.prototype.parseByte,Vt.uShort=Vt.offset16=Vt.prototype.parseUShort,Vt.uShortList=Vt.prototype.parseUShortList,Vt.uInt24=Vt.prototype.parseUInt24,Vt.uLong=Vt.offset32=Vt.prototype.parseULong,Vt.uLongList=Vt.prototype.parseULongList,Vt.fixed=Vt.prototype.parseFixed,Vt.f2Dot14=Vt.prototype.parseF2Dot14,Vt.struct=Vt.prototype.parseStruct,Vt.coverage=Vt.prototype.parseCoverage,Vt.classDef=Vt.prototype.parseClassDef;var zt={reserved:Vt.uShort,reqFeatureIndex:Vt.uShort,featureIndexes:Vt.uShortList};Vt.prototype.parseScriptList=function(){return this.parsePointer(Vt.recordList({tag:Vt.tag,script:Vt.pointer({defaultLangSys:Vt.pointer(zt),langSysRecords:Vt.recordList({tag:Vt.tag,langSys:Vt.pointer(zt)})})}))||[]},Vt.prototype.parseFeatureList=function(){return this.parsePointer(Vt.recordList({tag:Vt.tag,feature:Vt.pointer({featureParams:Vt.offset16,lookupListIndexes:Vt.uShortList})}))||[]},Vt.prototype.parseLookupList=function(e){return this.parsePointer(Vt.list(Vt.pointer((function(){const t=this.parseUShort();Qe.argument(1<=t&&t<=9,"GPOS/GSUB lookup type "+t+" unknown.");const n=this.parseUShort(),s=16&n;return{lookupType:t,lookupFlag:n,subtables:this.parseList(Vt.pointer(e[t])),markFilteringSet:s?this.parseUShort():void 0}}))))||[]},Vt.prototype.parseFeatureVariationsList=function(){return this.parsePointer32((function(){const e=this.parseUShort(),t=this.parseUShort();Qe.argument(1===e&&t<1,"GPOS/GSUB feature variations table unknown.");return this.parseRecordList32({conditionSetOffset:Vt.offset32,featureTableSubstitutionOffset:Vt.offset32})}))||[]},Vt.prototype.parseVariationStore=function(){const e=this.relativeOffset,t=this.parseUShort(),n={itemVariationStore:this.parseItemVariationStore()};return this.relativeOffset=e+t+2,n},Vt.prototype.parseItemVariationStore=function(){const e=this.relativeOffset,t={format:this.parseUShort(),variationRegions:[],itemVariationSubtables:[]},n=this.parseOffset32(),s=this.parseUShort(),r=this.parseULongList(s);this.relativeOffset=e+n,t.variationRegions=this.parseVariationRegionList();for(let n=0;n<s;n++){const s=r[n];this.relativeOffset=e+s,t.itemVariationSubtables.push(this.parseItemVariationSubtable())}return t},Vt.prototype.parseVariationRegionList=function(){const e=this.parseUShort(),t=this.parseUShort();return this.parseRecordList(t,{regionAxes:Vt.recordList(e,{startCoord:Vt.f2Dot14,peakCoord:Vt.f2Dot14,endCoord:Vt.f2Dot14})})},Vt.prototype.parseItemVariationSubtable=function(){const e=this.parseUShort(),t=this.parseUShort(),n=this.parseUShortList(),s=n.length;return{regionIndexes:n,deltaSets:e&&s?this.parseDeltaSets(e,t,s):[]}},Vt.prototype.parseDeltaSetIndexMap=function(){const e=this.parseByte(),t=this.parseByte(),n=[];let s=0;switch(e){case 0:s=this.parseUShort();break;case 1:s=this.parseULong();break;default:console.error(`unsupported DeltaSetIndexMap format ${e}`)}if(!s)return{format:e,entryFormat:t};const r=1+(t&_t),o=1+((t&Ht)>>4);for(let e=0;e<s;e++){let e;if(1===o)e=this.parseByte();else if(2===o)e=this.parseUShort();else if(3===o)e=this.parseUInt24();else{if(4!==o)throw new Error(`Invalid entry size of ${o}`);e=this.getULong()}const t=e>>r,s=e&(1<<r)-1;n.push({outerIndex:t,innerIndex:s})}return{format:e,entryFormat:t,map:n}},Vt.prototype.parseDeltaSets=function(e,t,n){const s=Array.from({length:e},(()=>[])),r=t&Rt,o=t&Ut;if(o>n)throw Error("wordCount must be less than or equal to regionIndexCount");const a=(r?this.parseLong:this.parseShort).bind(this),i=(r?this.parseShort:this.parseChar).bind(this);for(let t=0;t<e;t++)for(let e=0;e<n;e++)e<o?s[t].push(a()):s[t].push(i());return s},Vt.prototype.parseTupleVariationStoreList=function(e,t,n){const s=this.parseUShort(),r=1&this.parseUShort(),o=this.parseOffset32(),a=(r?this.parseULong:this.parseUShort).bind(this),i={};let l,u=a();r||(u*=2);for(let c=0;c<s;c++){l=a(),r||(l*=2);const s=l-u;i[c]=s?this.parseTupleVariationStore(o+u,e,t,n,c):void 0,u=l}return i},Vt.prototype.parseTupleVariationStore=function(e,t,n,s,r){const o=this.relativeOffset;this.relativeOffset=e,"cvar"===n&&(this.relativeOffset+=4);const a=this.parseUShort(),i=!!(a&Lt),l=a&Ct;let u=this.parseOffset16();const c=[];let p=[];for(let e=0;e<l;e++){const e=this.parseTupleVariationHeader(t,n);c.push(e)}this.relativeOffset!==e+u&&(console.warn(`Unexpected offset after parsing tuple variation headers! Expected ${e+u}, actually ${this.relativeOffset}`),this.relativeOffset=e+u),i&&(p=this.parsePackedPointNumbers());let h=this.relativeOffset;for(let e=0;e<l;e++){const t=c[e];t.privatePoints=[],this.relativeOffset=h,"cvar"!==n||t.peakTuple||console.warn("An embedded peak tuple is required in TupleVariationHeaders for the cvar table."),t.flags.privatePointNumbers&&(t.privatePoints=this.parsePackedPointNumbers()),delete t.flags;const o=this.offset,a=this.relativeOffset,i=e=>{let i,l;const u=()=>{let e=0;if("gvar"===n){if(e=t.privatePoints.length||p.length,!e){const t=s.get(r);t.path,e=t.points.length,e+=4}}else"cvar"===n&&(e=s.length);this.offset=o,this.relativeOffset=a,i=this.parsePackedDeltas(e),"gvar"===n&&(l=this.parsePackedDeltas(e))};return{configurable:!0,get:function(){return void 0===i&&u(),"deltasY"===e?l:i},set:function(t){void 0===i&&u(),"deltasY"===e?l=t:i=t}}};Object.defineProperty(t,"deltas",i.call(this,"deltas")),"gvar"===n&&Object.defineProperty(t,"deltasY",i.call(this,"deltasY")),h+=t.variationDataSize,delete t.variationDataSize}this.relativeOffset=o;const f={headers:c};return f.sharedPoints=p,f},Vt.prototype.parseTupleVariationHeader=function(e,t){const n=this.parseUShort(),s=this.parseUShort(),r=!!(s&Et),o=!!(s&Dt),a=!!(s&Mt),i=r?void 0:s&Ft,l={variationDataSize:n,peakTuple:r?this.parseTupleRecords(1,e)[0]:void 0,intermediateStartTuple:o?this.parseTupleRecords(1,e)[0]:void 0,intermediateEndTuple:o?this.parseTupleRecords(1,e)[0]:void 0,flags:{embeddedPeakTuple:r,intermediateRegion:o,privatePointNumbers:a}};return"gvar"===t&&(l.sharedTupleRecordsIndex=i),l},Vt.prototype.parsePackedPointNumbers=function(){const e=this.parseByte(),t=[];let n=e;if(e>=128){const t=this.parseByte();n=(e&Nt)<<8|t}let s=0;for(;t.length<n;){const e=this.parseByte(),r=!!(e&At);let o=1+(e&Nt);for(let e=0;e<o&&t.length<n;e++){let e;e=r?this.parseUShort():this.parseByte(),s+=e,t.push(s)}}return t},Vt.prototype.parsePackedDeltas=function(e){const t=[];for(;t.length<e;){const n=this.parseByte(),s=!!(n&Pt),r=!!(n&Bt),o=1+(n&Gt);for(let n=0;n<o&&t.length<e;n++)s?t.push(0):r?t.push(this.parseShort()):t.push(this.parseChar())}return t};var qt={getByte:xt,getCard8:xt,getUShort:Tt,getCard16:Tt,getShort:function(e,t){return e.getInt16(t,!1)},getUInt24:Ot,getULong:kt,getFixed:wt,getTag:function(e,t){let n="";for(let s=t;s<t+4;s+=1)n+=String.fromCharCode(e.getInt8(s));return n},getOffset:function(e,t,n){let s=0;for(let r=0;r<n;r+=1)s<<=8,s+=e.getUint8(t+r);return s},getBytes:function(e,t,n){const s=[];for(let r=t;r<n;r+=1)s.push(e.getUint8(r));return s},bytesToString:function(e){let t="";for(let n=0;n<e.length;n+=1)t+=String.fromCharCode(e[n]);return t},Parser:Vt},jt=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],Wt={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"},$t={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},Xt={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 Yt(e,t,n){switch(e){case 0:if(65535===t)return"und";if(n)return n[t];break;case 1:return Wt[t];case 3:return Xt[t]}}var Zt="utf-16",Qt={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"},Kt={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 Jt(e,t,n){switch(e){case 0:return Zt;case 1:return Kt[n]||Qt[t];case 3:if(1===t||10===t)return Zt}}var en={0:"unicode",1:"macintosh",2:"reserved",3:"windows"};function tn(e){return en[e]}function nn(e){const t={};for(let n in e)t[e[n]]=parseInt(n);return t}function sn(e,t,n,s,r,o){return new St.Record("NameRecord",[{name:"platformID",type:"USHORT",value:e},{name:"encodingID",type:"USHORT",value:t},{name:"languageID",type:"USHORT",value:n},{name:"nameID",type:"USHORT",value:s},{name:"length",type:"USHORT",value:r},{name:"offset",type:"USHORT",value:o}])}function rn(e,t){let n=function(e,t){const n=e.length,s=t.length-n+1;e:for(let r=0;r<s;r++)for(;r<s;r++){for(let s=0;s<n;s++)if(t[r+s]!==e[s])continue e;return r}return-1}(e,t);if(n<0){n=t.length;let s=0;const r=e.length;for(;s<r;++s)t.push(e[s])}return n}function on(e,t,n=[]){if(t<256&&t in jt){if(n.length&&!n.includes(parseInt(t)))return;t=jt[t]}for(let n in e)for(let s in e[n])if(s===t||parseInt(s)===t)return e[n][s]}var an={parse:function(e,t,n){const s={},r=new qt.Parser(e,t),o=r.parseUShort(),a=r.parseUShort(),i=r.offset+r.parseUShort();for(let t=0;t<a;t++){const t=r.parseUShort(),o=r.parseUShort(),a=r.parseUShort(),l=r.parseUShort(),u=jt[l]||l,c=r.parseUShort(),p=r.parseUShort(),h=Yt(t,a,n),f=Jt(t,o,a),d=tn(t);if(void 0!==f&&void 0!==h&&void 0!==d){let t;if(t=f===Zt?Je.UTF16(e,i+p,c):Je.MACSTRING(e,i+p,c,f),t){let e=s[d];void 0===e&&(e=s[d]={});let n=e[u];void 0===n&&(n=e[u]={}),n[h]=t}}}return 1===o&&r.parseUShort(),s},make:function(e,t){const n=nn(en),s=nn(Wt),r=nn(Xt),o=[],a=[];for(let i in e){let l;const u=[],c={},p=nn(jt),h=n[i];for(let t in e[i]){let n=p[t];if(void 0===n&&(n=t),l=parseInt(n),isNaN(l))throw new Error('Name table entry "'+t+'" does not exist, see nameTableNames for complete list.');c[l]=e[i][t],u.push(l)}for(let e=0;e<u.length;e++){l=u[e];const n=c[l];for(let e in n){const i=n[e];if(1===h||0===h){let n=s[e],r=$t[n];const u=Jt(h,r,n);let c=et.MACSTRING(i,u);if(0===h&&(n=t.indexOf(e),n<0&&(n=t.length,t.push(e)),r=4,c=et.UTF16(i)),void 0!==c){const e=rn(c,a);o.push(sn(h,r,n,l,c.length,e))}}if(3===h){const t=r[e];if(void 0!==t){const e=et.UTF16(i),n=rn(e,a);o.push(sn(3,1,t,l,e.length,n))}}}}}o.sort((function(e,t){return e.platformID-t.platformID||e.encodingID-t.encodingID||e.languageID-t.languageID||e.nameID-t.nameID}));const i=new St.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:o.length},{name:"stringOffset",type:"USHORT",value:6+12*o.length}]);for(let e=0;e<o.length;e++)i.fields.push({name:"record_"+e,type:"RECORD",value:o[e]});return i.fields.push({name:"strings",type:"LITERAL",value:a}),i},getNameByID:on};function ln(e,t,n){e.segments.push({end:t,start:t,delta:-(t-n),offset:0,glyphIndex:n})}var un={parse:function(e,t){const n={};n.version=qt.getUShort(e,t),Qe.argument(0===n.version,"cmap table version should be 0."),n.numTables=qt.getUShort(e,t+2);let s=null,r=-1,o=-1,a=null,i=null;const l=[0,1,2,3,4,6],u=[0,1,10];for(let c=n.numTables-1;c>=0;c-=1)if(a=qt.getUShort(e,t+4+8*c),i=qt.getUShort(e,t+4+8*c+2),3===a&&u.includes(i)||0===a&&l.includes(i)||1===a&&0===i){if(o>0)continue;if(o=qt.getULong(e,t+4+8*c+4),s)break}else if(0===a&&5===i)if(r=qt.getULong(e,t+4+8*c+4),s=new qt.Parser(e,t+r),14!==s.parseUShort())r=-1,s=null;else if(o>0)break;if(-1===o)throw new Error("No valid cmap sub-tables found.");const c=new qt.Parser(e,t+o);if(n.format=c.parseUShort(),0===n.format)!function(e,t,n,s){e.length=t.parseUShort(),e.language=t.parseUShort()-1;const r=t.parseByteList(e.length),o=Object.assign({},r),a=Jt(n,s,e.language),i=st[a];for(let e=0;e<i.length;e++)o[i.charCodeAt(e)]=r[128+e];e.glyphIndexMap=o}(n,c,a,i);else if(12===n.format||13===n.format)!function(e,t,n){let s;t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong(),e.groupCount=s=t.parseULong(),e.glyphIndexMap={};for(let r=0;r<s;r+=1){const s=t.parseULong(),r=t.parseULong();let o=t.parseULong();for(let t=s;t<=r;t+=1)e.glyphIndexMap[t]=o,12===n&&o++}}(n,c,n.format);else{if(4!==n.format)throw new Error("Only format 0 (platformId 1, encodingId 0), 4, 12 and 14 cmap tables are supported (found format "+n.format+", platformId "+a+", encodingId "+i+").");!function(e,t,n,s,r){let o;e.length=t.parseUShort(),e.language=t.parseUShort(),e.segCount=o=t.parseUShort()>>1,t.skip("uShort",3),e.glyphIndexMap={};const a=new qt.Parser(n,s+r+14),i=new qt.Parser(n,s+r+16+2*o),l=new qt.Parser(n,s+r+16+4*o),u=new qt.Parser(n,s+r+16+6*o);let c=s+r+16+8*o;for(let t=0;t<o-1;t+=1){let t;const s=a.parseUShort(),r=i.parseUShort(),o=l.parseShort(),p=u.parseUShort();for(let a=r;a<=s;a+=1)0!==p?(c=u.offset+u.relativeOffset-2,c+=p,c+=2*(a-r),t=qt.getUShort(n,c),0!==t&&(t=t+o&65535)):t=a+o&65535,e.glyphIndexMap[a]=t}}(n,c,e,t,o)}return s&&function(e,t){const n={};t.skip("uLong");const s=t.parseULong();for(let e=0;e<s;e+=1){const e=t.parseUInt24(),s={varSelector:e},r=t.parseOffset32(),o=t.parseOffset32(),a=t.relativeOffset;r&&(t.relativeOffset=r,s.defaultUVS=t.parseStruct({ranges:function(){return t.parseRecordList32({startUnicodeValue:t.parseUInt24,additionalCount:t.parseByte})}})),o&&(t.relativeOffset=o,s.nonDefaultUVS=t.parseStruct({uvsMappings:function(){const e={},n=t.parseRecordList32({unicodeValue:t.parseUInt24,glyphID:t.parseUShort});for(let t=0;t<n.length;t+=1)e[n[t].unicodeValue]=n[t];return e}})),n[e]=s,t.relativeOffset=a}e.varSelectorList=n}(n,s),n},make:function(e){let t,n=!0;for(t=e.length-1;t>0;t-=1){if(e.get(t).unicode>65535){console.log("Adding CMAP format 12 (needed!)"),n=!1;break}}let s=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:n?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:n?12:20}];n||s.push({name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}),s.push({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});const r=new St.Table("cmap",s);for(r.segments=[],t=0;t<e.length;t+=1){const n=e.get(t);for(let e=0;e<n.unicodes.length;e+=1)ln(r,n.unicodes[e],t)}r.segments.sort((function(e,t){return e.start-t.start})),function(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}(r);const o=r.segments.length;let a=0,i=[],l=[],u=[],c=[],p=[],h=[];for(t=0;t<o;t+=1){const e=r.segments[t];e.end<=65535&&e.start<=65535?(i.push({name:"end_"+t,type:"USHORT",value:e.end}),l.push({name:"start_"+t,type:"USHORT",value:e.start}),u.push({name:"idDelta_"+t,type:"SHORT",value:e.delta}),c.push({name:"idRangeOffset_"+t,type:"USHORT",value:e.offset}),void 0!==e.glyphId&&p.push({name:"glyph_"+t,type:"USHORT",value:e.glyphId})):a+=1,n||void 0===e.glyphIndex||(h.push({name:"cmap12Start_"+t,type:"ULONG",value:e.start}),h.push({name:"cmap12End_"+t,type:"ULONG",value:e.end}),h.push({name:"cmap12Glyph_"+t,type:"ULONG",value:e.glyphIndex}))}r.segCountX2=2*(o-a),r.searchRange=2*Math.pow(2,Math.floor(Math.log(o-a)/Math.log(2))),r.entrySelector=Math.log(r.searchRange/2)/Math.log(2),r.rangeShift=r.segCountX2-r.searchRange;for(let e=0;e<i.length;e++)r.fields.push(i[e]);r.fields.push({name:"reservedPad",type:"USHORT",value:0});for(let e=0;e<l.length;e++)r.fields.push(l[e]);for(let e=0;e<u.length;e++)r.fields.push(u[e]);for(let e=0;e<c.length;e++)r.fields.push(c[e]);for(let e=0;e<p.length;e++)r.fields.push(p[e]);if(r.cmap4Length=14+2*i.length+2+2*l.length+2*u.length+2*c.length+2*p.length,!n){const e=16+4*h.length;r.cmap12Offset=20+r.cmap4Length,r.fields.push({name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:e},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:h.length/3});for(let e=0;e<h.length;e++)r.fields.push(h[e])}return r}},cn=[".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"],pn=[".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"],hn=[".notdef","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"],fn=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","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"],dn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],gn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],mn=[".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 yn(e){this.font=e}function vn(e){this.cmap=e}function bn(e,t){this.encoding=e,this.charset=t}function Sn(e){switch(e.version){case 1:this.names=mn.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(let t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<mn.length?this.names[t]=mn[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-mn.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(let t=0;t<e.numberOfGlyphs;t++)this.names[t]=mn[t+e.glyphNameIndex[t]];break;default:this.names=[]}}function xn(e,t){t.lowMemory?function(e){e._IndexToUnicodeMap={};const t=e.tables.cmap.glyphIndexMap,n=Object.keys(t);for(let s=0;s<n.length;s+=1){const r=n[s];let o=t[r];void 0===e._IndexToUnicodeMap[o]?e._IndexToUnicodeMap[o]={unicodes:[parseInt(r)]}:e._IndexToUnicodeMap[o].unicodes.push(parseInt(r))}}(e):function(e){let t;const n=e.tables.cmap.glyphIndexMap,s=Object.keys(n);for(let r=0;r<s.length;r+=1){const o=s[r],a=n[o];t=e.glyphs.get(a),t.addUnicode(parseInt(o))}for(let n=0;n<e.glyphs.length;n+=1)t=e.glyphs.get(n),e.cffEncoding?t.name=e.cffEncoding.charset[n]:e.glyphNames.names&&(t.name=e.glyphNames.glyphIndexToName(n))}(e)}yn.prototype.charToGlyphIndex=function(e){const t=e.codePointAt(0),n=this.font.glyphs;if(n)for(let e=0;e<n.length;e+=1){const s=n.get(e);for(let n=0;n<s.unicodes.length;n+=1)if(s.unicodes[n]===t)return e}return null},vn.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0},bn.prototype.charToGlyphIndex=function(e){const t=e.codePointAt(0),n=this.encoding[t];return this.charset.indexOf(n)},Sn.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},Sn.prototype.glyphIndexToName=function(e){return this.names[e]};var Tn={line:function(e,t,n,s,r){e.beginPath(),e.moveTo(t,n),e.lineTo(s,r),e.stroke()}};function On(e){var t=(4278190080&e)>>24,n=(16711680&e)>>16,s=(65280&e)>>8,r=255&e;return{b:t=t+256&255,g:n=n+256&255,r:s=s+256&255,a:r=(r+256&255)/255}}function kn(e,t,n=0,s="hexa"){if(65535==t)return"currentColor";const r=e&&e.tables&&e.tables.cpal;if(!r)return"currentColor";if(n>r.colorRecordIndices.length-1)throw new Error(`Palette index out of range (colorRecordIndices.length: ${r.colorRecordIndices.length}, index: ${t})`);if(t>r.numPaletteEntries)throw new Error(`Color index out of range (numPaletteEntries: ${r.numPaletteEntries}, index: ${t})`);const o=r.colorRecordIndices[n]+t;if(o>r.colorRecords)throw new Error(`Color index out of range (colorRecords.length: ${r.colorRecords.length}, lookupIndex: ${o})`);const a=On(r.colorRecords[o]);return"bgra"===s?a:Un(a,s)}function wn(e){return("0"+parseInt(e).toString(16)).slice(-2)}function In(e){return parseInt(`0x${wn(e.b)}${wn(e.g)}${wn(e.r)}${wn(255*e.a)}`,16)}function Rn(e,t="hexa"){const n="raw"==t||"cpal"==t,s=Number.isInteger(e);let r=!0;if(s&&n||"currentColor"===e)return e;if("object"==typeof e){if("bgra"==t)return e;if(n)return In(e)}else if(!s&&/^#([a-f0-9]{3}|[a-f0-9]{4}|[a-f0-9]{6}|[a-f0-9]{8})$/i.test(e.trim())){switch((e=e.trim().substring(1)).length){case 3:e={r:parseInt(e[0].repeat(2),16),g:parseInt(e[1].repeat(2),16),b:parseInt(e[2].repeat(2),16),a:1};break;case 4:e={r:parseInt(e[0].repeat(2),16),g:parseInt(e[1].repeat(2),16),b:parseInt(e[2].repeat(2),16),a:parseInt(e[3].repeat(2),16)/255};break;case 6:e={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16),a:1};break;case 8:e={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16),a:parseInt(e[6]+e[7],16)/255}}if("bgra"==t)return e}else if("undefined"!=typeof document&&/^[a-z]+$/i.test(e)){const t=document.createElement("canvas").getContext("2d");t.fillStyle=e;const n=Un(t.fillStyle,"hexa");"#000000ff"===n&&"black"!==e.toLowerCase()?r=!1:e=n}else{e=e.trim();const t=/rgba?\(\s*(?:(\d*\.\d+)(%?)|(\d+)(%?))\s*(?:,|\s*)\s*(?:(\d*\.\d+)(%?)|(\d+)(%?))\s*(?:,|\s*)\s*(?:(\d*\.\d+)(%?)|(\d+)(%?))\s*(?:(?:,|\s|\/)\s*(?:(0*(?:\.\d+)?()|0*1(?:\.0+)?())|(?:\.\d+)|(\d+)(%)|(\d*\.\d+)(%)))?\s*\)/;if(t.test(e)){const n=e.match(t).filter((e=>void 0!==e));e={r:Math.round(parseFloat(n[1])/(n[2]?100/255:1)),g:Math.round(parseFloat(n[3])/(n[4]?100/255:1)),b:Math.round(parseFloat(n[5])/(n[6]?100/255:1)),a:n[7]?parseFloat(n[7])/(n[8]?100:1):1}}else{const t=/hsla?\(\s*(?:(\d*\.\d+|\d+)(deg|turn|))\s*(?:,|\s*)\s*(?:(\d*\.\d+)%?|(\d+)%?)\s*(?:,|\s*)\s*(?:(\d*\.\d+)%?|(\d+)%?)\s*(?:(?:,|\s|\/)\s*(?:(0*(?:\.\d+)?()|0*1(?:\.0+)?())|(?:\.\d+)|(\d+)(%)|(\d*\.\d+)(%)))?\s*\)/;if(t.test(e)){const n=e.match(t).filter((e=>void 0!==e));e=function(e){let{h:t,s:n,l:s,a:r}=e;t%=360,n/=100,s/=100;const o=(1-Math.abs(2*s-1))*n,a=o*(1-Math.abs(t/60%2-1)),i=s-o/2;let l=0,u=0,c=0;return 0<=t&&t<60?(l=o,u=a,c=0):60<=t&&t<120?(l=a,u=o,c=0):120<=t&&t<180?(l=0,u=o,c=a):180<=t&&t<240?(l=0,u=a,c=o):240<=t&&t<300?(l=a,u=0,c=o):300<=t&&t<=360&&(l=o,u=0,c=a),{r:Math.round(255*(l+i)),g:Math.round(255*(u+i)),b:Math.round(255*(c+i)),a:r}}({h:parseFloat(n[1])*("turn"===n[2]?360:1),s:parseFloat(n[3]),l:parseFloat(n[4]),a:n[5]?parseFloat(n[5])/(n[6]?100:1):1})}else r=!1}}if(!r)throw new Error(`Invalid color format: ${e}`);return Un(e,t)}function Un(e,t="hexa"){if("currentColor"===e)return e;if(Number.isInteger(e)){if("raw"==t||"cpal"==t)return e;e=On(e)}else"object"!=typeof e&&(e=Rn(e,"bgra"));let n=["hsl","hsla"].includes(t)?function(e){const t=e.r/255,n=e.g/255,s=e.b/255,r=Math.max(t,n,s),o=Math.min(t,n,s);let a,i,l=(r+o)/2;if(r===o)a=i=0;else{const e=r-o;switch(i=l>.5?e/(2-r-o):e/(r+o),r){case t:a=(n-s)/e+(n<s?6:0);break;case n:a=(s-t)/e+2;break;case s:a=(t-n)/e+4}a/=6}return{h:360*a,s:100*i,l:100*l}}(e):null;switch(t){case"rgba":return`rgba(${e.r}, ${e.g}, ${e.b}, ${parseFloat(e.a.toFixed(3))})`;case"rgb":return`rgb(${e.r}, ${e.g}, ${e.b})`;case"hex":case"hex6":case"hex-6":return`#${wn(e.r)}${wn(e.g)}${wn(e.b)}`;case"hexa":case"hex8":case"hex-8":return`#${wn(e.r)}${wn(e.g)}${wn(e.b)}${wn(255*e.a)}`;case"hsl":return`hsl(${n.h.toFixed(2)}, ${n.s.toFixed(2)}%, ${n.l.toFixed(2)}%)`;case"hsla":return`hsla(${n.h.toFixed(2)}, ${n.s.toFixed(2)}%, ${n.l.toFixed(2)}%, ${parseFloat(e.a.toFixed(3))})`;case"bgra":return e;case"raw":case"cpal":return In(e);default:throw new Error("Unknown color format: "+t)}}var Ln={parse:function(e,t){const n=new Vt(e,t),s=n.parseShort();0!==s&&console.warn("Only CPALv0 is currently fully supported.");const r=n.parseShort(),o=n.parseShort(),a=n.parseShort(),i=n.parseOffset32(),l=n.parseUShortList(o);n.relativeOffset=i;const u=n.parseULongList(a);return n.relativeOffset=i,{version:s,numPaletteEntries:r,colorRecords:u,colorRecordIndices:l}},make:function({version:e=0,numPaletteEntries:t=0,colorRecords:n=[],colorRecordIndices:s=[0]}){return Qe.argument(0===e,"Only CPALv0 are supported."),Qe.argument(n.length,"No colorRecords given."),Qe.argument(s.length,"No colorRecordIndices given."),s.length>1&&Qe.argument(t,"Can't infer numPaletteEntries on multiple colorRecordIndices"),new St.Table("CPAL",[{name:"version",type:"USHORT",value:e},{name:"numPaletteEntries",type:"USHORT",value:t||n.length},{name:"numPalettes",type:"USHORT",value:s.length},{name:"numColorRecords",type:"USHORT",value:n.length},{name:"colorRecordsArrayOffset",type:"ULONG",value:12+2*s.length},...s.map(((e,t)=>({name:"colorRecordIndices_"+t,type:"USHORT",value:e}))),...n.map(((e,t)=>({name:"colorRecords_"+t,type:"ULONG",value:e})))])},getPaletteColor:kn,parseColor:Rn,formatColor:Un};function Cn(e){this.bindConstructorValues(e)}Cn.prototype.bindConstructorValues=function(e){if(this.index=e.index||0,".notdef"===e.name?e.unicode=void 0:".null"===e.name&&(e.unicode=0),0===e.unicode&&".null"!==e.name)throw new Error('The unicode value "0" is reserved for the glyph name ".null" and cannot be used by any other glyph.');this.name=e.name||null,this.unicode=e.unicode,this.unicodes=e.unicodes||(void 0!==e.unicode?[e.unicode]:[]),"xMin"in e&&(this.xMin=e.xMin),"yMin"in e&&(this.yMin=e.yMin),"xMax"in e&&(this.xMax=e.xMax),"yMax"in e&&(this.yMax=e.yMax),"advanceWidth"in e&&(this.advanceWidth=e.advanceWidth),"leftSideBearing"in e&&(this.leftSideBearing=e.leftSideBearing),"points"in e&&(this.points=e.points),Object.defineProperty(this,"path",function(e,t){let n=t||new Xe;return{configurable:!0,get:function(){return"function"==typeof n&&(n=n()),n},set:function(e){n=e}}}(0,e.path))},Cn.prototype.addUnicode=function(e){0===this.unicodes.length&&(this.unicode=e),this.unicodes.push(e)},Cn.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},Cn.prototype.getPath=function(e,t,n,s,r){let o,a;e=void 0!==e?e:0,t=void 0!==t?t:0,n=void 0!==n?n:72;let i=(s=Object.assign({},r&&r.defaultRenderOptions,s)).xScale,l=s.yScale;const u=1/(this.path.unitsPerEm||1e3)*n;let c=this;r&&r.variation&&(c=r.variation.getTransform(this,s.variation),o=c.path.commands),s.hinting&&r&&r.hinting&&(a=c.path&&r.hinting.exec(c,n,s)),a?(o=r.hinting.getCommands(a),e=Math.round(e),t=Math.round(t),i=l=1):(o=c.path.commands,void 0===i&&(i=u),void 0===l&&(l=u));const p=new Xe;if(s.drawSVG){const n=this.getSvgImage(r);if(n){const s=new Xe;return s._image={image:n.image,x:e+n.leftSideBearing*u,y:t-n.baseline*u,width:n.image.width*u,height:n.image.height*u},p._layers=[s],p}}if(s.drawLayers){const o=this.getLayers(r);if(o&&o.length){p._layers=[];for(let a=0;a<o.length;a+=1){const i=o[a];let l=kn(r,i.paletteIndex,s.usePalette);l="currentColor"===l?s.fill||"black":Un(l,s.colorFormat||"rgba"),s=Object.assign({},s,{fill:l}),p._layers.push(this.getPath.call(i.glyph,e,t,n,s,r))}return p}}p.fill=s.fill||this.path.fill,p.stroke=this.path.stroke,p.strokeWidth=this.path.strokeWidth*u;for(let n=0;n<o.length;n+=1){const s=o[n];"M"===s.type?p.moveTo(e+s.x*i,t+-s.y*l):"L"===s.type?p.lineTo(e+s.x*i,t+-s.y*l):"Q"===s.type?p.quadraticCurveTo(e+s.x1*i,t+-s.y1*l,e+s.x*i,t+-s.y*l):"C"===s.type?p.curveTo(e+s.x1*i,t+-s.y1*l,e+s.x2*i,t+-s.y2*l,e+s.x*i,t+-s.y*l):"Z"===s.type&&p.stroke&&p.strokeWidth&&p.closePath()}return p},Cn.prototype.getLayers=function(e){if(!e)throw Error("The font object is required to read the colr/cpal tables in order to get the layers.");return e.layers.get(this.index)},Cn.prototype.getSvgImage=function(e){if(!e)throw Error("The font object is required to read the svg table in order to get the image.");return e.svgImages.get(this.index)},Cn.prototype.getContours=function(e=null){if(void 0===this.points&&!e)return[];const t=[];let n=[],s=e||this.points;for(let e=0;e<s.length;e+=1){const r=s[e];n.push(r),r.lastPointOfContour&&(t.push(n),n=[])}return Qe.argument(0===n.length,"There are still points left in the current contour."),t},Cn.prototype.getMetrics=function(){const e=this.path.commands,t=[],n=[];for(let s=0;s<e.length;s+=1){const r=e[s];"Z"!==r.type&&(t.push(r.x),n.push(r.y)),"Q"!==r.type&&"C"!==r.type||(t.push(r.x1),n.push(r.y1)),"C"===r.type&&(t.push(r.x2),n.push(r.y2))}const s={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,n),leftSideBearing:this.leftSideBearing};return isFinite(s.xMin)||(s.xMin=0),isFinite(s.xMax)||(s.xMax=this.advanceWidth),isFinite(s.yMin)||(s.yMin=0),isFinite(s.yMax)||(s.yMax=0),s.rightSideBearing=this.advanceWidth-s.leftSideBearing-(s.xMax-s.xMin),s},Cn.prototype.draw=function(e,t,n,s,r,o){r=Object.assign({},o.defaultRenderOptions,r);this.getPath(t,n,s,r,o).draw(e)},Cn.prototype.drawPoints=function(e,t,n,s,r,o){if((r=Object.assign({},o&&o.defaultRenderOptions,r)).drawLayers){const r=this.getLayers(o);if(r&&r.length){for(let o=0;o<r.length;o+=1)r[o].glyph.index!==this.index&&this.drawPoints.call(r[o].glyph,e,t,n,s);return}}function a(t,n,s,r){e.beginPath();for(let o=0;o<t.length;o+=1)e.moveTo(n+t[o].x*r,s+t[o].y*r),e.arc(n+t[o].x*r,s+t[o].y*r,2,0,2*Math.PI,!1);e.fill()}t=void 0!==t?t:0,n=void 0!==n?n:0,s=void 0!==s?s:24;const i=1/this.path.unitsPerEm*s,l=[],u=[];let c=this.path.commands;o&&o.variation&&(c=o.variation.getTransform(this,r.variation).path.commands);for(let e=0;e<c.length;e+=1){const t=c[e];void 0!==t.x&&l.push({x:t.x,y:-t.y}),void 0!==t.x1&&u.push({x:t.x1,y:-t.y1}),void 0!==t.x2&&u.push({x:t.x2,y:-t.y2})}e.fillStyle="blue",a(l,t,n,i),e.fillStyle="red",a(u,t,n,i)},Cn.prototype.drawMetrics=function(e,t,n,s){let r;t=void 0!==t?t:0,n=void 0!==n?n:0,s=void 0!==s?s:24,r=1/this.path.unitsPerEm*s,e.lineWidth=1,e.strokeStyle="black",Tn.line(e,t,-1e4,t,1e4),Tn.line(e,-1e4,n,1e4,n);const o=this.xMin||0;let a=this.yMin||0;const i=this.xMax||0;let l=this.yMax||0;const u=this.advanceWidth||0;e.strokeStyle="blue",Tn.line(e,t+o*r,-1e4,t+o*r,1e4),Tn.line(e,t+i*r,-1e4,t+i*r,1e4),Tn.line(e,-1e4,n+-a*r,1e4,n+-a*r),Tn.line(e,-1e4,n+-l*r,1e4,n+-l*r),e.strokeStyle="green",Tn.line(e,t+u*r,-1e4,t+u*r,1e4)},Cn.prototype.toPathData=function(e,t){e=Object.assign({},{variation:t&&t.defaultRenderOptions.variation},e);let n=this;t&&t.variation&&(n=t.variation.getTransform(this,e.variation));let s=n.points&&e.pointsTransform?e.pointsTransform(n.points):n.path;return e.pathTramsform&&(s=e.pathTramsform(s)),s.toPathData(e)},Cn.prototype.fromSVG=function(e,t={}){return this.path.fromSVG(e,t)},Cn.prototype.toSVG=function(e,t){const n=this.toPathData.apply(this,[e,t]);return this.path.toSVG(e,n)},Cn.prototype.toDOMElement=function(e,t){e=Object.assign({},{variation:t&&t.defaultRenderOptions.variation},e);let n=this.path;return t&&t.variation&&(n=t.variation.getTransform(this,e.variation).path),n.toDOMElement(e)};var En=Cn;function Dn(e,t,n){Object.defineProperty(e,t,{get:function(){return void 0===e[n]&&e.path,e[n]},set:function(t){e[n]=t},enumerable:!0,configurable:!0})}function Mn(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(let n=0;n<t.length;n++){const s=t[n];s.path.unitsPerEm=e.unitsPerEm,this.glyphs[n]=s}this.length=t&&t.length||0}"undefined"!=typeof Symbol&&Symbol.iterator&&(Mn.prototype[Symbol.iterator]=function(){let e=-1;return{next:function(){e++;const t=e>=this.length-1;return{value:this.get(e),done:t}}.bind(this)}}),Mn.prototype.get=function(e){if(this.font._push&&void 0===this.glyphs[e]){this.font._push(e),"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]());let t=this.glyphs[e],n=this.font._IndexToUnicodeMap[e];if(n)for(let e=0;e<n.unicodes.length;e++)t.addUnicode(n.unicodes[e]);this.font.cffEncoding?t.name=this.font.cffEncoding.charset[e]:this.font.glyphNames.names&&(t.name=this.font.glyphNames.glyphIndexToName(e)),this.glyphs[e].advanceWidth=this.font._hmtxTableData[e].advanceWidth,this.glyphs[e].leftSideBearing=this.font._hmtxTableData[e].leftSideBearing}else"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]());return this.glyphs[e]},Mn.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};var Fn={GlyphSet:Mn,glyphLoader:function(e,t){return new En({index:t,font:e})},ttfGlyphLoader:function(e,t,n,s,r,o){return function(){const a=new En({index:t,font:e});return a.path=function(){n(a,s,r);const t=o(e.glyphs,a);return t.unitsPerEm=e.unitsPerEm,t},Dn(a,"numberOfContours","_numberOfContours"),Dn(a,"xMin","_xMin"),Dn(a,"xMax","_xMax"),Dn(a,"yMin","_yMin"),Dn(a,"yMax","_yMax"),Dn(a,"points","_points"),a}},cffGlyphLoader:function(e,t,n,s,r){return function(){const o=new En({index:t,font:e});return o.path=function(){const t=n(e,o,s,r);return t.unitsPerEm=e.unitsPerEm,t},o}}};function An(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!An(e[n],t[n]))return!1;return!0}return!1}function Nn(e){let t;return t=e.length<1240?107:e.length<33900?1131:32768,t}function Pn(e,t,n,s){const r=[],o=[],a=s>1?qt.getULong(e,t):qt.getCard16(e,t),i=s>1?4:2;let l,u;if(0!==a){const n=qt.getByte(e,t+i);l=t+(a+1)*n+i;let s=t+i+1;for(let t=0;t<a+1;t+=1)r.push(qt.getOffset(e,s,n)),s+=n;u=l+r[a]}else u=t+i;for(let a=0;a<r.length-1;a+=1){let i=qt.getBytes(e,l+r[a],l+r[a+1]);n&&(i=n(i,e,t,s)),o.push(i)}return{objects:o,startOffset:t,endOffset:u}}function Bn(e,t){let n,s,r,o;if(28===t)return n=e.parseByte(),s=e.parseByte(),n<<8|s;if(29===t)return n=e.parseByte(),s=e.parseByte(),r=e.parseByte(),o=e.parseByte(),n<<24|s<<16|r<<8|o;if(30===t)return function(e){let t="";const n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const s=e.parseByte(),r=s>>4,o=15&s;if(15===r)break;if(t+=n[r],15===o)break;t+=n[o]}return parseFloat(t)}(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return n=e.parseByte(),256*(t-247)+n+108;if(t>=251&&t<=254)return n=e.parseByte(),256*-(t-251)-n-108;throw new Error("Invalid b0 "+t)}function Gn(e,t,n,s){t=void 0!==t?t:0;const r=new qt.Parser(e,t),o=[];let a=[];n=void 0!==n?n:e.byteLength;let i=s<2?22:28;for(;r.relativeOffset<n;){let e=r.parseByte();if(e<i){if(12===e&&(e=1200+r.parseByte()),s>1&&23===e){Qn(a);continue}o.push([e,a]),a=[]}else a.push(Bn(r,e))}return function(e){const t={};for(let n=0;n<e.length;n+=1){const s=e[n][0],r=e[n][1];let o;if(o=1===r.length?r[0]:r,Object.prototype.hasOwnProperty.call(t,s)&&!isNaN(t[s]))throw new Error("Object "+t+" already has key "+s);t[s]=o}return t}(o)}function _n(e,t){return t=t<=390?cn[t]:e?e[t-391]:void 0}function Hn(e,t,n){const s={};let r;for(let o=0;o<t.length;o+=1){const a=t[o];if(Array.isArray(a.type)){const t=[];t.length=a.type.length;for(let s=0;s<a.type.length;s++)r=void 0!==e[a.op]?e[a.op][s]:void 0,void 0===r&&(r=void 0!==a.value&&void 0!==a.value[s]?a.value[s]:null),"SID"===a.type[s]&&(r=_n(n,r)),t[s]=r;s[a.name]=t}else r=e[a.op],void 0===r&&(r=void 0!==a.value?a.value:null),"SID"===a.type&&(r=_n(n,r)),s[a.name]=r}return s}var Vn=[{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"}],zn=[{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"charStrings",op:17,type:"offset"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"vstore",op:24,type:"offset"}],qn=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}],jn=[{name:"blueValues",op:6,type:"delta"},{name:"otherBlues",op:7,type:"delta"},{name:"familyBlues",op:7,type:"delta"},{name:"familyBlues",op:8,type:"delta"},{name:"familyOtherBlues",op:9,type:"delta"},{name:"blueScale",op:1209,type:"number",value:.039625},{name:"blueShift",op:1210,type:"number",value:7},{name:"blueFuzz",op:1211,type:"number",value:1},{name:"stdHW",op:10,type:"number"},{name:"stdVW",op:11,type:"number"},{name:"stemSnapH",op:1212,type:"number"},{name:"stemSnapV",op:1213,type:"number"},{name:"languageGroup",op:1217,type:"number",value:0},{name:"expansionFactor",op:1218,type:"number",value:.06},{name:"vsindex",op:22,type:"number",value:0},{name:"subrs",op:19,type:"offset"}],Wn=[{name:"private",op:18,type:["number","offset"],value:[0,0]}];function $n(e,t,n,s){return Hn(Gn(e,t,e.byteLength,s),s>1?zn:Vn,n)}function Xn(e,t,n,s,r){return Hn(Gn(e,t,n,r),r>1?jn:qn,s)}function Yn(e,t,n){return Hn(Gn(e,t,void 0,n),Wn)}function Zn(e,t,n,s,r){const o=[];for(let a=0;a<n.length;a+=1){const i=$n(new DataView(new Uint8Array(n[a]).buffer),0,s,r);i._subrs=[],i._subrsBias=0,i._defaultWidthX=0,i._nominalWidthX=0;const l=r<2?i.private[0]:0,u=r<2?i.private[1]:0;if(0!==l&&0!==u){const n=Xn(e,u+t,l,s,r);if(i._defaultWidthX=n.defaultWidthX,i._nominalWidthX=n.nominalWidthX,0!==n.subrs){const s=Pn(e,u+n.subrs+t,void 0,r);i._subrs=s.objects,i._subrsBias=Nn(i._subrs)}i._privateDict=n}o.push(i)}return o}function Qn(e){let t=e.pop();for(;e.length>t;)e.pop()}function Kn(e,t){const n=e.tables.cff&&e.tables.cff.topDict&&e.tables.cff.topDict.paintType||0;return 2===n&&(t.fill=null,t.stroke="black",t.strokeWidth=e.tables.cff.topDict.strokeWidth||0),n}function Jn(e,t,n,s,r){let o,a,i,l;const u=new Xe,c=[];let p,h,f,d,g,m=0,y=!1,v=!1,b=0,S=0,x=0,T=[];const O=e.tables.cff2||e.tables.cff;if(f=O.topDict._defaultWidthX,d=O.topDict._nominalWidthX,r=r||e.variation&&e.variation.get(),t.getBlendPath||(t.getBlendPath=function(r){return Jn(e,t,n,s,r)}),e.isCIDFont||s>1){const e=O.topDict._fdSelect?O.topDict._fdSelect[t.index]:0,n=O.topDict._fdArray[e];p=n._subrs,h=n._subrsBias,s>1?(T=O.topDict._vstore.itemVariationStore,x=n._privateDict.vsindex):(f=n._defaultWidthX,d=n._nominalWidthX)}else p=O.topDict._subrs,h=O.topDict._subrsBias;const k=Kn(e,u);let w=f;function I(e,t){v&&2!==k&&u.closePath(),u.moveTo(e,t),v=!0}function R(){let e;e=!!(1&c.length),e&&!y&&(w=c.shift()+d),m+=c.length>>1,c.length=0,y=!0}return function n(f){let O,U,L,C,E,D,M,F,A,N,P,B,G=0;for(;G<f.length;){let W=f[G];switch(G+=1,W){case 1:case 3:case 18:case 23:R();break;case 4:c.length>1&&!y&&(w=c.shift()+d,y=!0),S+=c.pop(),I(b,S);break;case 5:for(;c.length>0;)b+=c.shift(),S+=c.shift(),u.lineTo(b,S);break;case 6:for(;c.length>0&&(b+=c.shift(),u.lineTo(b,S),0!==c.length);)S+=c.shift(),u.lineTo(b,S);break;case 7:for(;c.length>0&&(S+=c.shift(),u.lineTo(b,S),0!==c.length);)b+=c.shift(),u.lineTo(b,S);break;case 8:for(;c.length>0;)o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l+c.shift(),u.curveTo(o,a,i,l,b,S);break;case 10:E=c.pop()+h,D=p[E],D&&n(D);break;case 11:if(s>1){console.error("CFF CharString operator return (11) is not supported in CFF2");break}return;case 12:switch(W=f[G],G+=1,W){case 35:o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),M=i+c.shift(),F=l+c.shift(),A=M+c.shift(),N=F+c.shift(),P=A+c.shift(),B=N+c.shift(),b=P+c.shift(),S=B+c.shift(),c.shift(),u.curveTo(o,a,i,l,M,F),u.curveTo(A,N,P,B,b,S);break;case 34:o=b+c.shift(),a=S,i=o+c.shift(),l=a+c.shift(),M=i+c.shift(),F=l,A=M+c.shift(),N=l,P=A+c.shift(),B=S,b=P+c.shift(),u.curveTo(o,a,i,l,M,F),u.curveTo(A,N,P,B,b,S);break;case 36:o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),M=i+c.shift(),F=l,A=M+c.shift(),N=l,P=A+c.shift(),B=N+c.shift(),b=P+c.shift(),u.curveTo(o,a,i,l,M,F),u.curveTo(A,N,P,B,b,S);break;case 37:o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),M=i+c.shift(),F=l+c.shift(),A=M+c.shift(),N=F+c.shift(),P=A+c.shift(),B=N+c.shift(),Math.abs(P-b)>Math.abs(B-S)?b=P+c.shift():S=B+c.shift(),u.curveTo(o,a,i,l,M,F),u.curveTo(A,N,P,B,b,S);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+W),c.length=0}break;case 14:if(s>1){console.error("CFF CharString operator endchar (14) is not supported in CFF2");break}if(c.length>=4){const n=dn[c.pop()],s=dn[c.pop()],r=c.pop(),o=c.pop();if(n&&s){t.isComposite=!0,t.components=[];const a=e.cffEncoding.charset.indexOf(n),i=e.cffEncoding.charset.indexOf(s);t.components.push({glyphIndex:i,dx:0,dy:0}),t.components.push({glyphIndex:a,dx:o,dy:r}),u.extend(e.glyphs.get(i).path);const l=e.glyphs.get(a),c=JSON.parse(JSON.stringify(l.path.commands));for(let e=0;e<c.length;e+=1){const t=c[e];"Z"!==t.type&&(t.x+=o,t.y+=r),"Q"!==t.type&&"C"!==t.type||(t.x1+=o,t.y1+=r),"C"===t.type&&(t.x2+=o,t.y2+=r)}u.extend(c)}}else c.length>0&&!y&&(w=c.shift()+d,y=!0);v&&2!==k&&(u.closePath(),v=!1);break;case 15:if(s<2){console.error("CFF2 CharString operator vsindex (15) is not supported in CFF");break}x=c.pop();break;case 16:if(s<2){console.error("CFF2 CharString operator blend (16) is not supported in CFF");break}g||(g=e.variation&&r&&e.variation.process.getBlendVector(T,x,r));var _=c.pop(),H=g?g.length:T.itemVariationSubtables[x].regionIndexes.length,V=_*H,z=c.length-V,q=z-_;if(g)for(let e=0;e<_;e++){var j=c[q+e];for(let e=0;e<H;e++)j+=g[e]*c[z++];c[q+e]=j}for(;V--;)c.pop();break;case 19:case 20:R(),G+=m+7>>3;break;case 21:c.length>2&&!y&&(w=c.shift()+d,y=!0),S+=c.pop(),b+=c.pop(),I(b,S);break;case 22:c.length>1&&!y&&(w=c.shift()+d,y=!0),b+=c.pop(),I(b,S);break;case 24:for(;c.length>2;)o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l+c.shift(),u.curveTo(o,a,i,l,b,S);b+=c.shift(),S+=c.shift(),u.lineTo(b,S);break;case 25:for(;c.length>6;)b+=c.shift(),S+=c.shift(),u.lineTo(b,S);o=b+c.shift(),a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l+c.shift(),u.curveTo(o,a,i,l,b,S);break;case 26:for(1&c.length&&(b+=c.shift());c.length>0;)o=b,a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i,S=l+c.shift(),u.curveTo(o,a,i,l,b,S);break;case 27:for(1&c.length&&(S+=c.shift());c.length>0;)o=b+c.shift(),a=S,i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l,u.curveTo(o,a,i,l,b,S);break;case 28:O=f[G],U=f[G+1],c.push((O<<24|U<<16)>>16),G+=2;break;case 29:E=c.pop()+e.gsubrsBias,D=e.gsubrs[E],D&&n(D);break;case 30:for(;c.length>0&&(o=b,a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l+(1===c.length?c.shift():0),u.curveTo(o,a,i,l,b,S),0!==c.length);)o=b+c.shift(),a=S,i=o+c.shift(),l=a+c.shift(),S=l+c.shift(),b=i+(1===c.length?c.shift():0),u.curveTo(o,a,i,l,b,S);break;case 31:for(;c.length>0&&(o=b+c.shift(),a=S,i=o+c.shift(),l=a+c.shift(),S=l+c.shift(),b=i+(1===c.length?c.shift():0),u.curveTo(o,a,i,l,b,S),0!==c.length);)o=b,a=S+c.shift(),i=o+c.shift(),l=a+c.shift(),b=i+c.shift(),S=l+(1===c.length?c.shift():0),u.curveTo(o,a,i,l,b,S);break;default:W<32?console.log("Glyph "+t.index+": unknown operator "+W):W<247?c.push(W-139):W<251?(O=f[G],G+=1,c.push(256*(W-247)+O+108)):W<255?(O=f[G],G+=1,c.push(256*-(W-251)-O-108)):(O=f[G],U=f[G+1],L=f[G+2],C=f[G+3],G+=4,c.push((O<<24|U<<16|L<<8|C)/65536))}}}(n),e.variation&&r&&(u.commands=u.commands.map((e=>{const t=Object.keys(e);for(let n=0;n<t.length;n++){const s=t[n];"type"!==s&&(e[s]=Math.round(e[s]))}return e}))),y&&(t.advanceWidth=w),u}function es(e,t,n,s,r){const o=[];let a;const i=new qt.Parser(e,t),l=i.parseCard8();if(0===l)for(let e=0;e<n;e++){if(a=i.parseCard8(),a>=s)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+s+")");o.push(a)}else{if(!(3===l||r>1&&4===l))throw new Error("CFF Table CID Font FDSelect table has unsupported format "+l);{const e=4===l?i.parseULong():i.parseCard16();let t,u=4===l?i.parseULong():i.parseCard16();if(0!==u)throw new Error(`CFF Table CID Font FDSelect format ${l} range has bad initial GID ${u}`);for(let c=0;c<e;c++){if(a=4===l?i.parseUShort():i.parseCard8(),t=4===l?i.parseULong():i.parseCard16(),a>=s)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+s+")");if(t>n)throw new Error(`CFF Table CID Font FDSelect format ${r} range has bad GID ${t}`);for(;u<t;u++)o.push(a);u=t}if(t!==n)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final (Sentinal) GID "+t)}}return o}function ts(e,t){let n,s=cn.indexOf(e);return s>=0&&(n=s),s=t.indexOf(e),s>=0?n=s+cn.length:(n=cn.length+t.length,t.push(e)),n}function ns(e,t,n){const s={};for(let r=0;r<e.length;r+=1){const o=e[r];let a=t[o.name];void 0===a||An(a,o.value)||("SID"===o.type&&(a=ts(a,n)),s[o.op]={name:o.name,type:o.type,value:a})}return s}function ss(e,t,n){const s=new St.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return s.dict=ns(n>1?zn:Vn,e,t),s}function rs(e){const t=new St.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}function os(e,t){const n=[],s=e.path;t<2&&n.push({name:"width",type:"NUMBER",value:e.advanceWidth});let r=0,o=0;for(let e=0;e<s.commands.length;e+=1){let t,a,i=s.commands[e];if("Q"===i.type){const e=1/3,t=2/3;i={type:"C",x:i.x,y:i.y,x1:Math.round(e*r+t*i.x1),y1:Math.round(e*o+t*i.y1),x2:Math.round(e*i.x+t*i.x1),y2:Math.round(e*i.y+t*i.y1)}}if("M"===i.type)t=Math.round(i.x-r),a=Math.round(i.y-o),n.push({name:"dx",type:"NUMBER",value:t}),n.push({name:"dy",type:"NUMBER",value:a}),n.push({name:"rmoveto",type:"OP",value:21}),r=Math.round(i.x),o=Math.round(i.y);else if("L"===i.type)t=Math.round(i.x-r),a=Math.round(i.y-o),n.push({name:"dx",type:"NUMBER",value:t}),n.push({name:"dy",type:"NUMBER",value:a}),n.push({name:"rlineto",type:"OP",value:5}),r=Math.round(i.x),o=Math.round(i.y);else if("C"===i.type){const e=Math.round(i.x1-r),s=Math.round(i.y1-o),l=Math.round(i.x2-i.x1),u=Math.round(i.y2-i.y1);t=Math.round(i.x-i.x2),a=Math.round(i.y-i.y2),n.push({name:"dx1",type:"NUMBER",value:e}),n.push({name:"dy1",type:"NUMBER",value:s}),n.push({name:"dx2",type:"NUMBER",value:l}),n.push({name:"dy2",type:"NUMBER",value:u}),n.push({name:"dx",type:"NUMBER",value:t}),n.push({name:"dy",type:"NUMBER",value:a}),n.push({name:"rrcurveto",type:"OP",value:8}),r=Math.round(i.x),o=Math.round(i.y)}}return t<2&&n.push({name:"endchar",type:"OP",value:14}),n}var as={parse:function(e,t,n,s){let r;const o=function(e,t){const n={};if(n.formatMajor=qt.getCard8(e,t),n.formatMinor=qt.getCard8(e,t+1),n.formatMajor>2)throw new Error(`Unsupported CFF table version ${n.formatMajor}.${n.formatMinor}`);return n.size=qt.getCard8(e,t+2),n.formatMajor<2?(n.offsetSize=qt.getCard8(e,t+3),n.startOffset=t,n.endOffset=t+4):(n.topDictLength=qt.getCard16(e,t+3),n.endOffset=t+8),n}(e,t);r=2===o.formatMajor?n.tables.cff2={}:n.tables.cff={};const a=o.formatMajor>1?null:Pn(e,o.endOffset,qt.bytesToString),i=o.formatMajor>1?null:Pn(e,a.endOffset),l=o.formatMajor>1?null:Pn(e,i.endOffset,qt.bytesToString),u=Pn(e,o.formatMajor>1?t+o.size+o.topDictLength:l.endOffset,void 0,o.formatMajor);let c,p;if(n.gsubrs=u.objects,n.gsubrsBias=Nn(n.gsubrs),o.formatMajor>1){const n=t+o.size,s=qt.getBytes(e,n,n+o.topDictLength);c=Zn(e,0,[s],void 0,o.formatMajor)[0]}else{const n=Zn(e,t,i.objects,l.objects,o.formatMajor);if(1!==n.length)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+n.length);c=n[0]}if(r.topDict=c,c._privateDict&&(n.defaultWidthX=c._privateDict.defaultWidthX,n.nominalWidthX=c._privateDict.nominalWidthX),o.formatMajor<2&&void 0!==c.ros[0]&&void 0!==c.ros[1]&&(n.isCIDFont=!0),o.formatMajor>1){let s=c.fdArray,r=c.fdSelect;if(!s)throw new Error("This is a CFF2 font, but FDArray information is missing");const a=Pn(e,t+s,null,o.formatMajor),i=function(e,t,n){const s=[];for(let r=0;r<n.length;r++){const o=Yn(new DataView(new Uint8Array(n[r]).buffer),0,2),a=o.private[0],i=o.private[1];if(0!==a&&0!==i){const n=Xn(e,i+t,a,[],2);if(n.subrs){const s=Pn(e,i+n.subrs+t,void 0,2);o._subrs=s.objects,o._subrsBias=Nn(o._subrs)}o._privateDict=n}s.push(o)}return s}(e,t,a.objects);c._fdArray=i,r&&(c._fdSelect=es(e,t+r,n.numGlyphs,i.length,o.formatMajor))}else if(n.isCIDFont){let s=c.fdArray,r=c.fdSelect;if(0===s||0===r)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");s+=t;const a=Pn(e,s),i=Zn(e,t,a.objects,l.objects,o.formatMajor);c._fdArray=i,r+=t,c._fdSelect=es(e,r,n.numGlyphs,i.length,o.formatMajor)}if(o.formatMajor<2){const s=t+c.private[1],r=Xn(e,s,c.private[0],l.objects,o.formatMajor);if(n.defaultWidthX=r.defaultWidthX,n.nominalWidthX=r.nominalWidthX,0!==r.subrs){const t=s+r.subrs,o=Pn(e,t);n.subrs=o.objects,n.subrsBias=Nn(n.subrs)}else n.subrs=[],n.subrsBias=0}if(s.lowMemory?(p=function(e,t,n){const s=[],r=n>1?qt.getULong(e,t):qt.getCard16(e,t),o=n>1?4:2;let a,i;if(0!==r){const n=qt.getByte(e,t+o);a=t+(r+1)*n+o;let l=t+o+1;for(let t=0;t<r+1;t+=1)s.push(qt.getOffset(e,l,n)),l+=n;i=a+s[r]}else i=t+o;return{offsets:s,startOffset:t,endOffset:i}}(e,t+c.charStrings,o.formatMajor),n.nGlyphs=p.offsets.length-(o.formatMajor>1?1:0)):(p=Pn(e,t+c.charStrings,null,o.formatMajor),n.nGlyphs=p.objects.length),o.formatMajor>1&&n.tables.maxp&&n.nGlyphs!==n.tables.maxp.numGlyphs&&console.error(`Glyph count in the CFF2 table (${n.nGlyphs}) must correspond to the glyph count in the maxp table (${n.tables.maxp.numGlyphs})`),o.formatMajor<2){let s=[],r=[];s=0===c.charset?pn:1===c.charset?hn:2===c.charset?fn:function(e,t,n,s,r){let o,a;const i=new qt.Parser(e,t);n-=1;const l=[".notdef"],u=i.parseCard8();if(0===u)for(let e=0;e<n;e+=1)o=i.parseSID(),r?l.push(o):l.push(_n(s,o)||o);else if(1===u)for(;l.length<=n;){o=i.parseSID(),a=i.parseCard8();for(let e=0;e<=a;e+=1)r?l.push("cid"+("00000"+o).slice(-5)):l.push(_n(s,o)||o),o+=1}else{if(2!==u)throw new Error("Unknown charset format "+u);for(;l.length<=n;){o=i.parseSID(),a=i.parseCard16();for(let e=0;e<=a;e+=1)r?l.push("cid"+("00000"+o).slice(-5)):l.push(_n(s,o)||o),o+=1}}return l}(e,t+c.charset,n.nGlyphs,l.objects,n.isCIDFont),r=0===c.encoding?dn:1===c.encoding?gn:function(e,t){let n;const s={},r=new qt.Parser(e,t),o=r.parseCard8();if(0===o){const e=r.parseCard8();for(let t=0;t<e;t+=1)n=r.parseCard8(),s[n]=t}else{if(1!==o)throw new Error("Unknown encoding format "+o);{const e=r.parseCard8();n=1;for(let t=0;t<e;t+=1){const e=r.parseCard8(),t=r.parseCard8();for(let r=e;r<=e+t;r+=1)s[r]=n,n+=1}}}return s}(e,t+c.encoding),n.cffEncoding=new bn(r,s),n.encoding=n.encoding||n.cffEncoding}if(n.glyphs=new Fn.GlyphSet(n),s.lowMemory)n._push=function(s){const r=function(e,t,n,s,r,o){const a=o>1?qt.getULong(n,s):qt.getCard16(n,s),i=o>1?4:2;let l=0;0!==a&&(l=s+(a+1)*qt.getByte(n,s+i)+i);let u=qt.getBytes(n,l+t[e],l+t[e+1]);return r&&(u=r(u)),u}(s,p.offsets,e,t+c.charStrings,void 0,o.formatMajor);n.glyphs.push(s,Fn.cffGlyphLoader(n,s,Jn,r,o.formatMajor))};else for(let e=0;e<n.nGlyphs;e+=1){const t=p.objects[e];n.glyphs.push(e,Fn.cffGlyphLoader(n,e,Jn,t,o.formatMajor))}if(c.vstore){const n=new qt.Parser(e,t+c.vstore);c._vstore=n.parseVariationStore()}},make:function(e,t){const n=new St.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"}]),s=1/t.unitsPerEm,r={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[s,0,0,s,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},o=t&&t.topDict||{};o.paintType&&(r.paintType=o.paintType,r.strokeWidth=o.strokeWidth||0);const a=[];let i;for(let t=1;t<e.length;t+=1)i=e.get(t),a.push(i.name);const l=[];n.header=new St.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}]),n.nameIndex=function(e){const t=new St.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);t.names=[];for(let n=0;n<e.length;n+=1)t.names.push({name:"name_"+n,type:"NAME",value:e[n]});return t}([t.postScriptName]);let u=ss(r,l);n.topDictIndex=rs(u),n.globalSubrIndex=new St.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}]),n.charsets=function(e,t){const n=new St.Record("Charsets",[{name:"format",type:"Card8",value:0}]);for(let s=0;s<e.length;s+=1){const r=ts(e[s],t);n.fields.push({name:"glyph_"+s,type:"SID",value:r})}return n}(a,l),n.charStringsIndex=function(e,t){const n=new St.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]);for(let s=0;s<e.length;s+=1){const r=e.get(s),o=os(r,t);n.charStrings.push({name:r.name,type:"CHARSTRING",value:o})}return n}(e,1),n.privateDict=function(e,t,n){const s=new St.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return s.dict=ns(n>1?jn:qn,e,t),s}({},l),n.stringIndex=function(e){const t=new St.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);t.strings=[];for(let n=0;n<e.length;n+=1)t.strings.push({name:"string_"+n,type:"STRING",value:e[n]});return t}(l);const c=n.header.sizeOf()+n.nameIndex.sizeOf()+n.topDictIndex.sizeOf()+n.stringIndex.sizeOf()+n.globalSubrIndex.sizeOf();return r.charset=c,r.encoding=0,r.charStrings=r.charset+n.charsets.sizeOf(),r.private[1]=r.charStrings+n.charStringsIndex.sizeOf(),u=ss(r,l),n.topDictIndex=rs(u),n}};var is={parse:function(e,t){const n={},s=new qt.Parser(e,t);return n.version=s.parseVersion(),n.fontRevision=Math.round(1e3*s.parseFixed())/1e3,n.checkSumAdjustment=s.parseULong(),n.magicNumber=s.parseULong(),Qe.argument(1594834165===n.magicNumber,"Font header has wrong magic number."),n.flags=s.parseUShort(),n.unitsPerEm=s.parseUShort(),n.created=s.parseLongDateTime(),n.modified=s.parseLongDateTime(),n.xMin=s.parseShort(),n.yMin=s.parseShort(),n.xMax=s.parseShort(),n.yMax=s.parseShort(),n.macStyle=s.parseUShort(),n.lowestRecPPEM=s.parseUShort(),n.fontDirectionHint=s.parseShort(),n.indexToLocFormat=s.parseShort(),n.glyphDataFormat=s.parseShort(),n},make:function(e){const t=Math.round((new Date).getTime()/1e3)+2082844800;let n=t,s=e.macStyle||0;return e.createdTimestamp&&(n=e.createdTimestamp+2082844800),new St.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:n},{name:"modified",type:"LONGDATETIME",value:t},{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:s},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],e)}};var ls={parse:function(e,t){const n={},s=new qt.Parser(e,t);return n.version=s.parseVersion(),n.ascender=s.parseShort(),n.descender=s.parseShort(),n.lineGap=s.parseShort(),n.advanceWidthMax=s.parseUShort(),n.minLeftSideBearing=s.parseShort(),n.minRightSideBearing=s.parseShort(),n.xMaxExtent=s.parseShort(),n.caretSlopeRise=s.parseShort(),n.caretSlopeRun=s.parseShort(),n.caretOffset=s.parseShort(),s.relativeOffset+=8,n.metricDataFormat=s.parseShort(),n.numberOfHMetrics=s.parseUShort(),n},make:function(e){return new St.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}],e)}};var us={parse:function(e,t,n,s,r,o,a){a.lowMemory?function(e,t,n,s,r){let o,a;e._hmtxTableData={};const i=new qt.Parser(t,n);for(let t=0;t<r;t+=1)t<s&&(o=i.parseUShort(),a=i.parseShort()),e._hmtxTableData[t]={advanceWidth:o,leftSideBearing:a}}(e,t,n,s,r):function(e,t,n,s,r){let o,a;const i=new qt.Parser(e,t);for(let e=0;e<s;e+=1){e<n&&(o=i.parseUShort(),a=i.parseShort());const t=r.get(e);t.advanceWidth=o,t.leftSideBearing=a}}(t,n,s,r,o)},make:function(e){const t=new St.Table("hmtx",[]);for(let n=0;n<e.length;n+=1){const s=e.get(n),r=s.advanceWidth||0,o=s.leftSideBearing||0;t.fields.push({name:"advanceWidth_"+n,type:"USHORT",value:r}),t.fields.push({name:"leftSideBearing_"+n,type:"SHORT",value:o})}return t}};var cs={make:function(e){const t=new St.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]);let n="";const s=12+4*e.length;for(let r=0;r<e.length;++r){let o=n.indexOf(e[r]);o<0&&(o=n.length,n+=e[r]),t.fields.push({name:"offset "+r,type:"USHORT",value:s+o}),t.fields.push({name:"length "+r,type:"USHORT",value:e[r].length})}return t.fields.push({name:"stringPool",type:"CHARARRAY",value:n}),t},parse:function(e,t){const n=new qt.Parser(e,t),s=n.parseULong();Qe.argument(1===s,"Unsupported ltag table version."),n.skip("uLong",1);const r=n.parseULong(),o=[];for(let s=0;s<r;s++){let s="";const r=t+n.parseUShort(),a=n.parseUShort();for(let t=r;t<r+a;++t)s+=String.fromCharCode(e.getInt8(t));o.push(s)}return o}};var ps={parse:function(e,t){const n={},s=new qt.Parser(e,t);return n.version=s.parseVersion(),n.numGlyphs=s.parseUShort(),1===n.version&&(n.maxPoints=s.parseUShort(),n.maxContours=s.parseUShort(),n.maxCompositePoints=s.parseUShort(),n.maxCompositeContours=s.parseUShort(),n.maxZones=s.parseUShort(),n.maxTwilightPoints=s.parseUShort(),n.maxStorage=s.parseUShort(),n.maxFunctionDefs=s.parseUShort(),n.maxInstructionDefs=s.parseUShort(),n.maxStackElements=s.parseUShort(),n.maxSizeOfInstructions=s.parseUShort(),n.maxComponentElements=s.parseUShort(),n.maxComponentDepth=s.parseUShort()),n},make:function(e){return new St.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])}},hs=[{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}];var fs={parse:function(e,t){const n={},s=new qt.Parser(e,t);n.version=s.parseUShort(),n.xAvgCharWidth=s.parseShort(),n.usWeightClass=s.parseUShort(),n.usWidthClass=s.parseUShort(),n.fsType=s.parseUShort(),n.ySubscriptXSize=s.parseShort(),n.ySubscriptYSize=s.parseShort(),n.ySubscriptXOffset=s.parseShort(),n.ySubscriptYOffset=s.parseShort(),n.ySuperscriptXSize=s.parseShort(),n.ySuperscriptYSize=s.parseShort(),n.ySuperscriptXOffset=s.parseShort(),n.ySuperscriptYOffset=s.parseShort(),n.yStrikeoutSize=s.parseShort(),n.yStrikeoutPosition=s.parseShort(),n.sFamilyClass=s.parseShort(),n.panose=[];for(let e=0;e<10;e++)n.panose[e]=s.parseByte();return n.ulUnicodeRange1=s.parseULong(),n.ulUnicodeRange2=s.parseULong(),n.ulUnicodeRange3=s.parseULong(),n.ulUnicodeRange4=s.parseULong(),n.achVendID=String.fromCharCode(s.parseByte(),s.parseByte(),s.parseByte(),s.parseByte()),n.fsSelection=s.parseUShort(),n.usFirstCharIndex=s.parseUShort(),n.usLastCharIndex=s.parseUShort(),n.sTypoAscender=s.parseShort(),n.sTypoDescender=s.parseShort(),n.sTypoLineGap=s.parseShort(),n.usWinAscent=s.parseUShort(),n.usWinDescent=s.parseUShort(),n.version>=1&&(n.ulCodePageRange1=s.parseULong(),n.ulCodePageRange2=s.parseULong()),n.version>=2&&(n.sxHeight=s.parseShort(),n.sCapHeight=s.parseShort(),n.usDefaultChar=s.parseUShort(),n.usBreakChar=s.parseUShort(),n.usMaxContent=s.parseUShort()),n},make:function(e){return new St.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}],e)},unicodeRanges:hs,getUnicodeRange:function(e){for(let t=0;t<hs.length;t+=1){const n=hs[t];if(e>=n.begin&&e<n.end)return t}return-1}};var ds={parse:function(e,t){const n={},s=new qt.Parser(e,t);switch(n.version=s.parseVersion(),n.italicAngle=s.parseFixed(),n.underlinePosition=s.parseShort(),n.underlineThickness=s.parseShort(),n.isFixedPitch=s.parseULong(),n.minMemType42=s.parseULong(),n.maxMemType42=s.parseULong(),n.minMemType1=s.parseULong(),n.maxMemType1=s.parseULong(),n.version){case 1:n.names=mn.slice();break;case 2:n.numberOfGlyphs=s.parseUShort(),n.glyphNameIndex=new Array(n.numberOfGlyphs);for(let e=0;e<n.numberOfGlyphs;e++)n.glyphNameIndex[e]=s.parseUShort();n.names=[];for(let e=0;e<n.numberOfGlyphs;e++)if(n.glyphNameIndex[e]>=mn.length){const e=s.parseChar();n.names.push(s.parseString(e))}break;case 2.5:n.numberOfGlyphs=s.parseUShort(),n.offset=new Array(n.numberOfGlyphs);for(let e=0;e<n.numberOfGlyphs;e++)n.offset[e]=s.parseChar()}return n},make:function(e){const{italicAngle:t=Math.round(65536*(e.italicAngle||0)),underlinePosition:n=0,underlineThickness:s=0,isFixedPitch:r=0,minMemType42:o=0,maxMemType42:a=0,minMemType1:i=0,maxMemType1:l=0}=e.tables.post||{};return new St.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:t},{name:"underlinePosition",type:"FWORD",value:n},{name:"underlineThickness",type:"FWORD",value:s},{name:"isFixedPitch",type:"ULONG",value:r},{name:"minMemType42",type:"ULONG",value:o},{name:"maxMemType42",type:"ULONG",value:a},{name:"minMemType1",type:"ULONG",value:i},{name:"maxMemType1",type:"ULONG",value:l}])}},gs=new Array(9);gs[1]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(Vt.coverage),deltaGlyphId:this.parseShort()}:2===t?{substFormat:2,coverage:this.parsePointer(Vt.coverage),substitute:this.parseOffset16List()}:void Qe.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")},gs[2]=function(){const e=this.parseUShort();return Qe.argument(1===e,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(Vt.coverage),sequences:this.parseListOfLists()}},gs[3]=function(){const e=this.parseUShort();return Qe.argument(1===e,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(Vt.coverage),alternateSets:this.parseListOfLists()}},gs[4]=function(){const e=this.parseUShort();return Qe.argument(1===e,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(Vt.coverage),ligatureSets:this.parseListOfLists((function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}}))}};var ms={sequenceIndex:Vt.uShort,lookupListIndex:Vt.uShort};gs[5]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{substFormat:t,coverage:this.parsePointer(Vt.coverage),ruleSets:this.parseListOfLists((function(){const e=this.parseUShort(),t=this.parseUShort();return{input:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,ms)}}))};if(2===t)return{substFormat:t,coverage:this.parsePointer(Vt.coverage),classDef:this.parsePointer(Vt.classDef),classSets:this.parseListOfLists((function(){const e=this.parseUShort(),t=this.parseUShort();return{classes:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,ms)}}))};if(3===t){const e=this.parseUShort(),n=this.parseUShort();return{substFormat:t,coverages:this.parseList(e,Vt.pointer(Vt.coverage)),lookupRecords:this.parseRecordList(n,ms)}}Qe.assert(!1,"0x"+e.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},gs[6]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(Vt.coverage),chainRuleSets:this.parseListOfLists((function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(ms)}}))}:2===t?{substFormat:2,coverage:this.parsePointer(Vt.coverage),backtrackClassDef:this.parsePointer(Vt.classDef),inputClassDef:this.parsePointer(Vt.classDef),lookaheadClassDef:this.parsePointer(Vt.classDef),chainClassSet:this.parseListOfLists((function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(ms)}}))}:3===t?{substFormat:3,backtrackCoverage:this.parseList(Vt.pointer(Vt.coverage)),inputCoverage:this.parseList(Vt.pointer(Vt.coverage)),lookaheadCoverage:this.parseList(Vt.pointer(Vt.coverage)),lookupRecords:this.parseRecordList(ms)}:void Qe.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},gs[7]=function(){const e=this.parseUShort();Qe.argument(1===e,"GSUB Extension Substitution subtable identifier-format must be 1");const t=this.parseUShort(),n=new Vt(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:gs[t].call(n)}},gs[8]=function(){const e=this.parseUShort();return Qe.argument(1===e,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(Vt.coverage),backtrackCoverage:this.parseList(Vt.pointer(Vt.coverage)),lookaheadCoverage:this.parseList(Vt.pointer(Vt.coverage)),substitutes:this.parseUShortList()}};var ys=new Array(9);ys[1]=function(e){return 1===e.substFormat?new St.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new St.Coverage(e.coverage)},{name:"deltaGlyphID",type:"SHORT",value:e.deltaGlyphId}]):2===e.substFormat?new St.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new St.Coverage(e.coverage)}].concat(St.ushortList("substitute",e.substitute))):void Qe.fail("Lookup type 1 substFormat must be 1 or 2.")},ys[2]=function(e){return Qe.assert(1===e.substFormat,"Lookup type 2 substFormat must be 1."),new St.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new St.Coverage(e.coverage)}].concat(St.tableList("seqSet",e.sequences,(function(e){return new St.Table("sequenceSetTable",St.ushortList("sequence",e))}))))},ys[3]=function(e){return Qe.assert(1===e.substFormat,"Lookup type 3 substFormat must be 1."),new St.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new St.Coverage(e.coverage)}].concat(St.tableList("altSet",e.alternateSets,(function(e){return new St.Table("alternateSetTable",St.ushortList("alternate",e))}))))},ys[4]=function(e){return Qe.assert(1===e.substFormat,"Lookup type 4 substFormat must be 1."),new St.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new St.Coverage(e.coverage)}].concat(St.tableList("ligSet",e.ligatureSets,(function(e){return new St.Table("ligatureSetTable",St.tableList("ligature",e,(function(e){return new St.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:e.ligGlyph}].concat(St.ushortList("component",e.components,e.components.length+1)))})))}))))},ys[5]=function(e){if(1===e.substFormat)return new St.Table("contextualSubstitutionTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new St.Coverage(e.coverage)}].concat(St.tableList("sequenceRuleSet",e.ruleSets,(function(e){return e?new St.Table("sequenceRuleSetTable",St.tableList("sequenceRule",e,(function(e){let t=St.ushortList("seqLookup",[],e.lookupRecords.length).concat(St.ushortList("inputSequence",e.input,e.input.length+1));[t[0],t[1]]=[t[1],t[0]];for(let n=0;n<e.lookupRecords.length;n++){const s=e.lookupRecords[n];t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:s.lookupListIndex})}return new St.Table("sequenceRuleTable",t)}))):new St.Table("NULL",null)}))));if(2===e.substFormat)return new St.Table("contextualSubstitutionTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new St.Coverage(e.coverage)},{name:"classDef",type:"TABLE",value:new St.ClassDef(e.classDef)}].concat(St.tableList("classSeqRuleSet",e.classSets,(function(e){return e?new St.Table("classSeqRuleSetTable",St.tableList("classSeqRule",e,(function(e){let t=St.ushortList("classes",e.classes,e.classes.length+1).concat(St.ushortList("seqLookupCount",[],e.lookupRecords.length));for(let n=0;n<e.lookupRecords.length;n++){const s=e.lookupRecords[n];t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:s.lookupListIndex})}return new St.Table("classSeqRuleTable",t)}))):new St.Table("NULL",null)}))));if(3===e.substFormat){let t=[{name:"substFormat",type:"USHORT",value:e.substFormat}];t.push({name:"inputGlyphCount",type:"USHORT",value:e.coverages.length}),t.push({name:"substitutionCount",type:"USHORT",value:e.lookupRecords.length});for(let n=0;n<e.coverages.length;n++){const s=e.coverages[n];t.push({name:"inputCoverage"+n,type:"TABLE",value:new St.Coverage(s)})}for(let n=0;n<e.lookupRecords.length;n++){const s=e.lookupRecords[n];t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:s.lookupListIndex})}return new St.Table("contextualSubstitutionTable",t)}Qe.assert(!1,"lookup type 5 format must be 1, 2 or 3.")},ys[6]=function(e){if(1===e.substFormat){let t=new St.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new St.Coverage(e.coverage)}].concat(St.tableList("chainRuleSet",e.chainRuleSets,(function(e){return new St.Table("chainRuleSetTable",St.tableList("chainRule",e,(function(e){let t=St.ushortList("backtrackGlyph",e.backtrack,e.backtrack.length).concat(St.ushortList("inputGlyph",e.input,e.input.length+1)).concat(St.ushortList("lookaheadGlyph",e.lookahead,e.lookahead.length)).concat(St.ushortList("substitution",[],e.lookupRecords.length));for(let n=0;n<e.lookupRecords.length;n++){const s=e.lookupRecords[n];t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:s.lookupListIndex})}return new St.Table("chainRuleTable",t)})))}))));return t}if(2===e.substFormat)Qe.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(3===e.substFormat){let t=[{name:"substFormat",type:"USHORT",value:e.substFormat}];t.push({name:"backtrackGlyphCount",type:"USHORT",value:e.backtrackCoverage.length});for(let n=0;n<e.backtrackCoverage.length;n++){const s=e.backtrackCoverage[n];t.push({name:"backtrackCoverage"+n,type:"TABLE",value:new St.Coverage(s)})}t.push({name:"inputGlyphCount",type:"USHORT",value:e.inputCoverage.length});for(let n=0;n<e.inputCoverage.length;n++){const s=e.inputCoverage[n];t.push({name:"inputCoverage"+n,type:"TABLE",value:new St.Coverage(s)})}t.push({name:"lookaheadGlyphCount",type:"USHORT",value:e.lookaheadCoverage.length});for(let n=0;n<e.lookaheadCoverage.length;n++){const s=e.lookaheadCoverage[n];t.push({name:"lookaheadCoverage"+n,type:"TABLE",value:new St.Coverage(s)})}t.push({name:"substitutionCount",type:"USHORT",value:e.lookupRecords.length});for(let n=0;n<e.lookupRecords.length;n++){const s=e.lookupRecords[n];t=t.concat({name:"sequenceIndex"+n,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+n,type:"USHORT",value:s.lookupListIndex})}return new St.Table("chainContextTable",t)}Qe.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};var vs={parse:function(e,t){const n=new Vt(e,t=t||0),s=n.parseVersion(1);return Qe.argument(1===s||1.1===s,"Unsupported GSUB table version."),1===s?{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(gs)}:{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(gs),variations:n.parseFeatureVariationsList()}},make:function(e){return new St.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new St.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new St.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new St.LookupList(e.lookups,ys)}])}};var bs={parse:function(e,t){const n=new qt.Parser(e,t),s=n.parseULong();Qe.argument(1===s,"Unsupported META table version."),n.parseULong(),n.parseULong();const r=n.parseULong(),o={};for(let s=0;s<r;s++){const s=n.parseTag(),r=n.parseULong(),a=n.parseULong();if("appl"===s||"bild"===s)continue;const i=Je.UTF8(e,t+r,a);o[s]=i}return o},make:function(e){const t=Object.keys(e).length;let n="";const s=16+12*t,r=new St.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:s},{name:"numTags",type:"ULONG",value:t}]);for(let t in e){const o=n.length;n+=e[t],r.fields.push({name:"tag "+t,type:"TAG",value:t}),r.fields.push({name:"offset "+t,type:"ULONG",value:s+o}),r.fields.push({name:"length "+t,type:"ULONG",value:e[t].length})}return r.fields.push({name:"stringPool",type:"CHARARRAY",value:n}),r}};var Ss={parse:function(e,t){const n=new Vt(e,t),s=n.parseUShort();0!==s&&console.warn("Only COLRv0 is currently fully supported. A subset of color glyphs might be available in this font if provided in the v0 format.");const r=n.parseUShort(),o=n.parseOffset32(),a=n.parseOffset32(),i=n.parseUShort();n.relativeOffset=o;const l=n.parseRecordList(r,{glyphID:Vt.uShort,firstLayerIndex:Vt.uShort,numLayers:Vt.uShort});return n.relativeOffset=a,{version:s,baseGlyphRecords:l,layerRecords:n.parseRecordList(i,{glyphID:Vt.uShort,paletteIndex:Vt.uShort})}},make:function({version:e=0,baseGlyphRecords:t=[],layerRecords:n=[]}){Qe.argument(0===e,"Only COLRv0 supported.");const s=14+6*t.length;return new St.Table("COLR",[{name:"version",type:"USHORT",value:e},{name:"numBaseGlyphRecords",type:"USHORT",value:t.length},{name:"baseGlyphRecordsOffset",type:"ULONG",value:14},{name:"layerRecordsOffset",type:"ULONG",value:s},{name:"numLayerRecords",type:"USHORT",value:n.length},...t.map(((e,t)=>[{name:"glyphID_"+t,type:"USHORT",value:e.glyphID},{name:"firstLayerIndex_"+t,type:"USHORT",value:e.firstLayerIndex},{name:"numLayers_"+t,type:"USHORT",value:e.numLayers}])).flat(),...n.map(((e,t)=>[{name:"LayerGlyphID_"+t,type:"USHORT",value:e.glyphID},{name:"paletteIndex_"+t,type:"USHORT",value:e.paletteIndex}])).flat()])}};function xs(e,t,n){const s={},r=new qt.Parser(e,t);s.tag=r.parseTag(),s.minValue=r.parseFixed(),s.defaultValue=r.parseFixed(),s.maxValue=r.parseFixed(),r.skip("uShort",1);const o=r.parseUShort();return s.axisNameID=o,s.name=on(n,o),s}function Ts(e,t,n,s={}){const r=[{name:"nameID_"+e,type:"USHORT",value:t.subfamilyNameID},{name:"flags_"+e,type:"USHORT",value:0}];for(let s=0;s<n.length;++s){const o=n[s].tag;r.push({name:"axis_"+e+" "+o,type:"FIXED",value:t.coordinates[o]<<16})}return s&&s.postScriptNameID&&r.push({name:"postScriptNameID_",type:"USHORT",value:void 0!==t.postScriptNameID?t.postScriptNameID:65535}),r}function Os(e,t,n,s,r){const o={},a=new qt.Parser(e,t),i=a.parseUShort();o.subfamilyNameID=i,o.name=on(s,i,[2,17]),a.skip("uShort",1),o.coordinates={};for(let e=0;e<n.length;++e)o.coordinates[n[e].tag]=a.parseFixed();if(a.relativeOffset===r)return o.postScriptNameID=void 0,o.postScriptName=void 0,o;const l=a.parseUShort();return o.postScriptNameID=65535==l?void 0:l,o.postScriptName=void 0!==o.postScriptNameID?on(s,l,[6]):"",o}var ks={make:function(e,t){const n=new St.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:e.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:e.instances.length},{name:"instanceSize",type:"USHORT",value:4+4*e.axes.length}]);n.offsetToData=n.sizeOf();for(let t=0;t<e.axes.length;t++)n.fields=n.fields.concat((s=t,r=e.axes[t],[{name:"tag_"+s,type:"TAG",value:r.tag},{name:"minValue_"+s,type:"FIXED",value:r.minValue<<16},{name:"defaultValue_"+s,type:"FIXED",value:r.defaultValue<<16},{name:"maxValue_"+s,type:"FIXED",value:r.maxValue<<16},{name:"flags_"+s,type:"USHORT",value:0},{name:"nameID_"+s,type:"USHORT",value:r.axisNameID}]));var s,r;const o={};for(let t=0;t<e.instances.length;t++)if(void 0!==e.instances[t].postScriptNameID){n.instanceSize+=2,o.postScriptNameID=!0;break}for(let t=0;t<e.instances.length;t++)n.fields=n.fields.concat(Ts(t,e.instances[t],e.axes,o));return n},parse:function(e,t,n){const s=new qt.Parser(e,t),r=s.parseULong();Qe.argument(65536===r,"Unsupported fvar table version.");const o=s.parseOffset16();s.skip("uShort",1);const a=s.parseUShort(),i=s.parseUShort(),l=s.parseUShort(),u=s.parseUShort(),c=[];for(let s=0;s<a;s++)c.push(xs(e,t+o+s*i,n));const p=[],h=t+o+a*i;for(let t=0;t<l;t++)p.push(Os(e,h+t*u,c,n,u));return{axes:c,instances:p}}},ws={tag:Vt.tag,nameID:Vt.uShort,ordering:Vt.uShort},Is=new Array(5);function Rs(){const e=this.parseUShort(),t=Is[e],n={format:e};return void 0===t?(console.warn(`Unknown axis value table format ${e}`),n):Object.assign(n,this.parseStruct(t.bind(this)))}Is[1]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),value:this.parseFixed()}},Is[2]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),nominalValue:this.parseFixed(),rangeMinValue:this.parseFixed(),rangeMaxValue:this.parseFixed()}},Is[3]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),value:this.parseFixed(),linkedValue:this.parseFixed()}},Is[4]=function(){const e=this.parseUShort();return{flags:this.parseUShort(),valueNameID:this.parseUShort(),axisValues:this.parseList(e,(function(){return{axisIndex:this.parseUShort(),value:this.parseFixed()}}))}};var Us=new Array(5);function Ls(e,t){const n=t.format,s=Us[n];Qe.argument(void 0!==s,`Unknown axis value table format ${n}`);const r=s(e,t);return new St.Table("axisValueTable_"+e,r)}Us[1]=function(e,t){return[{name:`format${e}`,type:"USHORT",value:1},{name:`axisIndex${e}`,type:"USHORT",value:t.axisIndex},{name:`flags${e}`,type:"USHORT",value:t.flags},{name:`valueNameID${e}`,type:"USHORT",value:t.valueNameID},{name:`value${e}`,type:"FLOAT",value:t.value}]},Us[2]=function(e,t){return[{name:`format${e}`,type:"USHORT",value:2},{name:`axisIndex${e}`,type:"USHORT",value:t.axisIndex},{name:`flags${e}`,type:"USHORT",value:t.flags},{name:`valueNameID${e}`,type:"USHORT",value:t.valueNameID},{name:`nominalValue${e}`,type:"FLOAT",value:t.nominalValue},{name:`rangeMinValue${e}`,type:"FLOAT",value:t.rangeMinValue},{name:`rangeMaxValue${e}`,type:"FLOAT",value:t.rangeMaxValue}]},Us[3]=function(e,t){return[{name:`format${e}`,type:"USHORT",value:3},{name:`axisIndex${e}`,type:"USHORT",value:t.axisIndex},{name:`flags${e}`,type:"USHORT",value:t.flags},{name:`valueNameID${e}`,type:"USHORT",value:t.valueNameID},{name:`value${e}`,type:"FLOAT",value:t.value},{name:`linkedValue${e}`,type:"FLOAT",value:t.linkedValue}]},Us[4]=function(e,t){let n=[{name:`format${e}`,type:"USHORT",value:4},{name:`axisCount${e}`,type:"USHORT",value:t.axisValues.length},{name:`flags${e}`,type:"USHORT",value:t.flags},{name:`valueNameID${e}`,type:"USHORT",value:t.valueNameID}];for(let s=0;s<t.axisValues.length;s++)n=n.concat([{name:`format${e}axisIndex${s}`,type:"USHORT",value:t.axisValues[s].axisIndex},{name:`format${e}value${s}`,type:"FLOAT",value:t.axisValues[s].value}]);return n};var Cs={make:function(e){const t=new St.Table("STAT",[{name:"majorVersion",type:"USHORT",value:1},{name:"minorVersion",type:"USHORT",value:2},{name:"designAxisSize",type:"USHORT",value:8},{name:"designAxisCount",type:"USHORT",value:e.axes.length},{name:"designAxesOffset",type:"ULONG",value:0},{name:"axisValueCount",type:"USHORT",value:e.values.length},{name:"offsetToAxisValueOffsets",type:"ULONG",value:0},{name:"elidedFallbackNameID",type:"USHORT",value:e.elidedFallbackNameID}]);t.designAxesOffset=t.offsetToAxisValueOffsets=t.sizeOf();for(let r=0;r<e.axes.length;r++){const o=(n=r,s=e.axes[r],new St.Record("axisRecord_"+n,[{name:"axisTag_"+n,type:"TAG",value:s.tag},{name:"axisNameID_"+n,type:"USHORT",value:s.nameID},{name:"axisOrdering_"+n,type:"USHORT",value:s.ordering}]));t.offsetToAxisValueOffsets+=o.sizeOf(),t.fields=t.fields.concat(o.fields)}var n,s;const r=[];let o=[],a=2*e.values.length;for(let t=0;t<e.values.length;t++){const n=Ls(t,e.values[t]);r.push({name:"offset_"+t,type:"USHORT",value:a}),a+=n.sizeOf(),o=o.concat(n.fields)}return t.fields=t.fields.concat(r),t.fields=t.fields.concat(o),t},parse:function(e,t,n){t||(t=0);const s=new qt.Parser(e,t),r=s.parseUShort(),o=s.parseUShort();1!==r&&console.warn(`Unsupported STAT table version ${r}.${o}`);const a=[r,o],i=s.parseUShort(),l=s.parseUShort(),u=s.parseOffset32(),c=s.parseUShort(),p=s.parseOffset32(),h=r>1||o>0?s.parseUShort():void 0;void 0!==n&&Qe.argument(l>=n.axes.length,"STAT axis count must be greater than or equal to fvar axis count"),c>0&&Qe.argument(l>=0,"STAT axis count must be greater than 0 if STAT axis value count is greater than 0");const f=[];for(let e=0;e<l;e++)s.offset=t+u,s.relativeOffset=e*i,f.push(s.parseStruct(ws));s.offset=t,s.relativeOffset=p;const d=s.parseUShortList(c),g=[];for(let e=0;e<c;e++)s.offset=t+p,s.relativeOffset=d[e],g.push(Rs.apply(s));return{version:a,axes:f,values:g,elidedFallbackNameID:h}}};function Es(e,t){return new St.Record("axisValueMap_"+e,[{name:"fromCoordinate_"+e,type:"F2DOT14",value:t.fromCoordinate},{name:"toCoordinate_"+e,type:"F2DOT14",value:t.toCoordinate}])}function Ds(e,t){const n=new St.Record("segmentMap_"+e,[{name:"positionMapCount_"+e,type:"USHORT",value:t.axisValueMaps.length}]);let s=[];for(let n=0;n<t.axisValueMaps.length;n++){const r=Es(`${e}_${n}`,t.axisValueMaps[n]);s=s.concat(r.fields)}return n.fields=n.fields.concat(s),n}var Ms={make:function(e,t){Qe.argument(e.axisSegmentMaps.length===t.axes.length,"avar axis count must correspond to fvar axis count");const n=new St.Table("avar",[{name:"majorVersion",type:"USHORT",value:1},{name:"minorVersion",type:"USHORT",value:0},{name:"reserved",type:"USHORT",value:0},{name:"axisCount",type:"USHORT",value:e.axisSegmentMaps.length}]);for(let t=0;t<e.axisSegmentMaps.length;t++){const s=Ds(t,e.axisSegmentMaps[t]);n.fields=n.fields.concat(s.fields)}return n},parse:function(e,t,n){t||(t=0);const s=new Vt(e,t),r=s.parseUShort(),o=s.parseUShort();1!==r&&console.warn(`Unsupported avar table version ${r}.${o}`),s.skip("uShort",1);const a=s.parseUShort();Qe.argument(a===n.axes.length,"avar axis count must correspond to fvar axis count");const i=[];for(let e=0;e<a;e++){const e=[],t=s.parseUShort();for(let n=0;n<t;n++){const t=s.parseF2Dot14(),n=s.parseF2Dot14();e.push({fromCoordinate:t,toCoordinate:n})}i.push({axisValueMaps:e})}return{version:[r,o],axisSegmentMaps:i}}};var Fs={make:function(){console.warn("Writing of cvar tables is not yet supported.")},parse:function(e,t,n,s){const r=new qt.Parser(e,t),o=r.parseTupleVariationStore(r.relativeOffset,n.axes.length,"cvar",s),a=r.parseUShort(),i=r.parseUShort();return 1!==a&&console.warn(`Unsupported cvar table version ${a}.${i}`),{version:[a,i],...o}}};var As={make:function(){console.warn("Writing of gvar tables is not yet supported.")},parse:function(e,t,n,s){const r=new qt.Parser(e,t),o=r.parseUShort(),a=r.parseUShort();1!==o&&console.warn(`Unsupported gvar table version ${o}.${a}`);const i=r.parseUShort();i!==n.axes.length&&console.warn(`axisCount ${i} in gvar table does not match the number of axes ${n.axes.length} in the fvar table!`);const l=r.parseUShort();return{version:[o,a],sharedTuples:r.parsePointer32((function(){return this.parseTupleRecords(l,i)})),glyphVariations:r.parseTupleVariationStoreList(i,"gvar",s)}}};var Ns={parse:function(e,t){const n={},s=new qt.Parser(e,t);n.version=s.parseUShort(),Qe.argument(n.version<=1,"Unsupported gasp table version."),n.numRanges=s.parseUShort(),n.gaspRanges=[];for(let e=0;e<n.numRanges;e++)n.gaspRanges[e]={rangeMaxPPEM:s.parseUShort(),rangeGaspBehavior:s.parseUShort()};return n},make:function(e){const t=new St.Table("gasp",[{name:"version",type:"USHORT",value:1},{name:"numRanges",type:"USHORT",value:e.numRanges}]);for(let n in e.gaspRanges)t.fields.push({name:"rangeMaxPPEM",type:"USHORT",value:e.gaspRanges[n].rangeMaxPPEM}),t.fields.push({name:"rangeGaspBehavior",type:"USHORT",value:e.gaspRanges[n].rangeGaspBehavior});return t}};var Ps={make:function(e){const t=Array.from(e.keys()).sort(),n=[],s=[],r=new Map;let o=0,a={endGlyphID:null};for(let i=0,l=t.length;i<l;i++){const l=t[i],u=e.get(l);let c=r.get(u);void 0===c&&(c=o,s.push(u),r.set(u,c),o+=u.byteLength),l-1===a.endGlyphID&&c===a.svgDocOffset?a.endGlyphID=l:(a={startGlyphID:l,endGlyphID:l,svgDocOffset:c,svgDocLength:u.byteLength},n.push(a))}const i=n.length,l=s.length,u=2+12*i,c=new Array(4+4*i+l);let p=0;c[p++]={name:"version",type:"USHORT",value:0},c[p++]={name:"svgDocumentListOffset",type:"ULONG",value:10},c[p++]={name:"reserved",type:"ULONG",value:0},c[p++]={name:"numEntries",type:"USHORT",value:i};for(let e=0;e<i;e++){const t="documentRecord_"+e,{startGlyphID:s,endGlyphID:r,svgDocOffset:o,svgDocLength:a}=n[e];c[p++]={name:t+"_startGlyphID",type:"USHORT",value:s},c[p++]={name:t+"_endGlyphID",type:"USHORT",value:r},c[p++]={name:t+"_svgDocOffset",type:"ULONG",value:u+o},c[p++]={name:t+"_svgDocLength",type:"ULONG",value:a}}for(let e=0;e<l;e++)c[p++]={name:"svgDoc_"+e,type:"LITERAL",value:s[e]};return new St.Table("SVG ",c)},parse:function(e,t){const n=new Map,s=e.buffer,r=new Vt(e,t);if(0!==r.parseUShort())return n;r.relativeOffset=r.parseOffset32();const o=e.byteOffset+t+r.relativeOffset,a=r.parseUShort(),i=new Map;for(let e=0;e<a;e++){const e=r.parseUShort(),t=r.parseUShort(),a=o+r.parseOffset32(),l=r.parseULong();let u=i.get(a);void 0===u&&(u=new Uint8Array(s,a,l),i.set(a,u));for(let s=e;s<=t;s++)n.set(s,u)}return n}};function Bs(e){return Math.log(e)/Math.log(2)|0}function Gs(e){for(;e.length%4!=0;)e.push(0);let t=0;for(let n=0;n<e.length;n+=4)t+=(e[n]<<24)+(e[n+1]<<16)+(e[n+2]<<8)+e[n+3];return t%=Math.pow(2,32),t}function _s(e,t,n,s){return new St.Record("Table Record",[{name:"tag",type:"TAG",value:void 0!==e?e:""},{name:"checkSum",type:"ULONG",value:void 0!==t?t:0},{name:"offset",type:"ULONG",value:void 0!==n?n:0},{name:"length",type:"ULONG",value:void 0!==s?s:0}])}function Hs(e){const t=new St.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}]);t.tables=e,t.numTables=e.length;const n=Math.pow(2,Bs(t.numTables));t.searchRange=16*n,t.entrySelector=Bs(n),t.rangeShift=16*t.numTables-t.searchRange;const s=[],r=[];let o=t.sizeOf()+_s().sizeOf()*t.numTables;for(;o%4!=0;)o+=1,r.push({name:"padding",type:"BYTE",value:0});for(let t=0;t<e.length;t+=1){const n=e[t];Qe.argument(4===n.tableName.length,"Table name"+n.tableName+" is invalid.");const a=n.sizeOf(),i=_s(n.tableName,Gs(n.encode()),o,a);for(s.push({name:i.tag+" Table Record",type:"RECORD",value:i}),r.push({name:n.tableName+" table",type:"RECORD",value:n}),o+=a,Qe.argument(!isNaN(o),"Something went wrong calculating the offset.");o%4!=0;)o+=1,r.push({name:"padding",type:"BYTE",value:0})}return s.sort((function(e,t){return e.value.tag>t.value.tag?1:-1})),t.fields=t.fields.concat(s),t.fields=t.fields.concat(r),t}function Vs(e,t,n){for(let n=0;n<t.length;n+=1){const s=e.charToGlyphIndex(t[n]);if(s>0){return e.glyphs.get(s).getMetrics()}}return n}function zs(e){let t=0;for(let n=0;n<e.length;n+=1)t+=e[n];return t/e.length}var qs={make:Hs,fontToTable:function(e){const t=[],n=[],s=[],r=[],o=[],a=[],i=[];let l,u=0,c=0,p=0,h=0,f=0;for(let d=0;d<e.glyphs.length;d+=1){const g=e.glyphs.get(d),m=0|g.unicode;if(isNaN(g.advanceWidth))throw new Error("Glyph "+g.name+" ("+d+"): advanceWidth is not a number.");(l>m||void 0===l)&&m>0&&(l=m),u<m&&(u=m);const y=fs.getUnicodeRange(m);if(y<32)c|=1<<y;else if(y<64)p|=1<<y-32;else if(y<96)h|=1<<y-64;else{if(!(y<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");f|=1<<y-96}if(".notdef"===g.name)continue;const v=g.getMetrics();t.push(v.xMin),n.push(v.yMin),s.push(v.xMax),r.push(v.yMax),a.push(v.leftSideBearing),i.push(v.rightSideBearing),o.push(g.advanceWidth)}const d={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,s),yMax:Math.max.apply(null,r),advanceWidthMax:Math.max.apply(null,o),advanceWidthAvg:zs(o),minLeftSideBearing:Math.min.apply(null,a),maxLeftSideBearing:Math.max.apply(null,a),minRightSideBearing:Math.min.apply(null,i)};d.ascender=e.ascender,d.descender=e.descender;let g=0;e.weightClass>=600&&(g|=e.macStyleValues.BOLD),e.italicAngle<0&&(g|=e.macStyleValues.ITALIC);const m=is.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:d.xMin,yMin:d.yMin,xMax:d.xMax,yMax:d.yMax,lowestRecPPEM:3,macStyle:g,createdTimestamp:e.createdTimestamp}),y=ls.make({ascender:d.ascender,descender:d.descender,advanceWidthMax:d.advanceWidthMax,minLeftSideBearing:d.minLeftSideBearing,minRightSideBearing:d.minRightSideBearing,xMaxExtent:d.maxLeftSideBearing+(d.xMax-d.xMin),numberOfHMetrics:e.glyphs.length}),v=ps.make(e.glyphs.length),b=fs.make(Object.assign({xAvgCharWidth:Math.round(d.advanceWidthAvg),usFirstCharIndex:l,usLastCharIndex:u,ulUnicodeRange1:c,ulUnicodeRange2:p,ulUnicodeRange3:h,ulUnicodeRange4:f,sTypoAscender:d.ascender,sTypoDescender:d.descender,sTypoLineGap:0,usWinAscent:d.yMax,usWinDescent:Math.abs(d.yMin),ulCodePageRange1:1,sxHeight:Vs(e,"xyvw",{yMax:Math.round(d.ascender/2)}).yMax,sCapHeight:Vs(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",d).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0},e.tables.os2)),S=us.make(e.glyphs),x=un.make(e.glyphs),T=e.getEnglishName("fontFamily"),O=e.getEnglishName("fontSubfamily"),k=T+" "+O;let w=e.getEnglishName("postScriptName");w||(w=T.replace(/\s/g,"")+"-"+O);const I={};for(let t in e.names)I[t]=e.names[t];I.unicode=I.unicode||{},I.macintosh=I.macintosh||{},I.windows=I.windows||{};const R=e.names.unicode||{},U=e.names.macintosh||{},L=e.names.windows||{};for(const t in I){if(I[t]=I[t]||{},!I[t].uniqueID){const n=e.getEnglishName("manufacturer")||"";I[t].uniqueID={en:`${n}: ${k}`}}I[t].postScriptName||(I[t].postScriptName={en:w})}I.unicode.preferredFamily||(I.unicode.preferredFamily=R.fontFamily||U.fontFamily||L.fontFamily),I.macintosh.preferredFamily||(I.macintosh.preferredFamily=U.fontFamily||R.fontFamily||L.fontFamily),I.windows.preferredFamily||(I.windows.preferredFamily=L.fontFamily||R.fontFamily||U.fontFamily),I.unicode.preferredSubfamily||(I.unicode.preferredSubfamily=R.fontSubfamily||U.fontSubfamily||L.fontSubfamily),I.macintosh.preferredSubfamily||(I.macintosh.preferredSubfamily=U.fontSubfamily||R.fontSubfamily||L.fontSubfamily),I.windows.preferredSubfamily||(I.windows.preferredSubfamily=L.fontSubfamily||R.fontSubfamily||U.fontSubfamily);const C=[],E=an.make(I,C),D=C.length>0?cs.make(C):void 0,M=ds.make(e),F=as.make(e.glyphs,{version:e.getEnglishName("version"),fullName:k,familyName:T,weightName:O,postScriptName:w,unitsPerEm:e.unitsPerEm,fontBBox:[0,d.yMin,d.ascender,d.advanceWidthMax],topDict:e.tables.cff&&e.tables.cff.topDict||{}}),A=e.metas&&Object.keys(e.metas).length>0?bs.make(e.metas):void 0,N=[m,y,v,b,E,x,M,F,S];D&&N.push(D);const P={gsub:vs,cpal:Ln,colr:Ss,stat:Cs,avar:Ms,cvar:Fs,fvar:ks,gvar:As,gasp:Ns,svg:Ps},B={avar:[e.tables.fvar],fvar:[e.names]};for(let t in P){const n=e.tables[t];if(n){const s=P[t].make.call(e,n,...B[t]||[]);s&&N.push(s)}}A&&N.push(A);const G=Hs(N),_=Gs(G.encode()),H=G.fields;let V=!1;for(let e=0;e<H.length;e+=1)if("head table"===H[e].name){H[e].value.checkSumAdjustment=2981146554-_,V=!0;break}if(!V)throw new Error("Could not find head table with checkSum to adjust.");return G},computeCheckSum:Gs};function js(e,t){let n=0,s=e.length-1;for(;n<=s;){const r=n+s>>>1,o=e[r].tag;if(o===t)return r;o<t?n=r+1:s=r-1}return-n-1}function Ws(e,t){let n=0,s=e.length-1;for(;n<=s;){const r=n+s>>>1,o=e[r];if(o===t)return r;o<t?n=r+1:s=r-1}return-n-1}function $s(e,t){let n,s=0,r=e.length-1;for(;s<=r;){const o=s+r>>>1;n=e[o];const a=n.start;if(a===t)return n;a<t?s=o+1:r=o-1}if(s>0)return n=e[s-1],t>n.end?0:n}function Xs(e,t){this.font=e,this.tableName=t}Xs.prototype={searchTag:js,binSearch:Ws,getTable:function(e){let t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){let e=this.getTable();return e?e.scripts.map((function(e){return e.tag})):[]},getDefaultScriptName:function(){let e=this.getTable();if(!e)return;let t=!1;for(let n=0;n<e.scripts.length;n++){const s=e.scripts[n].tag;if("DFLT"===s)return s;"latn"===s&&(t=!0)}return t?"latn":void 0},getScriptTable:function(e,t){const n=this.getTable(t);if(n){e=e||"DFLT";const s=n.scripts,r=js(n.scripts,e);if(r>=0)return s[r].script;if(t){const t={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return s.splice(-1-r,0,t),t.script}}},getLangSysTable:function(e,t,n){const s=this.getScriptTable(e,n);if(s){if(!t||"dflt"===t||"DFLT"===t)return s.defaultLangSys;const e=js(s.langSysRecords,t);if(e>=0)return s.langSysRecords[e].langSys;if(n){const n={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return s.langSysRecords.splice(-1-e,0,n),n.langSys}}},getFeatureTable:function(e,t,n,s){const r=this.getLangSysTable(e,t,s);if(r){let e;const t=r.featureIndexes,o=this.font.tables[this.tableName].features;for(let s=0;s<t.length;s++)if(e=o[t[s]],e.tag===n)return e.feature;if(s){const s=o.length;return Qe.assert(0===s||n>=o[s-1].tag,"Features must be added in alphabetical order."),e={tag:n,feature:{params:0,lookupListIndexes:[]}},o.push(e),t.push(s),e.feature}}},getLookupTables:function(e,t,n,s,r){const o=this.getFeatureTable(e,t,n,r),a=[];if(o){let e;const t=o.lookupListIndexes,n=this.font.tables[this.tableName].lookups;for(let r=0;r<t.length;r++)e=n[t[r]],e.lookupType===s&&a.push(e);if(0===a.length&&r){e={lookupType:s,lookupFlag:0,subtables:[],markFilteringSet:void 0};const r=n.length;return n.push(e),t.push(r),[e]}}return a},getGlyphClass:function(e,t){switch(e.format){case 1:return e.startGlyph<=t&&t<e.startGlyph+e.classes.length?e.classes[t-e.startGlyph]:0;case 2:{const n=$s(e.ranges,t);return n?n.classId:0}}},getCoverageIndex:function(e,t){switch(e.format){case 1:{const n=Ws(e.glyphs,t);return n>=0?n:-1}case 2:{const n=$s(e.ranges,t);return n?n.index+t-n.start:-1}}},expandCoverage:function(e){if(1===e.format)return e.glyphs;{const t=[],n=e.ranges;for(let e=0;e<n.length;e++){const s=n[e],r=s.start,o=s.end;for(let e=r;e<=o;e++)t.push(e)}return t}}};var Ys=Xs;function Zs(e){Ys.call(this,e,"gpos")}Zs.prototype=Ys.prototype,Zs.prototype.init=function(){const e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},Zs.prototype.getKerningValue=function(e,t,n){for(let s=0;s<e.length;s++){const r=e[s].subtables;for(let e=0;e<r.length;e++){const s=r[e],o=this.getCoverageIndex(s.coverage,t);if(!(o<0))switch(s.posFormat){case 1:{let e=s.pairSets[o];for(let t=0;t<e.length;t++){let s=e[t];if(s.secondGlyph===n)return s.value1&&s.value1.xAdvance||0}break}case 2:{const e=this.getGlyphClass(s.classDef1,t),r=this.getGlyphClass(s.classDef2,n),o=s.classRecords[e][r];return o.value1&&o.value1.xAdvance||0}}}}return 0},Zs.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,"kern",2)};var Qs=Zs;function Ks(e,t){const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}function Js(e){return 31===e[0]&&139===e[1]&&8===e[2]}function er(e){return{x:e.x,y:e.y,onCurve:e.onCurve,lastPointOfContour:e.lastPointOfContour}}function tr(e){return{glyphIndex:e.glyphIndex,xScale:e.xScale,scale01:e.scale01,scale10:e.scale10,yScale:e.yScale,dx:e.dx,dy:e.dy}}function nr(e){Ys.call(this,e,"gsub")}function sr(e,t,n){const s=e.subtables;for(let e=0;e<s.length;e++){const n=s[e];if(n.substFormat===t)return n}if(n)return s.push(n),n}nr.prototype=Ys.prototype,nr.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},nr.prototype.getSingle=function(e,t,n){const s=[],r=this.getLookupTables(t,n,e,1);for(let e=0;e<r.length;e++){const t=r[e].subtables;for(let e=0;e<t.length;e++){const n=t[e],r=this.expandCoverage(n.coverage);let o;if(1===n.substFormat){const e=n.deltaGlyphId;for(o=0;o<r.length;o++){const t=r[o];s.push({sub:t,by:t+e})}}else{const e=n.substitute;for(o=0;o<r.length;o++)s.push({sub:r[o],by:e[o]})}}}return s},nr.prototype.getMultiple=function(e,t,n){const s=[],r=this.getLookupTables(t,n,e,2);for(let e=0;e<r.length;e++){const t=r[e].subtables;for(let e=0;e<t.length;e++){const n=t[e],r=this.expandCoverage(n.coverage);let o;for(o=0;o<r.length;o++){const e=r[o],t=n.sequences[o];s.push({sub:e,by:t})}}}return s},nr.prototype.getAlternates=function(e,t,n){const s=[],r=this.getLookupTables(t,n,e,3);for(let e=0;e<r.length;e++){const t=r[e].subtables;for(let e=0;e<t.length;e++){const n=t[e],r=this.expandCoverage(n.coverage),o=n.alternateSets;for(let e=0;e<r.length;e++)s.push({sub:r[e],by:o[e]})}}return s},nr.prototype.getLigatures=function(e,t,n){const s=[],r=this.getLookupTables(t,n,e,4);for(let e=0;e<r.length;e++){const t=r[e].subtables;for(let e=0;e<t.length;e++){const n=t[e],r=this.expandCoverage(n.coverage),o=n.ligatureSets;for(let e=0;e<r.length;e++){const t=r[e],n=o[e];for(let e=0;e<n.length;e++){const r=n[e];s.push({sub:[t].concat(r.components),by:r.ligGlyph})}}}}return s},nr.prototype.addSingle=function(e,t,n,s){const r=sr(this.getLookupTables(n,s,e,1,!0)[0],2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});Qe.assert(1===r.coverage.format,"Single: unable to modify coverage table format "+r.coverage.format);const o=t.sub;let a=this.binSearch(r.coverage.glyphs,o);a<0&&(a=-1-a,r.coverage.glyphs.splice(a,0,o),r.substitute.splice(a,0,0)),r.substitute[a]=t.by},nr.prototype.addMultiple=function(e,t,n,s){Qe.assert(t.by instanceof Array&&t.by.length>1,'Multiple: "by" must be an array of two or more ids');const r=sr(this.getLookupTables(n,s,e,2,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});Qe.assert(1===r.coverage.format,"Multiple: unable to modify coverage table format "+r.coverage.format);const o=t.sub;let a=this.binSearch(r.coverage.glyphs,o);a<0&&(a=-1-a,r.coverage.glyphs.splice(a,0,o),r.sequences.splice(a,0,0)),r.sequences[a]=t.by},nr.prototype.addAlternate=function(e,t,n,s){const r=sr(this.getLookupTables(n,s,e,3,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});Qe.assert(1===r.coverage.format,"Alternate: unable to modify coverage table format "+r.coverage.format);const o=t.sub;let a=this.binSearch(r.coverage.glyphs,o);a<0&&(a=-1-a,r.coverage.glyphs.splice(a,0,o),r.alternateSets.splice(a,0,0)),r.alternateSets[a]=t.by},nr.prototype.addLigature=function(e,t,n,s){const r=this.getLookupTables(n,s,e,4,!0)[0];let o=r.subtables[0];o||(o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},r.subtables[0]=o),Qe.assert(1===o.coverage.format,"Ligature: unable to modify coverage table format "+o.coverage.format);const a=t.sub[0],i=t.sub.slice(1),l={ligGlyph:t.by,components:i};let u=this.binSearch(o.coverage.glyphs,a);if(u>=0){const e=o.ligatureSets[u];for(let t=0;t<e.length;t++)if(Ks(e[t].components,i))return;e.push(l)}else u=-1-u,o.coverage.glyphs.splice(u,0,a),o.ligatureSets.splice(u,0,[l])},nr.prototype.getFeature=function(e,t,n){if(/ss\d\d/.test(e))return this.getSingle(e,t,n);switch(e){case"aalt":case"salt":return this.getSingle(e,t,n).concat(this.getAlternates(e,t,n));case"dlig":case"liga":case"rlig":return this.getLigatures(e,t,n);case"ccmp":return this.getMultiple(e,t,n).concat(this.getLigatures(e,t,n));case"stch":return this.getMultiple(e,t,n)}},nr.prototype.add=function(e,t,n,s){if(/ss\d\d/.test(e))return this.addSingle(e,t,n,s);switch(e){case"aalt":case"salt":return"number"==typeof t.by?this.addSingle(e,t,n,s):this.addAlternate(e,t,n,s);case"dlig":case"liga":case"rlig":return this.addLigature(e,t,n,s);case"ccmp":return t.by instanceof Array?this.addMultiple(e,t,n,s):this.addLigature(e,t,n,s)}};var rr=nr,or=class{constructor(e){this.defaultValue=255,this.font=e}cpal(){return!(!this.font.tables||!this.font.tables.cpal)&&this.font.tables.cpal}getAll(e){const t=[],n=this.cpal();if(!n)return t;for(let s=0;s<n.colorRecordIndices.length;s++){const r=n.colorRecordIndices[s],o=[];for(let t=r;t<r+n.numPaletteEntries;t++)o.push(Un(n.colorRecords[t],e||"hexa"));t.push(o)}return t}toCPALcolor(e){return Array.isArray(e)?e.map((e=>Rn(e,"raw"))):Rn(e,"raw")}fillPalette(e,t=[],n=this.cpal().numPaletteEntries){return e=Number.isInteger(e)?this.get(e,"raw"):e,Object.assign(Array(n).fill(this.defaultValue),this.toCPALcolor(e).concat(this.toCPALcolor(t)))}extend(e){if(this.ensureCPAL(Array(e).fill(this.defaultValue)))return;const t=this.cpal(),n=t.numPaletteEntries+e,s=this.getAll().map((e=>this.fillPalette(e,[],n)));t.numPaletteEntries=n,t.colorRecords=this.toCPALcolor(s.flat()),this.updateIndices()}get(e,t="hexa"){return this.getAll(t)[e]||null}getColor(e,t=0,n="hexa"){return kn(this.font,e,t,n)}setColor(e,t,n=0){e=parseInt(e),n=parseInt(n);let s=this.getAll("raw"),r=s[n];if(!r)throw Error(`paletteIndex ${n} out of range`);const o=this.cpal(),a=o.numPaletteEntries;Array.isArray(t)||(t=[t]),t.length+e>a&&(this.extend(t.length+e-a),s=this.getAll("raw"),r=s[n]);for(let n=0;n<t.length;n++)r[n+e]=this.toCPALcolor(t[n]);o.colorRecords=s.flat(),this.updateIndices()}add(e){if(this.ensureCPAL(e))return;const t=this.cpal(),n=t.numPaletteEntries;e&&e.length?((e=this.toCPALcolor(e)).length>n?this.extend(e.length-n):e.length<n&&(e=this.fillPalette(e)),t.colorRecordIndices.push(t.colorRecords.length),t.colorRecords.push(...e)):(t.colorRecordIndices.push(t.colorRecords.length),t.colorRecords.push(...Array(n).fill(this.defaultValue)))}delete(e){const t=this.getAll("raw");delete t[e];const n=this.cpal();n.colorRecordIndices.pop(),n.colorRecords=t.flat()}deleteColor(e,t){if(e===t)throw Error("replacementIndex cannot be the same as colorIndex");const n=this.cpal(),s=this.getAll("raw"),r=[];if(t>n.numPaletteEntries-1)throw Error(`Replacement index out of range: numPaletteEntries after deletion: ${n.numPaletteEntries-1}, replacementIndex: ${t})`);for(let t=0;t<s.length;t++){const n=s[t].filter(((t,n)=>n!==e));r.push(n)}const o=this.font.tables.colr;if(o){const n=o.layerRecords;for(let r=0;r<n.length;r++){const o=n[r].paletteIndex;if(o>e){const e=1;n[r].paletteIndex-=e}else if(o===e){let o=0;for(let n=0;n<s.length;n++)if(t>e&&t<=e+s[n].length){o++;break}n[r].paletteIndex=t-o}}this.font.tables.colr={...o,layerRecords:n}}const a=r.flat();for(let e=0;e<s.length;e++)n.colorRecordIndices[e]-=e;n.numPaletteEntries=Math.max(0,n.numPaletteEntries-1),n.colorRecords=this.toCPALcolor(a)}ensureCPAL(e){return!this.cpal()&&(e=e&&e.length?this.toCPALcolor(e):[this.defaultValue],this.font.tables.cpal={version:0,numPaletteEntries:e.length,colorRecords:e,colorRecordIndices:[0]},!0)}updateIndices(){const e=this.cpal(),t=Math.ceil(e.colorRecords.length/e.numPaletteEntries);e.colorRecordIndices=[];for(let n=0;n<t;n++)e.colorRecordIndices.push(n*e.numPaletteEntries)}},ar=class{constructor(e){this.font=e}ensureCOLR(){return this.font.tables.colr||(this.font.tables.colr={version:0,baseGlyphRecords:[],layerRecords:[]}),this.font}get(e){const t=this.font,n=[],s=t.tables.colr,r=t.tables.cpal;if(!s||!r)return n;const o=function(e,t,n){let s=0,r=e.length-1,o=null;for(;s<=r;){const a=Math.floor((s+r)/2),i=e[a],l=i[t];if(l<n)s=a+1;else{if(!(l>n)){o=i;break}r=a-1}}return o}(s.baseGlyphRecords,"glyphID",e);if(!o)return n;const a=o.firstLayerIndex,i=o.numLayers;for(let e=0;e<i;e++){const r=s.layerRecords[a+e];n.push({glyph:t.glyphs.get(r.glyphID),paletteIndex:r.paletteIndex})}return n}add(e,t,n){const s=this.get(e);t=Array.isArray(t)?t:[t],void 0===n||n===1/0||n>s.length?n=s.length:n<0&&(n=s.length+1+n%(s.length+1))>=s.length+1&&(n-=s.length+1);const r=[];for(let e=0;e<n;e++){const t=Number.isInteger(s[e].glyph)?s[e].glyph:s[e].glyph.index;r.push({glyphID:t,paletteIndex:s[e].paletteIndex})}for(const e of t){const t=Number.isInteger(e.glyph)?e.glyph:e.glyph.index;r.push({glyphID:t,paletteIndex:e.paletteIndex})}for(let e=n;e<s.length;e++){const t=Number.isInteger(s[e].glyph)?s[e].glyph:s[e].glyph.index;r.push({glyphID:t,paletteIndex:s[e].paletteIndex})}this.updateColrTable(e,r)}setPaletteIndex(e,t,n){let s=this.get(e);s[t]?(s=s.map(((e,s)=>({glyphID:e.glyph.index,paletteIndex:s===t?n:e.paletteIndex}))),this.updateColrTable(e,s)):console.error("Invalid layer index")}remove(e,t,n=t){let s=this.get(e);s=s.map((e=>({glyphID:e.glyph.index,paletteIndex:e.paletteIndex}))),s.splice(t,n-t+1),this.updateColrTable(e,s)}updateColrTable(e,t){this.ensureCOLR();const n=this.font.tables.colr;let s=function(e,t,n){let s=0,r=e.length-1;for(;s<=r;){const o=Math.floor((s+r)/2),a=e[o];if(a[t]<n)s=o+1;else{if(!(a[t]>n))return o;r=o-1}}return-1}(n.baseGlyphRecords,"glyphID",e);if(-1===s){const t={glyphID:e,firstLayerIndex:n.layerRecords.length,numLayers:0};s=function(e,t,n){let s=0,r=e.length;for(;s<r;){const a=s+r>>>1;o=n,e[a][t]-o[t]<0?s=a+1:r=a}var o;return e.splice(s,0,n),s}(n.baseGlyphRecords,"glyphID",t)}const r=n.baseGlyphRecords[s],o=r.numLayers,a=t.length,i=a-o;if(i>0){const e=t.slice(o).map((e=>({glyphID:e.glyphID,paletteIndex:e.paletteIndex})));n.layerRecords.splice(r.firstLayerIndex+o,0,...e)}else i<0&&n.layerRecords.splice(r.firstLayerIndex+a,-i);for(let e=0;e<Math.min(o,a);e++)n.layerRecords[r.firstLayerIndex+e]={glyphID:t[e].glyphID,paletteIndex:t[e].paletteIndex};if(r.numLayers=a,0!==i)for(let e=0;e<n.baseGlyphRecords.length;e++){const t=n.baseGlyphRecords[e];e===s||t.firstLayerIndex<r.firstLayerIndex||(n.baseGlyphRecords[e].firstLayerIndex+=i)}}},ir=class{constructor(e){this.font=e,this.cache=new WeakMap}get(e){const t=this.getOrCreateSvgImageCacheEntry(e);return t&&t.image}getAsync(e){const t=this.getOrCreateSvgImageCacheEntry(e);return t&&t.promise}getOrCreateSvgImageCacheEntry(e){const t=this.font.tables.svg;if(void 0===t)return;const n=t.get(e);if(void 0===n)return;let s=this.cache.get(n);void 0===s&&(s=function(e){return{template:lr(e).then(ur),images:new Map}}(n),this.cache.set(n,s));let r=s.images.get(e);return void 0===r&&(r=function(e,t,n){return{promise:t.then((t=>{let s;"string"==typeof t?s=t:(t[4]=n,s=t.join(""));const r=function(e,t){const n=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement,s=n.viewBox.baseVal,r=n.width.baseVal,o=n.height.baseVal;let a=1,i=1;s.width>0&&s.height>0&&(1===r.unitType?(a=r.valueInSpecifiedUnits/s.width,i=1===o.unitType?o.valueInSpecifiedUnits/s.height:a):1===o.unitType?(i=o.valueInSpecifiedUnits/s.height,a=i):t&&(a=t/s.width,i=t/s.height));const l=document.createElement("div");l.style.position="fixed",l.style.visibility="hidden",l.appendChild(n),document.body.appendChild(l);const u=n.getBBox();document.body.removeChild(l);const c=(u.x-s.x)*a,p=(s.y-u.y)*i,h=u.width*a,f=u.height*i;n.setAttribute("viewBox",[u.x,u.y,u.width,u.height].join(" ")),1!==a&&n.setAttribute("width",h);1!==i&&n.setAttribute("height",f);const d=new Image(h,f);return d.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n.outerHTML),{leftSideBearing:c,baseline:p,image:d}}(s,e.unitsPerEm);return r.image.decode().then((()=>r))})),image:void 0}}(this.font,s.template,e),r.promise.then((t=>{if(r.image=t,"function"==typeof this.font.onGlyphUpdated)try{this.font.onGlyphUpdated(e)}catch(t){console.error("font.onGlyphUpdated",e,t)}})),s.images.set(e,r)),r}};var lr="function"==typeof DecompressionStream?function(e){if(Js(e))return new Response(new Response(e).body.pipeThrough(new DecompressionStream("gzip"))).text();try{return Promise.resolve((new TextDecoder).decode(e))}catch(e){return Promise.reject(e)}}:function(e){try{return Promise.resolve((new TextDecoder).decode(Js(e)?function(e){const t=new DataView(e.buffer,e.byteOffset,e.byteLength);let n=10;const s=e.byteLength-8,r=t.getInt8(3);if(4&r&&(n+=2+t.getUint16(n,!0)),8&r)for(;n<s&&0!==e[n++];);if(16&r)for(;n<s&&0!==e[n++];);if(2&r&&(n+=2),n>=s)throw new Error("Can't find compressed blocks");const o=t.getUint32(t.byteLength-4,!0);return _e(e.subarray(n,s),new Uint8Array(o))}(e):e))}catch(e){return Promise.reject(e)}};function ur(e){const t=e.indexOf("<svg"),n=e.indexOf(">",t+4)+1;if(/ id=['"]glyph\d+['"]/.test(e.substring(t,n)))return e;const s=e.lastIndexOf("</svg>");return[e.substring(0,n),"<defs>",e.substring(n,s),'</defs><use href="#glyph',"",'"/>',e.substring(s)]}function cr(e,t,n,s,r){let o;return(t&s)>0?(o=e.parseByte(),t&r||(o=-o),o=n+o):o=(t&r)>0?n:n+e.parseShort(),o}function pr(e,t,n){const s=new qt.Parser(t,n);let r,o;if(e._numberOfContours=s.parseShort(),e._xMin=s.parseShort(),e._yMin=s.parseShort(),e._xMax=s.parseShort(),e._yMax=s.parseShort(),e._numberOfContours>0){const t=e.endPointIndices=[];for(let n=0;n<e._numberOfContours;n+=1)t.push(s.parseUShort());e.instructionLength=s.parseUShort(),e.instructions=[];for(let t=0;t<e.instructionLength;t+=1)e.instructions.push(s.parseByte());const n=t[t.length-1]+1;r=[];for(let e=0;e<n;e+=1)if(o=s.parseByte(),r.push(o),(8&o)>0){const t=s.parseByte();for(let n=0;n<t;n+=1)r.push(o),e+=1}if(Qe.argument(r.length===n,"Bad flags."),t.length>0){const a=[];let i;if(n>0){for(let e=0;e<n;e+=1)o=r[e],i={},i.onCurve=!!(1&o),i.lastPointOfContour=t.indexOf(e)>=0,a.push(i);let e=0;for(let t=0;t<n;t+=1)o=r[t],i=a[t],i.x=cr(s,o,e,2,16),e=i.x;let l=0;for(let e=0;e<n;e+=1)o=r[e],i=a[e],i.y=cr(s,o,l,4,32),l=i.y}e.points=a}else e.points=[]}else if(0===e.numberOfContours)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];let t=!0;for(;t;){r=s.parseUShort();const n={glyphIndex:s.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(1&r)>0?(2&r)>0?(n.dx=s.parseShort(),n.dy=s.parseShort()):n.matchedPoints=[s.parseUShort(),s.parseUShort()]:(2&r)>0?(n.dx=s.parseChar(),n.dy=s.parseChar()):n.matchedPoints=[s.parseByte(),s.parseByte()],(8&r)>0?n.xScale=n.yScale=s.parseF2Dot14():(64&r)>0?(n.xScale=s.parseF2Dot14(),n.yScale=s.parseF2Dot14()):(128&r)>0&&(n.xScale=s.parseF2Dot14(),n.scale01=s.parseF2Dot14(),n.scale10=s.parseF2Dot14(),n.yScale=s.parseF2Dot14()),e.components.push(n),t=!!(32&r)}if(256&r){e.instructionLength=s.parseUShort(),e.instructions=[];for(let t=0;t<e.instructionLength;t+=1)e.instructions.push(s.parseByte())}}}function hr(e,t){const n=[];for(let s=0;s<e.length;s+=1){const r=e[s],o={x:t.xScale*r.x+t.scale10*r.y+t.dx,y:t.scale01*r.x+t.yScale*r.y+t.dy,onCurve:r.onCurve,lastPointOfContour:r.lastPointOfContour};n.push(o)}return n}function fr(e){const t=new Xe;if(!e)return t;const n=function(e){const t=[];let n=[];for(let s=0;s<e.length;s+=1){const r=e[s];n.push(r),r.lastPointOfContour&&(t.push(n),n=[])}return Qe.argument(0===n.length,"There are still points left in the current contour."),t}(e);for(let e=0;e<n.length;++e){const s=n[e];let r=s[s.length-1],o=s[0];if(r.onCurve)t.moveTo(r.x,r.y);else if(o.onCurve)t.moveTo(o.x,o.y);else{const e={x:.5*(r.x+o.x),y:.5*(r.y+o.y)};t.moveTo(e.x,e.y)}for(let e=0;e<s.length;++e)if(r=o,o=s[(e+1)%s.length],r.onCurve)t.lineTo(r.x,r.y);else{let e=o;o.onCurve||(e={x:.5*(r.x+o.x),y:.5*(r.y+o.y)}),t.quadraticCurveTo(r.x,r.y,e.x,e.y)}t.closePath()}return t}function dr(e,t){if(t.isComposite)for(let n=0;n<t.components.length;n+=1){const s=t.components[n],r=e.get(s.glyphIndex);if(r.getPath(),r.points){let e;if(void 0===s.matchedPoints)e=hr(r.points,s);else{if(s.matchedPoints[0]>t.points.length-1||s.matchedPoints[1]>r.points.length-1)throw Error("Matched points out of range in "+t.name);const n=t.points[s.matchedPoints[0]];let o=r.points[s.matchedPoints[1]];const a={xScale:s.xScale,scale01:s.scale01,scale10:s.scale10,yScale:s.yScale,dx:0,dy:0};o=hr([o],a)[0],a.dx=n.x-o.x,a.dy=n.y-o.y,e=hr(r.points,a)}t.points=t.points.concat(e)}}return fr(t.points)}var gr,mr,yr,vr,br={getPath:fr,parse:function(e,t,n,s,r){return r.lowMemory?function(e,t,n,s){const r=new Fn.GlyphSet(s);return s._push=function(o){const a=n[o];a!==n[o+1]?r.push(o,Fn.ttfGlyphLoader(s,o,pr,e,t+a,dr)):r.push(o,Fn.glyphLoader(s,o))},r}(e,t,n,s):function(e,t,n,s){const r=new Fn.GlyphSet(s);for(let o=0;o<n.length-1;o+=1){const a=n[o];a!==n[o+1]?r.push(o,Fn.ttfGlyphLoader(s,o,pr,e,t+a,dr)):r.push(o,Fn.glyphLoader(s,o))}return r}(e,t,n,s)}},Sr=class{constructor(e){this.font=e}normalizeCoordTags(e){for(const t in e)if(t.length<4){const n=t.padEnd(4," ");void 0===e[n]&&(e[n]=e[t]),delete e[t]}}getNormalizedCoords(e){e||(e=this.font.variation.get());let t=[];this.normalizeCoordTags(e);for(let n=0;n<this.fvar().axes.length;n++){const s=this.fvar().axes[n];let r=e[s.tag];void 0===r&&(r=s.defaultValue),r<s.defaultValue?t.push((r-s.defaultValue+Number.EPSILON)/(s.defaultValue-s.minValue+Number.EPSILON)):t.push((r-s.defaultValue+Number.EPSILON)/(s.maxValue-s.defaultValue+Number.EPSILON))}if(this.avar())for(let e=0;e<this.avar().axisSegmentMaps.length;e++){let n=this.avar().axisSegmentMaps[e];for(let s=0;s<n.axisValueMaps.length;s++){let r=n.axisValueMaps[s];if(s>=1&&t[e]<r.fromCoordinate){let o=n.axisValueMaps[s-1];t[e]=((t[e]-o.fromCoordinate)*(r.toCoordinate-o.toCoordinate)+Number.EPSILON)/(r.fromCoordinate-o.fromCoordinate+Number.EPSILON)+o.toCoordinate;break}}}return t}interpolatePoints(e,t,n){if(0===e.length)return;let s=0;for(;s<e.length;){let r=s,o=s,a=e[o];for(;!a.lastPointOfContour;)a=e[++o];for(;s<=o&&!n[s];)s++;if(s>o)continue;let i=s,l=s;for(s++;s<=o;)n[s]&&(this.deltaInterpolate(l+1,s-1,l,s,t,e),l=s),s++;l===i?this.deltaShift(r,o,l,t,e):(this.deltaInterpolate(l+1,o,l,i,t,e),i>0&&this.deltaInterpolate(r,i-1,l,i,t,e)),s=o+1}}deltaInterpolate(e,t,n,s,r,o){if(e>t)return;let a=["x","y"];for(let l=0;l<a.length;l++){let u=a[l];if(r[n][u]>r[s][u]){var i=n;n=s,s=i}let c=r[n][u],p=r[s][u],h=o[n][u],f=o[s][u];if(c!==p||h===f){let n=c===p?0:(f-h)/(p-c);for(let s=e;s<=t;s++){let e=r[s][u];e<=c?e+=h-c:e>=p?e+=f-p:e=h+(e-c)*n,o[s][u]=e}}}}deltaShift(e,t,n,s,r){let o=r[n].x-s[n].x,a=r[n].y-s[n].y;if(0!==o||0!==a)for(let s=e;s<=t;s++)s!==n&&(r[s].x+=o,r[s].y+=a)}transformComponents(e,t,n,s,r,o){let a=0;for(let i=0;i<e.components.length;i++){const l=e.components[i],u=this.font.glyphs.get(l.glyphIndex),c=tr(l),p=s.indexOf(i);p>-1&&(c.dx+=Math.round(r.deltas[p]*o),c.dy+=Math.round(r.deltasY[p]*o));const h=hr(this.getTransform(u,n).points,c);t.splice(a,h.length,...h),a+=u.points.length}}applyTupleVariationStore(e,t,n,s="gvar",r={}){n||(n=this.font.variation.get());const o=this.getNormalizedCoords(n),{headers:a,sharedPoints:i}=e,l=this.fvar().axes.length;let u;"gvar"===s?u=t.map(er):"cvar"===s&&(u=[...t]);for(let e=0;e<a.length;e++){const c=a[e];let p=1;for(let e=0;e<l;e++){let t=[0];switch(s){case"gvar":t=c.peakTuple?c.peakTuple:this.gvar().sharedTuples[c.sharedTupleRecordsIndex];break;case"cvar":t=c.peakTuple}if(0!==t[e]){if(0===o[e]){p=0;break}if(c.intermediateStartTuple){if(o[e]<c.intermediateStartTuple[e]||o[e]>c.intermediateEndTuple[e]){p=0;break}p=o[e]<t[e]?p*(o[e]-c.intermediateStartTuple[e]+Number.EPSILON)/(t[e]-c.intermediateStartTuple[e]+Number.EPSILON):p*(c.intermediateEndTuple[e]-o[e]+Number.EPSILON)/(c.intermediateEndTuple[e]-t[e]+Number.EPSILON)}else{if(o[e]<Math.min(0,t[e])||o[e]>Math.max(0,t[e])){p=0;break}p=(p*o[e]+Number.EPSILON)/(t[e]+Number.EPSILON)}}}if(0===p)continue;const h=c.privatePoints.length?c.privatePoints:i;if("gvar"===s&&r.glyph&&r.glyph.isComposite)this.transformComponents(r.glyph,u,n,h,c,p);else if(0===h.length)for(let e=0;e<u.length;e++){const t=u[e];"gvar"===s?u[e]={x:Math.round(t.x+c.deltas[e]*p),y:Math.round(t.y+c.deltasY[e]*p),onCurve:t.onCurve,lastPointOfContour:t.lastPointOfContour}:"cvar"===s&&(u[e]=Math.round(t+c.deltas[e]*p))}else{let e;"gvar"===s?e=u.map(er):"cvar"===s&&(e=u);const n=Array(t.length).fill(!1);for(let r=0;r<h.length;r++){let o=h[r];if(o<t.length){let t=e[o];"gvar"===s?(n[o]=!0,t.x+=c.deltas[r]*p,t.y+=c.deltasY[r]*p):"cvar"===s&&(u[o]=Math.round(t+c.deltas[r]*p))}}if("gvar"===s){this.interpolatePoints(e,u,n);for(let n=0;n<t.length;n++){let t=e[n].x-u[n].x,s=e[n].y-u[n].y;u[n].x=Math.round(u[n].x+t),u[n].y=Math.round(u[n].y+s)}}}}return u}getTransform(e,t){Number.isInteger(e)&&(e=this.font.glyphs.get(e));const n=e.getBlendPath,s=!(!e.points||!e.points.length);let r=e;if(n||s)if(t||(t=this.font.variation.get()),s){const n=this.gvar()&&this.gvar().glyphVariations[e.index];if(n){const s=e.points;let o=this.applyTupleVariationStore(n,s,t,"gvar",{glyph:e});r=new En(Object.assign({},e,{points:o,path:fr(o)}))}}else if(n){const n=e.getBlendPath(t);r=new En(Object.assign({},e,{path:n}))}return this.font.tables.hvar&&(e._advanceWidth=void 0!==e._advanceWidth?e._advanceWidth:e.advanceWidth,e.advanceWidth=r.advanceWidth=Math.round(e._advanceWidth+this.getVariableAdjustment(r.index,"hvar","advanceWidth",t)),e._leftSideBearing=void 0!==e._leftSideBearing?e._leftSideBearing:e.leftSideBearing,e.leftSideBearing=r.leftSideBearing=Math.round(e._leftSideBearing+this.getVariableAdjustment(r.index,"hvar","lsb",t))),r}getCvarTransform(e){const t=this.font.tables.cvt,n=this.cvar();return t&&t.length&&n&&n.headers.length?this.applyTupleVariationStore(n,t,e,"cvar"):t}getVariableAdjustment(e,t,n,s){let r,o;s=s||this.font.variation.get();const a=this.font.tables[t];if(!a)throw Error(`trying to get variation adjustment from non-existent table "${a}"`);if(!a.itemVariationStore)throw Error(`trying to get variation adjustment from table "${a}" which does not have an itemVariationStore`);const i=a[n]&&a[n].map.length;if(i){let t=e;t>=i&&(t=i-1),({outerIndex:r,innerIndex:o}=a[n].map[t])}else r=0,o=e;return this.getDelta(a.itemVariationStore,r,o,s)}getDelta(e,t,n,s){if(t>=e.itemVariationSubtables.length)return 0;let r=e.itemVariationSubtables[t];if(n>=r.deltaSets.length)return 0;let o=r.deltaSets[n],a=this.getBlendVector(e,t,s),i=0;for(let e=0;e<r.regionIndexes.length;e++)i+=o[e]*a[e];return i}getBlendVector(e,t,n){n||(n=this.font.variation.get());let s=e.itemVariationSubtables[t];const r=this.getNormalizedCoords(n);let o=[];for(let t=0;t<s.regionIndexes.length;t++){let n=1,a=s.regionIndexes[t],i=e.variationRegions[a].regionAxes;for(let e=0;e<i.length;e++){let t,s=i[e];t=s.startCoord>s.peakCoord||s.peakCoord>s.endCoord||s.startCoord<0&&s.endCoord>0&&0!==s.peakCoord||0===s.peakCoord?1:r[e]<s.startCoord||r[e]>s.endCoord?0:r[e]===s.peakCoord?1:r[e]<s.peakCoord?(r[e]-s.startCoord+Number.EPSILON)/(s.peakCoord-s.startCoord+Number.EPSILON):(s.endCoord-r[e]+Number.EPSILON)/(s.endCoord-s.peakCoord+Number.EPSILON),n*=t}o[t]=n}return o}avar(){return this.font.tables.avar}cvar(){return this.font.tables.cvar}fvar(){return this.font.tables.fvar}gvar(){return this.font.tables.gvar}hvar(){return this.font.tables.hvar}},xr=class{constructor(e){this.font=e,this.process=new Sr(this.font),this.activateDefaultVariation(),this.getTransform=this.process.getTransform.bind(this.process)}activateDefaultVariation(){const e=this.getDefaultInstanceIndex();e>-1?this.set(e):this.set(this.getDefaultCoordinates())}getDefaultCoordinates(){return this.fvar().axes.reduce(((e,t)=>(e[t.tag]=t.defaultValue,e)),{})}getDefaultInstanceIndex(){const e=this.getDefaultCoordinates();let t=this.getInstanceIndex(e);return t<0&&(t=this.fvar().instances.findIndex((e=>e.name&&"Regular"===e.name.en))),t}getInstanceIndex(e){return this.fvar().instances.findIndex((t=>Object.keys(e).every((n=>t.coordinates[n]===e[n]))))}getInstance(e){return this.fvar().instances&&this.fvar().instances[e]}set(e){let t;if(Number.isInteger(e)){const n=this.getInstance(e);if(!n)throw Error(`Invalid instance index ${e}`);t={...n.coordinates}}else t=e,this.process.normalizeCoordTags(t);t=Object.assign({},this.font.defaultRenderOptions.variation,t),this.font.defaultRenderOptions=Object.assign({},this.font.defaultRenderOptions,{variation:t})}get(){return Object.assign({},this.font.defaultRenderOptions.variation)}avar(){return this.font.tables.avar}cvar(){return this.font.tables.cvar}fvar(){return this.font.tables.fvar}gvar(){return this.font.tables.gvar}hvar(){return this.font.tables.hvar}};function Tr(e){this.font=e,this.getCommands=function(e){return br.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Or(e){return e}function kr(e){return Math.sign(e)*Math.round(Math.abs(e))}function wr(e){return Math.sign(e)*Math.round(Math.abs(2*e))/2}function Ir(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function Rr(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function Ur(e){return Math.sign(e)*Math.floor(Math.abs(e))}var Lr=function(e){const t=this.srPeriod;let n=this.srPhase;let s=1;return e<0&&(e=-e,s=-1),e+=this.srThreshold-n,e=Math.trunc(e/t)*t,(e+=n)<0?n*s:e*s},Cr={x:1,y:0,axis:"x",distance:function(e,t,n,s){return(n?e.xo:e.x)-(s?t.xo:t.x)},interpolate:function(e,t,n,s){let r,o,a,i,l,u,c;if(!s||s===this)return r=e.xo-t.xo,o=e.xo-n.xo,l=t.x-t.xo,u=n.x-n.xo,a=Math.abs(r),i=Math.abs(o),c=a+i,0===c?void(e.x=e.xo+(l+u)/2):void(e.x=e.xo+(l*i+u*a)/c);r=s.distance(e,t,!0,!0),o=s.distance(e,n,!0,!0),l=s.distance(t,t,!1,!0),u=s.distance(n,n,!1,!0),a=Math.abs(r),i=Math.abs(o),c=a+i,0!==c?Cr.setRelative(e,e,(l*i+u*a)/c,s,!0):Cr.setRelative(e,e,(l+u)/2,s,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,n,s,r){if(!s||s===this)return void(e.x=(r?t.xo:t.x)+n);const o=r?t.xo:t.x,a=r?t.yo:t.y,i=o+n*s.x,l=a+n*s.y;e.x=i+(e.y-l)/s.normalSlope},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},Er={x:0,y:1,axis:"y",distance:function(e,t,n,s){return(n?e.yo:e.y)-(s?t.yo:t.y)},interpolate:function(e,t,n,s){let r,o,a,i,l,u,c;if(!s||s===this)return r=e.yo-t.yo,o=e.yo-n.yo,l=t.y-t.yo,u=n.y-n.yo,a=Math.abs(r),i=Math.abs(o),c=a+i,0===c?void(e.y=e.yo+(l+u)/2):void(e.y=e.yo+(l*i+u*a)/c);r=s.distance(e,t,!0,!0),o=s.distance(e,n,!0,!0),l=s.distance(t,t,!1,!0),u=s.distance(n,n,!1,!0),a=Math.abs(r),i=Math.abs(o),c=a+i,0!==c?Er.setRelative(e,e,(l*i+u*a)/c,s,!0):Er.setRelative(e,e,(l+u)/2,s,!0)},normalSlope:0,setRelative:function(e,t,n,s,r){if(!s||s===this)return void(e.y=(r?t.yo:t.y)+n);const o=r?t.xo:t.x,a=r?t.yo:t.y,i=o+n*s.x,l=a+n*s.y;e.y=l+s.normalSlope*(e.x-i)},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};function Dr(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}function Mr(e,t){const n=Math.sqrt(e*e+t*t);return t/=n,1===(e/=n)&&0===t?Cr:0===e&&1===t?Er:new Dr(e,t)}function Fr(e,t,n,s){this.x=this.xo=Math.round(64*e)/64,this.y=this.yo=Math.round(64*t)/64,this.lastPointOfContour=n,this.onCurve=s,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Object.freeze(Cr),Object.freeze(Er),Dr.prototype.distance=function(e,t,n,s){return this.x*Cr.distance(e,t,n,s)+this.y*Er.distance(e,t,n,s)},Dr.prototype.interpolate=function(e,t,n,s){let r,o,a,i,l,u,c;a=s.distance(e,t,!0,!0),i=s.distance(e,n,!0,!0),r=s.distance(t,t,!1,!0),o=s.distance(n,n,!1,!0),l=Math.abs(a),u=Math.abs(i),c=l+u,0!==c?this.setRelative(e,e,(r*u+o*l)/c,s,!0):this.setRelative(e,e,(r+o)/2,s,!0)},Dr.prototype.setRelative=function(e,t,n,s,r){s=s||this;const o=r?t.xo:t.x,a=r?t.yo:t.y,i=o+n*s.x,l=a+n*s.y,u=s.normalSlope,c=this.slope,p=e.x,h=e.y;e.x=(c*p-u*i+l-h)/(c-u),e.y=c*(e.x-p)+h},Dr.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0},Fr.prototype.nextTouched=function(e){let t=this.nextPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},Fr.prototype.prevTouched=function(e){let t=this.prevPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var Ar=Object.freeze(new Fr(0,0)),Nr={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function Pr(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=Cr,this.round=kr}}function Br(e){const t=e.tZone=new Array(e.gZone.length);for(let e=0;e<t.length;e++)t[e]=new Fr(0,0)}function Gr(e,t){const n=e.prog;let s,r=e.ip,o=1;do{if(s=n[++r],88===s)o++;else if(89===s)o--;else if(64===s)r+=n[r+1]+1;else if(65===s)r+=2*n[r+1]+1;else if(s>=176&&s<=183)r+=s-176+1;else if(s>=184&&s<=191)r+=2*(s-184+1);else if(t&&1===o&&27===s)break}while(o>0);e.ip=r}function _r(e,t){t.fv=t.pv=t.dpv=e}function Hr(e,t){t.pv=t.dpv=e}function Vr(e,t){t.fv=e}function zr(e,t){const n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],a=t.z1[r];let i,l;e?(i=o.y-a.y,l=a.x-o.x):(i=a.x-o.x,l=a.y-o.y),t.pv=t.dpv=Mr(i,l)}function qr(e,t){const n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],a=t.z1[r];let i,l;e?(i=o.y-a.y,l=a.x-o.x):(i=a.x-o.x,l=a.y-o.y),t.fv=Mr(i,l)}function jr(e){e.stack.pop()}function Wr(e,t){const n=t.stack.pop(),s=t.z0[n],r=t.fv,o=t.pv;let a=o.distance(s,Ar);e&&(a=t.round(a)),r.setRelative(s,Ar,a,o),r.touch(s),t.rp0=t.rp1=n}function $r(e,t){const n=t.z2,s=n.length-2;let r,o,a;for(let t=0;t<s;t++)r=n[t],e.touched(r)||(o=r.prevTouched(e),o!==r&&(a=r.nextTouched(e),o===a&&e.setRelative(r,r,e.distance(o,o,!1,!0),e,!0),e.interpolate(r,o,a,e)))}function Xr(e,t){const n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,a=t.pv;let i=t.loop;const l=t.z2;for(;i--;){const e=l[n.pop()],t=a.distance(r,r,!1,!0);o.setRelative(e,e,t,a),o.touch(e)}t.loop=1}function Yr(e,t){const n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,a=t.pv,i=n.pop(),l=t.z2[t.contours[i]];let u=l;const c=a.distance(r,r,!1,!0);do{u!==r&&o.setRelative(u,u,c,a),u=u.nextPointOnContour}while(u!==l)}function Zr(e,t){const n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,a=t.pv;let i,l;switch(n.pop()){case 0:i=t.tZone;break;case 1:i=t.gZone;break;default:throw new Error("Invalid zone")}const u=a.distance(r,r,!1,!0),c=i.length-2;for(let e=0;e<c;e++)l=i[e],o.setRelative(l,l,u,a)}function Qr(e,t){const n=t.stack,s=n.pop()/64,r=n.pop(),o=t.z1[r],a=t.z0[t.rp0],i=t.fv,l=t.pv;i.setRelative(o,a,s,l),i.touch(o),t.rp1=t.rp0,t.rp2=r,e&&(t.rp0=r)}function Kr(e,t){const n=t.stack,s=n.pop(),r=n.pop(),o=t.z0[r],a=t.fv,i=t.pv;let l=t.cvt[s];let u=i.distance(o,Ar);e&&(Math.abs(u-l)<t.cvCutIn&&(u=l),u=t.round(u)),a.setRelative(o,Ar,u,i),0===t.zp0&&(o.xo=o.x,o.yo=o.y),a.touch(o),t.rp0=t.rp1=r}function Jr(e,t){const n=t.stack,s=n.pop(),r=t.z2[s];n.push(64*t.dpv.distance(r,Ar,e,!1))}function eo(e,t){const n=t.stack,s=n.pop(),r=n.pop(),o=t.z1[s],a=t.z0[r],i=t.dpv.distance(a,o,e,e);t.stack.push(Math.round(64*i))}function to(e,t){const n=t.stack,s=n.pop(),r=t.fv,o=t.pv,a=t.ppem,i=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;for(let e=0;e<s;e++){const e=n.pop(),t=n.pop();if(i+((240&t)>>4)!==a)continue;let s=(15&t)-8;s>=0&&s++;const c=u[e];r.setRelative(c,c,s*l,o)}}function no(e,t){const n=t.stack,s=n.pop();n.push(64*t.round(s/64))}function so(e,t){const n=t.stack,s=n.pop(),r=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;for(let e=0;e<s;e++){const e=n.pop(),s=n.pop();if(o+((240&s)>>4)!==r)continue;let i=(15&s)-8;i>=0&&i++;const l=i*a;0,t.cvt[e]+=l}}function ro(e,t){const n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],a=t.z1[r];let i,l;e?(i=o.y-a.y,l=a.x-o.x):(i=a.x-o.x,l=a.y-o.y),t.dpv=Mr(i,l)}function oo(e,t){const n=t.stack,s=t.prog;let r=t.ip;for(let t=0;t<e;t++)n.push(s[++r]);t.ip=r}function ao(e,t){let n=t.ip;const s=t.prog,r=t.stack;for(let t=0;t<e;t++){let e=s[++n]<<8|s[++n];32768&e&&(e=-(1+(65535^e))),r.push(e)}t.ip=n}function io(e,t,n,s,r,o){const a=o.stack,i=e&&a.pop(),l=a.pop(),u=o.rp0,c=o.z0[u],p=o.z1[l],h=o.minDis,f=o.fv,d=o.dpv;let g,m,y,v;m=g=d.distance(p,c,!0,!0),y=m>=0?1:-1,m=Math.abs(m),e&&(v=o.cvt[i],s&&Math.abs(m-v)<o.cvCutIn&&(m=v)),n&&m<h&&(m=h),s&&(m=o.round(m)),f.setRelative(p,c,y*m,d),f.touch(p),o.rp1=o.rp0,o.rp2=l,t&&(o.rp0=l)}Tr.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(this._errorState>2)return;const n=this.font;let s=this._prepState;if(!s||s.ppem!==t){let e=this._fpgmState;if(!e){Pr.prototype=Nr,e=this._fpgmState=new Pr("fpgm",n.tables.fpgm),e.funcs=[],e.font=n;try{mr(e)}catch(e){return console.log("Hinting error in FPGM:"+e),void(this._errorState=3)}}Pr.prototype=e,s=this._prepState=new Pr("prep",n.tables.prep),s.ppem=t;const r=n.variation&&n.variation.process.getCvarTransform()||n.tables.cvt;if(r){const e=s.cvt=new Array(r.length),o=t/n.unitsPerEm;for(let t=0;t<r.length;t++)e[t]=r[t]*o}else s.cvt=[];0;try{mr(s)}catch(e){this._errorState<2&&console.log("Hinting error in PREP:"+e),this._errorState=2}}if(!(this._errorState>1))try{return yr(e,s)}catch(e){return this._errorState<1&&(console.log("Hinting error:"+e),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}},yr=function(e,t){const n=t.ppem/t.font.unitsPerEm,s=n;let r,o,a,i=e.components;if(Pr.prototype=t,i){const l=t.font;o=[],r=[];for(let e=0;e<i.length;e++){const t=i[e],u=l.glyphs.get(t.glyphIndex);a=new Pr("glyf",u.instructions),vr(u,a,n,s);const c=Math.round(t.dx*n),p=Math.round(t.dy*s),h=a.gZone,f=a.contours;for(let e=0;e<h.length;e++){const t=h[e];t.xTouched=t.yTouched=!1,t.xo=t.x=t.x+c,t.yo=t.y=t.y+p}const d=o.length;o.push.apply(o,h);for(let e=0;e<f.length;e++)r.push(f[e]+d)}e.instructions&&!a.inhibitGridFit&&(a=new Pr("glyf",e.instructions),a.gZone=a.z0=a.z1=a.z2=o,a.contours=r,o.push(new Fr(0,0),new Fr(Math.round(e.advanceWidth*n),0)),mr(a),o.length-=2)}else a=new Pr("glyf",e.instructions),vr(e,a,n,s),o=a.gZone;return o},vr=function(e,t,n,s){const r=e.points||[],o=r.length,a=t.gZone=t.z0=t.z1=t.z2=[],i=t.contours=[];let l,u,c;for(let e=0;e<o;e++)l=r[e],a[e]=new Fr(l.x*n,l.y*s,l.lastPointOfContour,l.onCurve);for(let e=0;e<o;e++)l=a[e],u||(u=l,i.push(e)),l.lastPointOfContour?(l.nextPointOnContour=u,u.prevPointOnContour=l,u=void 0):(c=a[e+1],l.nextPointOnContour=c,c.prevPointOnContour=l);t.inhibitGridFit||(a.push(new Fr(0,0),new Fr(Math.round(e.advanceWidth*n),0)),mr(t),a.length-=2)},mr=function(e){let t=e.prog;if(!t)return;const n=t.length;let s;for(e.ip=0;e.ip<n;e.ip++){if(s=gr[t[e.ip]],!s)throw new Error("unknown instruction: 0x"+Number(t[e.ip]).toString(16));s(e)}},gr=[_r.bind(void 0,Er),_r.bind(void 0,Cr),Hr.bind(void 0,Er),Hr.bind(void 0,Cr),Vr.bind(void 0,Er),Vr.bind(void 0,Cr),zr.bind(void 0,0),zr.bind(void 0,1),qr.bind(void 0,0),qr.bind(void 0,1),function(e){const t=e.stack,n=t.pop(),s=t.pop();e.pv=e.dpv=Mr(s,n)},function(e){const t=e.stack,n=t.pop(),s=t.pop();e.fv=Mr(s,n)},function(e){const t=e.stack,n=e.pv;t.push(16384*n.x),t.push(16384*n.y)},function(e){const t=e.stack,n=e.fv;t.push(16384*n.x),t.push(16384*n.y)},function(e){e.fv=e.pv},function(e){const t=e.stack,n=t.pop(),s=t.pop(),r=t.pop(),o=t.pop(),a=t.pop(),i=e.z0,l=e.z1,u=i[n],c=i[s],p=l[r],h=l[o],f=e.z2[a],d=u.x,g=u.y,m=c.x,y=c.y,v=p.x,b=p.y,S=h.x,x=h.y,T=(d-m)*(b-x)-(g-y)*(v-S),O=d*y-g*m,k=v*x-b*S;f.x=(O*(v-S)-k*(d-m))/T,f.y=(O*(b-x)-k*(g-y))/T},function(e){e.rp0=e.stack.pop()},function(e){e.rp1=e.stack.pop()},function(e){e.rp2=e.stack.pop()},function(e){const t=e.stack.pop();switch(e.zp0=t,t){case 0:e.tZone||Br(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){const t=e.stack.pop();switch(e.zp1=t,t){case 0:e.tZone||Br(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){const t=e.stack.pop();switch(e.zp2=t,t){case 0:e.tZone||Br(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){const t=e.stack.pop();switch(e.zp0=e.zp1=e.zp2=t,t){case 0:e.tZone||Br(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){e.loop=e.stack.pop()},function(e){e.round=kr},function(e){e.round=Ir},function(e){const t=e.stack.pop();e.minDis=t/64},function(e){Gr(e,!1)},function(e){const t=e.stack.pop();e.ip+=t-1},function(e){const t=e.stack.pop();e.cvCutIn=t/64},void 0,void 0,function(e){const t=e.stack;t.push(t[t.length-1])},jr,function(e){e.stack.length=0},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(n),t.push(s)},function(e){const t=e.stack;t.push(t.length)},function(e){const t=e.stack,n=t.pop();t.push(t[t.length-n])},function(e){const t=e.stack,n=t.pop();t.push(t.splice(t.length-n,1)[0])},void 0,void 0,void 0,function(e){const t=e.stack,n=t.pop(),s=t.pop(),r=e.ip,o=e.prog;e.prog=e.funcs[n];for(let t=0;t<s;t++)mr(e);e.ip=r,e.prog=o},function(e){const t=e.stack.pop(),n=e.ip,s=e.prog;e.prog=e.funcs[t],mr(e),e.ip=n,e.prog=s},function(e){if("fpgm"!==e.env)throw new Error("FDEF not allowed here");const t=e.stack,n=e.prog;let s=e.ip;const r=t.pop(),o=s;for(0;45!==n[++s];);e.ip=s,e.funcs[r]=n.slice(o+1,s)},void 0,Wr.bind(void 0,0),Wr.bind(void 0,1),$r.bind(void 0,Er),$r.bind(void 0,Cr),Xr.bind(void 0,0),Xr.bind(void 0,1),Yr.bind(void 0,0),Yr.bind(void 0,1),Zr.bind(void 0,0),Zr.bind(void 0,1),function(e){const t=e.stack;let n=e.loop;const s=e.fv,r=t.pop()/64,o=e.z2;for(;n--;){const e=o[t.pop()];0,s.setRelative(e,e,r),s.touch(e)}e.loop=1},function(e){const t=e.stack,n=e.rp1,s=e.rp2;let r=e.loop;const o=e.z0[n],a=e.z1[s],i=e.fv,l=e.dpv,u=e.z2;for(;r--;){const e=u[t.pop()];0,i.interpolate(e,o,a,l),i.touch(e)}e.loop=1},Qr.bind(void 0,0),Qr.bind(void 0,1),function(e){const t=e.stack,n=e.rp0,s=e.z0[n];let r=e.loop;const o=e.fv,a=e.pv,i=e.z1;for(;r--;){const e=i[t.pop()];0,o.setRelative(e,s,0,a),o.touch(e)}e.loop=1},function(e){e.round=wr},Kr.bind(void 0,0),Kr.bind(void 0,1),function(e){const t=e.prog;let n=e.ip;const s=e.stack,r=t[++n];for(let e=0;e<r;e++)s.push(t[++n]);e.ip=n},function(e){let t=e.ip;const n=e.prog,s=e.stack,r=n[++t];for(let e=0;e<r;e++){let e=n[++t]<<8|n[++t];32768&e&&(e=-(1+(65535^e))),s.push(e)}e.ip=t},function(e){const t=e.stack;let n=e.store;n||(n=e.store=[]);const s=t.pop();n[t.pop()]=s},function(e){const t=e.stack,n=e.store,s=t.pop(),r=n&&n[s]||0;t.push(r)},function(e){const t=e.stack,n=t.pop(),s=t.pop();e.cvt[s]=n/64},function(e){const t=e.stack,n=t.pop();t.push(64*e.cvt[n])},Jr.bind(void 0,0),Jr.bind(void 0,1),void 0,eo.bind(void 0,0),eo.bind(void 0,1),function(e){e.stack.push(e.ppem)},void 0,function(e){e.autoFlip=!0},void 0,void 0,function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s<n?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s<=n?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s>n?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s>=n?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(n===s?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(n!==s?1:0)},function(e){const t=e.stack,n=t.pop();t.push(1&Math.trunc(n)?1:0)},function(e){const t=e.stack,n=t.pop();t.push(1&Math.trunc(n)?0:1)},function(e){e.stack.pop()||Gr(e,!0)},function(e){0},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(n&&s?1:0)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(n||s?1:0)},function(e){const t=e.stack,n=t.pop();t.push(n?0:1)},to.bind(void 0,1),function(e){const t=e.stack.pop();e.deltaBase=t},function(e){const t=e.stack.pop();e.deltaShift=Math.pow(.5,t)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s+n)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s-n)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(64*s/n)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(s*n/64)},function(e){const t=e.stack,n=t.pop();t.push(Math.abs(n))},function(e){const t=e.stack;let n=t.pop();t.push(-n)},function(e){const t=e.stack,n=t.pop();t.push(64*Math.floor(n/64))},function(e){const t=e.stack,n=t.pop();t.push(64*Math.ceil(n/64))},no.bind(void 0,0),no.bind(void 0,1),no.bind(void 0,2),no.bind(void 0,3),void 0,void 0,void 0,void 0,function(e){const t=e.stack,n=t.pop(),s=t.pop();e.cvt[s]=n*e.ppem/e.font.unitsPerEm},to.bind(void 0,2),to.bind(void 0,3),so.bind(void 0,1),so.bind(void 0,2),so.bind(void 0,3),function(e){let t,n=e.stack.pop();switch(e.round=Lr,192&n){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=t,48&n){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*t},function(e){let t,n=e.stack.pop();switch(e.round=Lr,192&n){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(e.srPeriod=t,48&n){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*t},void 0,void 0,function(e){e.round=Or},void 0,function(e){e.round=Rr},function(e){e.round=Ur},jr,jr,void 0,void 0,void 0,void 0,void 0,function(e){e.stack.pop()},ro.bind(void 0,0),ro.bind(void 0,1),function(e){const t=e.stack,n=t.pop();let s=0;1&n&&(s=35),32&n&&(s|=4096),t.push(s)},void 0,function(e){const t=e.stack,n=t.pop(),s=t.pop(),r=t.pop();t.push(s),t.push(n),t.push(r)},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(Math.max(s,n))},function(e){const t=e.stack,n=t.pop(),s=t.pop();t.push(Math.min(s,n))},function(e){e.stack.pop()},function(e){const t=e.stack.pop();let n=e.stack.pop();switch(t){case 1:return void(e.inhibitGridFit=!!n);case 2:return void(e.ignoreCvt=!!n);default:throw new Error("invalid INSTCTRL[] selector")}},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,oo.bind(void 0,1),oo.bind(void 0,2),oo.bind(void 0,3),oo.bind(void 0,4),oo.bind(void 0,5),oo.bind(void 0,6),oo.bind(void 0,7),oo.bind(void 0,8),ao.bind(void 0,1),ao.bind(void 0,2),ao.bind(void 0,3),ao.bind(void 0,4),ao.bind(void 0,5),ao.bind(void 0,6),ao.bind(void 0,7),ao.bind(void 0,8),io.bind(void 0,0,0,0,0,0),io.bind(void 0,0,0,0,0,1),io.bind(void 0,0,0,0,0,2),io.bind(void 0,0,0,0,0,3),io.bind(void 0,0,0,0,1,0),io.bind(void 0,0,0,0,1,1),io.bind(void 0,0,0,0,1,2),io.bind(void 0,0,0,0,1,3),io.bind(void 0,0,0,1,0,0),io.bind(void 0,0,0,1,0,1),io.bind(void 0,0,0,1,0,2),io.bind(void 0,0,0,1,0,3),io.bind(void 0,0,0,1,1,0),io.bind(void 0,0,0,1,1,1),io.bind(void 0,0,0,1,1,2),io.bind(void 0,0,0,1,1,3),io.bind(void 0,0,1,0,0,0),io.bind(void 0,0,1,0,0,1),io.bind(void 0,0,1,0,0,2),io.bind(void 0,0,1,0,0,3),io.bind(void 0,0,1,0,1,0),io.bind(void 0,0,1,0,1,1),io.bind(void 0,0,1,0,1,2),io.bind(void 0,0,1,0,1,3),io.bind(void 0,0,1,1,0,0),io.bind(void 0,0,1,1,0,1),io.bind(void 0,0,1,1,0,2),io.bind(void 0,0,1,1,0,3),io.bind(void 0,0,1,1,1,0),io.bind(void 0,0,1,1,1,1),io.bind(void 0,0,1,1,1,2),io.bind(void 0,0,1,1,1,3),io.bind(void 0,1,0,0,0,0),io.bind(void 0,1,0,0,0,1),io.bind(void 0,1,0,0,0,2),io.bind(void 0,1,0,0,0,3),io.bind(void 0,1,0,0,1,0),io.bind(void 0,1,0,0,1,1),io.bind(void 0,1,0,0,1,2),io.bind(void 0,1,0,0,1,3),io.bind(void 0,1,0,1,0,0),io.bind(void 0,1,0,1,0,1),io.bind(void 0,1,0,1,0,2),io.bind(void 0,1,0,1,0,3),io.bind(void 0,1,0,1,1,0),io.bind(void 0,1,0,1,1,1),io.bind(void 0,1,0,1,1,2),io.bind(void 0,1,0,1,1,3),io.bind(void 0,1,1,0,0,0),io.bind(void 0,1,1,0,0,1),io.bind(void 0,1,1,0,0,2),io.bind(void 0,1,1,0,0,3),io.bind(void 0,1,1,0,1,0),io.bind(void 0,1,1,0,1,1),io.bind(void 0,1,1,0,1,2),io.bind(void 0,1,1,0,1,3),io.bind(void 0,1,1,1,0,0),io.bind(void 0,1,1,1,0,1),io.bind(void 0,1,1,1,0,2),io.bind(void 0,1,1,1,0,3),io.bind(void 0,1,1,1,1,0),io.bind(void 0,1,1,1,1,1),io.bind(void 0,1,1,1,1,2),io.bind(void 0,1,1,1,1,3)];var lo=Tr;function uo(e){this.char=e,this.state={},this.activeState=null}function co(e,t,n){this.contextName=n,this.startIndex=e,this.endOffset=t}function po(e,t,n){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=t,this.checkEnd=n}function ho(e,t){this.context=e,this.index=t,this.length=e.length,this.current=e[t],this.backtrack=e.slice(0,t),this.lookahead=e.slice(t+1)}function fo(e){this.eventId=e,this.subscribers=[]}function go(e){const t=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];for(let e=0;e<t.length;e++){const n=t[e];Object.defineProperty(this.events,n,{value:new fo(n)})}if(e)for(let n=0;n<t.length;n++){const s=t[n],r=e[s];"function"==typeof r&&this.events[s].subscribe(r)}const n=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];for(let e=0;e<n.length;e++){const t=n[e];this.events[t].subscribe(this.updateContextsRanges)}}function mo(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],go.call(this,e)}uo.prototype.setState=function(e,t){return this.state[e]=t,this.activeState={key:e,value:this.state[e]},this.activeState},uo.prototype.getState=function(e){return this.state[e]||null},mo.prototype.inboundIndex=function(e){return e>=0&&e<this.tokens.length},mo.prototype.composeRUD=function(e){const t=e.map((e=>this[e[0]].apply(this,e.slice(1).concat(true)))),n=e=>"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"FAIL");if(t.every(n))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:t.filter(n)};this.dispatch("composeRUD",[t.filter((e=>!n(e)))])},mo.prototype.replaceRange=function(e,t,n,s){t=null!==t?t:this.tokens.length;const r=n.every((e=>e instanceof uo));if(!isNaN(e)&&this.inboundIndex(e)&&r){const r=this.tokens.splice.apply(this.tokens,[e,t].concat(n));return s||this.dispatch("replaceToken",[e,t,n]),[r,n]}return{FAIL:"replaceRange: invalid tokens or startIndex."}},mo.prototype.replaceToken=function(e,t,n){if(!isNaN(e)&&this.inboundIndex(e)&&t instanceof uo){const s=this.tokens.splice(e,1,t);return n||this.dispatch("replaceToken",[e,t]),[s[0],t]}return{FAIL:"replaceToken: invalid token or index."}},mo.prototype.removeRange=function(e,t,n){t=isNaN(t)?this.tokens.length:t;const s=this.tokens.splice(e,t);return n||this.dispatch("removeRange",[s,e,t]),s},mo.prototype.removeToken=function(e,t){if(!isNaN(e)&&this.inboundIndex(e)){const n=this.tokens.splice(e,1);return t||this.dispatch("removeToken",[n,e]),n}return{FAIL:"removeToken: invalid token index."}},mo.prototype.insertToken=function(e,t,n){return e.every((e=>e instanceof uo))?(this.tokens.splice.apply(this.tokens,[t,0].concat(e)),n||this.dispatch("insertToken",[e,t]),e):{FAIL:"insertToken: invalid token(s)."}},mo.prototype.registerModifier=function(e,t,n){this.events.newToken.subscribe((function(s,r){const o=[s,r],a=[s,r];if(null===t||!0===t.apply(this,o)){let t=n.apply(this,a);s.setState(e,t)}})),this.registeredModifiers.push(e)},fo.prototype.subscribe=function(e){return"function"==typeof e?this.subscribers.push(e)-1:{FAIL:`invalid '${this.eventId}' event handler`}},fo.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)},ho.prototype.setCurrentIndex=function(e){this.index=e,this.current=this.context[e],this.backtrack=this.context.slice(0,e),this.lookahead=this.context.slice(e+1)},ho.prototype.get=function(e){switch(!0){case 0===e:return this.current;case e<0&&Math.abs(e)<=this.backtrack.length:return this.backtrack.slice(e)[0];case e>0&&e<=this.lookahead.length:return this.lookahead[e-1];default:return null}},mo.prototype.rangeToText=function(e){if(e instanceof co)return this.getRangeTokens(e).map((e=>e.char)).join("")},mo.prototype.getText=function(){return this.tokens.map((e=>e.char)).join("")},mo.prototype.getContext=function(e){let t=this.registeredContexts[e];return t||null},mo.prototype.on=function(e,t){const n=this.events[e];return n?n.subscribe(t):null},mo.prototype.dispatch=function(e,t){const n=this.events[e];if(n instanceof fo)for(let e=0;e<n.subscribers.length;e++){n.subscribers[e].apply(this,t||[])}},mo.prototype.registerContextChecker=function(e,t,n){if(this.getContext(e))return{FAIL:`context name '${e}' is already registered.`};if("function"!=typeof t)return{FAIL:"missing context start check."};if("function"!=typeof n)return{FAIL:"missing context end check."};const s=new po(e,t,n);return this.registeredContexts[e]=s,this.contextCheckers.push(s),s},mo.prototype.getRangeTokens=function(e){const t=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,t))},mo.prototype.getContextRanges=function(e){const t=this.getContext(e);return t?t.ranges:{FAIL:`context checker '${e}' is not registered.`}},mo.prototype.resetContextsRanges=function(){const e=this.registeredContexts;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){e[t].ranges=[]}},mo.prototype.updateContextsRanges=function(){this.resetContextsRanges();const e=this.tokens.map((e=>e.char));for(let t=0;t<e.length;t++){const n=new ho(e,t);this.runContextCheck(n)}this.dispatch("updateContextsRanges",[this.registeredContexts])},mo.prototype.setEndOffset=function(e,t){let n=new co(this.getContext(t).openRange.startIndex,e,t);const s=this.getContext(t).ranges;return n.rangeId=`${t}.${s.length}`,s.push(n),this.getContext(t).openRange=null,n},mo.prototype.runContextCheck=function(e){const t=e.index;for(let n=0;n<this.contextCheckers.length;n++){const s=this.contextCheckers[n];let r=s.contextName,o=this.getContext(r).openRange;if(!o&&s.checkStart(e)&&(o=new co(t,null,r),this.getContext(r).openRange=o,this.dispatch("contextStart",[r,t])),o&&s.checkEnd(e)){const e=t-o.startIndex+1,n=this.setEndOffset(e,r);this.dispatch("contextEnd",[r,n])}}},mo.prototype.tokenize=function(e){this.tokens=[],this.resetContextsRanges();let t=Array.from(e);this.dispatch("start");for(let e=0;e<t.length;e++){const n=t[e],s=new ho(t,e);this.dispatch("next",[s]),this.runContextCheck(s);let r=new uo(n);this.tokens.push(r),this.dispatch("newToken",[r,s])}return this.dispatch("end",[this.tokens]),this.tokens};var yo=mo;function vo(e){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e)}function bo(e){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(e)}function So(e){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e)}function xo(e){return/[\u0E00-\u0E7F]/.test(e)}function To(e){return/[A-z]/.test(e)}function Oo(e){this.font=e,this.features={}}function ko(e){this.id=e.id,this.tag=e.tag,this.substitution=e.substitution}function wo(e,t){if(!e)return-1;switch(t.format){case 1:return t.glyphs.indexOf(e);case 2:{let n=t.ranges;for(let t=0;t<n.length;t++){const s=n[t];if(e>=s.start&&e<=s.end){let t=e-s.start;return s.index+t}}break}default:return-1}return-1}function Io(e,t){return-1===wo(e,t.coverage)?null:e+t.deltaGlyphId}function Ro(e,t){let n=wo(e,t.coverage);return-1===n?null:t.substitute[n]}function Uo(e,t){let n=[];for(let s=0;s<e.length;s++){const r=e[s];let o=t.current;o=Array.isArray(o)?o[0]:o;const a=wo(o,r);-1!==a&&n.push(a)}return n.length!==e.length?-1:n}function Lo(e,t){const n=t.inputCoverage.length+t.lookaheadCoverage.length+t.backtrackCoverage.length;if(e.context.length<n)return[];let s=Uo(t.inputCoverage,e);if(-1===s)return[];const r=t.inputCoverage.length-1;if(e.lookahead.length<t.lookaheadCoverage.length)return[];let o=e.lookahead.slice(r);for(;o.length&&So(o[0].char);)o.shift();const a=new ho(o,0);let i=Uo(t.lookaheadCoverage,a),l=[].concat(e.backtrack);for(l.reverse();l.length&&So(l[0].char);)l.shift();if(l.length<t.backtrackCoverage.length)return[];const u=new ho(l,0);let c=Uo(t.backtrackCoverage,u);let p=[];if(s.length===t.inputCoverage.length&&i.length===t.lookaheadCoverage.length&&c.length===t.backtrackCoverage.length)for(let n=0;n<t.lookupRecords.length;n++){const r=t.lookupRecords[n].lookupListIndex,o=this.getLookupByIndex(r);for(let t=0;t<o.subtables.length;t++){let n,r=o.subtables[t],a=this.getSubstitutionType(o,r);if("71"===a?(a=this.getSubstitutionType(r,r.extension),n=this.getLookupMethod(r,r.extension),r=r.extension):n=this.getLookupMethod(o,r),"12"!==a)throw new Error(`Substitution type ${a} is not supported in chaining substitution`);for(let t=0;t<s.length;t++){const s=n(e.get(t));s&&p.push(s)}}}return p}function Co(e,t){let n,s=wo(e.current,t.coverage);if(-1===s)return null;let r=t.ligatureSets[s];for(let t=0;t<r.length;t++){n=r[t];for(let t=0;t<n.components.length;t++){if(e.lookahead[t]!==n.components[t])break;if(t===n.components.length-1)return n}}return null}function Eo(e,t){let n=e.current;if(-1===wo(n,t.coverage))return null;for(const s of t.ruleSets)for(const t of s){let s=!0;for(let n=0;n<t.input.length;n++)if(e.lookahead[n]!==t.input[n]){s=!1;break}if(s){let e=[];e.push(n);for(let n=0;n<t.input.length;n++)e.push(t.input[n]);const s=(e,t)=>{const{lookupListIndex:n,sequenceIndex:s}=t,{subtables:r}=this.getLookupByIndex(n);for(const t of r){-1!==wo(e[s],t.coverage)&&(e[s]=t.deltaGlyphId)}};for(let n=0;n<t.lookupRecords.length;n++){s(e,t.lookupRecords[n])}return e}}return null}function Do(e,t){let n=[];for(let s=0;s<t.coverages.length;s++){const r=t.lookupRecords[s],o=t.coverages[s];let a=e.context[e.index+r.sequenceIndex];if(-1===wo(a,o))return null;let i=this.font.tables.gsub.lookups[r.lookupListIndex];for(let e=0;e<i.subtables.length;e++){let t=i.subtables[e],s=wo(a,t.coverage);if(-1===s)return null;switch(i.lookupType){case 1:{let e=t.substitute[s];n.push(e);break}case 2:{let e=t.sequences[s];n.push(e);break}}}}return n}function Mo(e,t){let n=wo(e,t.coverage);return-1===n?null:t.sequences[n]}Oo.prototype.getDefaultScriptFeaturesIndexes=function(){const e=this.font.tables.gsub.scripts;for(let t=0;t<e.length;t++){const n=e[t];if("DFLT"===n.tag)return n.script.defaultLangSys.featureIndexes}return[]},Oo.prototype.getScriptFeaturesIndexes=function(e){if(!this.font.tables.gsub)return[];if(!e)return this.getDefaultScriptFeaturesIndexes();const t=this.font.tables.gsub.scripts;for(let n=0;n<t.length;n++){const s=t[n];if(s.tag===e&&s.script.defaultLangSys)return s.script.defaultLangSys.featureIndexes;{let t=s.langSysRecords;if(t)for(let n=0;n<t.length;n++){const s=t[n];if(s.tag===e){return s.langSys.featureIndexes}}}}return this.getDefaultScriptFeaturesIndexes()},Oo.prototype.mapTagsToFeatures=function(e,t){let n={};for(let t=0;t<e.length;t++){const s=e[t].tag,r=e[t].feature;n[s]=r}this.features[t].tags=n},Oo.prototype.getScriptFeatures=function(e){let t=this.features[e];if(Object.prototype.hasOwnProperty.call(this.features,e))return t;const n=this.getScriptFeaturesIndexes(e);if(!n)return null;const s=this.font.tables.gsub;return t=n.map((e=>s.features[e])),this.features[e]=t,this.mapTagsToFeatures(t,e),t},Oo.prototype.getSubstitutionType=function(e,t){return e.lookupType.toString()+t.substFormat.toString()},Oo.prototype.getLookupMethod=function(e,t){let n=this.getSubstitutionType(e,t);switch(n){case"11":return e=>Io.apply(this,[e,t]);case"12":return e=>Ro.apply(this,[e,t]);case"63":return e=>Lo.apply(this,[e,t]);case"41":return e=>Co.apply(this,[e,t]);case"21":return e=>Mo.apply(this,[e,t]);case"51":return e=>Eo.apply(this,[e,t]);case"53":return e=>Do.apply(this,[e,t]);default:throw new Error(`substitutionType : ${n} lookupType: ${e.lookupType} - substFormat: ${t.substFormat} is not yet supported`)}},Oo.prototype.lookupFeature=function(e){let t=e.contextParams,n=t.index;const s=this.getFeature({tag:e.tag,script:e.script});if(!s)return new Error(`font '${(this.font.names.unicode||this.font.names.windows||this.font.names.macintosh).fullName.en}' doesn't support feature '${e.tag}' for script '${e.script}'.`);const r=this.getFeatureLookups(s),o=[].concat(t.context);for(let s=0;s<r.length;s++){const a=r[s],i=this.getLookupSubtables(a);for(let s=0;s<i.length;s++){let r,l,u=i[s],c=this.getSubstitutionType(a,u);switch("71"===c?(c=this.getSubstitutionType(u,u.extension),r=this.getLookupMethod(u,u.extension),u=u.extension):r=this.getLookupMethod(a,u),c){case"11":l=r(t.current),l&&o.splice(n,1,new ko({id:11,tag:e.tag,substitution:l}));break;case"12":l=r(t.current),l&&o.splice(n,1,new ko({id:12,tag:e.tag,substitution:l}));break;case"63":l=r(t),Array.isArray(l)&&l.length&&o.splice(n,1,new ko({id:63,tag:e.tag,substitution:l}));break;case"41":l=r(t),l&&o.splice(n,1,new ko({id:41,tag:e.tag,substitution:l}));break;case"21":l=r(t.current),l&&o.splice(n,1,new ko({id:21,tag:e.tag,substitution:l}));break;case"51":case"53":l=r(t),Array.isArray(l)&&l.length&&o.splice(n,1,new ko({id:parseInt(c),tag:e.tag,substitution:l}))}t=new ho(o,n),Array.isArray(l)&&!l.length||(l=null)}}return o.length?o:null},Oo.prototype.supports=function(e){if(!e.script)return!1;this.getScriptFeatures(e.script);const t=Object.prototype.hasOwnProperty.call(this.features,e.script);if(!e.tag)return t;const n=this.features[e.script].some((t=>t.tag===e.tag));return t&&n},Oo.prototype.getLookupSubtables=function(e){return e.subtables||null},Oo.prototype.getLookupByIndex=function(e){return this.font.tables.gsub.lookups[e]||null},Oo.prototype.getFeatureLookups=function(e){return e.lookupListIndexes.map(this.getLookupByIndex.bind(this))},Oo.prototype.getFeature=function(e){if(!this.font)return{FAIL:"No font was found"};Object.prototype.hasOwnProperty.call(this.features,e.script)||this.getScriptFeatures(e.script);const 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}`}};var Fo=Oo;var Ao={startCheck:function(e){const t=e.current,n=e.get(-1);return null===n&&vo(t)||!vo(n)&&vo(t)},endCheck:function(e){const t=e.get(1);return null===t||!vo(t)}};var No={startCheck:function(e){const t=e.current,n=e.get(-1);return(vo(t)||So(t))&&!vo(n)},endCheck:function(e){const t=e.get(1);switch(!0){case null===t:return!0;case!vo(t)&&!So(t):{const n=/\s/.test(t);if(!n)return!0;if(n){let t=!1;if(t=e.lookahead.some((e=>vo(e)||So(e))),!t)return!0}break}default:return!1}}};function Po(e,t,n){for(let s=0;s<e.substitution.length;s++){const r=e.substitution[s],o=t[n+s];Array.isArray(r)?r.length?o.setState(e.tag,r[0]):o.setState("deleted",!0):o.setState(e.tag,r)}}var Bo={11:function(e,t,n){t[n].setState(e.tag,e.substitution)},12:function(e,t,n){t[n].setState(e.tag,e.substitution)},63:Po,41:function(e,t,n){let s=t[n];s.setState(e.tag,e.substitution.ligGlyph);const r=e.substitution.components.length;for(let e=0;e<r;e++)s=t[n+e+1],s.setState("deleted",!0)},51:Po,53:Po};var Go=function(e,t,n){e instanceof ko&&Bo[e.id]&&Bo[e.id](e,t,n)};function _o(e){let t=[].concat(e.backtrack);for(let e=t.length-1;e>=0;e--){const n=t[e],s=bo(n),r=So(n);if(!s&&!r)return!0;if(s)return!1}return!1}function Ho(e){if(bo(e.current))return!1;for(let t=0;t<e.lookahead.length;t++){if(!So(e.lookahead[t]))return!0}return!1}var Vo=function(e){const t="arab",n=this.featuresTags[t],s=this.tokenizer.getRangeTokens(e);if(1===s.length)return;let r=new ho(s.map((e=>e.getState("glyphIndex"))),0);const o=new ho(s.map((e=>e.char)),0);for(let e=0;e<s.length;e++){if(So(s[e].char))continue;r.setCurrentIndex(e),o.setCurrentIndex(e);let a,i=0;switch(_o(o)&&(i|=1),Ho(o)&&(i|=2),i){case 1:a="fina";break;case 2:a="init";break;case 3:a="medi"}if(-1===n.indexOf(a))continue;let l=this.query.lookupFeature({tag:a,script:t,contextParams:r});if(l instanceof Error)console.info(l.message);else for(let e=0;e<l.length;e++){const t=l[e];t instanceof ko&&(Go(t,s,e),r.context[e]=t.substitution)}}};function zo(e,t){return new ho(e.map((e=>e.activeState.value)),t||0)}var qo=function(e){let t=this.tokenizer.getRangeTokens(e),n=zo(t);for(let e=0;e<n.context.length;e++){n.setCurrentIndex(e);let s=this.query.lookupFeature({tag:"rlig",script:"arab",contextParams:n});if(s.length){for(let n=0;n<s.length;n++){const r=s[n];Go(r,t,e)}n=zo(t)}}};var jo={startCheck:function(e){return 0===e.index&&e.context.length>1},endCheck:function(e){return e.index===e.context.length-1}};function Wo(e,t){return new ho(e.map((e=>e.activeState.value)),t||0)}var $o=function(e){const t="delf",n="ccmp";let s=this.tokenizer.getRangeTokens(e),r=Wo(s);for(let e=0;e<r.context.length;e++){if(!this.query.getFeature({tag:n,script:t,contextParams:r}))continue;r.setCurrentIndex(e);let o=this.query.lookupFeature({tag:n,script:t,contextParams:r});if(o.length){for(let t=0;t<o.length;t++){const n=o[t];Go(n,s,e)}r=Wo(s)}}};var Xo={startCheck:function(e){const t=e.current,n=e.get(-1);return null===n&&To(t)||!To(n)&&To(t)},endCheck:function(e){const t=e.get(1);return null===t||!To(t)}};function Yo(e,t){return new ho(e.map((e=>e.activeState.value)),t||0)}var Zo=function(e){let t=this.tokenizer.getRangeTokens(e),n=Yo(t);for(let e=0;e<n.context.length;e++){n.setCurrentIndex(e);let s=this.query.lookupFeature({tag:"liga",script:"latn",contextParams:n});if(s.length){for(let n=0;n<s.length;n++){const r=s[n];Go(r,t,e)}n=Yo(t)}}};var Qo={startCheck:function(e){const t=e.current,n=e.get(-1);return null===n&&xo(t)||!xo(n)&&xo(t)},endCheck:function(e){const t=e.get(1);return null===t||!xo(t)}};function Ko(e,t){return new ho(e.map((e=>e.activeState.value)),t||0)}var Jo=function(e){let t=this.tokenizer.getRangeTokens(e),n=Ko(t,0);for(let e=0;e<n.context.length;e++){n.setCurrentIndex(e);let s=this.query.lookupFeature({tag:"ccmp",script:"thai",contextParams:n});if(s.length){for(let n=0;n<s.length;n++){const r=s[n];Go(r,t,e)}n=Ko(t,e)}}};function ea(e,t){return new ho(e.map((e=>e.activeState.value)),t||0)}var ta=function(e){let t=this.tokenizer.getRangeTokens(e),n=ea(t,0);for(let e=0;e<n.context.length;e++){n.setCurrentIndex(e);let s=this.query.lookupFeature({tag:"liga",script:"thai",contextParams:n});if(s.length){for(let n=0;n<s.length;n++){const r=s[n];Go(r,t,e)}n=ea(t,e)}}};function na(e,t){return new ho(e.map((e=>e.activeState.value)),t||0)}var sa=function(e){let t=this.tokenizer.getRangeTokens(e),n=na(t,0);for(let e=0;e<n.context.length;e++){n.setCurrentIndex(e);let s=this.query.lookupFeature({tag:"rlig",script:"thai",contextParams:n});if(s.length){for(let n=0;n<s.length;n++){const r=s[n];Go(r,t,e)}n=na(t,e)}}};function ra(e){if(null===e)return!1;const t=e.codePointAt(0);return t>=6155&&t<=6157||t>=65024&&t<=65039||t>=917760&&t<=917999}var oa={startCheck:function(e){const t=e.current,n=e.get(1);return null===n&&ra(t)||ra(n)},endCheck:function(e){const t=e.get(1);return null===t||!ra(t)}};var aa=function(e){const t=this.query.font,n=this.tokenizer.getRangeTokens(e);if(n[1].setState("deleted",!0),t.tables.cmap&&t.tables.cmap.varSelectorList){const e=n[0].char.codePointAt(0),s=n[1].char.codePointAt(0),r=t.tables.cmap.varSelectorList[s];if(void 0!==r&&r.nonDefaultUVS){const s=r.nonDefaultUVS.uvsMappings;if(s[e]){const r=s[e].glyphID;void 0!==t.glyphs.glyphs[r]&&n[0].setState("glyphIndex",r)}}}};function ia(e){this.baseDir=e||"ltr",this.tokenizer=new yo,this.featuresTags={}}function la(e){const t=this.contextChecks[`${e}Check`];return this.tokenizer.registerContextChecker(e,t.startCheck,t.endCheck)}function ua(){return la.call(this,"ccmpReplacement"),la.call(this,"latinWord"),la.call(this,"arabicWord"),la.call(this,"arabicSentence"),la.call(this,"thaiWord"),la.call(this,"unicodeVariationSequence"),this.tokenizer.tokenize(this.text)}function ca(){const e=this.tokenizer.getContextRanges("arabicSentence");for(let t=0;t<e.length;t++){const n=e[t];let s=this.tokenizer.getRangeTokens(n);this.tokenizer.replaceRange(n.startIndex,n.endOffset,s.reverse())}}function pa(){if(-1===this.tokenizer.registeredModifiers.indexOf("glyphIndex"))throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function ha(){if(!Object.prototype.hasOwnProperty.call(this.featuresTags,"arab"))return;pa.call(this);const e=this.tokenizer.getContextRanges("arabicWord");for(let t=0;t<e.length;t++){const n=e[t];Vo.call(this,n)}}function fa(){pa.call(this);const e=this.tokenizer.getContextRanges("ccmpReplacement");for(let t=0;t<e.length;t++){const n=e[t];$o.call(this,n)}}function da(){if(!this.hasFeatureEnabled("arab","rlig"))return;pa.call(this);const e=this.tokenizer.getContextRanges("arabicWord");for(let t=0;t<e.length;t++){const n=e[t];qo.call(this,n)}}function ga(){if(!this.hasFeatureEnabled("latn","liga"))return;pa.call(this);const e=this.tokenizer.getContextRanges("latinWord");for(let t=0;t<e.length;t++){const n=e[t];Zo.call(this,n)}}function ma(){const e=this.tokenizer.getContextRanges("unicodeVariationSequence");for(let t=0;t<e.length;t++){const n=e[t];aa.call(this,n)}}function ya(){pa.call(this);const e=this.tokenizer.getContextRanges("thaiWord");for(let t=0;t<e.length;t++){const n=e[t];this.hasFeatureEnabled("thai","liga")&&ta.call(this,n),this.hasFeatureEnabled("thai","rlig")&&sa.call(this,n),this.hasFeatureEnabled("thai","ccmp")&&Jo.call(this,n)}}ia.prototype.setText=function(e){this.text=e},ia.prototype.contextChecks={ccmpReplacementCheck:jo,latinWordCheck:Xo,arabicWordCheck:Ao,arabicSentenceCheck:No,thaiWordCheck:Qo,unicodeVariationSequenceCheck:oa},ia.prototype.registerFeatures=function(e,t){const n=t.filter((t=>this.query.supports({script:e,tag:t})));Object.prototype.hasOwnProperty.call(this.featuresTags,e)?this.featuresTags[e]=this.featuresTags[e].concat(n):this.featuresTags[e]=n},ia.prototype.applyFeatures=function(e,t){if(!e)throw new Error("No valid font was provided to apply features");this.query||(this.query=new Fo(e));for(let e=0;e<t.length;e++){const n=t[e];this.query.supports({script:n.script})&&this.registerFeatures(n.script,n.tags)}},ia.prototype.registerModifier=function(e,t,n){this.tokenizer.registerModifier(e,t,n)},ia.prototype.checkContextReady=function(e){return!!this.tokenizer.getContext(e)},ia.prototype.applyFeaturesToContexts=function(){this.checkContextReady("ccmpReplacement")&&fa.call(this),this.checkContextReady("arabicWord")&&(ha.call(this),da.call(this)),this.checkContextReady("latinWord")&&ga.call(this),this.checkContextReady("arabicSentence")&&ca.call(this),this.checkContextReady("thaiWord")&&ya.call(this),this.checkContextReady("unicodeVariationSequence")&&ma.call(this)},ia.prototype.hasFeatureEnabled=function(e,t){return-1!==(this.featuresTags[e]||[]).indexOf(t)},ia.prototype.processText=function(e){this.text&&this.text===e||(this.setText(e),ua.call(this),this.applyFeaturesToContexts())},ia.prototype.getBidiText=function(e){return this.processText(e),this.tokenizer.getText()},ia.prototype.getTextGlyphs=function(e){this.processText(e);let t=[];for(let e=0;e<this.tokenizer.tokens.length;e++){const n=this.tokenizer.tokens[e];if(n.state.deleted)continue;const s=n.activeState.value;t.push(Array.isArray(s)?s[0]:s)}return t};var va=ia;function ba(e){return{fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||(e.familyName+e.styleName).replace(/\s/g,"")},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}}}function Sa(e){if((e=e||{}).tables=e.tables||{},!e.empty){if(!e.familyName)throw"When creating a new Font object, familyName is required.";if(!e.styleName)throw"When creating a new Font object, styleName is required.";if(!e.unitsPerEm)throw"When creating a new Font object, unitsPerEm is required.";if(!e.ascender)throw"When creating a new Font object, ascender is required.";if(e.descender>0)throw"When creating a new Font object, negative descender value is required.";this.names={},this.names.unicode=ba(e),this.names.macintosh=ba(e),this.names.windows=ba(e),this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.italicAngle=e.italicAngle||0,this.weightClass=e.weightClass||0;let t=0;e.fsSelection?t=e.fsSelection:(this.italicAngle<0?t|=this.fsSelectionValues.ITALIC:this.italicAngle>0&&(t|=this.fsSelectionValues.OBLIQUE),this.weightClass>=600&&(t|=this.fsSelectionValues.BOLD),0==t&&(t=this.fsSelectionValues.REGULAR)),e.panose&&Array.isArray(e.panose)||(e.panose=[0,0,0,0,0,0,0,0,0]),this.tables=Object.assign(e.tables,{os2:Object.assign({usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,bFamilyType:e.panose[0]||0,bSerifStyle:e.panose[1]||0,bWeight:e.panose[2]||0,bProportion:e.panose[3]||0,bContrast:e.panose[4]||0,bStrokeVariation:e.panose[5]||0,bArmStyle:e.panose[6]||0,bLetterform:e.panose[7]||0,bMidline:e.panose[8]||0,bXHeight:e.panose[9]||0,fsSelection:t},e.tables.os2)})}this.supported=!0,this.glyphs=new Fn.GlyphSet(this,e.glyphs||[]),this.encoding=new yn(this),this.position=new Qs(this),this.substitution=new rr(this),this.tables=this.tables||{},this.tables=new Proxy(this.tables,{set:(e,t,n)=>(e[t]=n,e.fvar&&(e.gvar||e.cff2)&&!this.variation&&(this.variation=new xr(this)),!0)}),this.palettes=new or(this),this.layers=new ar(this),this.svgImages=new ir(this),this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new lo(this):null}})}Sa.prototype.hasChar=function(e){return this.encoding.charToGlyphIndex(e)>0},Sa.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},Sa.prototype.charToGlyph=function(e){const t=this.charToGlyphIndex(e);let n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},Sa.prototype.updateFeatures=function(e){return this.defaultRenderOptions.features.map((t=>"latn"===t.script?{script:"latn",tags:t.tags.filter((t=>e[t]))}:t))},Sa.prototype.stringToGlyphIndexes=function(e,t){const n=new va;n.registerModifier("glyphIndex",null,(e=>this.charToGlyphIndex(e.char)));let s=t?this.updateFeatures(t.features):this.defaultRenderOptions.features;return n.applyFeatures(this,s),n.getTextGlyphs(e)},Sa.prototype.stringToGlyphs=function(e,t){const n=this.stringToGlyphIndexes(e,t);let s=n.length;const r=new Array(s),o=this.glyphs.get(0);for(let e=0;e<s;e+=1)r[e]=this.glyphs.get(n[e])||o;return r},Sa.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},Sa.prototype.nameToGlyph=function(e){const t=this.nameToGlyphIndex(e);let n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},Sa.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},Sa.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;const n=this.position.defaultKerningTables;return n?this.position.getKerningValue(n,e,t):this.kerningPairs[e+","+t]||0},Sa.prototype.defaultRenderOptions={kerning:!0,features:[{script:"arab",tags:["init","medi","fina","rlig"]},{script:"latn",tags:["liga","rlig"]},{script:"thai",tags:["liga","rlig","ccmp"]}],hinting:!1,usePalette:0,drawLayers:!0,drawSVG:!0},Sa.prototype.forEachGlyph=function(e,t,n,s,r,o){t=void 0!==t?t:0,n=void 0!==n?n:0,s=void 0!==s?s:72,r=Object.assign({},this.defaultRenderOptions,r);const a=1/this.unitsPerEm*s,i=this.stringToGlyphs(e,r);let l;if(r.kerning){const e=r.script||this.position.getDefaultScriptName();l=this.position.getKerningTables(e,r.language)}for(let e=0;e<i.length;e+=1){const u=i[e];if(o.call(this,u,t,n,s,r),u.advanceWidth&&(t+=u.advanceWidth*a),r.kerning&&e<i.length-1){t+=(l?this.position.getKerningValue(l,u.index,i[e+1].index):this.getKerningValue(u,i[e+1]))*a}r.letterSpacing?t+=r.letterSpacing*s:r.tracking&&(t+=r.tracking/1e3*s)}return t},Sa.prototype.getPath=function(e,t,n,s,r){r=Object.assign({},this.defaultRenderOptions,r);const o=new Xe;if(o._layers=[],Kn(this,o),o.stroke){const e=1/(o.unitsPerEm||1e3)*s;o.strokeWidth*=e}return this.forEachGlyph(e,t,n,s,r,((e,t,n,s)=>{const a=e.getPath(t,n,s,r,this);if(r.drawSVG||r.drawLayers){const e=a._layers;if(e&&e.length){for(let t=0;t<e.length;t++){const n=e[t];o._layers.push(n)}return}}o.extend(a)})),o},Sa.prototype.getPaths=function(e,t,n,s,r){r=Object.assign({},this.defaultRenderOptions,r);const o=[];return this.forEachGlyph(e,t,n,s,r,(function(e,t,n,s){const a=e.getPath(t,n,s,r,this);o.push(a)})),o},Sa.prototype.getAdvanceWidth=function(e,t,n){return n=Object.assign({},this.defaultRenderOptions,n),this.forEachGlyph(e,0,0,t,n,(function(){}))},Sa.prototype.draw=function(e,t,n,s,r,o){this.getPath(t,n,s,r,o).draw(e)},Sa.prototype.drawPoints=function(e,t,n,s,r,o){o=Object.assign({},this.defaultRenderOptions,o),this.forEachGlyph(t,n,s,r,o,(function(t,n,s,r){t.drawPoints(e,n,s,r,o,this)}))},Sa.prototype.drawMetrics=function(e,t,n,s,r,o){o=Object.assign({},this.defaultRenderOptions,o),this.forEachGlyph(t,n,s,r,o,(function(t,n,s,r){t.drawMetrics(e,n,s,r)}))},Sa.prototype.getEnglishName=function(e){const t=(this.names.unicode||this.names.macintosh||this.names.windows)[e];if(t)return t.en},Sa.prototype.validate=function(){const e=[],t=this;function n(t,n){t||(console.warn(`[opentype.js] ${n}`),e.push(n))}function s(e){const s=t.getEnglishName(e);n(s&&s.trim().length>0,"No English "+e+" specified.")}if(s("fontFamily"),s("weightName"),s("manufacturer"),s("copyright"),s("version"),n(this.unitsPerEm>0,"No unitsPerEm specified."),this.tables.colr){const e=this.tables.colr.baseGlyphRecords;let t=-1;for(let s=0;s<e.length;s++){const r=e[s].glyphID;if(n(t<e[s].glyphID,`baseGlyphs must be sorted by GlyphID in ascending order, but glyphID ${r} comes after ${t}`),t>e[s].glyphID)break;t=r}}return e},Sa.prototype.toTables=function(){return qs.fontToTable(this)},Sa.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},Sa.prototype.toArrayBuffer=function(){const e=this.toTables().encode(),t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let t=0;t<e.length;t++)n[t]=e[t];return t},Sa.prototype.download=function(){console.error("DEPRECATED: platform-specific actions are to be implemented on user-side")},Sa.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},Sa.prototype.macStyleValues={BOLD:1,ITALIC:2,UNDERLINE:4,OUTLINED:8,SHADOW:16,CONDENSED:32,EXTENDED:64},Sa.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},Sa.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var xa=Sa;var Ta={make:function(){console.warn("Writing of hvar tables is not yet supported.")},parse:function(e,t){const n=new qt.Parser(e,t),s=n.parseUShort(),r=n.parseUShort();return 1!==s&&console.warn(`Unsupported hvar table version ${s}.${r}`),{version:[s,r],itemVariationStore:n.parsePointer32((function(){return this.parseItemVariationStore()})),advanceWidth:n.parsePointer32((function(){return this.parseDeltaSetIndexMap()})),lsb:n.parsePointer32((function(){return this.parseDeltaSetIndexMap()})),rsb:n.parsePointer32((function(){return this.parseDeltaSetIndexMap()}))}}},Oa=function(){return{coverage:this.parsePointer(Vt.coverage),attachPoints:this.parseList(Vt.pointer(Vt.uShortList))}},ka=function(){var e=this.parseUShort();return Qe.argument(1===e||2===e||3===e,"Unsupported CaretValue table version."),1===e?{coordinate:this.parseShort()}:2===e?{pointindex:this.parseShort()}:3===e?{coordinate:this.parseShort()}:void 0},wa=function(){return this.parseList(Vt.pointer(ka))},Ia=function(){return{coverage:this.parsePointer(Vt.coverage),ligGlyphs:this.parseList(Vt.pointer(wa))}},Ra=function(){return this.parseUShort(),this.parseList(Vt.pointer(Vt.coverage))};var Ua={parse:function(e,t){const n=new Vt(e,t=t||0),s=n.parseVersion(1);Qe.argument(1===s||1.2===s||1.3===s,"Unsupported GDEF table version.");var r={version:s,classDef:n.parsePointer(Vt.classDef),attachList:n.parsePointer(Oa),ligCaretList:n.parsePointer(Ia),markAttachClassDef:n.parsePointer(Vt.classDef)};return s>=1.2&&(r.markGlyphSets=n.parsePointer(Ra)),r}},La=new Array(10);La[1]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{posFormat:1,coverage:this.parsePointer(Vt.coverage),value:this.parseValueRecord()}:2===t?{posFormat:2,coverage:this.parsePointer(Vt.coverage),values:this.parseValueRecordList()}:void Qe.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},La[2]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();Qe.assert(1===t||2===t,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");const n=this.parsePointer(Vt.coverage),s=this.parseUShort(),r=this.parseUShort();if(1===t)return{posFormat:t,coverage:n,valueFormat1:s,valueFormat2:r,pairSets:this.parseList(Vt.pointer(Vt.list((function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(s),value2:this.parseValueRecord(r)}}))))};if(2===t){const e=this.parsePointer(Vt.classDef),o=this.parsePointer(Vt.classDef),a=this.parseUShort(),i=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:s,valueFormat2:r,classDef1:e,classDef2:o,class1Count:a,class2Count:i,classRecords:this.parseList(a,Vt.list(i,(function(){return{value1:this.parseValueRecord(s),value2:this.parseValueRecord(r)}})))}}},La[3]=function(){return{error:"GPOS Lookup 3 not supported"}},La[4]=function(){return{error:"GPOS Lookup 4 not supported"}},La[5]=function(){return{error:"GPOS Lookup 5 not supported"}},La[6]=function(){return{error:"GPOS Lookup 6 not supported"}},La[7]=function(){return{error:"GPOS Lookup 7 not supported"}},La[8]=function(){return{error:"GPOS Lookup 8 not supported"}},La[9]=function(){return{error:"GPOS Lookup 9 not supported"}};var Ca=new Array(10);var Ea={parse:function(e,t){const n=new Vt(e,t=t||0),s=n.parseVersion(1);return Qe.argument(1===s||1.1===s,"Unsupported GPOS table version "+s),1===s?{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(La)}:{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(La),variations:n.parseFeatureVariationsList()}},make:function(e){return new St.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new St.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new St.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new St.LookupList(e.lookups,Ca)}])}};var Da={parse:function(e,t){const n=new qt.Parser(e,t),s=n.parseUShort();if(0===s)return function(e){const t={};e.skip("uShort");const n=e.parseUShort();Qe.argument(0===n,"Unsupported kern sub-table version."),e.skip("uShort",2);const s=e.parseUShort();e.skip("uShort",3);for(let n=0;n<s;n+=1){const n=e.parseUShort(),s=e.parseUShort(),r=e.parseShort();t[n+","+s]=r}return t}(n);if(1===s)return function(e){const t={};e.skip("uShort"),e.parseULong()>1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");const n=255&e.parseUShort();if(e.skip("uShort"),0===n){const n=e.parseUShort();e.skip("uShort",3);for(let s=0;s<n;s+=1){const n=e.parseUShort(),s=e.parseUShort(),r=e.parseShort();t[n+","+s]=r}}return t}(n);throw new Error("Unsupported kern table version ("+s+").")}};var Ma={parse:function(e,t,n,s){const r=new qt.Parser(e,t),o=s?r.parseUShort:r.parseULong,a=[];for(let e=0;e<n+1;e+=1){let e=o.call(r);s&&(e*=2),a.push(e)}return a}};function Fa(e,t){const n=[];let s=12;for(let r=0;r<t;r+=1){const t=qt.getTag(e,s),r=qt.getULong(e,s+4),o=qt.getULong(e,s+8),a=qt.getULong(e,s+12);n.push({tag:t,checksum:r,offset:o,length:a,compression:!1}),s+=16}return n}function Aa(e,t){if("WOFF"===t.compression){const n=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),s=new Uint8Array(t.length);if(_e(n,s),s.byteLength!==t.length)throw new Error("Decompression error: "+t.tag+" decompressed length doesn't match recorded length");return{data:new DataView(s.buffer,0),offset:0}}return{data:e,offset:t.offset}}function Na(e,t={}){let n,s;const r=new xa({empty:!0});e.constructor!==ArrayBuffer&&(e=new Uint8Array(e).buffer);const o=new DataView(e,0);let a,i=[];const l=qt.getTag(o,0);if(l===String.fromCharCode(0,1,0,0)||"true"===l||"typ1"===l)r.outlinesFormat="truetype",a=qt.getUShort(o,4),i=Fa(o,a);else if("OTTO"===l)r.outlinesFormat="cff",a=qt.getUShort(o,4),i=Fa(o,a);else{if("wOFF"!==l){if("wOF2"===l){throw new Error("WOFF2 require an external decompressor library, see examples at: https://github.com/opentypejs/opentype.js/issues/183#issuecomment-1147228025")}throw new Error("Unsupported OpenType signature "+l)}{const e=qt.getTag(o,4);if(e===String.fromCharCode(0,1,0,0))r.outlinesFormat="truetype";else{if("OTTO"!==e)throw new Error("Unsupported OpenType flavor "+l);r.outlinesFormat="cff"}a=qt.getUShort(o,12),i=function(e,t){const n=[];let s=44;for(let r=0;r<t;r+=1){const t=qt.getTag(e,s),r=qt.getULong(e,s+4),o=qt.getULong(e,s+8),a=qt.getULong(e,s+12);let i;i=o<a&&"WOFF",n.push({tag:t,offset:r,compression:i,compressedLength:o,length:a}),s+=20}return n}(o,a)}}let u,c,p,h,f,d,g,m,y,v,b,S,x,T,O,k,w,I;for(let e=0;e<a;e+=1){const t=i[e];let a;switch(t.tag){case"avar":g=t;break;case"cmap":a=Aa(o,t),r.tables.cmap=un.parse(a.data,a.offset),r.encoding=new vn(r.tables.cmap);break;case"cvt ":a=Aa(o,t),I=new qt.Parser(a.data,a.offset),r.tables.cvt=I.parseShortList(t.length/2);break;case"fvar":p=t;break;case"STAT":h=t;break;case"gvar":f=t;break;case"cvar":d=t;break;case"fpgm":a=Aa(o,t),I=new qt.Parser(a.data,a.offset),r.tables.fpgm=I.parseByteList(t.length);break;case"head":a=Aa(o,t),r.tables.head=is.parse(a.data,a.offset),r.unitsPerEm=r.tables.head.unitsPerEm,n=r.tables.head.indexToLocFormat;break;case"hhea":a=Aa(o,t),r.tables.hhea=ls.parse(a.data,a.offset),r.ascender=r.tables.hhea.ascender,r.descender=r.tables.hhea.descender,r.numberOfHMetrics=r.tables.hhea.numberOfHMetrics;break;case"HVAR":x=t;break;case"hmtx":S=t;break;case"ltag":a=Aa(o,t),s=cs.parse(a.data,a.offset);break;case"COLR":a=Aa(o,t),r.tables.colr=Ss.parse(a.data,a.offset);break;case"CPAL":a=Aa(o,t),r.tables.cpal=Ln.parse(a.data,a.offset);break;case"maxp":a=Aa(o,t),r.tables.maxp=ps.parse(a.data,a.offset),r.numGlyphs=r.tables.maxp.numGlyphs;break;case"name":k=t;break;case"OS/2":a=Aa(o,t),r.tables.os2=fs.parse(a.data,a.offset);break;case"post":a=Aa(o,t),r.tables.post=ds.parse(a.data,a.offset),r.glyphNames=new Sn(r.tables.post);break;case"prep":a=Aa(o,t),I=new qt.Parser(a.data,a.offset),r.tables.prep=I.parseByteList(t.length);break;case"glyf":m=t;break;case"loca":O=t;break;case"CFF ":u=t;break;case"CFF2":c=t;break;case"kern":T=t;break;case"GDEF":y=t;break;case"GPOS":v=t;break;case"GSUB":b=t;break;case"meta":w=t;break;case"gasp":try{a=Aa(o,t),r.tables.gasp=Ns.parse(a.data,a.offset)}catch(e){console.warn("Failed to parse gasp table, skipping."),console.warn(e)}break;case"SVG ":a=Aa(o,t),r.tables.svg=Ps.parse(a.data,a.offset)}}const R=Aa(o,k);if(r.tables.name=an.parse(R.data,R.offset,s),r.names=r.tables.name,m&&O){const e=0===n,s=Aa(o,O),a=Ma.parse(s.data,s.offset,r.numGlyphs,e),i=Aa(o,m);r.glyphs=br.parse(i.data,i.offset,a,r,t)}else if(u){const e=Aa(o,u);as.parse(e.data,e.offset,r,t)}else{if(!c)throw new Error("Font doesn't contain TrueType, CFF or CFF2 outlines.");{const e=Aa(o,c);as.parse(e.data,e.offset,r,t)}}const U=Aa(o,S);if(us.parse(r,U.data,U.offset,r.numberOfHMetrics,r.numGlyphs,r.glyphs,t),xn(r,t),T){const e=Aa(o,T);r.kerningPairs=Da.parse(e.data,e.offset)}else r.kerningPairs={};if(y){const e=Aa(o,y);r.tables.gdef=Ua.parse(e.data,e.offset)}if(v){const e=Aa(o,v);r.tables.gpos=Ea.parse(e.data,e.offset),r.position.init()}if(b){const e=Aa(o,b);r.tables.gsub=vs.parse(e.data,e.offset)}if(p){const e=Aa(o,p);r.tables.fvar=ks.parse(e.data,e.offset,r.names)}if(h){const e=Aa(o,h);r.tables.stat=Cs.parse(e.data,e.offset,r.tables.fvar)}if(f){p||console.warn("This font provides a gvar table, but no fvar table, which is required for variable fonts."),m||console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");const e=Aa(o,f);r.tables.gvar=As.parse(e.data,e.offset,r.tables.fvar,r.glyphs)}if(d){p||console.warn("This font provides a cvar table, but no fvar table, which is required for variable fonts."),r.tables.cvt||console.warn("This font provides a cvar table, but no cvt table which could be made variable."),m||console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");const e=Aa(o,d);r.tables.cvar=Fs.parse(e.data,e.offset,r.tables.fvar,r.tables.cvt||[])}if(g){p||console.warn("This font provides an avar table, but no fvar table, which is required for variable fonts.");const e=Aa(o,g);r.tables.avar=Ms.parse(e.data,e.offset,r.tables.fvar)}if(x){p||console.warn("This font provides an HVAR table, but no fvar table, which is required for variable fonts."),S||console.warn("This font provides an HVAR table, but no hmtx table to vary.");const e=Aa(o,x);r.tables.hvar=Ta.parse(e.data,e.offset,r.tables.fvar)}if(w){const e=Aa(o,w);r.tables.meta=bs.parse(e.data,e.offset),r.metas=r.tables.meta}return r.palettes=new or(r),r}const Pa=Symbol(),Ba=Symbol(),Ga=Symbol(),_a=Symbol();function Ha(){this[Ba]=new Map,this[Ga]=new Map}Object.assign(Ha.prototype,{getDefaultFontStyle(){return this[Pa]=new be(this.getPrivateScene()),this[Pa].setPrivate(!0),this[Pa].setup(),this.getDefaultFontStyle=function(){return this[Pa]},Object.defineProperty(this,"getDefaultFontStyle",{enumerable:!1}),this[Pa]},getFont(e,t=!0){e=String(e);let n=this[Ba].get(e);return n||this[Ba].set(e,n=new Promise((async(n,s)=>{try{const s=await fetch(e,{cache:t?"default":"reload"});if(!s.ok)throw new Error(s.statusText||s.status);const r=e.includes(".woff2")?await this.getWaWoff2():e=>e,o=r(await s.arrayBuffer());n(Na(o))}catch(e){s(e)}}))),n},getGlyph(e,t,n){let s=this[Ga].get(e);s||this[Ga].set(e,s=[]);let r=s[t];r||(r=s[t]=[]);let o=r[n];return o||(o=r[n]={}),o},getWaWoff2(){return this[_a]??=this.loadWaWoff2()},async loadWaWoff2(){const e=T().getLibraryURL("decompress_binding.js"),t=await fetch(e);if(!t.ok)throw new Error(t.statusText||t.status);const n=await t.text(),s=new Function(n)();return await new Promise((e=>s.onRuntimeInitialized=e)),e=>s.decompress(e)}});const Va=Ha,za=g().add("X3DTextContext",Va),qa=e.X3DGeometryNode;var ja=t.n(qa);const Wa=e.X3DCast;var $a=t.n(Wa);function Xa(e){ja().call(this,e),this.addType(S().Text),this._length.setUnit("length"),this._maxExtent.setUnit("length"),this._origin.setUnit("length"),this._textBounds.setUnit("length"),this._lineBounds.setUnit("length")}Object.assign(Object.setPrototypeOf(Xa.prototype,ja().prototype),{initialize(){ja().prototype.initialize.call(this),this._fontStyle.addInterest("set_fontStyle__",this),this.set_fontStyle__()},getMatrix(){return this.textGeometry.getMatrix()},getLength(e){return e<this._length.length?Math.max(0,this._length[e]):0},set_live__(){ja().prototype.set_live__.call(this);const e=this.getBrowser(),t=this.isLive()&&e.getBrowserOption("AlwaysUpdateGeometries");this.getLive().getValue()||t?(e.getBrowserOptions()._PrimitiveQuality.addInterest("requestRebuild",this),e.getBrowserOptions()._TextCompression.addInterest("requestRebuild",this)):(e.getBrowserOptions()._PrimitiveQuality.removeInterest("requestRebuild",this),e.getBrowserOptions()._TextCompression.removeInterest("requestRebuild",this))},set_fontStyle__(){this.fontStyleNode?.removeInterest("requestRebuild",this),this.fontStyleNode=$a()(S().X3DFontStyleNode,this._fontStyle)??this.getBrowser().getDefaultFontStyle(),this.fontStyleNode.addInterest("requestRebuild",this),this.textGeometry=this.fontStyleNode.getTextGeometry(this)},build(){this.textGeometry.update(),this.textGeometry.build(),this.setSolid(this._solid.getValue())},traverse(e,t){this.textGeometry.traverse(e,t),ja().prototype.traverse.call(this,e,t)},displaySimple(e,t,n){this.textGeometry.displaySimple(e,t,n),ja().prototype.displaySimple.call(this,e,t,n)},display(e,t){this.textGeometry.display(e,t),ja().prototype.display.call(this,e,t),t.textureNode=null},transformLine(e){return this.textGeometry.transformLine(e)},transformMatrix(e){return this.textGeometry.transformMatrix(e)}}),Object.defineProperties(Xa,{...p().getStaticProperties("Text","Text",1,"geometry","2.0"),fieldDefinitions:{value:new(u())([new(i())(S().inputOutput,"metadata",new(o().SFNode)),new(i())(S().inputOutput,"string",new(o().MFString)),new(i())(S().inputOutput,"length",new(o().MFFloat)),new(i())(S().inputOutput,"maxExtent",new(o().SFFloat)),new(i())(S().initializeOnly,"solid",new(o().SFBool)),new(i())(S().outputOnly,"origin",new(o().SFVec3f)),new(i())(S().outputOnly,"textBounds",new(o().SFVec2f)),new(i())(S().outputOnly,"lineBounds",new(o().MFVec2f)),new(i())(S().inputOutput,"fontStyle",new(o().SFNode))]),enumerable:!0}});const Ya=Xa,Za=g().add("Text",Ya);s().add({name:"Text",concreteNodes:[be,Za],abstractNodes:[I],browserContext:za});g().add("TextComponent",undefined)})();