@spiffcommerce/core 44.5.3 → 44.5.4
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.
- package/CHANGELOG.md +6 -0
- package/dist/{index-qO9SfRol.cjs → index-CIPNLGSC.cjs} +6 -6
- package/dist/{index-qO9SfRol.cjs.map → index-CIPNLGSC.cjs.map} +1 -1
- package/dist/{index-BlxJMR8G.js → index-eG04Hkm8.js} +218 -243
- package/dist/{index-BlxJMR8G.js.map → index-eG04Hkm8.js.map} +1 -1
- package/dist/{index.browser-yJCSzfNu.js → index.browser-CyPdlEqr.js} +2 -2
- package/dist/{index.browser-yJCSzfNu.js.map → index.browser-CyPdlEqr.js.map} +1 -1
- package/dist/{index.browser-DvWaDnsa.cjs → index.browser-HO1knCEY.cjs} +2 -2
- package/dist/{index.browser-DvWaDnsa.cjs.map → index.browser-HO1knCEY.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1745,7 +1745,7 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${D.byteLength}`),D.tiff&&
|
|
|
1745
1745
|
}
|
|
1746
1746
|
}
|
|
1747
1747
|
`;var dd={exports:{}},pl={exports:{}},iM=pl.exports,EC;function aM(){return EC||(EC=1,(function(){var r,e,t,n,i,a;typeof performance<"u"&&performance!==null&&performance.now?pl.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(pl.exports=function(){return(r()-i)/1e6},e=process.hrtime,r=function(){var s;return s=e(),s[0]*1e9+s[1]},n=r(),a=process.uptime()*1e9,i=n-a):Date.now?(pl.exports=function(){return Date.now()-t},t=Date.now()):(pl.exports=function(){return new Date().getTime()-t},t=new Date().getTime())}).call(iM)),pl.exports}var kC;function sM(){if(kC)return dd.exports;kC=1;for(var r=aM(),e=typeof window>"u"?di:window,t=["moz","webkit"],n="AnimationFrame",i=e["request"+n],a=e["cancel"+n]||e["cancelRequest"+n],s=0;!i&&s<t.length;s++)i=e[t[s]+"Request"+n],a=e[t[s]+"Cancel"+n]||e[t[s]+"CancelRequest"+n];if(!i||!a){var o=0,l=0,u=[],c=1e3/60;i=function(f){if(u.length===0){var d=r(),h=Math.max(0,c-(d-o));o=h+d,setTimeout(function(){var g=u.slice(0);u.length=0;for(var v=0;v<g.length;v++)if(!g[v].cancelled)try{g[v].callback(o)}catch(y){setTimeout(function(){throw y},0)}},Math.round(h))}return u.push({handle:++l,callback:f,cancelled:!1}),l},a=function(f){for(var d=0;d<u.length;d++)u[d].handle===f&&(u[d].cancelled=!0)}}return dd.exports=function(f){return i.call(e,f)},dd.exports.cancel=function(){a.apply(e,arguments)},dd.exports.polyfill=function(f){f||(f=e),f.requestAnimationFrame=i,f.cancelAnimationFrame=a},dd.exports}var oM=sM();const w0=Ns(oM);var C0,TC;function lM(){return TC||(TC=1,C0=function(r){this.ok=!1,this.alpha=1,r.charAt(0)=="#"&&(r=r.substr(1,6)),r=r.replace(/ /g,""),r=r.toLowerCase();var e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};r=e[r]||r;for(var t=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(l){return[parseInt(l[1]),parseInt(l[2]),parseInt(l[3]),parseFloat(l[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(l){return[parseInt(l[1]),parseInt(l[2]),parseInt(l[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(l){return[parseInt(l[1],16),parseInt(l[2],16),parseInt(l[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(l){return[parseInt(l[1]+l[1],16),parseInt(l[2]+l[2],16),parseInt(l[3]+l[3],16)]}}],n=0;n<t.length;n++){var i=t[n].re,a=t[n].process,s=i.exec(r);if(s){var o=a(s);this.r=o[0],this.g=o[1],this.b=o[2],o.length>3&&(this.alpha=o[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var l=this.r.toString(16),u=this.g.toString(16),c=this.b.toString(16);return l.length==1&&(l="0"+l),u.length==1&&(u="0"+u),c.length==1&&(c="0"+c),"#"+l+u+c},this.getHelpXML=function(){for(var l=new Array,u=0;u<t.length;u++)for(var c=t[u].example,f=0;f<c.length;f++)l[l.length]=c[f];for(var d in e)l[l.length]=d;var h=document.createElement("ul");h.setAttribute("id","rgbcolor-examples");for(var u=0;u<l.length;u++)try{var g=document.createElement("li"),v=new RGBColor(l[u]),y=document.createElement("div");y.style.cssText="margin: 3px; border: 1px solid black; background:"+v.toHex()+"; color:"+v.toHex(),y.appendChild(document.createTextNode("test"));var A=document.createTextNode(" "+l[u]+" -> "+v.toRGB()+" -> "+v.toHex());g.appendChild(y),g.appendChild(A),h.appendChild(g)}catch{}return h}}),C0}var uM=lM();const Hy=Ns(uM);var AT=function(r,e){return(AT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(r,e)};function bT(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=r}AT(r,e),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function cM(r){var e="";Array.isArray(r)||(r=[r]);for(var t=0;t<r.length;t++){var n=r[t];if(n.type===Le.CLOSE_PATH)e+="z";else if(n.type===Le.HORIZ_LINE_TO)e+=(n.relative?"h":"H")+n.x;else if(n.type===Le.VERT_LINE_TO)e+=(n.relative?"v":"V")+n.y;else if(n.type===Le.MOVE_TO)e+=(n.relative?"m":"M")+n.x+" "+n.y;else if(n.type===Le.LINE_TO)e+=(n.relative?"l":"L")+n.x+" "+n.y;else if(n.type===Le.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+" "+n.y1+" "+n.x2+" "+n.y2+" "+n.x+" "+n.y;else if(n.type===Le.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+" "+n.y2+" "+n.x+" "+n.y;else if(n.type===Le.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+" "+n.y1+" "+n.x+" "+n.y;else if(n.type===Le.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+" "+n.y;else{if(n.type!==Le.ARC)throw new Error('Unexpected command type "'+n.type+'" at index '+t+".");e+=(n.relative?"a":"A")+n.rX+" "+n.rY+" "+n.xRot+" "+ +n.lArcFlag+" "+ +n.sweepFlag+" "+n.x+" "+n.y}}return e}function jy(r,e){var t=r[0],n=r[1];return[t*Math.cos(e)-n*Math.sin(e),t*Math.sin(e)+n*Math.cos(e)]}function ka(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];for(var t=0;t<r.length;t++)if(typeof r[t]!="number")throw new Error("assertNumbers arguments["+t+"] is not a number. "+typeof r[t]+" == typeof "+r[t]);return!0}var ao=Math.PI;function x0(r,e,t){r.lArcFlag=r.lArcFlag===0?0:1,r.sweepFlag=r.sweepFlag===0?0:1;var n=r.rX,i=r.rY,a=r.x,s=r.y;n=Math.abs(r.rX),i=Math.abs(r.rY);var o=jy([(e-a)/2,(t-s)/2],-r.xRot/180*ao),l=o[0],u=o[1],c=Math.pow(l,2)/Math.pow(n,2)+Math.pow(u,2)/Math.pow(i,2);1<c&&(n*=Math.sqrt(c),i*=Math.sqrt(c)),r.rX=n,r.rY=i;var f=Math.pow(n,2)*Math.pow(u,2)+Math.pow(i,2)*Math.pow(l,2),d=(r.lArcFlag!==r.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(i,2)-f)/f)),h=n*u/i*d,g=-i*l/n*d,v=jy([h,g],r.xRot/180*ao);r.cX=v[0]+(e+a)/2,r.cY=v[1]+(t+s)/2,r.phi1=Math.atan2((u-g)/i,(l-h)/n),r.phi2=Math.atan2((-u-g)/i,(-l-h)/n),r.sweepFlag===0&&r.phi2>r.phi1&&(r.phi2-=2*ao),r.sweepFlag===1&&r.phi2<r.phi1&&(r.phi2+=2*ao),r.phi1*=180/ao,r.phi2*=180/ao}function FC(r,e,t){ka(r,e,t);var n=r*r+e*e-t*t;if(0>n)return[];if(n===0)return[[r*t/(r*r+e*e),e*t/(r*r+e*e)]];var i=Math.sqrt(n);return[[(r*t+e*i)/(r*r+e*e),(e*t-r*i)/(r*r+e*e)],[(r*t-e*i)/(r*r+e*e),(e*t+r*i)/(r*r+e*e)]]}var ti,ks=Math.PI/180;function IC(r,e,t){return(1-t)*r+t*e}function PC(r,e,t,n){return r+Math.cos(n/180*ao)*e+Math.sin(n/180*ao)*t}function DC(r,e,t,n){var i=1e-6,a=e-r,s=t-e,o=3*a+3*(n-t)-6*s,l=6*(s-a),u=3*a;return Math.abs(o)<i?[-u/l]:(function(c,f,d){var h=c*c/4-f;if(h<-d)return[];if(h<=d)return[-c/2];var g=Math.sqrt(h);return[-c/2-g,-c/2+g]})(l/o,u/o,i)}function RC(r,e,t,n,i){var a=1-i;return r*(a*a*a)+e*(3*a*a*i)+t*(3*a*i*i)+n*(i*i*i)}(function(r){function e(){return i((function(o,l,u){return o.relative&&(o.x1!==void 0&&(o.x1+=l),o.y1!==void 0&&(o.y1+=u),o.x2!==void 0&&(o.x2+=l),o.y2!==void 0&&(o.y2+=u),o.x!==void 0&&(o.x+=l),o.y!==void 0&&(o.y+=u),o.relative=!1),o}))}function t(){var o=NaN,l=NaN,u=NaN,c=NaN;return i((function(f,d,h){return f.type&Le.SMOOTH_CURVE_TO&&(f.type=Le.CURVE_TO,o=isNaN(o)?d:o,l=isNaN(l)?h:l,f.x1=f.relative?d-o:2*d-o,f.y1=f.relative?h-l:2*h-l),f.type&Le.CURVE_TO?(o=f.relative?d+f.x2:f.x2,l=f.relative?h+f.y2:f.y2):(o=NaN,l=NaN),f.type&Le.SMOOTH_QUAD_TO&&(f.type=Le.QUAD_TO,u=isNaN(u)?d:u,c=isNaN(c)?h:c,f.x1=f.relative?d-u:2*d-u,f.y1=f.relative?h-c:2*h-c),f.type&Le.QUAD_TO?(u=f.relative?d+f.x1:f.x1,c=f.relative?h+f.y1:f.y1):(u=NaN,c=NaN),f}))}function n(){var o=NaN,l=NaN;return i((function(u,c,f){if(u.type&Le.SMOOTH_QUAD_TO&&(u.type=Le.QUAD_TO,o=isNaN(o)?c:o,l=isNaN(l)?f:l,u.x1=u.relative?c-o:2*c-o,u.y1=u.relative?f-l:2*f-l),u.type&Le.QUAD_TO){o=u.relative?c+u.x1:u.x1,l=u.relative?f+u.y1:u.y1;var d=u.x1,h=u.y1;u.type=Le.CURVE_TO,u.x1=((u.relative?0:c)+2*d)/3,u.y1=((u.relative?0:f)+2*h)/3,u.x2=(u.x+2*d)/3,u.y2=(u.y+2*h)/3}else o=NaN,l=NaN;return u}))}function i(o){var l=0,u=0,c=NaN,f=NaN;return function(d){if(isNaN(c)&&!(d.type&Le.MOVE_TO))throw new Error("path must start with moveto");var h=o(d,l,u,c,f);return d.type&Le.CLOSE_PATH&&(l=c,u=f),d.x!==void 0&&(l=d.relative?l+d.x:d.x),d.y!==void 0&&(u=d.relative?u+d.y:d.y),d.type&Le.MOVE_TO&&(c=l,f=u),h}}function a(o,l,u,c,f,d){return ka(o,l,u,c,f,d),i((function(h,g,v,y){var A=h.x1,C=h.x2,S=h.relative&&!isNaN(y),F=h.x!==void 0?h.x:S?0:g,E=h.y!==void 0?h.y:S?0:v;function R(re){return re*re}h.type&Le.HORIZ_LINE_TO&&l!==0&&(h.type=Le.LINE_TO,h.y=h.relative?0:v),h.type&Le.VERT_LINE_TO&&u!==0&&(h.type=Le.LINE_TO,h.x=h.relative?0:g),h.x!==void 0&&(h.x=h.x*o+E*u+(S?0:f)),h.y!==void 0&&(h.y=F*l+h.y*c+(S?0:d)),h.x1!==void 0&&(h.x1=h.x1*o+h.y1*u+(S?0:f)),h.y1!==void 0&&(h.y1=A*l+h.y1*c+(S?0:d)),h.x2!==void 0&&(h.x2=h.x2*o+h.y2*u+(S?0:f)),h.y2!==void 0&&(h.y2=C*l+h.y2*c+(S?0:d));var B=o*c-l*u;if(h.xRot!==void 0&&(o!==1||l!==0||u!==0||c!==1))if(B===0)delete h.rX,delete h.rY,delete h.xRot,delete h.lArcFlag,delete h.sweepFlag,h.type=Le.LINE_TO;else{var j=h.xRot*Math.PI/180,G=Math.sin(j),ie=Math.cos(j),q=1/R(h.rX),Y=1/R(h.rY),J=R(ie)*q+R(G)*Y,ae=2*G*ie*(q-Y),oe=R(G)*q+R(ie)*Y,he=J*c*c-ae*l*c+oe*l*l,ye=ae*(o*c+l*u)-2*(J*u*c+oe*o*l),Ue=J*u*u-ae*o*u+oe*o*o,Re=(Math.atan2(ye,he-Ue)+Math.PI)%Math.PI/2,Oe=Math.sin(Re),ee=Math.cos(Re);h.rX=Math.abs(B)/Math.sqrt(he*R(ee)+ye*Oe*ee+Ue*R(Oe)),h.rY=Math.abs(B)/Math.sqrt(he*R(Oe)-ye*Oe*ee+Ue*R(ee)),h.xRot=180*Re/Math.PI}return h.sweepFlag!==void 0&&0>B&&(h.sweepFlag=+!h.sweepFlag),h}))}function s(){return function(o){var l={};for(var u in o)l[u]=o[u];return l}}r.ROUND=function(o){function l(u){return Math.round(u*o)/o}return o===void 0&&(o=1e13),ka(o),function(u){return u.x1!==void 0&&(u.x1=l(u.x1)),u.y1!==void 0&&(u.y1=l(u.y1)),u.x2!==void 0&&(u.x2=l(u.x2)),u.y2!==void 0&&(u.y2=l(u.y2)),u.x!==void 0&&(u.x=l(u.x)),u.y!==void 0&&(u.y=l(u.y)),u.rX!==void 0&&(u.rX=l(u.rX)),u.rY!==void 0&&(u.rY=l(u.rY)),u}},r.TO_ABS=e,r.TO_REL=function(){return i((function(o,l,u){return o.relative||(o.x1!==void 0&&(o.x1-=l),o.y1!==void 0&&(o.y1-=u),o.x2!==void 0&&(o.x2-=l),o.y2!==void 0&&(o.y2-=u),o.x!==void 0&&(o.x-=l),o.y!==void 0&&(o.y-=u),o.relative=!0),o}))},r.NORMALIZE_HVZ=function(o,l,u){return o===void 0&&(o=!0),l===void 0&&(l=!0),u===void 0&&(u=!0),i((function(c,f,d,h,g){if(isNaN(h)&&!(c.type&Le.MOVE_TO))throw new Error("path must start with moveto");return l&&c.type&Le.HORIZ_LINE_TO&&(c.type=Le.LINE_TO,c.y=c.relative?0:d),u&&c.type&Le.VERT_LINE_TO&&(c.type=Le.LINE_TO,c.x=c.relative?0:f),o&&c.type&Le.CLOSE_PATH&&(c.type=Le.LINE_TO,c.x=c.relative?h-f:h,c.y=c.relative?g-d:g),c.type&Le.ARC&&(c.rX===0||c.rY===0)&&(c.type=Le.LINE_TO,delete c.rX,delete c.rY,delete c.xRot,delete c.lArcFlag,delete c.sweepFlag),c}))},r.NORMALIZE_ST=t,r.QT_TO_C=n,r.INFO=i,r.SANITIZE=function(o){o===void 0&&(o=0),ka(o);var l=NaN,u=NaN,c=NaN,f=NaN;return i((function(d,h,g,v,y){var A=Math.abs,C=!1,S=0,F=0;if(d.type&Le.SMOOTH_CURVE_TO&&(S=isNaN(l)?0:h-l,F=isNaN(u)?0:g-u),d.type&(Le.CURVE_TO|Le.SMOOTH_CURVE_TO)?(l=d.relative?h+d.x2:d.x2,u=d.relative?g+d.y2:d.y2):(l=NaN,u=NaN),d.type&Le.SMOOTH_QUAD_TO?(c=isNaN(c)?h:2*h-c,f=isNaN(f)?g:2*g-f):d.type&Le.QUAD_TO?(c=d.relative?h+d.x1:d.x1,f=d.relative?g+d.y1:d.y2):(c=NaN,f=NaN),d.type&Le.LINE_COMMANDS||d.type&Le.ARC&&(d.rX===0||d.rY===0||!d.lArcFlag)||d.type&Le.CURVE_TO||d.type&Le.SMOOTH_CURVE_TO||d.type&Le.QUAD_TO||d.type&Le.SMOOTH_QUAD_TO){var E=d.x===void 0?0:d.relative?d.x:d.x-h,R=d.y===void 0?0:d.relative?d.y:d.y-g;S=isNaN(c)?d.x1===void 0?S:d.relative?d.x:d.x1-h:c-h,F=isNaN(f)?d.y1===void 0?F:d.relative?d.y:d.y1-g:f-g;var B=d.x2===void 0?0:d.relative?d.x:d.x2-h,j=d.y2===void 0?0:d.relative?d.y:d.y2-g;A(E)<=o&&A(R)<=o&&A(S)<=o&&A(F)<=o&&A(B)<=o&&A(j)<=o&&(C=!0)}return d.type&Le.CLOSE_PATH&&A(h-v)<=o&&A(g-y)<=o&&(C=!0),C?[]:d}))},r.MATRIX=a,r.ROTATE=function(o,l,u){l===void 0&&(l=0),u===void 0&&(u=0),ka(o,l,u);var c=Math.sin(o),f=Math.cos(o);return a(f,c,-c,f,l-l*f+u*c,u-l*c-u*f)},r.TRANSLATE=function(o,l){return l===void 0&&(l=0),ka(o,l),a(1,0,0,1,o,l)},r.SCALE=function(o,l){return l===void 0&&(l=o),ka(o,l),a(o,0,0,l,0,0)},r.SKEW_X=function(o){return ka(o),a(1,0,Math.atan(o),1,0,0)},r.SKEW_Y=function(o){return ka(o),a(1,Math.atan(o),0,1,0,0)},r.X_AXIS_SYMMETRY=function(o){return o===void 0&&(o=0),ka(o),a(-1,0,0,1,o,0)},r.Y_AXIS_SYMMETRY=function(o){return o===void 0&&(o=0),ka(o),a(1,0,0,-1,0,o)},r.A_TO_C=function(){return i((function(o,l,u){return Le.ARC===o.type?(function(c,f,d){var h,g,v,y;c.cX||x0(c,f,d);for(var A=Math.min(c.phi1,c.phi2),C=Math.max(c.phi1,c.phi2)-A,S=Math.ceil(C/90),F=new Array(S),E=f,R=d,B=0;B<S;B++){var j=IC(c.phi1,c.phi2,B/S),G=IC(c.phi1,c.phi2,(B+1)/S),ie=G-j,q=4/3*Math.tan(ie*ks/4),Y=[Math.cos(j*ks)-q*Math.sin(j*ks),Math.sin(j*ks)+q*Math.cos(j*ks)],J=Y[0],ae=Y[1],oe=[Math.cos(G*ks),Math.sin(G*ks)],he=oe[0],ye=oe[1],Ue=[he+q*Math.sin(G*ks),ye-q*Math.cos(G*ks)],Re=Ue[0],Oe=Ue[1];F[B]={relative:c.relative,type:Le.CURVE_TO};var ee=function(re,fe){var Be=jy([re*c.rX,fe*c.rY],c.xRot),ke=Be[0],$e=Be[1];return[c.cX+ke,c.cY+$e]};h=ee(J,ae),F[B].x1=h[0],F[B].y1=h[1],g=ee(Re,Oe),F[B].x2=g[0],F[B].y2=g[1],v=ee(he,ye),F[B].x=v[0],F[B].y=v[1],c.relative&&(F[B].x1-=E,F[B].y1-=R,F[B].x2-=E,F[B].y2-=R,F[B].x-=E,F[B].y-=R),E=(y=[F[B].x,F[B].y])[0],R=y[1]}return F})(o,o.relative?0:l,o.relative?0:u):o}))},r.ANNOTATE_ARCS=function(){return i((function(o,l,u){return o.relative&&(l=0,u=0),Le.ARC===o.type&&x0(o,l,u),o}))},r.CLONE=s,r.CALCULATE_BOUNDS=function(){var o=function(d){var h={};for(var g in d)h[g]=d[g];return h},l=e(),u=n(),c=t(),f=i((function(d,h,g){var v=c(u(l(o(d))));function y(Oe){Oe>f.maxX&&(f.maxX=Oe),Oe<f.minX&&(f.minX=Oe)}function A(Oe){Oe>f.maxY&&(f.maxY=Oe),Oe<f.minY&&(f.minY=Oe)}if(v.type&Le.DRAWING_COMMANDS&&(y(h),A(g)),v.type&Le.HORIZ_LINE_TO&&y(v.x),v.type&Le.VERT_LINE_TO&&A(v.y),v.type&Le.LINE_TO&&(y(v.x),A(v.y)),v.type&Le.CURVE_TO){y(v.x),A(v.y);for(var C=0,S=DC(h,v.x1,v.x2,v.x);C<S.length;C++)0<(Re=S[C])&&1>Re&&y(RC(h,v.x1,v.x2,v.x,Re));for(var F=0,E=DC(g,v.y1,v.y2,v.y);F<E.length;F++)0<(Re=E[F])&&1>Re&&A(RC(g,v.y1,v.y2,v.y,Re))}if(v.type&Le.ARC){y(v.x),A(v.y),x0(v,h,g);for(var R=v.xRot/180*Math.PI,B=Math.cos(R)*v.rX,j=Math.sin(R)*v.rX,G=-Math.sin(R)*v.rY,ie=Math.cos(R)*v.rY,q=v.phi1<v.phi2?[v.phi1,v.phi2]:-180>v.phi2?[v.phi2+360,v.phi1+360]:[v.phi2,v.phi1],Y=q[0],J=q[1],ae=function(Oe){var ee=Oe[0],re=Oe[1],fe=180*Math.atan2(re,ee)/Math.PI;return fe<Y?fe+360:fe},oe=0,he=FC(G,-B,0).map(ae);oe<he.length;oe++)(Re=he[oe])>Y&&Re<J&&y(PC(v.cX,B,G,Re));for(var ye=0,Ue=FC(ie,-j,0).map(ae);ye<Ue.length;ye++){var Re;(Re=Ue[ye])>Y&&Re<J&&A(PC(v.cY,j,ie,Re))}}return d}));return f.minX=1/0,f.maxX=-1/0,f.minY=1/0,f.maxY=-1/0,f}})(ti||(ti={}));var Sa,wT=(function(){function r(){}return r.prototype.round=function(e){return this.transform(ti.ROUND(e))},r.prototype.toAbs=function(){return this.transform(ti.TO_ABS())},r.prototype.toRel=function(){return this.transform(ti.TO_REL())},r.prototype.normalizeHVZ=function(e,t,n){return this.transform(ti.NORMALIZE_HVZ(e,t,n))},r.prototype.normalizeST=function(){return this.transform(ti.NORMALIZE_ST())},r.prototype.qtToC=function(){return this.transform(ti.QT_TO_C())},r.prototype.aToC=function(){return this.transform(ti.A_TO_C())},r.prototype.sanitize=function(e){return this.transform(ti.SANITIZE(e))},r.prototype.translate=function(e,t){return this.transform(ti.TRANSLATE(e,t))},r.prototype.scale=function(e,t){return this.transform(ti.SCALE(e,t))},r.prototype.rotate=function(e,t,n){return this.transform(ti.ROTATE(e,t,n))},r.prototype.matrix=function(e,t,n,i,a,s){return this.transform(ti.MATRIX(e,t,n,i,a,s))},r.prototype.skewX=function(e){return this.transform(ti.SKEW_X(e))},r.prototype.skewY=function(e){return this.transform(ti.SKEW_Y(e))},r.prototype.xSymmetry=function(e){return this.transform(ti.X_AXIS_SYMMETRY(e))},r.prototype.ySymmetry=function(e){return this.transform(ti.Y_AXIS_SYMMETRY(e))},r.prototype.annotateArcs=function(){return this.transform(ti.ANNOTATE_ARCS())},r})(),dM=function(r){return r===" "||r===" "||r==="\r"||r===`
|
|
1748
|
-
`},OC=function(r){return 48<=r.charCodeAt(0)&&r.charCodeAt(0)<=57},fM=(function(r){function e(){var t=r.call(this)||this;return t.curNumber="",t.curCommandType=-1,t.curCommandRelative=!1,t.canParseCommandOrComma=!0,t.curNumberHasExp=!1,t.curNumberHasExpDigits=!1,t.curNumberHasDecimal=!1,t.curArgs=[],t}return bT(e,r),e.prototype.finish=function(t){if(t===void 0&&(t=[]),this.parse(" ",t),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,n){var i=this;n===void 0&&(n=[]);for(var a=function(f){n.push(f),i.curArgs.length=0,i.canParseCommandOrComma=!0},s=0;s<t.length;s++){var o=t[s],l=!(this.curCommandType!==Le.ARC||this.curArgs.length!==3&&this.curArgs.length!==4||this.curNumber.length!==1||this.curNumber!=="0"&&this.curNumber!=="1"),u=OC(o)&&(this.curNumber==="0"&&o==="0"||l);if(!OC(o)||u)if(o!=="e"&&o!=="E")if(o!=="-"&&o!=="+"||!this.curNumberHasExp||this.curNumberHasExpDigits)if(o!=="."||this.curNumberHasExp||this.curNumberHasDecimal||l){if(this.curNumber&&this.curCommandType!==-1){var c=Number(this.curNumber);if(isNaN(c))throw new SyntaxError("Invalid number ending at "+s);if(this.curCommandType===Le.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>c)throw new SyntaxError('Expected positive number, got "'+c+'" at index "'+s+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+s+'"')}this.curArgs.push(c),this.curArgs.length===hM[this.curCommandType]&&(Le.HORIZ_LINE_TO===this.curCommandType?a({type:Le.HORIZ_LINE_TO,relative:this.curCommandRelative,x:c}):Le.VERT_LINE_TO===this.curCommandType?a({type:Le.VERT_LINE_TO,relative:this.curCommandRelative,y:c}):this.curCommandType===Le.MOVE_TO||this.curCommandType===Le.LINE_TO||this.curCommandType===Le.SMOOTH_QUAD_TO?(a({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),Le.MOVE_TO===this.curCommandType&&(this.curCommandType=Le.LINE_TO)):this.curCommandType===Le.CURVE_TO?a({type:Le.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===Le.SMOOTH_CURVE_TO?a({type:Le.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===Le.QUAD_TO?a({type:Le.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===Le.ARC&&a({type:Le.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!dM(o))if(o===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(o!=="+"&&o!=="-"&&o!==".")if(u)this.curNumber=o,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+s+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+o+'" at index '+s+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,o!=="z"&&o!=="Z")if(o==="h"||o==="H")this.curCommandType=Le.HORIZ_LINE_TO,this.curCommandRelative=o==="h";else if(o==="v"||o==="V")this.curCommandType=Le.VERT_LINE_TO,this.curCommandRelative=o==="v";else if(o==="m"||o==="M")this.curCommandType=Le.MOVE_TO,this.curCommandRelative=o==="m";else if(o==="l"||o==="L")this.curCommandType=Le.LINE_TO,this.curCommandRelative=o==="l";else if(o==="c"||o==="C")this.curCommandType=Le.CURVE_TO,this.curCommandRelative=o==="c";else if(o==="s"||o==="S")this.curCommandType=Le.SMOOTH_CURVE_TO,this.curCommandRelative=o==="s";else if(o==="q"||o==="Q")this.curCommandType=Le.QUAD_TO,this.curCommandRelative=o==="q";else if(o==="t"||o==="T")this.curCommandType=Le.SMOOTH_QUAD_TO,this.curCommandRelative=o==="t";else{if(o!=="a"&&o!=="A")throw new SyntaxError('Unexpected character "'+o+'" at index '+s+".");this.curCommandType=Le.ARC,this.curCommandRelative=o==="a"}else n.push({type:Le.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=o,this.curNumberHasDecimal=o==="."}else this.curNumber+=o,this.curNumberHasDecimal=!0;else this.curNumber+=o;else this.curNumber+=o,this.curNumberHasExp=!0;else this.curNumber+=o,this.curNumberHasExpDigits=this.curNumberHasExp}return n},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(n,i){i===void 0&&(i=[]);for(var a=0,s=Object.getPrototypeOf(this).parse.call(this,n);a<s.length;a++){var o=s[a],l=t(o);Array.isArray(l)?i.push.apply(i,l):i.push(l)}return i}}})},e})(wT),Le=(function(r){function e(t){var n=r.call(this)||this;return n.commands=typeof t=="string"?e.parse(t):t,n}return bT(e,r),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=ti.CALCULATE_BOUNDS();return this.transform(t),t},e.prototype.transform=function(t){for(var n=[],i=0,a=this.commands;i<a.length;i++){var s=t(a[i]);Array.isArray(s)?n.push.apply(n,s):n.push(s)}return this.commands=n,this},e.encode=function(t){return cM(t)},e.parse=function(t){var n=new fM,i=[];return n.parse(t,i),n.finish(i),i},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e})(wT),hM=((Sa={})[Le.MOVE_TO]=2,Sa[Le.LINE_TO]=2,Sa[Le.HORIZ_LINE_TO]=1,Sa[Le.VERT_LINE_TO]=1,Sa[Le.CLOSE_PATH]=0,Sa[Le.QUAD_TO]=4,Sa[Le.SMOOTH_QUAD_TO]=2,Sa[Le.CURVE_TO]=6,Sa[Le.SMOOTH_CURVE_TO]=4,Sa[Le.ARC]=7,Sa);function Hp(r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Hp=function(e){return typeof e}:Hp=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hp(r)}function pM(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var gM=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],mM=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function vM(r,e,t,n,i){if(typeof r=="string"&&(r=document.getElementById(r)),!r||Hp(r)!=="object"||!("getContext"in r))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var a=r.getContext("2d");try{return a.getImageData(e,t,n,i)}catch(s){throw new Error("unable to access image data: "+s)}}function yM(r,e,t,n,i,a){if(!(isNaN(a)||a<1)){a|=0;var s=vM(r,e,t,n,i);s=AM(s,e,t,n,i,a),r.getContext("2d").putImageData(s,e,t)}}function AM(r,e,t,n,i,a){for(var s=r.data,o=2*a+1,l=n-1,u=i-1,c=a+1,f=c*(c+1)/2,d=new BC,h=d,g,v=1;v<o;v++)h=h.next=new BC,v===c&&(g=h);h.next=d;for(var y=null,A=null,C=0,S=0,F=gM[a],E=mM[a],R=0;R<i;R++){h=d;for(var B=s[S],j=s[S+1],G=s[S+2],ie=s[S+3],q=0;q<c;q++)h.r=B,h.g=j,h.b=G,h.a=ie,h=h.next;for(var Y=0,J=0,ae=0,oe=0,he=c*B,ye=c*j,Ue=c*G,Re=c*ie,Oe=f*B,ee=f*j,re=f*G,fe=f*ie,Be=1;Be<c;Be++){var ke=S+((l<Be?l:Be)<<2),$e=s[ke],je=s[ke+1],qe=s[ke+2],Ge=s[ke+3],bt=c-Be;Oe+=(h.r=$e)*bt,ee+=(h.g=je)*bt,re+=(h.b=qe)*bt,fe+=(h.a=Ge)*bt,Y+=$e,J+=je,ae+=qe,oe+=Ge,h=h.next}y=d,A=g;for(var rr=0;rr<n;rr++){var Dr=fe*F>>>E;if(s[S+3]=Dr,Dr!==0){var Gt=255/Dr;s[S]=(Oe*F>>>E)*Gt,s[S+1]=(ee*F>>>E)*Gt,s[S+2]=(re*F>>>E)*Gt}else s[S]=s[S+1]=s[S+2]=0;Oe-=he,ee-=ye,re-=Ue,fe-=Re,he-=y.r,ye-=y.g,Ue-=y.b,Re-=y.a;var ar=rr+a+1;ar=C+(ar<l?ar:l)<<2,Y+=y.r=s[ar],J+=y.g=s[ar+1],ae+=y.b=s[ar+2],oe+=y.a=s[ar+3],Oe+=Y,ee+=J,re+=ae,fe+=oe,y=y.next;var St=A,st=St.r,Qr=St.g,Sr=St.b,gr=St.a;he+=st,ye+=Qr,Ue+=Sr,Re+=gr,Y-=st,J-=Qr,ae-=Sr,oe-=gr,A=A.next,S+=4}C+=n}for(var nr=0;nr<n;nr++){S=nr<<2;var dr=s[S],Yt=s[S+1],Xt=s[S+2],mt=s[S+3],Cr=c*dr,sn=c*Yt,_r=c*Xt,ir=c*mt,Yr=f*dr,kr=f*Yt,Zr=f*Xt,Vr=f*mt;h=d;for(var pn=0;pn<c;pn++)h.r=dr,h.g=Yt,h.b=Xt,h.a=mt,h=h.next;for(var gn=n,Tr=0,zr=0,en=0,$r=0,zt=1;zt<=a;zt++){S=gn+nr<<2;var sr=c-zt;Yr+=(h.r=dr=s[S])*sr,kr+=(h.g=Yt=s[S+1])*sr,Zr+=(h.b=Xt=s[S+2])*sr,Vr+=(h.a=mt=s[S+3])*sr,$r+=dr,Tr+=Yt,zr+=Xt,en+=mt,h=h.next,zt<u&&(gn+=n)}S=nr,y=d,A=g;for(var Er=0;Er<i;Er++){var tt=S<<2;s[tt+3]=mt=Vr*F>>>E,mt>0?(mt=255/mt,s[tt]=(Yr*F>>>E)*mt,s[tt+1]=(kr*F>>>E)*mt,s[tt+2]=(Zr*F>>>E)*mt):s[tt]=s[tt+1]=s[tt+2]=0,Yr-=Cr,kr-=sn,Zr-=_r,Vr-=ir,Cr-=y.r,sn-=y.g,_r-=y.b,ir-=y.a,tt=nr+((tt=Er+c)<u?tt:u)*n<<2,Yr+=$r+=y.r=s[tt],kr+=Tr+=y.g=s[tt+1],Zr+=zr+=y.b=s[tt+2],Vr+=en+=y.a=s[tt+3],y=y.next,Cr+=dr=A.r,sn+=Yt=A.g,_r+=Xt=A.b,ir+=mt=A.a,$r-=dr,Tr-=Yt,zr-=Xt,en-=mt,A=A.next,S+=n}}return r}var BC=function r(){pM(this,r),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function bl(r,e,t,n,i,a){return r[t*n*4+e*4+a]}function wl(r,e,t,n,i,a,s){r[t*n*4+e*4+a]=s}function Vf(r){return r.replace(/(?!\u3000)\s+/gm," ")}function Hi(r){const e=r.match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm);return e?e.map(parseFloat):[]}function bM(r){const e=Hi(r);return[e[0]||0,e[1]||0,e[2]||0,e[3]||0,e[4]||0,e[5]||0]}const wM=/^[A-Z-]+$/;function CM(r){return wM.test(r)?r.toLowerCase():r}function MC(r){const e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(r);return e&&(e[2]||e[3]||e[4])||""}function xM(r){if(!r.startsWith("rgb"))return r;let e=3;return r.replace(/\d+(\.\d+)?/g,(n,i)=>e--&&i?String(Math.round(parseFloat(n))):n)}const SM=/(\[[^\]]+\])/g,EM=/(#[^\s+>~.[:]+)/g,kM=/(\.[^\s+>~.[:]+)/g,TM=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,FM=/(:[\w-]+\([^)]*\))/gi,IM=/(:[^\s+>~.[:]+)/g,PM=/([^\s+>~.[:]+)/g;function cl(r,e){const t=e.exec(r);return t?[r.replace(e," "),t.length]:[r,0]}function DM(r){const e=[0,0,0];let t=r.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),n=0;return[t,n]=cl(t,SM),e[1]+=n,[t,n]=cl(t,EM),e[0]+=n,[t,n]=cl(t,kM),e[1]+=n,[t,n]=cl(t,TM),e[2]+=n,[t,n]=cl(t,FM),e[1]+=n,[t,n]=cl(t,IM),e[1]+=n,t=t.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[t,n]=cl(t,PM),e[2]+=n,e.join("")}const $u=1e-8;function _C(r){return Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2))}function Gy(r,e){return(r[0]*e[0]+r[1]*e[1])/(_C(r)*_C(e))}function NC(r,e){return(r[0]*e[1]<r[1]*e[0]?-1:1)*Math.acos(Gy(r,e))}function LC(r){return r*r*r}function UC(r){return 3*r*r*(1-r)}function VC(r){return 3*r*(1-r)*(1-r)}function zC(r){return(1-r)*(1-r)*(1-r)}function $C(r){return r*r}function HC(r){return 2*r*(1-r)}function jC(r){return(1-r)*(1-r)}class Mt{document;name;value;static empty(e){return new Mt(e,"EMPTY","")}static textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};isNormalizedColor=!1;constructor(e,t,n){this.document=e,this.name=t,this.value=n}split(e=" "){const{document:t,name:n}=this;return Vf(this.getString()).trim().split(e).map(i=>new Mt(t,n,i))}hasValue(e){const t=this.value;return t!==null&&t!==""&&(e||t!==0)&&typeof t<"u"}isString(e){const{value:t}=this,n=typeof t=="string";return!n||!e?n:e.test(t)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;const e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}setValue(e){return this.value=e,this}getValue(e){return typeof e>"u"||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return typeof e>"u"?0:parseFloat(e);const{value:t}=this;let n=parseFloat(t);return this.isString(/%$/)&&(n/=100),n}getString(e){return typeof e>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(e)}getColor(e){let t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=xM(t),this.value=t),t}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(e,t=!1){if(!this.hasValue())return 0;const[n,i]=typeof e=="boolean"?[void 0,e]:[e],{viewPort:a}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(a.computeSize("x"),a.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(a.computeSize("x"),a.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*a.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*a.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&i):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*a.computeSize(n);default:{const s=this.getNumber();return t&&s<1?s*a.computeSize(n):s}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){const e=this.getString(),n=/#([^)'"]+)/.exec(e)?.[1]||e;return this.document.definitions[n]}getFillStyleDefinition(e,t){let n=this.getDefinition();if(!n)return null;if(typeof n.createGradient=="function"&&"getBoundingBox"in e)return n.createGradient(this.document.ctx,e,t);if(typeof n.createPattern=="function"){if(n.getHrefAttribute().hasValue()){const i=n.getAttribute("patternTransform");n=n.getHrefAttribute().getDefinition(),n&&i.hasValue()&&n.getAttribute("patternTransform",!0).setValue(i.value)}if(n)return n.createPattern(this.document.ctx,e,t)}return null}getTextBaseline(){if(!this.hasValue())return null;const e=this.getString();return Mt.textBaselineMapping[e]||null}addOpacity(e){let t=this.getColor();const n=t.length;let i=0;for(let a=0;a<n&&(t[a]===","&&i++,i!==3);a++);if(e.hasValue()&&this.isString()&&i!==3){const a=new Hy(t);a.ok&&(a.alpha=e.getNumber(),t=a.toRGBA())}return new Mt(this.document,this.name,t)}}class qy{static DEFAULT_VIEWPORT_WIDTH=800;static DEFAULT_VIEWPORT_HEIGHT=600;viewPorts=[];clear(){this.viewPorts=[]}setCurrent(e,t){this.viewPorts.push({width:e,height:t})}removeCurrent(){this.viewPorts.pop()}getRoot(){const[e]=this.viewPorts;return e||GC()}getCurrent(){const{viewPorts:e}=this,t=e[e.length-1];return t||GC()}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(e){return typeof e=="number"?e:e==="x"?this.width:e==="y"?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}function GC(){return{width:qy.DEFAULT_VIEWPORT_WIDTH,height:qy.DEFAULT_VIEWPORT_HEIGHT}}class Rn{x;y;static parse(e,t=0){const[n=t,i=t]=Hi(e);return new Rn(n,i)}static parseScale(e,t=1){const[n=t,i=n]=Hi(e);return new Rn(n,i)}static parsePath(e){const t=Hi(e),n=t.length,i=[];for(let a=0;a<n;a+=2)i.push(new Rn(t[a],t[a+1]));return i}constructor(e,t){this.x=e,this.y=t}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}applyTransform(e){const{x:t,y:n}=this,i=t*e[0]+n*e[2]+e[4],a=t*e[1]+n*e[3]+e[5];this.x=i,this.y=a}}class RM{screen;working=!1;events=[];eventElements=[];constructor(e){this.screen=e,this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(this.working)return;const{screen:e,onClick:t,onMouseMove:n}=this,i=e.ctx.canvas;i.onclick=t,i.onmousemove=n,this.working=!0}stop(){if(!this.working)return;const e=this.screen.ctx.canvas;this.working=!1,e.onclick=null,e.onmousemove=null}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(!this.working)return;const{screen:e,events:t,eventElements:n}=this,{style:i}=e.ctx.canvas;let a;i&&(i.cursor=""),t.forEach(({run:s},o)=>{for(a=n[o];a;)s(a),a=a.parent}),this.events=[],this.eventElements=[]}checkPath(e,t){if(!this.working||!t)return;const{events:n,eventElements:i}=this;n.forEach(({x:a,y:s},o)=>{!i[o]&&t.isPointInPath&&t.isPointInPath(a,s)&&(i[o]=e)})}checkBoundingBox(e,t){if(!this.working||!t)return;const{events:n,eventElements:i}=this;n.forEach(({x:a,y:s},o)=>{!i[o]&&t.isPointInBox(a,s)&&(i[o]=e)})}mapXY(e,t){const{window:n,ctx:i}=this.screen,a=new Rn(e,t);let s=i.canvas;for(;s;)a.x-=s.offsetLeft,a.y-=s.offsetTop,s=s.offsetParent;return n?.scrollX&&(a.x+=n.scrollX),n?.scrollY&&(a.y+=n.scrollY),a}onClick(e){const{x:t,y:n}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onclick",x:t,y:n,run(i){i.onClick&&i.onClick()}})}onMouseMove(e){const{x:t,y:n}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onmousemove",x:t,y:n,run(i){i.onMouseMove&&i.onMouseMove()}})}}const qC=typeof window<"u"?window:null,WC=typeof fetch<"u"?fetch.bind(void 0):void 0;class zf{ctx;static defaultWindow=qC;static defaultFetch=WC;static FRAMERATE=30;static MAX_VIRTUAL_PIXELS=3e4;window;fetch;viewPort=new qy;mouse=new RM(this);animations=[];readyPromise;resolveReady;waits=[];frameDuration=0;isReadyLock=!1;isFirstRender=!0;intervalId=null;constructor(e,{fetch:t=WC,window:n=qC}={}){if(this.ctx=e,this.window=n,!t)throw new Error("Can't find 'fetch' in 'globalThis', please provide it via options");this.fetch=t}wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;const e=this.waits.every(t=>t());return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}setViewBox({document:e,ctx:t,aspectRatio:n,width:i,desiredWidth:a,height:s,desiredHeight:o,minX:l=0,minY:u=0,refX:c,refY:f,clip:d=!1,clipX:h=0,clipY:g=0}){const v=Vf(n).replace(/^defer\s/,""),[y,A]=v.split(" "),C=y||"xMidYMid",S=A||"meet",F=i/a,E=s/o,R=Math.min(F,E),B=Math.max(F,E);let j=a,G=o;S==="meet"&&(j*=R,G*=R),S==="slice"&&(j*=B,G*=B);const ie=new Mt(e,"refX",c),q=new Mt(e,"refY",f),Y=ie.hasValue()&&q.hasValue();if(Y&&t.translate(-R*ie.getPixels("x"),-R*q.getPixels("y")),d){const J=R*h,ae=R*g;t.beginPath(),t.moveTo(J,ae),t.lineTo(i,ae),t.lineTo(i,s),t.lineTo(J,s),t.closePath(),t.clip()}if(!Y){const J=S==="meet"&&R===E,ae=S==="slice"&&B===E,oe=S==="meet"&&R===F,he=S==="slice"&&B===F;C.startsWith("xMid")&&(J||ae)&&t.translate(i/2-j/2,0),C.endsWith("YMid")&&(oe||he)&&t.translate(0,s/2-G/2),C.startsWith("xMax")&&(J||ae)&&t.translate(i-j,0),C.endsWith("YMax")&&(oe||he)&&t.translate(0,s-G)}switch(!0){case C==="none":t.scale(F,E);break;case S==="meet":t.scale(R,R);break;case S==="slice":t.scale(B,B);break}t.translate(-l,-u)}start(e,{enableRedraw:t=!1,ignoreMouse:n=!1,ignoreAnimation:i=!1,ignoreDimensions:a=!1,ignoreClear:s=!1,forceRedraw:o,scaleWidth:l,scaleHeight:u,offsetX:c,offsetY:f}={}){const{mouse:d}=this,h=1e3/zf.FRAMERATE;if(this.isReadyLock=!1,this.frameDuration=h,this.readyPromise=new Promise(C=>{this.resolveReady=C}),this.isReady()&&this.render(e,a,s,l,u,c,f),!t)return;let g=Date.now(),v=g,y=0;const A=()=>{g=Date.now(),y=g-v,y>=h&&(v=g-y%h,this.shouldUpdate(i,o)&&(this.render(e,a,s,l,u,c,f),d.runEvents())),this.intervalId=w0(A)};n||d.start(),this.intervalId=w0(A)}stop(){this.intervalId&&(w0.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,t){if(!e){const{frameDuration:n}=this;if(this.animations.reduce((a,s)=>s.update(n)||a,!1))return!0}return!!(typeof t=="function"&&t()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(e,t,n,i,a,s,o){const{viewPort:l,ctx:u,isFirstRender:c}=this,f=u.canvas;l.clear(),f.width&&f.height&&l.setCurrent(f.width,f.height);const d=e.getStyle("width"),h=e.getStyle("height");!t&&(c||typeof i!="number"&&typeof a!="number")&&(d.hasValue()&&(f.width=d.getPixels("x"),f.style&&(f.style.width=`${f.width}px`)),h.hasValue()&&(f.height=h.getPixels("y"),f.style&&(f.style.height=`${f.height}px`)));let g=f.clientWidth||f.width,v=f.clientHeight||f.height;if(t&&d.hasValue()&&h.hasValue()&&(g=d.getPixels("x"),v=h.getPixels("y")),l.setCurrent(g,v),typeof s=="number"&&e.getAttribute("x",!0).setValue(s),typeof o=="number"&&e.getAttribute("y",!0).setValue(o),typeof i=="number"||typeof a=="number"){const y=Hi(e.getAttribute("viewBox").getString());let A=0,C=0;if(typeof i=="number"){const F=e.getStyle("width");F.hasValue()?A=F.getPixels("x")/i:y[2]&&!isNaN(y[2])&&(A=y[2]/i)}if(typeof a=="number"){const F=e.getStyle("height");F.hasValue()?C=F.getPixels("y")/a:y[3]&&!isNaN(y[3])&&(C=y[3]/a)}A||(A=C),C||(C=A),e.getAttribute("width",!0).setValue(i),e.getAttribute("height",!0).setValue(a);const S=e.getStyle("transform",!0,!0);S.setValue(`${S.getString()} scale(${1/A}, ${1/C})`)}n||u.clearRect(0,0,g,v),e.render(u),c&&(this.isFirstRender=!1)}}const{defaultFetch:OM}=zf,BM=typeof DOMParser<"u"?DOMParser:void 0;let S0=class{fetch;DOMParser;constructor({fetch:e=OM,DOMParser:t=BM}={}){if(!e)throw new Error("Can't find 'fetch' in 'globalThis', please provide it via options");if(!t)throw new Error("Can't find 'DOMParser' in 'globalThis', please provide it via options");this.fetch=e,this.DOMParser=t}async parse(e){return e.startsWith("<")?this.parseFromString(e):this.load(e)}parseFromString(e){const t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch{return this.checkDocument(t.parseFromString(e,"text/xml"))}}checkDocument(e){const t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent||"Unknown parse error");return e}async load(e){const n=await(await this.fetch(e)).text();return this.parseFromString(n)}};class MM{type="translate";point;constructor(e,t){this.point=Rn.parse(t)}apply(e){const{x:t,y:n}=this.point;e.translate(t||0,n||0)}unapply(e){const{x:t,y:n}=this.point;e.translate(-1*t||0,-1*n||0)}applyToPoint(e){const{x:t,y:n}=this.point;e.applyTransform([1,0,0,1,t||0,n||0])}}class _M{type="rotate";angle;originX;originY;cx;cy;constructor(e,t,n){const i=Hi(t);this.angle=new Mt(e,"angle",i[0]),this.originX=n[0],this.originY=n[1],this.cx=i[1]||0,this.cy=i[2]||0}apply(e){const{cx:t,cy:n,originX:i,originY:a,angle:s}=this,o=t+i.getPixels("x"),l=n+a.getPixels("y");e.translate(o,l),e.rotate(s.getRadians()),e.translate(-o,-l)}unapply(e){const{cx:t,cy:n,originX:i,originY:a,angle:s}=this,o=t+i.getPixels("x"),l=n+a.getPixels("y");e.translate(o,l),e.rotate(-1*s.getRadians()),e.translate(-o,-l)}applyToPoint(e){const{cx:t,cy:n,angle:i}=this,a=i.getRadians();e.applyTransform([1,0,0,1,t||0,n||0]),e.applyTransform([Math.cos(a),Math.sin(a),-Math.sin(a),Math.cos(a),0,0]),e.applyTransform([1,0,0,1,-t||0,-n||0])}}class NM{type="scale";scale;originX;originY;constructor(e,t,n){const i=Rn.parseScale(t);(i.x===0||i.y===0)&&(i.x=$u,i.y=$u),this.scale=i,this.originX=n[0],this.originY=n[1]}apply(e){const{scale:{x:t,y:n},originX:i,originY:a}=this,s=i.getPixels("x"),o=a.getPixels("y");e.translate(s,o),e.scale(t,n||t),e.translate(-s,-o)}unapply(e){const{scale:{x:t,y:n},originX:i,originY:a}=this,s=i.getPixels("x"),o=a.getPixels("y");e.translate(s,o),e.scale(1/t,1/n||t),e.translate(-s,-o)}applyToPoint(e){const{x:t,y:n}=this.scale;e.applyTransform([t||0,0,0,n||0,0,0])}}class CT{type="matrix";matrix;originX;originY;constructor(e,t,n){this.matrix=bM(t),this.originX=n[0],this.originY=n[1]}apply(e){const{originX:t,originY:n,matrix:i}=this,a=t.getPixels("x"),s=n.getPixels("y");e.translate(a,s),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.translate(-a,-s)}unapply(e){const{originX:t,originY:n,matrix:i}=this,a=i[0],s=i[2],o=i[4],l=i[1],u=i[3],c=i[5],f=0,d=0,h=1,g=1/(a*(u*h-c*d)-s*(l*h-c*f)+o*(l*d-u*f)),v=t.getPixels("x"),y=n.getPixels("y");e.translate(v,y),e.transform(g*(u*h-c*d),g*(c*f-l*h),g*(o*d-s*h),g*(a*h-o*f),g*(s*c-o*u),g*(o*l-a*c)),e.translate(-v,-y)}applyToPoint(e){e.applyTransform(this.matrix)}}class xT extends CT{type="skew";angle;constructor(e,t,n){super(e,t,n),this.angle=new Mt(e,"angle",t)}}class LM extends xT{type="skewX";constructor(e,t,n){super(e,t,n),this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class UM extends xT{type="skewY";constructor(e,t,n){super(e,t,n),this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function VM(r){return Vf(r).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function zM(r){const[e="",t=""]=r.split("(");return[e.trim(),t.trim().replace(")","")]}class tc{document;static fromElement(e,t){const n=t.getStyle("transform",!1,!0);if(n.hasValue()){const[i,a=i]=t.getStyle("transform-origin",!1,!0).split();if(i&&a){const s=[i,a];return new tc(e,n.getString(),s)}}return null}static transformTypes={translate:MM,rotate:_M,scale:NM,matrix:CT,skewX:LM,skewY:UM};transforms=[];constructor(e,t,n){this.document=e,VM(t).forEach(a=>{if(a==="none")return;const[s,o]=zM(a),l=tc.transformTypes[s];l&&this.transforms.push(new l(this.document,o,n))})}apply(e){this.transforms.forEach(t=>t.apply(e))}unapply(e){this.transforms.forEach(t=>t.unapply(e))}applyToPoint(e){this.transforms.forEach(t=>t.applyToPoint(e))}}class Yn{document;node;captureTextNodes;static ignoreChildTypes=["title"];type="";attributes={};styles={};stylesSpecificity={};animationFrozen=!1;animationFrozenValue="";parent=null;children=[];constructor(e,t,n=!1){if(this.document=e,this.node=t,this.captureTextNodes=n,!t||t.nodeType!==1)return;Array.from(t.attributes).forEach(s=>{const o=CM(s.nodeName);this.attributes[o]=new Mt(e,o,s.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()&&this.getAttribute("style").getString().split(";").map(o=>o.trim()).forEach(o=>{if(!o)return;const[l,u]=o.split(":").map(c=>c.trim());l&&(this.styles[l]=new Mt(e,l,u))});const{definitions:i}=e,a=this.getAttribute("id");a.hasValue()&&(i[a.getString()]||(i[a.getString()]=this)),Array.from(t.childNodes).forEach(s=>{if(s.nodeType===1)this.addChild(s);else if(n&&(s.nodeType===3||s.nodeType===4)){const o=e.createTextNode(s);o.getText().length>0&&this.addChild(o)}})}getAttribute(e,t=!1){const n=this.attributes[e];if(!n&&t){const i=new Mt(this.document,e,"");return this.attributes[e]=i,i}return n||Mt.empty(this.document)}getHrefAttribute(){let e;for(const t in this.attributes)if(t==="href"||t.endsWith(":href")){e=this.attributes[t];break}return e||Mt.empty(this.document)}getStyle(e,t=!1,n=!1){const i=this.styles[e];if(i)return i;const a=this.getAttribute(e);if(a.hasValue())return this.styles[e]=a,a;if(!n){const{parent:s}=this;if(s){const o=s.getStyle(e);if(o.hasValue())return o}}if(t){const s=new Mt(this.document,e,"");return this.styles[e]=s,s}return Mt.empty(this.document)}render(e){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(e.save(),this.getStyle("mask").hasValue()){const t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if(this.getStyle("filter").getValue("none")!=="none"){const t=this.getStyle("filter").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}setContext(e){}applyEffects(e){const t=tc.fromElement(this.document,this);t&&t.apply(e);const n=this.getStyle("clip-path",!1,!0);if(n.hasValue()){const i=n.getDefinition();i&&i.apply(e)}}clearContext(e){}renderChildren(e){this.children.forEach(t=>{t.render(e)})}addChild(e){const t=e instanceof Yn?e:this.document.createElement(e);t.parent=this,Yn.ignoreChildTypes.includes(t.type)||this.children.push(t)}matchesSelector(e){const{node:t}=this;if(!t)return!1;if(typeof t.matches=="function")return t.matches(e);const n=t.getAttribute?.("class");return!n||n===""?!1:n.split(" ").some(i=>`.${i}`===e)}addStylesFromStyleDefinition(){const{styles:e,stylesSpecificity:t}=this.document;let n;for(const i in e)if(!i.startsWith("@")&&this.matchesSelector(i)){const a=e[i],s=t[i];if(a)for(const o in a){let l=this.stylesSpecificity[o];typeof l>"u"&&(l="000"),s&&s>=l&&(n=a[o],n&&(this.styles[o]=n),this.stylesSpecificity[o]=s)}}}removeStyles(e,t){return t.reduce((i,a)=>{const s=e.getStyle(a);if(!s.hasValue())return i;const o=s.getString();return s.setValue(""),[...i,[a,o]]},[])}restoreStyles(e,t){t.forEach(([n,i])=>{e.getStyle(n,!0).setValue(i)})}isFirstChild(){return this.parent?.children.indexOf(this)===0}}class Pl extends Yn{}class $M extends Yn{constructor(e,t,n){super(e,t,n)}}function HM(r){const e=r.trim();return/^('|")/.test(e)?e:`"${e}"`}function jM(r){return typeof process>"u"?r:r.trim().split(",").map(HM).join(",")}function GM(r){if(!r)return"";const e=r.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}function qM(r){if(!r)return"";const e=r.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}let rc=class Iu{static parse(e="",t){let n="",i="",a="",s="",o="";const l=Vf(e).trim().split(" "),u={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return l.forEach(c=>{switch(!0){case(!u.fontStyle&&Iu.styles.includes(c)):c!=="inherit"&&(n=c),u.fontStyle=!0;break;case(!u.fontVariant&&Iu.variants.includes(c)):c!=="inherit"&&(i=c),u.fontStyle=!0,u.fontVariant=!0;break;case(!u.fontWeight&&Iu.weights.includes(c)):c!=="inherit"&&(a=c),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0;break;case!u.fontSize:c!=="inherit"&&(s=c.split("/")[0]||""),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0,u.fontSize=!0;break;default:c!=="inherit"&&(o+=c)}}),new Iu(n,i,a,s,o,t)}static styles="normal|italic|oblique|inherit";static variants="normal|small-caps|inherit";static weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";fontFamily;fontSize;fontStyle;fontWeight;fontVariant;constructor(e,t,n,i,a,s){const o=s?typeof s=="string"?Iu.parse(s):s:{};this.fontFamily=a||o.fontFamily,this.fontSize=i||o.fontSize,this.fontStyle=e||o.fontStyle,this.fontWeight=n||o.fontWeight,this.fontVariant=t||o.fontVariant}toString(){return[GM(this.fontStyle),this.fontVariant,qM(this.fontWeight),this.fontSize,jM(this.fontFamily)].join(" ").trim()}},_a=class{x1;y1;x2;y2;constructor(e=Number.NaN,t=Number.NaN,n=Number.NaN,i=Number.NaN){this.x1=e,this.y1=t,this.x2=n,this.y2=i,this.addPoint(e,t),this.addPoint(n,i)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,t){typeof e<"u"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof t<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))}addX(e){this.addPoint(e,0)}addY(e){this.addPoint(0,e)}addBoundingBox(e){if(!e)return;const{x1:t,y1:n,x2:i,y2:a}=e;this.addPoint(t,n),this.addPoint(i,a)}sumCubic(e,t,n,i,a){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*n+3*(1-e)*Math.pow(e,2)*i+Math.pow(e,3)*a}bezierCurveAdd(e,t,n,i,a){const s=6*t-12*n+6*i,o=-3*t+9*n-9*i+3*a,l=3*n-3*t;if(o===0){if(s===0)return;const d=-l/s;0<d&&d<1&&(e?this.addX(this.sumCubic(d,t,n,i,a)):this.addY(this.sumCubic(d,t,n,i,a)));return}const u=Math.pow(s,2)-4*l*o;if(u<0)return;const c=(-s+Math.sqrt(u))/(2*o);0<c&&c<1&&(e?this.addX(this.sumCubic(c,t,n,i,a)):this.addY(this.sumCubic(c,t,n,i,a)));const f=(-s-Math.sqrt(u))/(2*o);0<f&&f<1&&(e?this.addX(this.sumCubic(f,t,n,i,a)):this.addY(this.sumCubic(f,t,n,i,a)))}addBezierCurve(e,t,n,i,a,s,o,l){this.addPoint(e,t),this.addPoint(o,l),this.bezierCurveAdd(!0,e,n,a,o),this.bezierCurveAdd(!1,t,i,s,l)}addQuadraticCurve(e,t,n,i,a,s){const o=e+.6666666666666666*(n-e),l=t+2/3*(i-t),u=o+1/3*(a-e),c=l+1/3*(s-t);this.addBezierCurve(e,t,o,u,l,c,a,s)}isPointInBox(e,t){const{x1:n,y1:i,x2:a,y2:s}=this;return n<=e&&e<=a&&i<=t&&t<=s}};class Dl extends Yn{modifiedEmSizeStack=!1;calculateOpacity(){let e=1,t=this;for(;t;){const n=t.getStyle("opacity",!1,!0);n.hasValue(!0)&&(e*=n.getNumber()),t=t.parent}return e}setContext(e,t=!1){if(!t){const n=this.getStyle("fill"),i=this.getStyle("fill-opacity"),a=this.getStyle("stroke"),s=this.getStyle("stroke-opacity");if(n.isUrlDefinition()){const h=n.getFillStyleDefinition(this,i);h&&(e.fillStyle=h)}else if(n.hasValue()){n.getString()==="currentColor"&&n.setValue(this.getStyle("color").getColor());const h=n.getColor();h!=="inherit"&&(e.fillStyle=h==="none"?"rgba(0,0,0,0)":h)}if(i.hasValue()){const h=new Mt(this.document,"fill",e.fillStyle).addOpacity(i).getColor();e.fillStyle=h}if(a.isUrlDefinition()){const h=a.getFillStyleDefinition(this,s);h&&(e.strokeStyle=h)}else if(a.hasValue()){a.getString()==="currentColor"&&a.setValue(this.getStyle("color").getColor());const h=a.getString();h!=="inherit"&&(e.strokeStyle=h==="none"?"rgba(0,0,0,0)":h)}if(s.hasValue()){const h=new Mt(this.document,"stroke",e.strokeStyle).addOpacity(s).getString();e.strokeStyle=h}const o=this.getStyle("stroke-width");if(o.hasValue()){const h=o.getPixels();e.lineWidth=h||$u}const l=this.getStyle("stroke-linecap"),u=this.getStyle("stroke-linejoin"),c=this.getStyle("stroke-miterlimit"),f=this.getStyle("stroke-dasharray"),d=this.getStyle("stroke-dashoffset");if(l.hasValue()&&(e.lineCap=l.getString()),u.hasValue()&&(e.lineJoin=u.getString()),c.hasValue()&&(e.miterLimit=c.getNumber()),f.hasValue()&&f.getString()!=="none"){const h=Hi(f.getString());typeof e.setLineDash<"u"?e.setLineDash(h):typeof e.webkitLineDash<"u"?e.webkitLineDash=h:typeof e.mozDash<"u"&&!(h.length===1&&h[0]===0)&&(e.mozDash=h);const g=d.getPixels();typeof e.lineDashOffset<"u"?e.lineDashOffset=g:typeof e.webkitLineDashOffset<"u"?e.webkitLineDashOffset=g:typeof e.mozDashOffset<"u"&&(e.mozDashOffset=g)}}if(this.modifiedEmSizeStack=!1,typeof e.font<"u"){const n=this.getStyle("font"),i=this.getStyle("font-style"),a=this.getStyle("font-variant"),s=this.getStyle("font-weight"),o=this.getStyle("font-size"),l=this.getStyle("font-family"),u=new rc(i.getString(),a.getString(),s.getString(),o.hasValue()?`${o.getPixels(!0)}px`:"",l.getString(),rc.parse(n.getString(),e.font));i.setValue(u.fontStyle),a.setValue(u.fontVariant),s.setValue(u.fontWeight),o.setValue(u.fontSize),l.setValue(u.fontFamily),e.font=u.toString(),o.isPixels()&&(this.document.emSize=o.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}}class ko extends Dl{type="text";x=0;y=0;leafTexts=[];textChunkStart=0;minX=Number.POSITIVE_INFINITY;maxX=Number.NEGATIVE_INFINITY;measureCache=-1;constructor(e,t,n){super(e,t,new.target===ko?!0:n)}setContext(e,t=!1){super.setContext(e,t);const n=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();n&&(e.textBaseline=n)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(e){if(this.type!=="text")return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);let t=null;return this.children.forEach((n,i)=>{const a=this.getChildBoundingBox(e,this,this,i);t?t.addBoundingBox(a):t=a}),t}getFontSize(){const{document:e,parent:t}=this,n=rc.parse(e.ctx.font).fontSize;return t.getStyle("font-size").getNumber(n)}getTElementBoundingBox(e){const t=this.getFontSize();return new _a(this.x,this.y-t,this.x+this.measureText(e),this.y)}getGlyph(e,t,n){const i=t[n];let a;if(e.isArabic){const s=t.length,o=t[n-1],l=t[n+1];let u="isolated";(n===0||o===" ")&&n<s-1&&l!==" "&&(u="terminal"),n>0&&o!==" "&&n<s-1&&l!==" "&&(u="medial"),n>0&&o!==" "&&(n===s-1||l===" ")&&(u="initial"),a=e.arabicGlyphs[i]?.[u]||e.glyphs[i]}else a=e.glyphs[i];return a||(a=e.missingGlyph),a}getText(){return""}getTextFromNode(e){return(e||this.node).textContent}renderChildren(e){if(this.type!=="text"){this.renderTElementChildren(e);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((n,i)=>{this.renderChild(e,this,this,i)});const{mouse:t}=this.document.screen;t.isWorking()&&t.checkBoundingBox(this,this.getBoundingBox(e))}renderTElementChildren(e){const{document:t,parent:n}=this,i=this.getText(),a=n.getStyle("font-family").getDefinition();if(a?.fontFace){const{unitsPerEm:l}=a.fontFace,u=rc.parse(t.ctx.font),c=n.getStyle("font-size").getNumber(u.fontSize),f=n.getStyle("font-style").getString(u.fontStyle),d=c/l,h=a.isRTL?i.split("").reverse().join(""):i,g=Hi(n.getAttribute("dx").getString()),v=h.length;for(let y=0;y<v;y++){const A=this.getGlyph(a,h,y);e.translate(this.x,this.y),e.scale(d,-d);const C=e.lineWidth;e.lineWidth=e.lineWidth*l/c,f==="italic"&&e.transform(1,0,.4,1,0,0),A.render(e),f==="italic"&&e.transform(1,0,-.4,1,0,0),e.lineWidth=C,e.scale(1/d,-1/d),e.translate(-this.x,-this.y),this.x+=c*(A.horizAdvX||a.horizAdvX)/l,typeof g[y]<"u"&&!isNaN(g[y])&&(this.x+=g[y])}return}const{x:s,y:o}=this;e.fillStyle&&e.fillText(i,s,o),e.strokeStyle&&e.strokeText(i,s,o)}applyAnchoring(){if(this.textChunkStart>=this.leafTexts.length)return;const e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),n=!1;let i=0;t==="start"&&!n||t==="end"&&n?i=e.x-this.minX:t==="end"&&!n||t==="start"&&n?i=e.x-this.maxX:i=e.x-(this.minX+this.maxX)/2;for(let a=this.textChunkStart;a<this.leafTexts.length;a++)this.leafTexts[a].x+=i;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}adjustChildCoordinatesRecursive(e){this.children.forEach((t,n)=>{this.adjustChildCoordinatesRecursiveCore(e,this,this,n)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,t,n,i){const a=n.children[i];a.children.length>0?a.children.forEach((s,o)=>{t.adjustChildCoordinatesRecursiveCore(e,t,a,o)}):this.adjustChildCoordinates(e,t,n,i)}adjustChildCoordinates(e,t,n,i){const a=n.children[i];if(typeof a.measureText!="function")return a;e.save(),a.setContext(e,!0);const s=a.getAttribute("x"),o=a.getAttribute("y"),l=a.getAttribute("dx"),u=a.getAttribute("dy"),f=!!a.getStyle("font-family").getDefinition()?.isRTL;i===0&&(s.hasValue()||s.setValue(a.getInheritedAttribute("x")),o.hasValue()||o.setValue(a.getInheritedAttribute("y")),l.hasValue()||l.setValue(a.getInheritedAttribute("dx")),u.hasValue()||u.setValue(a.getInheritedAttribute("dy")));const d=a.measureText(e);return f&&(t.x-=d),s.hasValue()?(t.applyAnchoring(),a.x=s.getPixels("x"),l.hasValue()&&(a.x+=l.getPixels("x"))):(l.hasValue()&&(t.x+=l.getPixels("x")),a.x=t.x),t.x=a.x,f||(t.x+=d),o.hasValue()?(a.y=o.getPixels("y"),u.hasValue()&&(a.y+=u.getPixels("y"))):(u.hasValue()&&(t.y+=u.getPixels("y")),a.y=t.y),t.y=a.y,t.leafTexts.push(a),t.minX=Math.min(t.minX,a.x,a.x+d),t.maxX=Math.max(t.maxX,a.x,a.x+d),a.clearContext(e),e.restore(),a}getChildBoundingBox(e,t,n,i){const a=n.children[i];if(typeof a.getBoundingBox!="function")return null;const s=a.getBoundingBox(e);return s&&a.children.forEach((o,l)=>{const u=t.getChildBoundingBox(e,t,a,l);s.addBoundingBox(u)}),s}renderChild(e,t,n,i){const a=n.children[i];a.render(e),a.children.forEach((s,o)=>{t.renderChild(e,t,a,o)})}measureText(e){const{measureCache:t}=this;if(~t)return t;const n=this.getText(),i=this.measureTargetText(e,n);return this.measureCache=i,i}measureTargetText(e,t){if(!t.length)return 0;const{parent:n}=this,i=n.getStyle("font-family").getDefinition();if(i){const s=this.getFontSize(),o=i.isRTL?t.split("").reverse().join(""):t,l=Hi(n.getAttribute("dx").getString()),u=o.length;let c=0;for(let f=0;f<u;f++){const d=this.getGlyph(i,o,f);c+=(d.horizAdvX||i.horizAdvX)*s/i.fontFace.unitsPerEm,typeof l[f]<"u"&&!isNaN(l[f])&&(c+=l[f])}return c}if(!e.measureText)return t.length*10;e.save(),this.setContext(e,!0);const{width:a}=e.measureText(t);return this.clearContext(e),e.restore(),a}getInheritedAttribute(e){let t=this;for(;t instanceof ko&&t.isFirstChild()&&t.parent;){const n=t.parent.getAttribute(e);if(n.hasValue(!0))return n.getString("0");t=t.parent}return null}}class Hg extends ko{type="tspan";text;constructor(e,t,n){super(e,t,new.target===Hg?!0:n),this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}}class WM extends Hg{type="textNode"}class cr extends Le{control=new Rn(0,0);start=new Rn(0,0);current=new Rn(0,0);command=null;i=-1;previousCommand=null;points=[];angles=[];constructor(e){super(e.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,""))}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new Rn(0,0),this.control=new Rn(0,0),this.current=new Rn(0,0),this.points=[],this.angles=[]}isEnd(){const{i:e,commands:t}=this;return e>=t.length-1}next(){const e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(e="x",t="y"){const n=new Rn(this.command[e],this.command[t]);return this.makeAbsolute(n)}getAsControlPoint(e,t){const n=this.getPoint(e,t);return this.control=n,n}getAsCurrentPoint(e,t){const n=this.getPoint(e,t);return this.current=n,n}getReflectedControlPoint(){const e=this.previousCommand.type;if(e!==Le.CURVE_TO&&e!==Le.SMOOTH_CURVE_TO&&e!==Le.QUAD_TO&&e!==Le.SMOOTH_QUAD_TO)return this.current;const{current:{x:t,y:n},control:{x:i,y:a}}=this;return new Rn(2*t-i,2*n-a)}makeAbsolute(e){if(this.command.relative){const{x:t,y:n}=this.current;e.x+=t,e.y+=n}return e}addMarker(e,t,n){const{points:i,angles:a}=this;n&&a.length>0&&!a[a.length-1]&&(a[a.length-1]=i[i.length-1].angleTo(n)),this.addMarkerAngle(e,t?t.angleTo(e):null)}addMarkerAngle(e,t){this.points.push(e),this.angles.push(t)}getMarkerPoints(){return this.points}getMarkerAngles(){const{angles:e}=this,t=e.length;for(let n=0;n<t;n++)if(!e[n]){for(let i=n+1;i<t;i++)if(e[i]){e[n]=e[i];break}}return e}}class Kr extends Dl{type="path";pathParser;constructor(e,t,n){super(e,t,n),this.pathParser=new cr(this.getAttribute("d").getString())}path(e){const{pathParser:t}=this,n=new _a;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case cr.MOVE_TO:this.pathM(e,n);break;case cr.LINE_TO:this.pathL(e,n);break;case cr.HORIZ_LINE_TO:this.pathH(e,n);break;case cr.VERT_LINE_TO:this.pathV(e,n);break;case cr.CURVE_TO:this.pathC(e,n);break;case cr.SMOOTH_CURVE_TO:this.pathS(e,n);break;case cr.QUAD_TO:this.pathQ(e,n);break;case cr.SMOOTH_QUAD_TO:this.pathT(e,n);break;case cr.ARC:this.pathA(e,n);break;case cr.CLOSE_PATH:this.pathZ(e,n);break}return n}getBoundingBox(e){return this.path()}getMarkers(){const{pathParser:e}=this,t=e.getMarkerPoints(),n=e.getMarkerAngles();return!t||!n?null:t.map((a,s)=>[a,n[s]])}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);const t=this.getStyle("fill-rule");e.fillStyle!==""&&(t.getString("inherit")!=="inherit"?e.fill(t.getString()):e.fill()),e.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());const n=this.getMarkers();if(n){const i=n.length-1,a=this.getStyle("marker-start"),s=this.getStyle("marker-mid"),o=this.getStyle("marker-end");if(a.isUrlDefinition()){const l=a.getDefinition(),[u,c]=n[0];l&&l.render(e,u,c===null?void 0:c)}if(s.isUrlDefinition()){const l=s.getDefinition();for(let u=1;u<i;u++){const[c,f]=n[u];l&&l.render(e,c,f===null?void 0:f)}}if(o.isUrlDefinition()){const l=o.getDefinition(),[u,c]=n[i];l&&l.render(e,u,c===null?void 0:c)}}}static pathM(e){const t=e.getAsCurrentPoint();return e.start=e.current,{point:t}}pathM(e,t){const{pathParser:n}=this,{point:i}=Kr.pathM(n),{x:a,y:s}=i;n.addMarker(i),t.addPoint(a,s),e&&e.moveTo(a,s)}static pathL(e){const{current:t}=e,n=e.getAsCurrentPoint();return{current:t,point:n}}pathL(e,t){const{pathParser:n}=this,{current:i,point:a}=Kr.pathL(n),{x:s,y:o}=a;n.addMarker(a,i),t.addPoint(s,o),e&&e.lineTo(s,o)}static pathH(e){const{current:t,command:n}=e,i=new Rn((n?.relative?t.x:0)+n.x,t.y);return e.current=i,{current:t,point:i}}pathH(e,t){const{pathParser:n}=this,{current:i,point:a}=Kr.pathH(n),{x:s,y:o}=a;n.addMarker(a,i),t.addPoint(s,o),e&&e.lineTo(s,o)}static pathV(e){const{current:t,command:n}=e,i=new Rn(t.x,(n.relative?t.y:0)+n.y);return e.current=i,{current:t,point:i}}pathV(e,t){const{pathParser:n}=this,{current:i,point:a}=Kr.pathV(n),{x:s,y:o}=a;n.addMarker(a,i),t.addPoint(s,o),e&&e.lineTo(s,o)}static pathC(e){const{current:t}=e,n=e.getPoint("x1","y1"),i=e.getAsControlPoint("x2","y2"),a=e.getAsCurrentPoint();return{current:t,point:n,controlPoint:i,currentPoint:a}}pathC(e,t){const{pathParser:n}=this,{current:i,point:a,controlPoint:s,currentPoint:o}=Kr.pathC(n);n.addMarker(o,s,a),t.addBezierCurve(i.x,i.y,a.x,a.y,s.x,s.y,o.x,o.y),e&&e.bezierCurveTo(a.x,a.y,s.x,s.y,o.x,o.y)}static pathS(e){const{current:t}=e,n=e.getReflectedControlPoint(),i=e.getAsControlPoint("x2","y2"),a=e.getAsCurrentPoint();return{current:t,point:n,controlPoint:i,currentPoint:a}}pathS(e,t){const{pathParser:n}=this,{current:i,point:a,controlPoint:s,currentPoint:o}=Kr.pathS(n);n.addMarker(o,s,a),t.addBezierCurve(i.x,i.y,a.x,a.y,s.x,s.y,o.x,o.y),e&&e.bezierCurveTo(a.x,a.y,s.x,s.y,o.x,o.y)}static pathQ(e){const{current:t}=e,n=e.getAsControlPoint("x1","y1"),i=e.getAsCurrentPoint();return{current:t,controlPoint:n,currentPoint:i}}pathQ(e,t){const{pathParser:n}=this,{current:i,controlPoint:a,currentPoint:s}=Kr.pathQ(n);n.addMarker(s,a,a),t.addQuadraticCurve(i.x,i.y,a.x,a.y,s.x,s.y),e&&e.quadraticCurveTo(a.x,a.y,s.x,s.y)}static pathT(e){const{current:t}=e,n=e.getReflectedControlPoint();e.control=n;const i=e.getAsCurrentPoint();return{current:t,controlPoint:n,currentPoint:i}}pathT(e,t){const{pathParser:n}=this,{current:i,controlPoint:a,currentPoint:s}=Kr.pathT(n);n.addMarker(s,a,a),t.addQuadraticCurve(i.x,i.y,a.x,a.y,s.x,s.y),e&&e.quadraticCurveTo(a.x,a.y,s.x,s.y)}static pathA(e){const{current:t,command:n}=e;let{rX:i,rY:a,xRot:s,lArcFlag:o,sweepFlag:l}=n;const u=s*(Math.PI/180),c=e.getAsCurrentPoint(),f=new Rn(Math.cos(u)*(t.x-c.x)/2+Math.sin(u)*(t.y-c.y)/2,-Math.sin(u)*(t.x-c.x)/2+Math.cos(u)*(t.y-c.y)/2),d=Math.pow(f.x,2)/Math.pow(i,2)+Math.pow(f.y,2)/Math.pow(a,2);d>1&&(i*=Math.sqrt(d),a*=Math.sqrt(d));let h=(o===l?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(a,2)-Math.pow(i,2)*Math.pow(f.y,2)-Math.pow(a,2)*Math.pow(f.x,2))/(Math.pow(i,2)*Math.pow(f.y,2)+Math.pow(a,2)*Math.pow(f.x,2)));isNaN(h)&&(h=0);const g=new Rn(h*i*f.y/a,h*-a*f.x/i),v=new Rn((t.x+c.x)/2+Math.cos(u)*g.x-Math.sin(u)*g.y,(t.y+c.y)/2+Math.sin(u)*g.x+Math.cos(u)*g.y),y=NC([1,0],[(f.x-g.x)/i,(f.y-g.y)/a]),A=[(f.x-g.x)/i,(f.y-g.y)/a],C=[(-f.x-g.x)/i,(-f.y-g.y)/a];let S=NC(A,C);return Gy(A,C)<=-1&&(S=Math.PI),Gy(A,C)>=1&&(S=0),{currentPoint:c,rX:i,rY:a,sweepFlag:l,xAxisRotation:u,centp:v,a1:y,ad:S}}pathA(e,t){const{pathParser:n}=this,{currentPoint:i,rX:a,rY:s,sweepFlag:o,xAxisRotation:l,centp:u,a1:c,ad:f}=Kr.pathA(n),d=1-o?1:-1,h=c+d*(f/2),g=new Rn(u.x+a*Math.cos(h),u.y+s*Math.sin(h));if(n.addMarkerAngle(g,h-d*Math.PI/2),n.addMarkerAngle(i,h-d*Math.PI),t.addPoint(i.x,i.y),e&&!isNaN(c)&&!isNaN(f)){const v=a>s?a:s,y=a>s?1:a/s,A=a>s?s/a:1;e.translate(u.x,u.y),e.rotate(l),e.scale(y,A),e.arc(0,0,v,c,c+f,!!(1-o)),e.scale(1/y,1/A),e.rotate(-l),e.translate(-u.x,-u.y)}}static pathZ(e){e.current=e.start}pathZ(e,t){Kr.pathZ(this.pathParser),e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath()}}class $f extends Dl{type="svg";root=!1;setContext(e){const{document:t}=this,{screen:n,window:i}=t,a=e.canvas;if(n.setDefaults(e),"style"in a&&typeof e.font<"u"&&i&&typeof i.getComputedStyle<"u"){e.font=i.getComputedStyle(a).getPropertyValue("font");const A=new Mt(t,"fontSize",rc.parse(e.font).fontSize);A.hasValue()&&(t.rootEmSize=A.getPixels("y"),t.emSize=t.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);let{width:s,height:o}=n.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");const l=this.getAttribute("refX"),u=this.getAttribute("refY"),c=this.getAttribute("viewBox"),f=c.hasValue()?Hi(c.getString()):null,d=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible";let h=0,g=0,v=0,y=0;f&&(h=f[0],g=f[1]),this.root||(s=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y"),this.type==="marker"&&(v=h,y=g,h=0,g=0)),n.viewPort.setCurrent(s,o),this.node&&(!this.parent||this.node.parentNode?.nodeName==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),f&&(s=f[2],o=f[3]),t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:n.viewPort.width,desiredWidth:s,height:n.viewPort.height,desiredHeight:o,minX:h,minY:g,refX:l.getValue(),refY:u.getValue(),clip:d,clipX:v,clipY:y}),f&&(n.viewPort.removeCurrent(),n.viewPort.setCurrent(s,o))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e,t=e,n=!1){const i=this.getAttribute("width",!0),a=this.getAttribute("height",!0),s=this.getAttribute("viewBox"),o=this.getAttribute("style"),l=i.getNumber(0),u=a.getNumber(0);if(n)if(typeof n=="string")this.getAttribute("preserveAspectRatio",!0).setValue(n);else{const c=this.getAttribute("preserveAspectRatio");c.hasValue()&&c.setValue(c.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(i.setValue(e),a.setValue(t),s.hasValue()||s.setValue(`0 0 ${l||e} ${u||t}`),o.hasValue()){const c=this.getStyle("width"),f=this.getStyle("height");c.hasValue()&&c.setValue(`${e}px`),f.hasValue()&&f.setValue(`${t}px`)}}}class ST extends Kr{type="rect";path(e){const t=this.getAttribute("x").getPixels("x"),n=this.getAttribute("y").getPixels("y"),i=this.getStyle("width",!1,!0).getPixels("x"),a=this.getStyle("height",!1,!0).getPixels("y"),s=this.getAttribute("rx"),o=this.getAttribute("ry");let l=s.getPixels("x"),u=o.getPixels("y");if(s.hasValue()&&!o.hasValue()&&(u=l),o.hasValue()&&!s.hasValue()&&(l=u),l=Math.min(l,i/2),u=Math.min(u,a/2),e){const c=4*((Math.sqrt(2)-1)/3);e.beginPath(),a>0&&i>0&&(e.moveTo(t+l,n),e.lineTo(t+i-l,n),e.bezierCurveTo(t+i-l+c*l,n,t+i,n+u-c*u,t+i,n+u),e.lineTo(t+i,n+a-u),e.bezierCurveTo(t+i,n+a-u+c*u,t+i-l+c*l,n+a,t+i-l,n+a),e.lineTo(t+l,n+a),e.bezierCurveTo(t+l-c*l,n+a,t,n+a-u+c*u,t,n+a-u),e.lineTo(t,n+u),e.bezierCurveTo(t,n+u-c*u,t+l-c*l,n,t+l,n),e.closePath())}return new _a(t,n,t+i,n+a)}getMarkers(){return null}}class QM extends Kr{type="circle";path(e){const t=this.getAttribute("cx").getPixels("x"),n=this.getAttribute("cy").getPixels("y"),i=this.getAttribute("r").getPixels();return e&&i>0&&(e.beginPath(),e.arc(t,n,i,0,Math.PI*2,!1),e.closePath()),new _a(t-i,n-i,t+i,n+i)}getMarkers(){return null}}class YM extends Kr{type="ellipse";path(e){const t=4*((Math.sqrt(2)-1)/3),n=this.getAttribute("rx").getPixels("x"),i=this.getAttribute("ry").getPixels("y"),a=this.getAttribute("cx").getPixels("x"),s=this.getAttribute("cy").getPixels("y");return e&&n>0&&i>0&&(e.beginPath(),e.moveTo(a+n,s),e.bezierCurveTo(a+n,s+t*i,a+t*n,s+i,a,s+i),e.bezierCurveTo(a-t*n,s+i,a-n,s+t*i,a-n,s),e.bezierCurveTo(a-n,s-t*i,a-t*n,s-i,a,s-i),e.bezierCurveTo(a+t*n,s-i,a+n,s-t*i,a+n,s),e.closePath()),new _a(a-n,s-i,a+n,s+i)}getMarkers(){return null}}class XM extends Kr{type="line";getPoints(){return[new Rn(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new Rn(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(e){const[{x:t,y:n},{x:i,y:a}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(t,n),e.lineTo(i,a)),new _a(t,n,i,a)}getMarkers(){const[e,t]=this.getPoints(),n=e.angleTo(t);return[[e,n],[t,n]]}}class ET extends Kr{type="polyline";points=[];constructor(e,t,n){super(e,t,n),this.points=Rn.parsePath(this.getAttribute("points").getString())}path(e){const{points:t}=this,[{x:n,y:i}]=t,a=new _a(n,i);return e&&(e.beginPath(),e.moveTo(n,i)),t.forEach(({x:s,y:o})=>{a.addPoint(s,o),e&&e.lineTo(s,o)}),a}getMarkers(){const{points:e}=this,t=e.length-1,n=[];return e.forEach((i,a)=>{a!==t&&n.push([i,i.angleTo(e[a+1])])}),n.length>0&&n.push([e[e.length-1],n[n.length-1][1]]),n}}class JM extends ET{type="polygon";path(e){const t=super.path(e),[{x:n,y:i}]=this.points;return e&&(e.lineTo(n,i),e.closePath()),t}}class KM extends Yn{type="pattern";createPattern(e,t,n){const i=this.getStyle("width").getPixels("x",!0),a=this.getStyle("height").getPixels("y",!0),s=this.getAttribute("data-frame-width"),o=this.getAttribute("data-frame-height"),l=s.hasValue()?s.getPixels("x",!0):i,u=o.hasValue()?o.getPixels("y",!0):a,c=s.hasValue()&&o.hasValue(),f=new $f(this.document,void 0);f.attributes.viewBox=new Mt(this.document,"viewBox",this.getAttribute("viewBox").getValue()),f.attributes.width=new Mt(this.document,"width",`${l}px`),f.attributes.height=new Mt(this.document,"height",`${u}px`),f.attributes.transform=new Mt(this.document,"transform",this.getAttribute("patternTransform").getValue()),f.children=this.children;const d=this.document.createCanvas(l,u),h=d.getContext("2d");h.imageSmoothingEnabled=!0,h.imageSmoothingQuality="high";const g=this.getAttribute("x"),v=this.getAttribute("y");g.hasValue()&&v.hasValue()&&h.translate(g.getPixels("x",!0),v.getPixels("y",!0)),n.hasValue()?this.styles["fill-opacity"]=n:Reflect.deleteProperty(this.styles,"fill-opacity");for(let A=-1;A<=1;A++)for(let C=-1;C<=1;C++)h.save(),f.attributes.x=new Mt(this.document,"x",A*d.width),f.attributes.y=new Mt(this.document,"y",C*d.height),f.render(h),h.restore();return e.createPattern(d,c?"no-repeat":"repeat")}}class ZM extends Yn{type="marker";render(e,t,n){if(!t)return;const{x:i,y:a}=t,s=this.getAttribute("orient").getString("auto"),o=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(i,a),s==="auto"&&n&&e.rotate(n),o==="strokeWidth"&&e.scale(e.lineWidth,e.lineWidth),e.save();const l=new $f(this.document);l.type=this.type,l.attributes.viewBox=new Mt(this.document,"viewBox",this.getAttribute("viewBox").getValue()),l.attributes.refX=new Mt(this.document,"refX",this.getAttribute("refX").getValue()),l.attributes.refY=new Mt(this.document,"refY",this.getAttribute("refY").getValue()),l.attributes.width=new Mt(this.document,"width",this.getAttribute("markerWidth").getValue()),l.attributes.height=new Mt(this.document,"height",this.getAttribute("markerHeight").getValue()),l.attributes.overflow=new Mt(this.document,"overflow",this.getAttribute("overflow").getValue()),l.attributes.fill=new Mt(this.document,"fill",this.getAttribute("fill").getColor("black")),l.attributes.stroke=new Mt(this.document,"stroke",this.getAttribute("stroke").getValue("none")),l.children=this.children,l.render(e),e.restore(),o==="strokeWidth"&&e.scale(1/e.lineWidth,1/e.lineWidth),s==="auto"&&n&&e.rotate(-n),e.translate(-i,-a)}}class e_ extends Yn{type="defs";render(){}}class r1 extends Dl{type="g";getBoundingBox(e){const t=new _a;return this.children.forEach(n=>{n instanceof Kr&&t.addBoundingBox(n.getBoundingBox(e))}),t}}class kT extends Yn{attributesToInherit=["gradientUnits"];stops=[];constructor(e,t,n){super(e,t,n);const{stops:i,children:a}=this;a.forEach(s=>{s.type==="stop"&&i.push(s)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(e,t,n){let i=this;this.getHrefAttribute().hasValue()&&(i=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(i));const{stops:a}=i,s=this.getGradient(e,t);if(!s)return this.addParentOpacity(n,a[a.length-1].color);if(a.forEach(o=>{s.addColorStop(o.offset,this.addParentOpacity(n,o.color))}),this.getAttribute("gradientTransform").hasValue()){const{document:o}=this,{MAX_VIRTUAL_PIXELS:l}=zf,{viewPort:u}=o.screen,c=u.getRoot(),f=new ST(o);f.attributes.x=new Mt(o,"x",-l/3),f.attributes.y=new Mt(o,"y",-l/3),f.attributes.width=new Mt(o,"width",l),f.attributes.height=new Mt(o,"height",l);const d=new r1(o);d.attributes.transform=new Mt(o,"transform",this.getAttribute("gradientTransform").getValue()),d.children=[f];const h=new $f(o);h.attributes.x=new Mt(o,"x",0),h.attributes.y=new Mt(o,"y",0),h.attributes.width=new Mt(o,"width",c.width),h.attributes.height=new Mt(o,"height",c.height),h.children=[d];const g=o.createCanvas(c.width,c.height),v=g.getContext("2d");return v.fillStyle=s,h.render(v),v.createPattern(g,"no-repeat")}return s}inheritStopContainer(e){this.attributesToInherit.forEach(t=>{!this.getAttribute(t).hasValue()&&e.getAttribute(t).hasValue()&&this.getAttribute(t,!0).setValue(e.getAttribute(t).getValue())})}addParentOpacity(e,t){return e.hasValue()?new Mt(this.document,"color",t).addOpacity(e).getColor():t}}class t_ extends kT{type="linearGradient";constructor(e,t,n){super(e,t,n),this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(e,t){const n=this.getGradientUnits()==="objectBoundingBox",i=n?t.getBoundingBox(e):null;if(n||!i)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));const a=n?i.x+i.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),s=n?i.y+i.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),o=n?i.x+i.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),l=n?i.y+i.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return a===o&&s===l?null:e.createLinearGradient(a,s,o,l)}}class r_ extends kT{type="radialGradient";constructor(e,t,n){super(e,t,n),this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(e,t){const n=this.getGradientUnits()==="objectBoundingBox",i=t.getBoundingBox(e);if(n&&!i)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");const a=n?i.x+i.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),s=n?i.y+i.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y");let o=a,l=s;this.getAttribute("fx").hasValue()&&(o=n?i.x+i.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(l=n?i.y+i.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));const u=n?(i.width+i.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),c=this.getAttribute("fr").getPixels();return e.createRadialGradient(o,l,c,a,s,u)}}class n_ extends Yn{type="stop";offset;color;constructor(e,t,n){super(e,t,n);const i=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),a=this.getStyle("stop-opacity");let s=this.getStyle("stop-color",!0);s.getString()===""&&s.setValue("#000"),a.hasValue()&&(s=s.addOpacity(a)),this.offset=i,this.color=s.getColor()}}class n1 extends Yn{type="animate";begin;maxDuration;from;to;values;duration=0;initialValue;initialUnits="";removed=!1;frozen=!1;constructor(e,t,n){super(e,t,n),e.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new Mt(e,"values",null);const i=this.getAttribute("values");i.hasValue()&&this.values.setValue(i.getString().split(";"))}getProperty(){const e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return e==="CSS"?this.parent?.getStyle(t,!0):this.parent?.getAttribute(t,!0)}calcValue(){const{initialUnits:e}=this,{progress:t,from:n,to:i}=this.getProgress();let a=n.getNumber()+(i.getNumber()-n.getNumber())*t;return e==="%"&&(a*=100),`${a}${e}`}update(e){const{parent:t}=this,n=this.getProperty();if(!n)return!1;if(this.initialValue||(this.initialValue=n.getString(),this.initialUnits=n.getUnits()),this.duration>this.maxDuration){const a=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(a==="freeze"&&!this.frozen)this.frozen=!0,t&&n&&(t.animationFrozen=!0,t.animationFrozenValue=n.getString());else if(a==="remove"&&!this.removed)return this.removed=!0,t&&n&&n.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=e;let i=!1;if(this.begin<this.duration){let a=this.calcValue();const s=this.getAttribute("type");s.hasValue()&&(a=`${s.getString()}(${a})`),n.setValue(a),i=!0}return i}getProgress(){const{document:e,values:t}=this;let n=(this.duration-this.begin)/(this.maxDuration-this.begin),i,a;if(t.hasValue()){const s=n*(t.getValue().length-1),o=Math.floor(s),l=Math.ceil(s);let u;u=t.getValue()[o],i=new Mt(e,"from",u?parseFloat(u):0),u=t.getValue()[l],a=new Mt(e,"to",u?parseFloat(u):0),n=(s-o)/(l-o)}else i=this.from,a=this.to;return{progress:n,from:i,to:a}}}class i_ extends n1{type="animateColor";calcValue(){const{progress:e,from:t,to:n}=this.getProgress(),i=new Hy(t.getColor()),a=new Hy(n.getColor());if(i.ok&&a.ok){const s=i.r+(a.r-i.r)*e,o=i.g+(a.g-i.g)*e,l=i.b+(a.b-i.b)*e;return`rgb(${Math.floor(s)}, ${Math.floor(o)}, ${Math.floor(l)})`}return this.getAttribute("from").getColor()}}class a_ extends n1{type="animateTransform";calcValue(){const{progress:e,from:t,to:n}=this.getProgress(),i=Hi(t.getString()),a=Hi(n.getString());return i.map((o,l)=>{const u=a[l];return o+(u-o)*e}).join(" ")}}class TT extends Yn{type="font-face";ascent;descent;unitsPerEm;constructor(e,t,n){super(e,t,n),this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class i1 extends Kr{type="glyph";horizAdvX;unicode;arabicForm;constructor(e,t,n){super(e,t,n),this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class FT extends i1{type="missing-glyph";horizAdvX=0}class s_ extends Yn{type="font";isArabic=!1;missingGlyph;glyphs={};arabicGlyphs={};horizAdvX;isRTL=!1;fontFace;constructor(e,t,n){super(e,t,n),this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();const{definitions:i}=e,{children:a}=this;for(const s of a)if(s instanceof TT){this.fontFace=s;const o=s.getStyle("font-family");o.hasValue()&&(i[o.getString()]=this)}else if(s instanceof FT)this.missingGlyph=s;else if(s instanceof i1)if(s.arabicForm){this.isRTL=!0,this.isArabic=!0;const o=this.arabicGlyphs[s.unicode];typeof o>"u"?this.arabicGlyphs[s.unicode]={[s.arabicForm]:s}:o[s.arabicForm]=s}else this.glyphs[s.unicode]=s}render(){}}class o_ extends ko{type="tref";getText(){const e=this.getHrefAttribute().getDefinition();if(e){const t=e.children[0];if(t)return t.getText()}return""}}class l_ extends ko{type="a";hasText;text;constructor(e,t,n){super(e,t,n);const{childNodes:i}=t,a=i[0],s=i.length>0&&Array.from(i).every(o=>o.nodeType===3);this.hasText=s,this.text=s?this.getTextFromNode(a):""}getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);const{document:t,x:n,y:i}=this,{mouse:a}=t.screen,s=new Mt(t,"fontSize",rc.parse(t.ctx.font).fontSize);a.isWorking()&&a.checkBoundingBox(this,new _a(n,i-s.getPixels("y"),n+this.measureText(e),i))}else if(this.children.length>0){const t=new r1(this.document);t.children=this.children,t.parent=this,t.render(e)}}onClick(){const{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){const e=this.document.ctx;e.canvas.style.cursor="pointer"}}class u_ extends ko{type="textPath";textWidth=0;textHeight=0;pathLength=-1;glyphInfo=null;text;dataArray;letterSpacingCache=[];equidistantCache=null;measuresCache=new Map([["",0]]);constructor(e,t,n){super(e,t,n);const i=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(i)}getText(){return this.text}path(e){const{dataArray:t}=this;e&&e.beginPath(),t.forEach(({type:n,points:i})=>{switch(n){case cr.LINE_TO:e&&e.lineTo(i[0],i[1]);break;case cr.MOVE_TO:e&&e.moveTo(i[0],i[1]);break;case cr.CURVE_TO:e&&e.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]);break;case cr.QUAD_TO:e&&e.quadraticCurveTo(i[0],i[1],i[2],i[3]);break;case cr.ARC:{const[a,s,o,l,u,c,f,d]=i,h=o>l?o:l,g=o>l?1:o/l,v=o>l?l/o:1;e&&(e.translate(a,s),e.rotate(f),e.scale(g,v),e.arc(0,0,h,u,u+c,!!(1-d)),e.scale(1/g,1/v),e.rotate(-f),e.translate(-a,-s));break}case cr.CLOSE_PATH:e&&e.closePath();break}})}renderChildren(e){this.setTextData(e),e.save();const t=this.parent?.getStyle("text-decoration").getString(),n=this.getFontSize(),{glyphInfo:i}=this,a=e.fillStyle;t==="underline"&&e.beginPath(),i.forEach((s,o)=>{const{p0:l,p1:u,rotation:c,text:f}=s;e.save(),e.translate(l.x,l.y),e.rotate(c),e.fillStyle&&e.fillText(f,0,0),e.strokeStyle&&e.strokeText(f,0,0),e.restore(),t==="underline"&&(o===0&&e.moveTo(l.x,l.y+n/8),e.lineTo(u.x,u.y+n/5))}),t==="underline"&&(e.lineWidth=n/20,e.strokeStyle=a,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(e=0){return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,t,n,i,a,s,o,l,u){let c=s,f=this.measureText(e,l);l===" "&&t==="justify"&&n<i&&(f+=(i-n)/a),u>-1&&(c+=this.getLetterSpacingAt(u));const d=this.textHeight/20,h=this.getEquidistantPointOnPath(c,d,0),g=this.getEquidistantPointOnPath(c+f,d,0),v={p0:h,p1:g},y=h&&g?Math.atan2(g.y-h.y,g.x-h.x):0;if(o){const A=Math.cos(Math.PI/2+y)*o,C=Math.cos(-y)*o;v.p0={...h,distance:h.distance||0,x:h.x+A,y:h.y+C},v.p1={...g,distance:g.distance||0,x:g.x+A,y:g.y+C}}return c+=f,{offset:c,segment:v,rotation:y}}measureText(e,t){const{measuresCache:n}=this,i=t||this.getText();if(n.has(i))return n.get(i);const a=this.measureTargetText(e,i);return n.set(i,a),a}setTextData(e){if(this.glyphInfo)return;const t=this.getText(),n=t.split(""),i=t.split(" ").length-1,a=this.parent?.getAttribute("dx").split().map(S=>S.getPixels("x")),s=this.parent?.getAttribute("dy").getPixels("y"),o=this.getAttribute("text-anchor").getString("start"),l=this.getStyle("letter-spacing"),u=this.parent?.getStyle("letter-spacing");let c=0;!l.hasValue()||l.getValue()==="inherit"?c=u.getPixels():l.hasValue()&&l.getValue()!=="initial"&&l.getValue()!=="unset"&&(c=l.getPixels());const f=[],d=t.length;this.letterSpacingCache=f;for(let S=0;S<d;S++)f.push(typeof a[S]<"u"?a[S]:c);const h=f.reduce((S,F,E)=>E===0?0:S+F||0,0),g=this.measureText(e),v=Math.max(g+h,0);this.textWidth=g,this.textHeight=this.getFontSize(),this.glyphInfo=[];const y=this.getPathLength(),A=this.getAttribute("startOffset").getNumber(0)*y;let C=0;(o==="middle"||o==="center")&&(C=-v/2),(o==="end"||o==="right")&&(C=-v),C+=A,n.forEach((S,F)=>{const{offset:E,segment:R,rotation:B}=this.findSegmentToFitChar(e,o,v,y,i,C,s,S,F);C=E,!(!R.p0||!R.p1)&&this.glyphInfo.push({text:n[F],p0:R.p0,p1:R.p1,rotation:B})})}parsePathData(e){if(this.pathLength=-1,!e)return[];const t=[],{pathParser:n}=e;for(n.reset();!n.isEnd();){const{current:i}=n,a=i?i.x:0,s=i?i.y:0,o=n.next();let l=o.type,u=[];switch(o.type){case cr.MOVE_TO:this.pathM(n,u);break;case cr.LINE_TO:l=this.pathL(n,u);break;case cr.HORIZ_LINE_TO:l=this.pathH(n,u);break;case cr.VERT_LINE_TO:l=this.pathV(n,u);break;case cr.CURVE_TO:this.pathC(n,u);break;case cr.SMOOTH_CURVE_TO:l=this.pathS(n,u);break;case cr.QUAD_TO:this.pathQ(n,u);break;case cr.SMOOTH_QUAD_TO:l=this.pathT(n,u);break;case cr.ARC:u=this.pathA(n);break;case cr.CLOSE_PATH:Kr.pathZ(n);break}o.type!==cr.CLOSE_PATH?t.push({type:l,points:u,start:{x:a,y:s},pathLength:this.calcLength(a,s,l,u)}):t.push({type:cr.CLOSE_PATH,points:[],pathLength:0})}return t}pathM(e,t){const{x:n,y:i}=Kr.pathM(e).point;t.push(n,i)}pathL(e,t){const{x:n,y:i}=Kr.pathL(e).point;return t.push(n,i),cr.LINE_TO}pathH(e,t){const{x:n,y:i}=Kr.pathH(e).point;return t.push(n,i),cr.LINE_TO}pathV(e,t){const{x:n,y:i}=Kr.pathV(e).point;return t.push(n,i),cr.LINE_TO}pathC(e,t){const{point:n,controlPoint:i,currentPoint:a}=Kr.pathC(e);t.push(n.x,n.y,i.x,i.y,a.x,a.y)}pathS(e,t){const{point:n,controlPoint:i,currentPoint:a}=Kr.pathS(e);return t.push(n.x,n.y,i.x,i.y,a.x,a.y),cr.CURVE_TO}pathQ(e,t){const{controlPoint:n,currentPoint:i}=Kr.pathQ(e);t.push(n.x,n.y,i.x,i.y)}pathT(e,t){const{controlPoint:n,currentPoint:i}=Kr.pathT(e);return t.push(n.x,n.y,i.x,i.y),cr.QUAD_TO}pathA(e){let{rX:t,rY:n,sweepFlag:i,xAxisRotation:a,centp:s,a1:o,ad:l}=Kr.pathA(e);return i===0&&l>0&&(l-=2*Math.PI),i===1&&l<0&&(l+=2*Math.PI),[s.x,s.y,t,n,o,l,a,i]}calcLength(e,t,n,i){let a=0,s=null,o=null,l=0;switch(n){case cr.LINE_TO:return this.getLineLength(e,t,i[0],i[1]);case cr.CURVE_TO:for(a=0,s=this.getPointOnCubicBezier(0,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)o=this.getPointOnCubicBezier(l,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),a+=this.getLineLength(s.x,s.y,o.x,o.y),s=o;return a;case cr.QUAD_TO:for(a=0,s=this.getPointOnQuadraticBezier(0,e,t,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)o=this.getPointOnQuadraticBezier(l,e,t,i[0],i[1],i[2],i[3]),a+=this.getLineLength(s.x,s.y,o.x,o.y),s=o;return a;case cr.ARC:{a=0;const u=i[4],c=i[5],f=i[4]+c;let d=Math.PI/180;if(Math.abs(u-f)<d&&(d=Math.abs(u-f)),s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),c<0)for(l=u-d;l>f;l-=d)o=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),a+=this.getLineLength(s.x,s.y,o.x,o.y),s=o;else for(l=u+d;l<f;l+=d)o=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),a+=this.getLineLength(s.x,s.y,o.x,o.y),s=o;return o=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],f,0),a+=this.getLineLength(s.x,s.y,o.x,o.y),a}}return 0}getPointOnLine(e,t,n,i,a,s=t,o=n){const l=(a-n)/(i-t+$u);let u=Math.sqrt(e*e/(1+l*l));i<t&&(u*=-1);let c=l*u,f=null;if(i===t)f={x:s,y:o+c};else if((o-n)/(s-t+$u)===l)f={x:s+u,y:o+c};else{let d=0,h=0;const g=this.getLineLength(t,n,i,a);if(g<$u)return null;let v=(s-t)*(i-t)+(o-n)*(a-n);v/=g*g,d=t+v*(i-t),h=n+v*(a-n);const y=this.getLineLength(s,o,d,h),A=Math.sqrt(e*e-y*y);u=Math.sqrt(A*A/(1+l*l)),i<t&&(u*=-1),c=l*u,f={x:d+u,y:h+c}}return f}getPointOnPath(e){const t=this.getPathLength();let n=0,i=null;if(e<-5e-5||e-5e-5>t)return null;const{dataArray:a}=this;for(const s of a){if(s&&(s.pathLength<5e-5||n+s.pathLength+5e-5<e)){n+=s.pathLength;continue}const o=e-n;let l=0;switch(s.type){case cr.LINE_TO:i=this.getPointOnLine(o,s.start.x,s.start.y,s.points[0],s.points[1],s.start.x,s.start.y);break;case cr.ARC:{const u=s.points[4],c=s.points[5],f=s.points[4]+c;if(l=u+o/s.pathLength*c,c<0&&l<f||c>=0&&l>f)break;i=this.getPointOnEllipticalArc(s.points[0],s.points[1],s.points[2],s.points[3],l,s.points[6]);break}case cr.CURVE_TO:l=o/s.pathLength,l>1&&(l=1),i=this.getPointOnCubicBezier(l,s.start.x,s.start.y,s.points[0],s.points[1],s.points[2],s.points[3],s.points[4],s.points[5]);break;case cr.QUAD_TO:l=o/s.pathLength,l>1&&(l=1),i=this.getPointOnQuadraticBezier(l,s.start.x,s.start.y,s.points[0],s.points[1],s.points[2],s.points[3]);break}if(i)return i;break}return null}getLineLength(e,t,n,i){return Math.sqrt((n-e)*(n-e)+(i-t)*(i-t))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((e,t)=>t.pathLength>0?e+t.pathLength:e,0)),this.pathLength}getPointOnCubicBezier(e,t,n,i,a,s,o,l,u){const c=l*LC(e)+s*UC(e)+i*VC(e)+t*zC(e),f=u*LC(e)+o*UC(e)+a*VC(e)+n*zC(e);return{x:c,y:f}}getPointOnQuadraticBezier(e,t,n,i,a,s,o){const l=s*$C(e)+i*HC(e)+t*jC(e),u=o*$C(e)+a*HC(e)+n*jC(e);return{x:l,y:u}}getPointOnEllipticalArc(e,t,n,i,a,s){const o=Math.cos(s),l=Math.sin(s),u={x:n*Math.cos(a),y:i*Math.sin(a)};return{x:e+(u.x*o-u.y*l),y:t+(u.x*l+u.y*o)}}buildEquidistantCache(e,t){const n=this.getPathLength(),i=t||.25,a=e||n/100;if(!this.equidistantCache||this.equidistantCache.step!==a||this.equidistantCache.precision!==i){this.equidistantCache={step:a,precision:i,points:[]};let s=0;for(let o=0;o<=n;o+=i){const l=this.getPointOnPath(o),u=this.getPointOnPath(o+i);!l||!u||(s+=this.getLineLength(l.x,l.y,u.x,u.y),s>=a&&(this.equidistantCache.points.push({x:l.x,y:l.y,distance:o}),s-=a))}}}getEquidistantPointOnPath(e,t,n){if(this.buildEquidistantCache(t,n),e<0||e-this.getPathLength()>5e-5)return null;const i=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[i]||null}}const c_=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class d_ extends Dl{type="image";loaded=!1;image;constructor(e,t,n){super(e,t,n);const i=this.getHrefAttribute().getString();if(!i)return;const a=i.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(i);e.images.push(this),a?this.loadSvg(i):this.loadImage(i)}async loadImage(e){try{const t=await this.document.createImage(e,!0);this.image=t}catch(t){console.error(`Error while loading image "${e}":`,t)}this.loaded=!0}async loadSvg(e){const t=c_.exec(e);if(t){const n=t[5];n&&(t[4]==="base64"?this.image=atob(n):this.image=decodeURIComponent(n))}else try{const i=await(await this.document.fetch(e)).text();this.image=i}catch(n){console.error(`Error while loading image "${e}":`,n)}this.loaded=!0}renderChildren(e){const{document:t,image:n,loaded:i}=this,a=this.getAttribute("x").getPixels("x"),s=this.getAttribute("y").getPixels("y"),o=this.getStyle("width").getPixels("x"),l=this.getStyle("height").getPixels("y");if(!(!i||!n||!o||!l)){if(e.save(),e.translate(a,s),typeof n=="string"){const u=t.pith.forkString(e,n,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:o,scaleHeight:l}),{documentElement:c}=u.document;c&&(c.parent=this),u.resize(o,l,this.getAttribute("preserveAspectRatio").getString()),u.render()}else t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:o,desiredWidth:n.width,height:l,desiredHeight:n.height}),this.loaded&&(!("complete"in n)||n.complete)&&e.drawImage(n,0,0);e.restore()}}getBoundingBox(){const e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),n=this.getStyle("width").getPixels("x"),i=this.getStyle("height").getPixels("y");return new _a(e,t,e+n,t+i)}}class f_ extends Dl{type="symbol";render(e){}}class h_{document;loaded=!1;constructor(e){this.document=e,e.fonts.push(this)}async load(e,t){try{const{document:n}=this,a=(await n.pith.parser.load(t)).getElementsByTagName("font");Array.from(a).forEach(s=>{const o=n.createElement(s);n.definitions[e]=o})}catch(n){console.error(`Error while loading font "${t}":`,n)}this.loaded=!0}}class p_ extends Yn{static parseExternalUrl=MC;type="style";constructor(e,t,n){super(e,t,n),Vf(Array.from(t.childNodes).map(s=>s.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")).split("}").forEach(s=>{const o=s.trim();if(!o)return;const l=o.split("{"),u=l[0].split(","),c=l[1].split(";");u.forEach(f=>{const d=f.trim();if(!d)return;const h=e.styles[d]||{};if(c.forEach(g=>{const v=g.indexOf(":"),y=g.substr(0,v).trim(),A=g.substr(v+1,g.length-v).trim();y&&A&&(h[y]=new Mt(e,y,A))}),e.styles[d]=h,e.stylesSpecificity[d]=DM(d),d==="@font-face"){const g=h["font-family"].getString().replace(/"|'/g,"");h.src.getString().split(",").forEach(y=>{if(y.indexOf('format("svg")')>0){const A=MC(y);A&&new h_(e).load(g,A)}})}})})}}class g_ extends Dl{type="use";cachedElement;setContext(e){super.setContext(e);const t=this.getAttribute("x"),n=this.getAttribute("y");t.hasValue()&&e.translate(t.getPixels("x"),0),n.hasValue()&&e.translate(0,n.getPixels("y"))}path(e){const{element:t}=this;t&&t.path(e)}renderChildren(e){const{document:t,element:n}=this;if(n){let i=n;if(n.type==="symbol"&&(i=new $f(t),i.attributes.viewBox=new Mt(t,"viewBox",n.getAttribute("viewBox").getString()),i.attributes.preserveAspectRatio=new Mt(t,"preserveAspectRatio",n.getAttribute("preserveAspectRatio").getString()),i.attributes.overflow=new Mt(t,"overflow",n.getAttribute("overflow").getString()),i.children=n.children,n.styles.opacity=new Mt(t,"opacity",this.calculateOpacity())),i.type==="svg"){const s=this.getStyle("width",!1,!0),o=this.getStyle("height",!1,!0);s.hasValue()&&(i.attributes.width=new Mt(t,"width",s.getString())),o.hasValue()&&(i.attributes.height=new Mt(t,"height",o.getString()))}const a=i.parent;i.parent=this,i.render(e),i.parent=a}}getBoundingBox(e){const{element:t}=this;return t?t.getBoundingBox(e):null}elementTransform(){const{document:e,element:t}=this;return t?tc.fromElement(e,t):null}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function ei(r,e,t){return r[e]*t}function Ts(r,e,t,n){return e+Math.cos(r)*t+Math.sin(r)*n}class IT extends Pl{type="feColorMatrix";matrix;includeOpacity;constructor(e,t,n){super(e,t,n);let i=Hi(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{const a=i[0];i=[.213+.787*a,.715-.715*a,.072-.072*a,0,0,.213-.213*a,.715+.285*a,.072-.072*a,0,0,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{const a=i[0]*Math.PI/180;i=[Ts(a,.213,.787,-.213),Ts(a,.715,-.715,-.715),Ts(a,.072,-.072,.928),0,0,Ts(a,.213,-.213,.143),Ts(a,.715,.285,.14),Ts(a,.072,-.072,-.283),0,0,Ts(a,.213,-.213,-.787),Ts(a,.715,-.715,.715),Ts(a,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=i,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(e,t,n,i,a){const{includeOpacity:s,matrix:o}=this,l=e.getImageData(0,0,i,a);for(let u=0;u<a;u++)for(let c=0;c<i;c++){const f=bl(l.data,c,u,i,a,0),d=bl(l.data,c,u,i,a,1),h=bl(l.data,c,u,i,a,2),g=bl(l.data,c,u,i,a,3);let v=ei(o,0,f)+ei(o,1,d)+ei(o,2,h)+ei(o,3,g)+ei(o,4,1),y=ei(o,5,f)+ei(o,6,d)+ei(o,7,h)+ei(o,8,g)+ei(o,9,1),A=ei(o,10,f)+ei(o,11,d)+ei(o,12,h)+ei(o,13,g)+ei(o,14,1),C=ei(o,15,f)+ei(o,16,d)+ei(o,17,h)+ei(o,18,g)+ei(o,19,1);s&&(v=0,y=0,A=0,C*=g/255),wl(l.data,c,u,i,a,0,v),wl(l.data,c,u,i,a,1,y),wl(l.data,c,u,i,a,2,A),wl(l.data,c,u,i,a,3,C)}e.clearRect(0,0,i,a),e.putImageData(l,0,0)}}class a1 extends Yn{static ignoreStyles=["mask","transform","clip-path"];type="mask";apply(e,t){const{document:n}=this;let i=this.getAttribute("x").getPixels("x"),a=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y");if(!s&&!o){const h=new _a;this.children.forEach(g=>{g instanceof Kr&&h.addBoundingBox(g.getBoundingBox(e))}),i=Math.floor(h.x1),a=Math.floor(h.y1),s=Math.floor(h.width),o=Math.floor(h.height)}const l=this.removeStyles(t,a1.ignoreStyles),u=n.createCanvas(i+s,a+o),c=u.getContext("2d");n.screen.setDefaults(c),this.renderChildren(c),new IT(n,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(c,0,0,i+s,a+o);const f=n.createCanvas(i+s,a+o),d=f.getContext("2d");n.screen.setDefaults(d),t.render(d),d.globalCompositeOperation="destination-in",d.fillStyle=c.createPattern(u,"no-repeat"),d.fillRect(0,0,i+s,a+o),e.fillStyle=d.createPattern(f,"no-repeat"),e.fillRect(0,0,i+s,a+o),this.restoreStyles(t,l)}render(e){}}const QC=()=>{};class m_ extends Yn{type="clipPath";apply(e){const{document:t}=this,n=Reflect.getPrototypeOf(e),{beginPath:i,closePath:a}=e;n&&(n.beginPath=QC,n.closePath=QC),Reflect.apply(i,e,[]),this.children.forEach(s=>{if(!("path"in s))return;let o="elementTransform"in s?s.elementTransform():null;o||(o=tc.fromElement(t,s)),o&&o.apply(e),s.path(e),n&&(n.closePath=a),o&&o.unapply(e)}),Reflect.apply(a,e,[]),e.clip(),n&&(n.beginPath=i,n.closePath=a)}render(e){}}class PT extends Pl{type="feGaussianBlur";extraFilterDistance;blurRadius;constructor(e,t,n){super(e,t,n),this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(e,t,n,i,a){const{document:s,blurRadius:o}=this,l=s.window?s.window.document.body:null,u=e.canvas;u.id=s.getUniqueId(),l&&(u.style.display="none",l.appendChild(u)),yM(u,t,n,i,a,o),l&&l.removeChild(u)}}class s1 extends Yn{static ignoreStyles=["filter","transform","clip-path"];type="filter";apply(e,t){const{document:n,children:i}=this,a="getBoundingBox"in t?t.getBoundingBox(e):null;if(!a)return;let s=0,o=0;i.forEach(A=>{if(!(A instanceof PT))return;const C=A.extraFilterDistance||0;s=Math.max(s,C),o=Math.max(o,C)});const l=Math.floor(a.width),u=Math.floor(a.height),c=l+2*s,f=u+2*o;if(Number.isNaN(c)||Number.isNaN(f)||c<1||f<1)return;const d=Math.floor(a.x),h=Math.floor(a.y),g=this.removeStyles(t,s1.ignoreStyles),v=n.createCanvas(c,f),y=v.getContext("2d");n.screen.setDefaults(y),y.translate(-d+s,-h+o),t.render(y),i.forEach(A=>{A instanceof Pl&&A.apply(y,0,0,c,f)}),e.drawImage(v,0,0,c,f,d-s,h-o,c,f),this.restoreStyles(t,g)}render(e){}}class v_ extends Pl{type="feDropShadow";constructor(e,t,n){super(e,t,n),this.addStylesFromStyleDefinition()}apply(e,t,n,i,a){}}class y_ extends Pl{type="feMorphology";apply(e,t,n,i,a){}}class A_ extends Pl{type="feComposite";apply(e,t,n,i,a){}}class b_ extends Yn{type="title"}class w_ extends Yn{type="desc"}class o1 extends Yn{tableValues;constructor(e,t,n){super(e,t,n),this.tableValues=Hi(this.getAttribute("tableValues").getString())}}class DT extends o1{type="feFuncR"}class RT extends o1{type="feFuncG"}class OT extends o1{type="feFuncB"}class C_ extends Pl{type="feComponentTransfer";constructor(e,t,n){super(e,t,n)}calculateDiscrete(e,t){const n=e/255,i=t.tableValues.length;if(n===1)return 255*t.tableValues[i-1];for(let a=0;a<i;a++)if(a/i<=n&&n<(a+1)/i)return 255*t.tableValues[a];return 255*t.tableValues[0]}apply(e,t,n,i,a){const{children:s}=this;let o,l,u;s.forEach(f=>{f instanceof DT?o=f:f instanceof RT?l=f:f instanceof OT&&(u=f)});const c=e.getImageData(0,0,i,a);for(let f=0;f<a;f++)for(let d=0;d<i;d++){const h=bl(c.data,d,f,i,a,0),g=bl(c.data,d,f,i,a,1),v=bl(c.data,d,f,i,a,2),y=this.calculateDiscrete(h,o),A=this.calculateDiscrete(g,l),C=this.calculateDiscrete(v,u);wl(c.data,d,f,i,a,0,y),wl(c.data,d,f,i,a,1,A),wl(c.data,d,f,i,a,2,C)}e.clearRect(0,0,i,a),e.putImageData(c,0,0)}}const x_={svg:$f,rect:ST,circle:QM,ellipse:YM,line:XM,polyline:ET,polygon:JM,path:Kr,pattern:KM,marker:ZM,defs:e_,linearGradient:t_,radialGradient:r_,stop:n_,animate:n1,animateColor:i_,animateTransform:a_,font:s_,"font-face":TT,"missing-glyph":FT,glyph:i1,text:ko,tspan:Hg,tref:o_,a:l_,textPath:u_,image:d_,g:r1,symbol:f_,style:p_,use:g_,mask:a1,clipPath:m_,filter:s1,feDropShadow:v_,feFuncR:DT,feFuncG:RT,feFuncB:OT,feMorphology:y_,feComponentTransfer:C_,feComposite:A_,feColorMatrix:IT,feGaussianBlur:PT,title:b_,desc:w_};function S_(r,e){const t=document.createElement("canvas");return t.width=r,t.height=e,t}async function E_(r,e=!1){const t=document.createElement("img");return e&&(t.crossOrigin="Anonymous"),new Promise((n,i)=>{t.onload=()=>{n(t)},t.onerror=(a,s,o,l,u)=>{i(u)},t.src=r})}const E0=12;class Yd{pith;static createCanvas=S_;static createImage=E_;static elementTypes=x_;rootEmSize;documentElement;screen;createCanvas;createImage;definitions={};styles={};stylesSpecificity={};images=[];fonts=[];emSizeStack=[];uniqueId=0;constructor(e,{rootEmSize:t=E0,emSize:n=E0,createCanvas:i=Yd.createCanvas,createImage:a=Yd.createImage,anonymousCrossOrigin:s}={}){this.pith=e,this.screen=e.screen,this.rootEmSize=t,this.emSize=n,this.createCanvas=i,this.createImage=this.bindCreateImage(a,s),this.screen.wait(()=>this.isImagesLoaded()),this.screen.wait(()=>this.isFontsLoaded())}bindCreateImage(e,t){return typeof t=="boolean"?(n,i)=>e(n,typeof i=="boolean"?i:t):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){const{emSizeStack:e}=this;return e[e.length-1]||E0}set emSize(e){const{emSizeStack:t}=this;t.push(e)}popEmSize(){const{emSizeStack:e}=this;e.pop()}getUniqueId(){return`pith${++this.uniqueId}`}isImagesLoaded(){return this.images.every(e=>e.loaded)}isFontsLoaded(){return this.fonts.every(e=>e.loaded)}createDocumentElement(e){const t=this.createElement(e.documentElement,"svg");return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}createElement(e,t){const n=t||e.nodeName.replace(/^[^:]+:/,""),i=Yd.elementTypes[n];return i?new i(this,e):new $M(this,e)}createTextNode(e){return new WM(this,e)}setViewBox(e){this.screen.setViewBox({document:this,...e})}}class uo{static async from(e,t,n={}){const a=await new S0(n).parse(t);return new uo(e,a,n)}static fromString(e,t,n={}){const a=new S0(n).parseFromString(t);return new uo(e,a,n)}parser;screen;document;documentElement;options;constructor(e,t,n={}){this.parser=new S0(n),this.screen=new zf(e,n),this.options=n;const i=new Yd(this,n),a=i.createDocumentElement(t);this.document=i,this.documentElement=a}fork(e,t,n={}){return uo.from(e,t,{...this.options,...n})}forkString(e,t,n={}){return uo.fromString(e,t,{...this.options,...n})}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}async render(e={}){this.start({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0,...e}),await this.ready(),this.stop()}start(e={}){const{documentElement:t,screen:n,options:i}=this;n.start(t,{enableRedraw:!0,...i,...e})}stop(){this.screen.stop()}resize(e,t=e,n=!1){this.documentElement.resize(e,t,n)}}const k0=[Xe.SilentIllustration,Xe.ProductOverlay],YC=r=>{const e=[];for(const n of r.steps){const i=k_(n.stepName,r.stepGroups);if(!i)throw new Error("Workflow step does not belong to a group, all steps must belong to a group. Step: "+n.stepName);const a=e.find(s=>s.name===i.name);a?k0.includes(n.type)?a.silentSteps.push(n):a.renderableSteps.push(n):e.push({name:i.name,title:i.name,renderableSteps:k0.includes(n.type)?[]:[n],silentSteps:k0.includes(n.type)?[n]:[]})}const t="workflow.steps.finish.confirmDesign";return e.push({name:"Finish",title:t,renderableSteps:[{type:Xe.Finish,stepName:"Finish",stepTitle:t,helpText:"",data:{modelAnimation:r.finalizeStepConfig?r.finalizeStepConfig.modelAnimation:void 0,lookAtAnimation:r.finalizeStepConfig?r.finalizeStepConfig.lookAtAnimation:void 0},conditions:[]}],silentSteps:[]}),e},k_=(r,e)=>e.find(t=>t.stepNames.includes(r)),co=async(r,e)=>{const t=r.conditions||[];console.log(`[stepConditionsAreSatisfied] Evaluating step "${r.stepName}".`,{conditionCount:t.length,selectedStepNames:Object.keys(e)});const n=await Promise.all(t.map(async(a,s)=>{const o=e[a.targetStepName];if(o&&o.selectedVariants){const l=o.selectedVariants;if(a.type==="VariantMetafield"){await Ag.ensureIdsArePresent(l.map(c=>c.id));const u=a.requiredVariantMetafields?.some(c=>l.find(f=>Ag.requestIfAvailable(f.id,c.variantMetafieldConfigurationId||"")?.value===c.variantMetafieldValue));return console.log(`[stepConditionsAreSatisfied] Metafield condition ${s} evaluated to ${!!u}.`,{stepName:r.stepName,targetStepName:a.targetStepName,selectedVariantIds:l.map(c=>c.id),requiredVariantMetafields:a.requiredVariantMetafields}),u}else{const u=a.requiredVariantSelections.some(c=>l.find(f=>f.id===c)!==void 0);return console.log(`[stepConditionsAreSatisfied] Variant condition ${s} evaluated to ${u}.`,{stepName:r.stepName,targetStepName:a.targetStepName,selectedVariantIds:l.map(c=>c.id),requiredVariantSelections:a.requiredVariantSelections}),u}}return console.log(`[stepConditionsAreSatisfied] Condition ${s} failed: no selections for target step "${a.targetStepName}".`,{stepName:r.stepName}),!1})),i=n.every(a=>a);return console.log(`[stepConditionsAreSatisfied] Step "${r.stepName}" satisfied: ${i}.`,{results:n}),i},T_=async(r,e)=>{const t=await Promise.all(r.renderableSteps.map(o=>co(o,e))),n=r.renderableSteps.filter((o,l)=>t[l]),i=await Promise.all(r.silentSteps.map(o=>co(o,e))),a=r.silentSteps.filter((o,l)=>i[l]),s={name:r.name,title:r.title,renderableSteps:n,silentSteps:a};return s.silentSteps.length===0&&s.renderableSteps.length===0?null:s},Ja=async(r,e)=>(await Promise.all(r.map(n=>T_(n,e)))).filter(n=>n!==null),F_=async(r,e,t=!1)=>{const n=await Ja(r,e),i=[];for(const s of n)for(const o of s.renderableSteps){let l=0;if(o.type!=="Finish"&&o.type!=="Module"){let u;o.option?.variants?(u=o.option,l=u?.variants?.length||0):(u=await ct.getOption(o.option?.id),l=u?.variants?.length||0)}o.silent||(o.type===Xe.Model||o.type===Xe.Material||o.type===Xe.Picture||o.type===Xe.Shape?(l>1||t)&&i.push(o.stepName):i.push(o.stepName))}const a=n.filter(s=>s.renderableSteps.filter(l=>i.includes(l.stepName)).length>0);for(const s of a)s.renderableSteps=s.renderableSteps.filter(o=>i.includes(o.stepName));return a};class jg{constructor(){this.timestamp=Date.now()}}class Gg{constructor(e,t=!0){this.queue=[],this.activePromise=void 0,this.queueMaxSize=void 0,this.queueMaxSize=e,this.isEnabled=t}enqueue(e){if(this.queue.push(e),this.queueMaxSize!==void 0&&this.queue.length>this.queueMaxSize){const t=this.queue.length-1;for(let n=0;n<t;++n)this.queue.shift()}this.isEnabled&&(this.activePromise||(this.activePromise=this.dequeue()))}get enabled(){return this.isEnabled}set enabled(e){!this.isEnabled&&e&&!this.activePromise&&this.getRemainingQueueSize()>0&&(this.activePromise=this.dequeue()),this.isEnabled=e}hasActivePromise(){return!!this.activePromise}getRemainingQueueSize(){return this.queue.length}async finalize(){return this.activePromise?this.activePromise:Promise.resolve()}async dequeue(){const e=this.queue.shift();if(!e){this.activePromise=void 0;return}try{await e.execute()}catch(t){console.log(t)}finally{await this.dequeue()}}}var _d={exports:{}};_d.exports;var XC;function I_(){return XC||(XC=1,(function(r,e){var t=200,n="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",s="[object Array]",o="[object Boolean]",l="[object Date]",u="[object Error]",c="[object Function]",f="[object GeneratorFunction]",d="[object Map]",h="[object Number]",g="[object Object]",v="[object Promise]",y="[object RegExp]",A="[object Set]",C="[object String]",S="[object Symbol]",F="[object WeakMap]",E="[object ArrayBuffer]",R="[object DataView]",B="[object Float32Array]",j="[object Float64Array]",G="[object Int8Array]",ie="[object Int16Array]",q="[object Int32Array]",Y="[object Uint8Array]",J="[object Uint8ClampedArray]",ae="[object Uint16Array]",oe="[object Uint32Array]",he=/[\\^$.*+?()[\]{}|]/g,ye=/\w*$/,Ue=/^\[object .+?Constructor\]$/,Re=/^(?:0|[1-9]\d*)$/,Oe={};Oe[a]=Oe[s]=Oe[E]=Oe[R]=Oe[o]=Oe[l]=Oe[B]=Oe[j]=Oe[G]=Oe[ie]=Oe[q]=Oe[d]=Oe[h]=Oe[g]=Oe[y]=Oe[A]=Oe[C]=Oe[S]=Oe[Y]=Oe[J]=Oe[ae]=Oe[oe]=!0,Oe[u]=Oe[c]=Oe[F]=!1;var ee=typeof di=="object"&&di&&di.Object===Object&&di,re=typeof self=="object"&&self&&self.Object===Object&&self,fe=ee||re||Function("return this")(),Be=e&&!e.nodeType&&e,ke=Be&&!0&&r&&!r.nodeType&&r,$e=ke&&ke.exports===Be;function je(I,$){return I.set($[0],$[1]),I}function qe(I,$){return I.add($),I}function Ge(I,$){for(var se=-1,Ce=I?I.length:0;++se<Ce&&$(I[se],se,I)!==!1;);return I}function bt(I,$){for(var se=-1,Ce=$.length,ht=I.length;++se<Ce;)I[ht+se]=$[se];return I}function rr(I,$,se,Ce){for(var ht=-1,lt=I?I.length:0;++ht<lt;)se=$(se,I[ht],ht,I);return se}function Dr(I,$){for(var se=-1,Ce=Array(I);++se<I;)Ce[se]=$(se);return Ce}function Gt(I,$){return I?.[$]}function ar(I){var $=!1;if(I!=null&&typeof I.toString!="function")try{$=!!(I+"")}catch{}return $}function St(I){var $=-1,se=Array(I.size);return I.forEach(function(Ce,ht){se[++$]=[ht,Ce]}),se}function st(I,$){return function(se){return I($(se))}}function Qr(I){var $=-1,se=Array(I.size);return I.forEach(function(Ce){se[++$]=Ce}),se}var Sr=Array.prototype,gr=Function.prototype,nr=Object.prototype,dr=fe["__core-js_shared__"],Yt=(function(){var I=/[^.]+$/.exec(dr&&dr.keys&&dr.keys.IE_PROTO||"");return I?"Symbol(src)_1."+I:""})(),Xt=gr.toString,mt=nr.hasOwnProperty,Cr=nr.toString,sn=RegExp("^"+Xt.call(mt).replace(he,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_r=$e?fe.Buffer:void 0,ir=fe.Symbol,Yr=fe.Uint8Array,kr=st(Object.getPrototypeOf,Object),Zr=Object.create,Vr=nr.propertyIsEnumerable,pn=Sr.splice,gn=Object.getOwnPropertySymbols,Tr=_r?_r.isBuffer:void 0,zr=st(Object.keys,Object),en=rt(fe,"DataView"),$r=rt(fe,"Map"),zt=rt(fe,"Promise"),sr=rt(fe,"Set"),Er=rt(fe,"WeakMap"),tt=rt(Object,"create"),Nr=Or(en),Xr=Or($r),Ee=Or(zt),D=Or(sr),U=Or(Er),X=ir?ir.prototype:void 0,ue=X?X.valueOf:void 0;function Fe(I){var $=-1,se=I?I.length:0;for(this.clear();++$<se;){var Ce=I[$];this.set(Ce[0],Ce[1])}}function We(){this.__data__=tt?tt(null):{}}function wt(I){return this.has(I)&&delete this.__data__[I]}function Dt(I){var $=this.__data__;if(tt){var se=$[I];return se===n?void 0:se}return mt.call($,I)?$[I]:void 0}function Nt(I){var $=this.__data__;return tt?$[I]!==void 0:mt.call($,I)}function or(I,$){var se=this.__data__;return se[I]=tt&&$===void 0?n:$,this}Fe.prototype.clear=We,Fe.prototype.delete=wt,Fe.prototype.get=Dt,Fe.prototype.has=Nt,Fe.prototype.set=or;function Lt(I){var $=-1,se=I?I.length:0;for(this.clear();++$<se;){var Ce=I[$];this.set(Ce[0],Ce[1])}}function K(){this.__data__=[]}function Ie(I){var $=this.__data__,se=Cn($,I);if(se<0)return!1;var Ce=$.length-1;return se==Ce?$.pop():pn.call($,se,1),!0}function Qe(I){var $=this.__data__,se=Cn($,I);return se<0?void 0:$[se][1]}function Ye(I){return Cn(this.__data__,I)>-1}function xt(I,$){var se=this.__data__,Ce=Cn(se,I);return Ce<0?se.push([I,$]):se[Ce][1]=$,this}Lt.prototype.clear=K,Lt.prototype.delete=Ie,Lt.prototype.get=Qe,Lt.prototype.has=Ye,Lt.prototype.set=xt;function ft(I){var $=-1,se=I?I.length:0;for(this.clear();++$<se;){var Ce=I[$];this.set(Ce[0],Ce[1])}}function Rt(){this.__data__={hash:new Fe,map:new($r||Lt),string:new Fe}}function Et(I){return _e(this,I).delete(I)}function hr(I){return _e(this,I).get(I)}function tr(I){return _e(this,I).has(I)}function fr(I,$){return _e(this,I).set(I,$),this}ft.prototype.clear=Rt,ft.prototype.delete=Et,ft.prototype.get=hr,ft.prototype.has=tr,ft.prototype.set=fr;function $t(I){this.__data__=new Lt(I)}function Bn(){this.__data__=new Lt}function In(I){return this.__data__.delete(I)}function mr(I){return this.__data__.get(I)}function xr(I){return this.__data__.has(I)}function wn(I,$){var se=this.__data__;if(se instanceof Lt){var Ce=se.__data__;if(!$r||Ce.length<t-1)return Ce.push([I,$]),this;se=this.__data__=new ft(Ce)}return se.set(I,$),this}$t.prototype.clear=Bn,$t.prototype.delete=In,$t.prototype.get=mr,$t.prototype.has=xr,$t.prototype.set=wn;function Rr(I,$){var se=Ri(I)||_n(I)?Dr(I.length,String):[],Ce=se.length,ht=!!Ce;for(var lt in I)mt.call(I,lt)&&!(ht&&(lt=="length"||dn(lt,Ce)))&&se.push(lt);return se}function Gn(I,$,se){var Ce=I[$];(!(mt.call(I,$)&&Mn(Ce,se))||se===void 0&&!($ in I))&&(I[$]=se)}function Cn(I,$){for(var se=I.length;se--;)if(Mn(I[se][0],$))return se;return-1}function Hr(I,$){return I&&pe($,lr($),I)}function xn(I,$,se,Ce,ht,lt,Ht){var Ut;if(Ce&&(Ut=lt?Ce(I,ht,lt,Ht):Ce(I)),Ut!==void 0)return Ut;if(!En(I))return I;var Br=Ri(I);if(Br){if(Ut=Jt(I),!$)return W(I,Ut)}else{var M=nt(I),Z=M==c||M==f;if(Nn(I))return mn(I,$);if(M==g||M==a||Z&&!lt){if(ar(I))return lt?I:{};if(Ut=vr(Z?{}:I),!$)return ce(I,Hr(Ut,I))}else{if(!Oe[M])return lt?I:{};Ut=jr(I,M,xn,$)}}Ht||(Ht=new $t);var de=Ht.get(I);if(de)return de;if(Ht.set(I,Ut),!Br)var be=se?xe(I):lr(I);return Ge(be||I,function(Me,Ke){be&&(Ke=Me,Me=I[Ke]),Gn(Ut,Ke,xn(Me,$,se,Ce,Ke,I,Ht))}),Ut}function cn(I){return En(I)?Zr(I):{}}function tn(I,$,se){var Ce=$(I);return Ri(I)?Ce:bt(Ce,se(I))}function Jn(I){return Cr.call(I)}function si(I){if(!En(I)||Vn(I))return!1;var $=ki(I)||ar(I)?sn:Ue;return $.test(Or(I))}function Sn(I){if(!vn(I))return zr(I);var $=[];for(var se in Object(I))mt.call(I,se)&&se!="constructor"&&$.push(se);return $}function mn(I,$){if($)return I.slice();var se=new I.constructor(I.length);return I.copy(se),se}function on(I){var $=new I.constructor(I.byteLength);return new Yr($).set(new Yr(I)),$}function rn(I,$){var se=$?on(I.buffer):I.buffer;return new I.constructor(se,I.byteOffset,I.byteLength)}function Lr(I,$,se){var Ce=$?se(St(I),!0):St(I);return rr(Ce,je,new I.constructor)}function ln(I){var $=new I.constructor(I.source,ye.exec(I));return $.lastIndex=I.lastIndex,$}function k(I,$,se){var Ce=$?se(Qr(I),!0):Qr(I);return rr(Ce,qe,new I.constructor)}function O(I){return ue?Object(ue.call(I)):{}}function z(I,$){var se=$?on(I.buffer):I.buffer;return new I.constructor(se,I.byteOffset,I.length)}function W(I,$){var se=-1,Ce=I.length;for($||($=Array(Ce));++se<Ce;)$[se]=I[se];return $}function pe(I,$,se,Ce){se||(se={});for(var ht=-1,lt=$.length;++ht<lt;){var Ht=$[ht],Ut=void 0;Gn(se,Ht,Ut===void 0?I[Ht]:Ut)}return se}function ce(I,$){return pe(I,ut(I),$)}function xe(I){return tn(I,lr,ut)}function _e(I,$){var se=I.__data__;return Kn($)?se[typeof $=="string"?"string":"hash"]:se.map}function rt(I,$){var se=Gt(I,$);return si(se)?se:void 0}var ut=gn?st(gn,Object):Pn,nt=Jn;(en&&nt(new en(new ArrayBuffer(1)))!=R||$r&&nt(new $r)!=d||zt&&nt(zt.resolve())!=v||sr&&nt(new sr)!=A||Er&&nt(new Er)!=F)&&(nt=function(I){var $=Cr.call(I),se=$==g?I.constructor:void 0,Ce=se?Or(se):void 0;if(Ce)switch(Ce){case Nr:return R;case Xr:return d;case Ee:return v;case D:return A;case U:return F}return $});function Jt(I){var $=I.length,se=I.constructor($);return $&&typeof I[0]=="string"&&mt.call(I,"index")&&(se.index=I.index,se.input=I.input),se}function vr(I){return typeof I.constructor=="function"&&!vn(I)?cn(kr(I)):{}}function jr(I,$,se,Ce){var ht=I.constructor;switch($){case E:return on(I);case o:case l:return new ht(+I);case R:return rn(I,Ce);case B:case j:case G:case ie:case q:case Y:case J:case ae:case oe:return z(I,Ce);case d:return Lr(I,Ce,se);case h:case C:return new ht(I);case y:return ln(I);case A:return k(I,Ce,se);case S:return O(I)}}function dn(I,$){return $=$??i,!!$&&(typeof I=="number"||Re.test(I))&&I>-1&&I%1==0&&I<$}function Kn(I){var $=typeof I;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?I!=="__proto__":I===null}function Vn(I){return!!Yt&&Yt in I}function vn(I){var $=I&&I.constructor,se=typeof $=="function"&&$.prototype||nr;return I===se}function Or(I){if(I!=null){try{return Xt.call(I)}catch{}try{return I+""}catch{}}return""}function qn(I){return xn(I,!0,!0)}function Mn(I,$){return I===$||I!==I&&$!==$}function _n(I){return wi(I)&&mt.call(I,"callee")&&(!Vr.call(I,"callee")||Cr.call(I)==a)}var Ri=Array.isArray;function bi(I){return I!=null&&zn(I.length)&&!ki(I)}function wi(I){return Zn(I)&&bi(I)}var Nn=Tr||Ci;function ki(I){var $=En(I)?Cr.call(I):"";return $==c||$==f}function zn(I){return typeof I=="number"&&I>-1&&I%1==0&&I<=i}function En(I){var $=typeof I;return!!I&&($=="object"||$=="function")}function Zn(I){return!!I&&typeof I=="object"}function lr(I){return bi(I)?Rr(I):Sn(I)}function Pn(){return[]}function Ci(){return!1}r.exports=qn})(_d,_d.exports)),_d.exports}var P_=I_();const mo=Ns(P_);var Nd={exports:{}};Nd.exports;var JC;function D_(){return JC||(JC=1,(function(r,e){var t=200,n="__lodash_hash_undefined__",i=1,a=2,s=9007199254740991,o="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",v="[object Map]",y="[object Number]",A="[object Null]",C="[object Object]",S="[object Promise]",F="[object Proxy]",E="[object RegExp]",R="[object Set]",B="[object String]",j="[object Symbol]",G="[object Undefined]",ie="[object WeakMap]",q="[object ArrayBuffer]",Y="[object DataView]",J="[object Float32Array]",ae="[object Float64Array]",oe="[object Int8Array]",he="[object Int16Array]",ye="[object Int32Array]",Ue="[object Uint8Array]",Re="[object Uint8ClampedArray]",Oe="[object Uint16Array]",ee="[object Uint32Array]",re=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,Be=/^(?:0|[1-9]\d*)$/,ke={};ke[J]=ke[ae]=ke[oe]=ke[he]=ke[ye]=ke[Ue]=ke[Re]=ke[Oe]=ke[ee]=!0,ke[o]=ke[l]=ke[q]=ke[c]=ke[Y]=ke[f]=ke[d]=ke[h]=ke[v]=ke[y]=ke[C]=ke[E]=ke[R]=ke[B]=ke[ie]=!1;var $e=typeof di=="object"&&di&&di.Object===Object&&di,je=typeof self=="object"&&self&&self.Object===Object&&self,qe=$e||je||Function("return this")(),Ge=e&&!e.nodeType&&e,bt=Ge&&!0&&r&&!r.nodeType&&r,rr=bt&&bt.exports===Ge,Dr=rr&&$e.process,Gt=(function(){try{return Dr&&Dr.binding&&Dr.binding("util")}catch{}})(),ar=Gt&&Gt.isTypedArray;function St(I,$){for(var se=-1,Ce=I==null?0:I.length,ht=0,lt=[];++se<Ce;){var Ht=I[se];$(Ht,se,I)&&(lt[ht++]=Ht)}return lt}function st(I,$){for(var se=-1,Ce=$.length,ht=I.length;++se<Ce;)I[ht+se]=$[se];return I}function Qr(I,$){for(var se=-1,Ce=I==null?0:I.length;++se<Ce;)if($(I[se],se,I))return!0;return!1}function Sr(I,$){for(var se=-1,Ce=Array(I);++se<I;)Ce[se]=$(se);return Ce}function gr(I){return function($){return I($)}}function nr(I,$){return I.has($)}function dr(I,$){return I?.[$]}function Yt(I){var $=-1,se=Array(I.size);return I.forEach(function(Ce,ht){se[++$]=[ht,Ce]}),se}function Xt(I,$){return function(se){return I($(se))}}function mt(I){var $=-1,se=Array(I.size);return I.forEach(function(Ce){se[++$]=Ce}),se}var Cr=Array.prototype,sn=Function.prototype,_r=Object.prototype,ir=qe["__core-js_shared__"],Yr=sn.toString,kr=_r.hasOwnProperty,Zr=(function(){var I=/[^.]+$/.exec(ir&&ir.keys&&ir.keys.IE_PROTO||"");return I?"Symbol(src)_1."+I:""})(),Vr=_r.toString,pn=RegExp("^"+Yr.call(kr).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gn=rr?qe.Buffer:void 0,Tr=qe.Symbol,zr=qe.Uint8Array,en=_r.propertyIsEnumerable,$r=Cr.splice,zt=Tr?Tr.toStringTag:void 0,sr=Object.getOwnPropertySymbols,Er=gn?gn.isBuffer:void 0,tt=Xt(Object.keys,Object),Nr=ut(qe,"DataView"),Xr=ut(qe,"Map"),Ee=ut(qe,"Promise"),D=ut(qe,"Set"),U=ut(qe,"WeakMap"),X=ut(Object,"create"),ue=Or(Nr),Fe=Or(Xr),We=Or(Ee),wt=Or(D),Dt=Or(U),Nt=Tr?Tr.prototype:void 0,or=Nt?Nt.valueOf:void 0;function Lt(I){var $=-1,se=I==null?0:I.length;for(this.clear();++$<se;){var Ce=I[$];this.set(Ce[0],Ce[1])}}function K(){this.__data__=X?X(null):{},this.size=0}function Ie(I){var $=this.has(I)&&delete this.__data__[I];return this.size-=$?1:0,$}function Qe(I){var $=this.__data__;if(X){var se=$[I];return se===n?void 0:se}return kr.call($,I)?$[I]:void 0}function Ye(I){var $=this.__data__;return X?$[I]!==void 0:kr.call($,I)}function xt(I,$){var se=this.__data__;return this.size+=this.has(I)?0:1,se[I]=X&&$===void 0?n:$,this}Lt.prototype.clear=K,Lt.prototype.delete=Ie,Lt.prototype.get=Qe,Lt.prototype.has=Ye,Lt.prototype.set=xt;function ft(I){var $=-1,se=I==null?0:I.length;for(this.clear();++$<se;){var Ce=I[$];this.set(Ce[0],Ce[1])}}function Rt(){this.__data__=[],this.size=0}function Et(I){var $=this.__data__,se=mn($,I);if(se<0)return!1;var Ce=$.length-1;return se==Ce?$.pop():$r.call($,se,1),--this.size,!0}function hr(I){var $=this.__data__,se=mn($,I);return se<0?void 0:$[se][1]}function tr(I){return mn(this.__data__,I)>-1}function fr(I,$){var se=this.__data__,Ce=mn(se,I);return Ce<0?(++this.size,se.push([I,$])):se[Ce][1]=$,this}ft.prototype.clear=Rt,ft.prototype.delete=Et,ft.prototype.get=hr,ft.prototype.has=tr,ft.prototype.set=fr;function $t(I){var $=-1,se=I==null?0:I.length;for(this.clear();++$<se;){var Ce=I[$];this.set(Ce[0],Ce[1])}}function Bn(){this.size=0,this.__data__={hash:new Lt,map:new(Xr||ft),string:new Lt}}function In(I){var $=rt(this,I).delete(I);return this.size-=$?1:0,$}function mr(I){return rt(this,I).get(I)}function xr(I){return rt(this,I).has(I)}function wn(I,$){var se=rt(this,I),Ce=se.size;return se.set(I,$),this.size+=se.size==Ce?0:1,this}$t.prototype.clear=Bn,$t.prototype.delete=In,$t.prototype.get=mr,$t.prototype.has=xr,$t.prototype.set=wn;function Rr(I){var $=-1,se=I==null?0:I.length;for(this.__data__=new $t;++$<se;)this.add(I[$])}function Gn(I){return this.__data__.set(I,n),this}function Cn(I){return this.__data__.has(I)}Rr.prototype.add=Rr.prototype.push=Gn,Rr.prototype.has=Cn;function Hr(I){var $=this.__data__=new ft(I);this.size=$.size}function xn(){this.__data__=new ft,this.size=0}function cn(I){var $=this.__data__,se=$.delete(I);return this.size=$.size,se}function tn(I){return this.__data__.get(I)}function Jn(I){return this.__data__.has(I)}function si(I,$){var se=this.__data__;if(se instanceof ft){var Ce=se.__data__;if(!Xr||Ce.length<t-1)return Ce.push([I,$]),this.size=++se.size,this;se=this.__data__=new $t(Ce)}return se.set(I,$),this.size=se.size,this}Hr.prototype.clear=xn,Hr.prototype.delete=cn,Hr.prototype.get=tn,Hr.prototype.has=Jn,Hr.prototype.set=si;function Sn(I,$){var se=_n(I),Ce=!se&&Mn(I),ht=!se&&!Ce&&bi(I),lt=!se&&!Ce&&!ht&&Zn(I),Ht=se||Ce||ht||lt,Ut=Ht?Sr(I.length,String):[],Br=Ut.length;for(var M in I)kr.call(I,M)&&!(Ht&&(M=="length"||ht&&(M=="offset"||M=="parent")||lt&&(M=="buffer"||M=="byteLength"||M=="byteOffset")||jr(M,Br)))&&Ut.push(M);return Ut}function mn(I,$){for(var se=I.length;se--;)if(qn(I[se][0],$))return se;return-1}function on(I,$,se){var Ce=$(I);return _n(I)?Ce:st(Ce,se(I))}function rn(I){return I==null?I===void 0?G:A:zt&&zt in Object(I)?nt(I):vn(I)}function Lr(I){return En(I)&&rn(I)==o}function ln(I,$,se,Ce,ht){return I===$?!0:I==null||$==null||!En(I)&&!En($)?I!==I&&$!==$:k(I,$,se,Ce,ln,ht)}function k(I,$,se,Ce,ht,lt){var Ht=_n(I),Ut=_n($),Br=Ht?l:vr(I),M=Ut?l:vr($);Br=Br==o?C:Br,M=M==o?C:M;var Z=Br==C,de=M==C,be=Br==M;if(be&&bi(I)){if(!bi($))return!1;Ht=!0,Z=!1}if(be&&!Z)return lt||(lt=new Hr),Ht||Zn(I)?pe(I,$,se,Ce,ht,lt):ce(I,$,Br,se,Ce,ht,lt);if(!(se&i)){var Me=Z&&kr.call(I,"__wrapped__"),Ke=de&&kr.call($,"__wrapped__");if(Me||Ke){var Je=Me?I.value():I,yt=Ke?$.value():$;return lt||(lt=new Hr),ht(Je,yt,se,Ce,lt)}}return be?(lt||(lt=new Hr),xe(I,$,se,Ce,ht,lt)):!1}function O(I){if(!zn(I)||Kn(I))return!1;var $=Nn(I)?pn:fe;return $.test(Or(I))}function z(I){return En(I)&&ki(I.length)&&!!ke[rn(I)]}function W(I){if(!Vn(I))return tt(I);var $=[];for(var se in Object(I))kr.call(I,se)&&se!="constructor"&&$.push(se);return $}function pe(I,$,se,Ce,ht,lt){var Ht=se&i,Ut=I.length,Br=$.length;if(Ut!=Br&&!(Ht&&Br>Ut))return!1;var M=lt.get(I);if(M&<.get($))return M==$;var Z=-1,de=!0,be=se&a?new Rr:void 0;for(lt.set(I,$),lt.set($,I);++Z<Ut;){var Me=I[Z],Ke=$[Z];if(Ce)var Je=Ht?Ce(Ke,Me,Z,$,I,lt):Ce(Me,Ke,Z,I,$,lt);if(Je!==void 0){if(Je)continue;de=!1;break}if(be){if(!Qr($,function(yt,Ot){if(!nr(be,Ot)&&(Me===yt||ht(Me,yt,se,Ce,lt)))return be.push(Ot)})){de=!1;break}}else if(!(Me===Ke||ht(Me,Ke,se,Ce,lt))){de=!1;break}}return lt.delete(I),lt.delete($),de}function ce(I,$,se,Ce,ht,lt,Ht){switch(se){case Y:if(I.byteLength!=$.byteLength||I.byteOffset!=$.byteOffset)return!1;I=I.buffer,$=$.buffer;case q:return!(I.byteLength!=$.byteLength||!lt(new zr(I),new zr($)));case c:case f:case y:return qn(+I,+$);case d:return I.name==$.name&&I.message==$.message;case E:case B:return I==$+"";case v:var Ut=Yt;case R:var Br=Ce&i;if(Ut||(Ut=mt),I.size!=$.size&&!Br)return!1;var M=Ht.get(I);if(M)return M==$;Ce|=a,Ht.set(I,$);var Z=pe(Ut(I),Ut($),Ce,ht,lt,Ht);return Ht.delete(I),Z;case j:if(or)return or.call(I)==or.call($)}return!1}function xe(I,$,se,Ce,ht,lt){var Ht=se&i,Ut=_e(I),Br=Ut.length,M=_e($),Z=M.length;if(Br!=Z&&!Ht)return!1;for(var de=Br;de--;){var be=Ut[de];if(!(Ht?be in $:kr.call($,be)))return!1}var Me=lt.get(I);if(Me&<.get($))return Me==$;var Ke=!0;lt.set(I,$),lt.set($,I);for(var Je=Ht;++de<Br;){be=Ut[de];var yt=I[be],Ot=$[be];if(Ce)var pr=Ht?Ce(Ot,yt,be,$,I,lt):Ce(yt,Ot,be,I,$,lt);if(!(pr===void 0?yt===Ot||ht(yt,Ot,se,Ce,lt):pr)){Ke=!1;break}Je||(Je=be=="constructor")}if(Ke&&!Je){var yr=I.constructor,ur=$.constructor;yr!=ur&&"constructor"in I&&"constructor"in $&&!(typeof yr=="function"&&yr instanceof yr&&typeof ur=="function"&&ur instanceof ur)&&(Ke=!1)}return lt.delete(I),lt.delete($),Ke}function _e(I){return on(I,lr,Jt)}function rt(I,$){var se=I.__data__;return dn($)?se[typeof $=="string"?"string":"hash"]:se.map}function ut(I,$){var se=dr(I,$);return O(se)?se:void 0}function nt(I){var $=kr.call(I,zt),se=I[zt];try{I[zt]=void 0;var Ce=!0}catch{}var ht=Vr.call(I);return Ce&&($?I[zt]=se:delete I[zt]),ht}var Jt=sr?function(I){return I==null?[]:(I=Object(I),St(sr(I),function($){return en.call(I,$)}))}:Pn,vr=rn;(Nr&&vr(new Nr(new ArrayBuffer(1)))!=Y||Xr&&vr(new Xr)!=v||Ee&&vr(Ee.resolve())!=S||D&&vr(new D)!=R||U&&vr(new U)!=ie)&&(vr=function(I){var $=rn(I),se=$==C?I.constructor:void 0,Ce=se?Or(se):"";if(Ce)switch(Ce){case ue:return Y;case Fe:return v;case We:return S;case wt:return R;case Dt:return ie}return $});function jr(I,$){return $=$??s,!!$&&(typeof I=="number"||Be.test(I))&&I>-1&&I%1==0&&I<$}function dn(I){var $=typeof I;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?I!=="__proto__":I===null}function Kn(I){return!!Zr&&Zr in I}function Vn(I){var $=I&&I.constructor,se=typeof $=="function"&&$.prototype||_r;return I===se}function vn(I){return Vr.call(I)}function Or(I){if(I!=null){try{return Yr.call(I)}catch{}try{return I+""}catch{}}return""}function qn(I,$){return I===$||I!==I&&$!==$}var Mn=Lr((function(){return arguments})())?Lr:function(I){return En(I)&&kr.call(I,"callee")&&!en.call(I,"callee")},_n=Array.isArray;function Ri(I){return I!=null&&ki(I.length)&&!Nn(I)}var bi=Er||Ci;function wi(I,$){return ln(I,$)}function Nn(I){if(!zn(I))return!1;var $=rn(I);return $==h||$==g||$==u||$==F}function ki(I){return typeof I=="number"&&I>-1&&I%1==0&&I<=s}function zn(I){var $=typeof I;return I!=null&&($=="object"||$=="function")}function En(I){return I!=null&&typeof I=="object"}var Zn=ar?gr(ar):z;function lr(I){return Ri(I)?Sn(I):W(I)}function Pn(){return[]}function Ci(){return!1}r.exports=wi})(Nd,Nd.exports)),Nd.exports}var R_=D_();const vf=Ns(R_);var Wh={exports:{}},fd={};var KC;function O_(){if(KC)return fd;KC=1;var r=Il(),e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(o,l,u){var c,f={},d=null,h=null;u!==void 0&&(d=""+u),l.key!==void 0&&(d=""+l.key),l.ref!==void 0&&(h=l.ref);for(c in l)n.call(l,c)&&!a.hasOwnProperty(c)&&(f[c]=l[c]);if(o&&o.defaultProps)for(c in l=o.defaultProps,l)f[c]===void 0&&(f[c]=l[c]);return{$$typeof:e,type:o,key:d,ref:h,props:f,_owner:i.current}}return fd.Fragment=t,fd.jsx=s,fd.jsxs=s,fd}var hd={};var ZC;function B_(){return ZC||(ZC=1,process.env.NODE_ENV!=="production"&&(function(){var r=Il(),e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),g=Symbol.iterator,v="@@iterator";function y(K){if(K===null||typeof K!="object")return null;var Ie=g&&K[g]||K[v];return typeof Ie=="function"?Ie:null}var A=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(K){{for(var Ie=arguments.length,Qe=new Array(Ie>1?Ie-1:0),Ye=1;Ye<Ie;Ye++)Qe[Ye-1]=arguments[Ye];S("error",K,Qe)}}function S(K,Ie,Qe){{var Ye=A.ReactDebugCurrentFrame,xt=Ye.getStackAddendum();xt!==""&&(Ie+="%s",Qe=Qe.concat([xt]));var ft=Qe.map(function(Rt){return String(Rt)});ft.unshift("Warning: "+Ie),Function.prototype.apply.call(console[K],console,ft)}}var F=!1,E=!1,R=!1,B=!1,j=!1,G;G=Symbol.for("react.module.reference");function ie(K){return!!(typeof K=="string"||typeof K=="function"||K===n||K===a||j||K===i||K===u||K===c||B||K===h||F||E||R||typeof K=="object"&&K!==null&&(K.$$typeof===d||K.$$typeof===f||K.$$typeof===s||K.$$typeof===o||K.$$typeof===l||K.$$typeof===G||K.getModuleId!==void 0))}function q(K,Ie,Qe){var Ye=K.displayName;if(Ye)return Ye;var xt=Ie.displayName||Ie.name||"";return xt!==""?Qe+"("+xt+")":Qe}function Y(K){return K.displayName||"Context"}function J(K){if(K==null)return null;if(typeof K.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof K=="function")return K.displayName||K.name||null;if(typeof K=="string")return K;switch(K){case n:return"Fragment";case t:return"Portal";case a:return"Profiler";case i:return"StrictMode";case u:return"Suspense";case c:return"SuspenseList"}if(typeof K=="object")switch(K.$$typeof){case o:var Ie=K;return Y(Ie)+".Consumer";case s:var Qe=K;return Y(Qe._context)+".Provider";case l:return q(K,K.render,"ForwardRef");case f:var Ye=K.displayName||null;return Ye!==null?Ye:J(K.type)||"Memo";case d:{var xt=K,ft=xt._payload,Rt=xt._init;try{return J(Rt(ft))}catch{return null}}}return null}var ae=Object.assign,oe=0,he,ye,Ue,Re,Oe,ee,re;function fe(){}fe.__reactDisabledLog=!0;function Be(){{if(oe===0){he=console.log,ye=console.info,Ue=console.warn,Re=console.error,Oe=console.group,ee=console.groupCollapsed,re=console.groupEnd;var K={configurable:!0,enumerable:!0,value:fe,writable:!0};Object.defineProperties(console,{info:K,log:K,warn:K,error:K,group:K,groupCollapsed:K,groupEnd:K})}oe++}}function ke(){{if(oe--,oe===0){var K={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ae({},K,{value:he}),info:ae({},K,{value:ye}),warn:ae({},K,{value:Ue}),error:ae({},K,{value:Re}),group:ae({},K,{value:Oe}),groupCollapsed:ae({},K,{value:ee}),groupEnd:ae({},K,{value:re})})}oe<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var $e=A.ReactCurrentDispatcher,je;function qe(K,Ie,Qe){{if(je===void 0)try{throw Error()}catch(xt){var Ye=xt.stack.trim().match(/\n( *(at )?)/);je=Ye&&Ye[1]||""}return`
|
|
1748
|
+
`},OC=function(r){return 48<=r.charCodeAt(0)&&r.charCodeAt(0)<=57},fM=(function(r){function e(){var t=r.call(this)||this;return t.curNumber="",t.curCommandType=-1,t.curCommandRelative=!1,t.canParseCommandOrComma=!0,t.curNumberHasExp=!1,t.curNumberHasExpDigits=!1,t.curNumberHasDecimal=!1,t.curArgs=[],t}return bT(e,r),e.prototype.finish=function(t){if(t===void 0&&(t=[]),this.parse(" ",t),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,n){var i=this;n===void 0&&(n=[]);for(var a=function(f){n.push(f),i.curArgs.length=0,i.canParseCommandOrComma=!0},s=0;s<t.length;s++){var o=t[s],l=!(this.curCommandType!==Le.ARC||this.curArgs.length!==3&&this.curArgs.length!==4||this.curNumber.length!==1||this.curNumber!=="0"&&this.curNumber!=="1"),u=OC(o)&&(this.curNumber==="0"&&o==="0"||l);if(!OC(o)||u)if(o!=="e"&&o!=="E")if(o!=="-"&&o!=="+"||!this.curNumberHasExp||this.curNumberHasExpDigits)if(o!=="."||this.curNumberHasExp||this.curNumberHasDecimal||l){if(this.curNumber&&this.curCommandType!==-1){var c=Number(this.curNumber);if(isNaN(c))throw new SyntaxError("Invalid number ending at "+s);if(this.curCommandType===Le.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>c)throw new SyntaxError('Expected positive number, got "'+c+'" at index "'+s+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+s+'"')}this.curArgs.push(c),this.curArgs.length===hM[this.curCommandType]&&(Le.HORIZ_LINE_TO===this.curCommandType?a({type:Le.HORIZ_LINE_TO,relative:this.curCommandRelative,x:c}):Le.VERT_LINE_TO===this.curCommandType?a({type:Le.VERT_LINE_TO,relative:this.curCommandRelative,y:c}):this.curCommandType===Le.MOVE_TO||this.curCommandType===Le.LINE_TO||this.curCommandType===Le.SMOOTH_QUAD_TO?(a({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),Le.MOVE_TO===this.curCommandType&&(this.curCommandType=Le.LINE_TO)):this.curCommandType===Le.CURVE_TO?a({type:Le.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===Le.SMOOTH_CURVE_TO?a({type:Le.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===Le.QUAD_TO?a({type:Le.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===Le.ARC&&a({type:Le.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!dM(o))if(o===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(o!=="+"&&o!=="-"&&o!==".")if(u)this.curNumber=o,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+s+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+o+'" at index '+s+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,o!=="z"&&o!=="Z")if(o==="h"||o==="H")this.curCommandType=Le.HORIZ_LINE_TO,this.curCommandRelative=o==="h";else if(o==="v"||o==="V")this.curCommandType=Le.VERT_LINE_TO,this.curCommandRelative=o==="v";else if(o==="m"||o==="M")this.curCommandType=Le.MOVE_TO,this.curCommandRelative=o==="m";else if(o==="l"||o==="L")this.curCommandType=Le.LINE_TO,this.curCommandRelative=o==="l";else if(o==="c"||o==="C")this.curCommandType=Le.CURVE_TO,this.curCommandRelative=o==="c";else if(o==="s"||o==="S")this.curCommandType=Le.SMOOTH_CURVE_TO,this.curCommandRelative=o==="s";else if(o==="q"||o==="Q")this.curCommandType=Le.QUAD_TO,this.curCommandRelative=o==="q";else if(o==="t"||o==="T")this.curCommandType=Le.SMOOTH_QUAD_TO,this.curCommandRelative=o==="t";else{if(o!=="a"&&o!=="A")throw new SyntaxError('Unexpected character "'+o+'" at index '+s+".");this.curCommandType=Le.ARC,this.curCommandRelative=o==="a"}else n.push({type:Le.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=o,this.curNumberHasDecimal=o==="."}else this.curNumber+=o,this.curNumberHasDecimal=!0;else this.curNumber+=o;else this.curNumber+=o,this.curNumberHasExp=!0;else this.curNumber+=o,this.curNumberHasExpDigits=this.curNumberHasExp}return n},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(n,i){i===void 0&&(i=[]);for(var a=0,s=Object.getPrototypeOf(this).parse.call(this,n);a<s.length;a++){var o=s[a],l=t(o);Array.isArray(l)?i.push.apply(i,l):i.push(l)}return i}}})},e})(wT),Le=(function(r){function e(t){var n=r.call(this)||this;return n.commands=typeof t=="string"?e.parse(t):t,n}return bT(e,r),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=ti.CALCULATE_BOUNDS();return this.transform(t),t},e.prototype.transform=function(t){for(var n=[],i=0,a=this.commands;i<a.length;i++){var s=t(a[i]);Array.isArray(s)?n.push.apply(n,s):n.push(s)}return this.commands=n,this},e.encode=function(t){return cM(t)},e.parse=function(t){var n=new fM,i=[];return n.parse(t,i),n.finish(i),i},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e})(wT),hM=((Sa={})[Le.MOVE_TO]=2,Sa[Le.LINE_TO]=2,Sa[Le.HORIZ_LINE_TO]=1,Sa[Le.VERT_LINE_TO]=1,Sa[Le.CLOSE_PATH]=0,Sa[Le.QUAD_TO]=4,Sa[Le.SMOOTH_QUAD_TO]=2,Sa[Le.CURVE_TO]=6,Sa[Le.SMOOTH_CURVE_TO]=4,Sa[Le.ARC]=7,Sa);function Hp(r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Hp=function(e){return typeof e}:Hp=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hp(r)}function pM(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var gM=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],mM=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function vM(r,e,t,n,i){if(typeof r=="string"&&(r=document.getElementById(r)),!r||Hp(r)!=="object"||!("getContext"in r))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var a=r.getContext("2d");try{return a.getImageData(e,t,n,i)}catch(s){throw new Error("unable to access image data: "+s)}}function yM(r,e,t,n,i,a){if(!(isNaN(a)||a<1)){a|=0;var s=vM(r,e,t,n,i);s=AM(s,e,t,n,i,a),r.getContext("2d").putImageData(s,e,t)}}function AM(r,e,t,n,i,a){for(var s=r.data,o=2*a+1,l=n-1,u=i-1,c=a+1,f=c*(c+1)/2,d=new BC,h=d,g,v=1;v<o;v++)h=h.next=new BC,v===c&&(g=h);h.next=d;for(var y=null,A=null,C=0,S=0,F=gM[a],E=mM[a],R=0;R<i;R++){h=d;for(var B=s[S],j=s[S+1],G=s[S+2],ie=s[S+3],q=0;q<c;q++)h.r=B,h.g=j,h.b=G,h.a=ie,h=h.next;for(var Y=0,J=0,ae=0,oe=0,he=c*B,ye=c*j,Ue=c*G,Re=c*ie,Oe=f*B,ee=f*j,re=f*G,fe=f*ie,Be=1;Be<c;Be++){var ke=S+((l<Be?l:Be)<<2),$e=s[ke],je=s[ke+1],qe=s[ke+2],Ge=s[ke+3],bt=c-Be;Oe+=(h.r=$e)*bt,ee+=(h.g=je)*bt,re+=(h.b=qe)*bt,fe+=(h.a=Ge)*bt,Y+=$e,J+=je,ae+=qe,oe+=Ge,h=h.next}y=d,A=g;for(var rr=0;rr<n;rr++){var Dr=fe*F>>>E;if(s[S+3]=Dr,Dr!==0){var Gt=255/Dr;s[S]=(Oe*F>>>E)*Gt,s[S+1]=(ee*F>>>E)*Gt,s[S+2]=(re*F>>>E)*Gt}else s[S]=s[S+1]=s[S+2]=0;Oe-=he,ee-=ye,re-=Ue,fe-=Re,he-=y.r,ye-=y.g,Ue-=y.b,Re-=y.a;var ar=rr+a+1;ar=C+(ar<l?ar:l)<<2,Y+=y.r=s[ar],J+=y.g=s[ar+1],ae+=y.b=s[ar+2],oe+=y.a=s[ar+3],Oe+=Y,ee+=J,re+=ae,fe+=oe,y=y.next;var St=A,st=St.r,Qr=St.g,Sr=St.b,gr=St.a;he+=st,ye+=Qr,Ue+=Sr,Re+=gr,Y-=st,J-=Qr,ae-=Sr,oe-=gr,A=A.next,S+=4}C+=n}for(var nr=0;nr<n;nr++){S=nr<<2;var dr=s[S],Yt=s[S+1],Xt=s[S+2],mt=s[S+3],Cr=c*dr,sn=c*Yt,_r=c*Xt,ir=c*mt,Yr=f*dr,kr=f*Yt,Zr=f*Xt,Vr=f*mt;h=d;for(var pn=0;pn<c;pn++)h.r=dr,h.g=Yt,h.b=Xt,h.a=mt,h=h.next;for(var gn=n,Tr=0,zr=0,en=0,$r=0,zt=1;zt<=a;zt++){S=gn+nr<<2;var sr=c-zt;Yr+=(h.r=dr=s[S])*sr,kr+=(h.g=Yt=s[S+1])*sr,Zr+=(h.b=Xt=s[S+2])*sr,Vr+=(h.a=mt=s[S+3])*sr,$r+=dr,Tr+=Yt,zr+=Xt,en+=mt,h=h.next,zt<u&&(gn+=n)}S=nr,y=d,A=g;for(var Er=0;Er<i;Er++){var tt=S<<2;s[tt+3]=mt=Vr*F>>>E,mt>0?(mt=255/mt,s[tt]=(Yr*F>>>E)*mt,s[tt+1]=(kr*F>>>E)*mt,s[tt+2]=(Zr*F>>>E)*mt):s[tt]=s[tt+1]=s[tt+2]=0,Yr-=Cr,kr-=sn,Zr-=_r,Vr-=ir,Cr-=y.r,sn-=y.g,_r-=y.b,ir-=y.a,tt=nr+((tt=Er+c)<u?tt:u)*n<<2,Yr+=$r+=y.r=s[tt],kr+=Tr+=y.g=s[tt+1],Zr+=zr+=y.b=s[tt+2],Vr+=en+=y.a=s[tt+3],y=y.next,Cr+=dr=A.r,sn+=Yt=A.g,_r+=Xt=A.b,ir+=mt=A.a,$r-=dr,Tr-=Yt,zr-=Xt,en-=mt,A=A.next,S+=n}}return r}var BC=function r(){pM(this,r),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function bl(r,e,t,n,i,a){return r[t*n*4+e*4+a]}function wl(r,e,t,n,i,a,s){r[t*n*4+e*4+a]=s}function Vf(r){return r.replace(/(?!\u3000)\s+/gm," ")}function Hi(r){const e=r.match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm);return e?e.map(parseFloat):[]}function bM(r){const e=Hi(r);return[e[0]||0,e[1]||0,e[2]||0,e[3]||0,e[4]||0,e[5]||0]}const wM=/^[A-Z-]+$/;function CM(r){return wM.test(r)?r.toLowerCase():r}function MC(r){const e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(r);return e&&(e[2]||e[3]||e[4])||""}function xM(r){if(!r.startsWith("rgb"))return r;let e=3;return r.replace(/\d+(\.\d+)?/g,(n,i)=>e--&&i?String(Math.round(parseFloat(n))):n)}const SM=/(\[[^\]]+\])/g,EM=/(#[^\s+>~.[:]+)/g,kM=/(\.[^\s+>~.[:]+)/g,TM=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,FM=/(:[\w-]+\([^)]*\))/gi,IM=/(:[^\s+>~.[:]+)/g,PM=/([^\s+>~.[:]+)/g;function cl(r,e){const t=e.exec(r);return t?[r.replace(e," "),t.length]:[r,0]}function DM(r){const e=[0,0,0];let t=r.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),n=0;return[t,n]=cl(t,SM),e[1]+=n,[t,n]=cl(t,EM),e[0]+=n,[t,n]=cl(t,kM),e[1]+=n,[t,n]=cl(t,TM),e[2]+=n,[t,n]=cl(t,FM),e[1]+=n,[t,n]=cl(t,IM),e[1]+=n,t=t.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[t,n]=cl(t,PM),e[2]+=n,e.join("")}const $u=1e-8;function _C(r){return Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2))}function Gy(r,e){return(r[0]*e[0]+r[1]*e[1])/(_C(r)*_C(e))}function NC(r,e){return(r[0]*e[1]<r[1]*e[0]?-1:1)*Math.acos(Gy(r,e))}function LC(r){return r*r*r}function UC(r){return 3*r*r*(1-r)}function VC(r){return 3*r*(1-r)*(1-r)}function zC(r){return(1-r)*(1-r)*(1-r)}function $C(r){return r*r}function HC(r){return 2*r*(1-r)}function jC(r){return(1-r)*(1-r)}class Mt{document;name;value;static empty(e){return new Mt(e,"EMPTY","")}static textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};isNormalizedColor=!1;constructor(e,t,n){this.document=e,this.name=t,this.value=n}split(e=" "){const{document:t,name:n}=this;return Vf(this.getString()).trim().split(e).map(i=>new Mt(t,n,i))}hasValue(e){const t=this.value;return t!==null&&t!==""&&(e||t!==0)&&typeof t<"u"}isString(e){const{value:t}=this,n=typeof t=="string";return!n||!e?n:e.test(t)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;const e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}setValue(e){return this.value=e,this}getValue(e){return typeof e>"u"||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return typeof e>"u"?0:parseFloat(e);const{value:t}=this;let n=parseFloat(t);return this.isString(/%$/)&&(n/=100),n}getString(e){return typeof e>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(e)}getColor(e){let t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=xM(t),this.value=t),t}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(e,t=!1){if(!this.hasValue())return 0;const[n,i]=typeof e=="boolean"?[void 0,e]:[e],{viewPort:a}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(a.computeSize("x"),a.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(a.computeSize("x"),a.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*a.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*a.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&i):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*a.computeSize(n);default:{const s=this.getNumber();return t&&s<1?s*a.computeSize(n):s}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){const e=this.getString(),n=/#([^)'"]+)/.exec(e)?.[1]||e;return this.document.definitions[n]}getFillStyleDefinition(e,t){let n=this.getDefinition();if(!n)return null;if(typeof n.createGradient=="function"&&"getBoundingBox"in e)return n.createGradient(this.document.ctx,e,t);if(typeof n.createPattern=="function"){if(n.getHrefAttribute().hasValue()){const i=n.getAttribute("patternTransform");n=n.getHrefAttribute().getDefinition(),n&&i.hasValue()&&n.getAttribute("patternTransform",!0).setValue(i.value)}if(n)return n.createPattern(this.document.ctx,e,t)}return null}getTextBaseline(){if(!this.hasValue())return null;const e=this.getString();return Mt.textBaselineMapping[e]||null}addOpacity(e){let t=this.getColor();const n=t.length;let i=0;for(let a=0;a<n&&(t[a]===","&&i++,i!==3);a++);if(e.hasValue()&&this.isString()&&i!==3){const a=new Hy(t);a.ok&&(a.alpha=e.getNumber(),t=a.toRGBA())}return new Mt(this.document,this.name,t)}}class qy{static DEFAULT_VIEWPORT_WIDTH=800;static DEFAULT_VIEWPORT_HEIGHT=600;viewPorts=[];clear(){this.viewPorts=[]}setCurrent(e,t){this.viewPorts.push({width:e,height:t})}removeCurrent(){this.viewPorts.pop()}getRoot(){const[e]=this.viewPorts;return e||GC()}getCurrent(){const{viewPorts:e}=this,t=e[e.length-1];return t||GC()}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(e){return typeof e=="number"?e:e==="x"?this.width:e==="y"?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}function GC(){return{width:qy.DEFAULT_VIEWPORT_WIDTH,height:qy.DEFAULT_VIEWPORT_HEIGHT}}class Rn{x;y;static parse(e,t=0){const[n=t,i=t]=Hi(e);return new Rn(n,i)}static parseScale(e,t=1){const[n=t,i=n]=Hi(e);return new Rn(n,i)}static parsePath(e){const t=Hi(e),n=t.length,i=[];for(let a=0;a<n;a+=2)i.push(new Rn(t[a],t[a+1]));return i}constructor(e,t){this.x=e,this.y=t}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}applyTransform(e){const{x:t,y:n}=this,i=t*e[0]+n*e[2]+e[4],a=t*e[1]+n*e[3]+e[5];this.x=i,this.y=a}}class RM{screen;working=!1;events=[];eventElements=[];constructor(e){this.screen=e,this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(this.working)return;const{screen:e,onClick:t,onMouseMove:n}=this,i=e.ctx.canvas;i.onclick=t,i.onmousemove=n,this.working=!0}stop(){if(!this.working)return;const e=this.screen.ctx.canvas;this.working=!1,e.onclick=null,e.onmousemove=null}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(!this.working)return;const{screen:e,events:t,eventElements:n}=this,{style:i}=e.ctx.canvas;let a;i&&(i.cursor=""),t.forEach(({run:s},o)=>{for(a=n[o];a;)s(a),a=a.parent}),this.events=[],this.eventElements=[]}checkPath(e,t){if(!this.working||!t)return;const{events:n,eventElements:i}=this;n.forEach(({x:a,y:s},o)=>{!i[o]&&t.isPointInPath&&t.isPointInPath(a,s)&&(i[o]=e)})}checkBoundingBox(e,t){if(!this.working||!t)return;const{events:n,eventElements:i}=this;n.forEach(({x:a,y:s},o)=>{!i[o]&&t.isPointInBox(a,s)&&(i[o]=e)})}mapXY(e,t){const{window:n,ctx:i}=this.screen,a=new Rn(e,t);let s=i.canvas;for(;s;)a.x-=s.offsetLeft,a.y-=s.offsetTop,s=s.offsetParent;return n?.scrollX&&(a.x+=n.scrollX),n?.scrollY&&(a.y+=n.scrollY),a}onClick(e){const{x:t,y:n}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onclick",x:t,y:n,run(i){i.onClick&&i.onClick()}})}onMouseMove(e){const{x:t,y:n}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onmousemove",x:t,y:n,run(i){i.onMouseMove&&i.onMouseMove()}})}}const qC=typeof window<"u"?window:null,WC=typeof fetch<"u"?fetch.bind(void 0):void 0;class zf{ctx;static defaultWindow=qC;static defaultFetch=WC;static FRAMERATE=30;static MAX_VIRTUAL_PIXELS=3e4;window;fetch;viewPort=new qy;mouse=new RM(this);animations=[];readyPromise;resolveReady;waits=[];frameDuration=0;isReadyLock=!1;isFirstRender=!0;intervalId=null;constructor(e,{fetch:t=WC,window:n=qC}={}){if(this.ctx=e,this.window=n,!t)throw new Error("Can't find 'fetch' in 'globalThis', please provide it via options");this.fetch=t}wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;const e=this.waits.every(t=>t());return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}setViewBox({document:e,ctx:t,aspectRatio:n,width:i,desiredWidth:a,height:s,desiredHeight:o,minX:l=0,minY:u=0,refX:c,refY:f,clip:d=!1,clipX:h=0,clipY:g=0}){const v=Vf(n).replace(/^defer\s/,""),[y,A]=v.split(" "),C=y||"xMidYMid",S=A||"meet",F=i/a,E=s/o,R=Math.min(F,E),B=Math.max(F,E);let j=a,G=o;S==="meet"&&(j*=R,G*=R),S==="slice"&&(j*=B,G*=B);const ie=new Mt(e,"refX",c),q=new Mt(e,"refY",f),Y=ie.hasValue()&&q.hasValue();if(Y&&t.translate(-R*ie.getPixels("x"),-R*q.getPixels("y")),d){const J=R*h,ae=R*g;t.beginPath(),t.moveTo(J,ae),t.lineTo(i,ae),t.lineTo(i,s),t.lineTo(J,s),t.closePath(),t.clip()}if(!Y){const J=S==="meet"&&R===E,ae=S==="slice"&&B===E,oe=S==="meet"&&R===F,he=S==="slice"&&B===F;C.startsWith("xMid")&&(J||ae)&&t.translate(i/2-j/2,0),C.endsWith("YMid")&&(oe||he)&&t.translate(0,s/2-G/2),C.startsWith("xMax")&&(J||ae)&&t.translate(i-j,0),C.endsWith("YMax")&&(oe||he)&&t.translate(0,s-G)}switch(!0){case C==="none":t.scale(F,E);break;case S==="meet":t.scale(R,R);break;case S==="slice":t.scale(B,B);break}t.translate(-l,-u)}start(e,{enableRedraw:t=!1,ignoreMouse:n=!1,ignoreAnimation:i=!1,ignoreDimensions:a=!1,ignoreClear:s=!1,forceRedraw:o,scaleWidth:l,scaleHeight:u,offsetX:c,offsetY:f}={}){const{mouse:d}=this,h=1e3/zf.FRAMERATE;if(this.isReadyLock=!1,this.frameDuration=h,this.readyPromise=new Promise(C=>{this.resolveReady=C}),this.isReady()&&this.render(e,a,s,l,u,c,f),!t)return;let g=Date.now(),v=g,y=0;const A=()=>{g=Date.now(),y=g-v,y>=h&&(v=g-y%h,this.shouldUpdate(i,o)&&(this.render(e,a,s,l,u,c,f),d.runEvents())),this.intervalId=w0(A)};n||d.start(),this.intervalId=w0(A)}stop(){this.intervalId&&(w0.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,t){if(!e){const{frameDuration:n}=this;if(this.animations.reduce((a,s)=>s.update(n)||a,!1))return!0}return!!(typeof t=="function"&&t()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(e,t,n,i,a,s,o){const{viewPort:l,ctx:u,isFirstRender:c}=this,f=u.canvas;l.clear(),f.width&&f.height&&l.setCurrent(f.width,f.height);const d=e.getStyle("width"),h=e.getStyle("height");!t&&(c||typeof i!="number"&&typeof a!="number")&&(d.hasValue()&&(f.width=d.getPixels("x"),f.style&&(f.style.width=`${f.width}px`)),h.hasValue()&&(f.height=h.getPixels("y"),f.style&&(f.style.height=`${f.height}px`)));let g=f.clientWidth||f.width,v=f.clientHeight||f.height;if(t&&d.hasValue()&&h.hasValue()&&(g=d.getPixels("x"),v=h.getPixels("y")),l.setCurrent(g,v),typeof s=="number"&&e.getAttribute("x",!0).setValue(s),typeof o=="number"&&e.getAttribute("y",!0).setValue(o),typeof i=="number"||typeof a=="number"){const y=Hi(e.getAttribute("viewBox").getString());let A=0,C=0;if(typeof i=="number"){const F=e.getStyle("width");F.hasValue()?A=F.getPixels("x")/i:y[2]&&!isNaN(y[2])&&(A=y[2]/i)}if(typeof a=="number"){const F=e.getStyle("height");F.hasValue()?C=F.getPixels("y")/a:y[3]&&!isNaN(y[3])&&(C=y[3]/a)}A||(A=C),C||(C=A),e.getAttribute("width",!0).setValue(i),e.getAttribute("height",!0).setValue(a);const S=e.getStyle("transform",!0,!0);S.setValue(`${S.getString()} scale(${1/A}, ${1/C})`)}n||u.clearRect(0,0,g,v),e.render(u),c&&(this.isFirstRender=!1)}}const{defaultFetch:OM}=zf,BM=typeof DOMParser<"u"?DOMParser:void 0;let S0=class{fetch;DOMParser;constructor({fetch:e=OM,DOMParser:t=BM}={}){if(!e)throw new Error("Can't find 'fetch' in 'globalThis', please provide it via options");if(!t)throw new Error("Can't find 'DOMParser' in 'globalThis', please provide it via options");this.fetch=e,this.DOMParser=t}async parse(e){return e.startsWith("<")?this.parseFromString(e):this.load(e)}parseFromString(e){const t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch{return this.checkDocument(t.parseFromString(e,"text/xml"))}}checkDocument(e){const t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent||"Unknown parse error");return e}async load(e){const n=await(await this.fetch(e)).text();return this.parseFromString(n)}};class MM{type="translate";point;constructor(e,t){this.point=Rn.parse(t)}apply(e){const{x:t,y:n}=this.point;e.translate(t||0,n||0)}unapply(e){const{x:t,y:n}=this.point;e.translate(-1*t||0,-1*n||0)}applyToPoint(e){const{x:t,y:n}=this.point;e.applyTransform([1,0,0,1,t||0,n||0])}}class _M{type="rotate";angle;originX;originY;cx;cy;constructor(e,t,n){const i=Hi(t);this.angle=new Mt(e,"angle",i[0]),this.originX=n[0],this.originY=n[1],this.cx=i[1]||0,this.cy=i[2]||0}apply(e){const{cx:t,cy:n,originX:i,originY:a,angle:s}=this,o=t+i.getPixels("x"),l=n+a.getPixels("y");e.translate(o,l),e.rotate(s.getRadians()),e.translate(-o,-l)}unapply(e){const{cx:t,cy:n,originX:i,originY:a,angle:s}=this,o=t+i.getPixels("x"),l=n+a.getPixels("y");e.translate(o,l),e.rotate(-1*s.getRadians()),e.translate(-o,-l)}applyToPoint(e){const{cx:t,cy:n,angle:i}=this,a=i.getRadians();e.applyTransform([1,0,0,1,t||0,n||0]),e.applyTransform([Math.cos(a),Math.sin(a),-Math.sin(a),Math.cos(a),0,0]),e.applyTransform([1,0,0,1,-t||0,-n||0])}}class NM{type="scale";scale;originX;originY;constructor(e,t,n){const i=Rn.parseScale(t);(i.x===0||i.y===0)&&(i.x=$u,i.y=$u),this.scale=i,this.originX=n[0],this.originY=n[1]}apply(e){const{scale:{x:t,y:n},originX:i,originY:a}=this,s=i.getPixels("x"),o=a.getPixels("y");e.translate(s,o),e.scale(t,n||t),e.translate(-s,-o)}unapply(e){const{scale:{x:t,y:n},originX:i,originY:a}=this,s=i.getPixels("x"),o=a.getPixels("y");e.translate(s,o),e.scale(1/t,1/n||t),e.translate(-s,-o)}applyToPoint(e){const{x:t,y:n}=this.scale;e.applyTransform([t||0,0,0,n||0,0,0])}}class CT{type="matrix";matrix;originX;originY;constructor(e,t,n){this.matrix=bM(t),this.originX=n[0],this.originY=n[1]}apply(e){const{originX:t,originY:n,matrix:i}=this,a=t.getPixels("x"),s=n.getPixels("y");e.translate(a,s),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.translate(-a,-s)}unapply(e){const{originX:t,originY:n,matrix:i}=this,a=i[0],s=i[2],o=i[4],l=i[1],u=i[3],c=i[5],f=0,d=0,h=1,g=1/(a*(u*h-c*d)-s*(l*h-c*f)+o*(l*d-u*f)),v=t.getPixels("x"),y=n.getPixels("y");e.translate(v,y),e.transform(g*(u*h-c*d),g*(c*f-l*h),g*(o*d-s*h),g*(a*h-o*f),g*(s*c-o*u),g*(o*l-a*c)),e.translate(-v,-y)}applyToPoint(e){e.applyTransform(this.matrix)}}class xT extends CT{type="skew";angle;constructor(e,t,n){super(e,t,n),this.angle=new Mt(e,"angle",t)}}class LM extends xT{type="skewX";constructor(e,t,n){super(e,t,n),this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class UM extends xT{type="skewY";constructor(e,t,n){super(e,t,n),this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function VM(r){return Vf(r).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function zM(r){const[e="",t=""]=r.split("(");return[e.trim(),t.trim().replace(")","")]}class tc{document;static fromElement(e,t){const n=t.getStyle("transform",!1,!0);if(n.hasValue()){const[i,a=i]=t.getStyle("transform-origin",!1,!0).split();if(i&&a){const s=[i,a];return new tc(e,n.getString(),s)}}return null}static transformTypes={translate:MM,rotate:_M,scale:NM,matrix:CT,skewX:LM,skewY:UM};transforms=[];constructor(e,t,n){this.document=e,VM(t).forEach(a=>{if(a==="none")return;const[s,o]=zM(a),l=tc.transformTypes[s];l&&this.transforms.push(new l(this.document,o,n))})}apply(e){this.transforms.forEach(t=>t.apply(e))}unapply(e){this.transforms.forEach(t=>t.unapply(e))}applyToPoint(e){this.transforms.forEach(t=>t.applyToPoint(e))}}class Yn{document;node;captureTextNodes;static ignoreChildTypes=["title"];type="";attributes={};styles={};stylesSpecificity={};animationFrozen=!1;animationFrozenValue="";parent=null;children=[];constructor(e,t,n=!1){if(this.document=e,this.node=t,this.captureTextNodes=n,!t||t.nodeType!==1)return;Array.from(t.attributes).forEach(s=>{const o=CM(s.nodeName);this.attributes[o]=new Mt(e,o,s.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()&&this.getAttribute("style").getString().split(";").map(o=>o.trim()).forEach(o=>{if(!o)return;const[l,u]=o.split(":").map(c=>c.trim());l&&(this.styles[l]=new Mt(e,l,u))});const{definitions:i}=e,a=this.getAttribute("id");a.hasValue()&&(i[a.getString()]||(i[a.getString()]=this)),Array.from(t.childNodes).forEach(s=>{if(s.nodeType===1)this.addChild(s);else if(n&&(s.nodeType===3||s.nodeType===4)){const o=e.createTextNode(s);o.getText().length>0&&this.addChild(o)}})}getAttribute(e,t=!1){const n=this.attributes[e];if(!n&&t){const i=new Mt(this.document,e,"");return this.attributes[e]=i,i}return n||Mt.empty(this.document)}getHrefAttribute(){let e;for(const t in this.attributes)if(t==="href"||t.endsWith(":href")){e=this.attributes[t];break}return e||Mt.empty(this.document)}getStyle(e,t=!1,n=!1){const i=this.styles[e];if(i)return i;const a=this.getAttribute(e);if(a.hasValue())return this.styles[e]=a,a;if(!n){const{parent:s}=this;if(s){const o=s.getStyle(e);if(o.hasValue())return o}}if(t){const s=new Mt(this.document,e,"");return this.styles[e]=s,s}return Mt.empty(this.document)}render(e){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(e.save(),this.getStyle("mask").hasValue()){const t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if(this.getStyle("filter").getValue("none")!=="none"){const t=this.getStyle("filter").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}setContext(e){}applyEffects(e){const t=tc.fromElement(this.document,this);t&&t.apply(e);const n=this.getStyle("clip-path",!1,!0);if(n.hasValue()){const i=n.getDefinition();i&&i.apply(e)}}clearContext(e){}renderChildren(e){this.children.forEach(t=>{t.render(e)})}addChild(e){const t=e instanceof Yn?e:this.document.createElement(e);t.parent=this,Yn.ignoreChildTypes.includes(t.type)||this.children.push(t)}matchesSelector(e){const{node:t}=this;if(!t)return!1;if(typeof t.matches=="function")return t.matches(e);const n=t.getAttribute?.("class");return!n||n===""?!1:n.split(" ").some(i=>`.${i}`===e)}addStylesFromStyleDefinition(){const{styles:e,stylesSpecificity:t}=this.document;let n;for(const i in e)if(!i.startsWith("@")&&this.matchesSelector(i)){const a=e[i],s=t[i];if(a)for(const o in a){let l=this.stylesSpecificity[o];typeof l>"u"&&(l="000"),s&&s>=l&&(n=a[o],n&&(this.styles[o]=n),this.stylesSpecificity[o]=s)}}}removeStyles(e,t){return t.reduce((i,a)=>{const s=e.getStyle(a);if(!s.hasValue())return i;const o=s.getString();return s.setValue(""),[...i,[a,o]]},[])}restoreStyles(e,t){t.forEach(([n,i])=>{e.getStyle(n,!0).setValue(i)})}isFirstChild(){return this.parent?.children.indexOf(this)===0}}class Pl extends Yn{}class $M extends Yn{constructor(e,t,n){super(e,t,n)}}function HM(r){const e=r.trim();return/^('|")/.test(e)?e:`"${e}"`}function jM(r){return typeof process>"u"?r:r.trim().split(",").map(HM).join(",")}function GM(r){if(!r)return"";const e=r.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}function qM(r){if(!r)return"";const e=r.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}let rc=class Iu{static parse(e="",t){let n="",i="",a="",s="",o="";const l=Vf(e).trim().split(" "),u={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return l.forEach(c=>{switch(!0){case(!u.fontStyle&&Iu.styles.includes(c)):c!=="inherit"&&(n=c),u.fontStyle=!0;break;case(!u.fontVariant&&Iu.variants.includes(c)):c!=="inherit"&&(i=c),u.fontStyle=!0,u.fontVariant=!0;break;case(!u.fontWeight&&Iu.weights.includes(c)):c!=="inherit"&&(a=c),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0;break;case!u.fontSize:c!=="inherit"&&(s=c.split("/")[0]||""),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0,u.fontSize=!0;break;default:c!=="inherit"&&(o+=c)}}),new Iu(n,i,a,s,o,t)}static styles="normal|italic|oblique|inherit";static variants="normal|small-caps|inherit";static weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";fontFamily;fontSize;fontStyle;fontWeight;fontVariant;constructor(e,t,n,i,a,s){const o=s?typeof s=="string"?Iu.parse(s):s:{};this.fontFamily=a||o.fontFamily,this.fontSize=i||o.fontSize,this.fontStyle=e||o.fontStyle,this.fontWeight=n||o.fontWeight,this.fontVariant=t||o.fontVariant}toString(){return[GM(this.fontStyle),this.fontVariant,qM(this.fontWeight),this.fontSize,jM(this.fontFamily)].join(" ").trim()}},_a=class{x1;y1;x2;y2;constructor(e=Number.NaN,t=Number.NaN,n=Number.NaN,i=Number.NaN){this.x1=e,this.y1=t,this.x2=n,this.y2=i,this.addPoint(e,t),this.addPoint(n,i)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,t){typeof e<"u"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof t<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))}addX(e){this.addPoint(e,0)}addY(e){this.addPoint(0,e)}addBoundingBox(e){if(!e)return;const{x1:t,y1:n,x2:i,y2:a}=e;this.addPoint(t,n),this.addPoint(i,a)}sumCubic(e,t,n,i,a){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*n+3*(1-e)*Math.pow(e,2)*i+Math.pow(e,3)*a}bezierCurveAdd(e,t,n,i,a){const s=6*t-12*n+6*i,o=-3*t+9*n-9*i+3*a,l=3*n-3*t;if(o===0){if(s===0)return;const d=-l/s;0<d&&d<1&&(e?this.addX(this.sumCubic(d,t,n,i,a)):this.addY(this.sumCubic(d,t,n,i,a)));return}const u=Math.pow(s,2)-4*l*o;if(u<0)return;const c=(-s+Math.sqrt(u))/(2*o);0<c&&c<1&&(e?this.addX(this.sumCubic(c,t,n,i,a)):this.addY(this.sumCubic(c,t,n,i,a)));const f=(-s-Math.sqrt(u))/(2*o);0<f&&f<1&&(e?this.addX(this.sumCubic(f,t,n,i,a)):this.addY(this.sumCubic(f,t,n,i,a)))}addBezierCurve(e,t,n,i,a,s,o,l){this.addPoint(e,t),this.addPoint(o,l),this.bezierCurveAdd(!0,e,n,a,o),this.bezierCurveAdd(!1,t,i,s,l)}addQuadraticCurve(e,t,n,i,a,s){const o=e+.6666666666666666*(n-e),l=t+2/3*(i-t),u=o+1/3*(a-e),c=l+1/3*(s-t);this.addBezierCurve(e,t,o,u,l,c,a,s)}isPointInBox(e,t){const{x1:n,y1:i,x2:a,y2:s}=this;return n<=e&&e<=a&&i<=t&&t<=s}};class Dl extends Yn{modifiedEmSizeStack=!1;calculateOpacity(){let e=1,t=this;for(;t;){const n=t.getStyle("opacity",!1,!0);n.hasValue(!0)&&(e*=n.getNumber()),t=t.parent}return e}setContext(e,t=!1){if(!t){const n=this.getStyle("fill"),i=this.getStyle("fill-opacity"),a=this.getStyle("stroke"),s=this.getStyle("stroke-opacity");if(n.isUrlDefinition()){const h=n.getFillStyleDefinition(this,i);h&&(e.fillStyle=h)}else if(n.hasValue()){n.getString()==="currentColor"&&n.setValue(this.getStyle("color").getColor());const h=n.getColor();h!=="inherit"&&(e.fillStyle=h==="none"?"rgba(0,0,0,0)":h)}if(i.hasValue()){const h=new Mt(this.document,"fill",e.fillStyle).addOpacity(i).getColor();e.fillStyle=h}if(a.isUrlDefinition()){const h=a.getFillStyleDefinition(this,s);h&&(e.strokeStyle=h)}else if(a.hasValue()){a.getString()==="currentColor"&&a.setValue(this.getStyle("color").getColor());const h=a.getString();h!=="inherit"&&(e.strokeStyle=h==="none"?"rgba(0,0,0,0)":h)}if(s.hasValue()){const h=new Mt(this.document,"stroke",e.strokeStyle).addOpacity(s).getString();e.strokeStyle=h}const o=this.getStyle("stroke-width");if(o.hasValue()){const h=o.getPixels();e.lineWidth=h||$u}const l=this.getStyle("stroke-linecap"),u=this.getStyle("stroke-linejoin"),c=this.getStyle("stroke-miterlimit"),f=this.getStyle("stroke-dasharray"),d=this.getStyle("stroke-dashoffset");if(l.hasValue()&&(e.lineCap=l.getString()),u.hasValue()&&(e.lineJoin=u.getString()),c.hasValue()&&(e.miterLimit=c.getNumber()),f.hasValue()&&f.getString()!=="none"){const h=Hi(f.getString());typeof e.setLineDash<"u"?e.setLineDash(h):typeof e.webkitLineDash<"u"?e.webkitLineDash=h:typeof e.mozDash<"u"&&!(h.length===1&&h[0]===0)&&(e.mozDash=h);const g=d.getPixels();typeof e.lineDashOffset<"u"?e.lineDashOffset=g:typeof e.webkitLineDashOffset<"u"?e.webkitLineDashOffset=g:typeof e.mozDashOffset<"u"&&(e.mozDashOffset=g)}}if(this.modifiedEmSizeStack=!1,typeof e.font<"u"){const n=this.getStyle("font"),i=this.getStyle("font-style"),a=this.getStyle("font-variant"),s=this.getStyle("font-weight"),o=this.getStyle("font-size"),l=this.getStyle("font-family"),u=new rc(i.getString(),a.getString(),s.getString(),o.hasValue()?`${o.getPixels(!0)}px`:"",l.getString(),rc.parse(n.getString(),e.font));i.setValue(u.fontStyle),a.setValue(u.fontVariant),s.setValue(u.fontWeight),o.setValue(u.fontSize),l.setValue(u.fontFamily),e.font=u.toString(),o.isPixels()&&(this.document.emSize=o.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}}class ko extends Dl{type="text";x=0;y=0;leafTexts=[];textChunkStart=0;minX=Number.POSITIVE_INFINITY;maxX=Number.NEGATIVE_INFINITY;measureCache=-1;constructor(e,t,n){super(e,t,new.target===ko?!0:n)}setContext(e,t=!1){super.setContext(e,t);const n=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();n&&(e.textBaseline=n)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(e){if(this.type!=="text")return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);let t=null;return this.children.forEach((n,i)=>{const a=this.getChildBoundingBox(e,this,this,i);t?t.addBoundingBox(a):t=a}),t}getFontSize(){const{document:e,parent:t}=this,n=rc.parse(e.ctx.font).fontSize;return t.getStyle("font-size").getNumber(n)}getTElementBoundingBox(e){const t=this.getFontSize();return new _a(this.x,this.y-t,this.x+this.measureText(e),this.y)}getGlyph(e,t,n){const i=t[n];let a;if(e.isArabic){const s=t.length,o=t[n-1],l=t[n+1];let u="isolated";(n===0||o===" ")&&n<s-1&&l!==" "&&(u="terminal"),n>0&&o!==" "&&n<s-1&&l!==" "&&(u="medial"),n>0&&o!==" "&&(n===s-1||l===" ")&&(u="initial"),a=e.arabicGlyphs[i]?.[u]||e.glyphs[i]}else a=e.glyphs[i];return a||(a=e.missingGlyph),a}getText(){return""}getTextFromNode(e){return(e||this.node).textContent}renderChildren(e){if(this.type!=="text"){this.renderTElementChildren(e);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((n,i)=>{this.renderChild(e,this,this,i)});const{mouse:t}=this.document.screen;t.isWorking()&&t.checkBoundingBox(this,this.getBoundingBox(e))}renderTElementChildren(e){const{document:t,parent:n}=this,i=this.getText(),a=n.getStyle("font-family").getDefinition();if(a?.fontFace){const{unitsPerEm:l}=a.fontFace,u=rc.parse(t.ctx.font),c=n.getStyle("font-size").getNumber(u.fontSize),f=n.getStyle("font-style").getString(u.fontStyle),d=c/l,h=a.isRTL?i.split("").reverse().join(""):i,g=Hi(n.getAttribute("dx").getString()),v=h.length;for(let y=0;y<v;y++){const A=this.getGlyph(a,h,y);e.translate(this.x,this.y),e.scale(d,-d);const C=e.lineWidth;e.lineWidth=e.lineWidth*l/c,f==="italic"&&e.transform(1,0,.4,1,0,0),A.render(e),f==="italic"&&e.transform(1,0,-.4,1,0,0),e.lineWidth=C,e.scale(1/d,-1/d),e.translate(-this.x,-this.y),this.x+=c*(A.horizAdvX||a.horizAdvX)/l,typeof g[y]<"u"&&!isNaN(g[y])&&(this.x+=g[y])}return}const{x:s,y:o}=this;e.fillStyle&&e.fillText(i,s,o),e.strokeStyle&&e.strokeText(i,s,o)}applyAnchoring(){if(this.textChunkStart>=this.leafTexts.length)return;const e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),n=!1;let i=0;t==="start"&&!n||t==="end"&&n?i=e.x-this.minX:t==="end"&&!n||t==="start"&&n?i=e.x-this.maxX:i=e.x-(this.minX+this.maxX)/2;for(let a=this.textChunkStart;a<this.leafTexts.length;a++)this.leafTexts[a].x+=i;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}adjustChildCoordinatesRecursive(e){this.children.forEach((t,n)=>{this.adjustChildCoordinatesRecursiveCore(e,this,this,n)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,t,n,i){const a=n.children[i];a.children.length>0?a.children.forEach((s,o)=>{t.adjustChildCoordinatesRecursiveCore(e,t,a,o)}):this.adjustChildCoordinates(e,t,n,i)}adjustChildCoordinates(e,t,n,i){const a=n.children[i];if(typeof a.measureText!="function")return a;e.save(),a.setContext(e,!0);const s=a.getAttribute("x"),o=a.getAttribute("y"),l=a.getAttribute("dx"),u=a.getAttribute("dy"),f=!!a.getStyle("font-family").getDefinition()?.isRTL;i===0&&(s.hasValue()||s.setValue(a.getInheritedAttribute("x")),o.hasValue()||o.setValue(a.getInheritedAttribute("y")),l.hasValue()||l.setValue(a.getInheritedAttribute("dx")),u.hasValue()||u.setValue(a.getInheritedAttribute("dy")));const d=a.measureText(e);return f&&(t.x-=d),s.hasValue()?(t.applyAnchoring(),a.x=s.getPixels("x"),l.hasValue()&&(a.x+=l.getPixels("x"))):(l.hasValue()&&(t.x+=l.getPixels("x")),a.x=t.x),t.x=a.x,f||(t.x+=d),o.hasValue()?(a.y=o.getPixels("y"),u.hasValue()&&(a.y+=u.getPixels("y"))):(u.hasValue()&&(t.y+=u.getPixels("y")),a.y=t.y),t.y=a.y,t.leafTexts.push(a),t.minX=Math.min(t.minX,a.x,a.x+d),t.maxX=Math.max(t.maxX,a.x,a.x+d),a.clearContext(e),e.restore(),a}getChildBoundingBox(e,t,n,i){const a=n.children[i];if(typeof a.getBoundingBox!="function")return null;const s=a.getBoundingBox(e);return s&&a.children.forEach((o,l)=>{const u=t.getChildBoundingBox(e,t,a,l);s.addBoundingBox(u)}),s}renderChild(e,t,n,i){const a=n.children[i];a.render(e),a.children.forEach((s,o)=>{t.renderChild(e,t,a,o)})}measureText(e){const{measureCache:t}=this;if(~t)return t;const n=this.getText(),i=this.measureTargetText(e,n);return this.measureCache=i,i}measureTargetText(e,t){if(!t.length)return 0;const{parent:n}=this,i=n.getStyle("font-family").getDefinition();if(i){const s=this.getFontSize(),o=i.isRTL?t.split("").reverse().join(""):t,l=Hi(n.getAttribute("dx").getString()),u=o.length;let c=0;for(let f=0;f<u;f++){const d=this.getGlyph(i,o,f);c+=(d.horizAdvX||i.horizAdvX)*s/i.fontFace.unitsPerEm,typeof l[f]<"u"&&!isNaN(l[f])&&(c+=l[f])}return c}if(!e.measureText)return t.length*10;e.save(),this.setContext(e,!0);const{width:a}=e.measureText(t);return this.clearContext(e),e.restore(),a}getInheritedAttribute(e){let t=this;for(;t instanceof ko&&t.isFirstChild()&&t.parent;){const n=t.parent.getAttribute(e);if(n.hasValue(!0))return n.getString("0");t=t.parent}return null}}class Hg extends ko{type="tspan";text;constructor(e,t,n){super(e,t,new.target===Hg?!0:n),this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}}class WM extends Hg{type="textNode"}class cr extends Le{control=new Rn(0,0);start=new Rn(0,0);current=new Rn(0,0);command=null;i=-1;previousCommand=null;points=[];angles=[];constructor(e){super(e.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,""))}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new Rn(0,0),this.control=new Rn(0,0),this.current=new Rn(0,0),this.points=[],this.angles=[]}isEnd(){const{i:e,commands:t}=this;return e>=t.length-1}next(){const e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(e="x",t="y"){const n=new Rn(this.command[e],this.command[t]);return this.makeAbsolute(n)}getAsControlPoint(e,t){const n=this.getPoint(e,t);return this.control=n,n}getAsCurrentPoint(e,t){const n=this.getPoint(e,t);return this.current=n,n}getReflectedControlPoint(){const e=this.previousCommand.type;if(e!==Le.CURVE_TO&&e!==Le.SMOOTH_CURVE_TO&&e!==Le.QUAD_TO&&e!==Le.SMOOTH_QUAD_TO)return this.current;const{current:{x:t,y:n},control:{x:i,y:a}}=this;return new Rn(2*t-i,2*n-a)}makeAbsolute(e){if(this.command.relative){const{x:t,y:n}=this.current;e.x+=t,e.y+=n}return e}addMarker(e,t,n){const{points:i,angles:a}=this;n&&a.length>0&&!a[a.length-1]&&(a[a.length-1]=i[i.length-1].angleTo(n)),this.addMarkerAngle(e,t?t.angleTo(e):null)}addMarkerAngle(e,t){this.points.push(e),this.angles.push(t)}getMarkerPoints(){return this.points}getMarkerAngles(){const{angles:e}=this,t=e.length;for(let n=0;n<t;n++)if(!e[n]){for(let i=n+1;i<t;i++)if(e[i]){e[n]=e[i];break}}return e}}class Kr extends Dl{type="path";pathParser;constructor(e,t,n){super(e,t,n),this.pathParser=new cr(this.getAttribute("d").getString())}path(e){const{pathParser:t}=this,n=new _a;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case cr.MOVE_TO:this.pathM(e,n);break;case cr.LINE_TO:this.pathL(e,n);break;case cr.HORIZ_LINE_TO:this.pathH(e,n);break;case cr.VERT_LINE_TO:this.pathV(e,n);break;case cr.CURVE_TO:this.pathC(e,n);break;case cr.SMOOTH_CURVE_TO:this.pathS(e,n);break;case cr.QUAD_TO:this.pathQ(e,n);break;case cr.SMOOTH_QUAD_TO:this.pathT(e,n);break;case cr.ARC:this.pathA(e,n);break;case cr.CLOSE_PATH:this.pathZ(e,n);break}return n}getBoundingBox(e){return this.path()}getMarkers(){const{pathParser:e}=this,t=e.getMarkerPoints(),n=e.getMarkerAngles();return!t||!n?null:t.map((a,s)=>[a,n[s]])}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);const t=this.getStyle("fill-rule");e.fillStyle!==""&&(t.getString("inherit")!=="inherit"?e.fill(t.getString()):e.fill()),e.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());const n=this.getMarkers();if(n){const i=n.length-1,a=this.getStyle("marker-start"),s=this.getStyle("marker-mid"),o=this.getStyle("marker-end");if(a.isUrlDefinition()){const l=a.getDefinition(),[u,c]=n[0];l&&l.render(e,u,c===null?void 0:c)}if(s.isUrlDefinition()){const l=s.getDefinition();for(let u=1;u<i;u++){const[c,f]=n[u];l&&l.render(e,c,f===null?void 0:f)}}if(o.isUrlDefinition()){const l=o.getDefinition(),[u,c]=n[i];l&&l.render(e,u,c===null?void 0:c)}}}static pathM(e){const t=e.getAsCurrentPoint();return e.start=e.current,{point:t}}pathM(e,t){const{pathParser:n}=this,{point:i}=Kr.pathM(n),{x:a,y:s}=i;n.addMarker(i),t.addPoint(a,s),e&&e.moveTo(a,s)}static pathL(e){const{current:t}=e,n=e.getAsCurrentPoint();return{current:t,point:n}}pathL(e,t){const{pathParser:n}=this,{current:i,point:a}=Kr.pathL(n),{x:s,y:o}=a;n.addMarker(a,i),t.addPoint(s,o),e&&e.lineTo(s,o)}static pathH(e){const{current:t,command:n}=e,i=new Rn((n?.relative?t.x:0)+n.x,t.y);return e.current=i,{current:t,point:i}}pathH(e,t){const{pathParser:n}=this,{current:i,point:a}=Kr.pathH(n),{x:s,y:o}=a;n.addMarker(a,i),t.addPoint(s,o),e&&e.lineTo(s,o)}static pathV(e){const{current:t,command:n}=e,i=new Rn(t.x,(n.relative?t.y:0)+n.y);return e.current=i,{current:t,point:i}}pathV(e,t){const{pathParser:n}=this,{current:i,point:a}=Kr.pathV(n),{x:s,y:o}=a;n.addMarker(a,i),t.addPoint(s,o),e&&e.lineTo(s,o)}static pathC(e){const{current:t}=e,n=e.getPoint("x1","y1"),i=e.getAsControlPoint("x2","y2"),a=e.getAsCurrentPoint();return{current:t,point:n,controlPoint:i,currentPoint:a}}pathC(e,t){const{pathParser:n}=this,{current:i,point:a,controlPoint:s,currentPoint:o}=Kr.pathC(n);n.addMarker(o,s,a),t.addBezierCurve(i.x,i.y,a.x,a.y,s.x,s.y,o.x,o.y),e&&e.bezierCurveTo(a.x,a.y,s.x,s.y,o.x,o.y)}static pathS(e){const{current:t}=e,n=e.getReflectedControlPoint(),i=e.getAsControlPoint("x2","y2"),a=e.getAsCurrentPoint();return{current:t,point:n,controlPoint:i,currentPoint:a}}pathS(e,t){const{pathParser:n}=this,{current:i,point:a,controlPoint:s,currentPoint:o}=Kr.pathS(n);n.addMarker(o,s,a),t.addBezierCurve(i.x,i.y,a.x,a.y,s.x,s.y,o.x,o.y),e&&e.bezierCurveTo(a.x,a.y,s.x,s.y,o.x,o.y)}static pathQ(e){const{current:t}=e,n=e.getAsControlPoint("x1","y1"),i=e.getAsCurrentPoint();return{current:t,controlPoint:n,currentPoint:i}}pathQ(e,t){const{pathParser:n}=this,{current:i,controlPoint:a,currentPoint:s}=Kr.pathQ(n);n.addMarker(s,a,a),t.addQuadraticCurve(i.x,i.y,a.x,a.y,s.x,s.y),e&&e.quadraticCurveTo(a.x,a.y,s.x,s.y)}static pathT(e){const{current:t}=e,n=e.getReflectedControlPoint();e.control=n;const i=e.getAsCurrentPoint();return{current:t,controlPoint:n,currentPoint:i}}pathT(e,t){const{pathParser:n}=this,{current:i,controlPoint:a,currentPoint:s}=Kr.pathT(n);n.addMarker(s,a,a),t.addQuadraticCurve(i.x,i.y,a.x,a.y,s.x,s.y),e&&e.quadraticCurveTo(a.x,a.y,s.x,s.y)}static pathA(e){const{current:t,command:n}=e;let{rX:i,rY:a,xRot:s,lArcFlag:o,sweepFlag:l}=n;const u=s*(Math.PI/180),c=e.getAsCurrentPoint(),f=new Rn(Math.cos(u)*(t.x-c.x)/2+Math.sin(u)*(t.y-c.y)/2,-Math.sin(u)*(t.x-c.x)/2+Math.cos(u)*(t.y-c.y)/2),d=Math.pow(f.x,2)/Math.pow(i,2)+Math.pow(f.y,2)/Math.pow(a,2);d>1&&(i*=Math.sqrt(d),a*=Math.sqrt(d));let h=(o===l?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(a,2)-Math.pow(i,2)*Math.pow(f.y,2)-Math.pow(a,2)*Math.pow(f.x,2))/(Math.pow(i,2)*Math.pow(f.y,2)+Math.pow(a,2)*Math.pow(f.x,2)));isNaN(h)&&(h=0);const g=new Rn(h*i*f.y/a,h*-a*f.x/i),v=new Rn((t.x+c.x)/2+Math.cos(u)*g.x-Math.sin(u)*g.y,(t.y+c.y)/2+Math.sin(u)*g.x+Math.cos(u)*g.y),y=NC([1,0],[(f.x-g.x)/i,(f.y-g.y)/a]),A=[(f.x-g.x)/i,(f.y-g.y)/a],C=[(-f.x-g.x)/i,(-f.y-g.y)/a];let S=NC(A,C);return Gy(A,C)<=-1&&(S=Math.PI),Gy(A,C)>=1&&(S=0),{currentPoint:c,rX:i,rY:a,sweepFlag:l,xAxisRotation:u,centp:v,a1:y,ad:S}}pathA(e,t){const{pathParser:n}=this,{currentPoint:i,rX:a,rY:s,sweepFlag:o,xAxisRotation:l,centp:u,a1:c,ad:f}=Kr.pathA(n),d=1-o?1:-1,h=c+d*(f/2),g=new Rn(u.x+a*Math.cos(h),u.y+s*Math.sin(h));if(n.addMarkerAngle(g,h-d*Math.PI/2),n.addMarkerAngle(i,h-d*Math.PI),t.addPoint(i.x,i.y),e&&!isNaN(c)&&!isNaN(f)){const v=a>s?a:s,y=a>s?1:a/s,A=a>s?s/a:1;e.translate(u.x,u.y),e.rotate(l),e.scale(y,A),e.arc(0,0,v,c,c+f,!!(1-o)),e.scale(1/y,1/A),e.rotate(-l),e.translate(-u.x,-u.y)}}static pathZ(e){e.current=e.start}pathZ(e,t){Kr.pathZ(this.pathParser),e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath()}}class $f extends Dl{type="svg";root=!1;setContext(e){const{document:t}=this,{screen:n,window:i}=t,a=e.canvas;if(n.setDefaults(e),"style"in a&&typeof e.font<"u"&&i&&typeof i.getComputedStyle<"u"){e.font=i.getComputedStyle(a).getPropertyValue("font");const A=new Mt(t,"fontSize",rc.parse(e.font).fontSize);A.hasValue()&&(t.rootEmSize=A.getPixels("y"),t.emSize=t.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);let{width:s,height:o}=n.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");const l=this.getAttribute("refX"),u=this.getAttribute("refY"),c=this.getAttribute("viewBox"),f=c.hasValue()?Hi(c.getString()):null,d=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible";let h=0,g=0,v=0,y=0;f&&(h=f[0],g=f[1]),this.root||(s=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y"),this.type==="marker"&&(v=h,y=g,h=0,g=0)),n.viewPort.setCurrent(s,o),this.node&&(!this.parent||this.node.parentNode?.nodeName==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),f&&(s=f[2],o=f[3]),t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:n.viewPort.width,desiredWidth:s,height:n.viewPort.height,desiredHeight:o,minX:h,minY:g,refX:l.getValue(),refY:u.getValue(),clip:d,clipX:v,clipY:y}),f&&(n.viewPort.removeCurrent(),n.viewPort.setCurrent(s,o))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e,t=e,n=!1){const i=this.getAttribute("width",!0),a=this.getAttribute("height",!0),s=this.getAttribute("viewBox"),o=this.getAttribute("style"),l=i.getNumber(0),u=a.getNumber(0);if(n)if(typeof n=="string")this.getAttribute("preserveAspectRatio",!0).setValue(n);else{const c=this.getAttribute("preserveAspectRatio");c.hasValue()&&c.setValue(c.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(i.setValue(e),a.setValue(t),s.hasValue()||s.setValue(`0 0 ${l||e} ${u||t}`),o.hasValue()){const c=this.getStyle("width"),f=this.getStyle("height");c.hasValue()&&c.setValue(`${e}px`),f.hasValue()&&f.setValue(`${t}px`)}}}class ST extends Kr{type="rect";path(e){const t=this.getAttribute("x").getPixels("x"),n=this.getAttribute("y").getPixels("y"),i=this.getStyle("width",!1,!0).getPixels("x"),a=this.getStyle("height",!1,!0).getPixels("y"),s=this.getAttribute("rx"),o=this.getAttribute("ry");let l=s.getPixels("x"),u=o.getPixels("y");if(s.hasValue()&&!o.hasValue()&&(u=l),o.hasValue()&&!s.hasValue()&&(l=u),l=Math.min(l,i/2),u=Math.min(u,a/2),e){const c=4*((Math.sqrt(2)-1)/3);e.beginPath(),a>0&&i>0&&(e.moveTo(t+l,n),e.lineTo(t+i-l,n),e.bezierCurveTo(t+i-l+c*l,n,t+i,n+u-c*u,t+i,n+u),e.lineTo(t+i,n+a-u),e.bezierCurveTo(t+i,n+a-u+c*u,t+i-l+c*l,n+a,t+i-l,n+a),e.lineTo(t+l,n+a),e.bezierCurveTo(t+l-c*l,n+a,t,n+a-u+c*u,t,n+a-u),e.lineTo(t,n+u),e.bezierCurveTo(t,n+u-c*u,t+l-c*l,n,t+l,n),e.closePath())}return new _a(t,n,t+i,n+a)}getMarkers(){return null}}class QM extends Kr{type="circle";path(e){const t=this.getAttribute("cx").getPixels("x"),n=this.getAttribute("cy").getPixels("y"),i=this.getAttribute("r").getPixels();return e&&i>0&&(e.beginPath(),e.arc(t,n,i,0,Math.PI*2,!1),e.closePath()),new _a(t-i,n-i,t+i,n+i)}getMarkers(){return null}}class YM extends Kr{type="ellipse";path(e){const t=4*((Math.sqrt(2)-1)/3),n=this.getAttribute("rx").getPixels("x"),i=this.getAttribute("ry").getPixels("y"),a=this.getAttribute("cx").getPixels("x"),s=this.getAttribute("cy").getPixels("y");return e&&n>0&&i>0&&(e.beginPath(),e.moveTo(a+n,s),e.bezierCurveTo(a+n,s+t*i,a+t*n,s+i,a,s+i),e.bezierCurveTo(a-t*n,s+i,a-n,s+t*i,a-n,s),e.bezierCurveTo(a-n,s-t*i,a-t*n,s-i,a,s-i),e.bezierCurveTo(a+t*n,s-i,a+n,s-t*i,a+n,s),e.closePath()),new _a(a-n,s-i,a+n,s+i)}getMarkers(){return null}}class XM extends Kr{type="line";getPoints(){return[new Rn(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new Rn(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(e){const[{x:t,y:n},{x:i,y:a}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(t,n),e.lineTo(i,a)),new _a(t,n,i,a)}getMarkers(){const[e,t]=this.getPoints(),n=e.angleTo(t);return[[e,n],[t,n]]}}class ET extends Kr{type="polyline";points=[];constructor(e,t,n){super(e,t,n),this.points=Rn.parsePath(this.getAttribute("points").getString())}path(e){const{points:t}=this,[{x:n,y:i}]=t,a=new _a(n,i);return e&&(e.beginPath(),e.moveTo(n,i)),t.forEach(({x:s,y:o})=>{a.addPoint(s,o),e&&e.lineTo(s,o)}),a}getMarkers(){const{points:e}=this,t=e.length-1,n=[];return e.forEach((i,a)=>{a!==t&&n.push([i,i.angleTo(e[a+1])])}),n.length>0&&n.push([e[e.length-1],n[n.length-1][1]]),n}}class JM extends ET{type="polygon";path(e){const t=super.path(e),[{x:n,y:i}]=this.points;return e&&(e.lineTo(n,i),e.closePath()),t}}class KM extends Yn{type="pattern";createPattern(e,t,n){const i=this.getStyle("width").getPixels("x",!0),a=this.getStyle("height").getPixels("y",!0),s=this.getAttribute("data-frame-width"),o=this.getAttribute("data-frame-height"),l=s.hasValue()?s.getPixels("x",!0):i,u=o.hasValue()?o.getPixels("y",!0):a,c=s.hasValue()&&o.hasValue(),f=new $f(this.document,void 0);f.attributes.viewBox=new Mt(this.document,"viewBox",this.getAttribute("viewBox").getValue()),f.attributes.width=new Mt(this.document,"width",`${l}px`),f.attributes.height=new Mt(this.document,"height",`${u}px`),f.attributes.transform=new Mt(this.document,"transform",this.getAttribute("patternTransform").getValue()),f.children=this.children;const d=this.document.createCanvas(l,u),h=d.getContext("2d");h.imageSmoothingEnabled=!0,h.imageSmoothingQuality="high";const g=this.getAttribute("x"),v=this.getAttribute("y");g.hasValue()&&v.hasValue()&&h.translate(g.getPixels("x",!0),v.getPixels("y",!0)),n.hasValue()?this.styles["fill-opacity"]=n:Reflect.deleteProperty(this.styles,"fill-opacity");for(let A=-1;A<=1;A++)for(let C=-1;C<=1;C++)h.save(),f.attributes.x=new Mt(this.document,"x",A*d.width),f.attributes.y=new Mt(this.document,"y",C*d.height),f.render(h),h.restore();return e.createPattern(d,c?"no-repeat":"repeat")}}class ZM extends Yn{type="marker";render(e,t,n){if(!t)return;const{x:i,y:a}=t,s=this.getAttribute("orient").getString("auto"),o=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(i,a),s==="auto"&&n&&e.rotate(n),o==="strokeWidth"&&e.scale(e.lineWidth,e.lineWidth),e.save();const l=new $f(this.document);l.type=this.type,l.attributes.viewBox=new Mt(this.document,"viewBox",this.getAttribute("viewBox").getValue()),l.attributes.refX=new Mt(this.document,"refX",this.getAttribute("refX").getValue()),l.attributes.refY=new Mt(this.document,"refY",this.getAttribute("refY").getValue()),l.attributes.width=new Mt(this.document,"width",this.getAttribute("markerWidth").getValue()),l.attributes.height=new Mt(this.document,"height",this.getAttribute("markerHeight").getValue()),l.attributes.overflow=new Mt(this.document,"overflow",this.getAttribute("overflow").getValue()),l.attributes.fill=new Mt(this.document,"fill",this.getAttribute("fill").getColor("black")),l.attributes.stroke=new Mt(this.document,"stroke",this.getAttribute("stroke").getValue("none")),l.children=this.children,l.render(e),e.restore(),o==="strokeWidth"&&e.scale(1/e.lineWidth,1/e.lineWidth),s==="auto"&&n&&e.rotate(-n),e.translate(-i,-a)}}class e_ extends Yn{type="defs";render(){}}class r1 extends Dl{type="g";getBoundingBox(e){const t=new _a;return this.children.forEach(n=>{n instanceof Kr&&t.addBoundingBox(n.getBoundingBox(e))}),t}}class kT extends Yn{attributesToInherit=["gradientUnits"];stops=[];constructor(e,t,n){super(e,t,n);const{stops:i,children:a}=this;a.forEach(s=>{s.type==="stop"&&i.push(s)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(e,t,n){let i=this;this.getHrefAttribute().hasValue()&&(i=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(i));const{stops:a}=i,s=this.getGradient(e,t);if(!s)return this.addParentOpacity(n,a[a.length-1].color);if(a.forEach(o=>{s.addColorStop(o.offset,this.addParentOpacity(n,o.color))}),this.getAttribute("gradientTransform").hasValue()){const{document:o}=this,{MAX_VIRTUAL_PIXELS:l}=zf,{viewPort:u}=o.screen,c=u.getRoot(),f=new ST(o);f.attributes.x=new Mt(o,"x",-l/3),f.attributes.y=new Mt(o,"y",-l/3),f.attributes.width=new Mt(o,"width",l),f.attributes.height=new Mt(o,"height",l);const d=new r1(o);d.attributes.transform=new Mt(o,"transform",this.getAttribute("gradientTransform").getValue()),d.children=[f];const h=new $f(o);h.attributes.x=new Mt(o,"x",0),h.attributes.y=new Mt(o,"y",0),h.attributes.width=new Mt(o,"width",c.width),h.attributes.height=new Mt(o,"height",c.height),h.children=[d];const g=o.createCanvas(c.width,c.height),v=g.getContext("2d");return v.fillStyle=s,h.render(v),v.createPattern(g,"no-repeat")}return s}inheritStopContainer(e){this.attributesToInherit.forEach(t=>{!this.getAttribute(t).hasValue()&&e.getAttribute(t).hasValue()&&this.getAttribute(t,!0).setValue(e.getAttribute(t).getValue())})}addParentOpacity(e,t){return e.hasValue()?new Mt(this.document,"color",t).addOpacity(e).getColor():t}}class t_ extends kT{type="linearGradient";constructor(e,t,n){super(e,t,n),this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(e,t){const n=this.getGradientUnits()==="objectBoundingBox",i=n?t.getBoundingBox(e):null;if(n||!i)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));const a=n?i.x+i.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),s=n?i.y+i.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),o=n?i.x+i.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),l=n?i.y+i.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return a===o&&s===l?null:e.createLinearGradient(a,s,o,l)}}class r_ extends kT{type="radialGradient";constructor(e,t,n){super(e,t,n),this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(e,t){const n=this.getGradientUnits()==="objectBoundingBox",i=t.getBoundingBox(e);if(n&&!i)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");const a=n?i.x+i.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),s=n?i.y+i.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y");let o=a,l=s;this.getAttribute("fx").hasValue()&&(o=n?i.x+i.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(l=n?i.y+i.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));const u=n?(i.width+i.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),c=this.getAttribute("fr").getPixels();return e.createRadialGradient(o,l,c,a,s,u)}}class n_ extends Yn{type="stop";offset;color;constructor(e,t,n){super(e,t,n);const i=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),a=this.getStyle("stop-opacity");let s=this.getStyle("stop-color",!0);s.getString()===""&&s.setValue("#000"),a.hasValue()&&(s=s.addOpacity(a)),this.offset=i,this.color=s.getColor()}}class n1 extends Yn{type="animate";begin;maxDuration;from;to;values;duration=0;initialValue;initialUnits="";removed=!1;frozen=!1;constructor(e,t,n){super(e,t,n),e.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new Mt(e,"values",null);const i=this.getAttribute("values");i.hasValue()&&this.values.setValue(i.getString().split(";"))}getProperty(){const e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return e==="CSS"?this.parent?.getStyle(t,!0):this.parent?.getAttribute(t,!0)}calcValue(){const{initialUnits:e}=this,{progress:t,from:n,to:i}=this.getProgress();let a=n.getNumber()+(i.getNumber()-n.getNumber())*t;return e==="%"&&(a*=100),`${a}${e}`}update(e){const{parent:t}=this,n=this.getProperty();if(!n)return!1;if(this.initialValue||(this.initialValue=n.getString(),this.initialUnits=n.getUnits()),this.duration>this.maxDuration){const a=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(a==="freeze"&&!this.frozen)this.frozen=!0,t&&n&&(t.animationFrozen=!0,t.animationFrozenValue=n.getString());else if(a==="remove"&&!this.removed)return this.removed=!0,t&&n&&n.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=e;let i=!1;if(this.begin<this.duration){let a=this.calcValue();const s=this.getAttribute("type");s.hasValue()&&(a=`${s.getString()}(${a})`),n.setValue(a),i=!0}return i}getProgress(){const{document:e,values:t}=this;let n=(this.duration-this.begin)/(this.maxDuration-this.begin),i,a;if(t.hasValue()){const s=n*(t.getValue().length-1),o=Math.floor(s),l=Math.ceil(s);let u;u=t.getValue()[o],i=new Mt(e,"from",u?parseFloat(u):0),u=t.getValue()[l],a=new Mt(e,"to",u?parseFloat(u):0),n=(s-o)/(l-o)}else i=this.from,a=this.to;return{progress:n,from:i,to:a}}}class i_ extends n1{type="animateColor";calcValue(){const{progress:e,from:t,to:n}=this.getProgress(),i=new Hy(t.getColor()),a=new Hy(n.getColor());if(i.ok&&a.ok){const s=i.r+(a.r-i.r)*e,o=i.g+(a.g-i.g)*e,l=i.b+(a.b-i.b)*e;return`rgb(${Math.floor(s)}, ${Math.floor(o)}, ${Math.floor(l)})`}return this.getAttribute("from").getColor()}}class a_ extends n1{type="animateTransform";calcValue(){const{progress:e,from:t,to:n}=this.getProgress(),i=Hi(t.getString()),a=Hi(n.getString());return i.map((o,l)=>{const u=a[l];return o+(u-o)*e}).join(" ")}}class TT extends Yn{type="font-face";ascent;descent;unitsPerEm;constructor(e,t,n){super(e,t,n),this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class i1 extends Kr{type="glyph";horizAdvX;unicode;arabicForm;constructor(e,t,n){super(e,t,n),this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class FT extends i1{type="missing-glyph";horizAdvX=0}class s_ extends Yn{type="font";isArabic=!1;missingGlyph;glyphs={};arabicGlyphs={};horizAdvX;isRTL=!1;fontFace;constructor(e,t,n){super(e,t,n),this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();const{definitions:i}=e,{children:a}=this;for(const s of a)if(s instanceof TT){this.fontFace=s;const o=s.getStyle("font-family");o.hasValue()&&(i[o.getString()]=this)}else if(s instanceof FT)this.missingGlyph=s;else if(s instanceof i1)if(s.arabicForm){this.isRTL=!0,this.isArabic=!0;const o=this.arabicGlyphs[s.unicode];typeof o>"u"?this.arabicGlyphs[s.unicode]={[s.arabicForm]:s}:o[s.arabicForm]=s}else this.glyphs[s.unicode]=s}render(){}}class o_ extends ko{type="tref";getText(){const e=this.getHrefAttribute().getDefinition();if(e){const t=e.children[0];if(t)return t.getText()}return""}}class l_ extends ko{type="a";hasText;text;constructor(e,t,n){super(e,t,n);const{childNodes:i}=t,a=i[0],s=i.length>0&&Array.from(i).every(o=>o.nodeType===3);this.hasText=s,this.text=s?this.getTextFromNode(a):""}getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);const{document:t,x:n,y:i}=this,{mouse:a}=t.screen,s=new Mt(t,"fontSize",rc.parse(t.ctx.font).fontSize);a.isWorking()&&a.checkBoundingBox(this,new _a(n,i-s.getPixels("y"),n+this.measureText(e),i))}else if(this.children.length>0){const t=new r1(this.document);t.children=this.children,t.parent=this,t.render(e)}}onClick(){const{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){const e=this.document.ctx;e.canvas.style.cursor="pointer"}}class u_ extends ko{type="textPath";textWidth=0;textHeight=0;pathLength=-1;glyphInfo=null;text;dataArray;letterSpacingCache=[];equidistantCache=null;measuresCache=new Map([["",0]]);constructor(e,t,n){super(e,t,n);const i=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(i)}getText(){return this.text}path(e){const{dataArray:t}=this;e&&e.beginPath(),t.forEach(({type:n,points:i})=>{switch(n){case cr.LINE_TO:e&&e.lineTo(i[0],i[1]);break;case cr.MOVE_TO:e&&e.moveTo(i[0],i[1]);break;case cr.CURVE_TO:e&&e.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]);break;case cr.QUAD_TO:e&&e.quadraticCurveTo(i[0],i[1],i[2],i[3]);break;case cr.ARC:{const[a,s,o,l,u,c,f,d]=i,h=o>l?o:l,g=o>l?1:o/l,v=o>l?l/o:1;e&&(e.translate(a,s),e.rotate(f),e.scale(g,v),e.arc(0,0,h,u,u+c,!!(1-d)),e.scale(1/g,1/v),e.rotate(-f),e.translate(-a,-s));break}case cr.CLOSE_PATH:e&&e.closePath();break}})}renderChildren(e){this.setTextData(e),e.save();const t=this.parent?.getStyle("text-decoration").getString(),n=this.getFontSize(),{glyphInfo:i}=this,a=e.fillStyle;t==="underline"&&e.beginPath(),i.forEach((s,o)=>{const{p0:l,p1:u,rotation:c,text:f}=s;e.save(),e.translate(l.x,l.y),e.rotate(c),e.fillStyle&&e.fillText(f,0,0),e.strokeStyle&&e.strokeText(f,0,0),e.restore(),t==="underline"&&(o===0&&e.moveTo(l.x,l.y+n/8),e.lineTo(u.x,u.y+n/5))}),t==="underline"&&(e.lineWidth=n/20,e.strokeStyle=a,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(e=0){return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,t,n,i,a,s,o,l,u){let c=s,f=this.measureText(e,l);l===" "&&t==="justify"&&n<i&&(f+=(i-n)/a),u>-1&&(c+=this.getLetterSpacingAt(u));const d=this.textHeight/20,h=this.getEquidistantPointOnPath(c,d,0),g=this.getEquidistantPointOnPath(c+f,d,0),v={p0:h,p1:g},y=h&&g?Math.atan2(g.y-h.y,g.x-h.x):0;if(o){const A=Math.cos(Math.PI/2+y)*o,C=Math.cos(-y)*o;v.p0={...h,distance:h.distance||0,x:h.x+A,y:h.y+C},v.p1={...g,distance:g.distance||0,x:g.x+A,y:g.y+C}}return c+=f,{offset:c,segment:v,rotation:y}}measureText(e,t){const{measuresCache:n}=this,i=t||this.getText();if(n.has(i))return n.get(i);const a=this.measureTargetText(e,i);return n.set(i,a),a}setTextData(e){if(this.glyphInfo)return;const t=this.getText(),n=t.split(""),i=t.split(" ").length-1,a=this.parent?.getAttribute("dx").split().map(S=>S.getPixels("x")),s=this.parent?.getAttribute("dy").getPixels("y"),o=this.getAttribute("text-anchor").getString("start"),l=this.getStyle("letter-spacing"),u=this.parent?.getStyle("letter-spacing");let c=0;!l.hasValue()||l.getValue()==="inherit"?c=u.getPixels():l.hasValue()&&l.getValue()!=="initial"&&l.getValue()!=="unset"&&(c=l.getPixels());const f=[],d=t.length;this.letterSpacingCache=f;for(let S=0;S<d;S++)f.push(typeof a[S]<"u"?a[S]:c);const h=f.reduce((S,F,E)=>E===0?0:S+F||0,0),g=this.measureText(e),v=Math.max(g+h,0);this.textWidth=g,this.textHeight=this.getFontSize(),this.glyphInfo=[];const y=this.getPathLength(),A=this.getAttribute("startOffset").getNumber(0)*y;let C=0;(o==="middle"||o==="center")&&(C=-v/2),(o==="end"||o==="right")&&(C=-v),C+=A,n.forEach((S,F)=>{const{offset:E,segment:R,rotation:B}=this.findSegmentToFitChar(e,o,v,y,i,C,s,S,F);C=E,!(!R.p0||!R.p1)&&this.glyphInfo.push({text:n[F],p0:R.p0,p1:R.p1,rotation:B})})}parsePathData(e){if(this.pathLength=-1,!e)return[];const t=[],{pathParser:n}=e;for(n.reset();!n.isEnd();){const{current:i}=n,a=i?i.x:0,s=i?i.y:0,o=n.next();let l=o.type,u=[];switch(o.type){case cr.MOVE_TO:this.pathM(n,u);break;case cr.LINE_TO:l=this.pathL(n,u);break;case cr.HORIZ_LINE_TO:l=this.pathH(n,u);break;case cr.VERT_LINE_TO:l=this.pathV(n,u);break;case cr.CURVE_TO:this.pathC(n,u);break;case cr.SMOOTH_CURVE_TO:l=this.pathS(n,u);break;case cr.QUAD_TO:this.pathQ(n,u);break;case cr.SMOOTH_QUAD_TO:l=this.pathT(n,u);break;case cr.ARC:u=this.pathA(n);break;case cr.CLOSE_PATH:Kr.pathZ(n);break}o.type!==cr.CLOSE_PATH?t.push({type:l,points:u,start:{x:a,y:s},pathLength:this.calcLength(a,s,l,u)}):t.push({type:cr.CLOSE_PATH,points:[],pathLength:0})}return t}pathM(e,t){const{x:n,y:i}=Kr.pathM(e).point;t.push(n,i)}pathL(e,t){const{x:n,y:i}=Kr.pathL(e).point;return t.push(n,i),cr.LINE_TO}pathH(e,t){const{x:n,y:i}=Kr.pathH(e).point;return t.push(n,i),cr.LINE_TO}pathV(e,t){const{x:n,y:i}=Kr.pathV(e).point;return t.push(n,i),cr.LINE_TO}pathC(e,t){const{point:n,controlPoint:i,currentPoint:a}=Kr.pathC(e);t.push(n.x,n.y,i.x,i.y,a.x,a.y)}pathS(e,t){const{point:n,controlPoint:i,currentPoint:a}=Kr.pathS(e);return t.push(n.x,n.y,i.x,i.y,a.x,a.y),cr.CURVE_TO}pathQ(e,t){const{controlPoint:n,currentPoint:i}=Kr.pathQ(e);t.push(n.x,n.y,i.x,i.y)}pathT(e,t){const{controlPoint:n,currentPoint:i}=Kr.pathT(e);return t.push(n.x,n.y,i.x,i.y),cr.QUAD_TO}pathA(e){let{rX:t,rY:n,sweepFlag:i,xAxisRotation:a,centp:s,a1:o,ad:l}=Kr.pathA(e);return i===0&&l>0&&(l-=2*Math.PI),i===1&&l<0&&(l+=2*Math.PI),[s.x,s.y,t,n,o,l,a,i]}calcLength(e,t,n,i){let a=0,s=null,o=null,l=0;switch(n){case cr.LINE_TO:return this.getLineLength(e,t,i[0],i[1]);case cr.CURVE_TO:for(a=0,s=this.getPointOnCubicBezier(0,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)o=this.getPointOnCubicBezier(l,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),a+=this.getLineLength(s.x,s.y,o.x,o.y),s=o;return a;case cr.QUAD_TO:for(a=0,s=this.getPointOnQuadraticBezier(0,e,t,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)o=this.getPointOnQuadraticBezier(l,e,t,i[0],i[1],i[2],i[3]),a+=this.getLineLength(s.x,s.y,o.x,o.y),s=o;return a;case cr.ARC:{a=0;const u=i[4],c=i[5],f=i[4]+c;let d=Math.PI/180;if(Math.abs(u-f)<d&&(d=Math.abs(u-f)),s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),c<0)for(l=u-d;l>f;l-=d)o=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),a+=this.getLineLength(s.x,s.y,o.x,o.y),s=o;else for(l=u+d;l<f;l+=d)o=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),a+=this.getLineLength(s.x,s.y,o.x,o.y),s=o;return o=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],f,0),a+=this.getLineLength(s.x,s.y,o.x,o.y),a}}return 0}getPointOnLine(e,t,n,i,a,s=t,o=n){const l=(a-n)/(i-t+$u);let u=Math.sqrt(e*e/(1+l*l));i<t&&(u*=-1);let c=l*u,f=null;if(i===t)f={x:s,y:o+c};else if((o-n)/(s-t+$u)===l)f={x:s+u,y:o+c};else{let d=0,h=0;const g=this.getLineLength(t,n,i,a);if(g<$u)return null;let v=(s-t)*(i-t)+(o-n)*(a-n);v/=g*g,d=t+v*(i-t),h=n+v*(a-n);const y=this.getLineLength(s,o,d,h),A=Math.sqrt(e*e-y*y);u=Math.sqrt(A*A/(1+l*l)),i<t&&(u*=-1),c=l*u,f={x:d+u,y:h+c}}return f}getPointOnPath(e){const t=this.getPathLength();let n=0,i=null;if(e<-5e-5||e-5e-5>t)return null;const{dataArray:a}=this;for(const s of a){if(s&&(s.pathLength<5e-5||n+s.pathLength+5e-5<e)){n+=s.pathLength;continue}const o=e-n;let l=0;switch(s.type){case cr.LINE_TO:i=this.getPointOnLine(o,s.start.x,s.start.y,s.points[0],s.points[1],s.start.x,s.start.y);break;case cr.ARC:{const u=s.points[4],c=s.points[5],f=s.points[4]+c;if(l=u+o/s.pathLength*c,c<0&&l<f||c>=0&&l>f)break;i=this.getPointOnEllipticalArc(s.points[0],s.points[1],s.points[2],s.points[3],l,s.points[6]);break}case cr.CURVE_TO:l=o/s.pathLength,l>1&&(l=1),i=this.getPointOnCubicBezier(l,s.start.x,s.start.y,s.points[0],s.points[1],s.points[2],s.points[3],s.points[4],s.points[5]);break;case cr.QUAD_TO:l=o/s.pathLength,l>1&&(l=1),i=this.getPointOnQuadraticBezier(l,s.start.x,s.start.y,s.points[0],s.points[1],s.points[2],s.points[3]);break}if(i)return i;break}return null}getLineLength(e,t,n,i){return Math.sqrt((n-e)*(n-e)+(i-t)*(i-t))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((e,t)=>t.pathLength>0?e+t.pathLength:e,0)),this.pathLength}getPointOnCubicBezier(e,t,n,i,a,s,o,l,u){const c=l*LC(e)+s*UC(e)+i*VC(e)+t*zC(e),f=u*LC(e)+o*UC(e)+a*VC(e)+n*zC(e);return{x:c,y:f}}getPointOnQuadraticBezier(e,t,n,i,a,s,o){const l=s*$C(e)+i*HC(e)+t*jC(e),u=o*$C(e)+a*HC(e)+n*jC(e);return{x:l,y:u}}getPointOnEllipticalArc(e,t,n,i,a,s){const o=Math.cos(s),l=Math.sin(s),u={x:n*Math.cos(a),y:i*Math.sin(a)};return{x:e+(u.x*o-u.y*l),y:t+(u.x*l+u.y*o)}}buildEquidistantCache(e,t){const n=this.getPathLength(),i=t||.25,a=e||n/100;if(!this.equidistantCache||this.equidistantCache.step!==a||this.equidistantCache.precision!==i){this.equidistantCache={step:a,precision:i,points:[]};let s=0;for(let o=0;o<=n;o+=i){const l=this.getPointOnPath(o),u=this.getPointOnPath(o+i);!l||!u||(s+=this.getLineLength(l.x,l.y,u.x,u.y),s>=a&&(this.equidistantCache.points.push({x:l.x,y:l.y,distance:o}),s-=a))}}}getEquidistantPointOnPath(e,t,n){if(this.buildEquidistantCache(t,n),e<0||e-this.getPathLength()>5e-5)return null;const i=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[i]||null}}const c_=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class d_ extends Dl{type="image";loaded=!1;image;constructor(e,t,n){super(e,t,n);const i=this.getHrefAttribute().getString();if(!i)return;const a=i.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(i);e.images.push(this),a?this.loadSvg(i):this.loadImage(i)}async loadImage(e){try{const t=await this.document.createImage(e,!0);this.image=t}catch(t){console.error(`Error while loading image "${e}":`,t)}this.loaded=!0}async loadSvg(e){const t=c_.exec(e);if(t){const n=t[5];n&&(t[4]==="base64"?this.image=atob(n):this.image=decodeURIComponent(n))}else try{const i=await(await this.document.fetch(e)).text();this.image=i}catch(n){console.error(`Error while loading image "${e}":`,n)}this.loaded=!0}renderChildren(e){const{document:t,image:n,loaded:i}=this,a=this.getAttribute("x").getPixels("x"),s=this.getAttribute("y").getPixels("y"),o=this.getStyle("width").getPixels("x"),l=this.getStyle("height").getPixels("y");if(!(!i||!n||!o||!l)){if(e.save(),e.translate(a,s),typeof n=="string"){const u=t.pith.forkString(e,n,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:o,scaleHeight:l}),{documentElement:c}=u.document;c&&(c.parent=this),u.resize(o,l,this.getAttribute("preserveAspectRatio").getString()),u.render()}else t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:o,desiredWidth:n.width,height:l,desiredHeight:n.height}),this.loaded&&(!("complete"in n)||n.complete)&&e.drawImage(n,0,0);e.restore()}}getBoundingBox(){const e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),n=this.getStyle("width").getPixels("x"),i=this.getStyle("height").getPixels("y");return new _a(e,t,e+n,t+i)}}class f_ extends Dl{type="symbol";render(e){}}class h_{document;loaded=!1;constructor(e){this.document=e,e.fonts.push(this)}async load(e,t){try{const{document:n}=this,a=(await n.pith.parser.load(t)).getElementsByTagName("font");Array.from(a).forEach(s=>{const o=n.createElement(s);n.definitions[e]=o})}catch(n){console.error(`Error while loading font "${t}":`,n)}this.loaded=!0}}class p_ extends Yn{static parseExternalUrl=MC;type="style";constructor(e,t,n){super(e,t,n),Vf(Array.from(t.childNodes).map(s=>s.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")).split("}").forEach(s=>{const o=s.trim();if(!o)return;const l=o.split("{"),u=l[0].split(","),c=l[1].split(";");u.forEach(f=>{const d=f.trim();if(!d)return;const h=e.styles[d]||{};if(c.forEach(g=>{const v=g.indexOf(":"),y=g.substr(0,v).trim(),A=g.substr(v+1,g.length-v).trim();y&&A&&(h[y]=new Mt(e,y,A))}),e.styles[d]=h,e.stylesSpecificity[d]=DM(d),d==="@font-face"){const g=h["font-family"].getString().replace(/"|'/g,"");h.src.getString().split(",").forEach(y=>{if(y.indexOf('format("svg")')>0){const A=MC(y);A&&new h_(e).load(g,A)}})}})})}}class g_ extends Dl{type="use";cachedElement;setContext(e){super.setContext(e);const t=this.getAttribute("x"),n=this.getAttribute("y");t.hasValue()&&e.translate(t.getPixels("x"),0),n.hasValue()&&e.translate(0,n.getPixels("y"))}path(e){const{element:t}=this;t&&t.path(e)}renderChildren(e){const{document:t,element:n}=this;if(n){let i=n;if(n.type==="symbol"&&(i=new $f(t),i.attributes.viewBox=new Mt(t,"viewBox",n.getAttribute("viewBox").getString()),i.attributes.preserveAspectRatio=new Mt(t,"preserveAspectRatio",n.getAttribute("preserveAspectRatio").getString()),i.attributes.overflow=new Mt(t,"overflow",n.getAttribute("overflow").getString()),i.children=n.children,n.styles.opacity=new Mt(t,"opacity",this.calculateOpacity())),i.type==="svg"){const s=this.getStyle("width",!1,!0),o=this.getStyle("height",!1,!0);s.hasValue()&&(i.attributes.width=new Mt(t,"width",s.getString())),o.hasValue()&&(i.attributes.height=new Mt(t,"height",o.getString()))}const a=i.parent;i.parent=this,i.render(e),i.parent=a}}getBoundingBox(e){const{element:t}=this;return t?t.getBoundingBox(e):null}elementTransform(){const{document:e,element:t}=this;return t?tc.fromElement(e,t):null}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function ei(r,e,t){return r[e]*t}function Ts(r,e,t,n){return e+Math.cos(r)*t+Math.sin(r)*n}class IT extends Pl{type="feColorMatrix";matrix;includeOpacity;constructor(e,t,n){super(e,t,n);let i=Hi(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{const a=i[0];i=[.213+.787*a,.715-.715*a,.072-.072*a,0,0,.213-.213*a,.715+.285*a,.072-.072*a,0,0,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{const a=i[0]*Math.PI/180;i=[Ts(a,.213,.787,-.213),Ts(a,.715,-.715,-.715),Ts(a,.072,-.072,.928),0,0,Ts(a,.213,-.213,.143),Ts(a,.715,.285,.14),Ts(a,.072,-.072,-.283),0,0,Ts(a,.213,-.213,-.787),Ts(a,.715,-.715,.715),Ts(a,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=i,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(e,t,n,i,a){const{includeOpacity:s,matrix:o}=this,l=e.getImageData(0,0,i,a);for(let u=0;u<a;u++)for(let c=0;c<i;c++){const f=bl(l.data,c,u,i,a,0),d=bl(l.data,c,u,i,a,1),h=bl(l.data,c,u,i,a,2),g=bl(l.data,c,u,i,a,3);let v=ei(o,0,f)+ei(o,1,d)+ei(o,2,h)+ei(o,3,g)+ei(o,4,1),y=ei(o,5,f)+ei(o,6,d)+ei(o,7,h)+ei(o,8,g)+ei(o,9,1),A=ei(o,10,f)+ei(o,11,d)+ei(o,12,h)+ei(o,13,g)+ei(o,14,1),C=ei(o,15,f)+ei(o,16,d)+ei(o,17,h)+ei(o,18,g)+ei(o,19,1);s&&(v=0,y=0,A=0,C*=g/255),wl(l.data,c,u,i,a,0,v),wl(l.data,c,u,i,a,1,y),wl(l.data,c,u,i,a,2,A),wl(l.data,c,u,i,a,3,C)}e.clearRect(0,0,i,a),e.putImageData(l,0,0)}}class a1 extends Yn{static ignoreStyles=["mask","transform","clip-path"];type="mask";apply(e,t){const{document:n}=this;let i=this.getAttribute("x").getPixels("x"),a=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y");if(!s&&!o){const h=new _a;this.children.forEach(g=>{g instanceof Kr&&h.addBoundingBox(g.getBoundingBox(e))}),i=Math.floor(h.x1),a=Math.floor(h.y1),s=Math.floor(h.width),o=Math.floor(h.height)}const l=this.removeStyles(t,a1.ignoreStyles),u=n.createCanvas(i+s,a+o),c=u.getContext("2d");n.screen.setDefaults(c),this.renderChildren(c),new IT(n,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(c,0,0,i+s,a+o);const f=n.createCanvas(i+s,a+o),d=f.getContext("2d");n.screen.setDefaults(d),t.render(d),d.globalCompositeOperation="destination-in",d.fillStyle=c.createPattern(u,"no-repeat"),d.fillRect(0,0,i+s,a+o),e.fillStyle=d.createPattern(f,"no-repeat"),e.fillRect(0,0,i+s,a+o),this.restoreStyles(t,l)}render(e){}}const QC=()=>{};class m_ extends Yn{type="clipPath";apply(e){const{document:t}=this,n=Reflect.getPrototypeOf(e),{beginPath:i,closePath:a}=e;n&&(n.beginPath=QC,n.closePath=QC),Reflect.apply(i,e,[]),this.children.forEach(s=>{if(!("path"in s))return;let o="elementTransform"in s?s.elementTransform():null;o||(o=tc.fromElement(t,s)),o&&o.apply(e),s.path(e),n&&(n.closePath=a),o&&o.unapply(e)}),Reflect.apply(a,e,[]),e.clip(),n&&(n.beginPath=i,n.closePath=a)}render(e){}}class PT extends Pl{type="feGaussianBlur";extraFilterDistance;blurRadius;constructor(e,t,n){super(e,t,n),this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(e,t,n,i,a){const{document:s,blurRadius:o}=this,l=s.window?s.window.document.body:null,u=e.canvas;u.id=s.getUniqueId(),l&&(u.style.display="none",l.appendChild(u)),yM(u,t,n,i,a,o),l&&l.removeChild(u)}}class s1 extends Yn{static ignoreStyles=["filter","transform","clip-path"];type="filter";apply(e,t){const{document:n,children:i}=this,a="getBoundingBox"in t?t.getBoundingBox(e):null;if(!a)return;let s=0,o=0;i.forEach(A=>{if(!(A instanceof PT))return;const C=A.extraFilterDistance||0;s=Math.max(s,C),o=Math.max(o,C)});const l=Math.floor(a.width),u=Math.floor(a.height),c=l+2*s,f=u+2*o;if(Number.isNaN(c)||Number.isNaN(f)||c<1||f<1)return;const d=Math.floor(a.x),h=Math.floor(a.y),g=this.removeStyles(t,s1.ignoreStyles),v=n.createCanvas(c,f),y=v.getContext("2d");n.screen.setDefaults(y),y.translate(-d+s,-h+o),t.render(y),i.forEach(A=>{A instanceof Pl&&A.apply(y,0,0,c,f)}),e.drawImage(v,0,0,c,f,d-s,h-o,c,f),this.restoreStyles(t,g)}render(e){}}class v_ extends Pl{type="feDropShadow";constructor(e,t,n){super(e,t,n),this.addStylesFromStyleDefinition()}apply(e,t,n,i,a){}}class y_ extends Pl{type="feMorphology";apply(e,t,n,i,a){}}class A_ extends Pl{type="feComposite";apply(e,t,n,i,a){}}class b_ extends Yn{type="title"}class w_ extends Yn{type="desc"}class o1 extends Yn{tableValues;constructor(e,t,n){super(e,t,n),this.tableValues=Hi(this.getAttribute("tableValues").getString())}}class DT extends o1{type="feFuncR"}class RT extends o1{type="feFuncG"}class OT extends o1{type="feFuncB"}class C_ extends Pl{type="feComponentTransfer";constructor(e,t,n){super(e,t,n)}calculateDiscrete(e,t){const n=e/255,i=t.tableValues.length;if(n===1)return 255*t.tableValues[i-1];for(let a=0;a<i;a++)if(a/i<=n&&n<(a+1)/i)return 255*t.tableValues[a];return 255*t.tableValues[0]}apply(e,t,n,i,a){const{children:s}=this;let o,l,u;s.forEach(f=>{f instanceof DT?o=f:f instanceof RT?l=f:f instanceof OT&&(u=f)});const c=e.getImageData(0,0,i,a);for(let f=0;f<a;f++)for(let d=0;d<i;d++){const h=bl(c.data,d,f,i,a,0),g=bl(c.data,d,f,i,a,1),v=bl(c.data,d,f,i,a,2),y=this.calculateDiscrete(h,o),A=this.calculateDiscrete(g,l),C=this.calculateDiscrete(v,u);wl(c.data,d,f,i,a,0,y),wl(c.data,d,f,i,a,1,A),wl(c.data,d,f,i,a,2,C)}e.clearRect(0,0,i,a),e.putImageData(c,0,0)}}const x_={svg:$f,rect:ST,circle:QM,ellipse:YM,line:XM,polyline:ET,polygon:JM,path:Kr,pattern:KM,marker:ZM,defs:e_,linearGradient:t_,radialGradient:r_,stop:n_,animate:n1,animateColor:i_,animateTransform:a_,font:s_,"font-face":TT,"missing-glyph":FT,glyph:i1,text:ko,tspan:Hg,tref:o_,a:l_,textPath:u_,image:d_,g:r1,symbol:f_,style:p_,use:g_,mask:a1,clipPath:m_,filter:s1,feDropShadow:v_,feFuncR:DT,feFuncG:RT,feFuncB:OT,feMorphology:y_,feComponentTransfer:C_,feComposite:A_,feColorMatrix:IT,feGaussianBlur:PT,title:b_,desc:w_};function S_(r,e){const t=document.createElement("canvas");return t.width=r,t.height=e,t}async function E_(r,e=!1){const t=document.createElement("img");return e&&(t.crossOrigin="Anonymous"),new Promise((n,i)=>{t.onload=()=>{n(t)},t.onerror=(a,s,o,l,u)=>{i(u)},t.src=r})}const E0=12;class Yd{pith;static createCanvas=S_;static createImage=E_;static elementTypes=x_;rootEmSize;documentElement;screen;createCanvas;createImage;definitions={};styles={};stylesSpecificity={};images=[];fonts=[];emSizeStack=[];uniqueId=0;constructor(e,{rootEmSize:t=E0,emSize:n=E0,createCanvas:i=Yd.createCanvas,createImage:a=Yd.createImage,anonymousCrossOrigin:s}={}){this.pith=e,this.screen=e.screen,this.rootEmSize=t,this.emSize=n,this.createCanvas=i,this.createImage=this.bindCreateImage(a,s),this.screen.wait(()=>this.isImagesLoaded()),this.screen.wait(()=>this.isFontsLoaded())}bindCreateImage(e,t){return typeof t=="boolean"?(n,i)=>e(n,typeof i=="boolean"?i:t):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){const{emSizeStack:e}=this;return e[e.length-1]||E0}set emSize(e){const{emSizeStack:t}=this;t.push(e)}popEmSize(){const{emSizeStack:e}=this;e.pop()}getUniqueId(){return`pith${++this.uniqueId}`}isImagesLoaded(){return this.images.every(e=>e.loaded)}isFontsLoaded(){return this.fonts.every(e=>e.loaded)}createDocumentElement(e){const t=this.createElement(e.documentElement,"svg");return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}createElement(e,t){const n=t||e.nodeName.replace(/^[^:]+:/,""),i=Yd.elementTypes[n];return i?new i(this,e):new $M(this,e)}createTextNode(e){return new WM(this,e)}setViewBox(e){this.screen.setViewBox({document:this,...e})}}class uo{static async from(e,t,n={}){const a=await new S0(n).parse(t);return new uo(e,a,n)}static fromString(e,t,n={}){const a=new S0(n).parseFromString(t);return new uo(e,a,n)}parser;screen;document;documentElement;options;constructor(e,t,n={}){this.parser=new S0(n),this.screen=new zf(e,n),this.options=n;const i=new Yd(this,n),a=i.createDocumentElement(t);this.document=i,this.documentElement=a}fork(e,t,n={}){return uo.from(e,t,{...this.options,...n})}forkString(e,t,n={}){return uo.fromString(e,t,{...this.options,...n})}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}async render(e={}){this.start({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0,...e}),await this.ready(),this.stop()}start(e={}){const{documentElement:t,screen:n,options:i}=this;n.start(t,{enableRedraw:!0,...i,...e})}stop(){this.screen.stop()}resize(e,t=e,n=!1){this.documentElement.resize(e,t,n)}}const k0=[Xe.SilentIllustration,Xe.ProductOverlay],YC=r=>{const e=[];for(const n of r.steps){const i=k_(n.stepName,r.stepGroups);if(!i)throw new Error("Workflow step does not belong to a group, all steps must belong to a group. Step: "+n.stepName);const a=e.find(s=>s.name===i.name);a?k0.includes(n.type)?a.silentSteps.push(n):a.renderableSteps.push(n):e.push({name:i.name,title:i.name,renderableSteps:k0.includes(n.type)?[]:[n],silentSteps:k0.includes(n.type)?[n]:[]})}const t="workflow.steps.finish.confirmDesign";return e.push({name:"Finish",title:t,renderableSteps:[{type:Xe.Finish,stepName:"Finish",stepTitle:t,helpText:"",data:{modelAnimation:r.finalizeStepConfig?r.finalizeStepConfig.modelAnimation:void 0,lookAtAnimation:r.finalizeStepConfig?r.finalizeStepConfig.lookAtAnimation:void 0},conditions:[]}],silentSteps:[]}),e},k_=(r,e)=>e.find(t=>t.stepNames.includes(r)),co=async(r,e)=>{const t=r.conditions||[];return(await Promise.all(t.map(async(a,s)=>{const o=e[a.targetStepName];if(o&&o.selectedVariants){const l=o.selectedVariants;return a.type==="VariantMetafield"?(await Ag.ensureIdsArePresent(l.map(c=>c.id)),a.requiredVariantMetafields?.some(c=>l.find(f=>Ag.requestIfAvailable(f.id,c.variantMetafieldConfigurationId||"")?.value===c.variantMetafieldValue))):a.requiredVariantSelections.some(c=>l.find(f=>f.id===c)!==void 0)}return!1}))).every(a=>a)},T_=async(r,e)=>{const t=await Promise.all(r.renderableSteps.map(o=>co(o,e))),n=r.renderableSteps.filter((o,l)=>t[l]),i=await Promise.all(r.silentSteps.map(o=>co(o,e))),a=r.silentSteps.filter((o,l)=>i[l]),s={name:r.name,title:r.title,renderableSteps:n,silentSteps:a};return s.silentSteps.length===0&&s.renderableSteps.length===0?null:s},Ja=async(r,e)=>(await Promise.all(r.map(n=>T_(n,e)))).filter(n=>n!==null),F_=async(r,e,t=!1)=>{const n=await Ja(r,e),i=[];for(const s of n)for(const o of s.renderableSteps){let l=0;if(o.type!=="Finish"&&o.type!=="Module"){let u;o.option?.variants?(u=o.option,l=u?.variants?.length||0):(u=await ct.getOption(o.option?.id),l=u?.variants?.length||0)}o.silent||(o.type===Xe.Model||o.type===Xe.Material||o.type===Xe.Picture||o.type===Xe.Shape?(l>1||t)&&i.push(o.stepName):i.push(o.stepName))}const a=n.filter(s=>s.renderableSteps.filter(l=>i.includes(l.stepName)).length>0);for(const s of a)s.renderableSteps=s.renderableSteps.filter(o=>i.includes(o.stepName));return a};class jg{constructor(){this.timestamp=Date.now()}}class Gg{constructor(e,t=!0){this.queue=[],this.activePromise=void 0,this.queueMaxSize=void 0,this.queueMaxSize=e,this.isEnabled=t}enqueue(e){if(this.queue.push(e),this.queueMaxSize!==void 0&&this.queue.length>this.queueMaxSize){const t=this.queue.length-1;for(let n=0;n<t;++n)this.queue.shift()}this.isEnabled&&(this.activePromise||(this.activePromise=this.dequeue()))}get enabled(){return this.isEnabled}set enabled(e){!this.isEnabled&&e&&!this.activePromise&&this.getRemainingQueueSize()>0&&(this.activePromise=this.dequeue()),this.isEnabled=e}hasActivePromise(){return!!this.activePromise}getRemainingQueueSize(){return this.queue.length}async finalize(){return this.activePromise?this.activePromise:Promise.resolve()}async dequeue(){const e=this.queue.shift();if(!e){this.activePromise=void 0;return}try{await e.execute()}catch(t){console.log(t)}finally{await this.dequeue()}}}var _d={exports:{}};_d.exports;var XC;function I_(){return XC||(XC=1,(function(r,e){var t=200,n="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",s="[object Array]",o="[object Boolean]",l="[object Date]",u="[object Error]",c="[object Function]",f="[object GeneratorFunction]",d="[object Map]",h="[object Number]",g="[object Object]",v="[object Promise]",y="[object RegExp]",A="[object Set]",C="[object String]",S="[object Symbol]",F="[object WeakMap]",E="[object ArrayBuffer]",R="[object DataView]",B="[object Float32Array]",j="[object Float64Array]",G="[object Int8Array]",ie="[object Int16Array]",q="[object Int32Array]",Y="[object Uint8Array]",J="[object Uint8ClampedArray]",ae="[object Uint16Array]",oe="[object Uint32Array]",he=/[\\^$.*+?()[\]{}|]/g,ye=/\w*$/,Ue=/^\[object .+?Constructor\]$/,Re=/^(?:0|[1-9]\d*)$/,Oe={};Oe[a]=Oe[s]=Oe[E]=Oe[R]=Oe[o]=Oe[l]=Oe[B]=Oe[j]=Oe[G]=Oe[ie]=Oe[q]=Oe[d]=Oe[h]=Oe[g]=Oe[y]=Oe[A]=Oe[C]=Oe[S]=Oe[Y]=Oe[J]=Oe[ae]=Oe[oe]=!0,Oe[u]=Oe[c]=Oe[F]=!1;var ee=typeof di=="object"&&di&&di.Object===Object&&di,re=typeof self=="object"&&self&&self.Object===Object&&self,fe=ee||re||Function("return this")(),Be=e&&!e.nodeType&&e,ke=Be&&!0&&r&&!r.nodeType&&r,$e=ke&&ke.exports===Be;function je(I,$){return I.set($[0],$[1]),I}function qe(I,$){return I.add($),I}function Ge(I,$){for(var se=-1,Ce=I?I.length:0;++se<Ce&&$(I[se],se,I)!==!1;);return I}function bt(I,$){for(var se=-1,Ce=$.length,ht=I.length;++se<Ce;)I[ht+se]=$[se];return I}function rr(I,$,se,Ce){for(var ht=-1,lt=I?I.length:0;++ht<lt;)se=$(se,I[ht],ht,I);return se}function Dr(I,$){for(var se=-1,Ce=Array(I);++se<I;)Ce[se]=$(se);return Ce}function Gt(I,$){return I?.[$]}function ar(I){var $=!1;if(I!=null&&typeof I.toString!="function")try{$=!!(I+"")}catch{}return $}function St(I){var $=-1,se=Array(I.size);return I.forEach(function(Ce,ht){se[++$]=[ht,Ce]}),se}function st(I,$){return function(se){return I($(se))}}function Qr(I){var $=-1,se=Array(I.size);return I.forEach(function(Ce){se[++$]=Ce}),se}var Sr=Array.prototype,gr=Function.prototype,nr=Object.prototype,dr=fe["__core-js_shared__"],Yt=(function(){var I=/[^.]+$/.exec(dr&&dr.keys&&dr.keys.IE_PROTO||"");return I?"Symbol(src)_1."+I:""})(),Xt=gr.toString,mt=nr.hasOwnProperty,Cr=nr.toString,sn=RegExp("^"+Xt.call(mt).replace(he,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_r=$e?fe.Buffer:void 0,ir=fe.Symbol,Yr=fe.Uint8Array,kr=st(Object.getPrototypeOf,Object),Zr=Object.create,Vr=nr.propertyIsEnumerable,pn=Sr.splice,gn=Object.getOwnPropertySymbols,Tr=_r?_r.isBuffer:void 0,zr=st(Object.keys,Object),en=rt(fe,"DataView"),$r=rt(fe,"Map"),zt=rt(fe,"Promise"),sr=rt(fe,"Set"),Er=rt(fe,"WeakMap"),tt=rt(Object,"create"),Nr=Or(en),Xr=Or($r),Ee=Or(zt),D=Or(sr),U=Or(Er),X=ir?ir.prototype:void 0,ue=X?X.valueOf:void 0;function Fe(I){var $=-1,se=I?I.length:0;for(this.clear();++$<se;){var Ce=I[$];this.set(Ce[0],Ce[1])}}function We(){this.__data__=tt?tt(null):{}}function wt(I){return this.has(I)&&delete this.__data__[I]}function Dt(I){var $=this.__data__;if(tt){var se=$[I];return se===n?void 0:se}return mt.call($,I)?$[I]:void 0}function Nt(I){var $=this.__data__;return tt?$[I]!==void 0:mt.call($,I)}function or(I,$){var se=this.__data__;return se[I]=tt&&$===void 0?n:$,this}Fe.prototype.clear=We,Fe.prototype.delete=wt,Fe.prototype.get=Dt,Fe.prototype.has=Nt,Fe.prototype.set=or;function Lt(I){var $=-1,se=I?I.length:0;for(this.clear();++$<se;){var Ce=I[$];this.set(Ce[0],Ce[1])}}function K(){this.__data__=[]}function Ie(I){var $=this.__data__,se=Cn($,I);if(se<0)return!1;var Ce=$.length-1;return se==Ce?$.pop():pn.call($,se,1),!0}function Qe(I){var $=this.__data__,se=Cn($,I);return se<0?void 0:$[se][1]}function Ye(I){return Cn(this.__data__,I)>-1}function xt(I,$){var se=this.__data__,Ce=Cn(se,I);return Ce<0?se.push([I,$]):se[Ce][1]=$,this}Lt.prototype.clear=K,Lt.prototype.delete=Ie,Lt.prototype.get=Qe,Lt.prototype.has=Ye,Lt.prototype.set=xt;function ft(I){var $=-1,se=I?I.length:0;for(this.clear();++$<se;){var Ce=I[$];this.set(Ce[0],Ce[1])}}function Rt(){this.__data__={hash:new Fe,map:new($r||Lt),string:new Fe}}function Et(I){return _e(this,I).delete(I)}function hr(I){return _e(this,I).get(I)}function tr(I){return _e(this,I).has(I)}function fr(I,$){return _e(this,I).set(I,$),this}ft.prototype.clear=Rt,ft.prototype.delete=Et,ft.prototype.get=hr,ft.prototype.has=tr,ft.prototype.set=fr;function $t(I){this.__data__=new Lt(I)}function Bn(){this.__data__=new Lt}function In(I){return this.__data__.delete(I)}function mr(I){return this.__data__.get(I)}function xr(I){return this.__data__.has(I)}function wn(I,$){var se=this.__data__;if(se instanceof Lt){var Ce=se.__data__;if(!$r||Ce.length<t-1)return Ce.push([I,$]),this;se=this.__data__=new ft(Ce)}return se.set(I,$),this}$t.prototype.clear=Bn,$t.prototype.delete=In,$t.prototype.get=mr,$t.prototype.has=xr,$t.prototype.set=wn;function Rr(I,$){var se=Ri(I)||_n(I)?Dr(I.length,String):[],Ce=se.length,ht=!!Ce;for(var lt in I)mt.call(I,lt)&&!(ht&&(lt=="length"||dn(lt,Ce)))&&se.push(lt);return se}function Gn(I,$,se){var Ce=I[$];(!(mt.call(I,$)&&Mn(Ce,se))||se===void 0&&!($ in I))&&(I[$]=se)}function Cn(I,$){for(var se=I.length;se--;)if(Mn(I[se][0],$))return se;return-1}function Hr(I,$){return I&&pe($,lr($),I)}function xn(I,$,se,Ce,ht,lt,Ht){var Ut;if(Ce&&(Ut=lt?Ce(I,ht,lt,Ht):Ce(I)),Ut!==void 0)return Ut;if(!En(I))return I;var Br=Ri(I);if(Br){if(Ut=Jt(I),!$)return W(I,Ut)}else{var M=nt(I),Z=M==c||M==f;if(Nn(I))return mn(I,$);if(M==g||M==a||Z&&!lt){if(ar(I))return lt?I:{};if(Ut=vr(Z?{}:I),!$)return ce(I,Hr(Ut,I))}else{if(!Oe[M])return lt?I:{};Ut=jr(I,M,xn,$)}}Ht||(Ht=new $t);var de=Ht.get(I);if(de)return de;if(Ht.set(I,Ut),!Br)var be=se?xe(I):lr(I);return Ge(be||I,function(Me,Ke){be&&(Ke=Me,Me=I[Ke]),Gn(Ut,Ke,xn(Me,$,se,Ce,Ke,I,Ht))}),Ut}function cn(I){return En(I)?Zr(I):{}}function tn(I,$,se){var Ce=$(I);return Ri(I)?Ce:bt(Ce,se(I))}function Jn(I){return Cr.call(I)}function si(I){if(!En(I)||Vn(I))return!1;var $=ki(I)||ar(I)?sn:Ue;return $.test(Or(I))}function Sn(I){if(!vn(I))return zr(I);var $=[];for(var se in Object(I))mt.call(I,se)&&se!="constructor"&&$.push(se);return $}function mn(I,$){if($)return I.slice();var se=new I.constructor(I.length);return I.copy(se),se}function on(I){var $=new I.constructor(I.byteLength);return new Yr($).set(new Yr(I)),$}function rn(I,$){var se=$?on(I.buffer):I.buffer;return new I.constructor(se,I.byteOffset,I.byteLength)}function Lr(I,$,se){var Ce=$?se(St(I),!0):St(I);return rr(Ce,je,new I.constructor)}function ln(I){var $=new I.constructor(I.source,ye.exec(I));return $.lastIndex=I.lastIndex,$}function k(I,$,se){var Ce=$?se(Qr(I),!0):Qr(I);return rr(Ce,qe,new I.constructor)}function O(I){return ue?Object(ue.call(I)):{}}function z(I,$){var se=$?on(I.buffer):I.buffer;return new I.constructor(se,I.byteOffset,I.length)}function W(I,$){var se=-1,Ce=I.length;for($||($=Array(Ce));++se<Ce;)$[se]=I[se];return $}function pe(I,$,se,Ce){se||(se={});for(var ht=-1,lt=$.length;++ht<lt;){var Ht=$[ht],Ut=void 0;Gn(se,Ht,Ut===void 0?I[Ht]:Ut)}return se}function ce(I,$){return pe(I,ut(I),$)}function xe(I){return tn(I,lr,ut)}function _e(I,$){var se=I.__data__;return Kn($)?se[typeof $=="string"?"string":"hash"]:se.map}function rt(I,$){var se=Gt(I,$);return si(se)?se:void 0}var ut=gn?st(gn,Object):Pn,nt=Jn;(en&&nt(new en(new ArrayBuffer(1)))!=R||$r&&nt(new $r)!=d||zt&&nt(zt.resolve())!=v||sr&&nt(new sr)!=A||Er&&nt(new Er)!=F)&&(nt=function(I){var $=Cr.call(I),se=$==g?I.constructor:void 0,Ce=se?Or(se):void 0;if(Ce)switch(Ce){case Nr:return R;case Xr:return d;case Ee:return v;case D:return A;case U:return F}return $});function Jt(I){var $=I.length,se=I.constructor($);return $&&typeof I[0]=="string"&&mt.call(I,"index")&&(se.index=I.index,se.input=I.input),se}function vr(I){return typeof I.constructor=="function"&&!vn(I)?cn(kr(I)):{}}function jr(I,$,se,Ce){var ht=I.constructor;switch($){case E:return on(I);case o:case l:return new ht(+I);case R:return rn(I,Ce);case B:case j:case G:case ie:case q:case Y:case J:case ae:case oe:return z(I,Ce);case d:return Lr(I,Ce,se);case h:case C:return new ht(I);case y:return ln(I);case A:return k(I,Ce,se);case S:return O(I)}}function dn(I,$){return $=$??i,!!$&&(typeof I=="number"||Re.test(I))&&I>-1&&I%1==0&&I<$}function Kn(I){var $=typeof I;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?I!=="__proto__":I===null}function Vn(I){return!!Yt&&Yt in I}function vn(I){var $=I&&I.constructor,se=typeof $=="function"&&$.prototype||nr;return I===se}function Or(I){if(I!=null){try{return Xt.call(I)}catch{}try{return I+""}catch{}}return""}function qn(I){return xn(I,!0,!0)}function Mn(I,$){return I===$||I!==I&&$!==$}function _n(I){return wi(I)&&mt.call(I,"callee")&&(!Vr.call(I,"callee")||Cr.call(I)==a)}var Ri=Array.isArray;function bi(I){return I!=null&&zn(I.length)&&!ki(I)}function wi(I){return Zn(I)&&bi(I)}var Nn=Tr||Ci;function ki(I){var $=En(I)?Cr.call(I):"";return $==c||$==f}function zn(I){return typeof I=="number"&&I>-1&&I%1==0&&I<=i}function En(I){var $=typeof I;return!!I&&($=="object"||$=="function")}function Zn(I){return!!I&&typeof I=="object"}function lr(I){return bi(I)?Rr(I):Sn(I)}function Pn(){return[]}function Ci(){return!1}r.exports=qn})(_d,_d.exports)),_d.exports}var P_=I_();const mo=Ns(P_);var Nd={exports:{}};Nd.exports;var JC;function D_(){return JC||(JC=1,(function(r,e){var t=200,n="__lodash_hash_undefined__",i=1,a=2,s=9007199254740991,o="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",v="[object Map]",y="[object Number]",A="[object Null]",C="[object Object]",S="[object Promise]",F="[object Proxy]",E="[object RegExp]",R="[object Set]",B="[object String]",j="[object Symbol]",G="[object Undefined]",ie="[object WeakMap]",q="[object ArrayBuffer]",Y="[object DataView]",J="[object Float32Array]",ae="[object Float64Array]",oe="[object Int8Array]",he="[object Int16Array]",ye="[object Int32Array]",Ue="[object Uint8Array]",Re="[object Uint8ClampedArray]",Oe="[object Uint16Array]",ee="[object Uint32Array]",re=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,Be=/^(?:0|[1-9]\d*)$/,ke={};ke[J]=ke[ae]=ke[oe]=ke[he]=ke[ye]=ke[Ue]=ke[Re]=ke[Oe]=ke[ee]=!0,ke[o]=ke[l]=ke[q]=ke[c]=ke[Y]=ke[f]=ke[d]=ke[h]=ke[v]=ke[y]=ke[C]=ke[E]=ke[R]=ke[B]=ke[ie]=!1;var $e=typeof di=="object"&&di&&di.Object===Object&&di,je=typeof self=="object"&&self&&self.Object===Object&&self,qe=$e||je||Function("return this")(),Ge=e&&!e.nodeType&&e,bt=Ge&&!0&&r&&!r.nodeType&&r,rr=bt&&bt.exports===Ge,Dr=rr&&$e.process,Gt=(function(){try{return Dr&&Dr.binding&&Dr.binding("util")}catch{}})(),ar=Gt&&Gt.isTypedArray;function St(I,$){for(var se=-1,Ce=I==null?0:I.length,ht=0,lt=[];++se<Ce;){var Ht=I[se];$(Ht,se,I)&&(lt[ht++]=Ht)}return lt}function st(I,$){for(var se=-1,Ce=$.length,ht=I.length;++se<Ce;)I[ht+se]=$[se];return I}function Qr(I,$){for(var se=-1,Ce=I==null?0:I.length;++se<Ce;)if($(I[se],se,I))return!0;return!1}function Sr(I,$){for(var se=-1,Ce=Array(I);++se<I;)Ce[se]=$(se);return Ce}function gr(I){return function($){return I($)}}function nr(I,$){return I.has($)}function dr(I,$){return I?.[$]}function Yt(I){var $=-1,se=Array(I.size);return I.forEach(function(Ce,ht){se[++$]=[ht,Ce]}),se}function Xt(I,$){return function(se){return I($(se))}}function mt(I){var $=-1,se=Array(I.size);return I.forEach(function(Ce){se[++$]=Ce}),se}var Cr=Array.prototype,sn=Function.prototype,_r=Object.prototype,ir=qe["__core-js_shared__"],Yr=sn.toString,kr=_r.hasOwnProperty,Zr=(function(){var I=/[^.]+$/.exec(ir&&ir.keys&&ir.keys.IE_PROTO||"");return I?"Symbol(src)_1."+I:""})(),Vr=_r.toString,pn=RegExp("^"+Yr.call(kr).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gn=rr?qe.Buffer:void 0,Tr=qe.Symbol,zr=qe.Uint8Array,en=_r.propertyIsEnumerable,$r=Cr.splice,zt=Tr?Tr.toStringTag:void 0,sr=Object.getOwnPropertySymbols,Er=gn?gn.isBuffer:void 0,tt=Xt(Object.keys,Object),Nr=ut(qe,"DataView"),Xr=ut(qe,"Map"),Ee=ut(qe,"Promise"),D=ut(qe,"Set"),U=ut(qe,"WeakMap"),X=ut(Object,"create"),ue=Or(Nr),Fe=Or(Xr),We=Or(Ee),wt=Or(D),Dt=Or(U),Nt=Tr?Tr.prototype:void 0,or=Nt?Nt.valueOf:void 0;function Lt(I){var $=-1,se=I==null?0:I.length;for(this.clear();++$<se;){var Ce=I[$];this.set(Ce[0],Ce[1])}}function K(){this.__data__=X?X(null):{},this.size=0}function Ie(I){var $=this.has(I)&&delete this.__data__[I];return this.size-=$?1:0,$}function Qe(I){var $=this.__data__;if(X){var se=$[I];return se===n?void 0:se}return kr.call($,I)?$[I]:void 0}function Ye(I){var $=this.__data__;return X?$[I]!==void 0:kr.call($,I)}function xt(I,$){var se=this.__data__;return this.size+=this.has(I)?0:1,se[I]=X&&$===void 0?n:$,this}Lt.prototype.clear=K,Lt.prototype.delete=Ie,Lt.prototype.get=Qe,Lt.prototype.has=Ye,Lt.prototype.set=xt;function ft(I){var $=-1,se=I==null?0:I.length;for(this.clear();++$<se;){var Ce=I[$];this.set(Ce[0],Ce[1])}}function Rt(){this.__data__=[],this.size=0}function Et(I){var $=this.__data__,se=mn($,I);if(se<0)return!1;var Ce=$.length-1;return se==Ce?$.pop():$r.call($,se,1),--this.size,!0}function hr(I){var $=this.__data__,se=mn($,I);return se<0?void 0:$[se][1]}function tr(I){return mn(this.__data__,I)>-1}function fr(I,$){var se=this.__data__,Ce=mn(se,I);return Ce<0?(++this.size,se.push([I,$])):se[Ce][1]=$,this}ft.prototype.clear=Rt,ft.prototype.delete=Et,ft.prototype.get=hr,ft.prototype.has=tr,ft.prototype.set=fr;function $t(I){var $=-1,se=I==null?0:I.length;for(this.clear();++$<se;){var Ce=I[$];this.set(Ce[0],Ce[1])}}function Bn(){this.size=0,this.__data__={hash:new Lt,map:new(Xr||ft),string:new Lt}}function In(I){var $=rt(this,I).delete(I);return this.size-=$?1:0,$}function mr(I){return rt(this,I).get(I)}function xr(I){return rt(this,I).has(I)}function wn(I,$){var se=rt(this,I),Ce=se.size;return se.set(I,$),this.size+=se.size==Ce?0:1,this}$t.prototype.clear=Bn,$t.prototype.delete=In,$t.prototype.get=mr,$t.prototype.has=xr,$t.prototype.set=wn;function Rr(I){var $=-1,se=I==null?0:I.length;for(this.__data__=new $t;++$<se;)this.add(I[$])}function Gn(I){return this.__data__.set(I,n),this}function Cn(I){return this.__data__.has(I)}Rr.prototype.add=Rr.prototype.push=Gn,Rr.prototype.has=Cn;function Hr(I){var $=this.__data__=new ft(I);this.size=$.size}function xn(){this.__data__=new ft,this.size=0}function cn(I){var $=this.__data__,se=$.delete(I);return this.size=$.size,se}function tn(I){return this.__data__.get(I)}function Jn(I){return this.__data__.has(I)}function si(I,$){var se=this.__data__;if(se instanceof ft){var Ce=se.__data__;if(!Xr||Ce.length<t-1)return Ce.push([I,$]),this.size=++se.size,this;se=this.__data__=new $t(Ce)}return se.set(I,$),this.size=se.size,this}Hr.prototype.clear=xn,Hr.prototype.delete=cn,Hr.prototype.get=tn,Hr.prototype.has=Jn,Hr.prototype.set=si;function Sn(I,$){var se=_n(I),Ce=!se&&Mn(I),ht=!se&&!Ce&&bi(I),lt=!se&&!Ce&&!ht&&Zn(I),Ht=se||Ce||ht||lt,Ut=Ht?Sr(I.length,String):[],Br=Ut.length;for(var M in I)kr.call(I,M)&&!(Ht&&(M=="length"||ht&&(M=="offset"||M=="parent")||lt&&(M=="buffer"||M=="byteLength"||M=="byteOffset")||jr(M,Br)))&&Ut.push(M);return Ut}function mn(I,$){for(var se=I.length;se--;)if(qn(I[se][0],$))return se;return-1}function on(I,$,se){var Ce=$(I);return _n(I)?Ce:st(Ce,se(I))}function rn(I){return I==null?I===void 0?G:A:zt&&zt in Object(I)?nt(I):vn(I)}function Lr(I){return En(I)&&rn(I)==o}function ln(I,$,se,Ce,ht){return I===$?!0:I==null||$==null||!En(I)&&!En($)?I!==I&&$!==$:k(I,$,se,Ce,ln,ht)}function k(I,$,se,Ce,ht,lt){var Ht=_n(I),Ut=_n($),Br=Ht?l:vr(I),M=Ut?l:vr($);Br=Br==o?C:Br,M=M==o?C:M;var Z=Br==C,de=M==C,be=Br==M;if(be&&bi(I)){if(!bi($))return!1;Ht=!0,Z=!1}if(be&&!Z)return lt||(lt=new Hr),Ht||Zn(I)?pe(I,$,se,Ce,ht,lt):ce(I,$,Br,se,Ce,ht,lt);if(!(se&i)){var Me=Z&&kr.call(I,"__wrapped__"),Ke=de&&kr.call($,"__wrapped__");if(Me||Ke){var Je=Me?I.value():I,yt=Ke?$.value():$;return lt||(lt=new Hr),ht(Je,yt,se,Ce,lt)}}return be?(lt||(lt=new Hr),xe(I,$,se,Ce,ht,lt)):!1}function O(I){if(!zn(I)||Kn(I))return!1;var $=Nn(I)?pn:fe;return $.test(Or(I))}function z(I){return En(I)&&ki(I.length)&&!!ke[rn(I)]}function W(I){if(!Vn(I))return tt(I);var $=[];for(var se in Object(I))kr.call(I,se)&&se!="constructor"&&$.push(se);return $}function pe(I,$,se,Ce,ht,lt){var Ht=se&i,Ut=I.length,Br=$.length;if(Ut!=Br&&!(Ht&&Br>Ut))return!1;var M=lt.get(I);if(M&<.get($))return M==$;var Z=-1,de=!0,be=se&a?new Rr:void 0;for(lt.set(I,$),lt.set($,I);++Z<Ut;){var Me=I[Z],Ke=$[Z];if(Ce)var Je=Ht?Ce(Ke,Me,Z,$,I,lt):Ce(Me,Ke,Z,I,$,lt);if(Je!==void 0){if(Je)continue;de=!1;break}if(be){if(!Qr($,function(yt,Ot){if(!nr(be,Ot)&&(Me===yt||ht(Me,yt,se,Ce,lt)))return be.push(Ot)})){de=!1;break}}else if(!(Me===Ke||ht(Me,Ke,se,Ce,lt))){de=!1;break}}return lt.delete(I),lt.delete($),de}function ce(I,$,se,Ce,ht,lt,Ht){switch(se){case Y:if(I.byteLength!=$.byteLength||I.byteOffset!=$.byteOffset)return!1;I=I.buffer,$=$.buffer;case q:return!(I.byteLength!=$.byteLength||!lt(new zr(I),new zr($)));case c:case f:case y:return qn(+I,+$);case d:return I.name==$.name&&I.message==$.message;case E:case B:return I==$+"";case v:var Ut=Yt;case R:var Br=Ce&i;if(Ut||(Ut=mt),I.size!=$.size&&!Br)return!1;var M=Ht.get(I);if(M)return M==$;Ce|=a,Ht.set(I,$);var Z=pe(Ut(I),Ut($),Ce,ht,lt,Ht);return Ht.delete(I),Z;case j:if(or)return or.call(I)==or.call($)}return!1}function xe(I,$,se,Ce,ht,lt){var Ht=se&i,Ut=_e(I),Br=Ut.length,M=_e($),Z=M.length;if(Br!=Z&&!Ht)return!1;for(var de=Br;de--;){var be=Ut[de];if(!(Ht?be in $:kr.call($,be)))return!1}var Me=lt.get(I);if(Me&<.get($))return Me==$;var Ke=!0;lt.set(I,$),lt.set($,I);for(var Je=Ht;++de<Br;){be=Ut[de];var yt=I[be],Ot=$[be];if(Ce)var pr=Ht?Ce(Ot,yt,be,$,I,lt):Ce(yt,Ot,be,I,$,lt);if(!(pr===void 0?yt===Ot||ht(yt,Ot,se,Ce,lt):pr)){Ke=!1;break}Je||(Je=be=="constructor")}if(Ke&&!Je){var yr=I.constructor,ur=$.constructor;yr!=ur&&"constructor"in I&&"constructor"in $&&!(typeof yr=="function"&&yr instanceof yr&&typeof ur=="function"&&ur instanceof ur)&&(Ke=!1)}return lt.delete(I),lt.delete($),Ke}function _e(I){return on(I,lr,Jt)}function rt(I,$){var se=I.__data__;return dn($)?se[typeof $=="string"?"string":"hash"]:se.map}function ut(I,$){var se=dr(I,$);return O(se)?se:void 0}function nt(I){var $=kr.call(I,zt),se=I[zt];try{I[zt]=void 0;var Ce=!0}catch{}var ht=Vr.call(I);return Ce&&($?I[zt]=se:delete I[zt]),ht}var Jt=sr?function(I){return I==null?[]:(I=Object(I),St(sr(I),function($){return en.call(I,$)}))}:Pn,vr=rn;(Nr&&vr(new Nr(new ArrayBuffer(1)))!=Y||Xr&&vr(new Xr)!=v||Ee&&vr(Ee.resolve())!=S||D&&vr(new D)!=R||U&&vr(new U)!=ie)&&(vr=function(I){var $=rn(I),se=$==C?I.constructor:void 0,Ce=se?Or(se):"";if(Ce)switch(Ce){case ue:return Y;case Fe:return v;case We:return S;case wt:return R;case Dt:return ie}return $});function jr(I,$){return $=$??s,!!$&&(typeof I=="number"||Be.test(I))&&I>-1&&I%1==0&&I<$}function dn(I){var $=typeof I;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?I!=="__proto__":I===null}function Kn(I){return!!Zr&&Zr in I}function Vn(I){var $=I&&I.constructor,se=typeof $=="function"&&$.prototype||_r;return I===se}function vn(I){return Vr.call(I)}function Or(I){if(I!=null){try{return Yr.call(I)}catch{}try{return I+""}catch{}}return""}function qn(I,$){return I===$||I!==I&&$!==$}var Mn=Lr((function(){return arguments})())?Lr:function(I){return En(I)&&kr.call(I,"callee")&&!en.call(I,"callee")},_n=Array.isArray;function Ri(I){return I!=null&&ki(I.length)&&!Nn(I)}var bi=Er||Ci;function wi(I,$){return ln(I,$)}function Nn(I){if(!zn(I))return!1;var $=rn(I);return $==h||$==g||$==u||$==F}function ki(I){return typeof I=="number"&&I>-1&&I%1==0&&I<=s}function zn(I){var $=typeof I;return I!=null&&($=="object"||$=="function")}function En(I){return I!=null&&typeof I=="object"}var Zn=ar?gr(ar):z;function lr(I){return Ri(I)?Sn(I):W(I)}function Pn(){return[]}function Ci(){return!1}r.exports=wi})(Nd,Nd.exports)),Nd.exports}var R_=D_();const vf=Ns(R_);var Wh={exports:{}},fd={};var KC;function O_(){if(KC)return fd;KC=1;var r=Il(),e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(o,l,u){var c,f={},d=null,h=null;u!==void 0&&(d=""+u),l.key!==void 0&&(d=""+l.key),l.ref!==void 0&&(h=l.ref);for(c in l)n.call(l,c)&&!a.hasOwnProperty(c)&&(f[c]=l[c]);if(o&&o.defaultProps)for(c in l=o.defaultProps,l)f[c]===void 0&&(f[c]=l[c]);return{$$typeof:e,type:o,key:d,ref:h,props:f,_owner:i.current}}return fd.Fragment=t,fd.jsx=s,fd.jsxs=s,fd}var hd={};var ZC;function B_(){return ZC||(ZC=1,process.env.NODE_ENV!=="production"&&(function(){var r=Il(),e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),g=Symbol.iterator,v="@@iterator";function y(K){if(K===null||typeof K!="object")return null;var Ie=g&&K[g]||K[v];return typeof Ie=="function"?Ie:null}var A=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(K){{for(var Ie=arguments.length,Qe=new Array(Ie>1?Ie-1:0),Ye=1;Ye<Ie;Ye++)Qe[Ye-1]=arguments[Ye];S("error",K,Qe)}}function S(K,Ie,Qe){{var Ye=A.ReactDebugCurrentFrame,xt=Ye.getStackAddendum();xt!==""&&(Ie+="%s",Qe=Qe.concat([xt]));var ft=Qe.map(function(Rt){return String(Rt)});ft.unshift("Warning: "+Ie),Function.prototype.apply.call(console[K],console,ft)}}var F=!1,E=!1,R=!1,B=!1,j=!1,G;G=Symbol.for("react.module.reference");function ie(K){return!!(typeof K=="string"||typeof K=="function"||K===n||K===a||j||K===i||K===u||K===c||B||K===h||F||E||R||typeof K=="object"&&K!==null&&(K.$$typeof===d||K.$$typeof===f||K.$$typeof===s||K.$$typeof===o||K.$$typeof===l||K.$$typeof===G||K.getModuleId!==void 0))}function q(K,Ie,Qe){var Ye=K.displayName;if(Ye)return Ye;var xt=Ie.displayName||Ie.name||"";return xt!==""?Qe+"("+xt+")":Qe}function Y(K){return K.displayName||"Context"}function J(K){if(K==null)return null;if(typeof K.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof K=="function")return K.displayName||K.name||null;if(typeof K=="string")return K;switch(K){case n:return"Fragment";case t:return"Portal";case a:return"Profiler";case i:return"StrictMode";case u:return"Suspense";case c:return"SuspenseList"}if(typeof K=="object")switch(K.$$typeof){case o:var Ie=K;return Y(Ie)+".Consumer";case s:var Qe=K;return Y(Qe._context)+".Provider";case l:return q(K,K.render,"ForwardRef");case f:var Ye=K.displayName||null;return Ye!==null?Ye:J(K.type)||"Memo";case d:{var xt=K,ft=xt._payload,Rt=xt._init;try{return J(Rt(ft))}catch{return null}}}return null}var ae=Object.assign,oe=0,he,ye,Ue,Re,Oe,ee,re;function fe(){}fe.__reactDisabledLog=!0;function Be(){{if(oe===0){he=console.log,ye=console.info,Ue=console.warn,Re=console.error,Oe=console.group,ee=console.groupCollapsed,re=console.groupEnd;var K={configurable:!0,enumerable:!0,value:fe,writable:!0};Object.defineProperties(console,{info:K,log:K,warn:K,error:K,group:K,groupCollapsed:K,groupEnd:K})}oe++}}function ke(){{if(oe--,oe===0){var K={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ae({},K,{value:he}),info:ae({},K,{value:ye}),warn:ae({},K,{value:Ue}),error:ae({},K,{value:Re}),group:ae({},K,{value:Oe}),groupCollapsed:ae({},K,{value:ee}),groupEnd:ae({},K,{value:re})})}oe<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var $e=A.ReactCurrentDispatcher,je;function qe(K,Ie,Qe){{if(je===void 0)try{throw Error()}catch(xt){var Ye=xt.stack.trim().match(/\n( *(at )?)/);je=Ye&&Ye[1]||""}return`
|
|
1749
1749
|
`+je+K}}var Ge=!1,bt;{var rr=typeof WeakMap=="function"?WeakMap:Map;bt=new rr}function Dr(K,Ie){if(!K||Ge)return"";{var Qe=bt.get(K);if(Qe!==void 0)return Qe}var Ye;Ge=!0;var xt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ft;ft=$e.current,$e.current=null,Be();try{if(Ie){var Rt=function(){throw Error()};if(Object.defineProperty(Rt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Rt,[])}catch(mr){Ye=mr}Reflect.construct(K,[],Rt)}else{try{Rt.call()}catch(mr){Ye=mr}K.call(Rt.prototype)}}else{try{throw Error()}catch(mr){Ye=mr}K()}}catch(mr){if(mr&&Ye&&typeof mr.stack=="string"){for(var Et=mr.stack.split(`
|
|
1750
1750
|
`),hr=Ye.stack.split(`
|
|
1751
1751
|
`),tr=Et.length-1,fr=hr.length-1;tr>=1&&fr>=0&&Et[tr]!==hr[fr];)fr--;for(;tr>=1&&fr>=0;tr--,fr--)if(Et[tr]!==hr[fr]){if(tr!==1||fr!==1)do if(tr--,fr--,fr<0||Et[tr]!==hr[fr]){var $t=`
|
|
@@ -1779,7 +1779,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
1779
1779
|
matrix(${l}, ${-u}, ${u}, ${l}, 0, 0)
|
|
1780
1780
|
matrix(1, 0, 0, 1, ${-r.width/2}, ${-r.height/2})
|
|
1781
1781
|
matrix(${r.scaleX}, 0, 0, ${r.scaleY}, 0, 0)
|
|
1782
|
-
`,children:At.jsx(_T,{id:e,x:0,y:0,rotation:0,width:r.width,height:r.height,clipPath:r.path,children:c()})})})]})};String.prototype.codePointAt||(function(){var r=(function(){try{var t={},n=Object.defineProperty,i=n(t,t,t)&&n}catch{}return i})(),e=function(t){if(this==null)throw TypeError();var n=String(this),i=n.length,a=t?Number(t):0;if(a!=a&&(a=0),!(a<0||a>=i)){var s=n.charCodeAt(a),o;return s>=55296&&s<=56319&&i>a+1&&(o=n.charCodeAt(a+1),o>=56320&&o<=57343)?(s-55296)*1024+o-56320+65536:s}};r?r(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e})();var l1=0,NT=-3;function yf(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function X_(r,e){this.source=r,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=e,this.destLen=0,this.ltree=new yf,this.dtree=new yf}var LT=new yf,UT=new yf,u1=new Uint8Array(30),c1=new Uint16Array(30),VT=new Uint8Array(30),zT=new Uint16Array(30),J_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),tx=new yf,Wa=new Uint8Array(320);function $T(r,e,t,n){var i,a;for(i=0;i<t;++i)r[i]=0;for(i=0;i<30-t;++i)r[i+t]=i/t|0;for(a=n,i=0;i<30;++i)e[i]=a,a+=1<<r[i]}function K_(r,e){var t;for(t=0;t<7;++t)r.table[t]=0;for(r.table[7]=24,r.table[8]=152,r.table[9]=112,t=0;t<24;++t)r.trans[t]=256+t;for(t=0;t<144;++t)r.trans[24+t]=t;for(t=0;t<8;++t)r.trans[168+t]=280+t;for(t=0;t<112;++t)r.trans[176+t]=144+t;for(t=0;t<5;++t)e.table[t]=0;for(e.table[5]=32,t=0;t<32;++t)e.trans[t]=t}var rx=new Uint16Array(16);function T0(r,e,t,n){var i,a;for(i=0;i<16;++i)r.table[i]=0;for(i=0;i<n;++i)r.table[e[t+i]]++;for(r.table[0]=0,a=0,i=0;i<16;++i)rx[i]=a,a+=r.table[i];for(i=0;i<n;++i)e[t+i]&&(r.trans[rx[e[t+i]]++]=i)}function Z_(r){r.bitcount--||(r.tag=r.source[r.sourceIndex++],r.bitcount=7);var e=r.tag&1;return r.tag>>>=1,e}function Za(r,e,t){if(!e)return t;for(;r.bitcount<24;)r.tag|=r.source[r.sourceIndex++]<<r.bitcount,r.bitcount+=8;var n=r.tag&65535>>>16-e;return r.tag>>>=e,r.bitcount-=e,n+t}function Wy(r,e){for(;r.bitcount<24;)r.tag|=r.source[r.sourceIndex++]<<r.bitcount,r.bitcount+=8;var t=0,n=0,i=0,a=r.tag;do n=2*n+(a&1),a>>>=1,++i,t+=e.table[i],n-=e.table[i];while(n>=0);return r.tag=a,r.bitcount-=i,e.trans[t+n]}function e5(r,e,t){var n,i,a,s,o,l;for(n=Za(r,5,257),i=Za(r,5,1),a=Za(r,4,4),s=0;s<19;++s)Wa[s]=0;for(s=0;s<a;++s){var u=Za(r,3,0);Wa[J_[s]]=u}for(T0(tx,Wa,0,19),o=0;o<n+i;){var c=Wy(r,tx);switch(c){case 16:var f=Wa[o-1];for(l=Za(r,2,3);l;--l)Wa[o++]=f;break;case 17:for(l=Za(r,3,3);l;--l)Wa[o++]=0;break;case 18:for(l=Za(r,7,11);l;--l)Wa[o++]=0;break;default:Wa[o++]=c;break}}T0(e,Wa,0,n),T0(t,Wa,n,i)}function nx(r,e,t){for(;;){var n=Wy(r,e);if(n===256)return l1;if(n<256)r.dest[r.destLen++]=n;else{var i,a,s,o;for(n-=257,i=Za(r,u1[n],c1[n]),a=Wy(r,t),s=r.destLen-Za(r,VT[a],zT[a]),o=s;o<s+i;++o)r.dest[r.destLen++]=r.dest[o]}}}function t5(r){for(var e,t,n;r.bitcount>8;)r.sourceIndex--,r.bitcount-=8;if(e=r.source[r.sourceIndex+1],e=256*e+r.source[r.sourceIndex],t=r.source[r.sourceIndex+3],t=256*t+r.source[r.sourceIndex+2],e!==(~t&65535))return NT;for(r.sourceIndex+=4,n=e;n;--n)r.dest[r.destLen++]=r.source[r.sourceIndex++];return r.bitcount=0,l1}function r5(r,e){var t=new X_(r,e),n,i,a;do{switch(n=Z_(t),i=Za(t,2,0),i){case 0:a=t5(t);break;case 1:a=nx(t,LT,UT);break;case 2:e5(t,t.ltree,t.dtree),a=nx(t,t.ltree,t.dtree);break;default:a=NT}if(a!==l1)throw new Error("Data error")}while(!n);return t.destLen<t.dest.length?typeof t.dest.slice=="function"?t.dest.slice(0,t.destLen):t.dest.subarray(0,t.destLen):t.dest}K_(LT,UT);$T(u1,c1,4,3);$T(VT,zT,2,1);u1[28]=0;c1[28]=258;var n5=r5;function Cu(r,e,t,n,i){return Math.pow(1-i,3)*r+3*Math.pow(1-i,2)*i*e+3*(1-i)*Math.pow(i,2)*t+Math.pow(i,3)*n}function Bo(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}Bo.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)};Bo.prototype.addPoint=function(r,e){typeof r=="number"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=r,this.x2=r),r<this.x1&&(this.x1=r),r>this.x2&&(this.x2=r)),typeof e=="number"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))};Bo.prototype.addX=function(r){this.addPoint(r,null)};Bo.prototype.addY=function(r){this.addPoint(null,r)};Bo.prototype.addBezier=function(r,e,t,n,i,a,s,o){var l=[r,e],u=[t,n],c=[i,a],f=[s,o];this.addPoint(r,e),this.addPoint(s,o);for(var d=0;d<=1;d++){var h=6*l[d]-12*u[d]+6*c[d],g=-3*l[d]+9*u[d]-9*c[d]+3*f[d],v=3*u[d]-3*l[d];if(g===0){if(h===0)continue;var y=-v/h;0<y&&y<1&&(d===0&&this.addX(Cu(l[d],u[d],c[d],f[d],y)),d===1&&this.addY(Cu(l[d],u[d],c[d],f[d],y)));continue}var A=Math.pow(h,2)-4*v*g;if(!(A<0)){var C=(-h+Math.sqrt(A))/(2*g);0<C&&C<1&&(d===0&&this.addX(Cu(l[d],u[d],c[d],f[d],C)),d===1&&this.addY(Cu(l[d],u[d],c[d],f[d],C)));var S=(-h-Math.sqrt(A))/(2*g);0<S&&S<1&&(d===0&&this.addX(Cu(l[d],u[d],c[d],f[d],S)),d===1&&this.addY(Cu(l[d],u[d],c[d],f[d],S)))}}};Bo.prototype.addQuad=function(r,e,t,n,i,a){var s=r+.6666666666666666*(t-r),o=e+2/3*(n-e),l=s+1/3*(i-r),u=o+1/3*(a-e);this.addBezier(r,e,s,o,l,u,i,a)};function fi(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}fi.prototype.moveTo=function(r,e){this.commands.push({type:"M",x:r,y:e})};fi.prototype.lineTo=function(r,e){this.commands.push({type:"L",x:r,y:e})};fi.prototype.curveTo=fi.prototype.bezierCurveTo=function(r,e,t,n,i,a){this.commands.push({type:"C",x1:r,y1:e,x2:t,y2:n,x:i,y:a})};fi.prototype.quadTo=fi.prototype.quadraticCurveTo=function(r,e,t,n){this.commands.push({type:"Q",x1:r,y1:e,x:t,y:n})};fi.prototype.close=fi.prototype.closePath=function(){this.commands.push({type:"Z"})};fi.prototype.extend=function(r){if(r.commands)r=r.commands;else if(r instanceof Bo){var e=r;this.moveTo(e.x1,e.y1),this.lineTo(e.x2,e.y1),this.lineTo(e.x2,e.y2),this.lineTo(e.x1,e.y2),this.close();return}Array.prototype.push.apply(this.commands,r)};fi.prototype.getBoundingBox=function(){for(var r=new Bo,e=0,t=0,n=0,i=0,a=0;a<this.commands.length;a++){var s=this.commands[a];switch(s.type){case"M":r.addPoint(s.x,s.y),e=n=s.x,t=i=s.y;break;case"L":r.addPoint(s.x,s.y),n=s.x,i=s.y;break;case"Q":r.addQuad(n,i,s.x1,s.y1,s.x,s.y),n=s.x,i=s.y;break;case"C":r.addBezier(n,i,s.x1,s.y1,s.x2,s.y2,s.x,s.y),n=s.x,i=s.y;break;case"Z":n=e,i=t;break;default:throw new Error("Unexpected path command "+s.type)}}return r.isEmpty()&&r.addPoint(0,0),r};fi.prototype.draw=function(r){r.beginPath();for(var e=0;e<this.commands.length;e+=1){var t=this.commands[e];t.type==="M"?r.moveTo(t.x,t.y):t.type==="L"?r.lineTo(t.x,t.y):t.type==="C"?r.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y):t.type==="Q"?r.quadraticCurveTo(t.x1,t.y1,t.x,t.y):t.type==="Z"&&r.closePath()}this.fill&&(r.fillStyle=this.fill,r.fill()),this.stroke&&(r.strokeStyle=this.stroke,r.lineWidth=this.strokeWidth,r.stroke())};fi.prototype.toPathData=function(r){r=r!==void 0?r:2;function e(s){return Math.round(s)===s?""+Math.round(s):s.toFixed(r)}function t(){for(var s=arguments,o="",l=0;l<arguments.length;l+=1){var u=s[l];u>=0&&l>0&&(o+=" "),o+=e(u)}return o}for(var n="",i=0;i<this.commands.length;i+=1){var a=this.commands[i];a.type==="M"?n+="M"+t(a.x,a.y):a.type==="L"?n+="L"+t(a.x,a.y):a.type==="C"?n+="C"+t(a.x1,a.y1,a.x2,a.y2,a.x,a.y):a.type==="Q"?n+="Q"+t(a.x1,a.y1,a.x,a.y):a.type==="Z"&&(n+="Z")}return n};fi.prototype.toSVG=function(r){var e='<path d="';return e+=this.toPathData(r),e+='"',this.fill&&this.fill!=="black"&&(this.fill===null?e+=' fill="none"':e+=' fill="'+this.fill+'"'),this.stroke&&(e+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),e+="/>",e};fi.prototype.toDOMElement=function(r){var e=this.toPathData(r),t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",e),t};function HT(r){throw new Error(r)}function ix(r,e){r||HT(e)}var jt={fail:HT,argument:ix,assert:ix},ax=32768,sx=2147483648,nc={},it={},Qt={};function Na(r){return function(){return r}}it.BYTE=function(r){return jt.argument(r>=0&&r<=255,"Byte value should be between 0 and 255."),[r]};Qt.BYTE=Na(1);it.CHAR=function(r){return[r.charCodeAt(0)]};Qt.CHAR=Na(1);it.CHARARRAY=function(r){typeof r>"u"&&(r="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var e=[],t=0;t<r.length;t+=1)e[t]=r.charCodeAt(t);return e};Qt.CHARARRAY=function(r){return typeof r>"u"?0:r.length};it.USHORT=function(r){return[r>>8&255,r&255]};Qt.USHORT=Na(2);it.SHORT=function(r){return r>=ax&&(r=-(2*ax-r)),[r>>8&255,r&255]};Qt.SHORT=Na(2);it.UINT24=function(r){return[r>>16&255,r>>8&255,r&255]};Qt.UINT24=Na(3);it.ULONG=function(r){return[r>>24&255,r>>16&255,r>>8&255,r&255]};Qt.ULONG=Na(4);it.LONG=function(r){return r>=sx&&(r=-(2*sx-r)),[r>>24&255,r>>16&255,r>>8&255,r&255]};Qt.LONG=Na(4);it.FIXED=it.ULONG;Qt.FIXED=Qt.ULONG;it.FWORD=it.SHORT;Qt.FWORD=Qt.SHORT;it.UFWORD=it.USHORT;Qt.UFWORD=Qt.USHORT;it.LONGDATETIME=function(r){return[0,0,0,0,r>>24&255,r>>16&255,r>>8&255,r&255]};Qt.LONGDATETIME=Na(8);it.TAG=function(r){return jt.argument(r.length===4,"Tag should be exactly 4 ASCII characters."),[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3)]};Qt.TAG=Na(4);it.Card8=it.BYTE;Qt.Card8=Qt.BYTE;it.Card16=it.USHORT;Qt.Card16=Qt.USHORT;it.OffSize=it.BYTE;Qt.OffSize=Qt.BYTE;it.SID=it.USHORT;Qt.SID=Qt.USHORT;it.NUMBER=function(r){return r>=-107&&r<=107?[r+139]:r>=108&&r<=1131?(r=r-108,[(r>>8)+247,r&255]):r>=-1131&&r<=-108?(r=-r-108,[(r>>8)+251,r&255]):r>=-32768&&r<=32767?it.NUMBER16(r):it.NUMBER32(r)};Qt.NUMBER=function(r){return it.NUMBER(r).length};it.NUMBER16=function(r){return[28,r>>8&255,r&255]};Qt.NUMBER16=Na(3);it.NUMBER32=function(r){return[29,r>>24&255,r>>16&255,r>>8&255,r&255]};Qt.NUMBER32=Na(5);it.REAL=function(r){var e=r.toString(),t=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);if(t){var n=parseFloat("1e"+((t[2]?+t[2]:0)+t[1].length));e=(Math.round(r*n)/n).toString()}for(var i="",a=0,s=e.length;a<s;a+=1){var o=e[a];o==="e"?i+=e[++a]==="-"?"c":"b":o==="."?i+="a":o==="-"?i+="e":i+=o}i+=i.length&1?"f":"ff";for(var l=[30],u=0,c=i.length;u<c;u+=2)l.push(parseInt(i.substr(u,2),16));return l};Qt.REAL=function(r){return it.REAL(r).length};it.NAME=it.CHARARRAY;Qt.NAME=Qt.CHARARRAY;it.STRING=it.CHARARRAY;Qt.STRING=Qt.CHARARRAY;nc.UTF8=function(r,e,t){for(var n=[],i=t,a=0;a<i;a++,e+=1)n[a]=r.getUint8(e);return String.fromCharCode.apply(null,n)};nc.UTF16=function(r,e,t){for(var n=[],i=t/2,a=0;a<i;a++,e+=2)n[a]=r.getUint16(e);return String.fromCharCode.apply(null,n)};it.UTF16=function(r){for(var e=[],t=0;t<r.length;t+=1){var n=r.charCodeAt(t);e[e.length]=n>>8&255,e[e.length]=n&255}return e};Qt.UTF16=function(r){return r.length*2};var Qy={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};nc.MACSTRING=function(r,e,t,n){var i=Qy[n];if(i!==void 0){for(var a="",s=0;s<t;s++){var o=r.getUint8(e+s);o<=127?a+=String.fromCharCode(o):a+=i[o&127]}return a}};var Qh=typeof WeakMap=="function"&&new WeakMap,Yh,i5=function(r){if(!Yh){Yh={};for(var e in Qy)Yh[e]=new String(e)}var t=Yh[r];if(t!==void 0){if(Qh){var n=Qh.get(t);if(n!==void 0)return n}var i=Qy[r];if(i!==void 0){for(var a={},s=0;s<i.length;s++)a[i.charCodeAt(s)]=s+128;return Qh&&Qh.set(t,a),a}}};it.MACSTRING=function(r,e){var t=i5(e);if(t!==void 0){for(var n=[],i=0;i<r.length;i++){var a=r.charCodeAt(i);if(a>=128&&(a=t[a],a===void 0))return;n[i]=a}return n}};Qt.MACSTRING=function(r,e){var t=it.MACSTRING(r,e);return t!==void 0?t.length:0};function Yy(r){return r>=-128&&r<=127}function a5(r,e,t){for(var n=0,i=r.length;e<i&&n<64&&r[e]===0;)++e,++n;return t.push(128|n-1),e}function s5(r,e,t){for(var n=0,i=r.length,a=e;a<i&&n<64;){var s=r[a];if(!Yy(s)||s===0&&a+1<i&&r[a+1]===0)break;++a,++n}t.push(n-1);for(var o=e;o<a;++o)t.push(r[o]+256&255);return a}function o5(r,e,t){for(var n=0,i=r.length,a=e;a<i&&n<64;){var s=r[a];if(s===0||Yy(s)&&a+1<i&&Yy(r[a+1]))break;++a,++n}t.push(64|n-1);for(var o=e;o<a;++o){var l=r[o];t.push(l+65536>>8&255,l+256&255)}return a}it.VARDELTAS=function(r){for(var e=0,t=[];e<r.length;){var n=r[e];n===0?e=a5(r,e,t):n>=-128&&n<=127?e=s5(r,e,t):e=o5(r,e,t)}return t};it.INDEX=function(r){for(var e=1,t=[e],n=[],i=0;i<r.length;i+=1){var a=it.OBJECT(r[i]);Array.prototype.push.apply(n,a),e+=a.length,t.push(e)}if(n.length===0)return[0,0];for(var s=[],o=1+Math.floor(Math.log(e)/Math.log(2))/8|0,l=[void 0,it.BYTE,it.USHORT,it.UINT24,it.ULONG][o],u=0;u<t.length;u+=1){var c=l(t[u]);Array.prototype.push.apply(s,c)}return Array.prototype.concat(it.Card16(r.length),it.OffSize(o),s,n)};Qt.INDEX=function(r){return it.INDEX(r).length};it.DICT=function(r){for(var e=[],t=Object.keys(r),n=t.length,i=0;i<n;i+=1){var a=parseInt(t[i],0),s=r[a];e=e.concat(it.OPERAND(s.value,s.type)),e=e.concat(it.OPERATOR(a))}return e};Qt.DICT=function(r){return it.DICT(r).length};it.OPERATOR=function(r){return r<1200?[r]:[12,r-1200]};it.OPERAND=function(r,e){var t=[];if(Array.isArray(e))for(var n=0;n<e.length;n+=1)jt.argument(r.length===e.length,"Not enough arguments given for type"+e),t=t.concat(it.OPERAND(r[n],e[n]));else if(e==="SID")t=t.concat(it.NUMBER(r));else if(e==="offset")t=t.concat(it.NUMBER32(r));else if(e==="number")t=t.concat(it.NUMBER(r));else if(e==="real")t=t.concat(it.REAL(r));else throw new Error("Unknown operand type "+e);return t};it.OP=it.BYTE;Qt.OP=Qt.BYTE;var Xh=typeof WeakMap=="function"&&new WeakMap;it.CHARSTRING=function(r){if(Xh){var e=Xh.get(r);if(e!==void 0)return e}for(var t=[],n=r.length,i=0;i<n;i+=1){var a=r[i];t=t.concat(it[a.type](a.value))}return Xh&&Xh.set(r,t),t};Qt.CHARSTRING=function(r){return it.CHARSTRING(r).length};it.OBJECT=function(r){var e=it[r.type];return jt.argument(e!==void 0,"No encoding function for type "+r.type),e(r.value)};Qt.OBJECT=function(r){var e=Qt[r.type];return jt.argument(e!==void 0,"No sizeOf function for type "+r.type),e(r.value)};it.TABLE=function(r){for(var e=[],t=r.fields.length,n=[],i=[],a=0;a<t;a+=1){var s=r.fields[a],o=it[s.type];jt.argument(o!==void 0,"No encoding function for field type "+s.type+" ("+s.name+")");var l=r[s.name];l===void 0&&(l=s.value);var u=o(l);s.type==="TABLE"?(i.push(e.length),e=e.concat([0,0]),n.push(u)):e=e.concat(u)}for(var c=0;c<n.length;c+=1){var f=i[c],d=e.length;jt.argument(d<65536,"Table "+r.tableName+" too big."),e[f]=d>>8,e[f+1]=d&255,e=e.concat(n[c])}return e};Qt.TABLE=function(r){for(var e=0,t=r.fields.length,n=0;n<t;n+=1){var i=r.fields[n],a=Qt[i.type];jt.argument(a!==void 0,"No sizeOf function for field type "+i.type+" ("+i.name+")");var s=r[i.name];s===void 0&&(s=i.value),e+=a(s),i.type==="TABLE"&&(e+=2)}return e};it.RECORD=it.TABLE;Qt.RECORD=Qt.TABLE;it.LITERAL=function(r){return r};Qt.LITERAL=function(r){return r.length};function yi(r,e,t){if(e.length&&(e[0].name!=="coverageFormat"||e[0].value===1))for(var n=0;n<e.length;n+=1){var i=e[n];this[i.name]=i.value}if(this.tableName=r,this.fields=e,t)for(var a=Object.keys(t),s=0;s<a.length;s+=1){var o=a[s],l=t[o];this[o]!==void 0&&(this[o]=l)}}yi.prototype.encode=function(){return it.TABLE(this)};yi.prototype.sizeOf=function(){return Qt.TABLE(this)};function Af(r,e,t){t===void 0&&(t=e.length);var n=new Array(e.length+1);n[0]={name:r+"Count",type:"USHORT",value:t};for(var i=0;i<e.length;i++)n[i+1]={name:r+i,type:"USHORT",value:e[i]};return n}function Xy(r,e,t){var n=e.length,i=new Array(n+1);i[0]={name:r+"Count",type:"USHORT",value:n};for(var a=0;a<n;a++)i[a+1]={name:r+a,type:"TABLE",value:t(e[a],a)};return i}function bf(r,e,t){var n=e.length,i=[];i[0]={name:r+"Count",type:"USHORT",value:n};for(var a=0;a<n;a++)i=i.concat(t(e[a],a));return i}function sg(r){r.format===1?yi.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(Af("glyph",r.glyphs))):r.format===2?yi.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(bf("rangeRecord",r.ranges,function(e){return[{name:"startGlyphID",type:"USHORT",value:e.start},{name:"endGlyphID",type:"USHORT",value:e.end},{name:"startCoverageIndex",type:"USHORT",value:e.index}]}))):jt.assert(!1,"Coverage format must be 1 or 2.")}sg.prototype=Object.create(yi.prototype);sg.prototype.constructor=sg;function og(r){yi.call(this,"scriptListTable",bf("scriptRecord",r,function(e,t){var n=e.script,i=n.defaultLangSys;return jt.assert(!!i,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new yi("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new yi("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:i.reqFeatureIndex}].concat(Af("featureIndex",i.featureIndexes)))}].concat(bf("langSys",n.langSysRecords,function(a,s){var o=a.langSys;return[{name:"langSysTag"+s,type:"TAG",value:a.tag},{name:"langSys"+s,type:"TABLE",value:new yi("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:o.reqFeatureIndex}].concat(Af("featureIndex",o.featureIndexes)))}]})))}]}))}og.prototype=Object.create(yi.prototype);og.prototype.constructor=og;function lg(r){yi.call(this,"featureListTable",bf("featureRecord",r,function(e,t){var n=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new yi("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat(Af("lookupListIndex",n.lookupListIndexes)))}]}))}lg.prototype=Object.create(yi.prototype);lg.prototype.constructor=lg;function ug(r,e){yi.call(this,"lookupListTable",Xy("lookup",r,function(t){var n=e[t.lookupType];return jt.assert(!!n,"Unable to write GSUB lookup type "+t.lookupType+" tables."),new yi("lookupTable",[{name:"lookupType",type:"USHORT",value:t.lookupType},{name:"lookupFlag",type:"USHORT",value:t.lookupFlag}].concat(Xy("subtable",t.subtables,n)))}))}ug.prototype=Object.create(yi.prototype);ug.prototype.constructor=ug;var dt={Table:yi,Record:yi,Coverage:sg,ScriptList:og,FeatureList:lg,LookupList:ug,ushortList:Af,tableList:Xy,recordList:bf};function ox(r,e){return r.getUint8(e)}function cg(r,e){return r.getUint16(e,!1)}function l5(r,e){return r.getInt16(e,!1)}function d1(r,e){return r.getUint32(e,!1)}function jT(r,e){var t=r.getInt16(e,!1),n=r.getUint16(e+2,!1);return t+n/65535}function u5(r,e){for(var t="",n=e;n<e+4;n+=1)t+=String.fromCharCode(r.getInt8(n));return t}function c5(r,e,t){for(var n=0,i=0;i<t;i+=1)n<<=8,n+=r.getUint8(e+i);return n}function d5(r,e,t){for(var n=[],i=e;i<t;i+=1)n.push(r.getUint8(i));return n}function f5(r){for(var e="",t=0;t<r.length;t+=1)e+=String.fromCharCode(r[t]);return e}var h5={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function we(r,e){this.data=r,this.offset=e,this.relativeOffset=0}we.prototype.parseByte=function(){var r=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,r};we.prototype.parseChar=function(){var r=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,r};we.prototype.parseCard8=we.prototype.parseByte;we.prototype.parseUShort=function(){var r=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,r};we.prototype.parseCard16=we.prototype.parseUShort;we.prototype.parseSID=we.prototype.parseUShort;we.prototype.parseOffset16=we.prototype.parseUShort;we.prototype.parseShort=function(){var r=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,r};we.prototype.parseF2Dot14=function(){var r=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,r};we.prototype.parseULong=function(){var r=d1(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,r};we.prototype.parseOffset32=we.prototype.parseULong;we.prototype.parseFixed=function(){var r=jT(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,r};we.prototype.parseString=function(r){var e=this.data,t=this.offset+this.relativeOffset,n="";this.relativeOffset+=r;for(var i=0;i<r;i++)n+=String.fromCharCode(e.getUint8(t+i));return n};we.prototype.parseTag=function(){return this.parseString(4)};we.prototype.parseLongDateTime=function(){var r=d1(this.data,this.offset+this.relativeOffset+4);return r-=2082844800,this.relativeOffset+=8,r};we.prototype.parseVersion=function(r){var e=cg(this.data,this.offset+this.relativeOffset),t=cg(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,r===void 0&&(r=4096),e+t/r/10};we.prototype.skip=function(r,e){e===void 0&&(e=1),this.relativeOffset+=h5[r]*e};we.prototype.parseULongList=function(r){r===void 0&&(r=this.parseULong());for(var e=new Array(r),t=this.data,n=this.offset+this.relativeOffset,i=0;i<r;i++)e[i]=t.getUint32(n),n+=4;return this.relativeOffset+=r*4,e};we.prototype.parseOffset16List=we.prototype.parseUShortList=function(r){r===void 0&&(r=this.parseUShort());for(var e=new Array(r),t=this.data,n=this.offset+this.relativeOffset,i=0;i<r;i++)e[i]=t.getUint16(n),n+=2;return this.relativeOffset+=r*2,e};we.prototype.parseShortList=function(r){for(var e=new Array(r),t=this.data,n=this.offset+this.relativeOffset,i=0;i<r;i++)e[i]=t.getInt16(n),n+=2;return this.relativeOffset+=r*2,e};we.prototype.parseByteList=function(r){for(var e=new Array(r),t=this.data,n=this.offset+this.relativeOffset,i=0;i<r;i++)e[i]=t.getUint8(n++);return this.relativeOffset+=r,e};we.prototype.parseList=function(r,e){e||(e=r,r=this.parseUShort());for(var t=new Array(r),n=0;n<r;n++)t[n]=e.call(this);return t};we.prototype.parseList32=function(r,e){e||(e=r,r=this.parseULong());for(var t=new Array(r),n=0;n<r;n++)t[n]=e.call(this);return t};we.prototype.parseRecordList=function(r,e){e||(e=r,r=this.parseUShort());for(var t=new Array(r),n=Object.keys(e),i=0;i<r;i++){for(var a={},s=0;s<n.length;s++){var o=n[s],l=e[o];a[o]=l.call(this)}t[i]=a}return t};we.prototype.parseRecordList32=function(r,e){e||(e=r,r=this.parseULong());for(var t=new Array(r),n=Object.keys(e),i=0;i<r;i++){for(var a={},s=0;s<n.length;s++){var o=n[s],l=e[o];a[o]=l.call(this)}t[i]=a}return t};we.prototype.parseStruct=function(r){if(typeof r=="function")return r.call(this);for(var e=Object.keys(r),t={},n=0;n<e.length;n++){var i=e[n],a=r[i];t[i]=a.call(this)}return t};we.prototype.parseValueRecord=function(r){if(r===void 0&&(r=this.parseUShort()),r!==0){var e={};return r&1&&(e.xPlacement=this.parseShort()),r&2&&(e.yPlacement=this.parseShort()),r&4&&(e.xAdvance=this.parseShort()),r&8&&(e.yAdvance=this.parseShort()),r&16&&(e.xPlaDevice=void 0,this.parseShort()),r&32&&(e.yPlaDevice=void 0,this.parseShort()),r&64&&(e.xAdvDevice=void 0,this.parseShort()),r&128&&(e.yAdvDevice=void 0,this.parseShort()),e}};we.prototype.parseValueRecordList=function(){for(var r=this.parseUShort(),e=this.parseUShort(),t=new Array(e),n=0;n<e;n++)t[n]=this.parseValueRecord(r);return t};we.prototype.parsePointer=function(r){var e=this.parseOffset16();if(e>0)return new we(this.data,this.offset+e).parseStruct(r)};we.prototype.parsePointer32=function(r){var e=this.parseOffset32();if(e>0)return new we(this.data,this.offset+e).parseStruct(r)};we.prototype.parseListOfLists=function(r){for(var e=this.parseOffset16List(),t=e.length,n=this.relativeOffset,i=new Array(t),a=0;a<t;a++){var s=e[a];if(s===0){i[a]=void 0;continue}if(this.relativeOffset=s,r){for(var o=this.parseOffset16List(),l=new Array(o.length),u=0;u<o.length;u++)this.relativeOffset=s+o[u],l[u]=r.call(this);i[a]=l}else i[a]=this.parseUShortList()}return this.relativeOffset=n,i};we.prototype.parseCoverage=function(){var r=this.offset+this.relativeOffset,e=this.parseUShort(),t=this.parseUShort();if(e===1)return{format:1,glyphs:this.parseUShortList(t)};if(e===2){for(var n=new Array(t),i=0;i<t;i++)n[i]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:n}}throw new Error("0x"+r.toString(16)+": Coverage format must be 1 or 2.")};we.prototype.parseClassDef=function(){var r=this.offset+this.relativeOffset,e=this.parseUShort();if(e===1)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(e===2)return{format:2,ranges:this.parseRecordList({start:we.uShort,end:we.uShort,classId:we.uShort})};throw new Error("0x"+r.toString(16)+": ClassDef format must be 1 or 2.")};we.list=function(r,e){return function(){return this.parseList(r,e)}};we.list32=function(r,e){return function(){return this.parseList32(r,e)}};we.recordList=function(r,e){return function(){return this.parseRecordList(r,e)}};we.recordList32=function(r,e){return function(){return this.parseRecordList32(r,e)}};we.pointer=function(r){return function(){return this.parsePointer(r)}};we.pointer32=function(r){return function(){return this.parsePointer32(r)}};we.tag=we.prototype.parseTag;we.byte=we.prototype.parseByte;we.uShort=we.offset16=we.prototype.parseUShort;we.uShortList=we.prototype.parseUShortList;we.uLong=we.offset32=we.prototype.parseULong;we.uLongList=we.prototype.parseULongList;we.struct=we.prototype.parseStruct;we.coverage=we.prototype.parseCoverage;we.classDef=we.prototype.parseClassDef;var lx={reserved:we.uShort,reqFeatureIndex:we.uShort,featureIndexes:we.uShortList};we.prototype.parseScriptList=function(){return this.parsePointer(we.recordList({tag:we.tag,script:we.pointer({defaultLangSys:we.pointer(lx),langSysRecords:we.recordList({tag:we.tag,langSys:we.pointer(lx)})})}))||[]};we.prototype.parseFeatureList=function(){return this.parsePointer(we.recordList({tag:we.tag,feature:we.pointer({featureParams:we.offset16,lookupListIndexes:we.uShortList})}))||[]};we.prototype.parseLookupList=function(r){return this.parsePointer(we.list(we.pointer(function(){var e=this.parseUShort();jt.argument(1<=e&&e<=9,"GPOS/GSUB lookup type "+e+" unknown.");var t=this.parseUShort(),n=t&16;return{lookupType:e,lookupFlag:t,subtables:this.parseList(we.pointer(r[e])),markFilteringSet:n?this.parseUShort():void 0}})))||[]};we.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var r=this.parseUShort(),e=this.parseUShort();jt.argument(r===1&&e<1,"GPOS/GSUB feature variations table unknown.");var t=this.parseRecordList32({conditionSetOffset:we.offset32,featureTableSubstitutionOffset:we.offset32});return t})||[]};var vt={getByte:ox,getCard8:ox,getUShort:cg,getCard16:cg,getShort:l5,getULong:d1,getFixed:jT,getTag:u5,getOffset:c5,getBytes:d5,bytesToString:f5,Parser:we};function p5(r,e){e.parseUShort(),r.length=e.parseULong(),r.language=e.parseULong();var t;r.groupCount=t=e.parseULong(),r.glyphIndexMap={};for(var n=0;n<t;n+=1)for(var i=e.parseULong(),a=e.parseULong(),s=e.parseULong(),o=i;o<=a;o+=1)r.glyphIndexMap[o]=s,s++}function g5(r,e,t,n,i){r.length=e.parseUShort(),r.language=e.parseUShort();var a;r.segCount=a=e.parseUShort()>>1,e.skip("uShort",3),r.glyphIndexMap={};for(var s=new vt.Parser(t,n+i+14),o=new vt.Parser(t,n+i+16+a*2),l=new vt.Parser(t,n+i+16+a*4),u=new vt.Parser(t,n+i+16+a*6),c=n+i+16+a*8,f=0;f<a-1;f+=1)for(var d=void 0,h=s.parseUShort(),g=o.parseUShort(),v=l.parseShort(),y=u.parseUShort(),A=g;A<=h;A+=1)y!==0?(c=u.offset+u.relativeOffset-2,c+=y,c+=(A-g)*2,d=vt.getUShort(t,c),d!==0&&(d=d+v&65535)):d=A+v&65535,r.glyphIndexMap[A]=d}function m5(r,e){var t={};t.version=vt.getUShort(r,e),jt.argument(t.version===0,"cmap table version should be 0."),t.numTables=vt.getUShort(r,e+2);for(var n=-1,i=t.numTables-1;i>=0;i-=1){var a=vt.getUShort(r,e+4+i*8),s=vt.getUShort(r,e+4+i*8+2);if(a===3&&(s===0||s===1||s===10)||a===0&&(s===0||s===1||s===2||s===3||s===4)){n=vt.getULong(r,e+4+i*8+4);break}}if(n===-1)throw new Error("No valid cmap sub-tables found.");var o=new vt.Parser(r,e+n);if(t.format=o.parseUShort(),t.format===12)p5(t,o);else if(t.format===4)g5(t,o,r,e,n);else throw new Error("Only format 4 and 12 cmap tables are supported (found format "+t.format+").");return t}function v5(r,e,t){r.segments.push({end:e,start:e,delta:-(e-t),offset:0,glyphIndex:t})}function y5(r){r.segments.push({end:65535,start:65535,delta:1,offset:0})}function A5(r){var e=!0,t;for(t=r.length-1;t>0;t-=1){var n=r.get(t);if(n.unicode>65535){console.log("Adding CMAP format 12 (needed!)"),e=!1;break}}var i=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:e?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:e?12:20}];e||(i=i.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),i=i.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var a=new dt.Table("cmap",i);for(a.segments=[],t=0;t<r.length;t+=1){for(var s=r.get(t),o=0;o<s.unicodes.length;o+=1)v5(a,s.unicodes[o],t);a.segments=a.segments.sort(function(C,S){return C.start-S.start})}y5(a);var l=a.segments.length,u=0,c=[],f=[],d=[],h=[],g=[],v=[];for(t=0;t<l;t+=1){var y=a.segments[t];y.end<=65535&&y.start<=65535?(c=c.concat({name:"end_"+t,type:"USHORT",value:y.end}),f=f.concat({name:"start_"+t,type:"USHORT",value:y.start}),d=d.concat({name:"idDelta_"+t,type:"SHORT",value:y.delta}),h=h.concat({name:"idRangeOffset_"+t,type:"USHORT",value:y.offset}),y.glyphId!==void 0&&(g=g.concat({name:"glyph_"+t,type:"USHORT",value:y.glyphId}))):u+=1,!e&&y.glyphIndex!==void 0&&(v=v.concat({name:"cmap12Start_"+t,type:"ULONG",value:y.start}),v=v.concat({name:"cmap12End_"+t,type:"ULONG",value:y.end}),v=v.concat({name:"cmap12Glyph_"+t,type:"ULONG",value:y.glyphIndex}))}if(a.segCountX2=(l-u)*2,a.searchRange=Math.pow(2,Math.floor(Math.log(l-u)/Math.log(2)))*2,a.entrySelector=Math.log(a.searchRange/2)/Math.log(2),a.rangeShift=a.segCountX2-a.searchRange,a.fields=a.fields.concat(c),a.fields.push({name:"reservedPad",type:"USHORT",value:0}),a.fields=a.fields.concat(f),a.fields=a.fields.concat(d),a.fields=a.fields.concat(h),a.fields=a.fields.concat(g),a.cmap4Length=14+c.length*2+2+f.length*2+d.length*2+h.length*2+g.length*2,!e){var A=16+v.length*4;a.cmap12Offset=20+a.cmap4Length,a.fields=a.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:A},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:v.length/3}]),a.fields=a.fields.concat(v)}return a}var GT={parse:m5,make:A5},jp=[".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"],b5=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],w5=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],ml=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function qT(r){this.font=r}qT.prototype.charToGlyphIndex=function(r){var e=r.codePointAt(0),t=this.font.glyphs;if(t){for(var n=0;n<t.length;n+=1)for(var i=t.get(n),a=0;a<i.unicodes.length;a+=1)if(i.unicodes[a]===e)return n}return null};function WT(r){this.cmap=r}WT.prototype.charToGlyphIndex=function(r){return this.cmap.glyphIndexMap[r.codePointAt(0)]||0};function dg(r,e){this.encoding=r,this.charset=e}dg.prototype.charToGlyphIndex=function(r){var e=r.codePointAt(0),t=this.encoding[e];return this.charset.indexOf(t)};function f1(r){switch(r.version){case 1:this.names=ml.slice();break;case 2:this.names=new Array(r.numberOfGlyphs);for(var e=0;e<r.numberOfGlyphs;e++)r.glyphNameIndex[e]<ml.length?this.names[e]=ml[r.glyphNameIndex[e]]:this.names[e]=r.names[r.glyphNameIndex[e]-ml.length];break;case 2.5:this.names=new Array(r.numberOfGlyphs);for(var t=0;t<r.numberOfGlyphs;t++)this.names[t]=ml[t+r.glyphNameIndex[t]];break;case 3:this.names=[];break;default:this.names=[];break}}f1.prototype.nameToGlyphIndex=function(r){return this.names.indexOf(r)};f1.prototype.glyphIndexToName=function(r){return this.names[r]};function C5(r){for(var e,t=r.tables.cmap.glyphIndexMap,n=Object.keys(t),i=0;i<n.length;i+=1){var a=n[i],s=t[a];e=r.glyphs.get(s),e.addUnicode(parseInt(a))}for(var o=0;o<r.glyphs.length;o+=1)e=r.glyphs.get(o),r.cffEncoding?r.isCIDFont?e.name="gid"+o:e.name=r.cffEncoding.charset[o]:r.glyphNames.names&&(e.name=r.glyphNames.glyphIndexToName(o))}function x5(r){r._IndexToUnicodeMap={};for(var e=r.tables.cmap.glyphIndexMap,t=Object.keys(e),n=0;n<t.length;n+=1){var i=t[n],a=e[i];r._IndexToUnicodeMap[a]===void 0?r._IndexToUnicodeMap[a]={unicodes:[parseInt(i)]}:r._IndexToUnicodeMap[a].unicodes.push(parseInt(i))}}function S5(r,e){e.lowMemory?x5(r):C5(r)}function E5(r,e,t,n,i){r.beginPath(),r.moveTo(e,t),r.lineTo(n,i),r.stroke()}var dl={line:E5};function k5(r,e){var t=e||new fi;return{configurable:!0,get:function(){return typeof t=="function"&&(t=t()),t},set:function(n){t=n}}}function ga(r){this.bindConstructorValues(r)}ga.prototype.bindConstructorValues=function(r){this.index=r.index||0,this.name=r.name||null,this.unicode=r.unicode||void 0,this.unicodes=r.unicodes||r.unicode!==void 0?[r.unicode]:[],"xMin"in r&&(this.xMin=r.xMin),"yMin"in r&&(this.yMin=r.yMin),"xMax"in r&&(this.xMax=r.xMax),"yMax"in r&&(this.yMax=r.yMax),"advanceWidth"in r&&(this.advanceWidth=r.advanceWidth),Object.defineProperty(this,"path",k5(this,r.path))};ga.prototype.addUnicode=function(r){this.unicodes.length===0&&(this.unicode=r),this.unicodes.push(r)};ga.prototype.getBoundingBox=function(){return this.path.getBoundingBox()};ga.prototype.getPath=function(r,e,t,n,i){r=r!==void 0?r:0,e=e!==void 0?e:0,t=t!==void 0?t:72;var a,s;n||(n={});var o=n.xScale,l=n.yScale;if(n.hinting&&i&&i.hinting&&(s=this.path&&i.hinting.exec(this,t)),s)a=i.hinting.getCommands(s),r=Math.round(r),e=Math.round(e),o=l=1;else{a=this.path.commands;var u=1/(this.path.unitsPerEm||1e3)*t;o===void 0&&(o=u),l===void 0&&(l=u)}for(var c=new fi,f=0;f<a.length;f+=1){var d=a[f];d.type==="M"?c.moveTo(r+d.x*o,e+-d.y*l):d.type==="L"?c.lineTo(r+d.x*o,e+-d.y*l):d.type==="Q"?c.quadraticCurveTo(r+d.x1*o,e+-d.y1*l,r+d.x*o,e+-d.y*l):d.type==="C"?c.curveTo(r+d.x1*o,e+-d.y1*l,r+d.x2*o,e+-d.y2*l,r+d.x*o,e+-d.y*l):d.type==="Z"&&c.closePath()}return c};ga.prototype.getContours=function(){if(this.points===void 0)return[];for(var r=[],e=[],t=0;t<this.points.length;t+=1){var n=this.points[t];e.push(n),n.lastPointOfContour&&(r.push(e),e=[])}return jt.argument(e.length===0,"There are still points left in the current contour."),r};ga.prototype.getMetrics=function(){for(var r=this.path.commands,e=[],t=[],n=0;n<r.length;n+=1){var i=r[n];i.type!=="Z"&&(e.push(i.x),t.push(i.y)),(i.type==="Q"||i.type==="C")&&(e.push(i.x1),t.push(i.y1)),i.type==="C"&&(e.push(i.x2),t.push(i.y2))}var a={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,e),yMax:Math.max.apply(null,t),leftSideBearing:this.leftSideBearing};return isFinite(a.xMin)||(a.xMin=0),isFinite(a.xMax)||(a.xMax=this.advanceWidth),isFinite(a.yMin)||(a.yMin=0),isFinite(a.yMax)||(a.yMax=0),a.rightSideBearing=this.advanceWidth-a.leftSideBearing-(a.xMax-a.xMin),a};ga.prototype.draw=function(r,e,t,n,i){this.getPath(e,t,n,i).draw(r)};ga.prototype.drawPoints=function(r,e,t,n){function i(f,d,h,g){r.beginPath();for(var v=0;v<f.length;v+=1)r.moveTo(d+f[v].x*g,h+f[v].y*g),r.arc(d+f[v].x*g,h+f[v].y*g,2,0,Math.PI*2,!1);r.closePath(),r.fill()}e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:24;for(var a=1/this.path.unitsPerEm*n,s=[],o=[],l=this.path,u=0;u<l.commands.length;u+=1){var c=l.commands[u];c.x!==void 0&&s.push({x:c.x,y:-c.y}),c.x1!==void 0&&o.push({x:c.x1,y:-c.y1}),c.x2!==void 0&&o.push({x:c.x2,y:-c.y2})}r.fillStyle="blue",i(s,e,t,a),r.fillStyle="red",i(o,e,t,a)};ga.prototype.drawMetrics=function(r,e,t,n){var i;e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:24,i=1/this.path.unitsPerEm*n,r.lineWidth=1,r.strokeStyle="black",dl.line(r,e,-1e4,e,1e4),dl.line(r,-1e4,t,1e4,t);var a=this.xMin||0,s=this.yMin||0,o=this.xMax||0,l=this.yMax||0,u=this.advanceWidth||0;r.strokeStyle="blue",dl.line(r,e+a*i,-1e4,e+a*i,1e4),dl.line(r,e+o*i,-1e4,e+o*i,1e4),dl.line(r,-1e4,t+-s*i,1e4,t+-s*i),dl.line(r,-1e4,t+-l*i,1e4,t+-l*i),r.strokeStyle="green",dl.line(r,e+u*i,-1e4,e+u*i,1e4)};function Jh(r,e,t){Object.defineProperty(r,e,{get:function(){return r.path,r[t]},set:function(n){r[t]=n},enumerable:!0,configurable:!0})}function h1(r,e){if(this.font=r,this.glyphs={},Array.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];n.path.unitsPerEm=r.unitsPerEm,this.glyphs[t]=n}this.length=e&&e.length||0}h1.prototype.get=function(r){if(this.glyphs[r]===void 0){this.font._push(r),typeof this.glyphs[r]=="function"&&(this.glyphs[r]=this.glyphs[r]());var e=this.glyphs[r],t=this.font._IndexToUnicodeMap[r];if(t)for(var n=0;n<t.unicodes.length;n++)e.addUnicode(t.unicodes[n]);this.font.cffEncoding?this.font.isCIDFont?e.name="gid"+r:e.name=this.font.cffEncoding.charset[r]:this.font.glyphNames.names&&(e.name=this.font.glyphNames.glyphIndexToName(r)),this.glyphs[r].advanceWidth=this.font._hmtxTableData[r].advanceWidth,this.glyphs[r].leftSideBearing=this.font._hmtxTableData[r].leftSideBearing}else typeof this.glyphs[r]=="function"&&(this.glyphs[r]=this.glyphs[r]());return this.glyphs[r]};h1.prototype.push=function(r,e){this.glyphs[r]=e,this.length++};function T5(r,e){return new ga({index:e,font:r})}function F5(r,e,t,n,i,a){return function(){var s=new ga({index:e,font:r});return s.path=function(){t(s,n,i);var o=a(r.glyphs,s);return o.unitsPerEm=r.unitsPerEm,o},Jh(s,"xMin","_xMin"),Jh(s,"xMax","_xMax"),Jh(s,"yMin","_yMin"),Jh(s,"yMax","_yMax"),s}}function I5(r,e,t,n){return function(){var i=new ga({index:e,font:r});return i.path=function(){var a=t(r,i,n);return a.unitsPerEm=r.unitsPerEm,a},i}}var os={GlyphSet:h1,glyphLoader:T5,ttfGlyphLoader:F5,cffGlyphLoader:I5};function QT(r,e){if(r===e)return!0;if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t+=1)if(!QT(r[t],e[t]))return!1;return!0}else return!1}function Jy(r){var e;return r.length<1240?e=107:r.length<33900?e=1131:e=32768,e}function no(r,e,t){var n=[],i=[],a=vt.getCard16(r,e),s,o;if(a!==0){var l=vt.getByte(r,e+2);s=e+(a+1)*l+2;for(var u=e+3,c=0;c<a+1;c+=1)n.push(vt.getOffset(r,u,l)),u+=l;o=s+n[a]}else o=e+2;for(var f=0;f<n.length-1;f+=1){var d=vt.getBytes(r,s+n[f],s+n[f+1]);t&&(d=t(d)),i.push(d)}return{objects:i,startOffset:e,endOffset:o}}function P5(r,e){var t=[],n=vt.getCard16(r,e),i,a;if(n!==0){var s=vt.getByte(r,e+2);i=e+(n+1)*s+2;for(var o=e+3,l=0;l<n+1;l+=1)t.push(vt.getOffset(r,o,s)),o+=s;a=i+t[n]}else a=e+2;return{offsets:t,startOffset:e,endOffset:a}}function D5(r,e,t,n,i){var a=vt.getCard16(t,n),s=0;if(a!==0){var o=vt.getByte(t,n+2);s=n+(a+1)*o+2}var l=vt.getBytes(t,s+e[r],s+e[r+1]);return l}function R5(r){for(var e="",t=15,n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var i=r.parseByte(),a=i>>4,s=i&15;if(a===t||(e+=n[a],s===t))break;e+=n[s]}return parseFloat(e)}function O5(r,e){var t,n,i,a;if(e===28)return t=r.parseByte(),n=r.parseByte(),t<<8|n;if(e===29)return t=r.parseByte(),n=r.parseByte(),i=r.parseByte(),a=r.parseByte(),t<<24|n<<16|i<<8|a;if(e===30)return R5(r);if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return t=r.parseByte(),(e-247)*256+t+108;if(e>=251&&e<=254)return t=r.parseByte(),-(e-251)*256-t-108;throw new Error("Invalid b0 "+e)}function B5(r){for(var e={},t=0;t<r.length;t+=1){var n=r[t][0],i=r[t][1],a=void 0;if(i.length===1?a=i[0]:a=i,e.hasOwnProperty(n)&&!isNaN(e[n]))throw new Error("Object "+e+" already has key "+n);e[n]=a}return e}function YT(r,e,t){e=e!==void 0?e:0;var n=new vt.Parser(r,e),i=[],a=[];for(t=t!==void 0?t:r.length;n.relativeOffset<t;){var s=n.parseByte();s<=21?(s===12&&(s=1200+n.parseByte()),i.push([s,a]),a=[]):a.push(O5(n,s))}return B5(i)}function Xd(r,e){return e<=390?e=jp[e]:e=r[e-391],e}function XT(r,e,t){for(var n={},i,a=0;a<e.length;a+=1){var s=e[a];if(Array.isArray(s.type)){var o=[];o.length=s.type.length;for(var l=0;l<s.type.length;l++)i=r[s.op]!==void 0?r[s.op][l]:void 0,i===void 0&&(i=s.value!==void 0&&s.value[l]!==void 0?s.value[l]:null),s.type[l]==="SID"&&(i=Xd(t,i)),o[l]=i;n[s.name]=o}else i=r[s.op],i===void 0&&(i=s.value!==void 0?s.value:null),s.type==="SID"&&(i=Xd(t,i)),n[s.name]=i}return n}function M5(r,e){var t={};return t.formatMajor=vt.getCard8(r,e),t.formatMinor=vt.getCard8(r,e+1),t.size=vt.getCard8(r,e+2),t.offsetSize=vt.getCard8(r,e+3),t.startOffset=e,t.endOffset=e+4,t}var JT=[{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"}],KT=[{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 _5(r,e){var t=YT(r,0,r.byteLength);return XT(t,JT,e)}function ZT(r,e,t,n){var i=YT(r,e,t);return XT(i,KT,n)}function ux(r,e,t,n){for(var i=[],a=0;a<t.length;a+=1){var s=new DataView(new Uint8Array(t[a]).buffer),o=_5(s,n);o._subrs=[],o._subrsBias=0,o._defaultWidthX=0,o._nominalWidthX=0;var l=o.private[0],u=o.private[1];if(l!==0&&u!==0){var c=ZT(r,u+e,l,n);if(o._defaultWidthX=c.defaultWidthX,o._nominalWidthX=c.nominalWidthX,c.subrs!==0){var f=u+c.subrs,d=no(r,f+e);o._subrs=d.objects,o._subrsBias=Jy(o._subrs)}o._privateDict=c}i.push(o)}return i}function N5(r,e,t,n){var i,a,s=new vt.Parser(r,e);t-=1;var o=[".notdef"],l=s.parseCard8();if(l===0)for(var u=0;u<t;u+=1)i=s.parseSID(),o.push(Xd(n,i));else if(l===1)for(;o.length<=t;){i=s.parseSID(),a=s.parseCard8();for(var c=0;c<=a;c+=1)o.push(Xd(n,i)),i+=1}else if(l===2)for(;o.length<=t;){i=s.parseSID(),a=s.parseCard16();for(var f=0;f<=a;f+=1)o.push(Xd(n,i)),i+=1}else throw new Error("Unknown charset format "+l);return o}function L5(r,e,t){var n,i={},a=new vt.Parser(r,e),s=a.parseCard8();if(s===0)for(var o=a.parseCard8(),l=0;l<o;l+=1)n=a.parseCard8(),i[n]=l;else if(s===1){var u=a.parseCard8();n=1;for(var c=0;c<u;c+=1)for(var f=a.parseCard8(),d=a.parseCard8(),h=f;h<=f+d;h+=1)i[h]=n,n+=1}else throw new Error("Unknown encoding format "+s);return new dg(i,t)}function cx(r,e,t){var n,i,a,s,o=new fi,l=[],u=0,c=!1,f=!1,d=0,h=0,g,v,y,A;if(r.isCIDFont){var C=r.tables.cff.topDict._fdSelect[e.index],S=r.tables.cff.topDict._fdArray[C];g=S._subrs,v=S._subrsBias,y=S._defaultWidthX,A=S._nominalWidthX}else g=r.tables.cff.topDict._subrs,v=r.tables.cff.topDict._subrsBias,y=r.tables.cff.topDict._defaultWidthX,A=r.tables.cff.topDict._nominalWidthX;var F=y;function E(j,G){f&&o.closePath(),o.moveTo(j,G),f=!0}function R(){var j;j=l.length%2!==0,j&&!c&&(F=l.shift()+A),u+=l.length>>1,l.length=0,c=!0}function B(j){for(var G,ie,q,Y,J,ae,oe,he,ye,Ue,Re,Oe,ee=0;ee<j.length;){var re=j[ee];switch(ee+=1,re){case 1:R();break;case 3:R();break;case 4:l.length>1&&!c&&(F=l.shift()+A,c=!0),h+=l.pop(),E(d,h);break;case 5:for(;l.length>0;)d+=l.shift(),h+=l.shift(),o.lineTo(d,h);break;case 6:for(;l.length>0&&(d+=l.shift(),o.lineTo(d,h),l.length!==0);)h+=l.shift(),o.lineTo(d,h);break;case 7:for(;l.length>0&&(h+=l.shift(),o.lineTo(d,h),l.length!==0);)d+=l.shift(),o.lineTo(d,h);break;case 8:for(;l.length>0;)n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+l.shift(),o.curveTo(n,i,a,s,d,h);break;case 10:J=l.pop()+v,ae=g[J],ae&&B(ae);break;case 11:return;case 12:switch(re=j[ee],ee+=1,re){case 35:n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),oe=a+l.shift(),he=s+l.shift(),ye=oe+l.shift(),Ue=he+l.shift(),Re=ye+l.shift(),Oe=Ue+l.shift(),d=Re+l.shift(),h=Oe+l.shift(),l.shift(),o.curveTo(n,i,a,s,oe,he),o.curveTo(ye,Ue,Re,Oe,d,h);break;case 34:n=d+l.shift(),i=h,a=n+l.shift(),s=i+l.shift(),oe=a+l.shift(),he=s,ye=oe+l.shift(),Ue=s,Re=ye+l.shift(),Oe=h,d=Re+l.shift(),o.curveTo(n,i,a,s,oe,he),o.curveTo(ye,Ue,Re,Oe,d,h);break;case 36:n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),oe=a+l.shift(),he=s,ye=oe+l.shift(),Ue=s,Re=ye+l.shift(),Oe=Ue+l.shift(),d=Re+l.shift(),o.curveTo(n,i,a,s,oe,he),o.curveTo(ye,Ue,Re,Oe,d,h);break;case 37:n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),oe=a+l.shift(),he=s+l.shift(),ye=oe+l.shift(),Ue=he+l.shift(),Re=ye+l.shift(),Oe=Ue+l.shift(),Math.abs(Re-d)>Math.abs(Oe-h)?d=Re+l.shift():h=Oe+l.shift(),o.curveTo(n,i,a,s,oe,he),o.curveTo(ye,Ue,Re,Oe,d,h);break;default:console.log("Glyph "+e.index+": unknown operator 1200"+re),l.length=0}break;case 14:l.length>0&&!c&&(F=l.shift()+A,c=!0),f&&(o.closePath(),f=!1);break;case 18:R();break;case 19:case 20:R(),ee+=u+7>>3;break;case 21:l.length>2&&!c&&(F=l.shift()+A,c=!0),h+=l.pop(),d+=l.pop(),E(d,h);break;case 22:l.length>1&&!c&&(F=l.shift()+A,c=!0),d+=l.pop(),E(d,h);break;case 23:R();break;case 24:for(;l.length>2;)n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+l.shift(),o.curveTo(n,i,a,s,d,h);d+=l.shift(),h+=l.shift(),o.lineTo(d,h);break;case 25:for(;l.length>6;)d+=l.shift(),h+=l.shift(),o.lineTo(d,h);n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+l.shift(),o.curveTo(n,i,a,s,d,h);break;case 26:for(l.length%2&&(d+=l.shift());l.length>0;)n=d,i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a,h=s+l.shift(),o.curveTo(n,i,a,s,d,h);break;case 27:for(l.length%2&&(h+=l.shift());l.length>0;)n=d+l.shift(),i=h,a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s,o.curveTo(n,i,a,s,d,h);break;case 28:G=j[ee],ie=j[ee+1],l.push((G<<24|ie<<16)>>16),ee+=2;break;case 29:J=l.pop()+r.gsubrsBias,ae=r.gsubrs[J],ae&&B(ae);break;case 30:for(;l.length>0&&(n=d,i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+(l.length===1?l.shift():0),o.curveTo(n,i,a,s,d,h),l.length!==0);)n=d+l.shift(),i=h,a=n+l.shift(),s=i+l.shift(),h=s+l.shift(),d=a+(l.length===1?l.shift():0),o.curveTo(n,i,a,s,d,h);break;case 31:for(;l.length>0&&(n=d+l.shift(),i=h,a=n+l.shift(),s=i+l.shift(),h=s+l.shift(),d=a+(l.length===1?l.shift():0),o.curveTo(n,i,a,s,d,h),l.length!==0);)n=d,i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+(l.length===1?l.shift():0),o.curveTo(n,i,a,s,d,h);break;default:re<32?console.log("Glyph "+e.index+": unknown operator "+re):re<247?l.push(re-139):re<251?(G=j[ee],ee+=1,l.push((re-247)*256+G+108)):re<255?(G=j[ee],ee+=1,l.push(-(re-251)*256-G-108)):(G=j[ee],ie=j[ee+1],q=j[ee+2],Y=j[ee+3],ee+=4,l.push((G<<24|ie<<16|q<<8|Y)/65536))}}}return B(t),e.advanceWidth=F,o}function U5(r,e,t,n){var i=[],a,s=new vt.Parser(r,e),o=s.parseCard8();if(o===0)for(var l=0;l<t;l++){if(a=s.parseCard8(),a>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+n+")");i.push(a)}else if(o===3){var u=s.parseCard16(),c=s.parseCard16();if(c!==0)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+c);for(var f,d=0;d<u;d++){if(a=s.parseCard8(),f=s.parseCard16(),a>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+n+")");if(f>t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+f);for(;c<f;c++)i.push(a);c=f}if(f!==t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+f)}else throw new Error("CFF Table CID Font FDSelect table has unsupported format "+o);return i}function V5(r,e,t,n){t.tables.cff={};var i=M5(r,e),a=no(r,i.endOffset,vt.bytesToString),s=no(r,a.endOffset),o=no(r,s.endOffset,vt.bytesToString),l=no(r,o.endOffset);t.gsubrs=l.objects,t.gsubrsBias=Jy(t.gsubrs);var u=ux(r,e,s.objects,o.objects);if(u.length!==1)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+u.length);var c=u[0];if(t.tables.cff.topDict=c,c._privateDict&&(t.defaultWidthX=c._privateDict.defaultWidthX,t.nominalWidthX=c._privateDict.nominalWidthX),c.ros[0]!==void 0&&c.ros[1]!==void 0&&(t.isCIDFont=!0),t.isCIDFont){var f=c.fdArray,d=c.fdSelect;if(f===0||d===0)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");f+=e;var h=no(r,f),g=ux(r,e,h.objects,o.objects);c._fdArray=g,d+=e,c._fdSelect=U5(r,d,t.numGlyphs,g.length)}var v=e+c.private[1],y=ZT(r,v,c.private[0],o.objects);if(t.defaultWidthX=y.defaultWidthX,t.nominalWidthX=y.nominalWidthX,y.subrs!==0){var A=v+y.subrs,C=no(r,A);t.subrs=C.objects,t.subrsBias=Jy(t.subrs)}else t.subrs=[],t.subrsBias=0;var S;n.lowMemory?(S=P5(r,e+c.charStrings),t.nGlyphs=S.offsets.length):(S=no(r,e+c.charStrings),t.nGlyphs=S.objects.length);var F=N5(r,e+c.charset,t.nGlyphs,o.objects);if(c.encoding===0?t.cffEncoding=new dg(b5,F):c.encoding===1?t.cffEncoding=new dg(w5,F):t.cffEncoding=L5(r,e+c.encoding,F),t.encoding=t.encoding||t.cffEncoding,t.glyphs=new os.GlyphSet(t),n.lowMemory)t._push=function(B){var j=D5(B,S.offsets,r,e+c.charStrings);t.glyphs.push(B,os.cffGlyphLoader(t,B,cx,j))};else for(var E=0;E<t.nGlyphs;E+=1){var R=S.objects[E];t.glyphs.push(E,os.cffGlyphLoader(t,E,cx,R))}}function eF(r,e){var t,n=jp.indexOf(r);return n>=0&&(t=n),n=e.indexOf(r),n>=0?t=n+jp.length:(t=jp.length+e.length,e.push(r)),t}function z5(){return new dt.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function $5(r){var e=new dt.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);e.names=[];for(var t=0;t<r.length;t+=1)e.names.push({name:"name_"+t,type:"NAME",value:r[t]});return e}function tF(r,e,t){for(var n={},i=0;i<r.length;i+=1){var a=r[i],s=e[a.name];s!==void 0&&!QT(s,a.value)&&(a.type==="SID"&&(s=eF(s,t)),n[a.op]={name:a.name,type:a.type,value:s})}return n}function dx(r,e){var t=new dt.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=tF(JT,r,e),t}function fx(r){var e=new dt.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return e.topDicts=[{name:"topDict_0",type:"TABLE",value:r}],e}function H5(r){var e=new dt.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);e.strings=[];for(var t=0;t<r.length;t+=1)e.strings.push({name:"string_"+t,type:"STRING",value:r[t]});return e}function j5(){return new dt.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function G5(r,e){for(var t=new dt.Record("Charsets",[{name:"format",type:"Card8",value:0}]),n=0;n<r.length;n+=1){var i=r[n],a=eF(i,e);t.fields.push({name:"glyph_"+n,type:"SID",value:a})}return t}function q5(r){var e=[],t=r.path;e.push({name:"width",type:"NUMBER",value:r.advanceWidth});for(var n=0,i=0,a=0;a<t.commands.length;a+=1){var s=void 0,o=void 0,l=t.commands[a];if(l.type==="Q"){var u=.3333333333333333,c=2/3;l={type:"C",x:l.x,y:l.y,x1:Math.round(u*n+c*l.x1),y1:Math.round(u*i+c*l.y1),x2:Math.round(u*l.x+c*l.x1),y2:Math.round(u*l.y+c*l.y1)}}if(l.type==="M")s=Math.round(l.x-n),o=Math.round(l.y-i),e.push({name:"dx",type:"NUMBER",value:s}),e.push({name:"dy",type:"NUMBER",value:o}),e.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(l.x),i=Math.round(l.y);else if(l.type==="L")s=Math.round(l.x-n),o=Math.round(l.y-i),e.push({name:"dx",type:"NUMBER",value:s}),e.push({name:"dy",type:"NUMBER",value:o}),e.push({name:"rlineto",type:"OP",value:5}),n=Math.round(l.x),i=Math.round(l.y);else if(l.type==="C"){var f=Math.round(l.x1-n),d=Math.round(l.y1-i),h=Math.round(l.x2-l.x1),g=Math.round(l.y2-l.y1);s=Math.round(l.x-l.x2),o=Math.round(l.y-l.y2),e.push({name:"dx1",type:"NUMBER",value:f}),e.push({name:"dy1",type:"NUMBER",value:d}),e.push({name:"dx2",type:"NUMBER",value:h}),e.push({name:"dy2",type:"NUMBER",value:g}),e.push({name:"dx",type:"NUMBER",value:s}),e.push({name:"dy",type:"NUMBER",value:o}),e.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(l.x),i=Math.round(l.y)}}return e.push({name:"endchar",type:"OP",value:14}),e}function W5(r){for(var e=new dt.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),t=0;t<r.length;t+=1){var n=r.get(t),i=q5(n);e.charStrings.push({name:n.name,type:"CHARSTRING",value:i})}return e}function Q5(r,e){var t=new dt.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=tF(KT,r,e),t}function Y5(r,e){for(var t=new dt.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),n=1/e.unitsPerEm,i={version:e.version,fullName:e.fullName,familyName:e.familyName,weight:e.weightName,fontBBox:e.fontBBox||[0,0,0,0],fontMatrix:[n,0,0,n,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},a={},s=[],o,l=1;l<r.length;l+=1)o=r.get(l),s.push(o.name);var u=[];t.header=z5(),t.nameIndex=$5([e.postScriptName]);var c=dx(i,u);t.topDictIndex=fx(c),t.globalSubrIndex=j5(),t.charsets=G5(s,u),t.charStringsIndex=W5(r),t.privateDict=Q5(a,u),t.stringIndex=H5(u);var f=t.header.sizeOf()+t.nameIndex.sizeOf()+t.topDictIndex.sizeOf()+t.stringIndex.sizeOf()+t.globalSubrIndex.sizeOf();return i.charset=f,i.encoding=0,i.charStrings=i.charset+t.charsets.sizeOf(),i.private[1]=i.charStrings+t.charStringsIndex.sizeOf(),c=dx(i,u),t.topDictIndex=fx(c),t}var rF={parse:V5,make:Y5};function X5(r,e){var t={},n=new vt.Parser(r,e);return t.version=n.parseVersion(),t.fontRevision=Math.round(n.parseFixed()*1e3)/1e3,t.checkSumAdjustment=n.parseULong(),t.magicNumber=n.parseULong(),jt.argument(t.magicNumber===1594834165,"Font header has wrong magic number."),t.flags=n.parseUShort(),t.unitsPerEm=n.parseUShort(),t.created=n.parseLongDateTime(),t.modified=n.parseLongDateTime(),t.xMin=n.parseShort(),t.yMin=n.parseShort(),t.xMax=n.parseShort(),t.yMax=n.parseShort(),t.macStyle=n.parseUShort(),t.lowestRecPPEM=n.parseUShort(),t.fontDirectionHint=n.parseShort(),t.indexToLocFormat=n.parseShort(),t.glyphDataFormat=n.parseShort(),t}function J5(r){var e=Math.round(new Date().getTime()/1e3)+2082844800,t=e;return r.createdTimestamp&&(t=r.createdTimestamp+2082844800),new dt.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:t},{name:"modified",type:"LONGDATETIME",value:e},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],r)}var nF={parse:X5,make:J5};function K5(r,e){var t={},n=new vt.Parser(r,e);return t.version=n.parseVersion(),t.ascender=n.parseShort(),t.descender=n.parseShort(),t.lineGap=n.parseShort(),t.advanceWidthMax=n.parseUShort(),t.minLeftSideBearing=n.parseShort(),t.minRightSideBearing=n.parseShort(),t.xMaxExtent=n.parseShort(),t.caretSlopeRise=n.parseShort(),t.caretSlopeRun=n.parseShort(),t.caretOffset=n.parseShort(),n.relativeOffset+=8,t.metricDataFormat=n.parseShort(),t.numberOfHMetrics=n.parseUShort(),t}function Z5(r){return new dt.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],r)}var iF={parse:K5,make:Z5};function eN(r,e,t,n,i){for(var a,s,o=new vt.Parser(r,e),l=0;l<n;l+=1){l<t&&(a=o.parseUShort(),s=o.parseShort());var u=i.get(l);u.advanceWidth=a,u.leftSideBearing=s}}function tN(r,e,t,n,i){r._hmtxTableData={};for(var a,s,o=new vt.Parser(e,t),l=0;l<i;l+=1)l<n&&(a=o.parseUShort(),s=o.parseShort()),r._hmtxTableData[l]={advanceWidth:a,leftSideBearing:s}}function rN(r,e,t,n,i,a,s){s.lowMemory?tN(r,e,t,n,i):eN(e,t,n,i,a)}function nN(r){for(var e=new dt.Table("hmtx",[]),t=0;t<r.length;t+=1){var n=r.get(t),i=n.advanceWidth||0,a=n.leftSideBearing||0;e.fields.push({name:"advanceWidth_"+t,type:"USHORT",value:i}),e.fields.push({name:"leftSideBearing_"+t,type:"SHORT",value:a})}return e}var aF={parse:rN,make:nN};function iN(r){for(var e=new dt.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:r.length}]),t="",n=12+r.length*4,i=0;i<r.length;++i){var a=t.indexOf(r[i]);a<0&&(a=t.length,t+=r[i]),e.fields.push({name:"offset "+i,type:"USHORT",value:n+a}),e.fields.push({name:"length "+i,type:"USHORT",value:r[i].length})}return e.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),e}function aN(r,e){var t=new vt.Parser(r,e),n=t.parseULong();jt.argument(n===1,"Unsupported ltag table version."),t.skip("uLong",1);for(var i=t.parseULong(),a=[],s=0;s<i;s++){for(var o="",l=e+t.parseUShort(),u=t.parseUShort(),c=l;c<l+u;++c)o+=String.fromCharCode(r.getInt8(c));a.push(o)}return a}var sF={make:iN,parse:aN};function sN(r,e){var t={},n=new vt.Parser(r,e);return t.version=n.parseVersion(),t.numGlyphs=n.parseUShort(),t.version===1&&(t.maxPoints=n.parseUShort(),t.maxContours=n.parseUShort(),t.maxCompositePoints=n.parseUShort(),t.maxCompositeContours=n.parseUShort(),t.maxZones=n.parseUShort(),t.maxTwilightPoints=n.parseUShort(),t.maxStorage=n.parseUShort(),t.maxFunctionDefs=n.parseUShort(),t.maxInstructionDefs=n.parseUShort(),t.maxStackElements=n.parseUShort(),t.maxSizeOfInstructions=n.parseUShort(),t.maxComponentElements=n.parseUShort(),t.maxComponentDepth=n.parseUShort()),t}function oN(r){return new dt.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:r}])}var oF={parse:sN,make:oN},lF=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],uF={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"},lN={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},cF={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 uN(r,e,t){switch(r){case 0:if(e===65535)return"und";if(t)return t[e];break;case 1:return uF[e];case 3:return cF[e]}}var Ky="utf-16",cN={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"},dN={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 dF(r,e,t){switch(r){case 0:return Ky;case 1:return dN[t]||cN[e];case 3:if(e===1||e===10)return Ky;break}}function fN(r,e,t){for(var n={},i=new vt.Parser(r,e),a=i.parseUShort(),s=i.parseUShort(),o=i.offset+i.parseUShort(),l=0;l<s;l++){var u=i.parseUShort(),c=i.parseUShort(),f=i.parseUShort(),d=i.parseUShort(),h=lF[d]||d,g=i.parseUShort(),v=i.parseUShort(),y=uN(u,f,t),A=dF(u,c,f);if(A!==void 0&&y!==void 0){var C=void 0;if(A===Ky?C=nc.UTF16(r,o+v,g):C=nc.MACSTRING(r,o+v,g,A),C){var S=n[h];S===void 0&&(S=n[h]={}),S[y]=C}}}return a===1&&i.parseUShort(),n}function F0(r){var e={};for(var t in r)e[r[t]]=parseInt(t);return e}function hx(r,e,t,n,i,a){return new dt.Record("NameRecord",[{name:"platformID",type:"USHORT",value:r},{name:"encodingID",type:"USHORT",value:e},{name:"languageID",type:"USHORT",value:t},{name:"nameID",type:"USHORT",value:n},{name:"length",type:"USHORT",value:i},{name:"offset",type:"USHORT",value:a}])}function hN(r,e){var t=r.length,n=e.length-t+1;e:for(var i=0;i<n;i++)for(;i<n;i++){for(var a=0;a<t;a++)if(e[i+a]!==r[a])continue e;return i}return-1}function px(r,e){var t=hN(r,e);if(t<0){t=e.length;for(var n=0,i=r.length;n<i;++n)e.push(r[n])}return t}function pN(r,e){var t,n=[],i={},a=F0(lF);for(var s in r){var o=a[s];if(o===void 0&&(o=s),t=parseInt(o),isNaN(t))throw new Error('Name table entry "'+s+'" does not exist, see nameTableNames for complete list.');i[t]=r[s],n.push(t)}for(var l=F0(uF),u=F0(cF),c=[],f=[],d=0;d<n.length;d++){t=n[d];var h=i[t];for(var g in h){var v=h[g],y=1,A=l[g],C=lN[A],S=dF(y,C,A),F=it.MACSTRING(v,S);F===void 0&&(y=0,A=e.indexOf(g),A<0&&(A=e.length,e.push(g)),C=4,F=it.UTF16(v));var E=px(F,f);c.push(hx(y,C,A,t,F.length,E));var R=u[g];if(R!==void 0){var B=it.UTF16(v),j=px(B,f);c.push(hx(3,1,R,t,B.length,j))}}}c.sort(function(q,Y){return q.platformID-Y.platformID||q.encodingID-Y.encodingID||q.languageID-Y.languageID||q.nameID-Y.nameID});for(var G=new dt.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:c.length},{name:"stringOffset",type:"USHORT",value:6+c.length*12}]),ie=0;ie<c.length;ie++)G.fields.push({name:"record_"+ie,type:"RECORD",value:c[ie]});return G.fields.push({name:"strings",type:"LITERAL",value:f}),G}var fF={parse:fN,make:pN},Zy=[{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 gN(r){for(var e=0;e<Zy.length;e+=1){var t=Zy[e];if(r>=t.begin&&r<t.end)return e}return-1}function mN(r,e){var t={},n=new vt.Parser(r,e);t.version=n.parseUShort(),t.xAvgCharWidth=n.parseShort(),t.usWeightClass=n.parseUShort(),t.usWidthClass=n.parseUShort(),t.fsType=n.parseUShort(),t.ySubscriptXSize=n.parseShort(),t.ySubscriptYSize=n.parseShort(),t.ySubscriptXOffset=n.parseShort(),t.ySubscriptYOffset=n.parseShort(),t.ySuperscriptXSize=n.parseShort(),t.ySuperscriptYSize=n.parseShort(),t.ySuperscriptXOffset=n.parseShort(),t.ySuperscriptYOffset=n.parseShort(),t.yStrikeoutSize=n.parseShort(),t.yStrikeoutPosition=n.parseShort(),t.sFamilyClass=n.parseShort(),t.panose=[];for(var i=0;i<10;i++)t.panose[i]=n.parseByte();return t.ulUnicodeRange1=n.parseULong(),t.ulUnicodeRange2=n.parseULong(),t.ulUnicodeRange3=n.parseULong(),t.ulUnicodeRange4=n.parseULong(),t.achVendID=String.fromCharCode(n.parseByte(),n.parseByte(),n.parseByte(),n.parseByte()),t.fsSelection=n.parseUShort(),t.usFirstCharIndex=n.parseUShort(),t.usLastCharIndex=n.parseUShort(),t.sTypoAscender=n.parseShort(),t.sTypoDescender=n.parseShort(),t.sTypoLineGap=n.parseShort(),t.usWinAscent=n.parseUShort(),t.usWinDescent=n.parseUShort(),t.version>=1&&(t.ulCodePageRange1=n.parseULong(),t.ulCodePageRange2=n.parseULong()),t.version>=2&&(t.sxHeight=n.parseShort(),t.sCapHeight=n.parseShort(),t.usDefaultChar=n.parseUShort(),t.usBreakChar=n.parseUShort(),t.usMaxContent=n.parseUShort()),t}function vN(r){return new dt.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],r)}var eA={parse:mN,make:vN,unicodeRanges:Zy,getUnicodeRange:gN};function yN(r,e){var t={},n=new vt.Parser(r,e);switch(t.version=n.parseVersion(),t.italicAngle=n.parseFixed(),t.underlinePosition=n.parseShort(),t.underlineThickness=n.parseShort(),t.isFixedPitch=n.parseULong(),t.minMemType42=n.parseULong(),t.maxMemType42=n.parseULong(),t.minMemType1=n.parseULong(),t.maxMemType1=n.parseULong(),t.version){case 1:t.names=ml.slice();break;case 2:t.numberOfGlyphs=n.parseUShort(),t.glyphNameIndex=new Array(t.numberOfGlyphs);for(var i=0;i<t.numberOfGlyphs;i++)t.glyphNameIndex[i]=n.parseUShort();t.names=[];for(var a=0;a<t.numberOfGlyphs;a++)if(t.glyphNameIndex[a]>=ml.length){var s=n.parseChar();t.names.push(n.parseString(s))}break;case 2.5:t.numberOfGlyphs=n.parseUShort(),t.offset=new Array(t.numberOfGlyphs);for(var o=0;o<t.numberOfGlyphs;o++)t.offset[o]=n.parseChar();break}return t}function AN(){return new dt.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}var hF={parse:yN,make:AN},Da=new Array(9);Da[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(we.coverage),deltaGlyphId:this.parseUShort()};if(t===2)return{substFormat:2,coverage:this.parsePointer(we.coverage),substitute:this.parseOffset16List()};jt.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")};Da[2]=function(){var e=this.parseUShort();return jt.argument(e===1,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(we.coverage),sequences:this.parseListOfLists()}};Da[3]=function(){var e=this.parseUShort();return jt.argument(e===1,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(we.coverage),alternateSets:this.parseListOfLists()}};Da[4]=function(){var e=this.parseUShort();return jt.argument(e===1,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(we.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var Hu={sequenceIndex:we.uShort,lookupListIndex:we.uShort};Da[5]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:t,coverage:this.parsePointer(we.coverage),ruleSets:this.parseListOfLists(function(){var a=this.parseUShort(),s=this.parseUShort();return{input:this.parseUShortList(a-1),lookupRecords:this.parseRecordList(s,Hu)}})};if(t===2)return{substFormat:t,coverage:this.parsePointer(we.coverage),classDef:this.parsePointer(we.classDef),classSets:this.parseListOfLists(function(){var a=this.parseUShort(),s=this.parseUShort();return{classes:this.parseUShortList(a-1),lookupRecords:this.parseRecordList(s,Hu)}})};if(t===3){var n=this.parseUShort(),i=this.parseUShort();return{substFormat:t,coverages:this.parseList(n,we.pointer(we.coverage)),lookupRecords:this.parseRecordList(i,Hu)}}jt.assert(!1,"0x"+e.toString(16)+": lookup type 5 format must be 1, 2 or 3.")};Da[6]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(we.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Hu)}})};if(t===2)return{substFormat:2,coverage:this.parsePointer(we.coverage),backtrackClassDef:this.parsePointer(we.classDef),inputClassDef:this.parsePointer(we.classDef),lookaheadClassDef:this.parsePointer(we.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Hu)}})};if(t===3)return{substFormat:3,backtrackCoverage:this.parseList(we.pointer(we.coverage)),inputCoverage:this.parseList(we.pointer(we.coverage)),lookaheadCoverage:this.parseList(we.pointer(we.coverage)),lookupRecords:this.parseRecordList(Hu)};jt.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")};Da[7]=function(){var e=this.parseUShort();jt.argument(e===1,"GSUB Extension Substitution subtable identifier-format must be 1");var t=this.parseUShort(),n=new we(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:Da[t].call(n)}};Da[8]=function(){var e=this.parseUShort();return jt.argument(e===1,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(we.coverage),backtrackCoverage:this.parseList(we.pointer(we.coverage)),lookaheadCoverage:this.parseList(we.pointer(we.coverage)),substitutes:this.parseUShortList()}};function bN(r,e){e=e||0;var t=new we(r,e),n=t.parseVersion(1);return jt.argument(n===1||n===1.1,"Unsupported GSUB table version."),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(Da)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(Da),variations:t.parseFeatureVariationsList()}}var gc=new Array(9);gc[1]=function(e){return e.substFormat===1?new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)},{name:"deltaGlyphID",type:"USHORT",value:e.deltaGlyphId}]):new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.ushortList("substitute",e.substitute)))};gc[2]=function(e){return jt.assert(e.substFormat===1,"Lookup type 2 substFormat must be 1."),new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.tableList("seqSet",e.sequences,function(t){return new dt.Table("sequenceSetTable",dt.ushortList("sequence",t))})))};gc[3]=function(e){return jt.assert(e.substFormat===1,"Lookup type 3 substFormat must be 1."),new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.tableList("altSet",e.alternateSets,function(t){return new dt.Table("alternateSetTable",dt.ushortList("alternate",t))})))};gc[4]=function(e){return jt.assert(e.substFormat===1,"Lookup type 4 substFormat must be 1."),new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.tableList("ligSet",e.ligatureSets,function(t){return new dt.Table("ligatureSetTable",dt.tableList("ligature",t,function(n){return new dt.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:n.ligGlyph}].concat(dt.ushortList("component",n.components,n.components.length+1)))}))})))};gc[6]=function(e){if(e.substFormat===1){var t=new dt.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.tableList("chainRuleSet",e.chainRuleSets,function(a){return new dt.Table("chainRuleSetTable",dt.tableList("chainRule",a,function(s){var o=dt.ushortList("backtrackGlyph",s.backtrack,s.backtrack.length).concat(dt.ushortList("inputGlyph",s.input,s.input.length+1)).concat(dt.ushortList("lookaheadGlyph",s.lookahead,s.lookahead.length)).concat(dt.ushortList("substitution",[],s.lookupRecords.length));return s.lookupRecords.forEach(function(l,u){o=o.concat({name:"sequenceIndex"+u,type:"USHORT",value:l.sequenceIndex}).concat({name:"lookupListIndex"+u,type:"USHORT",value:l.lookupListIndex})}),new dt.Table("chainRuleTable",o)}))})));return t}else if(e.substFormat===2)jt.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(e.substFormat===3){var n=[{name:"substFormat",type:"USHORT",value:e.substFormat}];n.push({name:"backtrackGlyphCount",type:"USHORT",value:e.backtrackCoverage.length}),e.backtrackCoverage.forEach(function(a,s){n.push({name:"backtrackCoverage"+s,type:"TABLE",value:new dt.Coverage(a)})}),n.push({name:"inputGlyphCount",type:"USHORT",value:e.inputCoverage.length}),e.inputCoverage.forEach(function(a,s){n.push({name:"inputCoverage"+s,type:"TABLE",value:new dt.Coverage(a)})}),n.push({name:"lookaheadGlyphCount",type:"USHORT",value:e.lookaheadCoverage.length}),e.lookaheadCoverage.forEach(function(a,s){n.push({name:"lookaheadCoverage"+s,type:"TABLE",value:new dt.Coverage(a)})}),n.push({name:"substitutionCount",type:"USHORT",value:e.lookupRecords.length}),e.lookupRecords.forEach(function(a,s){n=n.concat({name:"sequenceIndex"+s,type:"USHORT",value:a.sequenceIndex}).concat({name:"lookupListIndex"+s,type:"USHORT",value:a.lookupListIndex})});var i=new dt.Table("chainContextTable",n);return i}jt.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};function wN(r){return new dt.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new dt.ScriptList(r.scripts)},{name:"features",type:"TABLE",value:new dt.FeatureList(r.features)},{name:"lookups",type:"TABLE",value:new dt.LookupList(r.lookups,gc)}])}var pF={parse:bN,make:wN};function CN(r,e){var t=new vt.Parser(r,e),n=t.parseULong();jt.argument(n===1,"Unsupported META table version."),t.parseULong(),t.parseULong();for(var i=t.parseULong(),a={},s=0;s<i;s++){var o=t.parseTag(),l=t.parseULong(),u=t.parseULong(),c=nc.UTF8(r,e+l,u);a[o]=c}return a}function xN(r){var e=Object.keys(r).length,t="",n=16+e*12,i=new dt.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:n},{name:"numTags",type:"ULONG",value:e}]);for(var a in r){var s=t.length;t+=r[a],i.fields.push({name:"tag "+a,type:"TAG",value:a}),i.fields.push({name:"offset "+a,type:"ULONG",value:n+s}),i.fields.push({name:"length "+a,type:"ULONG",value:r[a].length})}return i.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),i}var gF={parse:CN,make:xN};function gx(r){return Math.log(r)/Math.log(2)|0}function p1(r){for(;r.length%4!==0;)r.push(0);for(var e=0,t=0;t<r.length;t+=4)e+=(r[t]<<24)+(r[t+1]<<16)+(r[t+2]<<8)+r[t+3];return e%=Math.pow(2,32),e}function mx(r,e,t,n){return new dt.Record("Table Record",[{name:"tag",type:"TAG",value:r!==void 0?r:""},{name:"checkSum",type:"ULONG",value:e!==void 0?e:0},{name:"offset",type:"ULONG",value:t!==void 0?t:0},{name:"length",type:"ULONG",value:n!==void 0?n:0}])}function mF(r){var e=new dt.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);e.tables=r,e.numTables=r.length;var t=Math.pow(2,gx(e.numTables));e.searchRange=16*t,e.entrySelector=gx(t),e.rangeShift=e.numTables*16-e.searchRange;for(var n=[],i=[],a=e.sizeOf()+mx().sizeOf()*e.numTables;a%4!==0;)a+=1,i.push({name:"padding",type:"BYTE",value:0});for(var s=0;s<r.length;s+=1){var o=r[s];jt.argument(o.tableName.length===4,"Table name"+o.tableName+" is invalid.");var l=o.sizeOf(),u=mx(o.tableName,p1(o.encode()),a,l);for(n.push({name:u.tag+" Table Record",type:"RECORD",value:u}),i.push({name:o.tableName+" table",type:"RECORD",value:o}),a+=l,jt.argument(!isNaN(a),"Something went wrong calculating the offset.");a%4!==0;)a+=1,i.push({name:"padding",type:"BYTE",value:0})}return n.sort(function(c,f){return c.value.tag>f.value.tag?1:-1}),e.fields=e.fields.concat(n),e.fields=e.fields.concat(i),e}function vx(r,e,t){for(var n=0;n<e.length;n+=1){var i=r.charToGlyphIndex(e[n]);if(i>0){var a=r.glyphs.get(i);return a.getMetrics()}}return t}function SN(r){for(var e=0,t=0;t<r.length;t+=1)e+=r[t];return e/r.length}function EN(r){for(var e=[],t=[],n=[],i=[],a=[],s=[],o=[],l,u=0,c=0,f=0,d=0,h=0,g=0;g<r.glyphs.length;g+=1){var v=r.glyphs.get(g),y=v.unicode|0;if(isNaN(v.advanceWidth))throw new Error("Glyph "+v.name+" ("+g+"): advanceWidth is not a number.");(l>y||l===void 0)&&y>0&&(l=y),u<y&&(u=y);var A=eA.getUnicodeRange(y);if(A<32)c|=1<<A;else if(A<64)f|=1<<A-32;else if(A<96)d|=1<<A-64;else if(A<123)h|=1<<A-96;else throw new Error("Unicode ranges bits > 123 are reserved for internal usage");if(v.name!==".notdef"){var C=v.getMetrics();e.push(C.xMin),t.push(C.yMin),n.push(C.xMax),i.push(C.yMax),s.push(C.leftSideBearing),o.push(C.rightSideBearing),a.push(v.advanceWidth)}}var S={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,n),yMax:Math.max.apply(null,i),advanceWidthMax:Math.max.apply(null,a),advanceWidthAvg:SN(a),minLeftSideBearing:Math.min.apply(null,s),maxLeftSideBearing:Math.max.apply(null,s),minRightSideBearing:Math.min.apply(null,o)};S.ascender=r.ascender,S.descender=r.descender;var F=nF.make({flags:3,unitsPerEm:r.unitsPerEm,xMin:S.xMin,yMin:S.yMin,xMax:S.xMax,yMax:S.yMax,lowestRecPPEM:3,createdTimestamp:r.createdTimestamp}),E=iF.make({ascender:S.ascender,descender:S.descender,advanceWidthMax:S.advanceWidthMax,minLeftSideBearing:S.minLeftSideBearing,minRightSideBearing:S.minRightSideBearing,xMaxExtent:S.maxLeftSideBearing+(S.xMax-S.xMin),numberOfHMetrics:r.glyphs.length}),R=oF.make(r.glyphs.length),B=eA.make(Object.assign({xAvgCharWidth:Math.round(S.advanceWidthAvg),usFirstCharIndex:l,usLastCharIndex:u,ulUnicodeRange1:c,ulUnicodeRange2:f,ulUnicodeRange3:d,ulUnicodeRange4:h,sTypoAscender:S.ascender,sTypoDescender:S.descender,sTypoLineGap:0,usWinAscent:S.yMax,usWinDescent:Math.abs(S.yMin),ulCodePageRange1:1,sxHeight:vx(r,"xyvw",{yMax:Math.round(S.ascender/2)}).yMax,sCapHeight:vx(r,"HIKLEFJMNTZBDPRAGOQSUVWXY",S).yMax,usDefaultChar:r.hasChar(" ")?32:0,usBreakChar:r.hasChar(" ")?32:0},r.tables.os2)),j=aF.make(r.glyphs),G=GT.make(r.glyphs),ie=r.getEnglishName("fontFamily"),q=r.getEnglishName("fontSubfamily"),Y=ie+" "+q,J=r.getEnglishName("postScriptName");J||(J=ie.replace(/\s/g,"")+"-"+q);var ae={};for(var oe in r.names)ae[oe]=r.names[oe];ae.uniqueID||(ae.uniqueID={en:r.getEnglishName("manufacturer")+":"+Y}),ae.postScriptName||(ae.postScriptName={en:J}),ae.preferredFamily||(ae.preferredFamily=r.names.fontFamily),ae.preferredSubfamily||(ae.preferredSubfamily=r.names.fontSubfamily);var he=[],ye=fF.make(ae,he),Ue=he.length>0?sF.make(he):void 0,Re=hF.make(),Oe=rF.make(r.glyphs,{version:r.getEnglishName("version"),fullName:Y,familyName:ie,weightName:q,postScriptName:J,unitsPerEm:r.unitsPerEm,fontBBox:[0,S.yMin,S.ascender,S.advanceWidthMax]}),ee=r.metas&&Object.keys(r.metas).length>0?gF.make(r.metas):void 0,re=[F,E,R,B,ye,G,Re,Oe,j];Ue&&re.push(Ue),r.tables.gsub&&re.push(pF.make(r.tables.gsub)),ee&&re.push(ee);for(var fe=mF(re),Be=fe.encode(),ke=p1(Be),$e=fe.fields,je=!1,qe=0;qe<$e.length;qe+=1)if($e[qe].name==="head table"){$e[qe].value.checkSumAdjustment=2981146554-ke,je=!0;break}if(!je)throw new Error("Could not find head table with checkSum to adjust.");return fe}var kN={make:mF,fontToTable:EN,computeCheckSum:p1};function I0(r,e){for(var t=0,n=r.length-1;t<=n;){var i=t+n>>>1,a=r[i].tag;if(a===e)return i;a<e?t=i+1:n=i-1}return-t-1}function yx(r,e){for(var t=0,n=r.length-1;t<=n;){var i=t+n>>>1,a=r[i];if(a===e)return i;a<e?t=i+1:n=i-1}return-t-1}function Ax(r,e){for(var t,n=0,i=r.length-1;n<=i;){var a=n+i>>>1;t=r[a];var s=t.start;if(s===e)return t;s<e?n=a+1:i=a-1}if(n>0)return t=r[n-1],e>t.end?0:t}function Hf(r,e){this.font=r,this.tableName=e}Hf.prototype={searchTag:I0,binSearch:yx,getTable:function(r){var e=this.font.tables[this.tableName];return!e&&r&&(e=this.font.tables[this.tableName]=this.createDefaultTable()),e},getScriptNames:function(){var r=this.getTable();return r?r.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var r=this.getTable();if(r){for(var e=!1,t=0;t<r.scripts.length;t++){var n=r.scripts[t].tag;if(n==="DFLT")return n;n==="latn"&&(e=!0)}if(e)return"latn"}},getScriptTable:function(r,e){var t=this.getTable(e);if(t){r=r||"DFLT";var n=t.scripts,i=I0(t.scripts,r);if(i>=0)return n[i].script;if(e){var a={tag:r,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return n.splice(-1-i,0,a),a.script}}},getLangSysTable:function(r,e,t){var n=this.getScriptTable(r,t);if(n){if(!e||e==="dflt"||e==="DFLT")return n.defaultLangSys;var i=I0(n.langSysRecords,e);if(i>=0)return n.langSysRecords[i].langSys;if(t){var a={tag:e,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return n.langSysRecords.splice(-1-i,0,a),a.langSys}}},getFeatureTable:function(r,e,t,n){var i=this.getLangSysTable(r,e,n);if(i){for(var a,s=i.featureIndexes,o=this.font.tables[this.tableName].features,l=0;l<s.length;l++)if(a=o[s[l]],a.tag===t)return a.feature;if(n){var u=o.length;return jt.assert(u===0||t>=o[u-1].tag,"Features must be added in alphabetical order."),a={tag:t,feature:{params:0,lookupListIndexes:[]}},o.push(a),s.push(u),a.feature}}},getLookupTables:function(r,e,t,n,i){var a=this.getFeatureTable(r,e,t,i),s=[];if(a){for(var o,l=a.lookupListIndexes,u=this.font.tables[this.tableName].lookups,c=0;c<l.length;c++)o=u[l[c]],o.lookupType===n&&s.push(o);if(s.length===0&&i){o={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0};var f=u.length;return u.push(o),l.push(f),[o]}}return s},getGlyphClass:function(r,e){switch(r.format){case 1:return r.startGlyph<=e&&e<r.startGlyph+r.classes.length?r.classes[e-r.startGlyph]:0;case 2:var t=Ax(r.ranges,e);return t?t.classId:0}},getCoverageIndex:function(r,e){switch(r.format){case 1:var t=yx(r.glyphs,e);return t>=0?t:-1;case 2:var n=Ax(r.ranges,e);return n?n.index+e-n.start:-1}},expandCoverage:function(r){if(r.format===1)return r.glyphs;for(var e=[],t=r.ranges,n=0;n<t.length;n++)for(var i=t[n],a=i.start,s=i.end,o=a;o<=s;o++)e.push(o);return e}};function jf(r){Hf.call(this,r,"gpos")}jf.prototype=Hf.prototype;jf.prototype.init=function(){var r=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(r)};jf.prototype.getKerningValue=function(r,e,t){for(var n=0;n<r.length;n++)for(var i=r[n].subtables,a=0;a<i.length;a++){var s=i[a],o=this.getCoverageIndex(s.coverage,e);if(!(o<0))switch(s.posFormat){case 1:for(var l=s.pairSets[o],u=0;u<l.length;u++){var c=l[u];if(c.secondGlyph===t)return c.value1&&c.value1.xAdvance||0}break;case 2:var f=this.getGlyphClass(s.classDef1,e),d=this.getGlyphClass(s.classDef2,t),h=s.classRecords[f][d];return h.value1&&h.value1.xAdvance||0}}return 0};jf.prototype.getKerningTables=function(r,e){if(this.font.tables.gpos)return this.getLookupTables(r,e,"kern",2)};function ia(r){Hf.call(this,r,"gsub")}function TN(r,e){var t=r.length;if(t!==e.length)return!1;for(var n=0;n<t;n++)if(r[n]!==e[n])return!1;return!0}function g1(r,e,t){for(var n=r.subtables,i=0;i<n.length;i++){var a=n[i];if(a.substFormat===e)return a}if(t)return n.push(t),t}ia.prototype=Hf.prototype;ia.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}};ia.prototype.getSingle=function(r,e,t){for(var n=[],i=this.getLookupTables(e,t,r,1),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++){var l=s[o],u=this.expandCoverage(l.coverage),c=void 0;if(l.substFormat===1){var f=l.deltaGlyphId;for(c=0;c<u.length;c++){var d=u[c];n.push({sub:d,by:d+f})}}else{var h=l.substitute;for(c=0;c<u.length;c++)n.push({sub:u[c],by:h[c]})}}return n};ia.prototype.getMultiple=function(r,e,t){for(var n=[],i=this.getLookupTables(e,t,r,2),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++){var l=s[o],u=this.expandCoverage(l.coverage),c=void 0;for(c=0;c<u.length;c++){var f=u[c],d=l.sequences[c];n.push({sub:f,by:d})}}return n};ia.prototype.getAlternates=function(r,e,t){for(var n=[],i=this.getLookupTables(e,t,r,3),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++)for(var l=s[o],u=this.expandCoverage(l.coverage),c=l.alternateSets,f=0;f<u.length;f++)n.push({sub:u[f],by:c[f]});return n};ia.prototype.getLigatures=function(r,e,t){for(var n=[],i=this.getLookupTables(e,t,r,4),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++)for(var l=s[o],u=this.expandCoverage(l.coverage),c=l.ligatureSets,f=0;f<u.length;f++)for(var d=u[f],h=c[f],g=0;g<h.length;g++){var v=h[g];n.push({sub:[d].concat(v.components),by:v.ligGlyph})}return n};ia.prototype.addSingle=function(r,e,t,n){var i=this.getLookupTables(t,n,r,1,!0)[0],a=g1(i,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});jt.assert(a.coverage.format===1,"Single: unable to modify coverage table format "+a.coverage.format);var s=e.sub,o=this.binSearch(a.coverage.glyphs,s);o<0&&(o=-1-o,a.coverage.glyphs.splice(o,0,s),a.substitute.splice(o,0,0)),a.substitute[o]=e.by};ia.prototype.addMultiple=function(r,e,t,n){jt.assert(e.by instanceof Array&&e.by.length>1,'Multiple: "by" must be an array of two or more ids');var i=this.getLookupTables(t,n,r,2,!0)[0],a=g1(i,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});jt.assert(a.coverage.format===1,"Multiple: unable to modify coverage table format "+a.coverage.format);var s=e.sub,o=this.binSearch(a.coverage.glyphs,s);o<0&&(o=-1-o,a.coverage.glyphs.splice(o,0,s),a.sequences.splice(o,0,0)),a.sequences[o]=e.by};ia.prototype.addAlternate=function(r,e,t,n){var i=this.getLookupTables(t,n,r,3,!0)[0],a=g1(i,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});jt.assert(a.coverage.format===1,"Alternate: unable to modify coverage table format "+a.coverage.format);var s=e.sub,o=this.binSearch(a.coverage.glyphs,s);o<0&&(o=-1-o,a.coverage.glyphs.splice(o,0,s),a.alternateSets.splice(o,0,0)),a.alternateSets[o]=e.by};ia.prototype.addLigature=function(r,e,t,n){var i=this.getLookupTables(t,n,r,4,!0)[0],a=i.subtables[0];a||(a={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},i.subtables[0]=a),jt.assert(a.coverage.format===1,"Ligature: unable to modify coverage table format "+a.coverage.format);var s=e.sub[0],o=e.sub.slice(1),l={ligGlyph:e.by,components:o},u=this.binSearch(a.coverage.glyphs,s);if(u>=0){for(var c=a.ligatureSets[u],f=0;f<c.length;f++)if(TN(c[f].components,o))return;c.push(l)}else u=-1-u,a.coverage.glyphs.splice(u,0,s),a.ligatureSets.splice(u,0,[l])};ia.prototype.getFeature=function(r,e,t){if(/ss\d\d/.test(r))return this.getSingle(r,e,t);switch(r){case"aalt":case"salt":return this.getSingle(r,e,t).concat(this.getAlternates(r,e,t));case"dlig":case"liga":case"rlig":return this.getLigatures(r,e,t);case"ccmp":return this.getMultiple(r,e,t).concat(this.getLigatures(r,e,t));case"stch":return this.getMultiple(r,e,t)}};ia.prototype.add=function(r,e,t,n){if(/ss\d\d/.test(r))return this.addSingle(r,e,t,n);switch(r){case"aalt":case"salt":return typeof e.by=="number"?this.addSingle(r,e,t,n):this.addAlternate(r,e,t,n);case"dlig":case"liga":case"rlig":return this.addLigature(r,e,t,n);case"ccmp":return e.by instanceof Array?this.addMultiple(r,e,t,n):this.addLigature(r,e,t,n)}};function FN(){return typeof window<"u"}function IN(r){for(var e=new Buffer(r.byteLength),t=new Uint8Array(r),n=0;n<e.length;++n)e[n]=t[n];return e}function pd(r,e){if(!r)throw e}function bx(r,e,t,n,i){var a;return(e&n)>0?(a=r.parseByte(),(e&i)===0&&(a=-a),a=t+a):(e&i)>0?a=t:a=t+r.parseShort(),a}function vF(r,e,t){var n=new vt.Parser(e,t);r.numberOfContours=n.parseShort(),r._xMin=n.parseShort(),r._yMin=n.parseShort(),r._xMax=n.parseShort(),r._yMax=n.parseShort();var i,a;if(r.numberOfContours>0){for(var s=r.endPointIndices=[],o=0;o<r.numberOfContours;o+=1)s.push(n.parseUShort());r.instructionLength=n.parseUShort(),r.instructions=[];for(var l=0;l<r.instructionLength;l+=1)r.instructions.push(n.parseByte());var u=s[s.length-1]+1;i=[];for(var c=0;c<u;c+=1)if(a=n.parseByte(),i.push(a),(a&8)>0)for(var f=n.parseByte(),d=0;d<f;d+=1)i.push(a),c+=1;if(jt.argument(i.length===u,"Bad flags."),s.length>0){var h=[],g;if(u>0){for(var v=0;v<u;v+=1)a=i[v],g={},g.onCurve=!!(a&1),g.lastPointOfContour=s.indexOf(v)>=0,h.push(g);for(var y=0,A=0;A<u;A+=1)a=i[A],g=h[A],g.x=bx(n,a,y,2,16),y=g.x;for(var C=0,S=0;S<u;S+=1)a=i[S],g=h[S],g.y=bx(n,a,C,4,32),C=g.y}r.points=h}else r.points=[]}else if(r.numberOfContours===0)r.points=[];else{r.isComposite=!0,r.points=[],r.components=[];for(var F=!0;F;){i=n.parseUShort();var E={glyphIndex:n.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(i&1)>0?(i&2)>0?(E.dx=n.parseShort(),E.dy=n.parseShort()):E.matchedPoints=[n.parseUShort(),n.parseUShort()]:(i&2)>0?(E.dx=n.parseChar(),E.dy=n.parseChar()):E.matchedPoints=[n.parseByte(),n.parseByte()],(i&8)>0?E.xScale=E.yScale=n.parseF2Dot14():(i&64)>0?(E.xScale=n.parseF2Dot14(),E.yScale=n.parseF2Dot14()):(i&128)>0&&(E.xScale=n.parseF2Dot14(),E.scale01=n.parseF2Dot14(),E.scale10=n.parseF2Dot14(),E.yScale=n.parseF2Dot14()),r.components.push(E),F=!!(i&32)}if(i&256){r.instructionLength=n.parseUShort(),r.instructions=[];for(var R=0;R<r.instructionLength;R+=1)r.instructions.push(n.parseByte())}}}function P0(r,e){for(var t=[],n=0;n<r.length;n+=1){var i=r[n],a={x:e.xScale*i.x+e.scale01*i.y+e.dx,y:e.scale10*i.x+e.yScale*i.y+e.dy,onCurve:i.onCurve,lastPointOfContour:i.lastPointOfContour};t.push(a)}return t}function PN(r){for(var e=[],t=[],n=0;n<r.length;n+=1){var i=r[n];t.push(i),i.lastPointOfContour&&(e.push(t),t=[])}return jt.argument(t.length===0,"There are still points left in the current contour."),e}function yF(r){var e=new fi;if(!r)return e;for(var t=PN(r),n=0;n<t.length;++n){var i=t[n],a=null,s=i[i.length-1],o=i[0];if(s.onCurve)e.moveTo(s.x,s.y);else if(o.onCurve)e.moveTo(o.x,o.y);else{var l={x:(s.x+o.x)*.5,y:(s.y+o.y)*.5};e.moveTo(l.x,l.y)}for(var u=0;u<i.length;++u)if(a=s,s=o,o=i[(u+1)%i.length],s.onCurve)e.lineTo(s.x,s.y);else{var c=o;a.onCurve||((s.x+a.x)*.5,(s.y+a.y)*.5),o.onCurve||(c={x:(s.x+o.x)*.5,y:(s.y+o.y)*.5}),e.quadraticCurveTo(s.x,s.y,c.x,c.y)}e.closePath()}return e}function AF(r,e){if(e.isComposite)for(var t=0;t<e.components.length;t+=1){var n=e.components[t],i=r.get(n.glyphIndex);if(i.getPath(),i.points){var a=void 0;if(n.matchedPoints===void 0)a=P0(i.points,n);else{if(n.matchedPoints[0]>e.points.length-1||n.matchedPoints[1]>i.points.length-1)throw Error("Matched points out of range in "+e.name);var s=e.points[n.matchedPoints[0]],o=i.points[n.matchedPoints[1]],l={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};o=P0([o],l)[0],l.dx=s.x-o.x,l.dy=s.y-o.y,a=P0(i.points,l)}e.points=e.points.concat(a)}}return yF(e.points)}function DN(r,e,t,n){for(var i=new os.GlyphSet(n),a=0;a<t.length-1;a+=1){var s=t[a],o=t[a+1];s!==o?i.push(a,os.ttfGlyphLoader(n,a,vF,r,e+s,AF)):i.push(a,os.glyphLoader(n,a))}return i}function RN(r,e,t,n){var i=new os.GlyphSet(n);return n._push=function(a){var s=t[a],o=t[a+1];s!==o?i.push(a,os.ttfGlyphLoader(n,a,vF,r,e+s,AF)):i.push(a,os.glyphLoader(n,a))},i}function ON(r,e,t,n,i){return i.lowMemory?RN(r,e,t,n):DN(r,e,t,n)}var bF={getPath:yF,parse:ON},wF,El,CF,tA;function xF(r){this.font=r,this.getCommands=function(e){return bF.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function BN(r){return r}function SF(r){return Math.sign(r)*Math.round(Math.abs(r))}function MN(r){return Math.sign(r)*Math.round(Math.abs(r*2))/2}function _N(r){return Math.sign(r)*(Math.round(Math.abs(r)+.5)-.5)}function NN(r){return Math.sign(r)*Math.ceil(Math.abs(r))}function LN(r){return Math.sign(r)*Math.floor(Math.abs(r))}var EF=function(r){var e=this.srPeriod,t=this.srPhase,n=this.srThreshold,i=1;return r<0&&(r=-r,i=-1),r+=n-t,r=Math.trunc(r/e)*e,r+=t,r<0?t*i:r*i},rs={x:1,y:0,axis:"x",distance:function(r,e,t,n){return(t?r.xo:r.x)-(n?e.xo:e.x)},interpolate:function(r,e,t,n){var i,a,s,o,l,u,c;if(!n||n===this){if(i=r.xo-e.xo,a=r.xo-t.xo,l=e.x-e.xo,u=t.x-t.xo,s=Math.abs(i),o=Math.abs(a),c=s+o,c===0){r.x=r.xo+(l+u)/2;return}r.x=r.xo+(l*o+u*s)/c;return}if(i=n.distance(r,e,!0,!0),a=n.distance(r,t,!0,!0),l=n.distance(e,e,!1,!0),u=n.distance(t,t,!1,!0),s=Math.abs(i),o=Math.abs(a),c=s+o,c===0){rs.setRelative(r,r,(l+u)/2,n,!0);return}rs.setRelative(r,r,(l*o+u*s)/c,n,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(r,e,t,n,i){if(!n||n===this){r.x=(i?e.xo:e.x)+t;return}var a=i?e.xo:e.x,s=i?e.yo:e.y,o=a+t*n.x,l=s+t*n.y;r.x=o+(r.y-l)/n.normalSlope},slope:0,touch:function(r){r.xTouched=!0},touched:function(r){return r.xTouched},untouch:function(r){r.xTouched=!1}},Rs={x:0,y:1,axis:"y",distance:function(r,e,t,n){return(t?r.yo:r.y)-(n?e.yo:e.y)},interpolate:function(r,e,t,n){var i,a,s,o,l,u,c;if(!n||n===this){if(i=r.yo-e.yo,a=r.yo-t.yo,l=e.y-e.yo,u=t.y-t.yo,s=Math.abs(i),o=Math.abs(a),c=s+o,c===0){r.y=r.yo+(l+u)/2;return}r.y=r.yo+(l*o+u*s)/c;return}if(i=n.distance(r,e,!0,!0),a=n.distance(r,t,!0,!0),l=n.distance(e,e,!1,!0),u=n.distance(t,t,!1,!0),s=Math.abs(i),o=Math.abs(a),c=s+o,c===0){Rs.setRelative(r,r,(l+u)/2,n,!0);return}Rs.setRelative(r,r,(l*o+u*s)/c,n,!0)},normalSlope:0,setRelative:function(r,e,t,n,i){if(!n||n===this){r.y=(i?e.yo:e.y)+t;return}var a=i?e.xo:e.x,s=i?e.yo:e.y,o=a+t*n.x,l=s+t*n.y;r.y=l+n.normalSlope*(r.x-o)},slope:Number.POSITIVE_INFINITY,touch:function(r){r.yTouched=!0},touched:function(r){return r.yTouched},untouch:function(r){r.yTouched=!1}};Object.freeze(rs);Object.freeze(Rs);function Gf(r,e){this.x=r,this.y=e,this.axis=void 0,this.slope=e/r,this.normalSlope=-r/e,Object.freeze(this)}Gf.prototype.distance=function(r,e,t,n){return this.x*rs.distance(r,e,t,n)+this.y*Rs.distance(r,e,t,n)};Gf.prototype.interpolate=function(r,e,t,n){var i,a,s,o,l,u,c;if(s=n.distance(r,e,!0,!0),o=n.distance(r,t,!0,!0),i=n.distance(e,e,!1,!0),a=n.distance(t,t,!1,!0),l=Math.abs(s),u=Math.abs(o),c=l+u,c===0){this.setRelative(r,r,(i+a)/2,n,!0);return}this.setRelative(r,r,(i*u+a*l)/c,n,!0)};Gf.prototype.setRelative=function(r,e,t,n,i){n=n||this;var a=i?e.xo:e.x,s=i?e.yo:e.y,o=a+t*n.x,l=s+t*n.y,u=n.normalSlope,c=this.slope,f=r.x,d=r.y;r.x=(c*f-u*o+l-d)/(c-u),r.y=c*(r.x-f)+d};Gf.prototype.touch=function(r){r.xTouched=!0,r.yTouched=!0};function qf(r,e){var t=Math.sqrt(r*r+e*e);return r/=t,e/=t,r===1&&e===0?rs:r===0&&e===1?Rs:new Gf(r,e)}function Os(r,e,t,n){this.x=this.xo=Math.round(r*64)/64,this.y=this.yo=Math.round(e*64)/64,this.lastPointOfContour=t,this.onCurve=n,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Os.prototype.nextTouched=function(r){for(var e=this.nextPointOnContour;!r.touched(e)&&e!==this;)e=e.nextPointOnContour;return e};Os.prototype.prevTouched=function(r){for(var e=this.prevPointOnContour;!r.touched(e)&&e!==this;)e=e.prevPointOnContour;return e};var wf=Object.freeze(new Os(0,0)),UN={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function fo(r,e){switch(this.env=r,this.stack=[],this.prog=e,r){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=rs,this.round=SF}}xF.prototype.exec=function(r,e){if(typeof e!="number")throw new Error("Point size is not a number!");if(!(this._errorState>2)){var t=this.font,n=this._prepState;if(!n||n.ppem!==e){var i=this._fpgmState;if(!i){fo.prototype=UN,i=this._fpgmState=new fo("fpgm",t.tables.fpgm),i.funcs=[],i.font=t,exports.DEBUG&&(console.log("---EXEC FPGM---"),i.step=-1);try{El(i)}catch(u){console.log("Hinting error in FPGM:"+u),this._errorState=3;return}}fo.prototype=i,n=this._prepState=new fo("prep",t.tables.prep),n.ppem=e;var a=t.tables.cvt;if(a)for(var s=n.cvt=new Array(a.length),o=e/t.unitsPerEm,l=0;l<a.length;l++)s[l]=a[l]*o;else n.cvt=[];exports.DEBUG&&(console.log("---EXEC PREP---"),n.step=-1);try{El(n)}catch(u){this._errorState<2&&console.log("Hinting error in PREP:"+u),this._errorState=2}}if(!(this._errorState>1))try{return CF(r,n)}catch(u){this._errorState<1&&(console.log("Hinting error:"+u),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}}};CF=function(r,e){var t=e.ppem/e.font.unitsPerEm,n=t,i=r.components,a,s,o;if(fo.prototype=e,!i)o=new fo("glyf",r.instructions),exports.DEBUG&&(console.log("---EXEC GLYPH---"),o.step=-1),tA(r,o,t,n),s=o.gZone;else{var l=e.font;s=[],a=[];for(var u=0;u<i.length;u++){var c=i[u],f=l.glyphs.get(c.glyphIndex);o=new fo("glyf",f.instructions),exports.DEBUG&&(console.log("---EXEC COMP "+u+"---"),o.step=-1),tA(f,o,t,n);for(var d=Math.round(c.dx*t),h=Math.round(c.dy*n),g=o.gZone,v=o.contours,y=0;y<g.length;y++){var A=g[y];A.xTouched=A.yTouched=!1,A.xo=A.x=A.x+d,A.yo=A.y=A.y+h}var C=s.length;s.push.apply(s,g);for(var S=0;S<v.length;S++)a.push(v[S]+C)}r.instructions&&!o.inhibitGridFit&&(o=new fo("glyf",r.instructions),o.gZone=o.z0=o.z1=o.z2=s,o.contours=a,s.push(new Os(0,0),new Os(Math.round(r.advanceWidth*t),0)),exports.DEBUG&&(console.log("---EXEC COMPOSITE---"),o.step=-1),El(o),s.length-=2)}return s};tA=function(r,e,t,n){for(var i=r.points||[],a=i.length,s=e.gZone=e.z0=e.z1=e.z2=[],o=e.contours=[],l,u=0;u<a;u++)l=i[u],s[u]=new Os(l.x*t,l.y*n,l.lastPointOfContour,l.onCurve);for(var c,f,d=0;d<a;d++)l=s[d],c||(c=l,o.push(d)),l.lastPointOfContour?(l.nextPointOnContour=c,c.prevPointOnContour=l,c=void 0):(f=s[d+1],l.nextPointOnContour=f,f.prevPointOnContour=l);if(!e.inhibitGridFit){if(exports.DEBUG){console.log("PROCESSING GLYPH",e.stack);for(var h=0;h<a;h++)console.log(h,s[h].x,s[h].y)}if(s.push(new Os(0,0),new Os(Math.round(r.advanceWidth*t),0)),El(e),s.length-=2,exports.DEBUG){console.log("FINISHED GLYPH",e.stack);for(var g=0;g<a;g++)console.log(g,s[g].x,s[g].y)}}};El=function(r){var e=r.prog;if(e){var t=e.length,n;for(r.ip=0;r.ip<t;r.ip++){if(exports.DEBUG&&r.step++,n=wF[e[r.ip]],!n)throw new Error("unknown instruction: 0x"+Number(e[r.ip]).toString(16));n(r)}}};function qg(r){for(var e=r.tZone=new Array(r.gZone.length),t=0;t<e.length;t++)e[t]=new Os(0,0)}function kF(r,e){var t=r.prog,n=r.ip,i=1,a;do if(a=t[++n],a===88)i++;else if(a===89)i--;else if(a===64)n+=t[n+1]+1;else if(a===65)n+=2*t[n+1]+1;else if(a>=176&&a<=183)n+=a-176+1;else if(a>=184&&a<=191)n+=(a-184+1)*2;else if(e&&i===1&&a===27)break;while(i>0);r.ip=n}function wx(r,e){exports.DEBUG&&console.log(e.step,"SVTCA["+r.axis+"]"),e.fv=e.pv=e.dpv=r}function Cx(r,e){exports.DEBUG&&console.log(e.step,"SPVTCA["+r.axis+"]"),e.pv=e.dpv=r}function xx(r,e){exports.DEBUG&&console.log(e.step,"SFVTCA["+r.axis+"]"),e.fv=r}function Sx(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z2[n],s=e.z1[i];exports.DEBUG&&console.log("SPVTL["+r+"]",n,i);var o,l;r?(o=a.y-s.y,l=s.x-a.x):(o=s.x-a.x,l=s.y-a.y),e.pv=e.dpv=qf(o,l)}function Ex(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z2[n],s=e.z1[i];exports.DEBUG&&console.log("SFVTL["+r+"]",n,i);var o,l;r?(o=a.y-s.y,l=s.x-a.x):(o=s.x-a.x,l=s.y-a.y),e.fv=qf(o,l)}function VN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"SPVFS[]",t,n),r.pv=r.dpv=qf(n,t)}function zN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"SPVFS[]",t,n),r.fv=qf(n,t)}function $N(r){var e=r.stack,t=r.pv;exports.DEBUG&&console.log(r.step,"GPV[]"),e.push(t.x*16384),e.push(t.y*16384)}function HN(r){var e=r.stack,t=r.fv;exports.DEBUG&&console.log(r.step,"GFV[]"),e.push(t.x*16384),e.push(t.y*16384)}function jN(r){r.fv=r.pv,exports.DEBUG&&console.log(r.step,"SFVTPV[]")}function GN(r){var e=r.stack,t=e.pop(),n=e.pop(),i=e.pop(),a=e.pop(),s=e.pop(),o=r.z0,l=r.z1,u=o[t],c=o[n],f=l[i],d=l[a],h=r.z2[s];exports.DEBUG&&console.log("ISECT[], ",t,n,i,a,s);var g=u.x,v=u.y,y=c.x,A=c.y,C=f.x,S=f.y,F=d.x,E=d.y,R=(g-y)*(S-E)-(v-A)*(C-F),B=g*A-v*y,j=C*E-S*F;h.x=(B*(C-F)-j*(g-y))/R,h.y=(B*(S-E)-j*(v-A))/R}function qN(r){r.rp0=r.stack.pop(),exports.DEBUG&&console.log(r.step,"SRP0[]",r.rp0)}function WN(r){r.rp1=r.stack.pop(),exports.DEBUG&&console.log(r.step,"SRP1[]",r.rp1)}function QN(r){r.rp2=r.stack.pop(),exports.DEBUG&&console.log(r.step,"SRP2[]",r.rp2)}function YN(r){var e=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"SZP0[]",e),r.zp0=e,e){case 0:r.tZone||qg(r),r.z0=r.tZone;break;case 1:r.z0=r.gZone;break;default:throw new Error("Invalid zone pointer")}}function XN(r){var e=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"SZP1[]",e),r.zp1=e,e){case 0:r.tZone||qg(r),r.z1=r.tZone;break;case 1:r.z1=r.gZone;break;default:throw new Error("Invalid zone pointer")}}function JN(r){var e=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"SZP2[]",e),r.zp2=e,e){case 0:r.tZone||qg(r),r.z2=r.tZone;break;case 1:r.z2=r.gZone;break;default:throw new Error("Invalid zone pointer")}}function KN(r){var e=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"SZPS[]",e),r.zp0=r.zp1=r.zp2=e,e){case 0:r.tZone||qg(r),r.z0=r.z1=r.z2=r.tZone;break;case 1:r.z0=r.z1=r.z2=r.gZone;break;default:throw new Error("Invalid zone pointer")}}function ZN(r){r.loop=r.stack.pop(),exports.DEBUG&&console.log(r.step,"SLOOP[]",r.loop)}function e6(r){exports.DEBUG&&console.log(r.step,"RTG[]"),r.round=SF}function t6(r){exports.DEBUG&&console.log(r.step,"RTHG[]"),r.round=_N}function r6(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SMD[]",e),r.minDis=e/64}function n6(r){exports.DEBUG&&console.log(r.step,"ELSE[]"),kF(r,!1)}function i6(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"JMPR[]",e),r.ip+=e-1}function a6(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SCVTCI[]",e),r.cvCutIn=e/64}function s6(r){var e=r.stack;exports.DEBUG&&console.log(r.step,"DUP[]"),e.push(e[e.length-1])}function D0(r){exports.DEBUG&&console.log(r.step,"POP[]"),r.stack.pop()}function o6(r){exports.DEBUG&&console.log(r.step,"CLEAR[]"),r.stack.length=0}function l6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"SWAP[]"),e.push(t),e.push(n)}function u6(r){var e=r.stack;exports.DEBUG&&console.log(r.step,"DEPTH[]"),e.push(e.length)}function c6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"LOOPCALL[]",t,n);var i=r.ip,a=r.prog;r.prog=r.funcs[t];for(var s=0;s<n;s++)El(r),exports.DEBUG&&console.log(++r.step,s+1<n?"next loopcall":"done loopcall",s);r.ip=i,r.prog=a}function d6(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"CALL[]",e);var t=r.ip,n=r.prog;r.prog=r.funcs[e],El(r),r.ip=t,r.prog=n,exports.DEBUG&&console.log(++r.step,"returning from",e)}function f6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"CINDEX[]",t),e.push(e[e.length-t])}function h6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"MINDEX[]",t),e.push(e.splice(e.length-t,1)[0])}function p6(r){if(r.env!=="fpgm")throw new Error("FDEF not allowed here");var e=r.stack,t=r.prog,n=r.ip,i=e.pop(),a=n;for(exports.DEBUG&&console.log(r.step,"FDEF[]",i);t[++n]!==45;);r.ip=n,r.funcs[i]=t.slice(a+1,n)}function kx(r,e){var t=e.stack.pop(),n=e.z0[t],i=e.fv,a=e.pv;exports.DEBUG&&console.log(e.step,"MDAP["+r+"]",t);var s=a.distance(n,wf);r&&(s=e.round(s)),i.setRelative(n,wf,s,a),i.touch(n),e.rp0=e.rp1=t}function Tx(r,e){var t=e.z2,n=t.length-2,i,a,s;exports.DEBUG&&console.log(e.step,"IUP["+r.axis+"]");for(var o=0;o<n;o++)i=t[o],!r.touched(i)&&(a=i.prevTouched(r),a!==i&&(s=i.nextTouched(r),a===s&&r.setRelative(i,i,r.distance(a,a,!1,!0),r,!0),r.interpolate(i,a,s,r)))}function Fx(r,e){for(var t=e.stack,n=r?e.rp1:e.rp2,i=(r?e.z0:e.z1)[n],a=e.fv,s=e.pv,o=e.loop,l=e.z2;o--;){var u=t.pop(),c=l[u],f=s.distance(i,i,!1,!0);a.setRelative(c,c,f,s),a.touch(c),exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-o)+": ":"")+"SHP["+(r?"rp1":"rp2")+"]",u)}e.loop=1}function Ix(r,e){var t=e.stack,n=r?e.rp1:e.rp2,i=(r?e.z0:e.z1)[n],a=e.fv,s=e.pv,o=t.pop(),l=e.z2[e.contours[o]],u=l;exports.DEBUG&&console.log(e.step,"SHC["+r+"]",o);var c=s.distance(i,i,!1,!0);do u!==i&&a.setRelative(u,u,c,s),u=u.nextPointOnContour;while(u!==l)}function Px(r,e){var t=e.stack,n=r?e.rp1:e.rp2,i=(r?e.z0:e.z1)[n],a=e.fv,s=e.pv,o=t.pop();exports.DEBUG&&console.log(e.step,"SHZ["+r+"]",o);var l;switch(o){case 0:l=e.tZone;break;case 1:l=e.gZone;break;default:throw new Error("Invalid zone")}for(var u,c=s.distance(i,i,!1,!0),f=l.length-2,d=0;d<f;d++)u=l[d],a.setRelative(u,u,c,s)}function g6(r){for(var e=r.stack,t=r.loop,n=r.fv,i=e.pop()/64,a=r.z2;t--;){var s=e.pop(),o=a[s];exports.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-t)+": ":"")+"SHPIX[]",s,i),n.setRelative(o,o,i),n.touch(o)}r.loop=1}function m6(r){for(var e=r.stack,t=r.rp1,n=r.rp2,i=r.loop,a=r.z0[t],s=r.z1[n],o=r.fv,l=r.dpv,u=r.z2;i--;){var c=e.pop(),f=u[c];exports.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-i)+": ":"")+"IP[]",c,t,"<->",n),o.interpolate(f,a,s,l),o.touch(f)}r.loop=1}function Dx(r,e){var t=e.stack,n=t.pop()/64,i=t.pop(),a=e.z1[i],s=e.z0[e.rp0],o=e.fv,l=e.pv;o.setRelative(a,s,n,l),o.touch(a),exports.DEBUG&&console.log(e.step,"MSIRP["+r+"]",n,i),e.rp1=e.rp0,e.rp2=i,r&&(e.rp0=i)}function v6(r){for(var e=r.stack,t=r.rp0,n=r.z0[t],i=r.loop,a=r.fv,s=r.pv,o=r.z1;i--;){var l=e.pop(),u=o[l];exports.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-i)+": ":"")+"ALIGNRP[]",l),a.setRelative(u,n,0,s),a.touch(u)}r.loop=1}function y6(r){exports.DEBUG&&console.log(r.step,"RTDG[]"),r.round=MN}function Rx(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z0[i],s=e.fv,o=e.pv,l=e.cvt[n];exports.DEBUG&&console.log(e.step,"MIAP["+r+"]",n,"(",l,")",i);var u=o.distance(a,wf);r&&(Math.abs(u-l)<e.cvCutIn&&(u=l),u=e.round(u)),s.setRelative(a,wf,u,o),e.zp0===0&&(a.xo=a.x,a.yo=a.y),s.touch(a),e.rp0=e.rp1=i}function A6(r){var e=r.prog,t=r.ip,n=r.stack,i=e[++t];exports.DEBUG&&console.log(r.step,"NPUSHB[]",i);for(var a=0;a<i;a++)n.push(e[++t]);r.ip=t}function b6(r){var e=r.ip,t=r.prog,n=r.stack,i=t[++e];exports.DEBUG&&console.log(r.step,"NPUSHW[]",i);for(var a=0;a<i;a++){var s=t[++e]<<8|t[++e];s&32768&&(s=-((s^65535)+1)),n.push(s)}r.ip=e}function w6(r){var e=r.stack,t=r.store;t||(t=r.store=[]);var n=e.pop(),i=e.pop();exports.DEBUG&&console.log(r.step,"WS",n,i),t[i]=n}function C6(r){var e=r.stack,t=r.store,n=e.pop();exports.DEBUG&&console.log(r.step,"RS",n);var i=t&&t[n]||0;e.push(i)}function x6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"WCVTP",t,n),r.cvt[n]=t/64}function S6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"RCVT",t),e.push(r.cvt[t]*64)}function Ox(r,e){var t=e.stack,n=t.pop(),i=e.z2[n];exports.DEBUG&&console.log(e.step,"GC["+r+"]",n),t.push(e.dpv.distance(i,wf,r,!1)*64)}function Bx(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z1[n],s=e.z0[i],o=e.dpv.distance(s,a,r,r);exports.DEBUG&&console.log(e.step,"MD["+r+"]",n,i,"->",o),e.stack.push(Math.round(o*64))}function E6(r){exports.DEBUG&&console.log(r.step,"MPPEM[]"),r.stack.push(r.ppem)}function k6(r){exports.DEBUG&&console.log(r.step,"FLIPON[]"),r.autoFlip=!0}function T6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"LT[]",t,n),e.push(n<t?1:0)}function F6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"LTEQ[]",t,n),e.push(n<=t?1:0)}function I6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"GT[]",t,n),e.push(n>t?1:0)}function P6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"GTEQ[]",t,n),e.push(n>=t?1:0)}function D6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"EQ[]",t,n),e.push(t===n?1:0)}function R6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"NEQ[]",t,n),e.push(t!==n?1:0)}function O6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"ODD[]",t),e.push(Math.trunc(t)%2?1:0)}function B6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"EVEN[]",t),e.push(Math.trunc(t)%2?0:1)}function M6(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"IF[]",e),e||(kF(r,!0),exports.DEBUG&&console.log(r.step,"EIF[]"))}function _6(r){exports.DEBUG&&console.log(r.step,"EIF[]")}function N6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"AND[]",t,n),e.push(t&&n?1:0)}function L6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"OR[]",t,n),e.push(t||n?1:0)}function U6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"NOT[]",t),e.push(t?0:1)}function R0(r,e){var t=e.stack,n=t.pop(),i=e.fv,a=e.pv,s=e.ppem,o=e.deltaBase+(r-1)*16,l=e.deltaShift,u=e.z0;exports.DEBUG&&console.log(e.step,"DELTAP["+r+"]",n,t);for(var c=0;c<n;c++){var f=t.pop(),d=t.pop(),h=o+((d&240)>>4);if(h===s){var g=(d&15)-8;g>=0&&g++,exports.DEBUG&&console.log(e.step,"DELTAPFIX",f,"by",g*l);var v=u[f];i.setRelative(v,v,g*l,a)}}}function V6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"SDB[]",t),r.deltaBase=t}function z6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"SDS[]",t),r.deltaShift=Math.pow(.5,t)}function $6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"ADD[]",t,n),e.push(n+t)}function H6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"SUB[]",t,n),e.push(n-t)}function j6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"DIV[]",t,n),e.push(n*64/t)}function G6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"MUL[]",t,n),e.push(n*t/64)}function q6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"ABS[]",t),e.push(Math.abs(t))}function W6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"NEG[]",t),e.push(-t)}function Q6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"FLOOR[]",t),e.push(Math.floor(t/64)*64)}function Y6(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"CEILING[]",t),e.push(Math.ceil(t/64)*64)}function Kh(r,e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"ROUND[]"),t.push(e.round(n/64)*64)}function X6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"WCVTF[]",t,n),r.cvt[n]=t*r.ppem/r.font.unitsPerEm}function O0(r,e){var t=e.stack,n=t.pop(),i=e.ppem,a=e.deltaBase+(r-1)*16,s=e.deltaShift;exports.DEBUG&&console.log(e.step,"DELTAC["+r+"]",n,t);for(var o=0;o<n;o++){var l=t.pop(),u=t.pop(),c=a+((u&240)>>4);if(c===i){var f=(u&15)-8;f>=0&&f++;var d=f*s;exports.DEBUG&&console.log(e.step,"DELTACFIX",l,"by",d),e.cvt[l]+=d}}}function J6(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SROUND[]",e),r.round=EF;var t;switch(e&192){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(r.srPeriod=t,e&48){case 0:r.srPhase=0;break;case 16:r.srPhase=.25*t;break;case 32:r.srPhase=.5*t;break;case 48:r.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}e&=15,e===0?r.srThreshold=0:r.srThreshold=(e/8-.5)*t}function K6(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"S45ROUND[]",e),r.round=EF;var t;switch(e&192){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(r.srPeriod=t,e&48){case 0:r.srPhase=0;break;case 16:r.srPhase=.25*t;break;case 32:r.srPhase=.5*t;break;case 48:r.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}e&=15,e===0?r.srThreshold=0:r.srThreshold=(e/8-.5)*t}function Z6(r){exports.DEBUG&&console.log(r.step,"ROFF[]"),r.round=BN}function e8(r){exports.DEBUG&&console.log(r.step,"RUTG[]"),r.round=NN}function t8(r){exports.DEBUG&&console.log(r.step,"RDTG[]"),r.round=LN}function r8(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SCANCTRL[]",e)}function Mx(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z2[n],s=e.z1[i];exports.DEBUG&&console.log(e.step,"SDPVTL["+r+"]",n,i);var o,l;r?(o=a.y-s.y,l=s.x-a.x):(o=s.x-a.x,l=s.y-a.y),e.dpv=qf(o,l)}function n8(r){var e=r.stack,t=e.pop(),n=0;exports.DEBUG&&console.log(r.step,"GETINFO[]",t),t&1&&(n=35),t&32&&(n|=4096),e.push(n)}function i8(r){var e=r.stack,t=e.pop(),n=e.pop(),i=e.pop();exports.DEBUG&&console.log(r.step,"ROLL[]"),e.push(n),e.push(t),e.push(i)}function a8(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"MAX[]",t,n),e.push(Math.max(n,t))}function s8(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"MIN[]",t,n),e.push(Math.min(n,t))}function o8(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SCANTYPE[]",e)}function l8(r){var e=r.stack.pop(),t=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"INSTCTRL[]",e,t),e){case 1:r.inhibitGridFit=!!t;return;case 2:r.ignoreCvt=!!t;return;default:throw new Error("invalid INSTCTRL[] selector")}}function Ks(r,e){var t=e.stack,n=e.prog,i=e.ip;exports.DEBUG&&console.log(e.step,"PUSHB["+r+"]");for(var a=0;a<r;a++)t.push(n[++i]);e.ip=i}function Zs(r,e){var t=e.ip,n=e.prog,i=e.stack;exports.DEBUG&&console.log(e.ip,"PUSHW["+r+"]");for(var a=0;a<r;a++){var s=n[++t]<<8|n[++t];s&32768&&(s=-((s^65535)+1)),i.push(s)}e.ip=t}function gt(r,e,t,n,i,a){var s=a.stack,o=r&&s.pop(),l=s.pop(),u=a.rp0,c=a.z0[u],f=a.z1[l],d=a.minDis,h=a.fv,g=a.dpv,v,y,A,C;y=v=g.distance(f,c,!0,!0),A=y>=0?1:-1,y=Math.abs(y),r&&(C=a.cvt[o],n&&Math.abs(y-C)<a.cvCutIn&&(y=C)),t&&y<d&&(y=d),n&&(y=a.round(y)),h.setRelative(f,c,A*y,g),h.touch(f),exports.DEBUG&&console.log(a.step,(r?"MIRP[":"MDRP[")+(e?"M":"m")+(t?">":"_")+(n?"R":"_")+(i===0?"Gr":i===1?"Bl":i===2?"Wh":"")+"]",r?o+"("+a.cvt[o]+","+C+")":"",l,"(d =",v,"->",A*y,")"),a.rp1=a.rp0,a.rp2=l,e&&(a.rp0=l)}wF=[wx.bind(void 0,Rs),wx.bind(void 0,rs),Cx.bind(void 0,Rs),Cx.bind(void 0,rs),xx.bind(void 0,Rs),xx.bind(void 0,rs),Sx.bind(void 0,0),Sx.bind(void 0,1),Ex.bind(void 0,0),Ex.bind(void 0,1),VN,zN,$N,HN,jN,GN,qN,WN,QN,YN,XN,JN,KN,ZN,e6,t6,r6,n6,i6,a6,void 0,void 0,s6,D0,o6,l6,u6,f6,h6,void 0,void 0,void 0,c6,d6,p6,void 0,kx.bind(void 0,0),kx.bind(void 0,1),Tx.bind(void 0,Rs),Tx.bind(void 0,rs),Fx.bind(void 0,0),Fx.bind(void 0,1),Ix.bind(void 0,0),Ix.bind(void 0,1),Px.bind(void 0,0),Px.bind(void 0,1),g6,m6,Dx.bind(void 0,0),Dx.bind(void 0,1),v6,y6,Rx.bind(void 0,0),Rx.bind(void 0,1),A6,b6,w6,C6,x6,S6,Ox.bind(void 0,0),Ox.bind(void 0,1),void 0,Bx.bind(void 0,0),Bx.bind(void 0,1),E6,void 0,k6,void 0,void 0,T6,F6,I6,P6,D6,R6,O6,B6,M6,_6,N6,L6,U6,R0.bind(void 0,1),V6,z6,$6,H6,j6,G6,q6,W6,Q6,Y6,Kh.bind(void 0,0),Kh.bind(void 0,1),Kh.bind(void 0,2),Kh.bind(void 0,3),void 0,void 0,void 0,void 0,X6,R0.bind(void 0,2),R0.bind(void 0,3),O0.bind(void 0,1),O0.bind(void 0,2),O0.bind(void 0,3),J6,K6,void 0,void 0,Z6,void 0,e8,t8,D0,D0,void 0,void 0,void 0,void 0,void 0,r8,Mx.bind(void 0,0),Mx.bind(void 0,1),n8,void 0,i8,a8,s8,o8,l8,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Ks.bind(void 0,1),Ks.bind(void 0,2),Ks.bind(void 0,3),Ks.bind(void 0,4),Ks.bind(void 0,5),Ks.bind(void 0,6),Ks.bind(void 0,7),Ks.bind(void 0,8),Zs.bind(void 0,1),Zs.bind(void 0,2),Zs.bind(void 0,3),Zs.bind(void 0,4),Zs.bind(void 0,5),Zs.bind(void 0,6),Zs.bind(void 0,7),Zs.bind(void 0,8),gt.bind(void 0,0,0,0,0,0),gt.bind(void 0,0,0,0,0,1),gt.bind(void 0,0,0,0,0,2),gt.bind(void 0,0,0,0,0,3),gt.bind(void 0,0,0,0,1,0),gt.bind(void 0,0,0,0,1,1),gt.bind(void 0,0,0,0,1,2),gt.bind(void 0,0,0,0,1,3),gt.bind(void 0,0,0,1,0,0),gt.bind(void 0,0,0,1,0,1),gt.bind(void 0,0,0,1,0,2),gt.bind(void 0,0,0,1,0,3),gt.bind(void 0,0,0,1,1,0),gt.bind(void 0,0,0,1,1,1),gt.bind(void 0,0,0,1,1,2),gt.bind(void 0,0,0,1,1,3),gt.bind(void 0,0,1,0,0,0),gt.bind(void 0,0,1,0,0,1),gt.bind(void 0,0,1,0,0,2),gt.bind(void 0,0,1,0,0,3),gt.bind(void 0,0,1,0,1,0),gt.bind(void 0,0,1,0,1,1),gt.bind(void 0,0,1,0,1,2),gt.bind(void 0,0,1,0,1,3),gt.bind(void 0,0,1,1,0,0),gt.bind(void 0,0,1,1,0,1),gt.bind(void 0,0,1,1,0,2),gt.bind(void 0,0,1,1,0,3),gt.bind(void 0,0,1,1,1,0),gt.bind(void 0,0,1,1,1,1),gt.bind(void 0,0,1,1,1,2),gt.bind(void 0,0,1,1,1,3),gt.bind(void 0,1,0,0,0,0),gt.bind(void 0,1,0,0,0,1),gt.bind(void 0,1,0,0,0,2),gt.bind(void 0,1,0,0,0,3),gt.bind(void 0,1,0,0,1,0),gt.bind(void 0,1,0,0,1,1),gt.bind(void 0,1,0,0,1,2),gt.bind(void 0,1,0,0,1,3),gt.bind(void 0,1,0,1,0,0),gt.bind(void 0,1,0,1,0,1),gt.bind(void 0,1,0,1,0,2),gt.bind(void 0,1,0,1,0,3),gt.bind(void 0,1,0,1,1,0),gt.bind(void 0,1,0,1,1,1),gt.bind(void 0,1,0,1,1,2),gt.bind(void 0,1,0,1,1,3),gt.bind(void 0,1,1,0,0,0),gt.bind(void 0,1,1,0,0,1),gt.bind(void 0,1,1,0,0,2),gt.bind(void 0,1,1,0,0,3),gt.bind(void 0,1,1,0,1,0),gt.bind(void 0,1,1,0,1,1),gt.bind(void 0,1,1,0,1,2),gt.bind(void 0,1,1,0,1,3),gt.bind(void 0,1,1,1,0,0),gt.bind(void 0,1,1,1,0,1),gt.bind(void 0,1,1,1,0,2),gt.bind(void 0,1,1,1,0,3),gt.bind(void 0,1,1,1,1,0),gt.bind(void 0,1,1,1,1,1),gt.bind(void 0,1,1,1,1,2),gt.bind(void 0,1,1,1,1,3)];function mc(r){this.char=r,this.state={},this.activeState=null}function m1(r,e,t){this.contextName=t,this.startIndex=r,this.endOffset=e}function u8(r,e,t){this.contextName=r,this.openRange=null,this.ranges=[],this.checkStart=e,this.checkEnd=t}function Ra(r,e){this.context=r,this.index=e,this.length=r.length,this.current=r[e],this.backtrack=r.slice(0,e),this.lookahead=r.slice(e+1)}function Wg(r){this.eventId=r,this.subscribers=[]}function c8(r){var e=this,t=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];t.forEach(function(i){Object.defineProperty(e.events,i,{value:new Wg(i)})}),r&&t.forEach(function(i){var a=r[i];typeof a=="function"&&e.events[i].subscribe(a)});var n=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];n.forEach(function(i){e.events[i].subscribe(e.updateContextsRanges)})}function jn(r){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],c8.call(this,r)}mc.prototype.setState=function(r,e){return this.state[r]=e,this.activeState={key:r,value:this.state[r]},this.activeState};mc.prototype.getState=function(r){return this.state[r]||null};jn.prototype.inboundIndex=function(r){return r>=0&&r<this.tokens.length};jn.prototype.composeRUD=function(r){var e=this,t=!0,n=r.map(function(a){return e[a[0]].apply(e,a.slice(1).concat(t))}),i=function(a){return typeof a=="object"&&a.hasOwnProperty("FAIL")};if(n.every(i))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:n.filter(i)};this.dispatch("composeRUD",[n.filter(function(a){return!i(a)})])};jn.prototype.replaceRange=function(r,e,t,n){e=e!==null?e:this.tokens.length;var i=t.every(function(s){return s instanceof mc});if(!isNaN(r)&&this.inboundIndex(r)&&i){var a=this.tokens.splice.apply(this.tokens,[r,e].concat(t));return n||this.dispatch("replaceToken",[r,e,t]),[a,t]}else return{FAIL:"replaceRange: invalid tokens or startIndex."}};jn.prototype.replaceToken=function(r,e,t){if(!isNaN(r)&&this.inboundIndex(r)&&e instanceof mc){var n=this.tokens.splice(r,1,e);return t||this.dispatch("replaceToken",[r,e]),[n[0],e]}else return{FAIL:"replaceToken: invalid token or index."}};jn.prototype.removeRange=function(r,e,t){e=isNaN(e)?this.tokens.length:e;var n=this.tokens.splice(r,e);return t||this.dispatch("removeRange",[n,r,e]),n};jn.prototype.removeToken=function(r,e){if(!isNaN(r)&&this.inboundIndex(r)){var t=this.tokens.splice(r,1);return e||this.dispatch("removeToken",[t,r]),t}else return{FAIL:"removeToken: invalid token index."}};jn.prototype.insertToken=function(r,e,t){var n=r.every(function(i){return i instanceof mc});return n?(this.tokens.splice.apply(this.tokens,[e,0].concat(r)),t||this.dispatch("insertToken",[r,e]),r):{FAIL:"insertToken: invalid token(s)."}};jn.prototype.registerModifier=function(r,e,t){this.events.newToken.subscribe(function(n,i){var a=[n,i],s=e===null||e.apply(this,a)===!0,o=[n,i];if(s){var l=t.apply(this,o);n.setState(r,l)}}),this.registeredModifiers.push(r)};Wg.prototype.subscribe=function(r){return typeof r=="function"?this.subscribers.push(r)-1:{FAIL:"invalid '"+this.eventId+"' event handler"}};Wg.prototype.unsubscribe=function(r){this.subscribers.splice(r,1)};Ra.prototype.setCurrentIndex=function(r){this.index=r,this.current=this.context[r],this.backtrack=this.context.slice(0,r),this.lookahead=this.context.slice(r+1)};Ra.prototype.get=function(r){switch(!0){case r===0:return this.current;case(r<0&&Math.abs(r)<=this.backtrack.length):return this.backtrack.slice(r)[0];case(r>0&&r<=this.lookahead.length):return this.lookahead[r-1];default:return null}};jn.prototype.rangeToText=function(r){if(r instanceof m1)return this.getRangeTokens(r).map(function(e){return e.char}).join("")};jn.prototype.getText=function(){return this.tokens.map(function(r){return r.char}).join("")};jn.prototype.getContext=function(r){var e=this.registeredContexts[r];return e||null};jn.prototype.on=function(r,e){var t=this.events[r];return t?t.subscribe(e):null};jn.prototype.dispatch=function(r,e){var t=this,n=this.events[r];n instanceof Wg&&n.subscribers.forEach(function(i){i.apply(t,e||[])})};jn.prototype.registerContextChecker=function(r,e,t){if(this.getContext(r))return{FAIL:"context name '"+r+"' is already registered."};if(typeof e!="function")return{FAIL:"missing context start check."};if(typeof t!="function")return{FAIL:"missing context end check."};var n=new u8(r,e,t);return this.registeredContexts[r]=n,this.contextCheckers.push(n),n};jn.prototype.getRangeTokens=function(r){var e=r.startIndex+r.endOffset;return[].concat(this.tokens.slice(r.startIndex,e))};jn.prototype.getContextRanges=function(r){var e=this.getContext(r);return e?e.ranges:{FAIL:"context checker '"+r+"' is not registered."}};jn.prototype.resetContextsRanges=function(){var r=this.registeredContexts;for(var e in r)if(r.hasOwnProperty(e)){var t=r[e];t.ranges=[]}};jn.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var r=this.tokens.map(function(n){return n.char}),e=0;e<r.length;e++){var t=new Ra(r,e);this.runContextCheck(t)}this.dispatch("updateContextsRanges",[this.registeredContexts])};jn.prototype.setEndOffset=function(r,e){var t=this.getContext(e).openRange.startIndex,n=new m1(t,r,e),i=this.getContext(e).ranges;return n.rangeId=e+"."+i.length,i.push(n),this.getContext(e).openRange=null,n};jn.prototype.runContextCheck=function(r){var e=this,t=r.index;this.contextCheckers.forEach(function(n){var i=n.contextName,a=e.getContext(i).openRange;if(!a&&n.checkStart(r)&&(a=new m1(t,null,i),e.getContext(i).openRange=a,e.dispatch("contextStart",[i,t])),a&&n.checkEnd(r)){var s=t-a.startIndex+1,o=e.setEndOffset(s,i);e.dispatch("contextEnd",[i,o])}})};jn.prototype.tokenize=function(r){this.tokens=[],this.resetContextsRanges();var e=Array.from(r);this.dispatch("start");for(var t=0;t<e.length;t++){var n=e[t],i=new Ra(e,t);this.dispatch("next",[i]),this.runContextCheck(i);var a=new mc(n);this.tokens.push(a),this.dispatch("newToken",[a,i])}return this.dispatch("end",[this.tokens]),this.tokens};function vo(r){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(r)}function TF(r){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(r)}function Fo(r){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(r)}function Gp(r){return/[A-z]/.test(r)}function d8(r){return/\s/.test(r)}function aa(r){this.font=r,this.features={}}function vl(r){this.id=r.id,this.tag=r.tag,this.substitution=r.substitution}function Wf(r,e){if(!r)return-1;switch(e.format){case 1:return e.glyphs.indexOf(r);case 2:for(var t=e.ranges,n=0;n<t.length;n++){var i=t[n];if(r>=i.start&&r<=i.end){var a=r-i.start;return i.index+a}}break;default:return-1}return-1}function f8(r,e){var t=Wf(r,e.coverage);return t===-1?null:r+e.deltaGlyphId}function h8(r,e){var t=Wf(r,e.coverage);return t===-1?null:e.substitute[t]}function B0(r,e){for(var t=[],n=0;n<r.length;n++){var i=r[n],a=e.current;a=Array.isArray(a)?a[0]:a;var s=Wf(a,i);s!==-1&&t.push(s)}return t.length!==r.length?-1:t}function p8(r,e){var t=e.inputCoverage.length+e.lookaheadCoverage.length+e.backtrackCoverage.length;if(r.context.length<t)return[];var n=B0(e.inputCoverage,r);if(n===-1)return[];var i=e.inputCoverage.length-1;if(r.lookahead.length<e.lookaheadCoverage.length)return[];for(var a=r.lookahead.slice(i);a.length&&Fo(a[0].char);)a.shift();var s=new Ra(a,0),o=B0(e.lookaheadCoverage,s),l=[].concat(r.backtrack);for(l.reverse();l.length&&Fo(l[0].char);)l.shift();if(l.length<e.backtrackCoverage.length)return[];var u=new Ra(l,0),c=B0(e.backtrackCoverage,u),f=n.length===e.inputCoverage.length&&o.length===e.lookaheadCoverage.length&&c.length===e.backtrackCoverage.length,d=[];if(f)for(var h=0;h<e.lookupRecords.length;h++)for(var g=e.lookupRecords[h],v=g.lookupListIndex,y=this.getLookupByIndex(v),A=0;A<y.subtables.length;A++){var C=y.subtables[A],S=this.getLookupMethod(y,C),F=this.getSubstitutionType(y,C);if(F==="12")for(var E=0;E<n.length;E++){var R=r.get(E),B=S(R);B&&d.push(B)}}return d}function g8(r,e){var t=r.current,n=Wf(t,e.coverage);if(n===-1)return null;for(var i,a=e.ligatureSets[n],s=0;s<a.length;s++){i=a[s];for(var o=0;o<i.components.length;o++){var l=r.lookahead[o],u=i.components[o];if(l!==u)break;if(o===i.components.length-1)return i}}return null}function m8(r,e){var t=Wf(r,e.coverage);return t===-1?null:e.sequences[t]}aa.prototype.getDefaultScriptFeaturesIndexes=function(){for(var r=this.font.tables.gsub.scripts,e=0;e<r.length;e++){var t=r[e];if(t.tag==="DFLT")return t.script.defaultLangSys.featureIndexes}return[]};aa.prototype.getScriptFeaturesIndexes=function(r){var e=this.font.tables;if(!e.gsub)return[];if(!r)return this.getDefaultScriptFeaturesIndexes();for(var t=this.font.tables.gsub.scripts,n=0;n<t.length;n++){var i=t[n];if(i.tag===r&&i.script.defaultLangSys)return i.script.defaultLangSys.featureIndexes;var a=i.langSysRecords;if(a)for(var s=0;s<a.length;s++){var o=a[s];if(o.tag===r){var l=o.langSys;return l.featureIndexes}}}return this.getDefaultScriptFeaturesIndexes()};aa.prototype.mapTagsToFeatures=function(r,e){for(var t={},n=0;n<r.length;n++){var i=r[n].tag,a=r[n].feature;t[i]=a}this.features[e].tags=t};aa.prototype.getScriptFeatures=function(r){var e=this.features[r];if(this.features.hasOwnProperty(r))return e;var t=this.getScriptFeaturesIndexes(r);if(!t)return null;var n=this.font.tables.gsub;return e=t.map(function(i){return n.features[i]}),this.features[r]=e,this.mapTagsToFeatures(e,r),e};aa.prototype.getSubstitutionType=function(r,e){var t=r.lookupType.toString(),n=e.substFormat.toString();return t+n};aa.prototype.getLookupMethod=function(r,e){var t=this,n=this.getSubstitutionType(r,e);switch(n){case"11":return function(i){return f8.apply(t,[i,e])};case"12":return function(i){return h8.apply(t,[i,e])};case"63":return function(i){return p8.apply(t,[i,e])};case"41":return function(i){return g8.apply(t,[i,e])};case"21":return function(i){return m8.apply(t,[i,e])};default:throw new Error("lookupType: "+r.lookupType+" - substFormat: "+e.substFormat+" is not yet supported")}};aa.prototype.lookupFeature=function(r){var e=r.contextParams,t=e.index,n=this.getFeature({tag:r.tag,script:r.script});if(!n)return new Error("font '"+this.font.names.fullName.en+"' doesn't support feature '"+r.tag+"' for script '"+r.script+"'.");for(var i=this.getFeatureLookups(n),a=[].concat(e.context),s=0;s<i.length;s++)for(var o=i[s],l=this.getLookupSubtables(o),u=0;u<l.length;u++){var c=l[u],f=this.getSubstitutionType(o,c),d=this.getLookupMethod(o,c),h=void 0;switch(f){case"11":h=d(e.current),h&&a.splice(t,1,new vl({id:11,tag:r.tag,substitution:h}));break;case"12":h=d(e.current),h&&a.splice(t,1,new vl({id:12,tag:r.tag,substitution:h}));break;case"63":h=d(e),Array.isArray(h)&&h.length&&a.splice(t,1,new vl({id:63,tag:r.tag,substitution:h}));break;case"41":h=d(e),h&&a.splice(t,1,new vl({id:41,tag:r.tag,substitution:h}));break;case"21":h=d(e.current),h&&a.splice(t,1,new vl({id:21,tag:r.tag,substitution:h}));break}e=new Ra(a,t),!(Array.isArray(h)&&!h.length)&&(h=null)}return a.length?a:null};aa.prototype.supports=function(r){if(!r.script)return!1;this.getScriptFeatures(r.script);var e=this.features.hasOwnProperty(r.script);if(!r.tag)return e;var t=this.features[r.script].some(function(n){return n.tag===r.tag});return e&&t};aa.prototype.getLookupSubtables=function(r){return r.subtables||null};aa.prototype.getLookupByIndex=function(r){var e=this.font.tables.gsub.lookups;return e[r]||null};aa.prototype.getFeatureLookups=function(r){return r.lookupListIndexes.map(this.getLookupByIndex.bind(this))};aa.prototype.getFeature=function(e){if(!this.font)return{FAIL:"No font was found"};this.features.hasOwnProperty(e.script)||this.getScriptFeatures(e.script);var t=this.features[e.script];return t?t.tags[e.tag]?this.features[e.script].tags[e.tag]:null:{FAIL:"No feature for script "+e.script}};function v8(r){var e=r.current,t=r.get(-1);return t===null&&vo(e)||!vo(t)&&vo(e)}function y8(r){var e=r.get(1);return e===null||!vo(e)}var A8={startCheck:v8,endCheck:y8};function b8(r){var e=r.current,t=r.get(-1);return(vo(e)||Fo(e))&&!vo(t)}function w8(r){var e=r.get(1);switch(!0){case e===null:return!0;case(!vo(e)&&!Fo(e)):var t=d8(e);if(!t)return!0;if(t){var n=!1;if(n=r.lookahead.some(function(i){return vo(i)||Fo(i)}),!n)return!0}break;default:return!1}}var C8={startCheck:b8,endCheck:w8};function x8(r,e,t){e[t].setState(r.tag,r.substitution)}function S8(r,e,t){e[t].setState(r.tag,r.substitution)}function E8(r,e,t){r.substitution.forEach(function(n,i){var a=e[t+i];a.setState(r.tag,n)})}function k8(r,e,t){var n=e[t];n.setState(r.tag,r.substitution.ligGlyph);for(var i=r.substitution.components.length,a=0;a<i;a++)n=e[t+a+1],n.setState("deleted",!0)}var _x={11:x8,12:S8,63:E8,41:k8};function v1(r,e,t){r instanceof vl&&_x[r.id]&&_x[r.id](r,e,t)}function T8(r){for(var e=[].concat(r.backtrack),t=e.length-1;t>=0;t--){var n=e[t],i=TF(n),a=Fo(n);if(!i&&!a)return!0;if(i)return!1}return!1}function F8(r){if(TF(r.current))return!1;for(var e=0;e<r.lookahead.length;e++){var t=r.lookahead[e],n=Fo(t);if(!n)return!0}return!1}function I8(r){var e=this,t="arab",n=this.featuresTags[t],i=this.tokenizer.getRangeTokens(r);if(i.length!==1){var a=new Ra(i.map(function(o){return o.getState("glyphIndex")}),0),s=new Ra(i.map(function(o){return o.char}),0);i.forEach(function(o,l){if(!Fo(o.char)){a.setCurrentIndex(l),s.setCurrentIndex(l);var u=0;T8(s)&&(u|=1),F8(s)&&(u|=2);var c;switch(u){case 1:c="fina";break;case 2:c="init";break;case 3:c="medi";break}if(n.indexOf(c)!==-1){var f=e.query.lookupFeature({tag:c,script:t,contextParams:a});if(f instanceof Error)return console.info(f.message);f.forEach(function(d,h){d instanceof vl&&(v1(d,i,h),a.context[h]=d.substitution)})}}})}}function Nx(r,e){var t=r.map(function(n){return n.activeState.value});return new Ra(t,0)}function P8(r){var e=this,t="arab",n=this.tokenizer.getRangeTokens(r),i=Nx(n);i.context.forEach(function(a,s){i.setCurrentIndex(s);var o=e.query.lookupFeature({tag:"rlig",script:t,contextParams:i});o.length&&(o.forEach(function(l){return v1(l,n,s)}),i=Nx(n))})}function D8(r){var e=r.current,t=r.get(-1);return t===null&&Gp(e)||!Gp(t)&&Gp(e)}function R8(r){var e=r.get(1);return e===null||!Gp(e)}var O8={startCheck:D8,endCheck:R8};function Lx(r,e){var t=r.map(function(n){return n.activeState.value});return new Ra(t,0)}function B8(r){var e=this,t="latn",n=this.tokenizer.getRangeTokens(r),i=Lx(n);i.context.forEach(function(a,s){i.setCurrentIndex(s);var o=e.query.lookupFeature({tag:"liga",script:t,contextParams:i});o.length&&(o.forEach(function(l){return v1(l,n,s)}),i=Lx(n))})}function La(r){this.baseDir=r||"ltr",this.tokenizer=new jn,this.featuresTags={}}La.prototype.setText=function(r){this.text=r};La.prototype.contextChecks={latinWordCheck:O8,arabicWordCheck:A8,arabicSentenceCheck:C8};function M0(r){var e=this.contextChecks[r+"Check"];return this.tokenizer.registerContextChecker(r,e.startCheck,e.endCheck)}function M8(){return M0.call(this,"latinWord"),M0.call(this,"arabicWord"),M0.call(this,"arabicSentence"),this.tokenizer.tokenize(this.text)}function _8(){var r=this,e=this.tokenizer.getContextRanges("arabicSentence");e.forEach(function(t){var n=r.tokenizer.getRangeTokens(t);r.tokenizer.replaceRange(t.startIndex,t.endOffset,n.reverse())})}La.prototype.registerFeatures=function(r,e){var t=this,n=e.filter(function(i){return t.query.supports({script:r,tag:i})});this.featuresTags.hasOwnProperty(r)?this.featuresTags[r]=this.featuresTags[r].concat(n):this.featuresTags[r]=n};La.prototype.applyFeatures=function(r,e){if(!r)throw new Error("No valid font was provided to apply features");this.query||(this.query=new aa(r));for(var t=0;t<e.length;t++){var n=e[t];this.query.supports({script:n.script})&&this.registerFeatures(n.script,n.tags)}};La.prototype.registerModifier=function(r,e,t){this.tokenizer.registerModifier(r,e,t)};function y1(){if(this.tokenizer.registeredModifiers.indexOf("glyphIndex")===-1)throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function N8(){var r=this,e="arab";if(this.featuresTags.hasOwnProperty(e)){y1.call(this);var t=this.tokenizer.getContextRanges("arabicWord");t.forEach(function(n){I8.call(r,n)})}}function L8(){var r=this,e="arab";if(this.featuresTags.hasOwnProperty(e)){var t=this.featuresTags[e];if(t.indexOf("rlig")!==-1){y1.call(this);var n=this.tokenizer.getContextRanges("arabicWord");n.forEach(function(i){P8.call(r,i)})}}}function U8(){var r=this,e="latn";if(this.featuresTags.hasOwnProperty(e)){var t=this.featuresTags[e];if(t.indexOf("liga")!==-1){y1.call(this);var n=this.tokenizer.getContextRanges("latinWord");n.forEach(function(i){B8.call(r,i)})}}}La.prototype.checkContextReady=function(r){return!!this.tokenizer.getContext(r)};La.prototype.applyFeaturesToContexts=function(){this.checkContextReady("arabicWord")&&(N8.call(this),L8.call(this)),this.checkContextReady("latinWord")&&U8.call(this),this.checkContextReady("arabicSentence")&&_8.call(this)};La.prototype.processText=function(r){(!this.text||this.text!==r)&&(this.setText(r),M8.call(this),this.applyFeaturesToContexts())};La.prototype.getBidiText=function(r){return this.processText(r),this.tokenizer.getText()};La.prototype.getTextGlyphs=function(r){this.processText(r);for(var e=[],t=0;t<this.tokenizer.tokens.length;t++){var n=this.tokenizer.tokens[t];if(!n.state.deleted){var i=n.activeState.value;e.push(Array.isArray(i)?i[0]:i)}}return e};function hn(r){r=r||{},r.tables=r.tables||{},r.empty||(pd(r.familyName,"When creating a new Font object, familyName is required."),pd(r.styleName,"When creating a new Font object, styleName is required."),pd(r.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),pd(r.ascender,"When creating a new Font object, ascender is required."),pd(r.descender<=0,"When creating a new Font object, negative descender value is required."),this.names={fontFamily:{en:r.familyName||" "},fontSubfamily:{en:r.styleName||" "},fullName:{en:r.fullName||r.familyName+" "+r.styleName},postScriptName:{en:r.postScriptName||(r.familyName+r.styleName).replace(/\s/g,"")},designer:{en:r.designer||" "},designerURL:{en:r.designerURL||" "},manufacturer:{en:r.manufacturer||" "},manufacturerURL:{en:r.manufacturerURL||" "},license:{en:r.license||" "},licenseURL:{en:r.licenseURL||" "},version:{en:r.version||"Version 0.1"},description:{en:r.description||" "},copyright:{en:r.copyright||" "},trademark:{en:r.trademark||" "}},this.unitsPerEm=r.unitsPerEm||1e3,this.ascender=r.ascender,this.descender=r.descender,this.createdTimestamp=r.createdTimestamp,this.tables=Object.assign(r.tables,{os2:Object.assign({usWeightClass:r.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:r.widthClass||this.usWidthClasses.MEDIUM,fsSelection:r.fsSelection||this.fsSelectionValues.REGULAR},r.tables.os2)})),this.supported=!0,this.glyphs=new os.GlyphSet(this,r.glyphs||[]),this.encoding=new qT(this),this.position=new jf(this),this.substitution=new ia(this),this.tables=this.tables||{},this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){if(this._hinting)return this._hinting;if(this.outlinesFormat==="truetype")return this._hinting=new xF(this)}})}hn.prototype.hasChar=function(r){return this.encoding.charToGlyphIndex(r)!==null};hn.prototype.charToGlyphIndex=function(r){return this.encoding.charToGlyphIndex(r)};hn.prototype.charToGlyph=function(r){var e=this.charToGlyphIndex(r),t=this.glyphs.get(e);return t||(t=this.glyphs.get(0)),t};hn.prototype.updateFeatures=function(r){return this.defaultRenderOptions.features.map(function(e){return e.script==="latn"?{script:"latn",tags:e.tags.filter(function(t){return r[t]})}:e})};hn.prototype.stringToGlyphs=function(r,e){var t=this,n=new La,i=function(f){return t.charToGlyphIndex(f.char)};n.registerModifier("glyphIndex",null,i);var a=e?this.updateFeatures(e.features):this.defaultRenderOptions.features;n.applyFeatures(this,a);for(var s=n.getTextGlyphs(r),o=s.length,l=new Array(o),u=this.glyphs.get(0),c=0;c<o;c+=1)l[c]=this.glyphs.get(s[c])||u;return l};hn.prototype.nameToGlyphIndex=function(r){return this.glyphNames.nameToGlyphIndex(r)};hn.prototype.nameToGlyph=function(r){var e=this.nameToGlyphIndex(r),t=this.glyphs.get(e);return t||(t=this.glyphs.get(0)),t};hn.prototype.glyphIndexToName=function(r){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(r):""};hn.prototype.getKerningValue=function(r,e){r=r.index||r,e=e.index||e;var t=this.position.defaultKerningTables;return t?this.position.getKerningValue(t,r,e):this.kerningPairs[r+","+e]||0};hn.prototype.defaultRenderOptions={kerning:!0,features:[{script:"arab",tags:["init","medi","fina","rlig"]},{script:"latn",tags:["liga","rlig"]}]};hn.prototype.forEachGlyph=function(r,e,t,n,i,a){e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:72,i=Object.assign({},this.defaultRenderOptions,i);var s=1/this.unitsPerEm*n,o=this.stringToGlyphs(r,i),l;if(i.kerning){var u=i.script||this.position.getDefaultScriptName();l=this.position.getKerningTables(u,i.language)}for(var c=0;c<o.length;c+=1){var f=o[c];if(a.call(this,f,e,t,n,i),f.advanceWidth&&(e+=f.advanceWidth*s),i.kerning&&c<o.length-1){var d=l?this.position.getKerningValue(l,f.index,o[c+1].index):this.getKerningValue(f,o[c+1]);e+=d*s}i.letterSpacing?e+=i.letterSpacing*n:i.tracking&&(e+=i.tracking/1e3*n)}return e};hn.prototype.getPath=function(r,e,t,n,i){var a=new fi;return this.forEachGlyph(r,e,t,n,i,function(s,o,l,u){var c=s.getPath(o,l,u,i,this);a.extend(c)}),a};hn.prototype.getPaths=function(r,e,t,n,i){var a=[];return this.forEachGlyph(r,e,t,n,i,function(s,o,l,u){var c=s.getPath(o,l,u,i,this);a.push(c)}),a};hn.prototype.getAdvanceWidth=function(r,e,t){return this.forEachGlyph(r,0,0,e,t,function(){})};hn.prototype.draw=function(r,e,t,n,i,a){this.getPath(e,t,n,i,a).draw(r)};hn.prototype.drawPoints=function(r,e,t,n,i,a){this.forEachGlyph(e,t,n,i,a,function(s,o,l,u){s.drawPoints(r,o,l,u)})};hn.prototype.drawMetrics=function(r,e,t,n,i,a){this.forEachGlyph(e,t,n,i,a,function(s,o,l,u){s.drawMetrics(r,o,l,u)})};hn.prototype.getEnglishName=function(r){var e=this.names[r];if(e)return e.en};hn.prototype.validate=function(){var r=this;function e(n,i){}function t(n){var i=r.getEnglishName(n);i&&i.trim().length>0}t("fontFamily"),t("weightName"),t("manufacturer"),t("copyright"),t("version"),this.unitsPerEm>0};hn.prototype.toTables=function(){return kN.fontToTable(this)};hn.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()};hn.prototype.toArrayBuffer=function(){for(var r=this.toTables(),e=r.encode(),t=new ArrayBuffer(e.length),n=new Uint8Array(t),i=0;i<e.length;i++)n[i]=e[i];return t};hn.prototype.download=function(r){var e=this.getEnglishName("fontFamily"),t=this.getEnglishName("fontSubfamily");r=r||e.replace(/\s/g,"")+"-"+t+".otf";var n=this.toArrayBuffer();if(FN())if(window.URL=window.URL||window.webkitURL,window.URL){var i=new DataView(n),a=new Blob([i],{type:"font/opentype"}),s=document.createElement("a");s.href=window.URL.createObjectURL(a),s.download=r;var o=document.createEvent("MouseEvents");o.initEvent("click",!0,!1),s.dispatchEvent(o)}else console.warn("Font file could not be downloaded. Try using a different browser.");else{var l=require("fs"),u=IN(n);l.writeFileSync(r,u)}};hn.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512};hn.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9};hn.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};function FF(r,e){var t=JSON.stringify(r),n=256;for(var i in e){var a=parseInt(i);if(!(!a||a<256)){if(JSON.stringify(e[i])===t)return a;n<=a&&(n=a+1)}}return e[n]=r,n}function V8(r,e,t){var n=FF(e.name,t);return[{name:"tag_"+r,type:"TAG",value:e.tag},{name:"minValue_"+r,type:"FIXED",value:e.minValue<<16},{name:"defaultValue_"+r,type:"FIXED",value:e.defaultValue<<16},{name:"maxValue_"+r,type:"FIXED",value:e.maxValue<<16},{name:"flags_"+r,type:"USHORT",value:0},{name:"nameID_"+r,type:"USHORT",value:n}]}function z8(r,e,t){var n={},i=new vt.Parser(r,e);return n.tag=i.parseTag(),n.minValue=i.parseFixed(),n.defaultValue=i.parseFixed(),n.maxValue=i.parseFixed(),i.skip("uShort",1),n.name=t[i.parseUShort()]||{},n}function $8(r,e,t,n){for(var i=FF(e.name,n),a=[{name:"nameID_"+r,type:"USHORT",value:i},{name:"flags_"+r,type:"USHORT",value:0}],s=0;s<t.length;++s){var o=t[s].tag;a.push({name:"axis_"+r+" "+o,type:"FIXED",value:e.coordinates[o]<<16})}return a}function H8(r,e,t,n){var i={},a=new vt.Parser(r,e);i.name=n[a.parseUShort()]||{},a.skip("uShort",1),i.coordinates={};for(var s=0;s<t.length;++s)i.coordinates[t[s].tag]=a.parseFixed();return i}function j8(r,e){var t=new dt.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:r.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:r.instances.length},{name:"instanceSize",type:"USHORT",value:4+r.axes.length*4}]);t.offsetToData=t.sizeOf();for(var n=0;n<r.axes.length;n++)t.fields=t.fields.concat(V8(n,r.axes[n],e));for(var i=0;i<r.instances.length;i++)t.fields=t.fields.concat($8(i,r.instances[i],r.axes,e));return t}function G8(r,e,t){var n=new vt.Parser(r,e),i=n.parseULong();jt.argument(i===65536,"Unsupported fvar table version.");var a=n.parseOffset16();n.skip("uShort",1);for(var s=n.parseUShort(),o=n.parseUShort(),l=n.parseUShort(),u=n.parseUShort(),c=[],f=0;f<s;f++)c.push(z8(r,e+a+f*o,t));for(var d=[],h=e+a+s*o,g=0;g<l;g++)d.push(H8(r,h+g*u,c,t));return{axes:c,instances:d}}var q8={make:j8,parse:G8},W8=function(){return{coverage:this.parsePointer(we.coverage),attachPoints:this.parseList(we.pointer(we.uShortList))}},Q8=function(){var r=this.parseUShort();if(jt.argument(r===1||r===2||r===3,"Unsupported CaretValue table version."),r===1)return{coordinate:this.parseShort()};if(r===2)return{pointindex:this.parseShort()};if(r===3)return{coordinate:this.parseShort()}},Y8=function(){return this.parseList(we.pointer(Q8))},X8=function(){return{coverage:this.parsePointer(we.coverage),ligGlyphs:this.parseList(we.pointer(Y8))}},J8=function(){return this.parseUShort(),this.parseList(we.pointer(we.coverage))};function K8(r,e){e=e||0;var t=new we(r,e),n=t.parseVersion(1);jt.argument(n===1||n===1.2||n===1.3,"Unsupported GDEF table version.");var i={version:n,classDef:t.parsePointer(we.classDef),attachList:t.parsePointer(W8),ligCaretList:t.parsePointer(X8),markAttachClassDef:t.parsePointer(we.classDef)};return n>=1.2&&(i.markGlyphSets=t.parsePointer(J8)),i}var Z8={parse:K8},Oa=new Array(10);Oa[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{posFormat:1,coverage:this.parsePointer(we.coverage),value:this.parseValueRecord()};if(t===2)return{posFormat:2,coverage:this.parsePointer(we.coverage),values:this.parseValueRecordList()};jt.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")};Oa[2]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();jt.assert(t===1||t===2,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var n=this.parsePointer(we.coverage),i=this.parseUShort(),a=this.parseUShort();if(t===1)return{posFormat:t,coverage:n,valueFormat1:i,valueFormat2:a,pairSets:this.parseList(we.pointer(we.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(i),value2:this.parseValueRecord(a)}})))};if(t===2){var s=this.parsePointer(we.classDef),o=this.parsePointer(we.classDef),l=this.parseUShort(),u=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:i,valueFormat2:a,classDef1:s,classDef2:o,class1Count:l,class2Count:u,classRecords:this.parseList(l,we.list(u,function(){return{value1:this.parseValueRecord(i),value2:this.parseValueRecord(a)}}))}}};Oa[3]=function(){return{error:"GPOS Lookup 3 not supported"}};Oa[4]=function(){return{error:"GPOS Lookup 4 not supported"}};Oa[5]=function(){return{error:"GPOS Lookup 5 not supported"}};Oa[6]=function(){return{error:"GPOS Lookup 6 not supported"}};Oa[7]=function(){return{error:"GPOS Lookup 7 not supported"}};Oa[8]=function(){return{error:"GPOS Lookup 8 not supported"}};Oa[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function e7(r,e){e=e||0;var t=new we(r,e),n=t.parseVersion(1);return jt.argument(n===1||n===1.1,"Unsupported GPOS table version "+n),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(Oa)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(Oa),variations:t.parseFeatureVariationsList()}}var t7=new Array(10);function r7(r){return new dt.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new dt.ScriptList(r.scripts)},{name:"features",type:"TABLE",value:new dt.FeatureList(r.features)},{name:"lookups",type:"TABLE",value:new dt.LookupList(r.lookups,t7)}])}var n7={parse:e7,make:r7};function i7(r){var e={};r.skip("uShort");var t=r.parseUShort();jt.argument(t===0,"Unsupported kern sub-table version."),r.skip("uShort",2);var n=r.parseUShort();r.skip("uShort",3);for(var i=0;i<n;i+=1){var a=r.parseUShort(),s=r.parseUShort(),o=r.parseShort();e[a+","+s]=o}return e}function a7(r){var e={};r.skip("uShort");var t=r.parseULong();t>1&&console.warn("Only the first kern subtable is supported."),r.skip("uLong");var n=r.parseUShort(),i=n&255;if(r.skip("uShort"),i===0){var a=r.parseUShort();r.skip("uShort",3);for(var s=0;s<a;s+=1){var o=r.parseUShort(),l=r.parseUShort(),u=r.parseShort();e[o+","+l]=u}}return e}function s7(r,e){var t=new vt.Parser(r,e),n=t.parseUShort();if(n===0)return i7(t);if(n===1)return a7(t);throw new Error("Unsupported kern table version ("+n+").")}var o7={parse:s7};function l7(r,e,t,n){for(var i=new vt.Parser(r,e),a=n?i.parseUShort:i.parseULong,s=[],o=0;o<t+1;o+=1){var l=a.call(i);n&&(l*=2),s.push(l)}return s}var u7={parse:l7};function Ux(r,e){for(var t=[],n=12,i=0;i<e;i+=1){var a=vt.getTag(r,n),s=vt.getULong(r,n+4),o=vt.getULong(r,n+8),l=vt.getULong(r,n+12);t.push({tag:a,checksum:s,offset:o,length:l,compression:!1}),n+=16}return t}function c7(r,e){for(var t=[],n=44,i=0;i<e;i+=1){var a=vt.getTag(r,n),s=vt.getULong(r,n+4),o=vt.getULong(r,n+8),l=vt.getULong(r,n+12),u=void 0;o<l?u="WOFF":u=!1,t.push({tag:a,offset:s,compression:u,compressedLength:o,length:l}),n+=20}return t}function Qn(r,e){if(e.compression==="WOFF"){var t=new Uint8Array(r.buffer,e.offset+2,e.compressedLength-2),n=new Uint8Array(e.length);if(n5(t,n),n.byteLength!==e.length)throw new Error("Decompression error: "+e.tag+" decompressed length doesn't match recorded length");var i=new DataView(n.buffer,0);return{data:i,offset:0}}else return{data:r,offset:e.offset}}function rA(r,e){e=e??{};var t,n,i=new hn({empty:!0}),a=new DataView(r,0),s,o=[],l=vt.getTag(a,0);if(l==="\0\0\0"||l==="true"||l==="typ1")i.outlinesFormat="truetype",s=vt.getUShort(a,4),o=Ux(a,s);else if(l==="OTTO")i.outlinesFormat="cff",s=vt.getUShort(a,4),o=Ux(a,s);else if(l==="wOFF"){var u=vt.getTag(a,4);if(u==="\0\0\0")i.outlinesFormat="truetype";else if(u==="OTTO")i.outlinesFormat="cff";else throw new Error("Unsupported OpenType flavor "+l);s=vt.getUShort(a,12),o=c7(a,s)}else throw new Error("Unsupported OpenType signature "+l);for(var c,f,d,h,g,v,y,A,C,S,F,E,R=0;R<s;R+=1){var B=o[R],j=void 0;switch(B.tag){case"cmap":j=Qn(a,B),i.tables.cmap=GT.parse(j.data,j.offset),i.encoding=new WT(i.tables.cmap);break;case"cvt ":j=Qn(a,B),E=new vt.Parser(j.data,j.offset),i.tables.cvt=E.parseShortList(B.length/2);break;case"fvar":f=B;break;case"fpgm":j=Qn(a,B),E=new vt.Parser(j.data,j.offset),i.tables.fpgm=E.parseByteList(B.length);break;case"head":j=Qn(a,B),i.tables.head=nF.parse(j.data,j.offset),i.unitsPerEm=i.tables.head.unitsPerEm,t=i.tables.head.indexToLocFormat;break;case"hhea":j=Qn(a,B),i.tables.hhea=iF.parse(j.data,j.offset),i.ascender=i.tables.hhea.ascender,i.descender=i.tables.hhea.descender,i.numberOfHMetrics=i.tables.hhea.numberOfHMetrics;break;case"hmtx":y=B;break;case"ltag":j=Qn(a,B),n=sF.parse(j.data,j.offset);break;case"maxp":j=Qn(a,B),i.tables.maxp=oF.parse(j.data,j.offset),i.numGlyphs=i.tables.maxp.numGlyphs;break;case"name":S=B;break;case"OS/2":j=Qn(a,B),i.tables.os2=eA.parse(j.data,j.offset);break;case"post":j=Qn(a,B),i.tables.post=hF.parse(j.data,j.offset),i.glyphNames=new f1(i.tables.post);break;case"prep":j=Qn(a,B),E=new vt.Parser(j.data,j.offset),i.tables.prep=E.parseByteList(B.length);break;case"glyf":d=B;break;case"loca":C=B;break;case"CFF ":c=B;break;case"kern":A=B;break;case"GDEF":h=B;break;case"GPOS":g=B;break;case"GSUB":v=B;break;case"meta":F=B;break}}var G=Qn(a,S);if(i.tables.name=fF.parse(G.data,G.offset,n),i.names=i.tables.name,d&&C){var ie=t===0,q=Qn(a,C),Y=u7.parse(q.data,q.offset,i.numGlyphs,ie),J=Qn(a,d);i.glyphs=bF.parse(J.data,J.offset,Y,i,e)}else if(c){var ae=Qn(a,c);rF.parse(ae.data,ae.offset,i,e)}else throw new Error("Font doesn't contain TrueType or CFF outlines.");var oe=Qn(a,y);if(aF.parse(i,oe.data,oe.offset,i.numberOfHMetrics,i.numGlyphs,i.glyphs,e),S5(i,e),A){var he=Qn(a,A);i.kerningPairs=o7.parse(he.data,he.offset)}else i.kerningPairs={};if(h){var ye=Qn(a,h);i.tables.gdef=Z8.parse(ye.data,ye.offset)}if(g){var Ue=Qn(a,g);i.tables.gpos=n7.parse(Ue.data,Ue.offset),i.position.init()}if(v){var Re=Qn(a,v);i.tables.gsub=pF.parse(Re.data,Re.offset)}if(f){var Oe=Qn(a,f);i.tables.fvar=q8.parse(Oe.data,Oe.offset,i.names)}if(F){var ee=Qn(a,F);i.tables.meta=gF.parse(ee.data,ee.offset),i.metas=i.tables.meta}return i}var Mu=function(){return Mu=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Mu.apply(this,arguments)},d7="~",f7="~~";function A1(r,e){for(var t={},n={},i=r.split(f7),a=!1,s=0;i.length>s;s++){for(var o=i[s].split(d7),l=0;l<o.length;l+=2){var u=o[l],c=o[l+1],f="&"+u+";";t[f]=c,a&&(t["&"+u]=c),n[c]=f}a=!0}return e?{entities:Mu(Mu({},t),e.entities),characters:Mu(Mu({},n),e.characters)}:{entities:t,characters:n}}var _0={xml:/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html4:/∉|&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html5:/·|℗|⋇|⪧|⩺|⋗|⦕|⩼|⪆|⥸|⋗|⋛|⪌|≷|≳|⪦|⩹|⋖|⋋|⋉|⥶|⩻|⦖|◃|⊴|◂|∉|⋹̸|⋵̸|∉|⋷|⋶|∌|∌|⋾|⋽|∥|⊠|⨱|⨰|&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g},ic={};ic.xml=A1(`lt~<~gt~>~quot~"~apos~'~amp~&`);ic.html4=A1(`apos~'~OElig~Œ~oelig~œ~Scaron~Š~scaron~š~Yuml~Ÿ~circ~ˆ~tilde~˜~ensp~ ~emsp~ ~thinsp~ ~zwnj~~zwj~~lrm~~rlm~~ndash~–~mdash~—~lsquo~‘~rsquo~’~sbquo~‚~ldquo~“~rdquo~”~bdquo~„~dagger~†~Dagger~‡~permil~‰~lsaquo~‹~rsaquo~›~euro~€~fnof~ƒ~Alpha~Α~Beta~Β~Gamma~Γ~Delta~Δ~Epsilon~Ε~Zeta~Ζ~Eta~Η~Theta~Θ~Iota~Ι~Kappa~Κ~Lambda~Λ~Mu~Μ~Nu~Ν~Xi~Ξ~Omicron~Ο~Pi~Π~Rho~Ρ~Sigma~Σ~Tau~Τ~Upsilon~Υ~Phi~Φ~Chi~Χ~Psi~Ψ~Omega~Ω~alpha~α~beta~β~gamma~γ~delta~δ~epsilon~ε~zeta~ζ~eta~η~theta~θ~iota~ι~kappa~κ~lambda~λ~mu~μ~nu~ν~xi~ξ~omicron~ο~pi~π~rho~ρ~sigmaf~ς~sigma~σ~tau~τ~upsilon~υ~phi~φ~chi~χ~psi~ψ~omega~ω~thetasym~ϑ~upsih~ϒ~piv~ϖ~bull~•~hellip~…~prime~′~Prime~″~oline~‾~frasl~⁄~weierp~℘~image~ℑ~real~ℜ~trade~™~alefsym~ℵ~larr~←~uarr~↑~rarr~→~darr~↓~harr~↔~crarr~↵~lArr~⇐~uArr~⇑~rArr~⇒~dArr~⇓~hArr~⇔~forall~∀~part~∂~exist~∃~empty~∅~nabla~∇~isin~∈~notin~∉~ni~∋~prod~∏~sum~∑~minus~−~lowast~∗~radic~√~prop~∝~infin~∞~ang~∠~and~∧~or~∨~cap~∩~cup~∪~int~∫~there4~∴~sim~∼~cong~≅~asymp~≈~ne~≠~equiv~≡~le~≤~ge~≥~sub~⊂~sup~⊃~nsub~⊄~sube~⊆~supe~⊇~oplus~⊕~otimes~⊗~perp~⊥~sdot~⋅~lceil~⌈~rceil~⌉~lfloor~⌊~rfloor~⌋~lang~〈~rang~〉~loz~◊~spades~♠~clubs~♣~hearts~♥~diams~♦~~nbsp~ ~iexcl~¡~cent~¢~pound~£~curren~¤~yen~¥~brvbar~¦~sect~§~uml~¨~copy~©~ordf~ª~laquo~«~not~¬~shy~~reg~®~macr~¯~deg~°~plusmn~±~sup2~²~sup3~³~acute~´~micro~µ~para~¶~middot~·~cedil~¸~sup1~¹~ordm~º~raquo~»~frac14~¼~frac12~½~frac34~¾~iquest~¿~Agrave~À~Aacute~Á~Acirc~Â~Atilde~Ã~Auml~Ä~Aring~Å~AElig~Æ~Ccedil~Ç~Egrave~È~Eacute~É~Ecirc~Ê~Euml~Ë~Igrave~Ì~Iacute~Í~Icirc~Î~Iuml~Ï~ETH~Ð~Ntilde~Ñ~Ograve~Ò~Oacute~Ó~Ocirc~Ô~Otilde~Õ~Ouml~Ö~times~×~Oslash~Ø~Ugrave~Ù~Uacute~Ú~Ucirc~Û~Uuml~Ü~Yacute~Ý~THORN~Þ~szlig~ß~agrave~à~aacute~á~acirc~â~atilde~ã~auml~ä~aring~å~aelig~æ~ccedil~ç~egrave~è~eacute~é~ecirc~ê~euml~ë~igrave~ì~iacute~í~icirc~î~iuml~ï~eth~ð~ntilde~ñ~ograve~ò~oacute~ó~ocirc~ô~otilde~õ~ouml~ö~divide~÷~oslash~ø~ugrave~ù~uacute~ú~ucirc~û~uuml~ü~yacute~ý~thorn~þ~yuml~ÿ~quot~"~amp~&~lt~<~gt~>`);ic.html5=A1('Abreve~Ă~Acy~А~Afr~𝔄~Amacr~Ā~And~⩓~Aogon~Ą~Aopf~𝔸~ApplyFunction~~Ascr~𝒜~Assign~≔~Backslash~∖~Barv~⫧~Barwed~⌆~Bcy~Б~Because~∵~Bernoullis~ℬ~Bfr~𝔅~Bopf~𝔹~Breve~˘~Bscr~ℬ~Bumpeq~≎~CHcy~Ч~Cacute~Ć~Cap~⋒~CapitalDifferentialD~ⅅ~Cayleys~ℭ~Ccaron~Č~Ccirc~Ĉ~Cconint~∰~Cdot~Ċ~Cedilla~¸~CenterDot~·~Cfr~ℭ~CircleDot~⊙~CircleMinus~⊖~CirclePlus~⊕~CircleTimes~⊗~ClockwiseContourIntegral~∲~CloseCurlyDoubleQuote~”~CloseCurlyQuote~’~Colon~∷~Colone~⩴~Congruent~≡~Conint~∯~ContourIntegral~∮~Copf~ℂ~Coproduct~∐~CounterClockwiseContourIntegral~∳~Cross~⨯~Cscr~𝒞~Cup~⋓~CupCap~≍~DD~ⅅ~DDotrahd~⤑~DJcy~Ђ~DScy~Ѕ~DZcy~Џ~Darr~↡~Dashv~⫤~Dcaron~Ď~Dcy~Д~Del~∇~Dfr~𝔇~DiacriticalAcute~´~DiacriticalDot~˙~DiacriticalDoubleAcute~˝~DiacriticalGrave~`~DiacriticalTilde~˜~Diamond~⋄~DifferentialD~ⅆ~Dopf~𝔻~Dot~¨~DotDot~⃜~DotEqual~≐~DoubleContourIntegral~∯~DoubleDot~¨~DoubleDownArrow~⇓~DoubleLeftArrow~⇐~DoubleLeftRightArrow~⇔~DoubleLeftTee~⫤~DoubleLongLeftArrow~⟸~DoubleLongLeftRightArrow~⟺~DoubleLongRightArrow~⟹~DoubleRightArrow~⇒~DoubleRightTee~⊨~DoubleUpArrow~⇑~DoubleUpDownArrow~⇕~DoubleVerticalBar~∥~DownArrow~↓~DownArrowBar~⤓~DownArrowUpArrow~⇵~DownBreve~̑~DownLeftRightVector~⥐~DownLeftTeeVector~⥞~DownLeftVector~↽~DownLeftVectorBar~⥖~DownRightTeeVector~⥟~DownRightVector~⇁~DownRightVectorBar~⥗~DownTee~⊤~DownTeeArrow~↧~Downarrow~⇓~Dscr~𝒟~Dstrok~Đ~ENG~Ŋ~Ecaron~Ě~Ecy~Э~Edot~Ė~Efr~𝔈~Element~∈~Emacr~Ē~EmptySmallSquare~◻~EmptyVerySmallSquare~▫~Eogon~Ę~Eopf~𝔼~Equal~⩵~EqualTilde~≂~Equilibrium~⇌~Escr~ℰ~Esim~⩳~Exists~∃~ExponentialE~ⅇ~Fcy~Ф~Ffr~𝔉~FilledSmallSquare~◼~FilledVerySmallSquare~▪~Fopf~𝔽~ForAll~∀~Fouriertrf~ℱ~Fscr~ℱ~GJcy~Ѓ~Gammad~Ϝ~Gbreve~Ğ~Gcedil~Ģ~Gcirc~Ĝ~Gcy~Г~Gdot~Ġ~Gfr~𝔊~Gg~⋙~Gopf~𝔾~GreaterEqual~≥~GreaterEqualLess~⋛~GreaterFullEqual~≧~GreaterGreater~⪢~GreaterLess~≷~GreaterSlantEqual~⩾~GreaterTilde~≳~Gscr~𝒢~Gt~≫~HARDcy~Ъ~Hacek~ˇ~Hat~^~Hcirc~Ĥ~Hfr~ℌ~HilbertSpace~ℋ~Hopf~ℍ~HorizontalLine~─~Hscr~ℋ~Hstrok~Ħ~HumpDownHump~≎~HumpEqual~≏~IEcy~Е~IJlig~IJ~IOcy~Ё~Icy~И~Idot~İ~Ifr~ℑ~Im~ℑ~Imacr~Ī~ImaginaryI~ⅈ~Implies~⇒~Int~∬~Integral~∫~Intersection~⋂~InvisibleComma~~InvisibleTimes~~Iogon~Į~Iopf~𝕀~Iscr~ℐ~Itilde~Ĩ~Iukcy~І~Jcirc~Ĵ~Jcy~Й~Jfr~𝔍~Jopf~𝕁~Jscr~𝒥~Jsercy~Ј~Jukcy~Є~KHcy~Х~KJcy~Ќ~Kcedil~Ķ~Kcy~К~Kfr~𝔎~Kopf~𝕂~Kscr~𝒦~LJcy~Љ~Lacute~Ĺ~Lang~⟪~Laplacetrf~ℒ~Larr~↞~Lcaron~Ľ~Lcedil~Ļ~Lcy~Л~LeftAngleBracket~⟨~LeftArrow~←~LeftArrowBar~⇤~LeftArrowRightArrow~⇆~LeftCeiling~⌈~LeftDoubleBracket~⟦~LeftDownTeeVector~⥡~LeftDownVector~⇃~LeftDownVectorBar~⥙~LeftFloor~⌊~LeftRightArrow~↔~LeftRightVector~⥎~LeftTee~⊣~LeftTeeArrow~↤~LeftTeeVector~⥚~LeftTriangle~⊲~LeftTriangleBar~⧏~LeftTriangleEqual~⊴~LeftUpDownVector~⥑~LeftUpTeeVector~⥠~LeftUpVector~↿~LeftUpVectorBar~⥘~LeftVector~↼~LeftVectorBar~⥒~Leftarrow~⇐~Leftrightarrow~⇔~LessEqualGreater~⋚~LessFullEqual~≦~LessGreater~≶~LessLess~⪡~LessSlantEqual~⩽~LessTilde~≲~Lfr~𝔏~Ll~⋘~Lleftarrow~⇚~Lmidot~Ŀ~LongLeftArrow~⟵~LongLeftRightArrow~⟷~LongRightArrow~⟶~Longleftarrow~⟸~Longleftrightarrow~⟺~Longrightarrow~⟹~Lopf~𝕃~LowerLeftArrow~↙~LowerRightArrow~↘~Lscr~ℒ~Lsh~↰~Lstrok~Ł~Lt~≪~Map~⤅~Mcy~М~MediumSpace~ ~Mellintrf~ℳ~Mfr~𝔐~MinusPlus~∓~Mopf~𝕄~Mscr~ℳ~NJcy~Њ~Nacute~Ń~Ncaron~Ň~Ncedil~Ņ~Ncy~Н~NegativeMediumSpace~~NegativeThickSpace~~NegativeThinSpace~~NegativeVeryThinSpace~~NestedGreaterGreater~≫~NestedLessLess~≪~NewLine~\n~Nfr~𝔑~NoBreak~~NonBreakingSpace~ ~Nopf~ℕ~Not~⫬~NotCongruent~≢~NotCupCap~≭~NotDoubleVerticalBar~∦~NotElement~∉~NotEqual~≠~NotEqualTilde~≂̸~NotExists~∄~NotGreater~≯~NotGreaterEqual~≱~NotGreaterFullEqual~≧̸~NotGreaterGreater~≫̸~NotGreaterLess~≹~NotGreaterSlantEqual~⩾̸~NotGreaterTilde~≵~NotHumpDownHump~≎̸~NotHumpEqual~≏̸~NotLeftTriangle~⋪~NotLeftTriangleBar~⧏̸~NotLeftTriangleEqual~⋬~NotLess~≮~NotLessEqual~≰~NotLessGreater~≸~NotLessLess~≪̸~NotLessSlantEqual~⩽̸~NotLessTilde~≴~NotNestedGreaterGreater~⪢̸~NotNestedLessLess~⪡̸~NotPrecedes~⊀~NotPrecedesEqual~⪯̸~NotPrecedesSlantEqual~⋠~NotReverseElement~∌~NotRightTriangle~⋫~NotRightTriangleBar~⧐̸~NotRightTriangleEqual~⋭~NotSquareSubset~⊏̸~NotSquareSubsetEqual~⋢~NotSquareSuperset~⊐̸~NotSquareSupersetEqual~⋣~NotSubset~⊂⃒~NotSubsetEqual~⊈~NotSucceeds~⊁~NotSucceedsEqual~⪰̸~NotSucceedsSlantEqual~⋡~NotSucceedsTilde~≿̸~NotSuperset~⊃⃒~NotSupersetEqual~⊉~NotTilde~≁~NotTildeEqual~≄~NotTildeFullEqual~≇~NotTildeTilde~≉~NotVerticalBar~∤~Nscr~𝒩~Ocy~О~Odblac~Ő~Ofr~𝔒~Omacr~Ō~Oopf~𝕆~OpenCurlyDoubleQuote~“~OpenCurlyQuote~‘~Or~⩔~Oscr~𝒪~Otimes~⨷~OverBar~‾~OverBrace~⏞~OverBracket~⎴~OverParenthesis~⏜~PartialD~∂~Pcy~П~Pfr~𝔓~PlusMinus~±~Poincareplane~ℌ~Popf~ℙ~Pr~⪻~Precedes~≺~PrecedesEqual~⪯~PrecedesSlantEqual~≼~PrecedesTilde~≾~Product~∏~Proportion~∷~Proportional~∝~Pscr~𝒫~Qfr~𝔔~Qopf~ℚ~Qscr~𝒬~RBarr~⤐~Racute~Ŕ~Rang~⟫~Rarr~↠~Rarrtl~⤖~Rcaron~Ř~Rcedil~Ŗ~Rcy~Р~Re~ℜ~ReverseElement~∋~ReverseEquilibrium~⇋~ReverseUpEquilibrium~⥯~Rfr~ℜ~RightAngleBracket~⟩~RightArrow~→~RightArrowBar~⇥~RightArrowLeftArrow~⇄~RightCeiling~⌉~RightDoubleBracket~⟧~RightDownTeeVector~⥝~RightDownVector~⇂~RightDownVectorBar~⥕~RightFloor~⌋~RightTee~⊢~RightTeeArrow~↦~RightTeeVector~⥛~RightTriangle~⊳~RightTriangleBar~⧐~RightTriangleEqual~⊵~RightUpDownVector~⥏~RightUpTeeVector~⥜~RightUpVector~↾~RightUpVectorBar~⥔~RightVector~⇀~RightVectorBar~⥓~Rightarrow~⇒~Ropf~ℝ~RoundImplies~⥰~Rrightarrow~⇛~Rscr~ℛ~Rsh~↱~RuleDelayed~⧴~SHCHcy~Щ~SHcy~Ш~SOFTcy~Ь~Sacute~Ś~Sc~⪼~Scedil~Ş~Scirc~Ŝ~Scy~С~Sfr~𝔖~ShortDownArrow~↓~ShortLeftArrow~←~ShortRightArrow~→~ShortUpArrow~↑~SmallCircle~∘~Sopf~𝕊~Sqrt~√~Square~□~SquareIntersection~⊓~SquareSubset~⊏~SquareSubsetEqual~⊑~SquareSuperset~⊐~SquareSupersetEqual~⊒~SquareUnion~⊔~Sscr~𝒮~Star~⋆~Sub~⋐~Subset~⋐~SubsetEqual~⊆~Succeeds~≻~SucceedsEqual~⪰~SucceedsSlantEqual~≽~SucceedsTilde~≿~SuchThat~∋~Sum~∑~Sup~⋑~Superset~⊃~SupersetEqual~⊇~Supset~⋑~TRADE~™~TSHcy~Ћ~TScy~Ц~Tab~ ~Tcaron~Ť~Tcedil~Ţ~Tcy~Т~Tfr~𝔗~Therefore~∴~ThickSpace~ ~ThinSpace~ ~Tilde~∼~TildeEqual~≃~TildeFullEqual~≅~TildeTilde~≈~Topf~𝕋~TripleDot~⃛~Tscr~𝒯~Tstrok~Ŧ~Uarr~↟~Uarrocir~⥉~Ubrcy~Ў~Ubreve~Ŭ~Ucy~У~Udblac~Ű~Ufr~𝔘~Umacr~Ū~UnderBar~_~UnderBrace~⏟~UnderBracket~⎵~UnderParenthesis~⏝~Union~⋃~UnionPlus~⊎~Uogon~Ų~Uopf~𝕌~UpArrow~↑~UpArrowBar~⤒~UpArrowDownArrow~⇅~UpDownArrow~↕~UpEquilibrium~⥮~UpTee~⊥~UpTeeArrow~↥~Uparrow~⇑~Updownarrow~⇕~UpperLeftArrow~↖~UpperRightArrow~↗~Upsi~ϒ~Uring~Ů~Uscr~𝒰~Utilde~Ũ~VDash~⊫~Vbar~⫫~Vcy~В~Vdash~⊩~Vdashl~⫦~Vee~⋁~Verbar~‖~Vert~‖~VerticalBar~∣~VerticalLine~|~VerticalSeparator~❘~VerticalTilde~≀~VeryThinSpace~ ~Vfr~𝔙~Vopf~𝕍~Vscr~𝒱~Vvdash~⊪~Wcirc~Ŵ~Wedge~⋀~Wfr~𝔚~Wopf~𝕎~Wscr~𝒲~Xfr~𝔛~Xopf~𝕏~Xscr~𝒳~YAcy~Я~YIcy~Ї~YUcy~Ю~Ycirc~Ŷ~Ycy~Ы~Yfr~𝔜~Yopf~𝕐~Yscr~𝒴~ZHcy~Ж~Zacute~Ź~Zcaron~Ž~Zcy~З~Zdot~Ż~ZeroWidthSpace~~Zfr~ℨ~Zopf~ℤ~Zscr~𝒵~abreve~ă~ac~∾~acE~∾̳~acd~∿~acy~а~af~~afr~𝔞~aleph~ℵ~amacr~ā~amalg~⨿~andand~⩕~andd~⩜~andslope~⩘~andv~⩚~ange~⦤~angle~∠~angmsd~∡~angmsdaa~⦨~angmsdab~⦩~angmsdac~⦪~angmsdad~⦫~angmsdae~⦬~angmsdaf~⦭~angmsdag~⦮~angmsdah~⦯~angrt~∟~angrtvb~⊾~angrtvbd~⦝~angsph~∢~angst~Å~angzarr~⍼~aogon~ą~aopf~𝕒~ap~≈~apE~⩰~apacir~⩯~ape~≊~apid~≋~approx~≈~approxeq~≊~ascr~𝒶~ast~*~asympeq~≍~awconint~∳~awint~⨑~bNot~⫭~backcong~≌~backepsilon~϶~backprime~‵~backsim~∽~backsimeq~⋍~barvee~⊽~barwed~⌅~barwedge~⌅~bbrk~⎵~bbrktbrk~⎶~bcong~≌~bcy~б~becaus~∵~because~∵~bemptyv~⦰~bepsi~϶~bernou~ℬ~beth~ℶ~between~≬~bfr~𝔟~bigcap~⋂~bigcirc~◯~bigcup~⋃~bigodot~⨀~bigoplus~⨁~bigotimes~⨂~bigsqcup~⨆~bigstar~★~bigtriangledown~▽~bigtriangleup~△~biguplus~⨄~bigvee~⋁~bigwedge~⋀~bkarow~⤍~blacklozenge~⧫~blacksquare~▪~blacktriangle~▴~blacktriangledown~▾~blacktriangleleft~◂~blacktriangleright~▸~blank~␣~blk12~▒~blk14~░~blk34~▓~block~█~bne~=⃥~bnequiv~≡⃥~bnot~⌐~bopf~𝕓~bot~⊥~bottom~⊥~bowtie~⋈~boxDL~╗~boxDR~╔~boxDl~╖~boxDr~╓~boxH~═~boxHD~╦~boxHU~╩~boxHd~╤~boxHu~╧~boxUL~╝~boxUR~╚~boxUl~╜~boxUr~╙~boxV~║~boxVH~╬~boxVL~╣~boxVR~╠~boxVh~╫~boxVl~╢~boxVr~╟~boxbox~⧉~boxdL~╕~boxdR~╒~boxdl~┐~boxdr~┌~boxh~─~boxhD~╥~boxhU~╨~boxhd~┬~boxhu~┴~boxminus~⊟~boxplus~⊞~boxtimes~⊠~boxuL~╛~boxuR~╘~boxul~┘~boxur~└~boxv~│~boxvH~╪~boxvL~╡~boxvR~╞~boxvh~┼~boxvl~┤~boxvr~├~bprime~‵~breve~˘~bscr~𝒷~bsemi~⁏~bsim~∽~bsime~⋍~bsol~\\~bsolb~⧅~bsolhsub~⟈~bullet~•~bump~≎~bumpE~⪮~bumpe~≏~bumpeq~≏~cacute~ć~capand~⩄~capbrcup~⩉~capcap~⩋~capcup~⩇~capdot~⩀~caps~∩︀~caret~⁁~caron~ˇ~ccaps~⩍~ccaron~č~ccirc~ĉ~ccups~⩌~ccupssm~⩐~cdot~ċ~cemptyv~⦲~centerdot~·~cfr~𝔠~chcy~ч~check~✓~checkmark~✓~cir~○~cirE~⧃~circeq~≗~circlearrowleft~↺~circlearrowright~↻~circledR~®~circledS~Ⓢ~circledast~⊛~circledcirc~⊚~circleddash~⊝~cire~≗~cirfnint~⨐~cirmid~⫯~cirscir~⧂~clubsuit~♣~colon~:~colone~≔~coloneq~≔~comma~,~commat~@~comp~∁~compfn~∘~complement~∁~complexes~ℂ~congdot~⩭~conint~∮~copf~𝕔~coprod~∐~copysr~℗~cross~✗~cscr~𝒸~csub~⫏~csube~⫑~csup~⫐~csupe~⫒~ctdot~⋯~cudarrl~⤸~cudarrr~⤵~cuepr~⋞~cuesc~⋟~cularr~↶~cularrp~⤽~cupbrcap~⩈~cupcap~⩆~cupcup~⩊~cupdot~⊍~cupor~⩅~cups~∪︀~curarr~↷~curarrm~⤼~curlyeqprec~⋞~curlyeqsucc~⋟~curlyvee~⋎~curlywedge~⋏~curvearrowleft~↶~curvearrowright~↷~cuvee~⋎~cuwed~⋏~cwconint~∲~cwint~∱~cylcty~⌭~dHar~⥥~daleth~ℸ~dash~‐~dashv~⊣~dbkarow~⤏~dblac~˝~dcaron~ď~dcy~д~dd~ⅆ~ddagger~‡~ddarr~⇊~ddotseq~⩷~demptyv~⦱~dfisht~⥿~dfr~𝔡~dharl~⇃~dharr~⇂~diam~⋄~diamond~⋄~diamondsuit~♦~die~¨~digamma~ϝ~disin~⋲~div~÷~divideontimes~⋇~divonx~⋇~djcy~ђ~dlcorn~⌞~dlcrop~⌍~dollar~$~dopf~𝕕~dot~˙~doteq~≐~doteqdot~≑~dotminus~∸~dotplus~∔~dotsquare~⊡~doublebarwedge~⌆~downarrow~↓~downdownarrows~⇊~downharpoonleft~⇃~downharpoonright~⇂~drbkarow~⤐~drcorn~⌟~drcrop~⌌~dscr~𝒹~dscy~ѕ~dsol~⧶~dstrok~đ~dtdot~⋱~dtri~▿~dtrif~▾~duarr~⇵~duhar~⥯~dwangle~⦦~dzcy~џ~dzigrarr~⟿~eDDot~⩷~eDot~≑~easter~⩮~ecaron~ě~ecir~≖~ecolon~≕~ecy~э~edot~ė~ee~ⅇ~efDot~≒~efr~𝔢~eg~⪚~egs~⪖~egsdot~⪘~el~⪙~elinters~⏧~ell~ℓ~els~⪕~elsdot~⪗~emacr~ē~emptyset~∅~emptyv~∅~emsp13~ ~emsp14~ ~eng~ŋ~eogon~ę~eopf~𝕖~epar~⋕~eparsl~⧣~eplus~⩱~epsi~ε~epsiv~ϵ~eqcirc~≖~eqcolon~≕~eqsim~≂~eqslantgtr~⪖~eqslantless~⪕~equals~=~equest~≟~equivDD~⩸~eqvparsl~⧥~erDot~≓~erarr~⥱~escr~ℯ~esdot~≐~esim~≂~excl~!~expectation~ℰ~exponentiale~ⅇ~fallingdotseq~≒~fcy~ф~female~♀~ffilig~ffi~fflig~ff~ffllig~ffl~ffr~𝔣~filig~fi~fjlig~fj~flat~♭~fllig~fl~fltns~▱~fopf~𝕗~fork~⋔~forkv~⫙~fpartint~⨍~frac13~⅓~frac15~⅕~frac16~⅙~frac18~⅛~frac23~⅔~frac25~⅖~frac35~⅗~frac38~⅜~frac45~⅘~frac56~⅚~frac58~⅝~frac78~⅞~frown~⌢~fscr~𝒻~gE~≧~gEl~⪌~gacute~ǵ~gammad~ϝ~gap~⪆~gbreve~ğ~gcirc~ĝ~gcy~г~gdot~ġ~gel~⋛~geq~≥~geqq~≧~geqslant~⩾~ges~⩾~gescc~⪩~gesdot~⪀~gesdoto~⪂~gesdotol~⪄~gesl~⋛︀~gesles~⪔~gfr~𝔤~gg~≫~ggg~⋙~gimel~ℷ~gjcy~ѓ~gl~≷~glE~⪒~gla~⪥~glj~⪤~gnE~≩~gnap~⪊~gnapprox~⪊~gne~⪈~gneq~⪈~gneqq~≩~gnsim~⋧~gopf~𝕘~grave~`~gscr~ℊ~gsim~≳~gsime~⪎~gsiml~⪐~gtcc~⪧~gtcir~⩺~gtdot~⋗~gtlPar~⦕~gtquest~⩼~gtrapprox~⪆~gtrarr~⥸~gtrdot~⋗~gtreqless~⋛~gtreqqless~⪌~gtrless~≷~gtrsim~≳~gvertneqq~≩︀~gvnE~≩︀~hairsp~ ~half~½~hamilt~ℋ~hardcy~ъ~harrcir~⥈~harrw~↭~hbar~ℏ~hcirc~ĥ~heartsuit~♥~hercon~⊹~hfr~𝔥~hksearow~⤥~hkswarow~⤦~hoarr~⇿~homtht~∻~hookleftarrow~↩~hookrightarrow~↪~hopf~𝕙~horbar~―~hscr~𝒽~hslash~ℏ~hstrok~ħ~hybull~⁃~hyphen~‐~ic~~icy~и~iecy~е~iff~⇔~ifr~𝔦~ii~ⅈ~iiiint~⨌~iiint~∭~iinfin~⧜~iiota~℩~ijlig~ij~imacr~ī~imagline~ℐ~imagpart~ℑ~imath~ı~imof~⊷~imped~Ƶ~in~∈~incare~℅~infintie~⧝~inodot~ı~intcal~⊺~integers~ℤ~intercal~⊺~intlarhk~⨗~intprod~⨼~iocy~ё~iogon~į~iopf~𝕚~iprod~⨼~iscr~𝒾~isinE~⋹~isindot~⋵~isins~⋴~isinsv~⋳~isinv~∈~it~~itilde~ĩ~iukcy~і~jcirc~ĵ~jcy~й~jfr~𝔧~jmath~ȷ~jopf~𝕛~jscr~𝒿~jsercy~ј~jukcy~є~kappav~ϰ~kcedil~ķ~kcy~к~kfr~𝔨~kgreen~ĸ~khcy~х~kjcy~ќ~kopf~𝕜~kscr~𝓀~lAarr~⇚~lAtail~⤛~lBarr~⤎~lE~≦~lEg~⪋~lHar~⥢~lacute~ĺ~laemptyv~⦴~lagran~ℒ~langd~⦑~langle~⟨~lap~⪅~larrb~⇤~larrbfs~⤟~larrfs~⤝~larrhk~↩~larrlp~↫~larrpl~⤹~larrsim~⥳~larrtl~↢~lat~⪫~latail~⤙~late~⪭~lates~⪭︀~lbarr~⤌~lbbrk~❲~lbrace~{~lbrack~[~lbrke~⦋~lbrksld~⦏~lbrkslu~⦍~lcaron~ľ~lcedil~ļ~lcub~{~lcy~л~ldca~⤶~ldquor~„~ldrdhar~⥧~ldrushar~⥋~ldsh~↲~leftarrow~←~leftarrowtail~↢~leftharpoondown~↽~leftharpoonup~↼~leftleftarrows~⇇~leftrightarrow~↔~leftrightarrows~⇆~leftrightharpoons~⇋~leftrightsquigarrow~↭~leftthreetimes~⋋~leg~⋚~leq~≤~leqq~≦~leqslant~⩽~les~⩽~lescc~⪨~lesdot~⩿~lesdoto~⪁~lesdotor~⪃~lesg~⋚︀~lesges~⪓~lessapprox~⪅~lessdot~⋖~lesseqgtr~⋚~lesseqqgtr~⪋~lessgtr~≶~lesssim~≲~lfisht~⥼~lfr~𝔩~lg~≶~lgE~⪑~lhard~↽~lharu~↼~lharul~⥪~lhblk~▄~ljcy~љ~ll~≪~llarr~⇇~llcorner~⌞~llhard~⥫~lltri~◺~lmidot~ŀ~lmoust~⎰~lmoustache~⎰~lnE~≨~lnap~⪉~lnapprox~⪉~lne~⪇~lneq~⪇~lneqq~≨~lnsim~⋦~loang~⟬~loarr~⇽~lobrk~⟦~longleftarrow~⟵~longleftrightarrow~⟷~longmapsto~⟼~longrightarrow~⟶~looparrowleft~↫~looparrowright~↬~lopar~⦅~lopf~𝕝~loplus~⨭~lotimes~⨴~lowbar~_~lozenge~◊~lozf~⧫~lpar~(~lparlt~⦓~lrarr~⇆~lrcorner~⌟~lrhar~⇋~lrhard~⥭~lrtri~⊿~lscr~𝓁~lsh~↰~lsim~≲~lsime~⪍~lsimg~⪏~lsqb~[~lsquor~‚~lstrok~ł~ltcc~⪦~ltcir~⩹~ltdot~⋖~lthree~⋋~ltimes~⋉~ltlarr~⥶~ltquest~⩻~ltrPar~⦖~ltri~◃~ltrie~⊴~ltrif~◂~lurdshar~⥊~luruhar~⥦~lvertneqq~≨︀~lvnE~≨︀~mDDot~∺~male~♂~malt~✠~maltese~✠~map~↦~mapsto~↦~mapstodown~↧~mapstoleft~↤~mapstoup~↥~marker~▮~mcomma~⨩~mcy~м~measuredangle~∡~mfr~𝔪~mho~℧~mid~∣~midast~*~midcir~⫰~minusb~⊟~minusd~∸~minusdu~⨪~mlcp~⫛~mldr~…~mnplus~∓~models~⊧~mopf~𝕞~mp~∓~mscr~𝓂~mstpos~∾~multimap~⊸~mumap~⊸~nGg~⋙̸~nGt~≫⃒~nGtv~≫̸~nLeftarrow~⇍~nLeftrightarrow~⇎~nLl~⋘̸~nLt~≪⃒~nLtv~≪̸~nRightarrow~⇏~nVDash~⊯~nVdash~⊮~nacute~ń~nang~∠⃒~nap~≉~napE~⩰̸~napid~≋̸~napos~ʼn~napprox~≉~natur~♮~natural~♮~naturals~ℕ~nbump~≎̸~nbumpe~≏̸~ncap~⩃~ncaron~ň~ncedil~ņ~ncong~≇~ncongdot~⩭̸~ncup~⩂~ncy~н~neArr~⇗~nearhk~⤤~nearr~↗~nearrow~↗~nedot~≐̸~nequiv~≢~nesear~⤨~nesim~≂̸~nexist~∄~nexists~∄~nfr~𝔫~ngE~≧̸~nge~≱~ngeq~≱~ngeqq~≧̸~ngeqslant~⩾̸~nges~⩾̸~ngsim~≵~ngt~≯~ngtr~≯~nhArr~⇎~nharr~↮~nhpar~⫲~nis~⋼~nisd~⋺~niv~∋~njcy~њ~nlArr~⇍~nlE~≦̸~nlarr~↚~nldr~‥~nle~≰~nleftarrow~↚~nleftrightarrow~↮~nleq~≰~nleqq~≦̸~nleqslant~⩽̸~nles~⩽̸~nless~≮~nlsim~≴~nlt~≮~nltri~⋪~nltrie~⋬~nmid~∤~nopf~𝕟~notinE~⋹̸~notindot~⋵̸~notinva~∉~notinvb~⋷~notinvc~⋶~notni~∌~notniva~∌~notnivb~⋾~notnivc~⋽~npar~∦~nparallel~∦~nparsl~⫽⃥~npart~∂̸~npolint~⨔~npr~⊀~nprcue~⋠~npre~⪯̸~nprec~⊀~npreceq~⪯̸~nrArr~⇏~nrarr~↛~nrarrc~⤳̸~nrarrw~↝̸~nrightarrow~↛~nrtri~⋫~nrtrie~⋭~nsc~⊁~nsccue~⋡~nsce~⪰̸~nscr~𝓃~nshortmid~∤~nshortparallel~∦~nsim~≁~nsime~≄~nsimeq~≄~nsmid~∤~nspar~∦~nsqsube~⋢~nsqsupe~⋣~nsubE~⫅̸~nsube~⊈~nsubset~⊂⃒~nsubseteq~⊈~nsubseteqq~⫅̸~nsucc~⊁~nsucceq~⪰̸~nsup~⊅~nsupE~⫆̸~nsupe~⊉~nsupset~⊃⃒~nsupseteq~⊉~nsupseteqq~⫆̸~ntgl~≹~ntlg~≸~ntriangleleft~⋪~ntrianglelefteq~⋬~ntriangleright~⋫~ntrianglerighteq~⋭~num~#~numero~№~numsp~ ~nvDash~⊭~nvHarr~⤄~nvap~≍⃒~nvdash~⊬~nvge~≥⃒~nvgt~>⃒~nvinfin~⧞~nvlArr~⤂~nvle~≤⃒~nvlt~<⃒~nvltrie~⊴⃒~nvrArr~⤃~nvrtrie~⊵⃒~nvsim~∼⃒~nwArr~⇖~nwarhk~⤣~nwarr~↖~nwarrow~↖~nwnear~⤧~oS~Ⓢ~oast~⊛~ocir~⊚~ocy~о~odash~⊝~odblac~ő~odiv~⨸~odot~⊙~odsold~⦼~ofcir~⦿~ofr~𝔬~ogon~˛~ogt~⧁~ohbar~⦵~ohm~Ω~oint~∮~olarr~↺~olcir~⦾~olcross~⦻~olt~⧀~omacr~ō~omid~⦶~ominus~⊖~oopf~𝕠~opar~⦷~operp~⦹~orarr~↻~ord~⩝~order~ℴ~orderof~ℴ~origof~⊶~oror~⩖~orslope~⩗~orv~⩛~oscr~ℴ~osol~⊘~otimesas~⨶~ovbar~⌽~par~∥~parallel~∥~parsim~⫳~parsl~⫽~pcy~п~percnt~%~period~.~pertenk~‱~pfr~𝔭~phiv~ϕ~phmmat~ℳ~phone~☎~pitchfork~⋔~planck~ℏ~planckh~ℎ~plankv~ℏ~plus~+~plusacir~⨣~plusb~⊞~pluscir~⨢~plusdo~∔~plusdu~⨥~pluse~⩲~plussim~⨦~plustwo~⨧~pm~±~pointint~⨕~popf~𝕡~pr~≺~prE~⪳~prap~⪷~prcue~≼~pre~⪯~prec~≺~precapprox~⪷~preccurlyeq~≼~preceq~⪯~precnapprox~⪹~precneqq~⪵~precnsim~⋨~precsim~≾~primes~ℙ~prnE~⪵~prnap~⪹~prnsim~⋨~profalar~⌮~profline~⌒~profsurf~⌓~propto~∝~prsim~≾~prurel~⊰~pscr~𝓅~puncsp~ ~qfr~𝔮~qint~⨌~qopf~𝕢~qprime~⁗~qscr~𝓆~quaternions~ℍ~quatint~⨖~quest~?~questeq~≟~rAarr~⇛~rAtail~⤜~rBarr~⤏~rHar~⥤~race~∽̱~racute~ŕ~raemptyv~⦳~rangd~⦒~range~⦥~rangle~⟩~rarrap~⥵~rarrb~⇥~rarrbfs~⤠~rarrc~⤳~rarrfs~⤞~rarrhk~↪~rarrlp~↬~rarrpl~⥅~rarrsim~⥴~rarrtl~↣~rarrw~↝~ratail~⤚~ratio~∶~rationals~ℚ~rbarr~⤍~rbbrk~❳~rbrace~}~rbrack~]~rbrke~⦌~rbrksld~⦎~rbrkslu~⦐~rcaron~ř~rcedil~ŗ~rcub~}~rcy~р~rdca~⤷~rdldhar~⥩~rdquor~”~rdsh~↳~realine~ℛ~realpart~ℜ~reals~ℝ~rect~▭~rfisht~⥽~rfr~𝔯~rhard~⇁~rharu~⇀~rharul~⥬~rhov~ϱ~rightarrow~→~rightarrowtail~↣~rightharpoondown~⇁~rightharpoonup~⇀~rightleftarrows~⇄~rightleftharpoons~⇌~rightrightarrows~⇉~rightsquigarrow~↝~rightthreetimes~⋌~ring~˚~risingdotseq~≓~rlarr~⇄~rlhar~⇌~rmoust~⎱~rmoustache~⎱~rnmid~⫮~roang~⟭~roarr~⇾~robrk~⟧~ropar~⦆~ropf~𝕣~roplus~⨮~rotimes~⨵~rpar~)~rpargt~⦔~rppolint~⨒~rrarr~⇉~rscr~𝓇~rsh~↱~rsqb~]~rsquor~’~rthree~⋌~rtimes~⋊~rtri~▹~rtrie~⊵~rtrif~▸~rtriltri~⧎~ruluhar~⥨~rx~℞~sacute~ś~sc~≻~scE~⪴~scap~⪸~sccue~≽~sce~⪰~scedil~ş~scirc~ŝ~scnE~⪶~scnap~⪺~scnsim~⋩~scpolint~⨓~scsim~≿~scy~с~sdotb~⊡~sdote~⩦~seArr~⇘~searhk~⤥~searr~↘~searrow~↘~semi~;~seswar~⤩~setminus~∖~setmn~∖~sext~✶~sfr~𝔰~sfrown~⌢~sharp~♯~shchcy~щ~shcy~ш~shortmid~∣~shortparallel~∥~sigmav~ς~simdot~⩪~sime~≃~simeq~≃~simg~⪞~simgE~⪠~siml~⪝~simlE~⪟~simne~≆~simplus~⨤~simrarr~⥲~slarr~←~smallsetminus~∖~smashp~⨳~smeparsl~⧤~smid~∣~smile~⌣~smt~⪪~smte~⪬~smtes~⪬︀~softcy~ь~sol~/~solb~⧄~solbar~⌿~sopf~𝕤~spadesuit~♠~spar~∥~sqcap~⊓~sqcaps~⊓︀~sqcup~⊔~sqcups~⊔︀~sqsub~⊏~sqsube~⊑~sqsubset~⊏~sqsubseteq~⊑~sqsup~⊐~sqsupe~⊒~sqsupset~⊐~sqsupseteq~⊒~squ~□~square~□~squarf~▪~squf~▪~srarr~→~sscr~𝓈~ssetmn~∖~ssmile~⌣~sstarf~⋆~star~☆~starf~★~straightepsilon~ϵ~straightphi~ϕ~strns~¯~subE~⫅~subdot~⪽~subedot~⫃~submult~⫁~subnE~⫋~subne~⊊~subplus~⪿~subrarr~⥹~subset~⊂~subseteq~⊆~subseteqq~⫅~subsetneq~⊊~subsetneqq~⫋~subsim~⫇~subsub~⫕~subsup~⫓~succ~≻~succapprox~⪸~succcurlyeq~≽~succeq~⪰~succnapprox~⪺~succneqq~⪶~succnsim~⋩~succsim~≿~sung~♪~supE~⫆~supdot~⪾~supdsub~⫘~supedot~⫄~suphsol~⟉~suphsub~⫗~suplarr~⥻~supmult~⫂~supnE~⫌~supne~⊋~supplus~⫀~supset~⊃~supseteq~⊇~supseteqq~⫆~supsetneq~⊋~supsetneqq~⫌~supsim~⫈~supsub~⫔~supsup~⫖~swArr~⇙~swarhk~⤦~swarr~↙~swarrow~↙~swnwar~⤪~target~⌖~tbrk~⎴~tcaron~ť~tcedil~ţ~tcy~т~tdot~⃛~telrec~⌕~tfr~𝔱~therefore~∴~thetav~ϑ~thickapprox~≈~thicksim~∼~thkap~≈~thksim~∼~timesb~⊠~timesbar~⨱~timesd~⨰~tint~∭~toea~⤨~top~⊤~topbot~⌶~topcir~⫱~topf~𝕥~topfork~⫚~tosa~⤩~tprime~‴~triangle~▵~triangledown~▿~triangleleft~◃~trianglelefteq~⊴~triangleq~≜~triangleright~▹~trianglerighteq~⊵~tridot~◬~trie~≜~triminus~⨺~triplus~⨹~trisb~⧍~tritime~⨻~trpezium~⏢~tscr~𝓉~tscy~ц~tshcy~ћ~tstrok~ŧ~twixt~≬~twoheadleftarrow~↞~twoheadrightarrow~↠~uHar~⥣~ubrcy~ў~ubreve~ŭ~ucy~у~udarr~⇅~udblac~ű~udhar~⥮~ufisht~⥾~ufr~𝔲~uharl~↿~uharr~↾~uhblk~▀~ulcorn~⌜~ulcorner~⌜~ulcrop~⌏~ultri~◸~umacr~ū~uogon~ų~uopf~𝕦~uparrow~↑~updownarrow~↕~upharpoonleft~↿~upharpoonright~↾~uplus~⊎~upsi~υ~upuparrows~⇈~urcorn~⌝~urcorner~⌝~urcrop~⌎~uring~ů~urtri~◹~uscr~𝓊~utdot~⋰~utilde~ũ~utri~▵~utrif~▴~uuarr~⇈~uwangle~⦧~vArr~⇕~vBar~⫨~vBarv~⫩~vDash~⊨~vangrt~⦜~varepsilon~ϵ~varkappa~ϰ~varnothing~∅~varphi~ϕ~varpi~ϖ~varpropto~∝~varr~↕~varrho~ϱ~varsigma~ς~varsubsetneq~⊊︀~varsubsetneqq~⫋︀~varsupsetneq~⊋︀~varsupsetneqq~⫌︀~vartheta~ϑ~vartriangleleft~⊲~vartriangleright~⊳~vcy~в~vdash~⊢~vee~∨~veebar~⊻~veeeq~≚~vellip~⋮~verbar~|~vert~|~vfr~𝔳~vltri~⊲~vnsub~⊂⃒~vnsup~⊃⃒~vopf~𝕧~vprop~∝~vrtri~⊳~vscr~𝓋~vsubnE~⫋︀~vsubne~⊊︀~vsupnE~⫌︀~vsupne~⊋︀~vzigzag~⦚~wcirc~ŵ~wedbar~⩟~wedge~∧~wedgeq~≙~wfr~𝔴~wopf~𝕨~wp~℘~wr~≀~wreath~≀~wscr~𝓌~xcap~⋂~xcirc~◯~xcup~⋃~xdtri~▽~xfr~𝔵~xhArr~⟺~xharr~⟷~xlArr~⟸~xlarr~⟵~xmap~⟼~xnis~⋻~xodot~⨀~xopf~𝕩~xoplus~⨁~xotime~⨂~xrArr~⟹~xrarr~⟶~xscr~𝓍~xsqcup~⨆~xuplus~⨄~xutri~△~xvee~⋁~xwedge~⋀~yacy~я~ycirc~ŷ~ycy~ы~yfr~𝔶~yicy~ї~yopf~𝕪~yscr~𝓎~yucy~ю~zacute~ź~zcaron~ž~zcy~з~zdot~ż~zeetrf~ℨ~zfr~𝔷~zhcy~ж~zigrarr~⇝~zopf~𝕫~zscr~𝓏~~AMP~&~COPY~©~GT~>~LT~<~QUOT~"~REG~®',ic.html4);var h7={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},p7=String.fromCodePoint||function(r){return String.fromCharCode(Math.floor((r-65536)/1024)+55296,(r-65536)%1024+56320)},ac=function(){return ac=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},ac.apply(this,arguments)},g7=ac(ac({},ic),{all:ic.html5}),m7={scope:"body",level:"all"},N0=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g,L0=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g,Vx={xml:{strict:N0,attribute:L0,body:_0.xml},html4:{strict:N0,attribute:L0,body:_0.html4},html5:{strict:N0,attribute:L0,body:_0.html5}},v7=ac(ac({},Vx),{all:Vx.html5}),IF=String.fromCharCode,y7=IF(65533);function A7(r,e,t,n){var i=r,a=r[r.length-1];if(t&&a==="=")i=r;else if(n&&a!==";")i=r;else{var s=e[r];if(s)i=s;else if(r[0]==="&"&&r[1]==="#"){var o=r[2],l=o=="x"||o=="X"?parseInt(r.substr(3),16):parseInt(r.substr(2));i=l>=1114111?y7:l>65535?p7(l):IF(h7[l]||l)}}return i}function b7(r,e){var t=m7,n=t.level,i=n===void 0?"all":n,a=t.scope,s=a===void 0?i==="xml"?"strict":"body":a;if(!r)return"";var o=v7[i][s],l=g7[i].entities,u=s==="attribute",c=s==="strict";return r.replace(o,function(f){return A7(f,l,u,c)})}const PF=new Map;class w7{constructor(e){this.font=e,this.glyphsFromText=new Map,this.kerningValues=new Map,this.height=this.calculateApproximateHeight()}getFont(){return this.font}getGlyphs(e){const t=this.glyphsFromText.get(e);if(t)return t;const n=this.font.stringToGlyphs(e);return this.glyphsFromText.set(e,n),n}getApproximateHeight(){return this.height}getExactHeight(e){const t=this.font.stringToGlyphs(e);let n=0,i=0;return t.forEach(a=>{const s=a.getMetrics();n=Math.max(n,s.yMax),i=Math.min(i,s.yMin)}),n-i}getKerningValue(e,t){if(!e.name||!t.name)return;let n=this.kerningValues.get(e.name);n||(n=new Map,this.kerningValues.set(e.name,n));let i=n.get(t.name);return i||(i=this.font.getKerningValue(e,t),n.set(t.name,i)),i}calculateApproximateHeight(){const t=this.font.stringToGlyphs("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");let n=0,i=0;return t.forEach(a=>{const s=a.getMetrics();n=Math.max(n,s.yMax),i=Math.min(i,s.yMin)}),n-i}}const C7=r=>r.substring(0,5).toLowerCase().trim()==="data:",U0=new Map,Rl=async r=>{if(U0.has(r))return U0.get(r);const t=(async()=>{try{return Io(r).getFont()}catch{if(C7(r)){const n=qk(r),i=rA(n);return nA(r,i),i}else{const n=await Ng(r,!0),i=rA(n);return nA(r,i),await _4(i,r),i}}})();return U0.set(r,t),t},x7=r=>{const e=qk(r),t=rA(e);return nA(r,t),t},Io=r=>{const e=PF.get(r);if(e)return e;throw new Error("Font metrics unavailable for font")},nA=(r,e)=>{const t=new w7(e);return PF.set(r,t),t},S7=async r=>{const e=us(),t=e.parseFromString(r,"image/svg+xml"),n=t.firstElementChild,i=new Map;n.querySelectorAll("style").forEach(c=>{Kk.parse(c.innerHTML).stylesheet?.rules.forEach(d=>{if(d.type==="font-face"&&d.declarations){const h=d.declarations.find(y=>y.property==="font-family")?.value,v=d.declarations.find(y=>y.property==="src")?.value?.match(/'(https.*?)'/)?.[1];h&&v&&i.set(h,v)}})});const s=t.querySelectorAll("tspan");for(let c=0;c<s.length;c++){const f=s.item(c),d=f.closest("text"),h=f.closest("g"),g=d.getAttribute("font-family"),v=await Rl(i.get(g)),y=b7(f.innerHTML),A=d.getAttribute("fill"),C=d.getAttribute("stroke"),S=d.getAttribute("stroke-width"),F=v.getPath(y,0,0,parseInt(d.getAttribute("font-size")??"72")),E=F.getBoundingBox().x2-F.getBoundingBox().x1;let R=0;const B=f.getAttribute("text-anchor");B==="middle"?R=E/2:B==="end"&&(R=E);const j=v.getPath(y,parseFloat(f.getAttribute("x")??"0")-R,parseFloat(f.getAttribute("y")??"0"),parseInt(d.getAttribute("font-size")??"72"));j.fill=A,j.stroke=C,j.strokeWidth=parseFloat(S??"0");const G=j.toSVG(2),q=e.parseFromString(G,"image/svg+xml").firstElementChild;h.appendChild(q)}return t.querySelectorAll("text").forEach(c=>c.remove()),Do().serializeToString(n)},fg=(r,e,t,n)=>Math.max(F7(r.join(`
|
|
1782
|
+
`,children:At.jsx(_T,{id:e,x:0,y:0,rotation:0,width:r.width,height:r.height,clipPath:r.path,children:c()})})})]})};String.prototype.codePointAt||(function(){var r=(function(){try{var t={},n=Object.defineProperty,i=n(t,t,t)&&n}catch{}return i})(),e=function(t){if(this==null)throw TypeError();var n=String(this),i=n.length,a=t?Number(t):0;if(a!=a&&(a=0),!(a<0||a>=i)){var s=n.charCodeAt(a),o;return s>=55296&&s<=56319&&i>a+1&&(o=n.charCodeAt(a+1),o>=56320&&o<=57343)?(s-55296)*1024+o-56320+65536:s}};r?r(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e})();var l1=0,NT=-3;function yf(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function X_(r,e){this.source=r,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=e,this.destLen=0,this.ltree=new yf,this.dtree=new yf}var LT=new yf,UT=new yf,u1=new Uint8Array(30),c1=new Uint16Array(30),VT=new Uint8Array(30),zT=new Uint16Array(30),J_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),tx=new yf,Wa=new Uint8Array(320);function $T(r,e,t,n){var i,a;for(i=0;i<t;++i)r[i]=0;for(i=0;i<30-t;++i)r[i+t]=i/t|0;for(a=n,i=0;i<30;++i)e[i]=a,a+=1<<r[i]}function K_(r,e){var t;for(t=0;t<7;++t)r.table[t]=0;for(r.table[7]=24,r.table[8]=152,r.table[9]=112,t=0;t<24;++t)r.trans[t]=256+t;for(t=0;t<144;++t)r.trans[24+t]=t;for(t=0;t<8;++t)r.trans[168+t]=280+t;for(t=0;t<112;++t)r.trans[176+t]=144+t;for(t=0;t<5;++t)e.table[t]=0;for(e.table[5]=32,t=0;t<32;++t)e.trans[t]=t}var rx=new Uint16Array(16);function T0(r,e,t,n){var i,a;for(i=0;i<16;++i)r.table[i]=0;for(i=0;i<n;++i)r.table[e[t+i]]++;for(r.table[0]=0,a=0,i=0;i<16;++i)rx[i]=a,a+=r.table[i];for(i=0;i<n;++i)e[t+i]&&(r.trans[rx[e[t+i]]++]=i)}function Z_(r){r.bitcount--||(r.tag=r.source[r.sourceIndex++],r.bitcount=7);var e=r.tag&1;return r.tag>>>=1,e}function Za(r,e,t){if(!e)return t;for(;r.bitcount<24;)r.tag|=r.source[r.sourceIndex++]<<r.bitcount,r.bitcount+=8;var n=r.tag&65535>>>16-e;return r.tag>>>=e,r.bitcount-=e,n+t}function Wy(r,e){for(;r.bitcount<24;)r.tag|=r.source[r.sourceIndex++]<<r.bitcount,r.bitcount+=8;var t=0,n=0,i=0,a=r.tag;do n=2*n+(a&1),a>>>=1,++i,t+=e.table[i],n-=e.table[i];while(n>=0);return r.tag=a,r.bitcount-=i,e.trans[t+n]}function e5(r,e,t){var n,i,a,s,o,l;for(n=Za(r,5,257),i=Za(r,5,1),a=Za(r,4,4),s=0;s<19;++s)Wa[s]=0;for(s=0;s<a;++s){var u=Za(r,3,0);Wa[J_[s]]=u}for(T0(tx,Wa,0,19),o=0;o<n+i;){var c=Wy(r,tx);switch(c){case 16:var f=Wa[o-1];for(l=Za(r,2,3);l;--l)Wa[o++]=f;break;case 17:for(l=Za(r,3,3);l;--l)Wa[o++]=0;break;case 18:for(l=Za(r,7,11);l;--l)Wa[o++]=0;break;default:Wa[o++]=c;break}}T0(e,Wa,0,n),T0(t,Wa,n,i)}function nx(r,e,t){for(;;){var n=Wy(r,e);if(n===256)return l1;if(n<256)r.dest[r.destLen++]=n;else{var i,a,s,o;for(n-=257,i=Za(r,u1[n],c1[n]),a=Wy(r,t),s=r.destLen-Za(r,VT[a],zT[a]),o=s;o<s+i;++o)r.dest[r.destLen++]=r.dest[o]}}}function t5(r){for(var e,t,n;r.bitcount>8;)r.sourceIndex--,r.bitcount-=8;if(e=r.source[r.sourceIndex+1],e=256*e+r.source[r.sourceIndex],t=r.source[r.sourceIndex+3],t=256*t+r.source[r.sourceIndex+2],e!==(~t&65535))return NT;for(r.sourceIndex+=4,n=e;n;--n)r.dest[r.destLen++]=r.source[r.sourceIndex++];return r.bitcount=0,l1}function r5(r,e){var t=new X_(r,e),n,i,a;do{switch(n=Z_(t),i=Za(t,2,0),i){case 0:a=t5(t);break;case 1:a=nx(t,LT,UT);break;case 2:e5(t,t.ltree,t.dtree),a=nx(t,t.ltree,t.dtree);break;default:a=NT}if(a!==l1)throw new Error("Data error")}while(!n);return t.destLen<t.dest.length?typeof t.dest.slice=="function"?t.dest.slice(0,t.destLen):t.dest.subarray(0,t.destLen):t.dest}K_(LT,UT);$T(u1,c1,4,3);$T(VT,zT,2,1);u1[28]=0;c1[28]=258;var n5=r5;function Cu(r,e,t,n,i){return Math.pow(1-i,3)*r+3*Math.pow(1-i,2)*i*e+3*(1-i)*Math.pow(i,2)*t+Math.pow(i,3)*n}function Bo(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}Bo.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)};Bo.prototype.addPoint=function(r,e){typeof r=="number"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=r,this.x2=r),r<this.x1&&(this.x1=r),r>this.x2&&(this.x2=r)),typeof e=="number"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))};Bo.prototype.addX=function(r){this.addPoint(r,null)};Bo.prototype.addY=function(r){this.addPoint(null,r)};Bo.prototype.addBezier=function(r,e,t,n,i,a,s,o){var l=[r,e],u=[t,n],c=[i,a],f=[s,o];this.addPoint(r,e),this.addPoint(s,o);for(var d=0;d<=1;d++){var h=6*l[d]-12*u[d]+6*c[d],g=-3*l[d]+9*u[d]-9*c[d]+3*f[d],v=3*u[d]-3*l[d];if(g===0){if(h===0)continue;var y=-v/h;0<y&&y<1&&(d===0&&this.addX(Cu(l[d],u[d],c[d],f[d],y)),d===1&&this.addY(Cu(l[d],u[d],c[d],f[d],y)));continue}var A=Math.pow(h,2)-4*v*g;if(!(A<0)){var C=(-h+Math.sqrt(A))/(2*g);0<C&&C<1&&(d===0&&this.addX(Cu(l[d],u[d],c[d],f[d],C)),d===1&&this.addY(Cu(l[d],u[d],c[d],f[d],C)));var S=(-h-Math.sqrt(A))/(2*g);0<S&&S<1&&(d===0&&this.addX(Cu(l[d],u[d],c[d],f[d],S)),d===1&&this.addY(Cu(l[d],u[d],c[d],f[d],S)))}}};Bo.prototype.addQuad=function(r,e,t,n,i,a){var s=r+.6666666666666666*(t-r),o=e+2/3*(n-e),l=s+1/3*(i-r),u=o+1/3*(a-e);this.addBezier(r,e,s,o,l,u,i,a)};function fi(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}fi.prototype.moveTo=function(r,e){this.commands.push({type:"M",x:r,y:e})};fi.prototype.lineTo=function(r,e){this.commands.push({type:"L",x:r,y:e})};fi.prototype.curveTo=fi.prototype.bezierCurveTo=function(r,e,t,n,i,a){this.commands.push({type:"C",x1:r,y1:e,x2:t,y2:n,x:i,y:a})};fi.prototype.quadTo=fi.prototype.quadraticCurveTo=function(r,e,t,n){this.commands.push({type:"Q",x1:r,y1:e,x:t,y:n})};fi.prototype.close=fi.prototype.closePath=function(){this.commands.push({type:"Z"})};fi.prototype.extend=function(r){if(r.commands)r=r.commands;else if(r instanceof Bo){var e=r;this.moveTo(e.x1,e.y1),this.lineTo(e.x2,e.y1),this.lineTo(e.x2,e.y2),this.lineTo(e.x1,e.y2),this.close();return}Array.prototype.push.apply(this.commands,r)};fi.prototype.getBoundingBox=function(){for(var r=new Bo,e=0,t=0,n=0,i=0,a=0;a<this.commands.length;a++){var s=this.commands[a];switch(s.type){case"M":r.addPoint(s.x,s.y),e=n=s.x,t=i=s.y;break;case"L":r.addPoint(s.x,s.y),n=s.x,i=s.y;break;case"Q":r.addQuad(n,i,s.x1,s.y1,s.x,s.y),n=s.x,i=s.y;break;case"C":r.addBezier(n,i,s.x1,s.y1,s.x2,s.y2,s.x,s.y),n=s.x,i=s.y;break;case"Z":n=e,i=t;break;default:throw new Error("Unexpected path command "+s.type)}}return r.isEmpty()&&r.addPoint(0,0),r};fi.prototype.draw=function(r){r.beginPath();for(var e=0;e<this.commands.length;e+=1){var t=this.commands[e];t.type==="M"?r.moveTo(t.x,t.y):t.type==="L"?r.lineTo(t.x,t.y):t.type==="C"?r.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y):t.type==="Q"?r.quadraticCurveTo(t.x1,t.y1,t.x,t.y):t.type==="Z"&&r.closePath()}this.fill&&(r.fillStyle=this.fill,r.fill()),this.stroke&&(r.strokeStyle=this.stroke,r.lineWidth=this.strokeWidth,r.stroke())};fi.prototype.toPathData=function(r){r=r!==void 0?r:2;function e(s){return Math.round(s)===s?""+Math.round(s):s.toFixed(r)}function t(){for(var s=arguments,o="",l=0;l<arguments.length;l+=1){var u=s[l];u>=0&&l>0&&(o+=" "),o+=e(u)}return o}for(var n="",i=0;i<this.commands.length;i+=1){var a=this.commands[i];a.type==="M"?n+="M"+t(a.x,a.y):a.type==="L"?n+="L"+t(a.x,a.y):a.type==="C"?n+="C"+t(a.x1,a.y1,a.x2,a.y2,a.x,a.y):a.type==="Q"?n+="Q"+t(a.x1,a.y1,a.x,a.y):a.type==="Z"&&(n+="Z")}return n};fi.prototype.toSVG=function(r){var e='<path d="';return e+=this.toPathData(r),e+='"',this.fill&&this.fill!=="black"&&(this.fill===null?e+=' fill="none"':e+=' fill="'+this.fill+'"'),this.stroke&&(e+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),e+="/>",e};fi.prototype.toDOMElement=function(r){var e=this.toPathData(r),t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",e),t};function HT(r){throw new Error(r)}function ix(r,e){r||HT(e)}var jt={fail:HT,argument:ix,assert:ix},ax=32768,sx=2147483648,nc={},it={},Qt={};function Na(r){return function(){return r}}it.BYTE=function(r){return jt.argument(r>=0&&r<=255,"Byte value should be between 0 and 255."),[r]};Qt.BYTE=Na(1);it.CHAR=function(r){return[r.charCodeAt(0)]};Qt.CHAR=Na(1);it.CHARARRAY=function(r){typeof r>"u"&&(r="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var e=[],t=0;t<r.length;t+=1)e[t]=r.charCodeAt(t);return e};Qt.CHARARRAY=function(r){return typeof r>"u"?0:r.length};it.USHORT=function(r){return[r>>8&255,r&255]};Qt.USHORT=Na(2);it.SHORT=function(r){return r>=ax&&(r=-(2*ax-r)),[r>>8&255,r&255]};Qt.SHORT=Na(2);it.UINT24=function(r){return[r>>16&255,r>>8&255,r&255]};Qt.UINT24=Na(3);it.ULONG=function(r){return[r>>24&255,r>>16&255,r>>8&255,r&255]};Qt.ULONG=Na(4);it.LONG=function(r){return r>=sx&&(r=-(2*sx-r)),[r>>24&255,r>>16&255,r>>8&255,r&255]};Qt.LONG=Na(4);it.FIXED=it.ULONG;Qt.FIXED=Qt.ULONG;it.FWORD=it.SHORT;Qt.FWORD=Qt.SHORT;it.UFWORD=it.USHORT;Qt.UFWORD=Qt.USHORT;it.LONGDATETIME=function(r){return[0,0,0,0,r>>24&255,r>>16&255,r>>8&255,r&255]};Qt.LONGDATETIME=Na(8);it.TAG=function(r){return jt.argument(r.length===4,"Tag should be exactly 4 ASCII characters."),[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3)]};Qt.TAG=Na(4);it.Card8=it.BYTE;Qt.Card8=Qt.BYTE;it.Card16=it.USHORT;Qt.Card16=Qt.USHORT;it.OffSize=it.BYTE;Qt.OffSize=Qt.BYTE;it.SID=it.USHORT;Qt.SID=Qt.USHORT;it.NUMBER=function(r){return r>=-107&&r<=107?[r+139]:r>=108&&r<=1131?(r=r-108,[(r>>8)+247,r&255]):r>=-1131&&r<=-108?(r=-r-108,[(r>>8)+251,r&255]):r>=-32768&&r<=32767?it.NUMBER16(r):it.NUMBER32(r)};Qt.NUMBER=function(r){return it.NUMBER(r).length};it.NUMBER16=function(r){return[28,r>>8&255,r&255]};Qt.NUMBER16=Na(3);it.NUMBER32=function(r){return[29,r>>24&255,r>>16&255,r>>8&255,r&255]};Qt.NUMBER32=Na(5);it.REAL=function(r){var e=r.toString(),t=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);if(t){var n=parseFloat("1e"+((t[2]?+t[2]:0)+t[1].length));e=(Math.round(r*n)/n).toString()}for(var i="",a=0,s=e.length;a<s;a+=1){var o=e[a];o==="e"?i+=e[++a]==="-"?"c":"b":o==="."?i+="a":o==="-"?i+="e":i+=o}i+=i.length&1?"f":"ff";for(var l=[30],u=0,c=i.length;u<c;u+=2)l.push(parseInt(i.substr(u,2),16));return l};Qt.REAL=function(r){return it.REAL(r).length};it.NAME=it.CHARARRAY;Qt.NAME=Qt.CHARARRAY;it.STRING=it.CHARARRAY;Qt.STRING=Qt.CHARARRAY;nc.UTF8=function(r,e,t){for(var n=[],i=t,a=0;a<i;a++,e+=1)n[a]=r.getUint8(e);return String.fromCharCode.apply(null,n)};nc.UTF16=function(r,e,t){for(var n=[],i=t/2,a=0;a<i;a++,e+=2)n[a]=r.getUint16(e);return String.fromCharCode.apply(null,n)};it.UTF16=function(r){for(var e=[],t=0;t<r.length;t+=1){var n=r.charCodeAt(t);e[e.length]=n>>8&255,e[e.length]=n&255}return e};Qt.UTF16=function(r){return r.length*2};var Qy={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};nc.MACSTRING=function(r,e,t,n){var i=Qy[n];if(i!==void 0){for(var a="",s=0;s<t;s++){var o=r.getUint8(e+s);o<=127?a+=String.fromCharCode(o):a+=i[o&127]}return a}};var Qh=typeof WeakMap=="function"&&new WeakMap,Yh,i5=function(r){if(!Yh){Yh={};for(var e in Qy)Yh[e]=new String(e)}var t=Yh[r];if(t!==void 0){if(Qh){var n=Qh.get(t);if(n!==void 0)return n}var i=Qy[r];if(i!==void 0){for(var a={},s=0;s<i.length;s++)a[i.charCodeAt(s)]=s+128;return Qh&&Qh.set(t,a),a}}};it.MACSTRING=function(r,e){var t=i5(e);if(t!==void 0){for(var n=[],i=0;i<r.length;i++){var a=r.charCodeAt(i);if(a>=128&&(a=t[a],a===void 0))return;n[i]=a}return n}};Qt.MACSTRING=function(r,e){var t=it.MACSTRING(r,e);return t!==void 0?t.length:0};function Yy(r){return r>=-128&&r<=127}function a5(r,e,t){for(var n=0,i=r.length;e<i&&n<64&&r[e]===0;)++e,++n;return t.push(128|n-1),e}function s5(r,e,t){for(var n=0,i=r.length,a=e;a<i&&n<64;){var s=r[a];if(!Yy(s)||s===0&&a+1<i&&r[a+1]===0)break;++a,++n}t.push(n-1);for(var o=e;o<a;++o)t.push(r[o]+256&255);return a}function o5(r,e,t){for(var n=0,i=r.length,a=e;a<i&&n<64;){var s=r[a];if(s===0||Yy(s)&&a+1<i&&Yy(r[a+1]))break;++a,++n}t.push(64|n-1);for(var o=e;o<a;++o){var l=r[o];t.push(l+65536>>8&255,l+256&255)}return a}it.VARDELTAS=function(r){for(var e=0,t=[];e<r.length;){var n=r[e];n===0?e=a5(r,e,t):n>=-128&&n<=127?e=s5(r,e,t):e=o5(r,e,t)}return t};it.INDEX=function(r){for(var e=1,t=[e],n=[],i=0;i<r.length;i+=1){var a=it.OBJECT(r[i]);Array.prototype.push.apply(n,a),e+=a.length,t.push(e)}if(n.length===0)return[0,0];for(var s=[],o=1+Math.floor(Math.log(e)/Math.log(2))/8|0,l=[void 0,it.BYTE,it.USHORT,it.UINT24,it.ULONG][o],u=0;u<t.length;u+=1){var c=l(t[u]);Array.prototype.push.apply(s,c)}return Array.prototype.concat(it.Card16(r.length),it.OffSize(o),s,n)};Qt.INDEX=function(r){return it.INDEX(r).length};it.DICT=function(r){for(var e=[],t=Object.keys(r),n=t.length,i=0;i<n;i+=1){var a=parseInt(t[i],0),s=r[a];e=e.concat(it.OPERAND(s.value,s.type)),e=e.concat(it.OPERATOR(a))}return e};Qt.DICT=function(r){return it.DICT(r).length};it.OPERATOR=function(r){return r<1200?[r]:[12,r-1200]};it.OPERAND=function(r,e){var t=[];if(Array.isArray(e))for(var n=0;n<e.length;n+=1)jt.argument(r.length===e.length,"Not enough arguments given for type"+e),t=t.concat(it.OPERAND(r[n],e[n]));else if(e==="SID")t=t.concat(it.NUMBER(r));else if(e==="offset")t=t.concat(it.NUMBER32(r));else if(e==="number")t=t.concat(it.NUMBER(r));else if(e==="real")t=t.concat(it.REAL(r));else throw new Error("Unknown operand type "+e);return t};it.OP=it.BYTE;Qt.OP=Qt.BYTE;var Xh=typeof WeakMap=="function"&&new WeakMap;it.CHARSTRING=function(r){if(Xh){var e=Xh.get(r);if(e!==void 0)return e}for(var t=[],n=r.length,i=0;i<n;i+=1){var a=r[i];t=t.concat(it[a.type](a.value))}return Xh&&Xh.set(r,t),t};Qt.CHARSTRING=function(r){return it.CHARSTRING(r).length};it.OBJECT=function(r){var e=it[r.type];return jt.argument(e!==void 0,"No encoding function for type "+r.type),e(r.value)};Qt.OBJECT=function(r){var e=Qt[r.type];return jt.argument(e!==void 0,"No sizeOf function for type "+r.type),e(r.value)};it.TABLE=function(r){for(var e=[],t=r.fields.length,n=[],i=[],a=0;a<t;a+=1){var s=r.fields[a],o=it[s.type];jt.argument(o!==void 0,"No encoding function for field type "+s.type+" ("+s.name+")");var l=r[s.name];l===void 0&&(l=s.value);var u=o(l);s.type==="TABLE"?(i.push(e.length),e=e.concat([0,0]),n.push(u)):e=e.concat(u)}for(var c=0;c<n.length;c+=1){var f=i[c],d=e.length;jt.argument(d<65536,"Table "+r.tableName+" too big."),e[f]=d>>8,e[f+1]=d&255,e=e.concat(n[c])}return e};Qt.TABLE=function(r){for(var e=0,t=r.fields.length,n=0;n<t;n+=1){var i=r.fields[n],a=Qt[i.type];jt.argument(a!==void 0,"No sizeOf function for field type "+i.type+" ("+i.name+")");var s=r[i.name];s===void 0&&(s=i.value),e+=a(s),i.type==="TABLE"&&(e+=2)}return e};it.RECORD=it.TABLE;Qt.RECORD=Qt.TABLE;it.LITERAL=function(r){return r};Qt.LITERAL=function(r){return r.length};function yi(r,e,t){if(e.length&&(e[0].name!=="coverageFormat"||e[0].value===1))for(var n=0;n<e.length;n+=1){var i=e[n];this[i.name]=i.value}if(this.tableName=r,this.fields=e,t)for(var a=Object.keys(t),s=0;s<a.length;s+=1){var o=a[s],l=t[o];this[o]!==void 0&&(this[o]=l)}}yi.prototype.encode=function(){return it.TABLE(this)};yi.prototype.sizeOf=function(){return Qt.TABLE(this)};function Af(r,e,t){t===void 0&&(t=e.length);var n=new Array(e.length+1);n[0]={name:r+"Count",type:"USHORT",value:t};for(var i=0;i<e.length;i++)n[i+1]={name:r+i,type:"USHORT",value:e[i]};return n}function Xy(r,e,t){var n=e.length,i=new Array(n+1);i[0]={name:r+"Count",type:"USHORT",value:n};for(var a=0;a<n;a++)i[a+1]={name:r+a,type:"TABLE",value:t(e[a],a)};return i}function bf(r,e,t){var n=e.length,i=[];i[0]={name:r+"Count",type:"USHORT",value:n};for(var a=0;a<n;a++)i=i.concat(t(e[a],a));return i}function sg(r){r.format===1?yi.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(Af("glyph",r.glyphs))):r.format===2?yi.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(bf("rangeRecord",r.ranges,function(e){return[{name:"startGlyphID",type:"USHORT",value:e.start},{name:"endGlyphID",type:"USHORT",value:e.end},{name:"startCoverageIndex",type:"USHORT",value:e.index}]}))):jt.assert(!1,"Coverage format must be 1 or 2.")}sg.prototype=Object.create(yi.prototype);sg.prototype.constructor=sg;function og(r){yi.call(this,"scriptListTable",bf("scriptRecord",r,function(e,t){var n=e.script,i=n.defaultLangSys;return jt.assert(!!i,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new yi("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new yi("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:i.reqFeatureIndex}].concat(Af("featureIndex",i.featureIndexes)))}].concat(bf("langSys",n.langSysRecords,function(a,s){var o=a.langSys;return[{name:"langSysTag"+s,type:"TAG",value:a.tag},{name:"langSys"+s,type:"TABLE",value:new yi("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:o.reqFeatureIndex}].concat(Af("featureIndex",o.featureIndexes)))}]})))}]}))}og.prototype=Object.create(yi.prototype);og.prototype.constructor=og;function lg(r){yi.call(this,"featureListTable",bf("featureRecord",r,function(e,t){var n=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new yi("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat(Af("lookupListIndex",n.lookupListIndexes)))}]}))}lg.prototype=Object.create(yi.prototype);lg.prototype.constructor=lg;function ug(r,e){yi.call(this,"lookupListTable",Xy("lookup",r,function(t){var n=e[t.lookupType];return jt.assert(!!n,"Unable to write GSUB lookup type "+t.lookupType+" tables."),new yi("lookupTable",[{name:"lookupType",type:"USHORT",value:t.lookupType},{name:"lookupFlag",type:"USHORT",value:t.lookupFlag}].concat(Xy("subtable",t.subtables,n)))}))}ug.prototype=Object.create(yi.prototype);ug.prototype.constructor=ug;var dt={Table:yi,Record:yi,Coverage:sg,ScriptList:og,FeatureList:lg,LookupList:ug,ushortList:Af,tableList:Xy,recordList:bf};function ox(r,e){return r.getUint8(e)}function cg(r,e){return r.getUint16(e,!1)}function l5(r,e){return r.getInt16(e,!1)}function d1(r,e){return r.getUint32(e,!1)}function jT(r,e){var t=r.getInt16(e,!1),n=r.getUint16(e+2,!1);return t+n/65535}function u5(r,e){for(var t="",n=e;n<e+4;n+=1)t+=String.fromCharCode(r.getInt8(n));return t}function c5(r,e,t){for(var n=0,i=0;i<t;i+=1)n<<=8,n+=r.getUint8(e+i);return n}function d5(r,e,t){for(var n=[],i=e;i<t;i+=1)n.push(r.getUint8(i));return n}function f5(r){for(var e="",t=0;t<r.length;t+=1)e+=String.fromCharCode(r[t]);return e}var h5={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function we(r,e){this.data=r,this.offset=e,this.relativeOffset=0}we.prototype.parseByte=function(){var r=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,r};we.prototype.parseChar=function(){var r=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,r};we.prototype.parseCard8=we.prototype.parseByte;we.prototype.parseUShort=function(){var r=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,r};we.prototype.parseCard16=we.prototype.parseUShort;we.prototype.parseSID=we.prototype.parseUShort;we.prototype.parseOffset16=we.prototype.parseUShort;we.prototype.parseShort=function(){var r=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,r};we.prototype.parseF2Dot14=function(){var r=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,r};we.prototype.parseULong=function(){var r=d1(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,r};we.prototype.parseOffset32=we.prototype.parseULong;we.prototype.parseFixed=function(){var r=jT(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,r};we.prototype.parseString=function(r){var e=this.data,t=this.offset+this.relativeOffset,n="";this.relativeOffset+=r;for(var i=0;i<r;i++)n+=String.fromCharCode(e.getUint8(t+i));return n};we.prototype.parseTag=function(){return this.parseString(4)};we.prototype.parseLongDateTime=function(){var r=d1(this.data,this.offset+this.relativeOffset+4);return r-=2082844800,this.relativeOffset+=8,r};we.prototype.parseVersion=function(r){var e=cg(this.data,this.offset+this.relativeOffset),t=cg(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,r===void 0&&(r=4096),e+t/r/10};we.prototype.skip=function(r,e){e===void 0&&(e=1),this.relativeOffset+=h5[r]*e};we.prototype.parseULongList=function(r){r===void 0&&(r=this.parseULong());for(var e=new Array(r),t=this.data,n=this.offset+this.relativeOffset,i=0;i<r;i++)e[i]=t.getUint32(n),n+=4;return this.relativeOffset+=r*4,e};we.prototype.parseOffset16List=we.prototype.parseUShortList=function(r){r===void 0&&(r=this.parseUShort());for(var e=new Array(r),t=this.data,n=this.offset+this.relativeOffset,i=0;i<r;i++)e[i]=t.getUint16(n),n+=2;return this.relativeOffset+=r*2,e};we.prototype.parseShortList=function(r){for(var e=new Array(r),t=this.data,n=this.offset+this.relativeOffset,i=0;i<r;i++)e[i]=t.getInt16(n),n+=2;return this.relativeOffset+=r*2,e};we.prototype.parseByteList=function(r){for(var e=new Array(r),t=this.data,n=this.offset+this.relativeOffset,i=0;i<r;i++)e[i]=t.getUint8(n++);return this.relativeOffset+=r,e};we.prototype.parseList=function(r,e){e||(e=r,r=this.parseUShort());for(var t=new Array(r),n=0;n<r;n++)t[n]=e.call(this);return t};we.prototype.parseList32=function(r,e){e||(e=r,r=this.parseULong());for(var t=new Array(r),n=0;n<r;n++)t[n]=e.call(this);return t};we.prototype.parseRecordList=function(r,e){e||(e=r,r=this.parseUShort());for(var t=new Array(r),n=Object.keys(e),i=0;i<r;i++){for(var a={},s=0;s<n.length;s++){var o=n[s],l=e[o];a[o]=l.call(this)}t[i]=a}return t};we.prototype.parseRecordList32=function(r,e){e||(e=r,r=this.parseULong());for(var t=new Array(r),n=Object.keys(e),i=0;i<r;i++){for(var a={},s=0;s<n.length;s++){var o=n[s],l=e[o];a[o]=l.call(this)}t[i]=a}return t};we.prototype.parseStruct=function(r){if(typeof r=="function")return r.call(this);for(var e=Object.keys(r),t={},n=0;n<e.length;n++){var i=e[n],a=r[i];t[i]=a.call(this)}return t};we.prototype.parseValueRecord=function(r){if(r===void 0&&(r=this.parseUShort()),r!==0){var e={};return r&1&&(e.xPlacement=this.parseShort()),r&2&&(e.yPlacement=this.parseShort()),r&4&&(e.xAdvance=this.parseShort()),r&8&&(e.yAdvance=this.parseShort()),r&16&&(e.xPlaDevice=void 0,this.parseShort()),r&32&&(e.yPlaDevice=void 0,this.parseShort()),r&64&&(e.xAdvDevice=void 0,this.parseShort()),r&128&&(e.yAdvDevice=void 0,this.parseShort()),e}};we.prototype.parseValueRecordList=function(){for(var r=this.parseUShort(),e=this.parseUShort(),t=new Array(e),n=0;n<e;n++)t[n]=this.parseValueRecord(r);return t};we.prototype.parsePointer=function(r){var e=this.parseOffset16();if(e>0)return new we(this.data,this.offset+e).parseStruct(r)};we.prototype.parsePointer32=function(r){var e=this.parseOffset32();if(e>0)return new we(this.data,this.offset+e).parseStruct(r)};we.prototype.parseListOfLists=function(r){for(var e=this.parseOffset16List(),t=e.length,n=this.relativeOffset,i=new Array(t),a=0;a<t;a++){var s=e[a];if(s===0){i[a]=void 0;continue}if(this.relativeOffset=s,r){for(var o=this.parseOffset16List(),l=new Array(o.length),u=0;u<o.length;u++)this.relativeOffset=s+o[u],l[u]=r.call(this);i[a]=l}else i[a]=this.parseUShortList()}return this.relativeOffset=n,i};we.prototype.parseCoverage=function(){var r=this.offset+this.relativeOffset,e=this.parseUShort(),t=this.parseUShort();if(e===1)return{format:1,glyphs:this.parseUShortList(t)};if(e===2){for(var n=new Array(t),i=0;i<t;i++)n[i]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:n}}throw new Error("0x"+r.toString(16)+": Coverage format must be 1 or 2.")};we.prototype.parseClassDef=function(){var r=this.offset+this.relativeOffset,e=this.parseUShort();if(e===1)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(e===2)return{format:2,ranges:this.parseRecordList({start:we.uShort,end:we.uShort,classId:we.uShort})};throw new Error("0x"+r.toString(16)+": ClassDef format must be 1 or 2.")};we.list=function(r,e){return function(){return this.parseList(r,e)}};we.list32=function(r,e){return function(){return this.parseList32(r,e)}};we.recordList=function(r,e){return function(){return this.parseRecordList(r,e)}};we.recordList32=function(r,e){return function(){return this.parseRecordList32(r,e)}};we.pointer=function(r){return function(){return this.parsePointer(r)}};we.pointer32=function(r){return function(){return this.parsePointer32(r)}};we.tag=we.prototype.parseTag;we.byte=we.prototype.parseByte;we.uShort=we.offset16=we.prototype.parseUShort;we.uShortList=we.prototype.parseUShortList;we.uLong=we.offset32=we.prototype.parseULong;we.uLongList=we.prototype.parseULongList;we.struct=we.prototype.parseStruct;we.coverage=we.prototype.parseCoverage;we.classDef=we.prototype.parseClassDef;var lx={reserved:we.uShort,reqFeatureIndex:we.uShort,featureIndexes:we.uShortList};we.prototype.parseScriptList=function(){return this.parsePointer(we.recordList({tag:we.tag,script:we.pointer({defaultLangSys:we.pointer(lx),langSysRecords:we.recordList({tag:we.tag,langSys:we.pointer(lx)})})}))||[]};we.prototype.parseFeatureList=function(){return this.parsePointer(we.recordList({tag:we.tag,feature:we.pointer({featureParams:we.offset16,lookupListIndexes:we.uShortList})}))||[]};we.prototype.parseLookupList=function(r){return this.parsePointer(we.list(we.pointer(function(){var e=this.parseUShort();jt.argument(1<=e&&e<=9,"GPOS/GSUB lookup type "+e+" unknown.");var t=this.parseUShort(),n=t&16;return{lookupType:e,lookupFlag:t,subtables:this.parseList(we.pointer(r[e])),markFilteringSet:n?this.parseUShort():void 0}})))||[]};we.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var r=this.parseUShort(),e=this.parseUShort();jt.argument(r===1&&e<1,"GPOS/GSUB feature variations table unknown.");var t=this.parseRecordList32({conditionSetOffset:we.offset32,featureTableSubstitutionOffset:we.offset32});return t})||[]};var vt={getByte:ox,getCard8:ox,getUShort:cg,getCard16:cg,getShort:l5,getULong:d1,getFixed:jT,getTag:u5,getOffset:c5,getBytes:d5,bytesToString:f5,Parser:we};function p5(r,e){e.parseUShort(),r.length=e.parseULong(),r.language=e.parseULong();var t;r.groupCount=t=e.parseULong(),r.glyphIndexMap={};for(var n=0;n<t;n+=1)for(var i=e.parseULong(),a=e.parseULong(),s=e.parseULong(),o=i;o<=a;o+=1)r.glyphIndexMap[o]=s,s++}function g5(r,e,t,n,i){r.length=e.parseUShort(),r.language=e.parseUShort();var a;r.segCount=a=e.parseUShort()>>1,e.skip("uShort",3),r.glyphIndexMap={};for(var s=new vt.Parser(t,n+i+14),o=new vt.Parser(t,n+i+16+a*2),l=new vt.Parser(t,n+i+16+a*4),u=new vt.Parser(t,n+i+16+a*6),c=n+i+16+a*8,f=0;f<a-1;f+=1)for(var d=void 0,h=s.parseUShort(),g=o.parseUShort(),v=l.parseShort(),y=u.parseUShort(),A=g;A<=h;A+=1)y!==0?(c=u.offset+u.relativeOffset-2,c+=y,c+=(A-g)*2,d=vt.getUShort(t,c),d!==0&&(d=d+v&65535)):d=A+v&65535,r.glyphIndexMap[A]=d}function m5(r,e){var t={};t.version=vt.getUShort(r,e),jt.argument(t.version===0,"cmap table version should be 0."),t.numTables=vt.getUShort(r,e+2);for(var n=-1,i=t.numTables-1;i>=0;i-=1){var a=vt.getUShort(r,e+4+i*8),s=vt.getUShort(r,e+4+i*8+2);if(a===3&&(s===0||s===1||s===10)||a===0&&(s===0||s===1||s===2||s===3||s===4)){n=vt.getULong(r,e+4+i*8+4);break}}if(n===-1)throw new Error("No valid cmap sub-tables found.");var o=new vt.Parser(r,e+n);if(t.format=o.parseUShort(),t.format===12)p5(t,o);else if(t.format===4)g5(t,o,r,e,n);else throw new Error("Only format 4 and 12 cmap tables are supported (found format "+t.format+").");return t}function v5(r,e,t){r.segments.push({end:e,start:e,delta:-(e-t),offset:0,glyphIndex:t})}function y5(r){r.segments.push({end:65535,start:65535,delta:1,offset:0})}function A5(r){var e=!0,t;for(t=r.length-1;t>0;t-=1){var n=r.get(t);if(n.unicode>65535){console.log("Adding CMAP format 12 (needed!)"),e=!1;break}}var i=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:e?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:e?12:20}];e||(i=i.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),i=i.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var a=new dt.Table("cmap",i);for(a.segments=[],t=0;t<r.length;t+=1){for(var s=r.get(t),o=0;o<s.unicodes.length;o+=1)v5(a,s.unicodes[o],t);a.segments=a.segments.sort(function(C,S){return C.start-S.start})}y5(a);var l=a.segments.length,u=0,c=[],f=[],d=[],h=[],g=[],v=[];for(t=0;t<l;t+=1){var y=a.segments[t];y.end<=65535&&y.start<=65535?(c=c.concat({name:"end_"+t,type:"USHORT",value:y.end}),f=f.concat({name:"start_"+t,type:"USHORT",value:y.start}),d=d.concat({name:"idDelta_"+t,type:"SHORT",value:y.delta}),h=h.concat({name:"idRangeOffset_"+t,type:"USHORT",value:y.offset}),y.glyphId!==void 0&&(g=g.concat({name:"glyph_"+t,type:"USHORT",value:y.glyphId}))):u+=1,!e&&y.glyphIndex!==void 0&&(v=v.concat({name:"cmap12Start_"+t,type:"ULONG",value:y.start}),v=v.concat({name:"cmap12End_"+t,type:"ULONG",value:y.end}),v=v.concat({name:"cmap12Glyph_"+t,type:"ULONG",value:y.glyphIndex}))}if(a.segCountX2=(l-u)*2,a.searchRange=Math.pow(2,Math.floor(Math.log(l-u)/Math.log(2)))*2,a.entrySelector=Math.log(a.searchRange/2)/Math.log(2),a.rangeShift=a.segCountX2-a.searchRange,a.fields=a.fields.concat(c),a.fields.push({name:"reservedPad",type:"USHORT",value:0}),a.fields=a.fields.concat(f),a.fields=a.fields.concat(d),a.fields=a.fields.concat(h),a.fields=a.fields.concat(g),a.cmap4Length=14+c.length*2+2+f.length*2+d.length*2+h.length*2+g.length*2,!e){var A=16+v.length*4;a.cmap12Offset=20+a.cmap4Length,a.fields=a.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:A},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:v.length/3}]),a.fields=a.fields.concat(v)}return a}var GT={parse:m5,make:A5},jp=[".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"],b5=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],w5=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],ml=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function qT(r){this.font=r}qT.prototype.charToGlyphIndex=function(r){var e=r.codePointAt(0),t=this.font.glyphs;if(t){for(var n=0;n<t.length;n+=1)for(var i=t.get(n),a=0;a<i.unicodes.length;a+=1)if(i.unicodes[a]===e)return n}return null};function WT(r){this.cmap=r}WT.prototype.charToGlyphIndex=function(r){return this.cmap.glyphIndexMap[r.codePointAt(0)]||0};function dg(r,e){this.encoding=r,this.charset=e}dg.prototype.charToGlyphIndex=function(r){var e=r.codePointAt(0),t=this.encoding[e];return this.charset.indexOf(t)};function f1(r){switch(r.version){case 1:this.names=ml.slice();break;case 2:this.names=new Array(r.numberOfGlyphs);for(var e=0;e<r.numberOfGlyphs;e++)r.glyphNameIndex[e]<ml.length?this.names[e]=ml[r.glyphNameIndex[e]]:this.names[e]=r.names[r.glyphNameIndex[e]-ml.length];break;case 2.5:this.names=new Array(r.numberOfGlyphs);for(var t=0;t<r.numberOfGlyphs;t++)this.names[t]=ml[t+r.glyphNameIndex[t]];break;case 3:this.names=[];break;default:this.names=[];break}}f1.prototype.nameToGlyphIndex=function(r){return this.names.indexOf(r)};f1.prototype.glyphIndexToName=function(r){return this.names[r]};function C5(r){for(var e,t=r.tables.cmap.glyphIndexMap,n=Object.keys(t),i=0;i<n.length;i+=1){var a=n[i],s=t[a];e=r.glyphs.get(s),e.addUnicode(parseInt(a))}for(var o=0;o<r.glyphs.length;o+=1)e=r.glyphs.get(o),r.cffEncoding?r.isCIDFont?e.name="gid"+o:e.name=r.cffEncoding.charset[o]:r.glyphNames.names&&(e.name=r.glyphNames.glyphIndexToName(o))}function x5(r){r._IndexToUnicodeMap={};for(var e=r.tables.cmap.glyphIndexMap,t=Object.keys(e),n=0;n<t.length;n+=1){var i=t[n],a=e[i];r._IndexToUnicodeMap[a]===void 0?r._IndexToUnicodeMap[a]={unicodes:[parseInt(i)]}:r._IndexToUnicodeMap[a].unicodes.push(parseInt(i))}}function S5(r,e){e.lowMemory?x5(r):C5(r)}function E5(r,e,t,n,i){r.beginPath(),r.moveTo(e,t),r.lineTo(n,i),r.stroke()}var dl={line:E5};function k5(r,e){var t=e||new fi;return{configurable:!0,get:function(){return typeof t=="function"&&(t=t()),t},set:function(n){t=n}}}function ga(r){this.bindConstructorValues(r)}ga.prototype.bindConstructorValues=function(r){this.index=r.index||0,this.name=r.name||null,this.unicode=r.unicode||void 0,this.unicodes=r.unicodes||r.unicode!==void 0?[r.unicode]:[],"xMin"in r&&(this.xMin=r.xMin),"yMin"in r&&(this.yMin=r.yMin),"xMax"in r&&(this.xMax=r.xMax),"yMax"in r&&(this.yMax=r.yMax),"advanceWidth"in r&&(this.advanceWidth=r.advanceWidth),Object.defineProperty(this,"path",k5(this,r.path))};ga.prototype.addUnicode=function(r){this.unicodes.length===0&&(this.unicode=r),this.unicodes.push(r)};ga.prototype.getBoundingBox=function(){return this.path.getBoundingBox()};ga.prototype.getPath=function(r,e,t,n,i){r=r!==void 0?r:0,e=e!==void 0?e:0,t=t!==void 0?t:72;var a,s;n||(n={});var o=n.xScale,l=n.yScale;if(n.hinting&&i&&i.hinting&&(s=this.path&&i.hinting.exec(this,t)),s)a=i.hinting.getCommands(s),r=Math.round(r),e=Math.round(e),o=l=1;else{a=this.path.commands;var u=1/(this.path.unitsPerEm||1e3)*t;o===void 0&&(o=u),l===void 0&&(l=u)}for(var c=new fi,f=0;f<a.length;f+=1){var d=a[f];d.type==="M"?c.moveTo(r+d.x*o,e+-d.y*l):d.type==="L"?c.lineTo(r+d.x*o,e+-d.y*l):d.type==="Q"?c.quadraticCurveTo(r+d.x1*o,e+-d.y1*l,r+d.x*o,e+-d.y*l):d.type==="C"?c.curveTo(r+d.x1*o,e+-d.y1*l,r+d.x2*o,e+-d.y2*l,r+d.x*o,e+-d.y*l):d.type==="Z"&&c.closePath()}return c};ga.prototype.getContours=function(){if(this.points===void 0)return[];for(var r=[],e=[],t=0;t<this.points.length;t+=1){var n=this.points[t];e.push(n),n.lastPointOfContour&&(r.push(e),e=[])}return jt.argument(e.length===0,"There are still points left in the current contour."),r};ga.prototype.getMetrics=function(){for(var r=this.path.commands,e=[],t=[],n=0;n<r.length;n+=1){var i=r[n];i.type!=="Z"&&(e.push(i.x),t.push(i.y)),(i.type==="Q"||i.type==="C")&&(e.push(i.x1),t.push(i.y1)),i.type==="C"&&(e.push(i.x2),t.push(i.y2))}var a={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,e),yMax:Math.max.apply(null,t),leftSideBearing:this.leftSideBearing};return isFinite(a.xMin)||(a.xMin=0),isFinite(a.xMax)||(a.xMax=this.advanceWidth),isFinite(a.yMin)||(a.yMin=0),isFinite(a.yMax)||(a.yMax=0),a.rightSideBearing=this.advanceWidth-a.leftSideBearing-(a.xMax-a.xMin),a};ga.prototype.draw=function(r,e,t,n,i){this.getPath(e,t,n,i).draw(r)};ga.prototype.drawPoints=function(r,e,t,n){function i(f,d,h,g){r.beginPath();for(var v=0;v<f.length;v+=1)r.moveTo(d+f[v].x*g,h+f[v].y*g),r.arc(d+f[v].x*g,h+f[v].y*g,2,0,Math.PI*2,!1);r.closePath(),r.fill()}e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:24;for(var a=1/this.path.unitsPerEm*n,s=[],o=[],l=this.path,u=0;u<l.commands.length;u+=1){var c=l.commands[u];c.x!==void 0&&s.push({x:c.x,y:-c.y}),c.x1!==void 0&&o.push({x:c.x1,y:-c.y1}),c.x2!==void 0&&o.push({x:c.x2,y:-c.y2})}r.fillStyle="blue",i(s,e,t,a),r.fillStyle="red",i(o,e,t,a)};ga.prototype.drawMetrics=function(r,e,t,n){var i;e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:24,i=1/this.path.unitsPerEm*n,r.lineWidth=1,r.strokeStyle="black",dl.line(r,e,-1e4,e,1e4),dl.line(r,-1e4,t,1e4,t);var a=this.xMin||0,s=this.yMin||0,o=this.xMax||0,l=this.yMax||0,u=this.advanceWidth||0;r.strokeStyle="blue",dl.line(r,e+a*i,-1e4,e+a*i,1e4),dl.line(r,e+o*i,-1e4,e+o*i,1e4),dl.line(r,-1e4,t+-s*i,1e4,t+-s*i),dl.line(r,-1e4,t+-l*i,1e4,t+-l*i),r.strokeStyle="green",dl.line(r,e+u*i,-1e4,e+u*i,1e4)};function Jh(r,e,t){Object.defineProperty(r,e,{get:function(){return r.path,r[t]},set:function(n){r[t]=n},enumerable:!0,configurable:!0})}function h1(r,e){if(this.font=r,this.glyphs={},Array.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];n.path.unitsPerEm=r.unitsPerEm,this.glyphs[t]=n}this.length=e&&e.length||0}h1.prototype.get=function(r){if(this.glyphs[r]===void 0){this.font._push(r),typeof this.glyphs[r]=="function"&&(this.glyphs[r]=this.glyphs[r]());var e=this.glyphs[r],t=this.font._IndexToUnicodeMap[r];if(t)for(var n=0;n<t.unicodes.length;n++)e.addUnicode(t.unicodes[n]);this.font.cffEncoding?this.font.isCIDFont?e.name="gid"+r:e.name=this.font.cffEncoding.charset[r]:this.font.glyphNames.names&&(e.name=this.font.glyphNames.glyphIndexToName(r)),this.glyphs[r].advanceWidth=this.font._hmtxTableData[r].advanceWidth,this.glyphs[r].leftSideBearing=this.font._hmtxTableData[r].leftSideBearing}else typeof this.glyphs[r]=="function"&&(this.glyphs[r]=this.glyphs[r]());return this.glyphs[r]};h1.prototype.push=function(r,e){this.glyphs[r]=e,this.length++};function T5(r,e){return new ga({index:e,font:r})}function F5(r,e,t,n,i,a){return function(){var s=new ga({index:e,font:r});return s.path=function(){t(s,n,i);var o=a(r.glyphs,s);return o.unitsPerEm=r.unitsPerEm,o},Jh(s,"xMin","_xMin"),Jh(s,"xMax","_xMax"),Jh(s,"yMin","_yMin"),Jh(s,"yMax","_yMax"),s}}function I5(r,e,t,n){return function(){var i=new ga({index:e,font:r});return i.path=function(){var a=t(r,i,n);return a.unitsPerEm=r.unitsPerEm,a},i}}var os={GlyphSet:h1,glyphLoader:T5,ttfGlyphLoader:F5,cffGlyphLoader:I5};function QT(r,e){if(r===e)return!0;if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t+=1)if(!QT(r[t],e[t]))return!1;return!0}else return!1}function Jy(r){var e;return r.length<1240?e=107:r.length<33900?e=1131:e=32768,e}function no(r,e,t){var n=[],i=[],a=vt.getCard16(r,e),s,o;if(a!==0){var l=vt.getByte(r,e+2);s=e+(a+1)*l+2;for(var u=e+3,c=0;c<a+1;c+=1)n.push(vt.getOffset(r,u,l)),u+=l;o=s+n[a]}else o=e+2;for(var f=0;f<n.length-1;f+=1){var d=vt.getBytes(r,s+n[f],s+n[f+1]);t&&(d=t(d)),i.push(d)}return{objects:i,startOffset:e,endOffset:o}}function P5(r,e){var t=[],n=vt.getCard16(r,e),i,a;if(n!==0){var s=vt.getByte(r,e+2);i=e+(n+1)*s+2;for(var o=e+3,l=0;l<n+1;l+=1)t.push(vt.getOffset(r,o,s)),o+=s;a=i+t[n]}else a=e+2;return{offsets:t,startOffset:e,endOffset:a}}function D5(r,e,t,n,i){var a=vt.getCard16(t,n),s=0;if(a!==0){var o=vt.getByte(t,n+2);s=n+(a+1)*o+2}var l=vt.getBytes(t,s+e[r],s+e[r+1]);return l}function R5(r){for(var e="",t=15,n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var i=r.parseByte(),a=i>>4,s=i&15;if(a===t||(e+=n[a],s===t))break;e+=n[s]}return parseFloat(e)}function O5(r,e){var t,n,i,a;if(e===28)return t=r.parseByte(),n=r.parseByte(),t<<8|n;if(e===29)return t=r.parseByte(),n=r.parseByte(),i=r.parseByte(),a=r.parseByte(),t<<24|n<<16|i<<8|a;if(e===30)return R5(r);if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return t=r.parseByte(),(e-247)*256+t+108;if(e>=251&&e<=254)return t=r.parseByte(),-(e-251)*256-t-108;throw new Error("Invalid b0 "+e)}function B5(r){for(var e={},t=0;t<r.length;t+=1){var n=r[t][0],i=r[t][1],a=void 0;if(i.length===1?a=i[0]:a=i,e.hasOwnProperty(n)&&!isNaN(e[n]))throw new Error("Object "+e+" already has key "+n);e[n]=a}return e}function YT(r,e,t){e=e!==void 0?e:0;var n=new vt.Parser(r,e),i=[],a=[];for(t=t!==void 0?t:r.length;n.relativeOffset<t;){var s=n.parseByte();s<=21?(s===12&&(s=1200+n.parseByte()),i.push([s,a]),a=[]):a.push(O5(n,s))}return B5(i)}function Xd(r,e){return e<=390?e=jp[e]:e=r[e-391],e}function XT(r,e,t){for(var n={},i,a=0;a<e.length;a+=1){var s=e[a];if(Array.isArray(s.type)){var o=[];o.length=s.type.length;for(var l=0;l<s.type.length;l++)i=r[s.op]!==void 0?r[s.op][l]:void 0,i===void 0&&(i=s.value!==void 0&&s.value[l]!==void 0?s.value[l]:null),s.type[l]==="SID"&&(i=Xd(t,i)),o[l]=i;n[s.name]=o}else i=r[s.op],i===void 0&&(i=s.value!==void 0?s.value:null),s.type==="SID"&&(i=Xd(t,i)),n[s.name]=i}return n}function M5(r,e){var t={};return t.formatMajor=vt.getCard8(r,e),t.formatMinor=vt.getCard8(r,e+1),t.size=vt.getCard8(r,e+2),t.offsetSize=vt.getCard8(r,e+3),t.startOffset=e,t.endOffset=e+4,t}var JT=[{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"}],KT=[{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 _5(r,e){var t=YT(r,0,r.byteLength);return XT(t,JT,e)}function ZT(r,e,t,n){var i=YT(r,e,t);return XT(i,KT,n)}function ux(r,e,t,n){for(var i=[],a=0;a<t.length;a+=1){var s=new DataView(new Uint8Array(t[a]).buffer),o=_5(s,n);o._subrs=[],o._subrsBias=0,o._defaultWidthX=0,o._nominalWidthX=0;var l=o.private[0],u=o.private[1];if(l!==0&&u!==0){var c=ZT(r,u+e,l,n);if(o._defaultWidthX=c.defaultWidthX,o._nominalWidthX=c.nominalWidthX,c.subrs!==0){var f=u+c.subrs,d=no(r,f+e);o._subrs=d.objects,o._subrsBias=Jy(o._subrs)}o._privateDict=c}i.push(o)}return i}function N5(r,e,t,n){var i,a,s=new vt.Parser(r,e);t-=1;var o=[".notdef"],l=s.parseCard8();if(l===0)for(var u=0;u<t;u+=1)i=s.parseSID(),o.push(Xd(n,i));else if(l===1)for(;o.length<=t;){i=s.parseSID(),a=s.parseCard8();for(var c=0;c<=a;c+=1)o.push(Xd(n,i)),i+=1}else if(l===2)for(;o.length<=t;){i=s.parseSID(),a=s.parseCard16();for(var f=0;f<=a;f+=1)o.push(Xd(n,i)),i+=1}else throw new Error("Unknown charset format "+l);return o}function L5(r,e,t){var n,i={},a=new vt.Parser(r,e),s=a.parseCard8();if(s===0)for(var o=a.parseCard8(),l=0;l<o;l+=1)n=a.parseCard8(),i[n]=l;else if(s===1){var u=a.parseCard8();n=1;for(var c=0;c<u;c+=1)for(var f=a.parseCard8(),d=a.parseCard8(),h=f;h<=f+d;h+=1)i[h]=n,n+=1}else throw new Error("Unknown encoding format "+s);return new dg(i,t)}function cx(r,e,t){var n,i,a,s,o=new fi,l=[],u=0,c=!1,f=!1,d=0,h=0,g,v,y,A;if(r.isCIDFont){var C=r.tables.cff.topDict._fdSelect[e.index],S=r.tables.cff.topDict._fdArray[C];g=S._subrs,v=S._subrsBias,y=S._defaultWidthX,A=S._nominalWidthX}else g=r.tables.cff.topDict._subrs,v=r.tables.cff.topDict._subrsBias,y=r.tables.cff.topDict._defaultWidthX,A=r.tables.cff.topDict._nominalWidthX;var F=y;function E(j,G){f&&o.closePath(),o.moveTo(j,G),f=!0}function R(){var j;j=l.length%2!==0,j&&!c&&(F=l.shift()+A),u+=l.length>>1,l.length=0,c=!0}function B(j){for(var G,ie,q,Y,J,ae,oe,he,ye,Ue,Re,Oe,ee=0;ee<j.length;){var re=j[ee];switch(ee+=1,re){case 1:R();break;case 3:R();break;case 4:l.length>1&&!c&&(F=l.shift()+A,c=!0),h+=l.pop(),E(d,h);break;case 5:for(;l.length>0;)d+=l.shift(),h+=l.shift(),o.lineTo(d,h);break;case 6:for(;l.length>0&&(d+=l.shift(),o.lineTo(d,h),l.length!==0);)h+=l.shift(),o.lineTo(d,h);break;case 7:for(;l.length>0&&(h+=l.shift(),o.lineTo(d,h),l.length!==0);)d+=l.shift(),o.lineTo(d,h);break;case 8:for(;l.length>0;)n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+l.shift(),o.curveTo(n,i,a,s,d,h);break;case 10:J=l.pop()+v,ae=g[J],ae&&B(ae);break;case 11:return;case 12:switch(re=j[ee],ee+=1,re){case 35:n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),oe=a+l.shift(),he=s+l.shift(),ye=oe+l.shift(),Ue=he+l.shift(),Re=ye+l.shift(),Oe=Ue+l.shift(),d=Re+l.shift(),h=Oe+l.shift(),l.shift(),o.curveTo(n,i,a,s,oe,he),o.curveTo(ye,Ue,Re,Oe,d,h);break;case 34:n=d+l.shift(),i=h,a=n+l.shift(),s=i+l.shift(),oe=a+l.shift(),he=s,ye=oe+l.shift(),Ue=s,Re=ye+l.shift(),Oe=h,d=Re+l.shift(),o.curveTo(n,i,a,s,oe,he),o.curveTo(ye,Ue,Re,Oe,d,h);break;case 36:n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),oe=a+l.shift(),he=s,ye=oe+l.shift(),Ue=s,Re=ye+l.shift(),Oe=Ue+l.shift(),d=Re+l.shift(),o.curveTo(n,i,a,s,oe,he),o.curveTo(ye,Ue,Re,Oe,d,h);break;case 37:n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),oe=a+l.shift(),he=s+l.shift(),ye=oe+l.shift(),Ue=he+l.shift(),Re=ye+l.shift(),Oe=Ue+l.shift(),Math.abs(Re-d)>Math.abs(Oe-h)?d=Re+l.shift():h=Oe+l.shift(),o.curveTo(n,i,a,s,oe,he),o.curveTo(ye,Ue,Re,Oe,d,h);break;default:console.log("Glyph "+e.index+": unknown operator 1200"+re),l.length=0}break;case 14:l.length>0&&!c&&(F=l.shift()+A,c=!0),f&&(o.closePath(),f=!1);break;case 18:R();break;case 19:case 20:R(),ee+=u+7>>3;break;case 21:l.length>2&&!c&&(F=l.shift()+A,c=!0),h+=l.pop(),d+=l.pop(),E(d,h);break;case 22:l.length>1&&!c&&(F=l.shift()+A,c=!0),d+=l.pop(),E(d,h);break;case 23:R();break;case 24:for(;l.length>2;)n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+l.shift(),o.curveTo(n,i,a,s,d,h);d+=l.shift(),h+=l.shift(),o.lineTo(d,h);break;case 25:for(;l.length>6;)d+=l.shift(),h+=l.shift(),o.lineTo(d,h);n=d+l.shift(),i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+l.shift(),o.curveTo(n,i,a,s,d,h);break;case 26:for(l.length%2&&(d+=l.shift());l.length>0;)n=d,i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a,h=s+l.shift(),o.curveTo(n,i,a,s,d,h);break;case 27:for(l.length%2&&(h+=l.shift());l.length>0;)n=d+l.shift(),i=h,a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s,o.curveTo(n,i,a,s,d,h);break;case 28:G=j[ee],ie=j[ee+1],l.push((G<<24|ie<<16)>>16),ee+=2;break;case 29:J=l.pop()+r.gsubrsBias,ae=r.gsubrs[J],ae&&B(ae);break;case 30:for(;l.length>0&&(n=d,i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+(l.length===1?l.shift():0),o.curveTo(n,i,a,s,d,h),l.length!==0);)n=d+l.shift(),i=h,a=n+l.shift(),s=i+l.shift(),h=s+l.shift(),d=a+(l.length===1?l.shift():0),o.curveTo(n,i,a,s,d,h);break;case 31:for(;l.length>0&&(n=d+l.shift(),i=h,a=n+l.shift(),s=i+l.shift(),h=s+l.shift(),d=a+(l.length===1?l.shift():0),o.curveTo(n,i,a,s,d,h),l.length!==0);)n=d,i=h+l.shift(),a=n+l.shift(),s=i+l.shift(),d=a+l.shift(),h=s+(l.length===1?l.shift():0),o.curveTo(n,i,a,s,d,h);break;default:re<32?console.log("Glyph "+e.index+": unknown operator "+re):re<247?l.push(re-139):re<251?(G=j[ee],ee+=1,l.push((re-247)*256+G+108)):re<255?(G=j[ee],ee+=1,l.push(-(re-251)*256-G-108)):(G=j[ee],ie=j[ee+1],q=j[ee+2],Y=j[ee+3],ee+=4,l.push((G<<24|ie<<16|q<<8|Y)/65536))}}}return B(t),e.advanceWidth=F,o}function U5(r,e,t,n){var i=[],a,s=new vt.Parser(r,e),o=s.parseCard8();if(o===0)for(var l=0;l<t;l++){if(a=s.parseCard8(),a>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+n+")");i.push(a)}else if(o===3){var u=s.parseCard16(),c=s.parseCard16();if(c!==0)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+c);for(var f,d=0;d<u;d++){if(a=s.parseCard8(),f=s.parseCard16(),a>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+n+")");if(f>t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+f);for(;c<f;c++)i.push(a);c=f}if(f!==t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+f)}else throw new Error("CFF Table CID Font FDSelect table has unsupported format "+o);return i}function V5(r,e,t,n){t.tables.cff={};var i=M5(r,e),a=no(r,i.endOffset,vt.bytesToString),s=no(r,a.endOffset),o=no(r,s.endOffset,vt.bytesToString),l=no(r,o.endOffset);t.gsubrs=l.objects,t.gsubrsBias=Jy(t.gsubrs);var u=ux(r,e,s.objects,o.objects);if(u.length!==1)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+u.length);var c=u[0];if(t.tables.cff.topDict=c,c._privateDict&&(t.defaultWidthX=c._privateDict.defaultWidthX,t.nominalWidthX=c._privateDict.nominalWidthX),c.ros[0]!==void 0&&c.ros[1]!==void 0&&(t.isCIDFont=!0),t.isCIDFont){var f=c.fdArray,d=c.fdSelect;if(f===0||d===0)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");f+=e;var h=no(r,f),g=ux(r,e,h.objects,o.objects);c._fdArray=g,d+=e,c._fdSelect=U5(r,d,t.numGlyphs,g.length)}var v=e+c.private[1],y=ZT(r,v,c.private[0],o.objects);if(t.defaultWidthX=y.defaultWidthX,t.nominalWidthX=y.nominalWidthX,y.subrs!==0){var A=v+y.subrs,C=no(r,A);t.subrs=C.objects,t.subrsBias=Jy(t.subrs)}else t.subrs=[],t.subrsBias=0;var S;n.lowMemory?(S=P5(r,e+c.charStrings),t.nGlyphs=S.offsets.length):(S=no(r,e+c.charStrings),t.nGlyphs=S.objects.length);var F=N5(r,e+c.charset,t.nGlyphs,o.objects);if(c.encoding===0?t.cffEncoding=new dg(b5,F):c.encoding===1?t.cffEncoding=new dg(w5,F):t.cffEncoding=L5(r,e+c.encoding,F),t.encoding=t.encoding||t.cffEncoding,t.glyphs=new os.GlyphSet(t),n.lowMemory)t._push=function(B){var j=D5(B,S.offsets,r,e+c.charStrings);t.glyphs.push(B,os.cffGlyphLoader(t,B,cx,j))};else for(var E=0;E<t.nGlyphs;E+=1){var R=S.objects[E];t.glyphs.push(E,os.cffGlyphLoader(t,E,cx,R))}}function eF(r,e){var t,n=jp.indexOf(r);return n>=0&&(t=n),n=e.indexOf(r),n>=0?t=n+jp.length:(t=jp.length+e.length,e.push(r)),t}function z5(){return new dt.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function $5(r){var e=new dt.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);e.names=[];for(var t=0;t<r.length;t+=1)e.names.push({name:"name_"+t,type:"NAME",value:r[t]});return e}function tF(r,e,t){for(var n={},i=0;i<r.length;i+=1){var a=r[i],s=e[a.name];s!==void 0&&!QT(s,a.value)&&(a.type==="SID"&&(s=eF(s,t)),n[a.op]={name:a.name,type:a.type,value:s})}return n}function dx(r,e){var t=new dt.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=tF(JT,r,e),t}function fx(r){var e=new dt.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return e.topDicts=[{name:"topDict_0",type:"TABLE",value:r}],e}function H5(r){var e=new dt.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);e.strings=[];for(var t=0;t<r.length;t+=1)e.strings.push({name:"string_"+t,type:"STRING",value:r[t]});return e}function j5(){return new dt.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function G5(r,e){for(var t=new dt.Record("Charsets",[{name:"format",type:"Card8",value:0}]),n=0;n<r.length;n+=1){var i=r[n],a=eF(i,e);t.fields.push({name:"glyph_"+n,type:"SID",value:a})}return t}function q5(r){var e=[],t=r.path;e.push({name:"width",type:"NUMBER",value:r.advanceWidth});for(var n=0,i=0,a=0;a<t.commands.length;a+=1){var s=void 0,o=void 0,l=t.commands[a];if(l.type==="Q"){var u=.3333333333333333,c=2/3;l={type:"C",x:l.x,y:l.y,x1:Math.round(u*n+c*l.x1),y1:Math.round(u*i+c*l.y1),x2:Math.round(u*l.x+c*l.x1),y2:Math.round(u*l.y+c*l.y1)}}if(l.type==="M")s=Math.round(l.x-n),o=Math.round(l.y-i),e.push({name:"dx",type:"NUMBER",value:s}),e.push({name:"dy",type:"NUMBER",value:o}),e.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(l.x),i=Math.round(l.y);else if(l.type==="L")s=Math.round(l.x-n),o=Math.round(l.y-i),e.push({name:"dx",type:"NUMBER",value:s}),e.push({name:"dy",type:"NUMBER",value:o}),e.push({name:"rlineto",type:"OP",value:5}),n=Math.round(l.x),i=Math.round(l.y);else if(l.type==="C"){var f=Math.round(l.x1-n),d=Math.round(l.y1-i),h=Math.round(l.x2-l.x1),g=Math.round(l.y2-l.y1);s=Math.round(l.x-l.x2),o=Math.round(l.y-l.y2),e.push({name:"dx1",type:"NUMBER",value:f}),e.push({name:"dy1",type:"NUMBER",value:d}),e.push({name:"dx2",type:"NUMBER",value:h}),e.push({name:"dy2",type:"NUMBER",value:g}),e.push({name:"dx",type:"NUMBER",value:s}),e.push({name:"dy",type:"NUMBER",value:o}),e.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(l.x),i=Math.round(l.y)}}return e.push({name:"endchar",type:"OP",value:14}),e}function W5(r){for(var e=new dt.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),t=0;t<r.length;t+=1){var n=r.get(t),i=q5(n);e.charStrings.push({name:n.name,type:"CHARSTRING",value:i})}return e}function Q5(r,e){var t=new dt.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=tF(KT,r,e),t}function Y5(r,e){for(var t=new dt.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),n=1/e.unitsPerEm,i={version:e.version,fullName:e.fullName,familyName:e.familyName,weight:e.weightName,fontBBox:e.fontBBox||[0,0,0,0],fontMatrix:[n,0,0,n,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},a={},s=[],o,l=1;l<r.length;l+=1)o=r.get(l),s.push(o.name);var u=[];t.header=z5(),t.nameIndex=$5([e.postScriptName]);var c=dx(i,u);t.topDictIndex=fx(c),t.globalSubrIndex=j5(),t.charsets=G5(s,u),t.charStringsIndex=W5(r),t.privateDict=Q5(a,u),t.stringIndex=H5(u);var f=t.header.sizeOf()+t.nameIndex.sizeOf()+t.topDictIndex.sizeOf()+t.stringIndex.sizeOf()+t.globalSubrIndex.sizeOf();return i.charset=f,i.encoding=0,i.charStrings=i.charset+t.charsets.sizeOf(),i.private[1]=i.charStrings+t.charStringsIndex.sizeOf(),c=dx(i,u),t.topDictIndex=fx(c),t}var rF={parse:V5,make:Y5};function X5(r,e){var t={},n=new vt.Parser(r,e);return t.version=n.parseVersion(),t.fontRevision=Math.round(n.parseFixed()*1e3)/1e3,t.checkSumAdjustment=n.parseULong(),t.magicNumber=n.parseULong(),jt.argument(t.magicNumber===1594834165,"Font header has wrong magic number."),t.flags=n.parseUShort(),t.unitsPerEm=n.parseUShort(),t.created=n.parseLongDateTime(),t.modified=n.parseLongDateTime(),t.xMin=n.parseShort(),t.yMin=n.parseShort(),t.xMax=n.parseShort(),t.yMax=n.parseShort(),t.macStyle=n.parseUShort(),t.lowestRecPPEM=n.parseUShort(),t.fontDirectionHint=n.parseShort(),t.indexToLocFormat=n.parseShort(),t.glyphDataFormat=n.parseShort(),t}function J5(r){var e=Math.round(new Date().getTime()/1e3)+2082844800,t=e;return r.createdTimestamp&&(t=r.createdTimestamp+2082844800),new dt.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:t},{name:"modified",type:"LONGDATETIME",value:e},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],r)}var nF={parse:X5,make:J5};function K5(r,e){var t={},n=new vt.Parser(r,e);return t.version=n.parseVersion(),t.ascender=n.parseShort(),t.descender=n.parseShort(),t.lineGap=n.parseShort(),t.advanceWidthMax=n.parseUShort(),t.minLeftSideBearing=n.parseShort(),t.minRightSideBearing=n.parseShort(),t.xMaxExtent=n.parseShort(),t.caretSlopeRise=n.parseShort(),t.caretSlopeRun=n.parseShort(),t.caretOffset=n.parseShort(),n.relativeOffset+=8,t.metricDataFormat=n.parseShort(),t.numberOfHMetrics=n.parseUShort(),t}function Z5(r){return new dt.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],r)}var iF={parse:K5,make:Z5};function e6(r,e,t,n,i){for(var a,s,o=new vt.Parser(r,e),l=0;l<n;l+=1){l<t&&(a=o.parseUShort(),s=o.parseShort());var u=i.get(l);u.advanceWidth=a,u.leftSideBearing=s}}function t6(r,e,t,n,i){r._hmtxTableData={};for(var a,s,o=new vt.Parser(e,t),l=0;l<i;l+=1)l<n&&(a=o.parseUShort(),s=o.parseShort()),r._hmtxTableData[l]={advanceWidth:a,leftSideBearing:s}}function r6(r,e,t,n,i,a,s){s.lowMemory?t6(r,e,t,n,i):e6(e,t,n,i,a)}function n6(r){for(var e=new dt.Table("hmtx",[]),t=0;t<r.length;t+=1){var n=r.get(t),i=n.advanceWidth||0,a=n.leftSideBearing||0;e.fields.push({name:"advanceWidth_"+t,type:"USHORT",value:i}),e.fields.push({name:"leftSideBearing_"+t,type:"SHORT",value:a})}return e}var aF={parse:r6,make:n6};function i6(r){for(var e=new dt.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:r.length}]),t="",n=12+r.length*4,i=0;i<r.length;++i){var a=t.indexOf(r[i]);a<0&&(a=t.length,t+=r[i]),e.fields.push({name:"offset "+i,type:"USHORT",value:n+a}),e.fields.push({name:"length "+i,type:"USHORT",value:r[i].length})}return e.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),e}function a6(r,e){var t=new vt.Parser(r,e),n=t.parseULong();jt.argument(n===1,"Unsupported ltag table version."),t.skip("uLong",1);for(var i=t.parseULong(),a=[],s=0;s<i;s++){for(var o="",l=e+t.parseUShort(),u=t.parseUShort(),c=l;c<l+u;++c)o+=String.fromCharCode(r.getInt8(c));a.push(o)}return a}var sF={make:i6,parse:a6};function s6(r,e){var t={},n=new vt.Parser(r,e);return t.version=n.parseVersion(),t.numGlyphs=n.parseUShort(),t.version===1&&(t.maxPoints=n.parseUShort(),t.maxContours=n.parseUShort(),t.maxCompositePoints=n.parseUShort(),t.maxCompositeContours=n.parseUShort(),t.maxZones=n.parseUShort(),t.maxTwilightPoints=n.parseUShort(),t.maxStorage=n.parseUShort(),t.maxFunctionDefs=n.parseUShort(),t.maxInstructionDefs=n.parseUShort(),t.maxStackElements=n.parseUShort(),t.maxSizeOfInstructions=n.parseUShort(),t.maxComponentElements=n.parseUShort(),t.maxComponentDepth=n.parseUShort()),t}function o6(r){return new dt.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:r}])}var oF={parse:s6,make:o6},lF=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],uF={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"},l6={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},cF={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 u6(r,e,t){switch(r){case 0:if(e===65535)return"und";if(t)return t[e];break;case 1:return uF[e];case 3:return cF[e]}}var Ky="utf-16",c6={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"},d6={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 dF(r,e,t){switch(r){case 0:return Ky;case 1:return d6[t]||c6[e];case 3:if(e===1||e===10)return Ky;break}}function f6(r,e,t){for(var n={},i=new vt.Parser(r,e),a=i.parseUShort(),s=i.parseUShort(),o=i.offset+i.parseUShort(),l=0;l<s;l++){var u=i.parseUShort(),c=i.parseUShort(),f=i.parseUShort(),d=i.parseUShort(),h=lF[d]||d,g=i.parseUShort(),v=i.parseUShort(),y=u6(u,f,t),A=dF(u,c,f);if(A!==void 0&&y!==void 0){var C=void 0;if(A===Ky?C=nc.UTF16(r,o+v,g):C=nc.MACSTRING(r,o+v,g,A),C){var S=n[h];S===void 0&&(S=n[h]={}),S[y]=C}}}return a===1&&i.parseUShort(),n}function F0(r){var e={};for(var t in r)e[r[t]]=parseInt(t);return e}function hx(r,e,t,n,i,a){return new dt.Record("NameRecord",[{name:"platformID",type:"USHORT",value:r},{name:"encodingID",type:"USHORT",value:e},{name:"languageID",type:"USHORT",value:t},{name:"nameID",type:"USHORT",value:n},{name:"length",type:"USHORT",value:i},{name:"offset",type:"USHORT",value:a}])}function h6(r,e){var t=r.length,n=e.length-t+1;e:for(var i=0;i<n;i++)for(;i<n;i++){for(var a=0;a<t;a++)if(e[i+a]!==r[a])continue e;return i}return-1}function px(r,e){var t=h6(r,e);if(t<0){t=e.length;for(var n=0,i=r.length;n<i;++n)e.push(r[n])}return t}function p6(r,e){var t,n=[],i={},a=F0(lF);for(var s in r){var o=a[s];if(o===void 0&&(o=s),t=parseInt(o),isNaN(t))throw new Error('Name table entry "'+s+'" does not exist, see nameTableNames for complete list.');i[t]=r[s],n.push(t)}for(var l=F0(uF),u=F0(cF),c=[],f=[],d=0;d<n.length;d++){t=n[d];var h=i[t];for(var g in h){var v=h[g],y=1,A=l[g],C=l6[A],S=dF(y,C,A),F=it.MACSTRING(v,S);F===void 0&&(y=0,A=e.indexOf(g),A<0&&(A=e.length,e.push(g)),C=4,F=it.UTF16(v));var E=px(F,f);c.push(hx(y,C,A,t,F.length,E));var R=u[g];if(R!==void 0){var B=it.UTF16(v),j=px(B,f);c.push(hx(3,1,R,t,B.length,j))}}}c.sort(function(q,Y){return q.platformID-Y.platformID||q.encodingID-Y.encodingID||q.languageID-Y.languageID||q.nameID-Y.nameID});for(var G=new dt.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:c.length},{name:"stringOffset",type:"USHORT",value:6+c.length*12}]),ie=0;ie<c.length;ie++)G.fields.push({name:"record_"+ie,type:"RECORD",value:c[ie]});return G.fields.push({name:"strings",type:"LITERAL",value:f}),G}var fF={parse:f6,make:p6},Zy=[{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 g6(r){for(var e=0;e<Zy.length;e+=1){var t=Zy[e];if(r>=t.begin&&r<t.end)return e}return-1}function m6(r,e){var t={},n=new vt.Parser(r,e);t.version=n.parseUShort(),t.xAvgCharWidth=n.parseShort(),t.usWeightClass=n.parseUShort(),t.usWidthClass=n.parseUShort(),t.fsType=n.parseUShort(),t.ySubscriptXSize=n.parseShort(),t.ySubscriptYSize=n.parseShort(),t.ySubscriptXOffset=n.parseShort(),t.ySubscriptYOffset=n.parseShort(),t.ySuperscriptXSize=n.parseShort(),t.ySuperscriptYSize=n.parseShort(),t.ySuperscriptXOffset=n.parseShort(),t.ySuperscriptYOffset=n.parseShort(),t.yStrikeoutSize=n.parseShort(),t.yStrikeoutPosition=n.parseShort(),t.sFamilyClass=n.parseShort(),t.panose=[];for(var i=0;i<10;i++)t.panose[i]=n.parseByte();return t.ulUnicodeRange1=n.parseULong(),t.ulUnicodeRange2=n.parseULong(),t.ulUnicodeRange3=n.parseULong(),t.ulUnicodeRange4=n.parseULong(),t.achVendID=String.fromCharCode(n.parseByte(),n.parseByte(),n.parseByte(),n.parseByte()),t.fsSelection=n.parseUShort(),t.usFirstCharIndex=n.parseUShort(),t.usLastCharIndex=n.parseUShort(),t.sTypoAscender=n.parseShort(),t.sTypoDescender=n.parseShort(),t.sTypoLineGap=n.parseShort(),t.usWinAscent=n.parseUShort(),t.usWinDescent=n.parseUShort(),t.version>=1&&(t.ulCodePageRange1=n.parseULong(),t.ulCodePageRange2=n.parseULong()),t.version>=2&&(t.sxHeight=n.parseShort(),t.sCapHeight=n.parseShort(),t.usDefaultChar=n.parseUShort(),t.usBreakChar=n.parseUShort(),t.usMaxContent=n.parseUShort()),t}function v6(r){return new dt.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],r)}var eA={parse:m6,make:v6,unicodeRanges:Zy,getUnicodeRange:g6};function y6(r,e){var t={},n=new vt.Parser(r,e);switch(t.version=n.parseVersion(),t.italicAngle=n.parseFixed(),t.underlinePosition=n.parseShort(),t.underlineThickness=n.parseShort(),t.isFixedPitch=n.parseULong(),t.minMemType42=n.parseULong(),t.maxMemType42=n.parseULong(),t.minMemType1=n.parseULong(),t.maxMemType1=n.parseULong(),t.version){case 1:t.names=ml.slice();break;case 2:t.numberOfGlyphs=n.parseUShort(),t.glyphNameIndex=new Array(t.numberOfGlyphs);for(var i=0;i<t.numberOfGlyphs;i++)t.glyphNameIndex[i]=n.parseUShort();t.names=[];for(var a=0;a<t.numberOfGlyphs;a++)if(t.glyphNameIndex[a]>=ml.length){var s=n.parseChar();t.names.push(n.parseString(s))}break;case 2.5:t.numberOfGlyphs=n.parseUShort(),t.offset=new Array(t.numberOfGlyphs);for(var o=0;o<t.numberOfGlyphs;o++)t.offset[o]=n.parseChar();break}return t}function A6(){return new dt.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}var hF={parse:y6,make:A6},Da=new Array(9);Da[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(we.coverage),deltaGlyphId:this.parseUShort()};if(t===2)return{substFormat:2,coverage:this.parsePointer(we.coverage),substitute:this.parseOffset16List()};jt.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")};Da[2]=function(){var e=this.parseUShort();return jt.argument(e===1,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(we.coverage),sequences:this.parseListOfLists()}};Da[3]=function(){var e=this.parseUShort();return jt.argument(e===1,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(we.coverage),alternateSets:this.parseListOfLists()}};Da[4]=function(){var e=this.parseUShort();return jt.argument(e===1,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(we.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var Hu={sequenceIndex:we.uShort,lookupListIndex:we.uShort};Da[5]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:t,coverage:this.parsePointer(we.coverage),ruleSets:this.parseListOfLists(function(){var a=this.parseUShort(),s=this.parseUShort();return{input:this.parseUShortList(a-1),lookupRecords:this.parseRecordList(s,Hu)}})};if(t===2)return{substFormat:t,coverage:this.parsePointer(we.coverage),classDef:this.parsePointer(we.classDef),classSets:this.parseListOfLists(function(){var a=this.parseUShort(),s=this.parseUShort();return{classes:this.parseUShortList(a-1),lookupRecords:this.parseRecordList(s,Hu)}})};if(t===3){var n=this.parseUShort(),i=this.parseUShort();return{substFormat:t,coverages:this.parseList(n,we.pointer(we.coverage)),lookupRecords:this.parseRecordList(i,Hu)}}jt.assert(!1,"0x"+e.toString(16)+": lookup type 5 format must be 1, 2 or 3.")};Da[6]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(we.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Hu)}})};if(t===2)return{substFormat:2,coverage:this.parsePointer(we.coverage),backtrackClassDef:this.parsePointer(we.classDef),inputClassDef:this.parsePointer(we.classDef),lookaheadClassDef:this.parsePointer(we.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Hu)}})};if(t===3)return{substFormat:3,backtrackCoverage:this.parseList(we.pointer(we.coverage)),inputCoverage:this.parseList(we.pointer(we.coverage)),lookaheadCoverage:this.parseList(we.pointer(we.coverage)),lookupRecords:this.parseRecordList(Hu)};jt.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")};Da[7]=function(){var e=this.parseUShort();jt.argument(e===1,"GSUB Extension Substitution subtable identifier-format must be 1");var t=this.parseUShort(),n=new we(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:Da[t].call(n)}};Da[8]=function(){var e=this.parseUShort();return jt.argument(e===1,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(we.coverage),backtrackCoverage:this.parseList(we.pointer(we.coverage)),lookaheadCoverage:this.parseList(we.pointer(we.coverage)),substitutes:this.parseUShortList()}};function b6(r,e){e=e||0;var t=new we(r,e),n=t.parseVersion(1);return jt.argument(n===1||n===1.1,"Unsupported GSUB table version."),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(Da)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(Da),variations:t.parseFeatureVariationsList()}}var gc=new Array(9);gc[1]=function(e){return e.substFormat===1?new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)},{name:"deltaGlyphID",type:"USHORT",value:e.deltaGlyphId}]):new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.ushortList("substitute",e.substitute)))};gc[2]=function(e){return jt.assert(e.substFormat===1,"Lookup type 2 substFormat must be 1."),new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.tableList("seqSet",e.sequences,function(t){return new dt.Table("sequenceSetTable",dt.ushortList("sequence",t))})))};gc[3]=function(e){return jt.assert(e.substFormat===1,"Lookup type 3 substFormat must be 1."),new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.tableList("altSet",e.alternateSets,function(t){return new dt.Table("alternateSetTable",dt.ushortList("alternate",t))})))};gc[4]=function(e){return jt.assert(e.substFormat===1,"Lookup type 4 substFormat must be 1."),new dt.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.tableList("ligSet",e.ligatureSets,function(t){return new dt.Table("ligatureSetTable",dt.tableList("ligature",t,function(n){return new dt.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:n.ligGlyph}].concat(dt.ushortList("component",n.components,n.components.length+1)))}))})))};gc[6]=function(e){if(e.substFormat===1){var t=new dt.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new dt.Coverage(e.coverage)}].concat(dt.tableList("chainRuleSet",e.chainRuleSets,function(a){return new dt.Table("chainRuleSetTable",dt.tableList("chainRule",a,function(s){var o=dt.ushortList("backtrackGlyph",s.backtrack,s.backtrack.length).concat(dt.ushortList("inputGlyph",s.input,s.input.length+1)).concat(dt.ushortList("lookaheadGlyph",s.lookahead,s.lookahead.length)).concat(dt.ushortList("substitution",[],s.lookupRecords.length));return s.lookupRecords.forEach(function(l,u){o=o.concat({name:"sequenceIndex"+u,type:"USHORT",value:l.sequenceIndex}).concat({name:"lookupListIndex"+u,type:"USHORT",value:l.lookupListIndex})}),new dt.Table("chainRuleTable",o)}))})));return t}else if(e.substFormat===2)jt.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(e.substFormat===3){var n=[{name:"substFormat",type:"USHORT",value:e.substFormat}];n.push({name:"backtrackGlyphCount",type:"USHORT",value:e.backtrackCoverage.length}),e.backtrackCoverage.forEach(function(a,s){n.push({name:"backtrackCoverage"+s,type:"TABLE",value:new dt.Coverage(a)})}),n.push({name:"inputGlyphCount",type:"USHORT",value:e.inputCoverage.length}),e.inputCoverage.forEach(function(a,s){n.push({name:"inputCoverage"+s,type:"TABLE",value:new dt.Coverage(a)})}),n.push({name:"lookaheadGlyphCount",type:"USHORT",value:e.lookaheadCoverage.length}),e.lookaheadCoverage.forEach(function(a,s){n.push({name:"lookaheadCoverage"+s,type:"TABLE",value:new dt.Coverage(a)})}),n.push({name:"substitutionCount",type:"USHORT",value:e.lookupRecords.length}),e.lookupRecords.forEach(function(a,s){n=n.concat({name:"sequenceIndex"+s,type:"USHORT",value:a.sequenceIndex}).concat({name:"lookupListIndex"+s,type:"USHORT",value:a.lookupListIndex})});var i=new dt.Table("chainContextTable",n);return i}jt.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};function w6(r){return new dt.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new dt.ScriptList(r.scripts)},{name:"features",type:"TABLE",value:new dt.FeatureList(r.features)},{name:"lookups",type:"TABLE",value:new dt.LookupList(r.lookups,gc)}])}var pF={parse:b6,make:w6};function C6(r,e){var t=new vt.Parser(r,e),n=t.parseULong();jt.argument(n===1,"Unsupported META table version."),t.parseULong(),t.parseULong();for(var i=t.parseULong(),a={},s=0;s<i;s++){var o=t.parseTag(),l=t.parseULong(),u=t.parseULong(),c=nc.UTF8(r,e+l,u);a[o]=c}return a}function x6(r){var e=Object.keys(r).length,t="",n=16+e*12,i=new dt.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:n},{name:"numTags",type:"ULONG",value:e}]);for(var a in r){var s=t.length;t+=r[a],i.fields.push({name:"tag "+a,type:"TAG",value:a}),i.fields.push({name:"offset "+a,type:"ULONG",value:n+s}),i.fields.push({name:"length "+a,type:"ULONG",value:r[a].length})}return i.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),i}var gF={parse:C6,make:x6};function gx(r){return Math.log(r)/Math.log(2)|0}function p1(r){for(;r.length%4!==0;)r.push(0);for(var e=0,t=0;t<r.length;t+=4)e+=(r[t]<<24)+(r[t+1]<<16)+(r[t+2]<<8)+r[t+3];return e%=Math.pow(2,32),e}function mx(r,e,t,n){return new dt.Record("Table Record",[{name:"tag",type:"TAG",value:r!==void 0?r:""},{name:"checkSum",type:"ULONG",value:e!==void 0?e:0},{name:"offset",type:"ULONG",value:t!==void 0?t:0},{name:"length",type:"ULONG",value:n!==void 0?n:0}])}function mF(r){var e=new dt.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);e.tables=r,e.numTables=r.length;var t=Math.pow(2,gx(e.numTables));e.searchRange=16*t,e.entrySelector=gx(t),e.rangeShift=e.numTables*16-e.searchRange;for(var n=[],i=[],a=e.sizeOf()+mx().sizeOf()*e.numTables;a%4!==0;)a+=1,i.push({name:"padding",type:"BYTE",value:0});for(var s=0;s<r.length;s+=1){var o=r[s];jt.argument(o.tableName.length===4,"Table name"+o.tableName+" is invalid.");var l=o.sizeOf(),u=mx(o.tableName,p1(o.encode()),a,l);for(n.push({name:u.tag+" Table Record",type:"RECORD",value:u}),i.push({name:o.tableName+" table",type:"RECORD",value:o}),a+=l,jt.argument(!isNaN(a),"Something went wrong calculating the offset.");a%4!==0;)a+=1,i.push({name:"padding",type:"BYTE",value:0})}return n.sort(function(c,f){return c.value.tag>f.value.tag?1:-1}),e.fields=e.fields.concat(n),e.fields=e.fields.concat(i),e}function vx(r,e,t){for(var n=0;n<e.length;n+=1){var i=r.charToGlyphIndex(e[n]);if(i>0){var a=r.glyphs.get(i);return a.getMetrics()}}return t}function S6(r){for(var e=0,t=0;t<r.length;t+=1)e+=r[t];return e/r.length}function E6(r){for(var e=[],t=[],n=[],i=[],a=[],s=[],o=[],l,u=0,c=0,f=0,d=0,h=0,g=0;g<r.glyphs.length;g+=1){var v=r.glyphs.get(g),y=v.unicode|0;if(isNaN(v.advanceWidth))throw new Error("Glyph "+v.name+" ("+g+"): advanceWidth is not a number.");(l>y||l===void 0)&&y>0&&(l=y),u<y&&(u=y);var A=eA.getUnicodeRange(y);if(A<32)c|=1<<A;else if(A<64)f|=1<<A-32;else if(A<96)d|=1<<A-64;else if(A<123)h|=1<<A-96;else throw new Error("Unicode ranges bits > 123 are reserved for internal usage");if(v.name!==".notdef"){var C=v.getMetrics();e.push(C.xMin),t.push(C.yMin),n.push(C.xMax),i.push(C.yMax),s.push(C.leftSideBearing),o.push(C.rightSideBearing),a.push(v.advanceWidth)}}var S={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,n),yMax:Math.max.apply(null,i),advanceWidthMax:Math.max.apply(null,a),advanceWidthAvg:S6(a),minLeftSideBearing:Math.min.apply(null,s),maxLeftSideBearing:Math.max.apply(null,s),minRightSideBearing:Math.min.apply(null,o)};S.ascender=r.ascender,S.descender=r.descender;var F=nF.make({flags:3,unitsPerEm:r.unitsPerEm,xMin:S.xMin,yMin:S.yMin,xMax:S.xMax,yMax:S.yMax,lowestRecPPEM:3,createdTimestamp:r.createdTimestamp}),E=iF.make({ascender:S.ascender,descender:S.descender,advanceWidthMax:S.advanceWidthMax,minLeftSideBearing:S.minLeftSideBearing,minRightSideBearing:S.minRightSideBearing,xMaxExtent:S.maxLeftSideBearing+(S.xMax-S.xMin),numberOfHMetrics:r.glyphs.length}),R=oF.make(r.glyphs.length),B=eA.make(Object.assign({xAvgCharWidth:Math.round(S.advanceWidthAvg),usFirstCharIndex:l,usLastCharIndex:u,ulUnicodeRange1:c,ulUnicodeRange2:f,ulUnicodeRange3:d,ulUnicodeRange4:h,sTypoAscender:S.ascender,sTypoDescender:S.descender,sTypoLineGap:0,usWinAscent:S.yMax,usWinDescent:Math.abs(S.yMin),ulCodePageRange1:1,sxHeight:vx(r,"xyvw",{yMax:Math.round(S.ascender/2)}).yMax,sCapHeight:vx(r,"HIKLEFJMNTZBDPRAGOQSUVWXY",S).yMax,usDefaultChar:r.hasChar(" ")?32:0,usBreakChar:r.hasChar(" ")?32:0},r.tables.os2)),j=aF.make(r.glyphs),G=GT.make(r.glyphs),ie=r.getEnglishName("fontFamily"),q=r.getEnglishName("fontSubfamily"),Y=ie+" "+q,J=r.getEnglishName("postScriptName");J||(J=ie.replace(/\s/g,"")+"-"+q);var ae={};for(var oe in r.names)ae[oe]=r.names[oe];ae.uniqueID||(ae.uniqueID={en:r.getEnglishName("manufacturer")+":"+Y}),ae.postScriptName||(ae.postScriptName={en:J}),ae.preferredFamily||(ae.preferredFamily=r.names.fontFamily),ae.preferredSubfamily||(ae.preferredSubfamily=r.names.fontSubfamily);var he=[],ye=fF.make(ae,he),Ue=he.length>0?sF.make(he):void 0,Re=hF.make(),Oe=rF.make(r.glyphs,{version:r.getEnglishName("version"),fullName:Y,familyName:ie,weightName:q,postScriptName:J,unitsPerEm:r.unitsPerEm,fontBBox:[0,S.yMin,S.ascender,S.advanceWidthMax]}),ee=r.metas&&Object.keys(r.metas).length>0?gF.make(r.metas):void 0,re=[F,E,R,B,ye,G,Re,Oe,j];Ue&&re.push(Ue),r.tables.gsub&&re.push(pF.make(r.tables.gsub)),ee&&re.push(ee);for(var fe=mF(re),Be=fe.encode(),ke=p1(Be),$e=fe.fields,je=!1,qe=0;qe<$e.length;qe+=1)if($e[qe].name==="head table"){$e[qe].value.checkSumAdjustment=2981146554-ke,je=!0;break}if(!je)throw new Error("Could not find head table with checkSum to adjust.");return fe}var k6={make:mF,fontToTable:E6,computeCheckSum:p1};function I0(r,e){for(var t=0,n=r.length-1;t<=n;){var i=t+n>>>1,a=r[i].tag;if(a===e)return i;a<e?t=i+1:n=i-1}return-t-1}function yx(r,e){for(var t=0,n=r.length-1;t<=n;){var i=t+n>>>1,a=r[i];if(a===e)return i;a<e?t=i+1:n=i-1}return-t-1}function Ax(r,e){for(var t,n=0,i=r.length-1;n<=i;){var a=n+i>>>1;t=r[a];var s=t.start;if(s===e)return t;s<e?n=a+1:i=a-1}if(n>0)return t=r[n-1],e>t.end?0:t}function Hf(r,e){this.font=r,this.tableName=e}Hf.prototype={searchTag:I0,binSearch:yx,getTable:function(r){var e=this.font.tables[this.tableName];return!e&&r&&(e=this.font.tables[this.tableName]=this.createDefaultTable()),e},getScriptNames:function(){var r=this.getTable();return r?r.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var r=this.getTable();if(r){for(var e=!1,t=0;t<r.scripts.length;t++){var n=r.scripts[t].tag;if(n==="DFLT")return n;n==="latn"&&(e=!0)}if(e)return"latn"}},getScriptTable:function(r,e){var t=this.getTable(e);if(t){r=r||"DFLT";var n=t.scripts,i=I0(t.scripts,r);if(i>=0)return n[i].script;if(e){var a={tag:r,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return n.splice(-1-i,0,a),a.script}}},getLangSysTable:function(r,e,t){var n=this.getScriptTable(r,t);if(n){if(!e||e==="dflt"||e==="DFLT")return n.defaultLangSys;var i=I0(n.langSysRecords,e);if(i>=0)return n.langSysRecords[i].langSys;if(t){var a={tag:e,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return n.langSysRecords.splice(-1-i,0,a),a.langSys}}},getFeatureTable:function(r,e,t,n){var i=this.getLangSysTable(r,e,n);if(i){for(var a,s=i.featureIndexes,o=this.font.tables[this.tableName].features,l=0;l<s.length;l++)if(a=o[s[l]],a.tag===t)return a.feature;if(n){var u=o.length;return jt.assert(u===0||t>=o[u-1].tag,"Features must be added in alphabetical order."),a={tag:t,feature:{params:0,lookupListIndexes:[]}},o.push(a),s.push(u),a.feature}}},getLookupTables:function(r,e,t,n,i){var a=this.getFeatureTable(r,e,t,i),s=[];if(a){for(var o,l=a.lookupListIndexes,u=this.font.tables[this.tableName].lookups,c=0;c<l.length;c++)o=u[l[c]],o.lookupType===n&&s.push(o);if(s.length===0&&i){o={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0};var f=u.length;return u.push(o),l.push(f),[o]}}return s},getGlyphClass:function(r,e){switch(r.format){case 1:return r.startGlyph<=e&&e<r.startGlyph+r.classes.length?r.classes[e-r.startGlyph]:0;case 2:var t=Ax(r.ranges,e);return t?t.classId:0}},getCoverageIndex:function(r,e){switch(r.format){case 1:var t=yx(r.glyphs,e);return t>=0?t:-1;case 2:var n=Ax(r.ranges,e);return n?n.index+e-n.start:-1}},expandCoverage:function(r){if(r.format===1)return r.glyphs;for(var e=[],t=r.ranges,n=0;n<t.length;n++)for(var i=t[n],a=i.start,s=i.end,o=a;o<=s;o++)e.push(o);return e}};function jf(r){Hf.call(this,r,"gpos")}jf.prototype=Hf.prototype;jf.prototype.init=function(){var r=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(r)};jf.prototype.getKerningValue=function(r,e,t){for(var n=0;n<r.length;n++)for(var i=r[n].subtables,a=0;a<i.length;a++){var s=i[a],o=this.getCoverageIndex(s.coverage,e);if(!(o<0))switch(s.posFormat){case 1:for(var l=s.pairSets[o],u=0;u<l.length;u++){var c=l[u];if(c.secondGlyph===t)return c.value1&&c.value1.xAdvance||0}break;case 2:var f=this.getGlyphClass(s.classDef1,e),d=this.getGlyphClass(s.classDef2,t),h=s.classRecords[f][d];return h.value1&&h.value1.xAdvance||0}}return 0};jf.prototype.getKerningTables=function(r,e){if(this.font.tables.gpos)return this.getLookupTables(r,e,"kern",2)};function ia(r){Hf.call(this,r,"gsub")}function T6(r,e){var t=r.length;if(t!==e.length)return!1;for(var n=0;n<t;n++)if(r[n]!==e[n])return!1;return!0}function g1(r,e,t){for(var n=r.subtables,i=0;i<n.length;i++){var a=n[i];if(a.substFormat===e)return a}if(t)return n.push(t),t}ia.prototype=Hf.prototype;ia.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}};ia.prototype.getSingle=function(r,e,t){for(var n=[],i=this.getLookupTables(e,t,r,1),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++){var l=s[o],u=this.expandCoverage(l.coverage),c=void 0;if(l.substFormat===1){var f=l.deltaGlyphId;for(c=0;c<u.length;c++){var d=u[c];n.push({sub:d,by:d+f})}}else{var h=l.substitute;for(c=0;c<u.length;c++)n.push({sub:u[c],by:h[c]})}}return n};ia.prototype.getMultiple=function(r,e,t){for(var n=[],i=this.getLookupTables(e,t,r,2),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++){var l=s[o],u=this.expandCoverage(l.coverage),c=void 0;for(c=0;c<u.length;c++){var f=u[c],d=l.sequences[c];n.push({sub:f,by:d})}}return n};ia.prototype.getAlternates=function(r,e,t){for(var n=[],i=this.getLookupTables(e,t,r,3),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++)for(var l=s[o],u=this.expandCoverage(l.coverage),c=l.alternateSets,f=0;f<u.length;f++)n.push({sub:u[f],by:c[f]});return n};ia.prototype.getLigatures=function(r,e,t){for(var n=[],i=this.getLookupTables(e,t,r,4),a=0;a<i.length;a++)for(var s=i[a].subtables,o=0;o<s.length;o++)for(var l=s[o],u=this.expandCoverage(l.coverage),c=l.ligatureSets,f=0;f<u.length;f++)for(var d=u[f],h=c[f],g=0;g<h.length;g++){var v=h[g];n.push({sub:[d].concat(v.components),by:v.ligGlyph})}return n};ia.prototype.addSingle=function(r,e,t,n){var i=this.getLookupTables(t,n,r,1,!0)[0],a=g1(i,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});jt.assert(a.coverage.format===1,"Single: unable to modify coverage table format "+a.coverage.format);var s=e.sub,o=this.binSearch(a.coverage.glyphs,s);o<0&&(o=-1-o,a.coverage.glyphs.splice(o,0,s),a.substitute.splice(o,0,0)),a.substitute[o]=e.by};ia.prototype.addMultiple=function(r,e,t,n){jt.assert(e.by instanceof Array&&e.by.length>1,'Multiple: "by" must be an array of two or more ids');var i=this.getLookupTables(t,n,r,2,!0)[0],a=g1(i,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});jt.assert(a.coverage.format===1,"Multiple: unable to modify coverage table format "+a.coverage.format);var s=e.sub,o=this.binSearch(a.coverage.glyphs,s);o<0&&(o=-1-o,a.coverage.glyphs.splice(o,0,s),a.sequences.splice(o,0,0)),a.sequences[o]=e.by};ia.prototype.addAlternate=function(r,e,t,n){var i=this.getLookupTables(t,n,r,3,!0)[0],a=g1(i,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});jt.assert(a.coverage.format===1,"Alternate: unable to modify coverage table format "+a.coverage.format);var s=e.sub,o=this.binSearch(a.coverage.glyphs,s);o<0&&(o=-1-o,a.coverage.glyphs.splice(o,0,s),a.alternateSets.splice(o,0,0)),a.alternateSets[o]=e.by};ia.prototype.addLigature=function(r,e,t,n){var i=this.getLookupTables(t,n,r,4,!0)[0],a=i.subtables[0];a||(a={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},i.subtables[0]=a),jt.assert(a.coverage.format===1,"Ligature: unable to modify coverage table format "+a.coverage.format);var s=e.sub[0],o=e.sub.slice(1),l={ligGlyph:e.by,components:o},u=this.binSearch(a.coverage.glyphs,s);if(u>=0){for(var c=a.ligatureSets[u],f=0;f<c.length;f++)if(T6(c[f].components,o))return;c.push(l)}else u=-1-u,a.coverage.glyphs.splice(u,0,s),a.ligatureSets.splice(u,0,[l])};ia.prototype.getFeature=function(r,e,t){if(/ss\d\d/.test(r))return this.getSingle(r,e,t);switch(r){case"aalt":case"salt":return this.getSingle(r,e,t).concat(this.getAlternates(r,e,t));case"dlig":case"liga":case"rlig":return this.getLigatures(r,e,t);case"ccmp":return this.getMultiple(r,e,t).concat(this.getLigatures(r,e,t));case"stch":return this.getMultiple(r,e,t)}};ia.prototype.add=function(r,e,t,n){if(/ss\d\d/.test(r))return this.addSingle(r,e,t,n);switch(r){case"aalt":case"salt":return typeof e.by=="number"?this.addSingle(r,e,t,n):this.addAlternate(r,e,t,n);case"dlig":case"liga":case"rlig":return this.addLigature(r,e,t,n);case"ccmp":return e.by instanceof Array?this.addMultiple(r,e,t,n):this.addLigature(r,e,t,n)}};function F6(){return typeof window<"u"}function I6(r){for(var e=new Buffer(r.byteLength),t=new Uint8Array(r),n=0;n<e.length;++n)e[n]=t[n];return e}function pd(r,e){if(!r)throw e}function bx(r,e,t,n,i){var a;return(e&n)>0?(a=r.parseByte(),(e&i)===0&&(a=-a),a=t+a):(e&i)>0?a=t:a=t+r.parseShort(),a}function vF(r,e,t){var n=new vt.Parser(e,t);r.numberOfContours=n.parseShort(),r._xMin=n.parseShort(),r._yMin=n.parseShort(),r._xMax=n.parseShort(),r._yMax=n.parseShort();var i,a;if(r.numberOfContours>0){for(var s=r.endPointIndices=[],o=0;o<r.numberOfContours;o+=1)s.push(n.parseUShort());r.instructionLength=n.parseUShort(),r.instructions=[];for(var l=0;l<r.instructionLength;l+=1)r.instructions.push(n.parseByte());var u=s[s.length-1]+1;i=[];for(var c=0;c<u;c+=1)if(a=n.parseByte(),i.push(a),(a&8)>0)for(var f=n.parseByte(),d=0;d<f;d+=1)i.push(a),c+=1;if(jt.argument(i.length===u,"Bad flags."),s.length>0){var h=[],g;if(u>0){for(var v=0;v<u;v+=1)a=i[v],g={},g.onCurve=!!(a&1),g.lastPointOfContour=s.indexOf(v)>=0,h.push(g);for(var y=0,A=0;A<u;A+=1)a=i[A],g=h[A],g.x=bx(n,a,y,2,16),y=g.x;for(var C=0,S=0;S<u;S+=1)a=i[S],g=h[S],g.y=bx(n,a,C,4,32),C=g.y}r.points=h}else r.points=[]}else if(r.numberOfContours===0)r.points=[];else{r.isComposite=!0,r.points=[],r.components=[];for(var F=!0;F;){i=n.parseUShort();var E={glyphIndex:n.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(i&1)>0?(i&2)>0?(E.dx=n.parseShort(),E.dy=n.parseShort()):E.matchedPoints=[n.parseUShort(),n.parseUShort()]:(i&2)>0?(E.dx=n.parseChar(),E.dy=n.parseChar()):E.matchedPoints=[n.parseByte(),n.parseByte()],(i&8)>0?E.xScale=E.yScale=n.parseF2Dot14():(i&64)>0?(E.xScale=n.parseF2Dot14(),E.yScale=n.parseF2Dot14()):(i&128)>0&&(E.xScale=n.parseF2Dot14(),E.scale01=n.parseF2Dot14(),E.scale10=n.parseF2Dot14(),E.yScale=n.parseF2Dot14()),r.components.push(E),F=!!(i&32)}if(i&256){r.instructionLength=n.parseUShort(),r.instructions=[];for(var R=0;R<r.instructionLength;R+=1)r.instructions.push(n.parseByte())}}}function P0(r,e){for(var t=[],n=0;n<r.length;n+=1){var i=r[n],a={x:e.xScale*i.x+e.scale01*i.y+e.dx,y:e.scale10*i.x+e.yScale*i.y+e.dy,onCurve:i.onCurve,lastPointOfContour:i.lastPointOfContour};t.push(a)}return t}function P6(r){for(var e=[],t=[],n=0;n<r.length;n+=1){var i=r[n];t.push(i),i.lastPointOfContour&&(e.push(t),t=[])}return jt.argument(t.length===0,"There are still points left in the current contour."),e}function yF(r){var e=new fi;if(!r)return e;for(var t=P6(r),n=0;n<t.length;++n){var i=t[n],a=null,s=i[i.length-1],o=i[0];if(s.onCurve)e.moveTo(s.x,s.y);else if(o.onCurve)e.moveTo(o.x,o.y);else{var l={x:(s.x+o.x)*.5,y:(s.y+o.y)*.5};e.moveTo(l.x,l.y)}for(var u=0;u<i.length;++u)if(a=s,s=o,o=i[(u+1)%i.length],s.onCurve)e.lineTo(s.x,s.y);else{var c=o;a.onCurve||((s.x+a.x)*.5,(s.y+a.y)*.5),o.onCurve||(c={x:(s.x+o.x)*.5,y:(s.y+o.y)*.5}),e.quadraticCurveTo(s.x,s.y,c.x,c.y)}e.closePath()}return e}function AF(r,e){if(e.isComposite)for(var t=0;t<e.components.length;t+=1){var n=e.components[t],i=r.get(n.glyphIndex);if(i.getPath(),i.points){var a=void 0;if(n.matchedPoints===void 0)a=P0(i.points,n);else{if(n.matchedPoints[0]>e.points.length-1||n.matchedPoints[1]>i.points.length-1)throw Error("Matched points out of range in "+e.name);var s=e.points[n.matchedPoints[0]],o=i.points[n.matchedPoints[1]],l={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};o=P0([o],l)[0],l.dx=s.x-o.x,l.dy=s.y-o.y,a=P0(i.points,l)}e.points=e.points.concat(a)}}return yF(e.points)}function D6(r,e,t,n){for(var i=new os.GlyphSet(n),a=0;a<t.length-1;a+=1){var s=t[a],o=t[a+1];s!==o?i.push(a,os.ttfGlyphLoader(n,a,vF,r,e+s,AF)):i.push(a,os.glyphLoader(n,a))}return i}function R6(r,e,t,n){var i=new os.GlyphSet(n);return n._push=function(a){var s=t[a],o=t[a+1];s!==o?i.push(a,os.ttfGlyphLoader(n,a,vF,r,e+s,AF)):i.push(a,os.glyphLoader(n,a))},i}function O6(r,e,t,n,i){return i.lowMemory?R6(r,e,t,n):D6(r,e,t,n)}var bF={getPath:yF,parse:O6},wF,El,CF,tA;function xF(r){this.font=r,this.getCommands=function(e){return bF.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function B6(r){return r}function SF(r){return Math.sign(r)*Math.round(Math.abs(r))}function M6(r){return Math.sign(r)*Math.round(Math.abs(r*2))/2}function _6(r){return Math.sign(r)*(Math.round(Math.abs(r)+.5)-.5)}function N6(r){return Math.sign(r)*Math.ceil(Math.abs(r))}function L6(r){return Math.sign(r)*Math.floor(Math.abs(r))}var EF=function(r){var e=this.srPeriod,t=this.srPhase,n=this.srThreshold,i=1;return r<0&&(r=-r,i=-1),r+=n-t,r=Math.trunc(r/e)*e,r+=t,r<0?t*i:r*i},rs={x:1,y:0,axis:"x",distance:function(r,e,t,n){return(t?r.xo:r.x)-(n?e.xo:e.x)},interpolate:function(r,e,t,n){var i,a,s,o,l,u,c;if(!n||n===this){if(i=r.xo-e.xo,a=r.xo-t.xo,l=e.x-e.xo,u=t.x-t.xo,s=Math.abs(i),o=Math.abs(a),c=s+o,c===0){r.x=r.xo+(l+u)/2;return}r.x=r.xo+(l*o+u*s)/c;return}if(i=n.distance(r,e,!0,!0),a=n.distance(r,t,!0,!0),l=n.distance(e,e,!1,!0),u=n.distance(t,t,!1,!0),s=Math.abs(i),o=Math.abs(a),c=s+o,c===0){rs.setRelative(r,r,(l+u)/2,n,!0);return}rs.setRelative(r,r,(l*o+u*s)/c,n,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(r,e,t,n,i){if(!n||n===this){r.x=(i?e.xo:e.x)+t;return}var a=i?e.xo:e.x,s=i?e.yo:e.y,o=a+t*n.x,l=s+t*n.y;r.x=o+(r.y-l)/n.normalSlope},slope:0,touch:function(r){r.xTouched=!0},touched:function(r){return r.xTouched},untouch:function(r){r.xTouched=!1}},Rs={x:0,y:1,axis:"y",distance:function(r,e,t,n){return(t?r.yo:r.y)-(n?e.yo:e.y)},interpolate:function(r,e,t,n){var i,a,s,o,l,u,c;if(!n||n===this){if(i=r.yo-e.yo,a=r.yo-t.yo,l=e.y-e.yo,u=t.y-t.yo,s=Math.abs(i),o=Math.abs(a),c=s+o,c===0){r.y=r.yo+(l+u)/2;return}r.y=r.yo+(l*o+u*s)/c;return}if(i=n.distance(r,e,!0,!0),a=n.distance(r,t,!0,!0),l=n.distance(e,e,!1,!0),u=n.distance(t,t,!1,!0),s=Math.abs(i),o=Math.abs(a),c=s+o,c===0){Rs.setRelative(r,r,(l+u)/2,n,!0);return}Rs.setRelative(r,r,(l*o+u*s)/c,n,!0)},normalSlope:0,setRelative:function(r,e,t,n,i){if(!n||n===this){r.y=(i?e.yo:e.y)+t;return}var a=i?e.xo:e.x,s=i?e.yo:e.y,o=a+t*n.x,l=s+t*n.y;r.y=l+n.normalSlope*(r.x-o)},slope:Number.POSITIVE_INFINITY,touch:function(r){r.yTouched=!0},touched:function(r){return r.yTouched},untouch:function(r){r.yTouched=!1}};Object.freeze(rs);Object.freeze(Rs);function Gf(r,e){this.x=r,this.y=e,this.axis=void 0,this.slope=e/r,this.normalSlope=-r/e,Object.freeze(this)}Gf.prototype.distance=function(r,e,t,n){return this.x*rs.distance(r,e,t,n)+this.y*Rs.distance(r,e,t,n)};Gf.prototype.interpolate=function(r,e,t,n){var i,a,s,o,l,u,c;if(s=n.distance(r,e,!0,!0),o=n.distance(r,t,!0,!0),i=n.distance(e,e,!1,!0),a=n.distance(t,t,!1,!0),l=Math.abs(s),u=Math.abs(o),c=l+u,c===0){this.setRelative(r,r,(i+a)/2,n,!0);return}this.setRelative(r,r,(i*u+a*l)/c,n,!0)};Gf.prototype.setRelative=function(r,e,t,n,i){n=n||this;var a=i?e.xo:e.x,s=i?e.yo:e.y,o=a+t*n.x,l=s+t*n.y,u=n.normalSlope,c=this.slope,f=r.x,d=r.y;r.x=(c*f-u*o+l-d)/(c-u),r.y=c*(r.x-f)+d};Gf.prototype.touch=function(r){r.xTouched=!0,r.yTouched=!0};function qf(r,e){var t=Math.sqrt(r*r+e*e);return r/=t,e/=t,r===1&&e===0?rs:r===0&&e===1?Rs:new Gf(r,e)}function Os(r,e,t,n){this.x=this.xo=Math.round(r*64)/64,this.y=this.yo=Math.round(e*64)/64,this.lastPointOfContour=t,this.onCurve=n,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Os.prototype.nextTouched=function(r){for(var e=this.nextPointOnContour;!r.touched(e)&&e!==this;)e=e.nextPointOnContour;return e};Os.prototype.prevTouched=function(r){for(var e=this.prevPointOnContour;!r.touched(e)&&e!==this;)e=e.prevPointOnContour;return e};var wf=Object.freeze(new Os(0,0)),U6={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function fo(r,e){switch(this.env=r,this.stack=[],this.prog=e,r){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=rs,this.round=SF}}xF.prototype.exec=function(r,e){if(typeof e!="number")throw new Error("Point size is not a number!");if(!(this._errorState>2)){var t=this.font,n=this._prepState;if(!n||n.ppem!==e){var i=this._fpgmState;if(!i){fo.prototype=U6,i=this._fpgmState=new fo("fpgm",t.tables.fpgm),i.funcs=[],i.font=t,exports.DEBUG&&(console.log("---EXEC FPGM---"),i.step=-1);try{El(i)}catch(u){console.log("Hinting error in FPGM:"+u),this._errorState=3;return}}fo.prototype=i,n=this._prepState=new fo("prep",t.tables.prep),n.ppem=e;var a=t.tables.cvt;if(a)for(var s=n.cvt=new Array(a.length),o=e/t.unitsPerEm,l=0;l<a.length;l++)s[l]=a[l]*o;else n.cvt=[];exports.DEBUG&&(console.log("---EXEC PREP---"),n.step=-1);try{El(n)}catch(u){this._errorState<2&&console.log("Hinting error in PREP:"+u),this._errorState=2}}if(!(this._errorState>1))try{return CF(r,n)}catch(u){this._errorState<1&&(console.log("Hinting error:"+u),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}}};CF=function(r,e){var t=e.ppem/e.font.unitsPerEm,n=t,i=r.components,a,s,o;if(fo.prototype=e,!i)o=new fo("glyf",r.instructions),exports.DEBUG&&(console.log("---EXEC GLYPH---"),o.step=-1),tA(r,o,t,n),s=o.gZone;else{var l=e.font;s=[],a=[];for(var u=0;u<i.length;u++){var c=i[u],f=l.glyphs.get(c.glyphIndex);o=new fo("glyf",f.instructions),exports.DEBUG&&(console.log("---EXEC COMP "+u+"---"),o.step=-1),tA(f,o,t,n);for(var d=Math.round(c.dx*t),h=Math.round(c.dy*n),g=o.gZone,v=o.contours,y=0;y<g.length;y++){var A=g[y];A.xTouched=A.yTouched=!1,A.xo=A.x=A.x+d,A.yo=A.y=A.y+h}var C=s.length;s.push.apply(s,g);for(var S=0;S<v.length;S++)a.push(v[S]+C)}r.instructions&&!o.inhibitGridFit&&(o=new fo("glyf",r.instructions),o.gZone=o.z0=o.z1=o.z2=s,o.contours=a,s.push(new Os(0,0),new Os(Math.round(r.advanceWidth*t),0)),exports.DEBUG&&(console.log("---EXEC COMPOSITE---"),o.step=-1),El(o),s.length-=2)}return s};tA=function(r,e,t,n){for(var i=r.points||[],a=i.length,s=e.gZone=e.z0=e.z1=e.z2=[],o=e.contours=[],l,u=0;u<a;u++)l=i[u],s[u]=new Os(l.x*t,l.y*n,l.lastPointOfContour,l.onCurve);for(var c,f,d=0;d<a;d++)l=s[d],c||(c=l,o.push(d)),l.lastPointOfContour?(l.nextPointOnContour=c,c.prevPointOnContour=l,c=void 0):(f=s[d+1],l.nextPointOnContour=f,f.prevPointOnContour=l);if(!e.inhibitGridFit){if(exports.DEBUG){console.log("PROCESSING GLYPH",e.stack);for(var h=0;h<a;h++)console.log(h,s[h].x,s[h].y)}if(s.push(new Os(0,0),new Os(Math.round(r.advanceWidth*t),0)),El(e),s.length-=2,exports.DEBUG){console.log("FINISHED GLYPH",e.stack);for(var g=0;g<a;g++)console.log(g,s[g].x,s[g].y)}}};El=function(r){var e=r.prog;if(e){var t=e.length,n;for(r.ip=0;r.ip<t;r.ip++){if(exports.DEBUG&&r.step++,n=wF[e[r.ip]],!n)throw new Error("unknown instruction: 0x"+Number(e[r.ip]).toString(16));n(r)}}};function qg(r){for(var e=r.tZone=new Array(r.gZone.length),t=0;t<e.length;t++)e[t]=new Os(0,0)}function kF(r,e){var t=r.prog,n=r.ip,i=1,a;do if(a=t[++n],a===88)i++;else if(a===89)i--;else if(a===64)n+=t[n+1]+1;else if(a===65)n+=2*t[n+1]+1;else if(a>=176&&a<=183)n+=a-176+1;else if(a>=184&&a<=191)n+=(a-184+1)*2;else if(e&&i===1&&a===27)break;while(i>0);r.ip=n}function wx(r,e){exports.DEBUG&&console.log(e.step,"SVTCA["+r.axis+"]"),e.fv=e.pv=e.dpv=r}function Cx(r,e){exports.DEBUG&&console.log(e.step,"SPVTCA["+r.axis+"]"),e.pv=e.dpv=r}function xx(r,e){exports.DEBUG&&console.log(e.step,"SFVTCA["+r.axis+"]"),e.fv=r}function Sx(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z2[n],s=e.z1[i];exports.DEBUG&&console.log("SPVTL["+r+"]",n,i);var o,l;r?(o=a.y-s.y,l=s.x-a.x):(o=s.x-a.x,l=s.y-a.y),e.pv=e.dpv=qf(o,l)}function Ex(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z2[n],s=e.z1[i];exports.DEBUG&&console.log("SFVTL["+r+"]",n,i);var o,l;r?(o=a.y-s.y,l=s.x-a.x):(o=s.x-a.x,l=s.y-a.y),e.fv=qf(o,l)}function V6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"SPVFS[]",t,n),r.pv=r.dpv=qf(n,t)}function z6(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"SPVFS[]",t,n),r.fv=qf(n,t)}function $6(r){var e=r.stack,t=r.pv;exports.DEBUG&&console.log(r.step,"GPV[]"),e.push(t.x*16384),e.push(t.y*16384)}function H6(r){var e=r.stack,t=r.fv;exports.DEBUG&&console.log(r.step,"GFV[]"),e.push(t.x*16384),e.push(t.y*16384)}function j6(r){r.fv=r.pv,exports.DEBUG&&console.log(r.step,"SFVTPV[]")}function G6(r){var e=r.stack,t=e.pop(),n=e.pop(),i=e.pop(),a=e.pop(),s=e.pop(),o=r.z0,l=r.z1,u=o[t],c=o[n],f=l[i],d=l[a],h=r.z2[s];exports.DEBUG&&console.log("ISECT[], ",t,n,i,a,s);var g=u.x,v=u.y,y=c.x,A=c.y,C=f.x,S=f.y,F=d.x,E=d.y,R=(g-y)*(S-E)-(v-A)*(C-F),B=g*A-v*y,j=C*E-S*F;h.x=(B*(C-F)-j*(g-y))/R,h.y=(B*(S-E)-j*(v-A))/R}function q6(r){r.rp0=r.stack.pop(),exports.DEBUG&&console.log(r.step,"SRP0[]",r.rp0)}function W6(r){r.rp1=r.stack.pop(),exports.DEBUG&&console.log(r.step,"SRP1[]",r.rp1)}function Q6(r){r.rp2=r.stack.pop(),exports.DEBUG&&console.log(r.step,"SRP2[]",r.rp2)}function Y6(r){var e=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"SZP0[]",e),r.zp0=e,e){case 0:r.tZone||qg(r),r.z0=r.tZone;break;case 1:r.z0=r.gZone;break;default:throw new Error("Invalid zone pointer")}}function X6(r){var e=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"SZP1[]",e),r.zp1=e,e){case 0:r.tZone||qg(r),r.z1=r.tZone;break;case 1:r.z1=r.gZone;break;default:throw new Error("Invalid zone pointer")}}function J6(r){var e=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"SZP2[]",e),r.zp2=e,e){case 0:r.tZone||qg(r),r.z2=r.tZone;break;case 1:r.z2=r.gZone;break;default:throw new Error("Invalid zone pointer")}}function K6(r){var e=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"SZPS[]",e),r.zp0=r.zp1=r.zp2=e,e){case 0:r.tZone||qg(r),r.z0=r.z1=r.z2=r.tZone;break;case 1:r.z0=r.z1=r.z2=r.gZone;break;default:throw new Error("Invalid zone pointer")}}function Z6(r){r.loop=r.stack.pop(),exports.DEBUG&&console.log(r.step,"SLOOP[]",r.loop)}function eN(r){exports.DEBUG&&console.log(r.step,"RTG[]"),r.round=SF}function tN(r){exports.DEBUG&&console.log(r.step,"RTHG[]"),r.round=_6}function rN(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SMD[]",e),r.minDis=e/64}function nN(r){exports.DEBUG&&console.log(r.step,"ELSE[]"),kF(r,!1)}function iN(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"JMPR[]",e),r.ip+=e-1}function aN(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SCVTCI[]",e),r.cvCutIn=e/64}function sN(r){var e=r.stack;exports.DEBUG&&console.log(r.step,"DUP[]"),e.push(e[e.length-1])}function D0(r){exports.DEBUG&&console.log(r.step,"POP[]"),r.stack.pop()}function oN(r){exports.DEBUG&&console.log(r.step,"CLEAR[]"),r.stack.length=0}function lN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"SWAP[]"),e.push(t),e.push(n)}function uN(r){var e=r.stack;exports.DEBUG&&console.log(r.step,"DEPTH[]"),e.push(e.length)}function cN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"LOOPCALL[]",t,n);var i=r.ip,a=r.prog;r.prog=r.funcs[t];for(var s=0;s<n;s++)El(r),exports.DEBUG&&console.log(++r.step,s+1<n?"next loopcall":"done loopcall",s);r.ip=i,r.prog=a}function dN(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"CALL[]",e);var t=r.ip,n=r.prog;r.prog=r.funcs[e],El(r),r.ip=t,r.prog=n,exports.DEBUG&&console.log(++r.step,"returning from",e)}function fN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"CINDEX[]",t),e.push(e[e.length-t])}function hN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"MINDEX[]",t),e.push(e.splice(e.length-t,1)[0])}function pN(r){if(r.env!=="fpgm")throw new Error("FDEF not allowed here");var e=r.stack,t=r.prog,n=r.ip,i=e.pop(),a=n;for(exports.DEBUG&&console.log(r.step,"FDEF[]",i);t[++n]!==45;);r.ip=n,r.funcs[i]=t.slice(a+1,n)}function kx(r,e){var t=e.stack.pop(),n=e.z0[t],i=e.fv,a=e.pv;exports.DEBUG&&console.log(e.step,"MDAP["+r+"]",t);var s=a.distance(n,wf);r&&(s=e.round(s)),i.setRelative(n,wf,s,a),i.touch(n),e.rp0=e.rp1=t}function Tx(r,e){var t=e.z2,n=t.length-2,i,a,s;exports.DEBUG&&console.log(e.step,"IUP["+r.axis+"]");for(var o=0;o<n;o++)i=t[o],!r.touched(i)&&(a=i.prevTouched(r),a!==i&&(s=i.nextTouched(r),a===s&&r.setRelative(i,i,r.distance(a,a,!1,!0),r,!0),r.interpolate(i,a,s,r)))}function Fx(r,e){for(var t=e.stack,n=r?e.rp1:e.rp2,i=(r?e.z0:e.z1)[n],a=e.fv,s=e.pv,o=e.loop,l=e.z2;o--;){var u=t.pop(),c=l[u],f=s.distance(i,i,!1,!0);a.setRelative(c,c,f,s),a.touch(c),exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-o)+": ":"")+"SHP["+(r?"rp1":"rp2")+"]",u)}e.loop=1}function Ix(r,e){var t=e.stack,n=r?e.rp1:e.rp2,i=(r?e.z0:e.z1)[n],a=e.fv,s=e.pv,o=t.pop(),l=e.z2[e.contours[o]],u=l;exports.DEBUG&&console.log(e.step,"SHC["+r+"]",o);var c=s.distance(i,i,!1,!0);do u!==i&&a.setRelative(u,u,c,s),u=u.nextPointOnContour;while(u!==l)}function Px(r,e){var t=e.stack,n=r?e.rp1:e.rp2,i=(r?e.z0:e.z1)[n],a=e.fv,s=e.pv,o=t.pop();exports.DEBUG&&console.log(e.step,"SHZ["+r+"]",o);var l;switch(o){case 0:l=e.tZone;break;case 1:l=e.gZone;break;default:throw new Error("Invalid zone")}for(var u,c=s.distance(i,i,!1,!0),f=l.length-2,d=0;d<f;d++)u=l[d],a.setRelative(u,u,c,s)}function gN(r){for(var e=r.stack,t=r.loop,n=r.fv,i=e.pop()/64,a=r.z2;t--;){var s=e.pop(),o=a[s];exports.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-t)+": ":"")+"SHPIX[]",s,i),n.setRelative(o,o,i),n.touch(o)}r.loop=1}function mN(r){for(var e=r.stack,t=r.rp1,n=r.rp2,i=r.loop,a=r.z0[t],s=r.z1[n],o=r.fv,l=r.dpv,u=r.z2;i--;){var c=e.pop(),f=u[c];exports.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-i)+": ":"")+"IP[]",c,t,"<->",n),o.interpolate(f,a,s,l),o.touch(f)}r.loop=1}function Dx(r,e){var t=e.stack,n=t.pop()/64,i=t.pop(),a=e.z1[i],s=e.z0[e.rp0],o=e.fv,l=e.pv;o.setRelative(a,s,n,l),o.touch(a),exports.DEBUG&&console.log(e.step,"MSIRP["+r+"]",n,i),e.rp1=e.rp0,e.rp2=i,r&&(e.rp0=i)}function vN(r){for(var e=r.stack,t=r.rp0,n=r.z0[t],i=r.loop,a=r.fv,s=r.pv,o=r.z1;i--;){var l=e.pop(),u=o[l];exports.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-i)+": ":"")+"ALIGNRP[]",l),a.setRelative(u,n,0,s),a.touch(u)}r.loop=1}function yN(r){exports.DEBUG&&console.log(r.step,"RTDG[]"),r.round=M6}function Rx(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z0[i],s=e.fv,o=e.pv,l=e.cvt[n];exports.DEBUG&&console.log(e.step,"MIAP["+r+"]",n,"(",l,")",i);var u=o.distance(a,wf);r&&(Math.abs(u-l)<e.cvCutIn&&(u=l),u=e.round(u)),s.setRelative(a,wf,u,o),e.zp0===0&&(a.xo=a.x,a.yo=a.y),s.touch(a),e.rp0=e.rp1=i}function AN(r){var e=r.prog,t=r.ip,n=r.stack,i=e[++t];exports.DEBUG&&console.log(r.step,"NPUSHB[]",i);for(var a=0;a<i;a++)n.push(e[++t]);r.ip=t}function bN(r){var e=r.ip,t=r.prog,n=r.stack,i=t[++e];exports.DEBUG&&console.log(r.step,"NPUSHW[]",i);for(var a=0;a<i;a++){var s=t[++e]<<8|t[++e];s&32768&&(s=-((s^65535)+1)),n.push(s)}r.ip=e}function wN(r){var e=r.stack,t=r.store;t||(t=r.store=[]);var n=e.pop(),i=e.pop();exports.DEBUG&&console.log(r.step,"WS",n,i),t[i]=n}function CN(r){var e=r.stack,t=r.store,n=e.pop();exports.DEBUG&&console.log(r.step,"RS",n);var i=t&&t[n]||0;e.push(i)}function xN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"WCVTP",t,n),r.cvt[n]=t/64}function SN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"RCVT",t),e.push(r.cvt[t]*64)}function Ox(r,e){var t=e.stack,n=t.pop(),i=e.z2[n];exports.DEBUG&&console.log(e.step,"GC["+r+"]",n),t.push(e.dpv.distance(i,wf,r,!1)*64)}function Bx(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z1[n],s=e.z0[i],o=e.dpv.distance(s,a,r,r);exports.DEBUG&&console.log(e.step,"MD["+r+"]",n,i,"->",o),e.stack.push(Math.round(o*64))}function EN(r){exports.DEBUG&&console.log(r.step,"MPPEM[]"),r.stack.push(r.ppem)}function kN(r){exports.DEBUG&&console.log(r.step,"FLIPON[]"),r.autoFlip=!0}function TN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"LT[]",t,n),e.push(n<t?1:0)}function FN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"LTEQ[]",t,n),e.push(n<=t?1:0)}function IN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"GT[]",t,n),e.push(n>t?1:0)}function PN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"GTEQ[]",t,n),e.push(n>=t?1:0)}function DN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"EQ[]",t,n),e.push(t===n?1:0)}function RN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"NEQ[]",t,n),e.push(t!==n?1:0)}function ON(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"ODD[]",t),e.push(Math.trunc(t)%2?1:0)}function BN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"EVEN[]",t),e.push(Math.trunc(t)%2?0:1)}function MN(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"IF[]",e),e||(kF(r,!0),exports.DEBUG&&console.log(r.step,"EIF[]"))}function _N(r){exports.DEBUG&&console.log(r.step,"EIF[]")}function NN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"AND[]",t,n),e.push(t&&n?1:0)}function LN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"OR[]",t,n),e.push(t||n?1:0)}function UN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"NOT[]",t),e.push(t?0:1)}function R0(r,e){var t=e.stack,n=t.pop(),i=e.fv,a=e.pv,s=e.ppem,o=e.deltaBase+(r-1)*16,l=e.deltaShift,u=e.z0;exports.DEBUG&&console.log(e.step,"DELTAP["+r+"]",n,t);for(var c=0;c<n;c++){var f=t.pop(),d=t.pop(),h=o+((d&240)>>4);if(h===s){var g=(d&15)-8;g>=0&&g++,exports.DEBUG&&console.log(e.step,"DELTAPFIX",f,"by",g*l);var v=u[f];i.setRelative(v,v,g*l,a)}}}function VN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"SDB[]",t),r.deltaBase=t}function zN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"SDS[]",t),r.deltaShift=Math.pow(.5,t)}function $N(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"ADD[]",t,n),e.push(n+t)}function HN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"SUB[]",t,n),e.push(n-t)}function jN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"DIV[]",t,n),e.push(n*64/t)}function GN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"MUL[]",t,n),e.push(n*t/64)}function qN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"ABS[]",t),e.push(Math.abs(t))}function WN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"NEG[]",t),e.push(-t)}function QN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"FLOOR[]",t),e.push(Math.floor(t/64)*64)}function YN(r){var e=r.stack,t=e.pop();exports.DEBUG&&console.log(r.step,"CEILING[]",t),e.push(Math.ceil(t/64)*64)}function Kh(r,e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"ROUND[]"),t.push(e.round(n/64)*64)}function XN(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"WCVTF[]",t,n),r.cvt[n]=t*r.ppem/r.font.unitsPerEm}function O0(r,e){var t=e.stack,n=t.pop(),i=e.ppem,a=e.deltaBase+(r-1)*16,s=e.deltaShift;exports.DEBUG&&console.log(e.step,"DELTAC["+r+"]",n,t);for(var o=0;o<n;o++){var l=t.pop(),u=t.pop(),c=a+((u&240)>>4);if(c===i){var f=(u&15)-8;f>=0&&f++;var d=f*s;exports.DEBUG&&console.log(e.step,"DELTACFIX",l,"by",d),e.cvt[l]+=d}}}function JN(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SROUND[]",e),r.round=EF;var t;switch(e&192){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(r.srPeriod=t,e&48){case 0:r.srPhase=0;break;case 16:r.srPhase=.25*t;break;case 32:r.srPhase=.5*t;break;case 48:r.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}e&=15,e===0?r.srThreshold=0:r.srThreshold=(e/8-.5)*t}function KN(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"S45ROUND[]",e),r.round=EF;var t;switch(e&192){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(r.srPeriod=t,e&48){case 0:r.srPhase=0;break;case 16:r.srPhase=.25*t;break;case 32:r.srPhase=.5*t;break;case 48:r.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}e&=15,e===0?r.srThreshold=0:r.srThreshold=(e/8-.5)*t}function ZN(r){exports.DEBUG&&console.log(r.step,"ROFF[]"),r.round=B6}function e8(r){exports.DEBUG&&console.log(r.step,"RUTG[]"),r.round=N6}function t8(r){exports.DEBUG&&console.log(r.step,"RDTG[]"),r.round=L6}function r8(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SCANCTRL[]",e)}function Mx(r,e){var t=e.stack,n=t.pop(),i=t.pop(),a=e.z2[n],s=e.z1[i];exports.DEBUG&&console.log(e.step,"SDPVTL["+r+"]",n,i);var o,l;r?(o=a.y-s.y,l=s.x-a.x):(o=s.x-a.x,l=s.y-a.y),e.dpv=qf(o,l)}function n8(r){var e=r.stack,t=e.pop(),n=0;exports.DEBUG&&console.log(r.step,"GETINFO[]",t),t&1&&(n=35),t&32&&(n|=4096),e.push(n)}function i8(r){var e=r.stack,t=e.pop(),n=e.pop(),i=e.pop();exports.DEBUG&&console.log(r.step,"ROLL[]"),e.push(n),e.push(t),e.push(i)}function a8(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"MAX[]",t,n),e.push(Math.max(n,t))}function s8(r){var e=r.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(r.step,"MIN[]",t,n),e.push(Math.min(n,t))}function o8(r){var e=r.stack.pop();exports.DEBUG&&console.log(r.step,"SCANTYPE[]",e)}function l8(r){var e=r.stack.pop(),t=r.stack.pop();switch(exports.DEBUG&&console.log(r.step,"INSTCTRL[]",e,t),e){case 1:r.inhibitGridFit=!!t;return;case 2:r.ignoreCvt=!!t;return;default:throw new Error("invalid INSTCTRL[] selector")}}function Ks(r,e){var t=e.stack,n=e.prog,i=e.ip;exports.DEBUG&&console.log(e.step,"PUSHB["+r+"]");for(var a=0;a<r;a++)t.push(n[++i]);e.ip=i}function Zs(r,e){var t=e.ip,n=e.prog,i=e.stack;exports.DEBUG&&console.log(e.ip,"PUSHW["+r+"]");for(var a=0;a<r;a++){var s=n[++t]<<8|n[++t];s&32768&&(s=-((s^65535)+1)),i.push(s)}e.ip=t}function gt(r,e,t,n,i,a){var s=a.stack,o=r&&s.pop(),l=s.pop(),u=a.rp0,c=a.z0[u],f=a.z1[l],d=a.minDis,h=a.fv,g=a.dpv,v,y,A,C;y=v=g.distance(f,c,!0,!0),A=y>=0?1:-1,y=Math.abs(y),r&&(C=a.cvt[o],n&&Math.abs(y-C)<a.cvCutIn&&(y=C)),t&&y<d&&(y=d),n&&(y=a.round(y)),h.setRelative(f,c,A*y,g),h.touch(f),exports.DEBUG&&console.log(a.step,(r?"MIRP[":"MDRP[")+(e?"M":"m")+(t?">":"_")+(n?"R":"_")+(i===0?"Gr":i===1?"Bl":i===2?"Wh":"")+"]",r?o+"("+a.cvt[o]+","+C+")":"",l,"(d =",v,"->",A*y,")"),a.rp1=a.rp0,a.rp2=l,e&&(a.rp0=l)}wF=[wx.bind(void 0,Rs),wx.bind(void 0,rs),Cx.bind(void 0,Rs),Cx.bind(void 0,rs),xx.bind(void 0,Rs),xx.bind(void 0,rs),Sx.bind(void 0,0),Sx.bind(void 0,1),Ex.bind(void 0,0),Ex.bind(void 0,1),V6,z6,$6,H6,j6,G6,q6,W6,Q6,Y6,X6,J6,K6,Z6,eN,tN,rN,nN,iN,aN,void 0,void 0,sN,D0,oN,lN,uN,fN,hN,void 0,void 0,void 0,cN,dN,pN,void 0,kx.bind(void 0,0),kx.bind(void 0,1),Tx.bind(void 0,Rs),Tx.bind(void 0,rs),Fx.bind(void 0,0),Fx.bind(void 0,1),Ix.bind(void 0,0),Ix.bind(void 0,1),Px.bind(void 0,0),Px.bind(void 0,1),gN,mN,Dx.bind(void 0,0),Dx.bind(void 0,1),vN,yN,Rx.bind(void 0,0),Rx.bind(void 0,1),AN,bN,wN,CN,xN,SN,Ox.bind(void 0,0),Ox.bind(void 0,1),void 0,Bx.bind(void 0,0),Bx.bind(void 0,1),EN,void 0,kN,void 0,void 0,TN,FN,IN,PN,DN,RN,ON,BN,MN,_N,NN,LN,UN,R0.bind(void 0,1),VN,zN,$N,HN,jN,GN,qN,WN,QN,YN,Kh.bind(void 0,0),Kh.bind(void 0,1),Kh.bind(void 0,2),Kh.bind(void 0,3),void 0,void 0,void 0,void 0,XN,R0.bind(void 0,2),R0.bind(void 0,3),O0.bind(void 0,1),O0.bind(void 0,2),O0.bind(void 0,3),JN,KN,void 0,void 0,ZN,void 0,e8,t8,D0,D0,void 0,void 0,void 0,void 0,void 0,r8,Mx.bind(void 0,0),Mx.bind(void 0,1),n8,void 0,i8,a8,s8,o8,l8,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Ks.bind(void 0,1),Ks.bind(void 0,2),Ks.bind(void 0,3),Ks.bind(void 0,4),Ks.bind(void 0,5),Ks.bind(void 0,6),Ks.bind(void 0,7),Ks.bind(void 0,8),Zs.bind(void 0,1),Zs.bind(void 0,2),Zs.bind(void 0,3),Zs.bind(void 0,4),Zs.bind(void 0,5),Zs.bind(void 0,6),Zs.bind(void 0,7),Zs.bind(void 0,8),gt.bind(void 0,0,0,0,0,0),gt.bind(void 0,0,0,0,0,1),gt.bind(void 0,0,0,0,0,2),gt.bind(void 0,0,0,0,0,3),gt.bind(void 0,0,0,0,1,0),gt.bind(void 0,0,0,0,1,1),gt.bind(void 0,0,0,0,1,2),gt.bind(void 0,0,0,0,1,3),gt.bind(void 0,0,0,1,0,0),gt.bind(void 0,0,0,1,0,1),gt.bind(void 0,0,0,1,0,2),gt.bind(void 0,0,0,1,0,3),gt.bind(void 0,0,0,1,1,0),gt.bind(void 0,0,0,1,1,1),gt.bind(void 0,0,0,1,1,2),gt.bind(void 0,0,0,1,1,3),gt.bind(void 0,0,1,0,0,0),gt.bind(void 0,0,1,0,0,1),gt.bind(void 0,0,1,0,0,2),gt.bind(void 0,0,1,0,0,3),gt.bind(void 0,0,1,0,1,0),gt.bind(void 0,0,1,0,1,1),gt.bind(void 0,0,1,0,1,2),gt.bind(void 0,0,1,0,1,3),gt.bind(void 0,0,1,1,0,0),gt.bind(void 0,0,1,1,0,1),gt.bind(void 0,0,1,1,0,2),gt.bind(void 0,0,1,1,0,3),gt.bind(void 0,0,1,1,1,0),gt.bind(void 0,0,1,1,1,1),gt.bind(void 0,0,1,1,1,2),gt.bind(void 0,0,1,1,1,3),gt.bind(void 0,1,0,0,0,0),gt.bind(void 0,1,0,0,0,1),gt.bind(void 0,1,0,0,0,2),gt.bind(void 0,1,0,0,0,3),gt.bind(void 0,1,0,0,1,0),gt.bind(void 0,1,0,0,1,1),gt.bind(void 0,1,0,0,1,2),gt.bind(void 0,1,0,0,1,3),gt.bind(void 0,1,0,1,0,0),gt.bind(void 0,1,0,1,0,1),gt.bind(void 0,1,0,1,0,2),gt.bind(void 0,1,0,1,0,3),gt.bind(void 0,1,0,1,1,0),gt.bind(void 0,1,0,1,1,1),gt.bind(void 0,1,0,1,1,2),gt.bind(void 0,1,0,1,1,3),gt.bind(void 0,1,1,0,0,0),gt.bind(void 0,1,1,0,0,1),gt.bind(void 0,1,1,0,0,2),gt.bind(void 0,1,1,0,0,3),gt.bind(void 0,1,1,0,1,0),gt.bind(void 0,1,1,0,1,1),gt.bind(void 0,1,1,0,1,2),gt.bind(void 0,1,1,0,1,3),gt.bind(void 0,1,1,1,0,0),gt.bind(void 0,1,1,1,0,1),gt.bind(void 0,1,1,1,0,2),gt.bind(void 0,1,1,1,0,3),gt.bind(void 0,1,1,1,1,0),gt.bind(void 0,1,1,1,1,1),gt.bind(void 0,1,1,1,1,2),gt.bind(void 0,1,1,1,1,3)];function mc(r){this.char=r,this.state={},this.activeState=null}function m1(r,e,t){this.contextName=t,this.startIndex=r,this.endOffset=e}function u8(r,e,t){this.contextName=r,this.openRange=null,this.ranges=[],this.checkStart=e,this.checkEnd=t}function Ra(r,e){this.context=r,this.index=e,this.length=r.length,this.current=r[e],this.backtrack=r.slice(0,e),this.lookahead=r.slice(e+1)}function Wg(r){this.eventId=r,this.subscribers=[]}function c8(r){var e=this,t=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];t.forEach(function(i){Object.defineProperty(e.events,i,{value:new Wg(i)})}),r&&t.forEach(function(i){var a=r[i];typeof a=="function"&&e.events[i].subscribe(a)});var n=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];n.forEach(function(i){e.events[i].subscribe(e.updateContextsRanges)})}function jn(r){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],c8.call(this,r)}mc.prototype.setState=function(r,e){return this.state[r]=e,this.activeState={key:r,value:this.state[r]},this.activeState};mc.prototype.getState=function(r){return this.state[r]||null};jn.prototype.inboundIndex=function(r){return r>=0&&r<this.tokens.length};jn.prototype.composeRUD=function(r){var e=this,t=!0,n=r.map(function(a){return e[a[0]].apply(e,a.slice(1).concat(t))}),i=function(a){return typeof a=="object"&&a.hasOwnProperty("FAIL")};if(n.every(i))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:n.filter(i)};this.dispatch("composeRUD",[n.filter(function(a){return!i(a)})])};jn.prototype.replaceRange=function(r,e,t,n){e=e!==null?e:this.tokens.length;var i=t.every(function(s){return s instanceof mc});if(!isNaN(r)&&this.inboundIndex(r)&&i){var a=this.tokens.splice.apply(this.tokens,[r,e].concat(t));return n||this.dispatch("replaceToken",[r,e,t]),[a,t]}else return{FAIL:"replaceRange: invalid tokens or startIndex."}};jn.prototype.replaceToken=function(r,e,t){if(!isNaN(r)&&this.inboundIndex(r)&&e instanceof mc){var n=this.tokens.splice(r,1,e);return t||this.dispatch("replaceToken",[r,e]),[n[0],e]}else return{FAIL:"replaceToken: invalid token or index."}};jn.prototype.removeRange=function(r,e,t){e=isNaN(e)?this.tokens.length:e;var n=this.tokens.splice(r,e);return t||this.dispatch("removeRange",[n,r,e]),n};jn.prototype.removeToken=function(r,e){if(!isNaN(r)&&this.inboundIndex(r)){var t=this.tokens.splice(r,1);return e||this.dispatch("removeToken",[t,r]),t}else return{FAIL:"removeToken: invalid token index."}};jn.prototype.insertToken=function(r,e,t){var n=r.every(function(i){return i instanceof mc});return n?(this.tokens.splice.apply(this.tokens,[e,0].concat(r)),t||this.dispatch("insertToken",[r,e]),r):{FAIL:"insertToken: invalid token(s)."}};jn.prototype.registerModifier=function(r,e,t){this.events.newToken.subscribe(function(n,i){var a=[n,i],s=e===null||e.apply(this,a)===!0,o=[n,i];if(s){var l=t.apply(this,o);n.setState(r,l)}}),this.registeredModifiers.push(r)};Wg.prototype.subscribe=function(r){return typeof r=="function"?this.subscribers.push(r)-1:{FAIL:"invalid '"+this.eventId+"' event handler"}};Wg.prototype.unsubscribe=function(r){this.subscribers.splice(r,1)};Ra.prototype.setCurrentIndex=function(r){this.index=r,this.current=this.context[r],this.backtrack=this.context.slice(0,r),this.lookahead=this.context.slice(r+1)};Ra.prototype.get=function(r){switch(!0){case r===0:return this.current;case(r<0&&Math.abs(r)<=this.backtrack.length):return this.backtrack.slice(r)[0];case(r>0&&r<=this.lookahead.length):return this.lookahead[r-1];default:return null}};jn.prototype.rangeToText=function(r){if(r instanceof m1)return this.getRangeTokens(r).map(function(e){return e.char}).join("")};jn.prototype.getText=function(){return this.tokens.map(function(r){return r.char}).join("")};jn.prototype.getContext=function(r){var e=this.registeredContexts[r];return e||null};jn.prototype.on=function(r,e){var t=this.events[r];return t?t.subscribe(e):null};jn.prototype.dispatch=function(r,e){var t=this,n=this.events[r];n instanceof Wg&&n.subscribers.forEach(function(i){i.apply(t,e||[])})};jn.prototype.registerContextChecker=function(r,e,t){if(this.getContext(r))return{FAIL:"context name '"+r+"' is already registered."};if(typeof e!="function")return{FAIL:"missing context start check."};if(typeof t!="function")return{FAIL:"missing context end check."};var n=new u8(r,e,t);return this.registeredContexts[r]=n,this.contextCheckers.push(n),n};jn.prototype.getRangeTokens=function(r){var e=r.startIndex+r.endOffset;return[].concat(this.tokens.slice(r.startIndex,e))};jn.prototype.getContextRanges=function(r){var e=this.getContext(r);return e?e.ranges:{FAIL:"context checker '"+r+"' is not registered."}};jn.prototype.resetContextsRanges=function(){var r=this.registeredContexts;for(var e in r)if(r.hasOwnProperty(e)){var t=r[e];t.ranges=[]}};jn.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var r=this.tokens.map(function(n){return n.char}),e=0;e<r.length;e++){var t=new Ra(r,e);this.runContextCheck(t)}this.dispatch("updateContextsRanges",[this.registeredContexts])};jn.prototype.setEndOffset=function(r,e){var t=this.getContext(e).openRange.startIndex,n=new m1(t,r,e),i=this.getContext(e).ranges;return n.rangeId=e+"."+i.length,i.push(n),this.getContext(e).openRange=null,n};jn.prototype.runContextCheck=function(r){var e=this,t=r.index;this.contextCheckers.forEach(function(n){var i=n.contextName,a=e.getContext(i).openRange;if(!a&&n.checkStart(r)&&(a=new m1(t,null,i),e.getContext(i).openRange=a,e.dispatch("contextStart",[i,t])),a&&n.checkEnd(r)){var s=t-a.startIndex+1,o=e.setEndOffset(s,i);e.dispatch("contextEnd",[i,o])}})};jn.prototype.tokenize=function(r){this.tokens=[],this.resetContextsRanges();var e=Array.from(r);this.dispatch("start");for(var t=0;t<e.length;t++){var n=e[t],i=new Ra(e,t);this.dispatch("next",[i]),this.runContextCheck(i);var a=new mc(n);this.tokens.push(a),this.dispatch("newToken",[a,i])}return this.dispatch("end",[this.tokens]),this.tokens};function vo(r){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(r)}function TF(r){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(r)}function Fo(r){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(r)}function Gp(r){return/[A-z]/.test(r)}function d8(r){return/\s/.test(r)}function aa(r){this.font=r,this.features={}}function vl(r){this.id=r.id,this.tag=r.tag,this.substitution=r.substitution}function Wf(r,e){if(!r)return-1;switch(e.format){case 1:return e.glyphs.indexOf(r);case 2:for(var t=e.ranges,n=0;n<t.length;n++){var i=t[n];if(r>=i.start&&r<=i.end){var a=r-i.start;return i.index+a}}break;default:return-1}return-1}function f8(r,e){var t=Wf(r,e.coverage);return t===-1?null:r+e.deltaGlyphId}function h8(r,e){var t=Wf(r,e.coverage);return t===-1?null:e.substitute[t]}function B0(r,e){for(var t=[],n=0;n<r.length;n++){var i=r[n],a=e.current;a=Array.isArray(a)?a[0]:a;var s=Wf(a,i);s!==-1&&t.push(s)}return t.length!==r.length?-1:t}function p8(r,e){var t=e.inputCoverage.length+e.lookaheadCoverage.length+e.backtrackCoverage.length;if(r.context.length<t)return[];var n=B0(e.inputCoverage,r);if(n===-1)return[];var i=e.inputCoverage.length-1;if(r.lookahead.length<e.lookaheadCoverage.length)return[];for(var a=r.lookahead.slice(i);a.length&&Fo(a[0].char);)a.shift();var s=new Ra(a,0),o=B0(e.lookaheadCoverage,s),l=[].concat(r.backtrack);for(l.reverse();l.length&&Fo(l[0].char);)l.shift();if(l.length<e.backtrackCoverage.length)return[];var u=new Ra(l,0),c=B0(e.backtrackCoverage,u),f=n.length===e.inputCoverage.length&&o.length===e.lookaheadCoverage.length&&c.length===e.backtrackCoverage.length,d=[];if(f)for(var h=0;h<e.lookupRecords.length;h++)for(var g=e.lookupRecords[h],v=g.lookupListIndex,y=this.getLookupByIndex(v),A=0;A<y.subtables.length;A++){var C=y.subtables[A],S=this.getLookupMethod(y,C),F=this.getSubstitutionType(y,C);if(F==="12")for(var E=0;E<n.length;E++){var R=r.get(E),B=S(R);B&&d.push(B)}}return d}function g8(r,e){var t=r.current,n=Wf(t,e.coverage);if(n===-1)return null;for(var i,a=e.ligatureSets[n],s=0;s<a.length;s++){i=a[s];for(var o=0;o<i.components.length;o++){var l=r.lookahead[o],u=i.components[o];if(l!==u)break;if(o===i.components.length-1)return i}}return null}function m8(r,e){var t=Wf(r,e.coverage);return t===-1?null:e.sequences[t]}aa.prototype.getDefaultScriptFeaturesIndexes=function(){for(var r=this.font.tables.gsub.scripts,e=0;e<r.length;e++){var t=r[e];if(t.tag==="DFLT")return t.script.defaultLangSys.featureIndexes}return[]};aa.prototype.getScriptFeaturesIndexes=function(r){var e=this.font.tables;if(!e.gsub)return[];if(!r)return this.getDefaultScriptFeaturesIndexes();for(var t=this.font.tables.gsub.scripts,n=0;n<t.length;n++){var i=t[n];if(i.tag===r&&i.script.defaultLangSys)return i.script.defaultLangSys.featureIndexes;var a=i.langSysRecords;if(a)for(var s=0;s<a.length;s++){var o=a[s];if(o.tag===r){var l=o.langSys;return l.featureIndexes}}}return this.getDefaultScriptFeaturesIndexes()};aa.prototype.mapTagsToFeatures=function(r,e){for(var t={},n=0;n<r.length;n++){var i=r[n].tag,a=r[n].feature;t[i]=a}this.features[e].tags=t};aa.prototype.getScriptFeatures=function(r){var e=this.features[r];if(this.features.hasOwnProperty(r))return e;var t=this.getScriptFeaturesIndexes(r);if(!t)return null;var n=this.font.tables.gsub;return e=t.map(function(i){return n.features[i]}),this.features[r]=e,this.mapTagsToFeatures(e,r),e};aa.prototype.getSubstitutionType=function(r,e){var t=r.lookupType.toString(),n=e.substFormat.toString();return t+n};aa.prototype.getLookupMethod=function(r,e){var t=this,n=this.getSubstitutionType(r,e);switch(n){case"11":return function(i){return f8.apply(t,[i,e])};case"12":return function(i){return h8.apply(t,[i,e])};case"63":return function(i){return p8.apply(t,[i,e])};case"41":return function(i){return g8.apply(t,[i,e])};case"21":return function(i){return m8.apply(t,[i,e])};default:throw new Error("lookupType: "+r.lookupType+" - substFormat: "+e.substFormat+" is not yet supported")}};aa.prototype.lookupFeature=function(r){var e=r.contextParams,t=e.index,n=this.getFeature({tag:r.tag,script:r.script});if(!n)return new Error("font '"+this.font.names.fullName.en+"' doesn't support feature '"+r.tag+"' for script '"+r.script+"'.");for(var i=this.getFeatureLookups(n),a=[].concat(e.context),s=0;s<i.length;s++)for(var o=i[s],l=this.getLookupSubtables(o),u=0;u<l.length;u++){var c=l[u],f=this.getSubstitutionType(o,c),d=this.getLookupMethod(o,c),h=void 0;switch(f){case"11":h=d(e.current),h&&a.splice(t,1,new vl({id:11,tag:r.tag,substitution:h}));break;case"12":h=d(e.current),h&&a.splice(t,1,new vl({id:12,tag:r.tag,substitution:h}));break;case"63":h=d(e),Array.isArray(h)&&h.length&&a.splice(t,1,new vl({id:63,tag:r.tag,substitution:h}));break;case"41":h=d(e),h&&a.splice(t,1,new vl({id:41,tag:r.tag,substitution:h}));break;case"21":h=d(e.current),h&&a.splice(t,1,new vl({id:21,tag:r.tag,substitution:h}));break}e=new Ra(a,t),!(Array.isArray(h)&&!h.length)&&(h=null)}return a.length?a:null};aa.prototype.supports=function(r){if(!r.script)return!1;this.getScriptFeatures(r.script);var e=this.features.hasOwnProperty(r.script);if(!r.tag)return e;var t=this.features[r.script].some(function(n){return n.tag===r.tag});return e&&t};aa.prototype.getLookupSubtables=function(r){return r.subtables||null};aa.prototype.getLookupByIndex=function(r){var e=this.font.tables.gsub.lookups;return e[r]||null};aa.prototype.getFeatureLookups=function(r){return r.lookupListIndexes.map(this.getLookupByIndex.bind(this))};aa.prototype.getFeature=function(e){if(!this.font)return{FAIL:"No font was found"};this.features.hasOwnProperty(e.script)||this.getScriptFeatures(e.script);var t=this.features[e.script];return t?t.tags[e.tag]?this.features[e.script].tags[e.tag]:null:{FAIL:"No feature for script "+e.script}};function v8(r){var e=r.current,t=r.get(-1);return t===null&&vo(e)||!vo(t)&&vo(e)}function y8(r){var e=r.get(1);return e===null||!vo(e)}var A8={startCheck:v8,endCheck:y8};function b8(r){var e=r.current,t=r.get(-1);return(vo(e)||Fo(e))&&!vo(t)}function w8(r){var e=r.get(1);switch(!0){case e===null:return!0;case(!vo(e)&&!Fo(e)):var t=d8(e);if(!t)return!0;if(t){var n=!1;if(n=r.lookahead.some(function(i){return vo(i)||Fo(i)}),!n)return!0}break;default:return!1}}var C8={startCheck:b8,endCheck:w8};function x8(r,e,t){e[t].setState(r.tag,r.substitution)}function S8(r,e,t){e[t].setState(r.tag,r.substitution)}function E8(r,e,t){r.substitution.forEach(function(n,i){var a=e[t+i];a.setState(r.tag,n)})}function k8(r,e,t){var n=e[t];n.setState(r.tag,r.substitution.ligGlyph);for(var i=r.substitution.components.length,a=0;a<i;a++)n=e[t+a+1],n.setState("deleted",!0)}var _x={11:x8,12:S8,63:E8,41:k8};function v1(r,e,t){r instanceof vl&&_x[r.id]&&_x[r.id](r,e,t)}function T8(r){for(var e=[].concat(r.backtrack),t=e.length-1;t>=0;t--){var n=e[t],i=TF(n),a=Fo(n);if(!i&&!a)return!0;if(i)return!1}return!1}function F8(r){if(TF(r.current))return!1;for(var e=0;e<r.lookahead.length;e++){var t=r.lookahead[e],n=Fo(t);if(!n)return!0}return!1}function I8(r){var e=this,t="arab",n=this.featuresTags[t],i=this.tokenizer.getRangeTokens(r);if(i.length!==1){var a=new Ra(i.map(function(o){return o.getState("glyphIndex")}),0),s=new Ra(i.map(function(o){return o.char}),0);i.forEach(function(o,l){if(!Fo(o.char)){a.setCurrentIndex(l),s.setCurrentIndex(l);var u=0;T8(s)&&(u|=1),F8(s)&&(u|=2);var c;switch(u){case 1:c="fina";break;case 2:c="init";break;case 3:c="medi";break}if(n.indexOf(c)!==-1){var f=e.query.lookupFeature({tag:c,script:t,contextParams:a});if(f instanceof Error)return console.info(f.message);f.forEach(function(d,h){d instanceof vl&&(v1(d,i,h),a.context[h]=d.substitution)})}}})}}function Nx(r,e){var t=r.map(function(n){return n.activeState.value});return new Ra(t,0)}function P8(r){var e=this,t="arab",n=this.tokenizer.getRangeTokens(r),i=Nx(n);i.context.forEach(function(a,s){i.setCurrentIndex(s);var o=e.query.lookupFeature({tag:"rlig",script:t,contextParams:i});o.length&&(o.forEach(function(l){return v1(l,n,s)}),i=Nx(n))})}function D8(r){var e=r.current,t=r.get(-1);return t===null&&Gp(e)||!Gp(t)&&Gp(e)}function R8(r){var e=r.get(1);return e===null||!Gp(e)}var O8={startCheck:D8,endCheck:R8};function Lx(r,e){var t=r.map(function(n){return n.activeState.value});return new Ra(t,0)}function B8(r){var e=this,t="latn",n=this.tokenizer.getRangeTokens(r),i=Lx(n);i.context.forEach(function(a,s){i.setCurrentIndex(s);var o=e.query.lookupFeature({tag:"liga",script:t,contextParams:i});o.length&&(o.forEach(function(l){return v1(l,n,s)}),i=Lx(n))})}function La(r){this.baseDir=r||"ltr",this.tokenizer=new jn,this.featuresTags={}}La.prototype.setText=function(r){this.text=r};La.prototype.contextChecks={latinWordCheck:O8,arabicWordCheck:A8,arabicSentenceCheck:C8};function M0(r){var e=this.contextChecks[r+"Check"];return this.tokenizer.registerContextChecker(r,e.startCheck,e.endCheck)}function M8(){return M0.call(this,"latinWord"),M0.call(this,"arabicWord"),M0.call(this,"arabicSentence"),this.tokenizer.tokenize(this.text)}function _8(){var r=this,e=this.tokenizer.getContextRanges("arabicSentence");e.forEach(function(t){var n=r.tokenizer.getRangeTokens(t);r.tokenizer.replaceRange(t.startIndex,t.endOffset,n.reverse())})}La.prototype.registerFeatures=function(r,e){var t=this,n=e.filter(function(i){return t.query.supports({script:r,tag:i})});this.featuresTags.hasOwnProperty(r)?this.featuresTags[r]=this.featuresTags[r].concat(n):this.featuresTags[r]=n};La.prototype.applyFeatures=function(r,e){if(!r)throw new Error("No valid font was provided to apply features");this.query||(this.query=new aa(r));for(var t=0;t<e.length;t++){var n=e[t];this.query.supports({script:n.script})&&this.registerFeatures(n.script,n.tags)}};La.prototype.registerModifier=function(r,e,t){this.tokenizer.registerModifier(r,e,t)};function y1(){if(this.tokenizer.registeredModifiers.indexOf("glyphIndex")===-1)throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function N8(){var r=this,e="arab";if(this.featuresTags.hasOwnProperty(e)){y1.call(this);var t=this.tokenizer.getContextRanges("arabicWord");t.forEach(function(n){I8.call(r,n)})}}function L8(){var r=this,e="arab";if(this.featuresTags.hasOwnProperty(e)){var t=this.featuresTags[e];if(t.indexOf("rlig")!==-1){y1.call(this);var n=this.tokenizer.getContextRanges("arabicWord");n.forEach(function(i){P8.call(r,i)})}}}function U8(){var r=this,e="latn";if(this.featuresTags.hasOwnProperty(e)){var t=this.featuresTags[e];if(t.indexOf("liga")!==-1){y1.call(this);var n=this.tokenizer.getContextRanges("latinWord");n.forEach(function(i){B8.call(r,i)})}}}La.prototype.checkContextReady=function(r){return!!this.tokenizer.getContext(r)};La.prototype.applyFeaturesToContexts=function(){this.checkContextReady("arabicWord")&&(N8.call(this),L8.call(this)),this.checkContextReady("latinWord")&&U8.call(this),this.checkContextReady("arabicSentence")&&_8.call(this)};La.prototype.processText=function(r){(!this.text||this.text!==r)&&(this.setText(r),M8.call(this),this.applyFeaturesToContexts())};La.prototype.getBidiText=function(r){return this.processText(r),this.tokenizer.getText()};La.prototype.getTextGlyphs=function(r){this.processText(r);for(var e=[],t=0;t<this.tokenizer.tokens.length;t++){var n=this.tokenizer.tokens[t];if(!n.state.deleted){var i=n.activeState.value;e.push(Array.isArray(i)?i[0]:i)}}return e};function hn(r){r=r||{},r.tables=r.tables||{},r.empty||(pd(r.familyName,"When creating a new Font object, familyName is required."),pd(r.styleName,"When creating a new Font object, styleName is required."),pd(r.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),pd(r.ascender,"When creating a new Font object, ascender is required."),pd(r.descender<=0,"When creating a new Font object, negative descender value is required."),this.names={fontFamily:{en:r.familyName||" "},fontSubfamily:{en:r.styleName||" "},fullName:{en:r.fullName||r.familyName+" "+r.styleName},postScriptName:{en:r.postScriptName||(r.familyName+r.styleName).replace(/\s/g,"")},designer:{en:r.designer||" "},designerURL:{en:r.designerURL||" "},manufacturer:{en:r.manufacturer||" "},manufacturerURL:{en:r.manufacturerURL||" "},license:{en:r.license||" "},licenseURL:{en:r.licenseURL||" "},version:{en:r.version||"Version 0.1"},description:{en:r.description||" "},copyright:{en:r.copyright||" "},trademark:{en:r.trademark||" "}},this.unitsPerEm=r.unitsPerEm||1e3,this.ascender=r.ascender,this.descender=r.descender,this.createdTimestamp=r.createdTimestamp,this.tables=Object.assign(r.tables,{os2:Object.assign({usWeightClass:r.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:r.widthClass||this.usWidthClasses.MEDIUM,fsSelection:r.fsSelection||this.fsSelectionValues.REGULAR},r.tables.os2)})),this.supported=!0,this.glyphs=new os.GlyphSet(this,r.glyphs||[]),this.encoding=new qT(this),this.position=new jf(this),this.substitution=new ia(this),this.tables=this.tables||{},this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){if(this._hinting)return this._hinting;if(this.outlinesFormat==="truetype")return this._hinting=new xF(this)}})}hn.prototype.hasChar=function(r){return this.encoding.charToGlyphIndex(r)!==null};hn.prototype.charToGlyphIndex=function(r){return this.encoding.charToGlyphIndex(r)};hn.prototype.charToGlyph=function(r){var e=this.charToGlyphIndex(r),t=this.glyphs.get(e);return t||(t=this.glyphs.get(0)),t};hn.prototype.updateFeatures=function(r){return this.defaultRenderOptions.features.map(function(e){return e.script==="latn"?{script:"latn",tags:e.tags.filter(function(t){return r[t]})}:e})};hn.prototype.stringToGlyphs=function(r,e){var t=this,n=new La,i=function(f){return t.charToGlyphIndex(f.char)};n.registerModifier("glyphIndex",null,i);var a=e?this.updateFeatures(e.features):this.defaultRenderOptions.features;n.applyFeatures(this,a);for(var s=n.getTextGlyphs(r),o=s.length,l=new Array(o),u=this.glyphs.get(0),c=0;c<o;c+=1)l[c]=this.glyphs.get(s[c])||u;return l};hn.prototype.nameToGlyphIndex=function(r){return this.glyphNames.nameToGlyphIndex(r)};hn.prototype.nameToGlyph=function(r){var e=this.nameToGlyphIndex(r),t=this.glyphs.get(e);return t||(t=this.glyphs.get(0)),t};hn.prototype.glyphIndexToName=function(r){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(r):""};hn.prototype.getKerningValue=function(r,e){r=r.index||r,e=e.index||e;var t=this.position.defaultKerningTables;return t?this.position.getKerningValue(t,r,e):this.kerningPairs[r+","+e]||0};hn.prototype.defaultRenderOptions={kerning:!0,features:[{script:"arab",tags:["init","medi","fina","rlig"]},{script:"latn",tags:["liga","rlig"]}]};hn.prototype.forEachGlyph=function(r,e,t,n,i,a){e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:72,i=Object.assign({},this.defaultRenderOptions,i);var s=1/this.unitsPerEm*n,o=this.stringToGlyphs(r,i),l;if(i.kerning){var u=i.script||this.position.getDefaultScriptName();l=this.position.getKerningTables(u,i.language)}for(var c=0;c<o.length;c+=1){var f=o[c];if(a.call(this,f,e,t,n,i),f.advanceWidth&&(e+=f.advanceWidth*s),i.kerning&&c<o.length-1){var d=l?this.position.getKerningValue(l,f.index,o[c+1].index):this.getKerningValue(f,o[c+1]);e+=d*s}i.letterSpacing?e+=i.letterSpacing*n:i.tracking&&(e+=i.tracking/1e3*n)}return e};hn.prototype.getPath=function(r,e,t,n,i){var a=new fi;return this.forEachGlyph(r,e,t,n,i,function(s,o,l,u){var c=s.getPath(o,l,u,i,this);a.extend(c)}),a};hn.prototype.getPaths=function(r,e,t,n,i){var a=[];return this.forEachGlyph(r,e,t,n,i,function(s,o,l,u){var c=s.getPath(o,l,u,i,this);a.push(c)}),a};hn.prototype.getAdvanceWidth=function(r,e,t){return this.forEachGlyph(r,0,0,e,t,function(){})};hn.prototype.draw=function(r,e,t,n,i,a){this.getPath(e,t,n,i,a).draw(r)};hn.prototype.drawPoints=function(r,e,t,n,i,a){this.forEachGlyph(e,t,n,i,a,function(s,o,l,u){s.drawPoints(r,o,l,u)})};hn.prototype.drawMetrics=function(r,e,t,n,i,a){this.forEachGlyph(e,t,n,i,a,function(s,o,l,u){s.drawMetrics(r,o,l,u)})};hn.prototype.getEnglishName=function(r){var e=this.names[r];if(e)return e.en};hn.prototype.validate=function(){var r=this;function e(n,i){}function t(n){var i=r.getEnglishName(n);i&&i.trim().length>0}t("fontFamily"),t("weightName"),t("manufacturer"),t("copyright"),t("version"),this.unitsPerEm>0};hn.prototype.toTables=function(){return k6.fontToTable(this)};hn.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()};hn.prototype.toArrayBuffer=function(){for(var r=this.toTables(),e=r.encode(),t=new ArrayBuffer(e.length),n=new Uint8Array(t),i=0;i<e.length;i++)n[i]=e[i];return t};hn.prototype.download=function(r){var e=this.getEnglishName("fontFamily"),t=this.getEnglishName("fontSubfamily");r=r||e.replace(/\s/g,"")+"-"+t+".otf";var n=this.toArrayBuffer();if(F6())if(window.URL=window.URL||window.webkitURL,window.URL){var i=new DataView(n),a=new Blob([i],{type:"font/opentype"}),s=document.createElement("a");s.href=window.URL.createObjectURL(a),s.download=r;var o=document.createEvent("MouseEvents");o.initEvent("click",!0,!1),s.dispatchEvent(o)}else console.warn("Font file could not be downloaded. Try using a different browser.");else{var l=require("fs"),u=I6(n);l.writeFileSync(r,u)}};hn.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512};hn.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9};hn.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};function FF(r,e){var t=JSON.stringify(r),n=256;for(var i in e){var a=parseInt(i);if(!(!a||a<256)){if(JSON.stringify(e[i])===t)return a;n<=a&&(n=a+1)}}return e[n]=r,n}function V8(r,e,t){var n=FF(e.name,t);return[{name:"tag_"+r,type:"TAG",value:e.tag},{name:"minValue_"+r,type:"FIXED",value:e.minValue<<16},{name:"defaultValue_"+r,type:"FIXED",value:e.defaultValue<<16},{name:"maxValue_"+r,type:"FIXED",value:e.maxValue<<16},{name:"flags_"+r,type:"USHORT",value:0},{name:"nameID_"+r,type:"USHORT",value:n}]}function z8(r,e,t){var n={},i=new vt.Parser(r,e);return n.tag=i.parseTag(),n.minValue=i.parseFixed(),n.defaultValue=i.parseFixed(),n.maxValue=i.parseFixed(),i.skip("uShort",1),n.name=t[i.parseUShort()]||{},n}function $8(r,e,t,n){for(var i=FF(e.name,n),a=[{name:"nameID_"+r,type:"USHORT",value:i},{name:"flags_"+r,type:"USHORT",value:0}],s=0;s<t.length;++s){var o=t[s].tag;a.push({name:"axis_"+r+" "+o,type:"FIXED",value:e.coordinates[o]<<16})}return a}function H8(r,e,t,n){var i={},a=new vt.Parser(r,e);i.name=n[a.parseUShort()]||{},a.skip("uShort",1),i.coordinates={};for(var s=0;s<t.length;++s)i.coordinates[t[s].tag]=a.parseFixed();return i}function j8(r,e){var t=new dt.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:r.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:r.instances.length},{name:"instanceSize",type:"USHORT",value:4+r.axes.length*4}]);t.offsetToData=t.sizeOf();for(var n=0;n<r.axes.length;n++)t.fields=t.fields.concat(V8(n,r.axes[n],e));for(var i=0;i<r.instances.length;i++)t.fields=t.fields.concat($8(i,r.instances[i],r.axes,e));return t}function G8(r,e,t){var n=new vt.Parser(r,e),i=n.parseULong();jt.argument(i===65536,"Unsupported fvar table version.");var a=n.parseOffset16();n.skip("uShort",1);for(var s=n.parseUShort(),o=n.parseUShort(),l=n.parseUShort(),u=n.parseUShort(),c=[],f=0;f<s;f++)c.push(z8(r,e+a+f*o,t));for(var d=[],h=e+a+s*o,g=0;g<l;g++)d.push(H8(r,h+g*u,c,t));return{axes:c,instances:d}}var q8={make:j8,parse:G8},W8=function(){return{coverage:this.parsePointer(we.coverage),attachPoints:this.parseList(we.pointer(we.uShortList))}},Q8=function(){var r=this.parseUShort();if(jt.argument(r===1||r===2||r===3,"Unsupported CaretValue table version."),r===1)return{coordinate:this.parseShort()};if(r===2)return{pointindex:this.parseShort()};if(r===3)return{coordinate:this.parseShort()}},Y8=function(){return this.parseList(we.pointer(Q8))},X8=function(){return{coverage:this.parsePointer(we.coverage),ligGlyphs:this.parseList(we.pointer(Y8))}},J8=function(){return this.parseUShort(),this.parseList(we.pointer(we.coverage))};function K8(r,e){e=e||0;var t=new we(r,e),n=t.parseVersion(1);jt.argument(n===1||n===1.2||n===1.3,"Unsupported GDEF table version.");var i={version:n,classDef:t.parsePointer(we.classDef),attachList:t.parsePointer(W8),ligCaretList:t.parsePointer(X8),markAttachClassDef:t.parsePointer(we.classDef)};return n>=1.2&&(i.markGlyphSets=t.parsePointer(J8)),i}var Z8={parse:K8},Oa=new Array(10);Oa[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{posFormat:1,coverage:this.parsePointer(we.coverage),value:this.parseValueRecord()};if(t===2)return{posFormat:2,coverage:this.parsePointer(we.coverage),values:this.parseValueRecordList()};jt.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")};Oa[2]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();jt.assert(t===1||t===2,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var n=this.parsePointer(we.coverage),i=this.parseUShort(),a=this.parseUShort();if(t===1)return{posFormat:t,coverage:n,valueFormat1:i,valueFormat2:a,pairSets:this.parseList(we.pointer(we.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(i),value2:this.parseValueRecord(a)}})))};if(t===2){var s=this.parsePointer(we.classDef),o=this.parsePointer(we.classDef),l=this.parseUShort(),u=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:i,valueFormat2:a,classDef1:s,classDef2:o,class1Count:l,class2Count:u,classRecords:this.parseList(l,we.list(u,function(){return{value1:this.parseValueRecord(i),value2:this.parseValueRecord(a)}}))}}};Oa[3]=function(){return{error:"GPOS Lookup 3 not supported"}};Oa[4]=function(){return{error:"GPOS Lookup 4 not supported"}};Oa[5]=function(){return{error:"GPOS Lookup 5 not supported"}};Oa[6]=function(){return{error:"GPOS Lookup 6 not supported"}};Oa[7]=function(){return{error:"GPOS Lookup 7 not supported"}};Oa[8]=function(){return{error:"GPOS Lookup 8 not supported"}};Oa[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function e7(r,e){e=e||0;var t=new we(r,e),n=t.parseVersion(1);return jt.argument(n===1||n===1.1,"Unsupported GPOS table version "+n),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(Oa)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(Oa),variations:t.parseFeatureVariationsList()}}var t7=new Array(10);function r7(r){return new dt.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new dt.ScriptList(r.scripts)},{name:"features",type:"TABLE",value:new dt.FeatureList(r.features)},{name:"lookups",type:"TABLE",value:new dt.LookupList(r.lookups,t7)}])}var n7={parse:e7,make:r7};function i7(r){var e={};r.skip("uShort");var t=r.parseUShort();jt.argument(t===0,"Unsupported kern sub-table version."),r.skip("uShort",2);var n=r.parseUShort();r.skip("uShort",3);for(var i=0;i<n;i+=1){var a=r.parseUShort(),s=r.parseUShort(),o=r.parseShort();e[a+","+s]=o}return e}function a7(r){var e={};r.skip("uShort");var t=r.parseULong();t>1&&console.warn("Only the first kern subtable is supported."),r.skip("uLong");var n=r.parseUShort(),i=n&255;if(r.skip("uShort"),i===0){var a=r.parseUShort();r.skip("uShort",3);for(var s=0;s<a;s+=1){var o=r.parseUShort(),l=r.parseUShort(),u=r.parseShort();e[o+","+l]=u}}return e}function s7(r,e){var t=new vt.Parser(r,e),n=t.parseUShort();if(n===0)return i7(t);if(n===1)return a7(t);throw new Error("Unsupported kern table version ("+n+").")}var o7={parse:s7};function l7(r,e,t,n){for(var i=new vt.Parser(r,e),a=n?i.parseUShort:i.parseULong,s=[],o=0;o<t+1;o+=1){var l=a.call(i);n&&(l*=2),s.push(l)}return s}var u7={parse:l7};function Ux(r,e){for(var t=[],n=12,i=0;i<e;i+=1){var a=vt.getTag(r,n),s=vt.getULong(r,n+4),o=vt.getULong(r,n+8),l=vt.getULong(r,n+12);t.push({tag:a,checksum:s,offset:o,length:l,compression:!1}),n+=16}return t}function c7(r,e){for(var t=[],n=44,i=0;i<e;i+=1){var a=vt.getTag(r,n),s=vt.getULong(r,n+4),o=vt.getULong(r,n+8),l=vt.getULong(r,n+12),u=void 0;o<l?u="WOFF":u=!1,t.push({tag:a,offset:s,compression:u,compressedLength:o,length:l}),n+=20}return t}function Qn(r,e){if(e.compression==="WOFF"){var t=new Uint8Array(r.buffer,e.offset+2,e.compressedLength-2),n=new Uint8Array(e.length);if(n5(t,n),n.byteLength!==e.length)throw new Error("Decompression error: "+e.tag+" decompressed length doesn't match recorded length");var i=new DataView(n.buffer,0);return{data:i,offset:0}}else return{data:r,offset:e.offset}}function rA(r,e){e=e??{};var t,n,i=new hn({empty:!0}),a=new DataView(r,0),s,o=[],l=vt.getTag(a,0);if(l==="\0\0\0"||l==="true"||l==="typ1")i.outlinesFormat="truetype",s=vt.getUShort(a,4),o=Ux(a,s);else if(l==="OTTO")i.outlinesFormat="cff",s=vt.getUShort(a,4),o=Ux(a,s);else if(l==="wOFF"){var u=vt.getTag(a,4);if(u==="\0\0\0")i.outlinesFormat="truetype";else if(u==="OTTO")i.outlinesFormat="cff";else throw new Error("Unsupported OpenType flavor "+l);s=vt.getUShort(a,12),o=c7(a,s)}else throw new Error("Unsupported OpenType signature "+l);for(var c,f,d,h,g,v,y,A,C,S,F,E,R=0;R<s;R+=1){var B=o[R],j=void 0;switch(B.tag){case"cmap":j=Qn(a,B),i.tables.cmap=GT.parse(j.data,j.offset),i.encoding=new WT(i.tables.cmap);break;case"cvt ":j=Qn(a,B),E=new vt.Parser(j.data,j.offset),i.tables.cvt=E.parseShortList(B.length/2);break;case"fvar":f=B;break;case"fpgm":j=Qn(a,B),E=new vt.Parser(j.data,j.offset),i.tables.fpgm=E.parseByteList(B.length);break;case"head":j=Qn(a,B),i.tables.head=nF.parse(j.data,j.offset),i.unitsPerEm=i.tables.head.unitsPerEm,t=i.tables.head.indexToLocFormat;break;case"hhea":j=Qn(a,B),i.tables.hhea=iF.parse(j.data,j.offset),i.ascender=i.tables.hhea.ascender,i.descender=i.tables.hhea.descender,i.numberOfHMetrics=i.tables.hhea.numberOfHMetrics;break;case"hmtx":y=B;break;case"ltag":j=Qn(a,B),n=sF.parse(j.data,j.offset);break;case"maxp":j=Qn(a,B),i.tables.maxp=oF.parse(j.data,j.offset),i.numGlyphs=i.tables.maxp.numGlyphs;break;case"name":S=B;break;case"OS/2":j=Qn(a,B),i.tables.os2=eA.parse(j.data,j.offset);break;case"post":j=Qn(a,B),i.tables.post=hF.parse(j.data,j.offset),i.glyphNames=new f1(i.tables.post);break;case"prep":j=Qn(a,B),E=new vt.Parser(j.data,j.offset),i.tables.prep=E.parseByteList(B.length);break;case"glyf":d=B;break;case"loca":C=B;break;case"CFF ":c=B;break;case"kern":A=B;break;case"GDEF":h=B;break;case"GPOS":g=B;break;case"GSUB":v=B;break;case"meta":F=B;break}}var G=Qn(a,S);if(i.tables.name=fF.parse(G.data,G.offset,n),i.names=i.tables.name,d&&C){var ie=t===0,q=Qn(a,C),Y=u7.parse(q.data,q.offset,i.numGlyphs,ie),J=Qn(a,d);i.glyphs=bF.parse(J.data,J.offset,Y,i,e)}else if(c){var ae=Qn(a,c);rF.parse(ae.data,ae.offset,i,e)}else throw new Error("Font doesn't contain TrueType or CFF outlines.");var oe=Qn(a,y);if(aF.parse(i,oe.data,oe.offset,i.numberOfHMetrics,i.numGlyphs,i.glyphs,e),S5(i,e),A){var he=Qn(a,A);i.kerningPairs=o7.parse(he.data,he.offset)}else i.kerningPairs={};if(h){var ye=Qn(a,h);i.tables.gdef=Z8.parse(ye.data,ye.offset)}if(g){var Ue=Qn(a,g);i.tables.gpos=n7.parse(Ue.data,Ue.offset),i.position.init()}if(v){var Re=Qn(a,v);i.tables.gsub=pF.parse(Re.data,Re.offset)}if(f){var Oe=Qn(a,f);i.tables.fvar=q8.parse(Oe.data,Oe.offset,i.names)}if(F){var ee=Qn(a,F);i.tables.meta=gF.parse(ee.data,ee.offset),i.metas=i.tables.meta}return i}var Mu=function(){return Mu=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Mu.apply(this,arguments)},d7="~",f7="~~";function A1(r,e){for(var t={},n={},i=r.split(f7),a=!1,s=0;i.length>s;s++){for(var o=i[s].split(d7),l=0;l<o.length;l+=2){var u=o[l],c=o[l+1],f="&"+u+";";t[f]=c,a&&(t["&"+u]=c),n[c]=f}a=!0}return e?{entities:Mu(Mu({},t),e.entities),characters:Mu(Mu({},n),e.characters)}:{entities:t,characters:n}}var _0={xml:/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html4:/∉|&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html5:/·|℗|⋇|⪧|⩺|⋗|⦕|⩼|⪆|⥸|⋗|⋛|⪌|≷|≳|⪦|⩹|⋖|⋋|⋉|⥶|⩻|⦖|◃|⊴|◂|∉|⋹̸|⋵̸|∉|⋷|⋶|∌|∌|⋾|⋽|∥|⊠|⨱|⨰|&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g},ic={};ic.xml=A1(`lt~<~gt~>~quot~"~apos~'~amp~&`);ic.html4=A1(`apos~'~OElig~Œ~oelig~œ~Scaron~Š~scaron~š~Yuml~Ÿ~circ~ˆ~tilde~˜~ensp~ ~emsp~ ~thinsp~ ~zwnj~~zwj~~lrm~~rlm~~ndash~–~mdash~—~lsquo~‘~rsquo~’~sbquo~‚~ldquo~“~rdquo~”~bdquo~„~dagger~†~Dagger~‡~permil~‰~lsaquo~‹~rsaquo~›~euro~€~fnof~ƒ~Alpha~Α~Beta~Β~Gamma~Γ~Delta~Δ~Epsilon~Ε~Zeta~Ζ~Eta~Η~Theta~Θ~Iota~Ι~Kappa~Κ~Lambda~Λ~Mu~Μ~Nu~Ν~Xi~Ξ~Omicron~Ο~Pi~Π~Rho~Ρ~Sigma~Σ~Tau~Τ~Upsilon~Υ~Phi~Φ~Chi~Χ~Psi~Ψ~Omega~Ω~alpha~α~beta~β~gamma~γ~delta~δ~epsilon~ε~zeta~ζ~eta~η~theta~θ~iota~ι~kappa~κ~lambda~λ~mu~μ~nu~ν~xi~ξ~omicron~ο~pi~π~rho~ρ~sigmaf~ς~sigma~σ~tau~τ~upsilon~υ~phi~φ~chi~χ~psi~ψ~omega~ω~thetasym~ϑ~upsih~ϒ~piv~ϖ~bull~•~hellip~…~prime~′~Prime~″~oline~‾~frasl~⁄~weierp~℘~image~ℑ~real~ℜ~trade~™~alefsym~ℵ~larr~←~uarr~↑~rarr~→~darr~↓~harr~↔~crarr~↵~lArr~⇐~uArr~⇑~rArr~⇒~dArr~⇓~hArr~⇔~forall~∀~part~∂~exist~∃~empty~∅~nabla~∇~isin~∈~notin~∉~ni~∋~prod~∏~sum~∑~minus~−~lowast~∗~radic~√~prop~∝~infin~∞~ang~∠~and~∧~or~∨~cap~∩~cup~∪~int~∫~there4~∴~sim~∼~cong~≅~asymp~≈~ne~≠~equiv~≡~le~≤~ge~≥~sub~⊂~sup~⊃~nsub~⊄~sube~⊆~supe~⊇~oplus~⊕~otimes~⊗~perp~⊥~sdot~⋅~lceil~⌈~rceil~⌉~lfloor~⌊~rfloor~⌋~lang~〈~rang~〉~loz~◊~spades~♠~clubs~♣~hearts~♥~diams~♦~~nbsp~ ~iexcl~¡~cent~¢~pound~£~curren~¤~yen~¥~brvbar~¦~sect~§~uml~¨~copy~©~ordf~ª~laquo~«~not~¬~shy~~reg~®~macr~¯~deg~°~plusmn~±~sup2~²~sup3~³~acute~´~micro~µ~para~¶~middot~·~cedil~¸~sup1~¹~ordm~º~raquo~»~frac14~¼~frac12~½~frac34~¾~iquest~¿~Agrave~À~Aacute~Á~Acirc~Â~Atilde~Ã~Auml~Ä~Aring~Å~AElig~Æ~Ccedil~Ç~Egrave~È~Eacute~É~Ecirc~Ê~Euml~Ë~Igrave~Ì~Iacute~Í~Icirc~Î~Iuml~Ï~ETH~Ð~Ntilde~Ñ~Ograve~Ò~Oacute~Ó~Ocirc~Ô~Otilde~Õ~Ouml~Ö~times~×~Oslash~Ø~Ugrave~Ù~Uacute~Ú~Ucirc~Û~Uuml~Ü~Yacute~Ý~THORN~Þ~szlig~ß~agrave~à~aacute~á~acirc~â~atilde~ã~auml~ä~aring~å~aelig~æ~ccedil~ç~egrave~è~eacute~é~ecirc~ê~euml~ë~igrave~ì~iacute~í~icirc~î~iuml~ï~eth~ð~ntilde~ñ~ograve~ò~oacute~ó~ocirc~ô~otilde~õ~ouml~ö~divide~÷~oslash~ø~ugrave~ù~uacute~ú~ucirc~û~uuml~ü~yacute~ý~thorn~þ~yuml~ÿ~quot~"~amp~&~lt~<~gt~>`);ic.html5=A1('Abreve~Ă~Acy~А~Afr~𝔄~Amacr~Ā~And~⩓~Aogon~Ą~Aopf~𝔸~ApplyFunction~~Ascr~𝒜~Assign~≔~Backslash~∖~Barv~⫧~Barwed~⌆~Bcy~Б~Because~∵~Bernoullis~ℬ~Bfr~𝔅~Bopf~𝔹~Breve~˘~Bscr~ℬ~Bumpeq~≎~CHcy~Ч~Cacute~Ć~Cap~⋒~CapitalDifferentialD~ⅅ~Cayleys~ℭ~Ccaron~Č~Ccirc~Ĉ~Cconint~∰~Cdot~Ċ~Cedilla~¸~CenterDot~·~Cfr~ℭ~CircleDot~⊙~CircleMinus~⊖~CirclePlus~⊕~CircleTimes~⊗~ClockwiseContourIntegral~∲~CloseCurlyDoubleQuote~”~CloseCurlyQuote~’~Colon~∷~Colone~⩴~Congruent~≡~Conint~∯~ContourIntegral~∮~Copf~ℂ~Coproduct~∐~CounterClockwiseContourIntegral~∳~Cross~⨯~Cscr~𝒞~Cup~⋓~CupCap~≍~DD~ⅅ~DDotrahd~⤑~DJcy~Ђ~DScy~Ѕ~DZcy~Џ~Darr~↡~Dashv~⫤~Dcaron~Ď~Dcy~Д~Del~∇~Dfr~𝔇~DiacriticalAcute~´~DiacriticalDot~˙~DiacriticalDoubleAcute~˝~DiacriticalGrave~`~DiacriticalTilde~˜~Diamond~⋄~DifferentialD~ⅆ~Dopf~𝔻~Dot~¨~DotDot~⃜~DotEqual~≐~DoubleContourIntegral~∯~DoubleDot~¨~DoubleDownArrow~⇓~DoubleLeftArrow~⇐~DoubleLeftRightArrow~⇔~DoubleLeftTee~⫤~DoubleLongLeftArrow~⟸~DoubleLongLeftRightArrow~⟺~DoubleLongRightArrow~⟹~DoubleRightArrow~⇒~DoubleRightTee~⊨~DoubleUpArrow~⇑~DoubleUpDownArrow~⇕~DoubleVerticalBar~∥~DownArrow~↓~DownArrowBar~⤓~DownArrowUpArrow~⇵~DownBreve~̑~DownLeftRightVector~⥐~DownLeftTeeVector~⥞~DownLeftVector~↽~DownLeftVectorBar~⥖~DownRightTeeVector~⥟~DownRightVector~⇁~DownRightVectorBar~⥗~DownTee~⊤~DownTeeArrow~↧~Downarrow~⇓~Dscr~𝒟~Dstrok~Đ~ENG~Ŋ~Ecaron~Ě~Ecy~Э~Edot~Ė~Efr~𝔈~Element~∈~Emacr~Ē~EmptySmallSquare~◻~EmptyVerySmallSquare~▫~Eogon~Ę~Eopf~𝔼~Equal~⩵~EqualTilde~≂~Equilibrium~⇌~Escr~ℰ~Esim~⩳~Exists~∃~ExponentialE~ⅇ~Fcy~Ф~Ffr~𝔉~FilledSmallSquare~◼~FilledVerySmallSquare~▪~Fopf~𝔽~ForAll~∀~Fouriertrf~ℱ~Fscr~ℱ~GJcy~Ѓ~Gammad~Ϝ~Gbreve~Ğ~Gcedil~Ģ~Gcirc~Ĝ~Gcy~Г~Gdot~Ġ~Gfr~𝔊~Gg~⋙~Gopf~𝔾~GreaterEqual~≥~GreaterEqualLess~⋛~GreaterFullEqual~≧~GreaterGreater~⪢~GreaterLess~≷~GreaterSlantEqual~⩾~GreaterTilde~≳~Gscr~𝒢~Gt~≫~HARDcy~Ъ~Hacek~ˇ~Hat~^~Hcirc~Ĥ~Hfr~ℌ~HilbertSpace~ℋ~Hopf~ℍ~HorizontalLine~─~Hscr~ℋ~Hstrok~Ħ~HumpDownHump~≎~HumpEqual~≏~IEcy~Е~IJlig~IJ~IOcy~Ё~Icy~И~Idot~İ~Ifr~ℑ~Im~ℑ~Imacr~Ī~ImaginaryI~ⅈ~Implies~⇒~Int~∬~Integral~∫~Intersection~⋂~InvisibleComma~~InvisibleTimes~~Iogon~Į~Iopf~𝕀~Iscr~ℐ~Itilde~Ĩ~Iukcy~І~Jcirc~Ĵ~Jcy~Й~Jfr~𝔍~Jopf~𝕁~Jscr~𝒥~Jsercy~Ј~Jukcy~Є~KHcy~Х~KJcy~Ќ~Kcedil~Ķ~Kcy~К~Kfr~𝔎~Kopf~𝕂~Kscr~𝒦~LJcy~Љ~Lacute~Ĺ~Lang~⟪~Laplacetrf~ℒ~Larr~↞~Lcaron~Ľ~Lcedil~Ļ~Lcy~Л~LeftAngleBracket~⟨~LeftArrow~←~LeftArrowBar~⇤~LeftArrowRightArrow~⇆~LeftCeiling~⌈~LeftDoubleBracket~⟦~LeftDownTeeVector~⥡~LeftDownVector~⇃~LeftDownVectorBar~⥙~LeftFloor~⌊~LeftRightArrow~↔~LeftRightVector~⥎~LeftTee~⊣~LeftTeeArrow~↤~LeftTeeVector~⥚~LeftTriangle~⊲~LeftTriangleBar~⧏~LeftTriangleEqual~⊴~LeftUpDownVector~⥑~LeftUpTeeVector~⥠~LeftUpVector~↿~LeftUpVectorBar~⥘~LeftVector~↼~LeftVectorBar~⥒~Leftarrow~⇐~Leftrightarrow~⇔~LessEqualGreater~⋚~LessFullEqual~≦~LessGreater~≶~LessLess~⪡~LessSlantEqual~⩽~LessTilde~≲~Lfr~𝔏~Ll~⋘~Lleftarrow~⇚~Lmidot~Ŀ~LongLeftArrow~⟵~LongLeftRightArrow~⟷~LongRightArrow~⟶~Longleftarrow~⟸~Longleftrightarrow~⟺~Longrightarrow~⟹~Lopf~𝕃~LowerLeftArrow~↙~LowerRightArrow~↘~Lscr~ℒ~Lsh~↰~Lstrok~Ł~Lt~≪~Map~⤅~Mcy~М~MediumSpace~ ~Mellintrf~ℳ~Mfr~𝔐~MinusPlus~∓~Mopf~𝕄~Mscr~ℳ~NJcy~Њ~Nacute~Ń~Ncaron~Ň~Ncedil~Ņ~Ncy~Н~NegativeMediumSpace~~NegativeThickSpace~~NegativeThinSpace~~NegativeVeryThinSpace~~NestedGreaterGreater~≫~NestedLessLess~≪~NewLine~\n~Nfr~𝔑~NoBreak~~NonBreakingSpace~ ~Nopf~ℕ~Not~⫬~NotCongruent~≢~NotCupCap~≭~NotDoubleVerticalBar~∦~NotElement~∉~NotEqual~≠~NotEqualTilde~≂̸~NotExists~∄~NotGreater~≯~NotGreaterEqual~≱~NotGreaterFullEqual~≧̸~NotGreaterGreater~≫̸~NotGreaterLess~≹~NotGreaterSlantEqual~⩾̸~NotGreaterTilde~≵~NotHumpDownHump~≎̸~NotHumpEqual~≏̸~NotLeftTriangle~⋪~NotLeftTriangleBar~⧏̸~NotLeftTriangleEqual~⋬~NotLess~≮~NotLessEqual~≰~NotLessGreater~≸~NotLessLess~≪̸~NotLessSlantEqual~⩽̸~NotLessTilde~≴~NotNestedGreaterGreater~⪢̸~NotNestedLessLess~⪡̸~NotPrecedes~⊀~NotPrecedesEqual~⪯̸~NotPrecedesSlantEqual~⋠~NotReverseElement~∌~NotRightTriangle~⋫~NotRightTriangleBar~⧐̸~NotRightTriangleEqual~⋭~NotSquareSubset~⊏̸~NotSquareSubsetEqual~⋢~NotSquareSuperset~⊐̸~NotSquareSupersetEqual~⋣~NotSubset~⊂⃒~NotSubsetEqual~⊈~NotSucceeds~⊁~NotSucceedsEqual~⪰̸~NotSucceedsSlantEqual~⋡~NotSucceedsTilde~≿̸~NotSuperset~⊃⃒~NotSupersetEqual~⊉~NotTilde~≁~NotTildeEqual~≄~NotTildeFullEqual~≇~NotTildeTilde~≉~NotVerticalBar~∤~Nscr~𝒩~Ocy~О~Odblac~Ő~Ofr~𝔒~Omacr~Ō~Oopf~𝕆~OpenCurlyDoubleQuote~“~OpenCurlyQuote~‘~Or~⩔~Oscr~𝒪~Otimes~⨷~OverBar~‾~OverBrace~⏞~OverBracket~⎴~OverParenthesis~⏜~PartialD~∂~Pcy~П~Pfr~𝔓~PlusMinus~±~Poincareplane~ℌ~Popf~ℙ~Pr~⪻~Precedes~≺~PrecedesEqual~⪯~PrecedesSlantEqual~≼~PrecedesTilde~≾~Product~∏~Proportion~∷~Proportional~∝~Pscr~𝒫~Qfr~𝔔~Qopf~ℚ~Qscr~𝒬~RBarr~⤐~Racute~Ŕ~Rang~⟫~Rarr~↠~Rarrtl~⤖~Rcaron~Ř~Rcedil~Ŗ~Rcy~Р~Re~ℜ~ReverseElement~∋~ReverseEquilibrium~⇋~ReverseUpEquilibrium~⥯~Rfr~ℜ~RightAngleBracket~⟩~RightArrow~→~RightArrowBar~⇥~RightArrowLeftArrow~⇄~RightCeiling~⌉~RightDoubleBracket~⟧~RightDownTeeVector~⥝~RightDownVector~⇂~RightDownVectorBar~⥕~RightFloor~⌋~RightTee~⊢~RightTeeArrow~↦~RightTeeVector~⥛~RightTriangle~⊳~RightTriangleBar~⧐~RightTriangleEqual~⊵~RightUpDownVector~⥏~RightUpTeeVector~⥜~RightUpVector~↾~RightUpVectorBar~⥔~RightVector~⇀~RightVectorBar~⥓~Rightarrow~⇒~Ropf~ℝ~RoundImplies~⥰~Rrightarrow~⇛~Rscr~ℛ~Rsh~↱~RuleDelayed~⧴~SHCHcy~Щ~SHcy~Ш~SOFTcy~Ь~Sacute~Ś~Sc~⪼~Scedil~Ş~Scirc~Ŝ~Scy~С~Sfr~𝔖~ShortDownArrow~↓~ShortLeftArrow~←~ShortRightArrow~→~ShortUpArrow~↑~SmallCircle~∘~Sopf~𝕊~Sqrt~√~Square~□~SquareIntersection~⊓~SquareSubset~⊏~SquareSubsetEqual~⊑~SquareSuperset~⊐~SquareSupersetEqual~⊒~SquareUnion~⊔~Sscr~𝒮~Star~⋆~Sub~⋐~Subset~⋐~SubsetEqual~⊆~Succeeds~≻~SucceedsEqual~⪰~SucceedsSlantEqual~≽~SucceedsTilde~≿~SuchThat~∋~Sum~∑~Sup~⋑~Superset~⊃~SupersetEqual~⊇~Supset~⋑~TRADE~™~TSHcy~Ћ~TScy~Ц~Tab~ ~Tcaron~Ť~Tcedil~Ţ~Tcy~Т~Tfr~𝔗~Therefore~∴~ThickSpace~ ~ThinSpace~ ~Tilde~∼~TildeEqual~≃~TildeFullEqual~≅~TildeTilde~≈~Topf~𝕋~TripleDot~⃛~Tscr~𝒯~Tstrok~Ŧ~Uarr~↟~Uarrocir~⥉~Ubrcy~Ў~Ubreve~Ŭ~Ucy~У~Udblac~Ű~Ufr~𝔘~Umacr~Ū~UnderBar~_~UnderBrace~⏟~UnderBracket~⎵~UnderParenthesis~⏝~Union~⋃~UnionPlus~⊎~Uogon~Ų~Uopf~𝕌~UpArrow~↑~UpArrowBar~⤒~UpArrowDownArrow~⇅~UpDownArrow~↕~UpEquilibrium~⥮~UpTee~⊥~UpTeeArrow~↥~Uparrow~⇑~Updownarrow~⇕~UpperLeftArrow~↖~UpperRightArrow~↗~Upsi~ϒ~Uring~Ů~Uscr~𝒰~Utilde~Ũ~VDash~⊫~Vbar~⫫~Vcy~В~Vdash~⊩~Vdashl~⫦~Vee~⋁~Verbar~‖~Vert~‖~VerticalBar~∣~VerticalLine~|~VerticalSeparator~❘~VerticalTilde~≀~VeryThinSpace~ ~Vfr~𝔙~Vopf~𝕍~Vscr~𝒱~Vvdash~⊪~Wcirc~Ŵ~Wedge~⋀~Wfr~𝔚~Wopf~𝕎~Wscr~𝒲~Xfr~𝔛~Xopf~𝕏~Xscr~𝒳~YAcy~Я~YIcy~Ї~YUcy~Ю~Ycirc~Ŷ~Ycy~Ы~Yfr~𝔜~Yopf~𝕐~Yscr~𝒴~ZHcy~Ж~Zacute~Ź~Zcaron~Ž~Zcy~З~Zdot~Ż~ZeroWidthSpace~~Zfr~ℨ~Zopf~ℤ~Zscr~𝒵~abreve~ă~ac~∾~acE~∾̳~acd~∿~acy~а~af~~afr~𝔞~aleph~ℵ~amacr~ā~amalg~⨿~andand~⩕~andd~⩜~andslope~⩘~andv~⩚~ange~⦤~angle~∠~angmsd~∡~angmsdaa~⦨~angmsdab~⦩~angmsdac~⦪~angmsdad~⦫~angmsdae~⦬~angmsdaf~⦭~angmsdag~⦮~angmsdah~⦯~angrt~∟~angrtvb~⊾~angrtvbd~⦝~angsph~∢~angst~Å~angzarr~⍼~aogon~ą~aopf~𝕒~ap~≈~apE~⩰~apacir~⩯~ape~≊~apid~≋~approx~≈~approxeq~≊~ascr~𝒶~ast~*~asympeq~≍~awconint~∳~awint~⨑~bNot~⫭~backcong~≌~backepsilon~϶~backprime~‵~backsim~∽~backsimeq~⋍~barvee~⊽~barwed~⌅~barwedge~⌅~bbrk~⎵~bbrktbrk~⎶~bcong~≌~bcy~б~becaus~∵~because~∵~bemptyv~⦰~bepsi~϶~bernou~ℬ~beth~ℶ~between~≬~bfr~𝔟~bigcap~⋂~bigcirc~◯~bigcup~⋃~bigodot~⨀~bigoplus~⨁~bigotimes~⨂~bigsqcup~⨆~bigstar~★~bigtriangledown~▽~bigtriangleup~△~biguplus~⨄~bigvee~⋁~bigwedge~⋀~bkarow~⤍~blacklozenge~⧫~blacksquare~▪~blacktriangle~▴~blacktriangledown~▾~blacktriangleleft~◂~blacktriangleright~▸~blank~␣~blk12~▒~blk14~░~blk34~▓~block~█~bne~=⃥~bnequiv~≡⃥~bnot~⌐~bopf~𝕓~bot~⊥~bottom~⊥~bowtie~⋈~boxDL~╗~boxDR~╔~boxDl~╖~boxDr~╓~boxH~═~boxHD~╦~boxHU~╩~boxHd~╤~boxHu~╧~boxUL~╝~boxUR~╚~boxUl~╜~boxUr~╙~boxV~║~boxVH~╬~boxVL~╣~boxVR~╠~boxVh~╫~boxVl~╢~boxVr~╟~boxbox~⧉~boxdL~╕~boxdR~╒~boxdl~┐~boxdr~┌~boxh~─~boxhD~╥~boxhU~╨~boxhd~┬~boxhu~┴~boxminus~⊟~boxplus~⊞~boxtimes~⊠~boxuL~╛~boxuR~╘~boxul~┘~boxur~└~boxv~│~boxvH~╪~boxvL~╡~boxvR~╞~boxvh~┼~boxvl~┤~boxvr~├~bprime~‵~breve~˘~bscr~𝒷~bsemi~⁏~bsim~∽~bsime~⋍~bsol~\\~bsolb~⧅~bsolhsub~⟈~bullet~•~bump~≎~bumpE~⪮~bumpe~≏~bumpeq~≏~cacute~ć~capand~⩄~capbrcup~⩉~capcap~⩋~capcup~⩇~capdot~⩀~caps~∩︀~caret~⁁~caron~ˇ~ccaps~⩍~ccaron~č~ccirc~ĉ~ccups~⩌~ccupssm~⩐~cdot~ċ~cemptyv~⦲~centerdot~·~cfr~𝔠~chcy~ч~check~✓~checkmark~✓~cir~○~cirE~⧃~circeq~≗~circlearrowleft~↺~circlearrowright~↻~circledR~®~circledS~Ⓢ~circledast~⊛~circledcirc~⊚~circleddash~⊝~cire~≗~cirfnint~⨐~cirmid~⫯~cirscir~⧂~clubsuit~♣~colon~:~colone~≔~coloneq~≔~comma~,~commat~@~comp~∁~compfn~∘~complement~∁~complexes~ℂ~congdot~⩭~conint~∮~copf~𝕔~coprod~∐~copysr~℗~cross~✗~cscr~𝒸~csub~⫏~csube~⫑~csup~⫐~csupe~⫒~ctdot~⋯~cudarrl~⤸~cudarrr~⤵~cuepr~⋞~cuesc~⋟~cularr~↶~cularrp~⤽~cupbrcap~⩈~cupcap~⩆~cupcup~⩊~cupdot~⊍~cupor~⩅~cups~∪︀~curarr~↷~curarrm~⤼~curlyeqprec~⋞~curlyeqsucc~⋟~curlyvee~⋎~curlywedge~⋏~curvearrowleft~↶~curvearrowright~↷~cuvee~⋎~cuwed~⋏~cwconint~∲~cwint~∱~cylcty~⌭~dHar~⥥~daleth~ℸ~dash~‐~dashv~⊣~dbkarow~⤏~dblac~˝~dcaron~ď~dcy~д~dd~ⅆ~ddagger~‡~ddarr~⇊~ddotseq~⩷~demptyv~⦱~dfisht~⥿~dfr~𝔡~dharl~⇃~dharr~⇂~diam~⋄~diamond~⋄~diamondsuit~♦~die~¨~digamma~ϝ~disin~⋲~div~÷~divideontimes~⋇~divonx~⋇~djcy~ђ~dlcorn~⌞~dlcrop~⌍~dollar~$~dopf~𝕕~dot~˙~doteq~≐~doteqdot~≑~dotminus~∸~dotplus~∔~dotsquare~⊡~doublebarwedge~⌆~downarrow~↓~downdownarrows~⇊~downharpoonleft~⇃~downharpoonright~⇂~drbkarow~⤐~drcorn~⌟~drcrop~⌌~dscr~𝒹~dscy~ѕ~dsol~⧶~dstrok~đ~dtdot~⋱~dtri~▿~dtrif~▾~duarr~⇵~duhar~⥯~dwangle~⦦~dzcy~џ~dzigrarr~⟿~eDDot~⩷~eDot~≑~easter~⩮~ecaron~ě~ecir~≖~ecolon~≕~ecy~э~edot~ė~ee~ⅇ~efDot~≒~efr~𝔢~eg~⪚~egs~⪖~egsdot~⪘~el~⪙~elinters~⏧~ell~ℓ~els~⪕~elsdot~⪗~emacr~ē~emptyset~∅~emptyv~∅~emsp13~ ~emsp14~ ~eng~ŋ~eogon~ę~eopf~𝕖~epar~⋕~eparsl~⧣~eplus~⩱~epsi~ε~epsiv~ϵ~eqcirc~≖~eqcolon~≕~eqsim~≂~eqslantgtr~⪖~eqslantless~⪕~equals~=~equest~≟~equivDD~⩸~eqvparsl~⧥~erDot~≓~erarr~⥱~escr~ℯ~esdot~≐~esim~≂~excl~!~expectation~ℰ~exponentiale~ⅇ~fallingdotseq~≒~fcy~ф~female~♀~ffilig~ffi~fflig~ff~ffllig~ffl~ffr~𝔣~filig~fi~fjlig~fj~flat~♭~fllig~fl~fltns~▱~fopf~𝕗~fork~⋔~forkv~⫙~fpartint~⨍~frac13~⅓~frac15~⅕~frac16~⅙~frac18~⅛~frac23~⅔~frac25~⅖~frac35~⅗~frac38~⅜~frac45~⅘~frac56~⅚~frac58~⅝~frac78~⅞~frown~⌢~fscr~𝒻~gE~≧~gEl~⪌~gacute~ǵ~gammad~ϝ~gap~⪆~gbreve~ğ~gcirc~ĝ~gcy~г~gdot~ġ~gel~⋛~geq~≥~geqq~≧~geqslant~⩾~ges~⩾~gescc~⪩~gesdot~⪀~gesdoto~⪂~gesdotol~⪄~gesl~⋛︀~gesles~⪔~gfr~𝔤~gg~≫~ggg~⋙~gimel~ℷ~gjcy~ѓ~gl~≷~glE~⪒~gla~⪥~glj~⪤~gnE~≩~gnap~⪊~gnapprox~⪊~gne~⪈~gneq~⪈~gneqq~≩~gnsim~⋧~gopf~𝕘~grave~`~gscr~ℊ~gsim~≳~gsime~⪎~gsiml~⪐~gtcc~⪧~gtcir~⩺~gtdot~⋗~gtlPar~⦕~gtquest~⩼~gtrapprox~⪆~gtrarr~⥸~gtrdot~⋗~gtreqless~⋛~gtreqqless~⪌~gtrless~≷~gtrsim~≳~gvertneqq~≩︀~gvnE~≩︀~hairsp~ ~half~½~hamilt~ℋ~hardcy~ъ~harrcir~⥈~harrw~↭~hbar~ℏ~hcirc~ĥ~heartsuit~♥~hercon~⊹~hfr~𝔥~hksearow~⤥~hkswarow~⤦~hoarr~⇿~homtht~∻~hookleftarrow~↩~hookrightarrow~↪~hopf~𝕙~horbar~―~hscr~𝒽~hslash~ℏ~hstrok~ħ~hybull~⁃~hyphen~‐~ic~~icy~и~iecy~е~iff~⇔~ifr~𝔦~ii~ⅈ~iiiint~⨌~iiint~∭~iinfin~⧜~iiota~℩~ijlig~ij~imacr~ī~imagline~ℐ~imagpart~ℑ~imath~ı~imof~⊷~imped~Ƶ~in~∈~incare~℅~infintie~⧝~inodot~ı~intcal~⊺~integers~ℤ~intercal~⊺~intlarhk~⨗~intprod~⨼~iocy~ё~iogon~į~iopf~𝕚~iprod~⨼~iscr~𝒾~isinE~⋹~isindot~⋵~isins~⋴~isinsv~⋳~isinv~∈~it~~itilde~ĩ~iukcy~і~jcirc~ĵ~jcy~й~jfr~𝔧~jmath~ȷ~jopf~𝕛~jscr~𝒿~jsercy~ј~jukcy~є~kappav~ϰ~kcedil~ķ~kcy~к~kfr~𝔨~kgreen~ĸ~khcy~х~kjcy~ќ~kopf~𝕜~kscr~𝓀~lAarr~⇚~lAtail~⤛~lBarr~⤎~lE~≦~lEg~⪋~lHar~⥢~lacute~ĺ~laemptyv~⦴~lagran~ℒ~langd~⦑~langle~⟨~lap~⪅~larrb~⇤~larrbfs~⤟~larrfs~⤝~larrhk~↩~larrlp~↫~larrpl~⤹~larrsim~⥳~larrtl~↢~lat~⪫~latail~⤙~late~⪭~lates~⪭︀~lbarr~⤌~lbbrk~❲~lbrace~{~lbrack~[~lbrke~⦋~lbrksld~⦏~lbrkslu~⦍~lcaron~ľ~lcedil~ļ~lcub~{~lcy~л~ldca~⤶~ldquor~„~ldrdhar~⥧~ldrushar~⥋~ldsh~↲~leftarrow~←~leftarrowtail~↢~leftharpoondown~↽~leftharpoonup~↼~leftleftarrows~⇇~leftrightarrow~↔~leftrightarrows~⇆~leftrightharpoons~⇋~leftrightsquigarrow~↭~leftthreetimes~⋋~leg~⋚~leq~≤~leqq~≦~leqslant~⩽~les~⩽~lescc~⪨~lesdot~⩿~lesdoto~⪁~lesdotor~⪃~lesg~⋚︀~lesges~⪓~lessapprox~⪅~lessdot~⋖~lesseqgtr~⋚~lesseqqgtr~⪋~lessgtr~≶~lesssim~≲~lfisht~⥼~lfr~𝔩~lg~≶~lgE~⪑~lhard~↽~lharu~↼~lharul~⥪~lhblk~▄~ljcy~љ~ll~≪~llarr~⇇~llcorner~⌞~llhard~⥫~lltri~◺~lmidot~ŀ~lmoust~⎰~lmoustache~⎰~lnE~≨~lnap~⪉~lnapprox~⪉~lne~⪇~lneq~⪇~lneqq~≨~lnsim~⋦~loang~⟬~loarr~⇽~lobrk~⟦~longleftarrow~⟵~longleftrightarrow~⟷~longmapsto~⟼~longrightarrow~⟶~looparrowleft~↫~looparrowright~↬~lopar~⦅~lopf~𝕝~loplus~⨭~lotimes~⨴~lowbar~_~lozenge~◊~lozf~⧫~lpar~(~lparlt~⦓~lrarr~⇆~lrcorner~⌟~lrhar~⇋~lrhard~⥭~lrtri~⊿~lscr~𝓁~lsh~↰~lsim~≲~lsime~⪍~lsimg~⪏~lsqb~[~lsquor~‚~lstrok~ł~ltcc~⪦~ltcir~⩹~ltdot~⋖~lthree~⋋~ltimes~⋉~ltlarr~⥶~ltquest~⩻~ltrPar~⦖~ltri~◃~ltrie~⊴~ltrif~◂~lurdshar~⥊~luruhar~⥦~lvertneqq~≨︀~lvnE~≨︀~mDDot~∺~male~♂~malt~✠~maltese~✠~map~↦~mapsto~↦~mapstodown~↧~mapstoleft~↤~mapstoup~↥~marker~▮~mcomma~⨩~mcy~м~measuredangle~∡~mfr~𝔪~mho~℧~mid~∣~midast~*~midcir~⫰~minusb~⊟~minusd~∸~minusdu~⨪~mlcp~⫛~mldr~…~mnplus~∓~models~⊧~mopf~𝕞~mp~∓~mscr~𝓂~mstpos~∾~multimap~⊸~mumap~⊸~nGg~⋙̸~nGt~≫⃒~nGtv~≫̸~nLeftarrow~⇍~nLeftrightarrow~⇎~nLl~⋘̸~nLt~≪⃒~nLtv~≪̸~nRightarrow~⇏~nVDash~⊯~nVdash~⊮~nacute~ń~nang~∠⃒~nap~≉~napE~⩰̸~napid~≋̸~napos~ʼn~napprox~≉~natur~♮~natural~♮~naturals~ℕ~nbump~≎̸~nbumpe~≏̸~ncap~⩃~ncaron~ň~ncedil~ņ~ncong~≇~ncongdot~⩭̸~ncup~⩂~ncy~н~neArr~⇗~nearhk~⤤~nearr~↗~nearrow~↗~nedot~≐̸~nequiv~≢~nesear~⤨~nesim~≂̸~nexist~∄~nexists~∄~nfr~𝔫~ngE~≧̸~nge~≱~ngeq~≱~ngeqq~≧̸~ngeqslant~⩾̸~nges~⩾̸~ngsim~≵~ngt~≯~ngtr~≯~nhArr~⇎~nharr~↮~nhpar~⫲~nis~⋼~nisd~⋺~niv~∋~njcy~њ~nlArr~⇍~nlE~≦̸~nlarr~↚~nldr~‥~nle~≰~nleftarrow~↚~nleftrightarrow~↮~nleq~≰~nleqq~≦̸~nleqslant~⩽̸~nles~⩽̸~nless~≮~nlsim~≴~nlt~≮~nltri~⋪~nltrie~⋬~nmid~∤~nopf~𝕟~notinE~⋹̸~notindot~⋵̸~notinva~∉~notinvb~⋷~notinvc~⋶~notni~∌~notniva~∌~notnivb~⋾~notnivc~⋽~npar~∦~nparallel~∦~nparsl~⫽⃥~npart~∂̸~npolint~⨔~npr~⊀~nprcue~⋠~npre~⪯̸~nprec~⊀~npreceq~⪯̸~nrArr~⇏~nrarr~↛~nrarrc~⤳̸~nrarrw~↝̸~nrightarrow~↛~nrtri~⋫~nrtrie~⋭~nsc~⊁~nsccue~⋡~nsce~⪰̸~nscr~𝓃~nshortmid~∤~nshortparallel~∦~nsim~≁~nsime~≄~nsimeq~≄~nsmid~∤~nspar~∦~nsqsube~⋢~nsqsupe~⋣~nsubE~⫅̸~nsube~⊈~nsubset~⊂⃒~nsubseteq~⊈~nsubseteqq~⫅̸~nsucc~⊁~nsucceq~⪰̸~nsup~⊅~nsupE~⫆̸~nsupe~⊉~nsupset~⊃⃒~nsupseteq~⊉~nsupseteqq~⫆̸~ntgl~≹~ntlg~≸~ntriangleleft~⋪~ntrianglelefteq~⋬~ntriangleright~⋫~ntrianglerighteq~⋭~num~#~numero~№~numsp~ ~nvDash~⊭~nvHarr~⤄~nvap~≍⃒~nvdash~⊬~nvge~≥⃒~nvgt~>⃒~nvinfin~⧞~nvlArr~⤂~nvle~≤⃒~nvlt~<⃒~nvltrie~⊴⃒~nvrArr~⤃~nvrtrie~⊵⃒~nvsim~∼⃒~nwArr~⇖~nwarhk~⤣~nwarr~↖~nwarrow~↖~nwnear~⤧~oS~Ⓢ~oast~⊛~ocir~⊚~ocy~о~odash~⊝~odblac~ő~odiv~⨸~odot~⊙~odsold~⦼~ofcir~⦿~ofr~𝔬~ogon~˛~ogt~⧁~ohbar~⦵~ohm~Ω~oint~∮~olarr~↺~olcir~⦾~olcross~⦻~olt~⧀~omacr~ō~omid~⦶~ominus~⊖~oopf~𝕠~opar~⦷~operp~⦹~orarr~↻~ord~⩝~order~ℴ~orderof~ℴ~origof~⊶~oror~⩖~orslope~⩗~orv~⩛~oscr~ℴ~osol~⊘~otimesas~⨶~ovbar~⌽~par~∥~parallel~∥~parsim~⫳~parsl~⫽~pcy~п~percnt~%~period~.~pertenk~‱~pfr~𝔭~phiv~ϕ~phmmat~ℳ~phone~☎~pitchfork~⋔~planck~ℏ~planckh~ℎ~plankv~ℏ~plus~+~plusacir~⨣~plusb~⊞~pluscir~⨢~plusdo~∔~plusdu~⨥~pluse~⩲~plussim~⨦~plustwo~⨧~pm~±~pointint~⨕~popf~𝕡~pr~≺~prE~⪳~prap~⪷~prcue~≼~pre~⪯~prec~≺~precapprox~⪷~preccurlyeq~≼~preceq~⪯~precnapprox~⪹~precneqq~⪵~precnsim~⋨~precsim~≾~primes~ℙ~prnE~⪵~prnap~⪹~prnsim~⋨~profalar~⌮~profline~⌒~profsurf~⌓~propto~∝~prsim~≾~prurel~⊰~pscr~𝓅~puncsp~ ~qfr~𝔮~qint~⨌~qopf~𝕢~qprime~⁗~qscr~𝓆~quaternions~ℍ~quatint~⨖~quest~?~questeq~≟~rAarr~⇛~rAtail~⤜~rBarr~⤏~rHar~⥤~race~∽̱~racute~ŕ~raemptyv~⦳~rangd~⦒~range~⦥~rangle~⟩~rarrap~⥵~rarrb~⇥~rarrbfs~⤠~rarrc~⤳~rarrfs~⤞~rarrhk~↪~rarrlp~↬~rarrpl~⥅~rarrsim~⥴~rarrtl~↣~rarrw~↝~ratail~⤚~ratio~∶~rationals~ℚ~rbarr~⤍~rbbrk~❳~rbrace~}~rbrack~]~rbrke~⦌~rbrksld~⦎~rbrkslu~⦐~rcaron~ř~rcedil~ŗ~rcub~}~rcy~р~rdca~⤷~rdldhar~⥩~rdquor~”~rdsh~↳~realine~ℛ~realpart~ℜ~reals~ℝ~rect~▭~rfisht~⥽~rfr~𝔯~rhard~⇁~rharu~⇀~rharul~⥬~rhov~ϱ~rightarrow~→~rightarrowtail~↣~rightharpoondown~⇁~rightharpoonup~⇀~rightleftarrows~⇄~rightleftharpoons~⇌~rightrightarrows~⇉~rightsquigarrow~↝~rightthreetimes~⋌~ring~˚~risingdotseq~≓~rlarr~⇄~rlhar~⇌~rmoust~⎱~rmoustache~⎱~rnmid~⫮~roang~⟭~roarr~⇾~robrk~⟧~ropar~⦆~ropf~𝕣~roplus~⨮~rotimes~⨵~rpar~)~rpargt~⦔~rppolint~⨒~rrarr~⇉~rscr~𝓇~rsh~↱~rsqb~]~rsquor~’~rthree~⋌~rtimes~⋊~rtri~▹~rtrie~⊵~rtrif~▸~rtriltri~⧎~ruluhar~⥨~rx~℞~sacute~ś~sc~≻~scE~⪴~scap~⪸~sccue~≽~sce~⪰~scedil~ş~scirc~ŝ~scnE~⪶~scnap~⪺~scnsim~⋩~scpolint~⨓~scsim~≿~scy~с~sdotb~⊡~sdote~⩦~seArr~⇘~searhk~⤥~searr~↘~searrow~↘~semi~;~seswar~⤩~setminus~∖~setmn~∖~sext~✶~sfr~𝔰~sfrown~⌢~sharp~♯~shchcy~щ~shcy~ш~shortmid~∣~shortparallel~∥~sigmav~ς~simdot~⩪~sime~≃~simeq~≃~simg~⪞~simgE~⪠~siml~⪝~simlE~⪟~simne~≆~simplus~⨤~simrarr~⥲~slarr~←~smallsetminus~∖~smashp~⨳~smeparsl~⧤~smid~∣~smile~⌣~smt~⪪~smte~⪬~smtes~⪬︀~softcy~ь~sol~/~solb~⧄~solbar~⌿~sopf~𝕤~spadesuit~♠~spar~∥~sqcap~⊓~sqcaps~⊓︀~sqcup~⊔~sqcups~⊔︀~sqsub~⊏~sqsube~⊑~sqsubset~⊏~sqsubseteq~⊑~sqsup~⊐~sqsupe~⊒~sqsupset~⊐~sqsupseteq~⊒~squ~□~square~□~squarf~▪~squf~▪~srarr~→~sscr~𝓈~ssetmn~∖~ssmile~⌣~sstarf~⋆~star~☆~starf~★~straightepsilon~ϵ~straightphi~ϕ~strns~¯~subE~⫅~subdot~⪽~subedot~⫃~submult~⫁~subnE~⫋~subne~⊊~subplus~⪿~subrarr~⥹~subset~⊂~subseteq~⊆~subseteqq~⫅~subsetneq~⊊~subsetneqq~⫋~subsim~⫇~subsub~⫕~subsup~⫓~succ~≻~succapprox~⪸~succcurlyeq~≽~succeq~⪰~succnapprox~⪺~succneqq~⪶~succnsim~⋩~succsim~≿~sung~♪~supE~⫆~supdot~⪾~supdsub~⫘~supedot~⫄~suphsol~⟉~suphsub~⫗~suplarr~⥻~supmult~⫂~supnE~⫌~supne~⊋~supplus~⫀~supset~⊃~supseteq~⊇~supseteqq~⫆~supsetneq~⊋~supsetneqq~⫌~supsim~⫈~supsub~⫔~supsup~⫖~swArr~⇙~swarhk~⤦~swarr~↙~swarrow~↙~swnwar~⤪~target~⌖~tbrk~⎴~tcaron~ť~tcedil~ţ~tcy~т~tdot~⃛~telrec~⌕~tfr~𝔱~therefore~∴~thetav~ϑ~thickapprox~≈~thicksim~∼~thkap~≈~thksim~∼~timesb~⊠~timesbar~⨱~timesd~⨰~tint~∭~toea~⤨~top~⊤~topbot~⌶~topcir~⫱~topf~𝕥~topfork~⫚~tosa~⤩~tprime~‴~triangle~▵~triangledown~▿~triangleleft~◃~trianglelefteq~⊴~triangleq~≜~triangleright~▹~trianglerighteq~⊵~tridot~◬~trie~≜~triminus~⨺~triplus~⨹~trisb~⧍~tritime~⨻~trpezium~⏢~tscr~𝓉~tscy~ц~tshcy~ћ~tstrok~ŧ~twixt~≬~twoheadleftarrow~↞~twoheadrightarrow~↠~uHar~⥣~ubrcy~ў~ubreve~ŭ~ucy~у~udarr~⇅~udblac~ű~udhar~⥮~ufisht~⥾~ufr~𝔲~uharl~↿~uharr~↾~uhblk~▀~ulcorn~⌜~ulcorner~⌜~ulcrop~⌏~ultri~◸~umacr~ū~uogon~ų~uopf~𝕦~uparrow~↑~updownarrow~↕~upharpoonleft~↿~upharpoonright~↾~uplus~⊎~upsi~υ~upuparrows~⇈~urcorn~⌝~urcorner~⌝~urcrop~⌎~uring~ů~urtri~◹~uscr~𝓊~utdot~⋰~utilde~ũ~utri~▵~utrif~▴~uuarr~⇈~uwangle~⦧~vArr~⇕~vBar~⫨~vBarv~⫩~vDash~⊨~vangrt~⦜~varepsilon~ϵ~varkappa~ϰ~varnothing~∅~varphi~ϕ~varpi~ϖ~varpropto~∝~varr~↕~varrho~ϱ~varsigma~ς~varsubsetneq~⊊︀~varsubsetneqq~⫋︀~varsupsetneq~⊋︀~varsupsetneqq~⫌︀~vartheta~ϑ~vartriangleleft~⊲~vartriangleright~⊳~vcy~в~vdash~⊢~vee~∨~veebar~⊻~veeeq~≚~vellip~⋮~verbar~|~vert~|~vfr~𝔳~vltri~⊲~vnsub~⊂⃒~vnsup~⊃⃒~vopf~𝕧~vprop~∝~vrtri~⊳~vscr~𝓋~vsubnE~⫋︀~vsubne~⊊︀~vsupnE~⫌︀~vsupne~⊋︀~vzigzag~⦚~wcirc~ŵ~wedbar~⩟~wedge~∧~wedgeq~≙~wfr~𝔴~wopf~𝕨~wp~℘~wr~≀~wreath~≀~wscr~𝓌~xcap~⋂~xcirc~◯~xcup~⋃~xdtri~▽~xfr~𝔵~xhArr~⟺~xharr~⟷~xlArr~⟸~xlarr~⟵~xmap~⟼~xnis~⋻~xodot~⨀~xopf~𝕩~xoplus~⨁~xotime~⨂~xrArr~⟹~xrarr~⟶~xscr~𝓍~xsqcup~⨆~xuplus~⨄~xutri~△~xvee~⋁~xwedge~⋀~yacy~я~ycirc~ŷ~ycy~ы~yfr~𝔶~yicy~ї~yopf~𝕪~yscr~𝓎~yucy~ю~zacute~ź~zcaron~ž~zcy~з~zdot~ż~zeetrf~ℨ~zfr~𝔷~zhcy~ж~zigrarr~⇝~zopf~𝕫~zscr~𝓏~~AMP~&~COPY~©~GT~>~LT~<~QUOT~"~REG~®',ic.html4);var h7={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},p7=String.fromCodePoint||function(r){return String.fromCharCode(Math.floor((r-65536)/1024)+55296,(r-65536)%1024+56320)},ac=function(){return ac=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},ac.apply(this,arguments)},g7=ac(ac({},ic),{all:ic.html5}),m7={scope:"body",level:"all"},N0=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g,L0=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g,Vx={xml:{strict:N0,attribute:L0,body:_0.xml},html4:{strict:N0,attribute:L0,body:_0.html4},html5:{strict:N0,attribute:L0,body:_0.html5}},v7=ac(ac({},Vx),{all:Vx.html5}),IF=String.fromCharCode,y7=IF(65533);function A7(r,e,t,n){var i=r,a=r[r.length-1];if(t&&a==="=")i=r;else if(n&&a!==";")i=r;else{var s=e[r];if(s)i=s;else if(r[0]==="&"&&r[1]==="#"){var o=r[2],l=o=="x"||o=="X"?parseInt(r.substr(3),16):parseInt(r.substr(2));i=l>=1114111?y7:l>65535?p7(l):IF(h7[l]||l)}}return i}function b7(r,e){var t=m7,n=t.level,i=n===void 0?"all":n,a=t.scope,s=a===void 0?i==="xml"?"strict":"body":a;if(!r)return"";var o=v7[i][s],l=g7[i].entities,u=s==="attribute",c=s==="strict";return r.replace(o,function(f){return A7(f,l,u,c)})}const PF=new Map;class w7{constructor(e){this.font=e,this.glyphsFromText=new Map,this.kerningValues=new Map,this.height=this.calculateApproximateHeight()}getFont(){return this.font}getGlyphs(e){const t=this.glyphsFromText.get(e);if(t)return t;const n=this.font.stringToGlyphs(e);return this.glyphsFromText.set(e,n),n}getApproximateHeight(){return this.height}getExactHeight(e){const t=this.font.stringToGlyphs(e);let n=0,i=0;return t.forEach(a=>{const s=a.getMetrics();n=Math.max(n,s.yMax),i=Math.min(i,s.yMin)}),n-i}getKerningValue(e,t){if(!e.name||!t.name)return;let n=this.kerningValues.get(e.name);n||(n=new Map,this.kerningValues.set(e.name,n));let i=n.get(t.name);return i||(i=this.font.getKerningValue(e,t),n.set(t.name,i)),i}calculateApproximateHeight(){const t=this.font.stringToGlyphs("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");let n=0,i=0;return t.forEach(a=>{const s=a.getMetrics();n=Math.max(n,s.yMax),i=Math.min(i,s.yMin)}),n-i}}const C7=r=>r.substring(0,5).toLowerCase().trim()==="data:",U0=new Map,Rl=async r=>{if(U0.has(r))return U0.get(r);const t=(async()=>{try{return Io(r).getFont()}catch{if(C7(r)){const n=qk(r),i=rA(n);return nA(r,i),i}else{const n=await Ng(r,!0),i=rA(n);return nA(r,i),await _4(i,r),i}}})();return U0.set(r,t),t},x7=r=>{const e=qk(r),t=rA(e);return nA(r,t),t},Io=r=>{const e=PF.get(r);if(e)return e;throw new Error("Font metrics unavailable for font")},nA=(r,e)=>{const t=new w7(e);return PF.set(r,t),t},S7=async r=>{const e=us(),t=e.parseFromString(r,"image/svg+xml"),n=t.firstElementChild,i=new Map;n.querySelectorAll("style").forEach(c=>{Kk.parse(c.innerHTML).stylesheet?.rules.forEach(d=>{if(d.type==="font-face"&&d.declarations){const h=d.declarations.find(y=>y.property==="font-family")?.value,v=d.declarations.find(y=>y.property==="src")?.value?.match(/'(https.*?)'/)?.[1];h&&v&&i.set(h,v)}})});const s=t.querySelectorAll("tspan");for(let c=0;c<s.length;c++){const f=s.item(c),d=f.closest("text"),h=f.closest("g"),g=d.getAttribute("font-family"),v=await Rl(i.get(g)),y=b7(f.innerHTML),A=d.getAttribute("fill"),C=d.getAttribute("stroke"),S=d.getAttribute("stroke-width"),F=v.getPath(y,0,0,parseInt(d.getAttribute("font-size")??"72")),E=F.getBoundingBox().x2-F.getBoundingBox().x1;let R=0;const B=f.getAttribute("text-anchor");B==="middle"?R=E/2:B==="end"&&(R=E);const j=v.getPath(y,parseFloat(f.getAttribute("x")??"0")-R,parseFloat(f.getAttribute("y")??"0"),parseInt(d.getAttribute("font-size")??"72"));j.fill=A,j.stroke=C,j.strokeWidth=parseFloat(S??"0");const G=j.toSVG(2),q=e.parseFromString(G,"image/svg+xml").firstElementChild;h.appendChild(q)}return t.querySelectorAll("text").forEach(c=>c.remove()),Do().serializeToString(n)},fg=(r,e,t,n)=>Math.max(F7(r.join(`
|
|
1783
1783
|
`),t,n),e),zx=(r,e,t,n,i,a)=>{const s=(a||OF)*i.getApproximateHeight(),o=e.split(`
|
|
1784
1784
|
`);try{const l=o.flatMap(c=>qp(c,r.width,n,i)),u=l.flatMap(c=>c.lines);return{lines:u,requiredHeight:l.flatMap(c=>c.lines).length*(n*s),fontSize:t,requiredWidth:fg(u,r.width,n,i)}}catch{const u=e.split("");return{lines:u,requiredHeight:u.length*(n*s),fontSize:t,requiredWidth:fg(u,r.width,n,i)}}},qp=(r,e,t,n)=>{const i=ho(r,t,n);if(i<=e)return{lines:[r],width:i};if(!(r.indexOf(" ")>-1)){if(r.length<=1)throw new Error(`Character ${r} is wider than region`);const c=Math.floor(r.length/2),f=qp(r.slice(0,c),e,t,n),d=qp(r.slice(c),e,t,n);return{lines:[...f.lines,...d.lines],width:Math.max(f.width,d.width)}}const s=r.split(" "),o=[];let l=-1/0,u=0;for(;u<s.length;){const c=s[u];if(ho(c,t,n)>e){const f=qp(c,e,t,n);o.push(...f.lines),l=Math.max(l,f.width),u++}else{const f=[c];l=Math.max(l,ho(c,t,n));let d=u+1,h=!0;for(;d<s.length&&h;){const g=s[d],v=ho(`${f.join(" ")} ${g}`,t,n);v<=e?(f.push(g),l=Math.max(l,v),d++):h=!1}o.push(f.join(" ")),u=d}}if(l<0)throw new Error(`No max width calculated for text: ${o}.`);return{lines:o,width:l}},E7=(r,e,t,n,i,a)=>{const s=(a??OF)*e.getApproximateHeight(),o=1/t.unitsPerEm,l=DF(r,o,e),u=r.length*s*o,c=n/l,f=i/u;return Math.min(f,c)},k7=(r,e,t,n)=>{const i=Io(e.fontData.assetUrl),a=i.getFont(),s=e.fontSize/a.unitsPerEm;if(!t)return zx(e,r,e.fontSize,s,i,n);let o;if(e.text?o=e.text.split(`
|
|
1785
1785
|
`):o=e.input?.split(`
|
|
@@ -2652,7 +2652,7 @@ Minimum version required to store current data is: `+q+`.
|
|
|
2652
2652
|
id
|
|
2653
2653
|
}
|
|
2654
2654
|
}
|
|
2655
|
-
`,x9=(r,e)=>e&&typeof e=="object"&&!Array.isArray(e)?Object.keys(e).sort().reduce((t,n)=>(t[n]=e[n],t),{}):e,S9=r=>{for(const e of Object.values(r.layouts).map(t=>t.elements).flat())e.type==="illustration"&&(delete e.cachedObjectURL,e.src&&delete e.svg),e.type==="frame"&&delete e.pattern?.svg;return dI(r,"__typename"),r},dI=(r,e)=>{if(!(typeof r!="object"||r===null))for(const t in r)t===e?delete r[t]:dI(r[t],e)};var Jf=(r=>(r.Error="Error",r.Warning="Warning",r.Info="Info",r))(Jf||{});const E9=1e3;class xE extends jg{constructor(e){super(),this.update=e}async execute(){await this.update(),await new Promise(e=>{window.setTimeout(()=>{e()},E9)})}}const k9=r=>r.sort((e,t)=>e.index-t.index).map(e=>({id:Ar(),panelId:e.name,name:e.name,title:e.title,index:e.index,createdAt:new Date,updatedAt:new Date,transparentBackground:e.transparentBackground,height:e.height,width:e.width,previewRegion:e.previewRegion,useEditableArea:e.useEditableArea,editableArea:e.editableArea})),T9=(r,e)=>{const t=r.workflowState,n=t?JSON.parse(t):void 0;return n?Object.values(n.layouts).map(i=>i.layout):k9(e.panels)},af=class af{constructor(e,t,n,i,a,s=!1,o,l=!1,u=!1,c=!1){this.workflowStatePromiseQueue=new Gg(1),this.initialized=!1,this.readOnly=!1,this.isReloadedTransaction=!1,this.singleVariantsRenderable=!1,this.stepTags={},this.setWorkflow=async d=>{this.confirmedDesign=!1,this.editedSteps={},this.informationResults=[],this.mandatorySteps={},this.pendingUpdates=[],this.selectionCost=0,this.stepSpecificServices={},this.pollers=[],this.allScenes=[],this.stepElements={},this.stepInitialised={},this.stepMetadata={},this.stepSelections={},this.storage={},this.validationErrors={steps:new Map},this.currentAdjustingStepId="",this.reloadedState?this.layouts=Object.values(this.reloadedState.layouts||{}).map(g=>g.layout):d?this.layouts=T9(this.experience.getTransaction(),d):this.layouts=[],this.commandContext.initialize(this.layouts,this.reloadedState),this.renderableContextService=new _U(this.layouts),this.renderableContextService.setWorkflowManager(this),d.steps.forEach(g=>{this.stepTags[g.stepName]=g.tags??[]});const h=this.previewService;this.ejectFromPreviewService(),this.initializationPromise=this.initializeDefaultWorkflowState(d),this.initializationPromise.then(()=>{this.initialized=!0}),this.initializationPromise.catch(g=>{throw this.initialized=!1,new Error(g)}),this.initializationPromise.finally(()=>this.commandContext.registerStateCallback(()=>{this.updateStateWithServer(),this.renderLayouts()})),h&&await this.injectIntoPreviewService(h,!0)},this.renderLayouts=()=>{if(!this.previewService)return;const d=this.getCommandContext().getAllLayouts(),h=this.getLayoutPreviewService()?.getAll();if(h)for(const[,g]of h)g.render(d)},this.experience=e,this.client=t,this.updateTransaction=n,this.graphQlClient=i,this.reloadedState=a,this.readOnly=s,this.singleVariantsRenderable=u,this.commandContext=new jF,this.confirmCallbacks=[],this.editedCallbacks=[],this.elementsCallbacks=[],this.informationResultCallbacks=[],this.initCallbacks=[],this.mandatoryCallbacks=[],this.makingAdjustmentsCallback=[],this.metadataCallbacks=[],this.selectionCallbacks=[],this.stepSpecificStorageCallbacks={},this.storageCallbacks=[],this.validationCallbacks=[],this.recipientCallbacks=[],this.modelContainer=o,this.confirmedDesign=!1,this.editedSteps={},this.informationResults=[],this.mandatorySteps={},this.pendingUpdates=[],this.selectionCost=0,this.stepSpecificServices={},this.pollers=[],this.allScenes=[],this.stepElements={},this.stepInitialised={},this.stepMetadata={},this.stepSelections={},this.storage={},this.validationErrors={steps:new Map},this.currentAdjustingStepId="",this.isReloadedTransaction=l,c&&(this.workflowStatePromiseQueue.enabled=!1);const f=this.experience.getWorkflow();f&&this.setWorkflow(f)}getTemplatingContext(){const e=this.experience.getTransaction().recipient,t={recipient:e};return this.recipientConversionConfiguration?.requestedDataItems?.forEach(n=>{const i=n.uniqueIdentifier??n.title??"";n.type===Qd.FirstName?t[i]=e?.firstName:n.type===Qd.LastName?t[i]=e?.lastName:n.type===Qd.Custom&&(n.customFieldIndex===1?t[i]=e?.customField1:n.customFieldIndex===2?t[i]=e?.customField2:n.customFieldIndex===3?t[i]=e?.customField3:n.customFieldIndex===4?t[i]=e?.customField4:n.customFieldIndex===5&&(t[i]=e?.customField5),n.option&&(t[i]=n.option.variants?.find(a=>a.id===t[i])?.name))}),t}async updateRecipient(e,t,n,i,a,s,o,l,u,c,f,d,h,g,v,y,A,C){const S=this.experience.getTransaction();if(S.recipient?.id)this.experience.getTransaction().recipient={id:S.recipient.id,firstName:e??S.recipient.firstName,lastName:t??S.recipient.lastName,address:n??S.recipient.address,suburb:i??S.recipient.suburb,state:a??S.recipient.state,email:s??S.recipient.email,postalCode:o??S.recipient.postalCode,country:l??S.recipient.country,mobile:u??S.recipient.mobile,company:c??S.recipient.company,apartment:f??S.recipient.apartment,customField1:d??S.recipient.customField1,customField2:h??S.recipient.customField2,customField3:g??S.recipient.customField3,customField4:v??S.recipient.customField4,customField5:y??S.recipient.customField5,conversionConfigurationId:A||S.recipient.conversionConfigurationId},this.experience.callEvent(yg.RecipientChanged),await this.graphQlClient().mutate({mutation:y9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:S.recipient.id,firstName:e||S.recipient.firstName,lastName:t||S.recipient.lastName,address:n||S.recipient.address,suburb:i||S.recipient.suburb,state:a||S.recipient.state,email:s||S.recipient.email,postalCode:o||S.recipient.postalCode,country:l||S.recipient.country,mobile:u||S.recipient.mobile,company:c||S.recipient.company,apartment:f||S.recipient.apartment,customField1:d||S.recipient.customField1,customField2:h||S.recipient.customField2,customField3:g||S.recipient.customField3,customField4:v||S.recipient.customField4,customField5:y||S.recipient.customField5,conversionConfigurationId:A||S.recipient.conversionConfigurationId,prevalidated:C}});else{const F=await this.graphQlClient().mutate({mutation:v9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{firstName:e,lastName:t,address:n,suburb:i,state:a,email:s,postalCode:o,country:l,mobile:u,company:c,apartment:f,customField1:d,customField2:h,customField3:g,customField4:v,customField5:y,conversionConfigurationId:A}});S.recipient={id:F?.data?.recipientCreate?.id,firstName:e,lastName:t,address:n,suburb:i,state:a,email:s,postalCode:o,country:l,mobile:u,company:c,apartment:f,customField1:d,customField2:h,customField3:g,customField4:v,customField5:y,conversionConfigurationId:A},this.experience.callEvent(yg.RecipientChanged),await this.graphQlClient().mutate({mutation:A9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:this.experience.getTransaction().id,recipientId:F.data?.recipientCreate?.id},context:{transactionOwnerId:this.experience.getTransaction().transactionOwnerId}})}await this.fetchConversionConfiguration(),this.recipientCallbacks.forEach(F=>F(this.experience.getTransaction().recipient))}async fetchConversionConfiguration(){const e=this.experience.getTransaction().recipient;if(e?.conversionConfigurationId&&!this.recipientConversionConfiguration){const t=af.configurationPromiseMap.get(e.conversionConfigurationId);if(t)this.recipientConversionConfiguration=await t;else{const i=(async()=>(await this.graphQlClient().query({query:R3,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:e.conversionConfigurationId}})).data.conversionConfiguration)();af.configurationPromiseMap.set(e.conversionConfigurationId,i),this.recipientConversionConfiguration=await i}}}async initializeDefaultWorkflowState(e){const t=()=>{const c=e.finalizeStepConfig;if(!c)return;const f=c.lookAtAnimation,d=c.modelAnimation;f&&this.previewService?.executeCameraAnimation(f),d&&this.modelContainer?.executeAnimation(d)};this.reloadedState&&this.reloadedState.serializableWorkflow.steps.forEach(c=>{this.storage[c.stepName]=c.storage||{}});const n=await this.getInitialOptionIds(this.reloadedState?.serializableWorkflow?.steps.reduce((c,f)=>(f.selectedVariants?.length&&(c[f.stepName]={selectedVariants:f.selectedVariants.map(d=>({id:d.id}))}),c),{})),i=ct.getOptions(Array.from(n)),a=this.fetchConversionConfiguration();await Promise.all([i,a]),this.allScenes=YC(e);const o=(await Ja(this.allScenes,this.stepSelections)).map(c=>c.silentSteps).flat(),{stepElements:l,commands:u}=await this.stepElementsForIntroducedSilentSteps(o,!!this.reloadedState);this.commandContext.apply(new On(u),!0),this.stepElements={...this.stepElements,...l},await this.ensureStepsAreLoaded(),this.isReloadedTransaction||this.updateStateWithServer(),this.renderLayouts(),this.reloadedState&&t()}getWorkflowExperience(){return this.experience}getClient(){return this.client}setWorkflowStateSyncEnabled(e){this.workflowStatePromiseQueue.enabled=e}getInitializationPromise(){return this.initializationPromise}isInitialized(){return this.initialized}async getInitialOptionIds(e){const t=new Set,n=this.experience.getWorkflow();if(!n)return t;const i=YC(n),a={...e};let s=-1;for(;;){const u=(await Ja(i,a)).flatMap(c=>c.renderableSteps);if(u.length===s)break;s=u.length;for(const c of u){if(a[c.stepName])continue;const f=c.option?.defaultVariant?.id;f&&(a[c.stepName]={selectedVariants:[{id:f}]})}}return(await Ja(i,a)).flatMap(l=>l.renderableSteps).forEach(l=>{l.option?.id&&!l.option?.variants&&t.add(l.option.id)}),t}addConfirmCallback(e){e(this.confirmedDesign),this.confirmCallbacks.push(e)}addEditedCallback(e){e(this.editedSteps),this.editedCallbacks.push(e)}addElementsCallback(e){e(this.stepElements),this.elementsCallbacks.push(e)}addInformationResultCallback(e){e(this.informationResults),this.informationResultCallbacks.push(e)}addInitCallback(e){e(this.stepInitialised),this.initCallbacks.push(e)}addMandatoryCallback(e){e(this.mandatorySteps),this.mandatoryCallbacks.push(e)}addMetadataCallback(e){e(this.stepMetadata),this.metadataCallbacks.push(e)}async addSelectionCallback(e){e({selectionCost:this.selectionCost,selections:this.stepSelections,traversableScenes:await this.traversableScenes()}),this.selectionCallbacks.push(e)}addStepSpecificStorageCallback(e,t){Object.keys(this.storage).includes(t)||(this.storage[t]={}),e(this.storage[t]),Object.keys(this.stepSpecificStorageCallbacks).includes(t)||(this.stepSpecificStorageCallbacks[t]=[]),this.stepSpecificStorageCallbacks[t].push(e)}addStorageCallback(e){e(this.storage),this.storageCallbacks.push(e)}addMakingAdjustmentsCallback(e){e(this.currentAdjustingStepId),this.makingAdjustmentsCallback.push(e)}addPoller(e){this.pollers.push(e)}addValidationCallback(e){this.validationCallbacks.push(e),e(this.validationErrors)}addRecipientCallback(e){this.recipientCallbacks.push(e),e(this.experience.getTransaction().recipient)}removeRecipientCallback(e){this.recipientCallbacks=this.recipientCallbacks.filter(t=>t!==e)}getLayouts(){return this.layouts}getAllLayoutData(){return this.commandContext.getAllLayouts().map(e=>e.layoutState)}getLayoutPreviewService(){return this.renderableContextService}getInformationResults(){return this.informationResults}getPreviewService(){return this.previewService}getCommandContext(){return this.commandContext}getRegionElements(e){return this.stepElements[e]||[]}getStepSpecificServices(e){return this.stepSpecificServices[e]}getTransactionCustomer(){return this.ownerCustomer}setTransactionCustomer(e){this.ownerCustomer=e}setTransactionCustomerDetails(e){this.ownerCustomer={...this.ownerCustomer,emailAddress:e.email}}getModelContainer(){return this.modelContainer}setModelContainer(e){(!e||this.previewService&&this.previewService.getAllModels().includes(e))&&(this.modelContainer=e,e&&e.metadata&&e.metadata instanceof Map&&this.modelContainer.metadata.set("workflowManager",this))}getCommandDispatcher(){return e=>this.commandContext.apply(e,!this.initialized)}getWorkflowSelections(){const e={};return this.experience.getWorkflow()?.steps.forEach(t=>{const n=this.stepSelections[t.stepName];n&&n.selectedVariants&&n.selectedVariants.length>0&&(e[t.stepName]={selections:n.selectedVariants})}),e}getStepSelections(){return this.stepSelections}markStepsAsInitialised(e){const t={...this.stepInitialised};e.forEach(n=>{t[n]=!0}),this.stepInitialised=t,this.onInitChange()}getUpdatesPending(){return this.pendingUpdates.length>0}markUpdateCompleted(e){this.pendingUpdates=this.pendingUpdates.filter(t=>t!==e)}markUpdatePending(){const e=Ar();return this.pendingUpdates=[...this.pendingUpdates,e],e}setEditedStatus(e,t){this.editedSteps={...this.editedSteps,[e]:t},this.onEditedChange()}setInformationResults(e){this.informationResults=[...e],this.onInformationResultChange()}setCurrentAdjustingStepId(e){this.currentAdjustingStepId=e,this.onMakingAdjustmentsChange()}setMandatoryFulfilled(e,t){this.mandatorySteps[e]!==t&&(this.mandatorySteps={...this.mandatorySteps,[e]:t},this.onMandatoryChange())}async getMandatoryUnfulfilledSteps(){return(await Ja(this.allScenes,this.stepSelections)).flatMap(a=>a.renderableSteps).filter(a=>a.mandatory).filter(a=>!this.mandatorySteps[a.stepName]).map(a=>a.stepName)}setStepError(e,t,n){let i=!1;if(!this.validationErrors.steps.has(e)&&n)i=!0,this.validationErrors.steps.set(e,new Map([[t,n]]));else if(this.validationErrors.steps.has(e)){const a=this.validationErrors.steps.get(e);n&&n!==a.get(t)?(i=!0,a.set(t,n)):n||(i=!0,a.delete(t),a.size===0&&this.validationErrors.steps.delete(e))}i&&this.onValidationChange()}getStepErrors(e){return this.validationErrors.steps.get(e)}getValidationErrors(){return this.validationErrors}toggleDesignConfirmed(){this.confirmedDesign=!this.confirmedDesign,this.onConfirmChange()}toggleMakingAdjustmentsCallback(e){e(this.mandatorySteps),this.mandatoryCallbacks.push(e)}async injectIntoPreviewService(e,t){if(this.modelContainer)throw new Error("You must eject from the preview service before injecting again.");this.previewService=e;const n=this.experience.getProduct();if(!n?.modelUrl||!this.previewService)return;const i=e.loadModel({model:n.modelUrl,contextService:this.getLayoutPreviewService()},{refocusCamera:t});this.setModelContainer(i),(await Ja(this.allScenes,this.stepSelections)).filter(o=>o).map(o=>o.renderableSteps).flat().filter(o=>o.type===Xe.Model||o.type===Xe.Material).forEach(o=>{if(!o.option?.id){console.error(`Failed to read option id from step: ${o.stepName}`);return}const l=this.stepSelections[o.stepName]?.selectedVariants||[];if(l.length===0)return;const u=l[0];if(o.type===Xe.Model){if(!this.modelContainer)throw new nn("We should always have a model container when injecting a preview!");const c=u.asset?.fileLink;if(!c){console.error(`Failed to read model url from variant: ${u.id} for step: ${o.stepName}`);return}const f=o.data;this.modelContainer.applyModelVariant(o.stepName,{model:c,contextService:this.getLayoutPreviewService()},f.replaceProductModel||!1)}else{const c=u.material;if(!c){console.error(`Failed to read material from variant: ${u.id} for step: ${o.stepName}`);return}o.data.targetMaterials.forEach(d=>{if(!this.modelContainer)throw new nn("We should always have a model container when injecting a preview!");this.modelContainer.applyMaterialVariant(d,o.option.id,c)})}}),await i.getInitializationPromise(),this.renderLayouts()}ejectFromPreviewService(){if(this.modelContainer){if(!this.modelContainer.dispose)throw new Error("This feature is not supported in the current preview service.");this.modelContainer.dispose(),this.modelContainer=void 0}this.previewService=void 0}updateStorage(e,t){const n={...this.storage,[e]:{...this.storage[e],...t}};if(!vf(n,this.storage)){this.storage=n;const i=new OS(this.constructSerializableWorkflow());this.commandContext.apply(i,!0),this.onStepSpecificStorageChange(e),this.onStorageChange()}}constructSerializableWorkflow(){const e=[];return this.allScenes.forEach(t=>{t.renderableSteps.forEach(n=>{const i={stepName:n.stepName};i.storage=this.storage[n.stepName],i.selectedVariants=this.stepSelections[n.stepName]?.selectedVariants?.map(a=>({id:a.id,priceModifier:a.priceModifier})),e.push(i)})}),{steps:e}}updateStateWithServer(){if(this.readOnly)return;const e=this.serialize();this.workflowStatePromiseQueue.enqueue(new xE(async()=>{await new Promise(t=>{setTimeout(()=>{t()},1)}),await this.updateTransaction({variables:{id:this.experience.getTransaction().id,workflowState:e}})}))}async updateStateWithServerImmediate(){if(this.readOnly)return;const e=this.serialize();return new xE(async()=>{await this.updateTransaction({variables:{id:this.experience.getTransaction().id,workflowState:e}})}).execute()}serialize(){const e=this.getCommandContext().getState();if(!e)throw new nn("Attempted to serialize state before it was initialized.");const t=mo(e.transaction),n=S9(t);return JSON.stringify(n,x9,void 0)}async getStateHash(){const e=this.getCommandContext().getState(),n=Object.values(e?.transaction.layouts||{}).map(s=>s.modificationID??"").sort().join(""),a=new TextEncoder().encode(n);if(typeof window<"u"&&window.crypto&&window.crypto.subtle&&window.crypto.subtle.digest){const s=await window.crypto.subtle.digest("SHA-256",a);return Array.from(new Uint8Array(s)).map(u=>u.toString(16).padStart(2,"0")).join("")}try{return(await import("crypto")).createHash("sha256").update(n,"utf8").digest("hex")}catch{throw new Error("Unable to compute SHA-256 hash: no suitable crypto implementation available.")}}async outstandingRequestsPromise(){return this.workflowStatePromiseQueue.finalize()}updateMetadata(e,t){this.stepMetadata={...this.stepMetadata,[e]:{...this.stepMetadata[e],...t}},this.onMetadataChange()}removeElements(e){const t=(n,i)=>Object.keys(n).reduce((a,s)=>{const o=[...n[s]||[]];return i.forEach(l=>{const u=o.findIndex(c=>c.id===l.id);u>-1&&o.splice(u,1)}),a[s]=o,a},{});this.stepElements=t(this.stepElements,e)}async getInvalidCanvasRegions(){let e=[];for(const t of this.experience.getWorkflow()?.steps||[])if(!await co(t,this.stepSelections)&&this.stepElements[t.stepName])for(const n of this.stepElements[t.stepName])e.push(n);return e}async getInvalidModelVariants(){let e=[];for(const t of this.experience.getWorkflow()?.steps||[])t.type===Xe.Model&&!await co(t,this.stepSelections)&&e.push(t.stepName);return e}async stepElementsForIntroducedSilentSteps(e,t){const n=this.experience.getProduct();if(!n)return Promise.resolve({stepElements:{},commands:[]});const i=async(u,c,f)=>{if(u.type===Xe.SilentIllustration){const d=await new BS(u,c).trigger();return{step:u,results:d}}else if(u.type===Xe.ProductOverlay){const d=await new BS(u,c,f).trigger();return{step:u,results:d}}return Promise.reject("Unknown silent step. This is a bug")},a=e.filter(u=>!this.stepInitialised[u.stepName]),s={stepElements:{},commands:[]},o=[];for(const u of a)this.markStepsAsInitialised([u.stepName]),t||o.push(i(u,this.layouts,n));const l=await Promise.all(o);for(const u of l)s.stepElements[u.step.stepName]=u.results.map(c=>c.regionElement),s.commands=[...s.commands,...u.results.map(c=>c.command)];return s}getStepStorage(e){return this.storage[e]}getMetadata(e){return this.stepMetadata[e]}getWorkflowMetadata(){return this.stepMetadata}getStepTags(e){return this.stepTags[e]||[]}getSerializedStep(e,t){return t.find(n=>n.stepName===e)}async updateTransactionShareActions(){const e=await this.client.getShareActionsForTransaction(this.experience.getTransaction().id);this.experience.getTransaction().transactionShareActions=e}async updateTransactionStakeholders(){const e=await ze.getShadowGraphqlClient().query({query:L3,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:this.experience.getTransaction().id}});!e?.data?.transactions||e.data.transactions.length!==1?(this.experience.getTransaction().currentStakeholder=void 0,this.experience.getTransaction().stakeholders=void 0):(this.experience.getTransaction().stakeholders=e.data.transactions[0].stakeholders,this.experience.getTransaction().currentStakeholder=e.data.transactions[0].currentStakeholder)}async approveTransaction(e){await ze.getShadowGraphqlClient().mutate({mutation:g9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:this.experience.getTransaction().id,note:e}})}async rejectTransaction(e){await ze.getShadowGraphqlClient().mutate({mutation:m9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:this.experience.getTransaction().id,note:e}})}async reset(){this.stepElements={},this.stepInitialised={},this.stepMetadata={},this.stepSelections={},this.storage={},await this.ensureStepsAreLoaded()}async setSelectionsAndElements(e,t,n,i){const a=this.experience.getWorkflow();if(!a)throw new Error("Attempted to set selections when no workflow is set!");const s=this.stepSelections;this.stepSelections={...this.stepSelections,[e]:{selectedVariants:t}},this.selectionCost=Object.values(this.stepSelections).reduce((R,B)=>R+B.selectedVariants.map(j=>j.priceModifier||0).reduce((j,G)=>j+G,0),0);for(const R of a.steps)await co(R,this.stepSelections)||(this.stepInitialised[R.stepName]=!1,delete this.stepMetadata[R.stepName],delete this.stepSelections[R.stepName],delete this.storage[R.stepName]);const o=this.allScenes,l=await Ja(o,s),u=await Ja(o,this.stepSelections),c=l.map(R=>R.silentSteps).flat(),d=u.map(R=>R.silentSteps).flat().filter(R=>!c.some(B=>B.stepName===R.stepName));for(const R of c)await co(R,this.stepSelections)||(this.stepInitialised[R.stepName]=!1);const h=await this.getInvalidCanvasRegions(),{stepElements:g,commands:v}=await this.stepElementsForIntroducedSilentSteps(d,!1);this.stepElements={...this.stepElements,...g,[e]:n},this.removeElements(h);const y=a.steps.find(R=>R.stepName===e);y?.type===Xe.Frame&&this.getWorkflowExperience().getStepById(y.stepName)?.frameService?.setTargetElements(n.map(B=>B.id));const A=h.map(R=>new Ol(R.id)),C=new OS(this.constructSerializableWorkflow()),S=[...v,...A,C];S.length>0&&this.commandContext.apply(new On(S),!0),await this.ensureStepsAreLoaded(),this.onElementsChange();const F=await this.getInvalidModelVariants(),E=this.modelContainer;if(E){const R=F.map(B=>E.applyModelVariant(B,{contextService:this.getLayoutPreviewService()},!1));await Promise.all(R)}await this.onSelectionChange(),await this.reapplyMaterialSteps(),y?.type!==Xe.Frame&&y?.type!==Xe.Text&&this.setMandatoryFulfilled(e,!0),i&&await i()}async ensureStepsAreLoaded(){const t=(await Ja(this.allScenes,this.stepSelections)).map(l=>l.renderableSteps),n=[],i=t.flat();for(const l of i)if(!this.stepInitialised[l.stepName])switch(this.stepInitialised[l.stepName]=!0,l.type){case Xe.DigitalContent:n.push(T1.init(l,this,this.reloadedState));break;case Xe.Frame:n.push(so.init(l,this,this.reloadedState));break;case Xe.Illustration:n.push(Jd.init(l,this,this.reloadedState));break;case Xe.Material:n.push(F1.init(l,this,this.reloadedState));break;case Xe.Model:n.push(I1.init(l,this,this.reloadedState));break;case Xe.Module:this.stepSpecificServices[l.stepName]={module:await sI(l.data.module)},n.push(P1.init(l,this,this.reloadedState));break;case Xe.Picture:n.push(D1.init(l,this,this.reloadedState));break;case Xe.Question:n.push(R1.init(l,this,this.reloadedState));break;case Xe.Shape:n.push(Nu.init(l,this,this.reloadedState));break;case Xe.Text:n.push(ri.init(l,this,this.reloadedState));break}const a=(await Promise.allSettled(n)).map(l=>{if(l.status==="rejected")throw new Error(`Step initialization failed: ${l.reason}`);return l.value}),s=a.flatMap(l=>l?.command?[l.command]:[]),o=a.flatMap(l=>l?.followup?[l.followup]:[]);s&&s.length>0&&this.commandContext.apply(new On(s),!0);for(const l of o)await l();o.length>0&&await this.ensureStepsAreLoaded(),this.onInitChange()}onConfirmChange(){this.confirmCallbacks.forEach(e=>e(this.confirmedDesign))}onEditedChange(){this.editedCallbacks.forEach(e=>e(this.editedSteps))}onElementsChange(){this.elementsCallbacks.forEach(e=>e(this.stepElements))}onInformationResultChange(){this.informationResultCallbacks.forEach(e=>e(this.informationResults))}onInitChange(){this.initCallbacks.forEach(e=>e(this.stepInitialised))}onMakingAdjustmentsChange(){this.makingAdjustmentsCallback.forEach(e=>{e(this.currentAdjustingStepId)})}onMandatoryChange(){this.mandatoryCallbacks.forEach(e=>e(this.mandatorySteps))}onMetadataChange(){this.metadataCallbacks.forEach(e=>{e(this.stepMetadata)})}async onSelectionChange(){const e=await this.traversableScenes();for(const t of this.selectionCallbacks)t({selectionCost:this.selectionCost,selections:this.stepSelections,traversableScenes:e})}onStepSpecificStorageChange(e){Object.keys(this.stepSpecificStorageCallbacks).includes(e)||(this.stepSpecificStorageCallbacks[e]=[]),this.stepSpecificStorageCallbacks[e].forEach(t=>t(this.storage[e]))}onStorageChange(){this.storageCallbacks.forEach(e=>e(this.storage))}onValidationChange(){this.validationCallbacks.forEach(e=>e(this.validationErrors))}traversableScenes(){return F_(this.allScenes,this.stepSelections,this.singleVariantsRenderable)}async reapplyMaterialSteps(){if(!this.modelContainer)return;const t=(await Ja(this.allScenes,this.stepSelections)).flatMap(n=>n.renderableSteps).filter(n=>n.type===Xe.Material);for(const n of t){const i=this.stepSelections[n.stepName]?.selectedVariants;if(!i||i.length===0)continue;const s=i[0].material;if(!s||!n.option?.id)continue;n.data.targetMaterials.forEach(l=>{this.modelContainer?.applyMaterialVariant(l,n.option.id,s)})}}};af.configurationPromiseMap=new Map;let dA=af;class Fa{constructor(e){this.variantData=e}getType(){return this.variantData.asset?.type}getId(){return this.variantData.id}getName(){return this.variantData.name}getPriceFormatted(e,t){return this.variantData.priceModifier.toLocaleString(e||"en-US",{style:"currency",currency:"USD",...t})}getPrice(){return this.variantData.priceModifier}getAsset(){return this.variantData.asset?.fileLink}getAssetResource(){return this.variantData.asset}getThumbnail(e=256,t){const n=this.variantData.thumbnail;if(!(!n||!n.fileLink))return $g(n,e,"webp",t)}getColor(){return this.variantData.color}isDefault(){return!!this.variantData.default}getResource(){return this.variantData}isEnabled(){return this.variantData.enabled}getCategory(){return this.variantData.category}getProduct(){return this.variantData.product}}const sf=class sf{constructor(e,t,n){this.manager=e,this.step=t,this.tags=n}setUpdateState(e){sf.updateState.set(`${this.step.stepName}-${this.manager.getWorkflowExperience().getTransaction().id}`,e)}getUpdateState(){return!!sf.updateState.get(`${this.step.stepName}-${this.manager.getWorkflowExperience().getTransaction().id}`)}getCurrentVariant(){const n=this.manager.getWorkflowSelections()[this.step.stepName]?.selections[0];if(n)return new Fa(n)}async getAvailableVariants(){return(await this.getAllVariants()).filter(t=>t.isEnabled())||[]}async getAllVariants(){if(!this.step.option?.id)return[];if(this.step.option.variants)return(this.step.option.variants||[]).map(t=>new Fa(t))||[];const e=await ct.getOption(this.step.option?.id);if(!e)throw new Error("Option not found, cannot fetch variants.");return(e.variants||[]).map(t=>new Fa(t))||[]}getId(){return this.step.stepName}getName(){return this.step.stepTitle}getHelpText(){return this.step.helpText}getType(){return this.step.type}getRaw(){return this.step}getTags(){return this.tags}hasTag(e){return this.tags.includes(e)||!1}getMandatory(){return this.step.mandatory||!1}getOverrideGlobalPropertyConfiguration(e){return(this.manager.getStepStorage(this.step.stepName)?.overrideGlobalConfigurations??{})[e.toString()]??!1}setOverrideGlobalPropertyConfiguration(e,t){const n=this.manager.getStepStorage(this.step.stepName)?.overrideGlobalConfigurations??{};this.manager.updateStorage(this.step.stepName,{overrideGlobalConfigurations:{...n,[e.toString()]:t}})}getGlobalPropertyAspects(e){return this.step.globalPropertyAspectConfigurations?.filter(t=>t.globalPropertyConfigurationId===e&&t.aspectName).map(t=>t.aspectName)??[]}executeAnimations(e){const t=this.manager.getPreviewService(),n=this.manager.getModelContainer(),i=this.step.data.modelAnimation,a=this.step.data.lookAtAnimation;t?a&&t.executeCameraAnimation(a):console.warn("No preview service available, cannot execute camera animations."),n?i&&n.executeAnimation(i,e):console.warn("No model container available, cannot execute model animations.")}};sf.updateState=new Map;let Ui=sf;class fI extends Ui{constructor(e,t,n){super(e,t,n)}async selectVariant(e){if(!this.getUpdateState()&&this.getCurrentVariant()!==e)return Jd.selectVariant(this.step,e.getResource(),this.manager.getRegionElements(this.step.stepName)||[],t=>this.setUpdateState(t),this.manager)}getColors(){const e=this.manager.getRegionElements(this.step.stepName)||[];if(e.length===0)return;const n=Un(e[0].id,this.manager.getAllLayoutData()).colors,a=this.getCurrentVariant()?.getAssetResource()?.assetConfiguration,s=a?.defaultColorVariants||[];if(s.length!==0){const o={};return s.forEach(l=>{const u=a.channelNumbers.find(c=>c.number===l.channelNumber);if(u){const c=u.id.replace(/\W/g,"");o[l.channelNumber]={browserValue:n[c]?.browserValue||""}}}),o}try{return n}catch(o){console.error(o)}}setColor(e,t,n){const i=new Map,s=this.getCurrentVariant()?.getAssetResource()?.assetConfiguration;return(s?.defaultColorVariants||[]).length!==0?s.channelNumbers.forEach(l=>{if(l.number.toString()===e){const u=l.id.replace(/\W/g,"");n?i.set(u,{browserValue:t,pmsValue:n}):i.set(u,t)}}):n?i.set(e,{browserValue:t,pmsValue:n}):i.set(e,t),Jd.changeColors(this.step,this.manager.getRegionElements(this.step.stepName),this.manager,i)}async getColorOption(){return await ct.ensureFullOption(this.step.data.colorOption)}getAvailableColors(){return this.step.data.colorPickerEnabled?Jd.availableColors(this.step,this.manager):Promise.resolve([])}isColorPickerEnabled(){return this.step.data.colorPickerEnabled??!1}isPMSPickerEnabled(){return this.step.data.pmsPickerEnabled??!1}isVariantSearchEnabled(){return this.step.data.enableVariantSearch??!1}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}class hI extends Ui{constructor(e,t,n){super(e,t,n)}selectVariant(e){return F1.selectVariant(this.step,e.getResource(),this.manager,t=>this.setUpdateState(t))}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}class pI extends Ui{constructor(e,t,n){super(e,t,n)}selectVariant(e){return I1.selectVariant(this.step,e.getResource(),this.manager,t=>this.setUpdateState(t))}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}class gI extends Ui{constructor(e,t,n){super(e,t,n)}selectVariant(e){return D1.selectVariant(this.step,e.getResource(),this.manager,t=>this.setUpdateState(t))}isVariantSearchEnabled(){return this.step.data.enableVariantSearch??!1}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}class mI extends Ui{constructor(e,t,n){super(e,t,n)}async selectVariant(e){if(!e.getId())throw new Error("Unable to select variant with a null ID");await R1.selectVariant(this.step,e.getId(),this.manager)}async getDisplayType(){return this.step.data.displayType?this.step.data.displayType:(await ct.getOptionForStep(this.step))?.displayType}}class vI extends Ui{constructor(e,t,n){super(e,t,n)}selectVariant(e){const t=e.getResource();return Nu.selectVariant(this.step,{fill:t.color,stroke:t.color,variant:t},this.manager.getRegionElements(this.step.stepName)||[],this.manager)}setColor(e){return Nu.selectVariant(this.step,e,this.manager.getRegionElements(this.step.stepName)||[],this.manager)}getColors(){return Nu.availableColours(this.step)}setCustomColor(e){return this.getCurrentVariant()?.getColor()!=="#custom"&&console.warn(`setting custom color for step ${this.step.stepName} but color is ${this.getCurrentVariant()?.getColor()}`),Nu.setCustomColor(e,this.step,this.manager)}getCustomColor(){this.getCurrentVariant()?.getColor()!=="#custom"&&console.warn(`setting custom color for step ${this.step.stepName} but color is ${this.getCurrentVariant()?.getColor()}`);const e=this.manager.getStepStorage(this.step.stepName)?.colour;if(!e)throw new Error(`Color not available on step ${this.step.stepName}. Set a default on the workflow to fix this.`);return e}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}class yI extends Ui{constructor(e,t,n){super(e,t,n)}async selectVariant(e){await ri.selectVariant(this.step,e.getResource(),this.manager,t=>{if(t)this.manager.setInformationResults([...this.manager.getInformationResults(),{message:t,messageType:Jf.Error,stepID:this.step.stepName}]);else{const n=this.manager.getInformationResults().filter(i=>i.stepID!==this.step.stepName);this.manager.setInformationResults(n)}},()=>{})}async getAvailableFillColors(){return this.step.data.colorPickerEnabled?ri.availableFillColors(this.step):[]}async setFillColor(e){const t=this.manager.getRegionElements(this.step.stepName);await ri.changeFillColor(this.step,e,t,this.manager)}getFillColor(){return this.manager.getStepStorage(this.step.stepName)?.color||"#000000"}getAvailableFillImages(){return ri.availableFillImages(this.step)}async setFillImage(e){const t=this.manager.getRegionElements(this.step.stepName);await ri.changeFillImage(this.step,e,t,this.manager)}getFillImage(){return this.manager.getStepStorage(this.step.stepName)?.fillImage}getAlignment(){return ri.findLayoutElements(this.manager,this.step)?.[0].align}setAlignment(e){const t=this.manager.getRegionElements(this.step.stepName);ri.changeAlignment(this.step,e,t,this.manager)}setFullTextCustomization(e){const t=this.manager.getStepStorage(this.step.stepName)?.inputText||"",n=this.step.data.replaceableText!==void 0?this.step.data.replaceableText.replace("{{}}",t):t,i=e?n:this.step.data.defaultText;return this.manager.updateStorage(this.step.stepName,{customiseAllText:e,text:i,defaultCleared:!1}),this.setText(i)}setText(e){const t={input:e,helperData:{}},n=ri.findLayoutElements(this.manager,this.step),i=ri.filterUnsupportedCharacters(e,n[0]?.fontData),a=ju(i,this.manager).length,s=!!this.step.data&&!!this.step.data.maxLength&&a>this.step.data.maxLength;s||(t.input=i);const o=n.length<=0,l=o?{inputText:i,text:i}:{inputText:i};this.manager.updateStorage(this.step.stepName,l);const u=this.manager.getStepStorage(this.step.stepName),c=ri.getProcessedInput(i,this.step.data,u?.customiseAllText??!1);if(o)s||this.manager.updateMetadata(this.step.stepName,{text:c});else{const{command:f,errorData:d,helperData:h}=ri.updateInputText(i,n,this.step,this.manager);f&&this.manager.getCommandDispatcher()(f),t.helperData=h,t.errorData=d,!s&&!d&&this.manager.updateMetadata(this.step.stepName,{text:c})}return t}getText(){const e=this.step.data.defaultText,t=this.manager.getStepStorage(this.step.stepName);return e&&t?.defaultCleared!==void 0&&!t?.defaultCleared?e:this.manager.getStepStorage(this.step.stepName)?.text||""}isReplaceable(){return this.step.data.userCanReplaceText}newLinesSupported(){return this.step.data.allowNewlines||!1}clearDefaultTextIfNecessary(){if(!this.manager.getStepStorage(this.step.stepName)?.defaultCleared&&this.step.data.deleteDefaultOnFocus){const t=this.setText("");this.manager.updateStorage(this.step.stepName,{defaultCleared:!0,inputText:""});const n=ri.findLayoutElements(this.manager,this.step);return ri.updateInputText("",n,this.step,this.manager),t}}hasColorPicker(){return this.step.data.colorPickerEnabled}getRegions(){return this.step.data.regions}getCharacterLimit(){return this.step.data.maxLength}getCharactersRemaining(){const e=this.step.data.maxLength;if(e===void 0)return;const t=ju(this.getText(),this.manager);return e-t.length}setCustomColor(e){this.getFillColor()!=="#custom"&&console.warn(`setting custom color for text step ${this.step.stepName} but current fill is not #custom`);const t=this.manager.getRegionElements(this.step.stepName);ri.applyCustomFillColor(this.step,e,t,this.manager)}getCustomColor(){return this.manager.getStepStorage(this.step.stepName)?.customColor||"#000000"}async getAvailableStrokeColors(){return this.step.data.strokeEnabled?ri.availableStrokeColors(this.step):[]}getStrokeColor(){return this.manager.getStepStorage(this.step.stepName)?.strokeColor?.browserValue||"#000000"}async setStrokeColor(e){const t=this.manager.getRegionElements(this.step.stepName);await ri.changeStrokeColor(this.step,e,t,this.manager)}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}class AI extends Ui{constructor(e,t,n){super(e,t,n)}async selectVariant(){}getContent(){return this.step.data.content}}class bI extends Ui{constructor(e,t,n){super(e,t,n)}async selectVariant(){}getPreviewURL(){return this.manager.getStepStorage(this.step.stepName)?.videoUrl||""}async selectVideo(e){return T1.regenerateQRCode(this.manager.getRegionElements(this.step.stepName),e.key,this.manager,this.step)}}class wI extends Ui{constructor(e,t,n){super(e,t,n)}async selectVariant(){console.info("Text Modules don't support variants.")}getCharactersRemaining(){const e=this.step.data.maxLength;if(e===void 0)return;const t=ju(this.getText(),this.manager);return e-t.length}getCharacterLimit(){return this.step.data.maxLength}getText(){return this.manager.getStepStorage(this.step.stepName)?.text||""}setText(e){P1.changeText(this.step,e,this.manager,t=>{if(t){const n=[...this.manager.getInformationResults(),{message:t,messageType:Jf.Error,stepID:this.step.stepName}];this.manager.setInformationResults(n)}else{const n=this.manager.getInformationResults().filter(i=>i.stepID!==this.step.stepName);this.manager.setInformationResults(n)}})}}class CI extends Ui{constructor(e,t,n){super(e,t,n)}async selectVariant(){}async getAvailableVariants(){const e=await super.getAvailableVariants();if(!this.cachedProductIds){this.cachedProductIds=new Set;for(const t of e){const n=t.getProduct();n?.id&&this.cachedProductIds.add(n.id)}}return e}isPersonalisable(e){const t=e.getProduct();return!!t?.workflows&&t.workflows.length>0}async addProduct(e){const t=this.manager.getWorkflowExperience().getBundle();if(!t)throw new Error("Product step requires bundle context");const n=e.getProduct();if(!n)throw new Error("Variant has no product. Ensure the option query includes the product field on variants.");if(!this.isPersonalisable(e)){await this.incrementNonPersonalisable(e);return}const i=this.manager.getWorkflowExperience().getTransaction(),a=i.integrationProduct?.integration?.id;let s;if(a&&n.integrationProducts&&(s=n.integrationProducts.find(d=>d.integration?.id===a)?.id),!s)throw new Error("No integration product found for bundle context");const o=this.manager.getClient(),l=n?.workflows||[];let u;if(l.length===1)u=l[0].id;else if(l.length>1){const f=this.step.data.workflows,d=l.find(h=>f.includes(h.id));if(d)u=d.id;else throw new Error("Multiple workflows available but none match step configuration")}const c=await o.getWorkflowExperience({type:"integration",integrationProductId:s,workflowId:u,parentTransactionId:i.id});await t.addWorkflowExperience(c)}async incrementNonPersonalisable(e){const t=this.manager.getWorkflowExperience().getBundle();if(!t)return;const n=e.getProduct(),i=this.findExperienceForProduct(n.id);if(i){const c=i.getTransaction().quantity||1;await i.setQuantity(c+1);return}const a=this.manager.getWorkflowExperience().getTransaction(),s=a.integrationProduct?.integration?.id;let o;if(s&&n.integrationProducts&&(o=n.integrationProducts.find(f=>f.integration?.id===s)?.id),!o)throw new Error("No integration product found for bundle context");const u=await this.manager.getClient().getWorkflowExperience({type:"integration",integrationProductId:o,parentTransactionId:a.id});await t.addWorkflowExperience(u)}async removeProduct(e){const t=this.manager.getWorkflowExperience().getBundle();if(!t)throw new Error("Product step requires bundle context");const i=t.getWorkflowExperiences().find(o=>o.getTransaction().id===e);if(!i)throw new Error("Transaction is not a child of this product step");const a=i.getTransaction(),s=a.quantity||1;if(s>1){await i.setQuantity(s-1);return}await t.removeWorkflowExperienceByTransaction(a)}isCategoryFilterEnabled(){return this.step.data.categoryFilterEnabled??!1}isSearchBarEnabled(){return this.step.data.searchBarEnabled??!1}getMin(){return this.step.data.min}getMax(){return this.step.data.max}getPricing(){return this.step.data.pricing}getWorkflows(){return this.step.data.workflows||[]}getChildTransactions(){const e=this.manager.getWorkflowExperience().getBundle();if(!e)return[];const t=this.manager.getWorkflowExperience().getTransaction().id,n=e.getWorkflowExperiences(),i=this.getStepProductIds();return n.map(a=>a.getTransaction()).filter(a=>a.parentTransaction?.id!==t||i.size===0?!1:a.product?.id?i.has(a.product.id):!1)}getStepProductIds(){if(this.cachedProductIds&&this.cachedProductIds.size>0)return this.cachedProductIds;const e=this.step.option?.variants||[],t=new Set;for(const n of e)n.product?.id&&t.add(n.product.id);return t}getLockedAddOns(){return this.step.data.lockedAddOns||[]}findExperienceForProduct(e){const t=this.manager.getWorkflowExperience().getBundle();if(!t)return;const n=this.manager.getWorkflowExperience().getTransaction().id,i=this.getStepProductIds();return t.getWorkflowExperiences().find(a=>{const s=a.getTransaction();return s.parentTransaction?.id!==n||i.size>0&&!i.has(e)?!1:s.product?.id===e})}}class Ep{static get(e,t){switch(t.type){case Xe.DigitalContent:return new bI(e,t,e.getStepTags(t.stepName));case Xe.Information:return new AI(e,t,e.getStepTags(t.stepName));case Xe.Question:return new mI(e,t,e.getStepTags(t.stepName));case Xe.Text:return new yI(e,t,e.getStepTags(t.stepName));case Xe.Illustration:return new fI(e,t,e.getStepTags(t.stepName));case Xe.Picture:return new gI(e,t,e.getStepTags(t.stepName));case Xe.Shape:return new vI(e,t,e.getStepTags(t.stepName));case Xe.Material:return new hI(e,t,e.getStepTags(t.stepName));case Xe.Model:return new pI(e,t,e.getStepTags(t.stepName));case Xe.Frame:return new GP(e,t,e.getStepTags(t.stepName));case Xe.Module:return new wI(e,t,e.getStepTags(t.stepName));case Xe.Product:return new CI(e,t,e.getStepTags(t.stepName));default:throw new nn(`Step type ${t.type} not yet supported in Core SDK`)}}}var Pv,SE;function F9(){if(SE)return Pv;SE=1;var r=1/0,e=9007199254740991,t=17976931348623157e292,n=NaN,i="[object Function]",a="[object GeneratorFunction]",s="[object Symbol]",o=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=/^(?:0|[1-9]\d*)$/,d=parseInt,h=Object.prototype,g=h.toString,v=Math.ceil,y=Math.max;function A(oe,he,ye){var Ue=-1,Re=oe.length;he<0&&(he=-he>Re?0:Re+he),ye=ye>Re?Re:ye,ye<0&&(ye+=Re),Re=he>ye?0:ye-he>>>0,he>>>=0;for(var Oe=Array(Re);++Ue<Re;)Oe[Ue]=oe[Ue+he];return Oe}function C(oe,he){return he=he??e,!!he&&(typeof oe=="number"||f.test(oe))&&oe>-1&&oe%1==0&&oe<he}function S(oe,he,ye){if(!G(ye))return!1;var Ue=typeof he;return(Ue=="number"?R(ye)&&C(he,ye.length):Ue=="string"&&he in ye)?E(ye[he],oe):!1}function F(oe,he,ye){(ye?S(oe,he,ye):he===void 0)?he=1:he=y(J(he),0);var Ue=oe?oe.length:0;if(!Ue||he<1)return[];for(var Re=0,Oe=0,ee=Array(v(Ue/he));Re<Ue;)ee[Oe++]=A(oe,Re,Re+=he);return ee}function E(oe,he){return oe===he||oe!==oe&&he!==he}function R(oe){return oe!=null&&j(oe.length)&&!B(oe)}function B(oe){var he=G(oe)?g.call(oe):"";return he==i||he==a}function j(oe){return typeof oe=="number"&&oe>-1&&oe%1==0&&oe<=e}function G(oe){var he=typeof oe;return!!oe&&(he=="object"||he=="function")}function ie(oe){return!!oe&&typeof oe=="object"}function q(oe){return typeof oe=="symbol"||ie(oe)&&g.call(oe)==s}function Y(oe){if(!oe)return oe===0?oe:0;if(oe=ae(oe),oe===r||oe===-r){var he=oe<0?-1:1;return he*t}return oe===oe?oe:0}function J(oe){var he=Y(oe),ye=he%1;return he===he?ye?he-ye:he:0}function ae(oe){if(typeof oe=="number")return oe;if(q(oe))return n;if(G(oe)){var he=typeof oe.valueOf=="function"?oe.valueOf():oe;oe=G(he)?he+"":he}if(typeof oe!="string")return oe===0?oe:+oe;oe=oe.replace(o,"");var ye=u.test(oe);return ye||c.test(oe)?d(oe.slice(2),ye?2:8):l.test(oe)?n:+oe}return Pv=F,Pv}var I9=F9();const fA=Ns(I9),P9=Se`
|
|
2655
|
+
`,x9=(r,e)=>e&&typeof e=="object"&&!Array.isArray(e)?Object.keys(e).sort().reduce((t,n)=>(t[n]=e[n],t),{}):e,S9=r=>{for(const e of Object.values(r.layouts).map(t=>t.elements).flat())e.type==="illustration"&&(delete e.cachedObjectURL,e.src&&delete e.svg),e.type==="frame"&&delete e.pattern?.svg;return dI(r,"__typename"),r},dI=(r,e)=>{if(!(typeof r!="object"||r===null))for(const t in r)t===e?delete r[t]:dI(r[t],e)};var Jf=(r=>(r.Error="Error",r.Warning="Warning",r.Info="Info",r))(Jf||{});const E9=1e3;class xE extends jg{constructor(e){super(),this.update=e}async execute(){await this.update(),await new Promise(e=>{window.setTimeout(()=>{e()},E9)})}}const k9=r=>r.sort((e,t)=>e.index-t.index).map(e=>({id:Ar(),panelId:e.name,name:e.name,title:e.title,index:e.index,createdAt:new Date,updatedAt:new Date,transparentBackground:e.transparentBackground,height:e.height,width:e.width,previewRegion:e.previewRegion,useEditableArea:e.useEditableArea,editableArea:e.editableArea})),T9=(r,e)=>{const t=r.workflowState,n=t?JSON.parse(t):void 0;return n?Object.values(n.layouts).map(i=>i.layout):k9(e.panels)},af=class af{constructor(e,t,n,i,a,s=!1,o,l=!1,u=!1,c=!1){this.workflowStatePromiseQueue=new Gg(1),this.initialized=!1,this.readOnly=!1,this.isReloadedTransaction=!1,this.singleVariantsRenderable=!1,this.stepTags={},this.setWorkflow=async d=>{this.confirmedDesign=!1,this.editedSteps={},this.informationResults=[],this.mandatorySteps={},this.pendingUpdates=[],this.selectionCost=0,this.stepSpecificServices={},this.pollers=[],this.allScenes=[],this.stepElements={},this.stepInitialised={},this.stepMetadata={},this.stepSelections={},this.storage={},this.validationErrors={steps:new Map},this.currentAdjustingStepId="",this.reloadedState?this.layouts=Object.values(this.reloadedState.layouts||{}).map(g=>g.layout):d?this.layouts=T9(this.experience.getTransaction(),d):this.layouts=[],this.commandContext.initialize(this.layouts,this.reloadedState),this.renderableContextService=new _U(this.layouts),this.renderableContextService.setWorkflowManager(this),d.steps.forEach(g=>{this.stepTags[g.stepName]=g.tags??[]});const h=this.previewService;this.ejectFromPreviewService(),this.initializationPromise=this.initializeDefaultWorkflowState(d),this.initializationPromise.then(()=>{this.initialized=!0}),this.initializationPromise.catch(g=>{throw this.initialized=!1,new Error(g)}),this.initializationPromise.finally(()=>this.commandContext.registerStateCallback(()=>{this.updateStateWithServer(),this.renderLayouts()})),h&&await this.injectIntoPreviewService(h,!0)},this.renderLayouts=()=>{if(!this.previewService)return;const d=this.getCommandContext().getAllLayouts(),h=this.getLayoutPreviewService()?.getAll();if(h)for(const[,g]of h)g.render(d)},this.experience=e,this.client=t,this.updateTransaction=n,this.graphQlClient=i,this.reloadedState=a,this.readOnly=s,this.singleVariantsRenderable=u,this.commandContext=new jF,this.confirmCallbacks=[],this.editedCallbacks=[],this.elementsCallbacks=[],this.informationResultCallbacks=[],this.initCallbacks=[],this.mandatoryCallbacks=[],this.makingAdjustmentsCallback=[],this.metadataCallbacks=[],this.selectionCallbacks=[],this.stepSpecificStorageCallbacks={},this.storageCallbacks=[],this.validationCallbacks=[],this.recipientCallbacks=[],this.modelContainer=o,this.confirmedDesign=!1,this.editedSteps={},this.informationResults=[],this.mandatorySteps={},this.pendingUpdates=[],this.selectionCost=0,this.stepSpecificServices={},this.pollers=[],this.allScenes=[],this.stepElements={},this.stepInitialised={},this.stepMetadata={},this.stepSelections={},this.storage={},this.validationErrors={steps:new Map},this.currentAdjustingStepId="",this.isReloadedTransaction=l,c&&(this.workflowStatePromiseQueue.enabled=!1);const f=this.experience.getWorkflow();f&&this.setWorkflow(f)}getTemplatingContext(){const e=this.experience.getTransaction().recipient,t={recipient:e};return this.recipientConversionConfiguration?.requestedDataItems?.forEach(n=>{const i=n.uniqueIdentifier??n.title??"";n.type===Qd.FirstName?t[i]=e?.firstName:n.type===Qd.LastName?t[i]=e?.lastName:n.type===Qd.Custom&&(n.customFieldIndex===1?t[i]=e?.customField1:n.customFieldIndex===2?t[i]=e?.customField2:n.customFieldIndex===3?t[i]=e?.customField3:n.customFieldIndex===4?t[i]=e?.customField4:n.customFieldIndex===5&&(t[i]=e?.customField5),n.option&&(t[i]=n.option.variants?.find(a=>a.id===t[i])?.name))}),t}async updateRecipient(e,t,n,i,a,s,o,l,u,c,f,d,h,g,v,y,A,C){const S=this.experience.getTransaction();if(S.recipient?.id)this.experience.getTransaction().recipient={id:S.recipient.id,firstName:e??S.recipient.firstName,lastName:t??S.recipient.lastName,address:n??S.recipient.address,suburb:i??S.recipient.suburb,state:a??S.recipient.state,email:s??S.recipient.email,postalCode:o??S.recipient.postalCode,country:l??S.recipient.country,mobile:u??S.recipient.mobile,company:c??S.recipient.company,apartment:f??S.recipient.apartment,customField1:d??S.recipient.customField1,customField2:h??S.recipient.customField2,customField3:g??S.recipient.customField3,customField4:v??S.recipient.customField4,customField5:y??S.recipient.customField5,conversionConfigurationId:A||S.recipient.conversionConfigurationId},this.experience.callEvent(yg.RecipientChanged),await this.graphQlClient().mutate({mutation:y9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:S.recipient.id,firstName:e||S.recipient.firstName,lastName:t||S.recipient.lastName,address:n||S.recipient.address,suburb:i||S.recipient.suburb,state:a||S.recipient.state,email:s||S.recipient.email,postalCode:o||S.recipient.postalCode,country:l||S.recipient.country,mobile:u||S.recipient.mobile,company:c||S.recipient.company,apartment:f||S.recipient.apartment,customField1:d||S.recipient.customField1,customField2:h||S.recipient.customField2,customField3:g||S.recipient.customField3,customField4:v||S.recipient.customField4,customField5:y||S.recipient.customField5,conversionConfigurationId:A||S.recipient.conversionConfigurationId,prevalidated:C}});else{const F=await this.graphQlClient().mutate({mutation:v9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{firstName:e,lastName:t,address:n,suburb:i,state:a,email:s,postalCode:o,country:l,mobile:u,company:c,apartment:f,customField1:d,customField2:h,customField3:g,customField4:v,customField5:y,conversionConfigurationId:A}});S.recipient={id:F?.data?.recipientCreate?.id,firstName:e,lastName:t,address:n,suburb:i,state:a,email:s,postalCode:o,country:l,mobile:u,company:c,apartment:f,customField1:d,customField2:h,customField3:g,customField4:v,customField5:y,conversionConfigurationId:A},this.experience.callEvent(yg.RecipientChanged),await this.graphQlClient().mutate({mutation:A9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:this.experience.getTransaction().id,recipientId:F.data?.recipientCreate?.id},context:{transactionOwnerId:this.experience.getTransaction().transactionOwnerId}})}await this.fetchConversionConfiguration(),this.recipientCallbacks.forEach(F=>F(this.experience.getTransaction().recipient))}async fetchConversionConfiguration(){const e=this.experience.getTransaction().recipient;if(e?.conversionConfigurationId&&!this.recipientConversionConfiguration){const t=af.configurationPromiseMap.get(e.conversionConfigurationId);if(t)this.recipientConversionConfiguration=await t;else{const i=(async()=>(await this.graphQlClient().query({query:R3,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:e.conversionConfigurationId}})).data.conversionConfiguration)();af.configurationPromiseMap.set(e.conversionConfigurationId,i),this.recipientConversionConfiguration=await i}}}async initializeDefaultWorkflowState(e){const t=()=>{const c=e.finalizeStepConfig;if(!c)return;const f=c.lookAtAnimation,d=c.modelAnimation;f&&this.previewService?.executeCameraAnimation(f),d&&this.modelContainer?.executeAnimation(d)};this.reloadedState&&this.reloadedState.serializableWorkflow.steps.forEach(c=>{this.storage[c.stepName]=c.storage||{}});const n=await this.getInitialOptionIds(this.reloadedState?.serializableWorkflow?.steps.reduce((c,f)=>(f.selectedVariants?.length&&(c[f.stepName]={selectedVariants:f.selectedVariants.map(d=>({id:d.id}))}),c),{})),i=ct.getOptions(Array.from(n)),a=this.fetchConversionConfiguration();await Promise.all([i,a]),this.allScenes=YC(e);const o=(await Ja(this.allScenes,this.stepSelections)).map(c=>c.silentSteps).flat(),{stepElements:l,commands:u}=await this.stepElementsForIntroducedSilentSteps(o,!!this.reloadedState);this.commandContext.apply(new On(u),!0),this.stepElements={...this.stepElements,...l},await this.ensureStepsAreLoaded(),this.isReloadedTransaction||this.updateStateWithServer(),this.renderLayouts(),this.reloadedState&&t()}getWorkflowExperience(){return this.experience}getClient(){return this.client}setWorkflowStateSyncEnabled(e){this.workflowStatePromiseQueue.enabled=e}getInitializationPromise(){return this.initializationPromise}isInitialized(){return this.initialized}async getInitialOptionIds(e){const t=new Set,n=this.experience.getWorkflow();if(!n)return t;const i=YC(n),a={...e};let s=-1;for(;;){const u=(await Ja(i,a)).flatMap(c=>c.renderableSteps);if(u.length===s)break;s=u.length;for(const c of u){if(a[c.stepName])continue;const f=c.option?.defaultVariant?.id;f&&(a[c.stepName]={selectedVariants:[{id:f}]})}}return(await Ja(i,a)).flatMap(l=>l.renderableSteps).forEach(l=>{l.option?.id&&!l.option?.variants&&t.add(l.option.id)}),t}addConfirmCallback(e){e(this.confirmedDesign),this.confirmCallbacks.push(e)}addEditedCallback(e){e(this.editedSteps),this.editedCallbacks.push(e)}addElementsCallback(e){e(this.stepElements),this.elementsCallbacks.push(e)}addInformationResultCallback(e){e(this.informationResults),this.informationResultCallbacks.push(e)}addInitCallback(e){e(this.stepInitialised),this.initCallbacks.push(e)}addMandatoryCallback(e){e(this.mandatorySteps),this.mandatoryCallbacks.push(e)}addMetadataCallback(e){e(this.stepMetadata),this.metadataCallbacks.push(e)}async addSelectionCallback(e){e({selectionCost:this.selectionCost,selections:this.stepSelections,traversableScenes:await this.traversableScenes()}),this.selectionCallbacks.push(e)}addStepSpecificStorageCallback(e,t){Object.keys(this.storage).includes(t)||(this.storage[t]={}),e(this.storage[t]),Object.keys(this.stepSpecificStorageCallbacks).includes(t)||(this.stepSpecificStorageCallbacks[t]=[]),this.stepSpecificStorageCallbacks[t].push(e)}addStorageCallback(e){e(this.storage),this.storageCallbacks.push(e)}addMakingAdjustmentsCallback(e){e(this.currentAdjustingStepId),this.makingAdjustmentsCallback.push(e)}addPoller(e){this.pollers.push(e)}addValidationCallback(e){this.validationCallbacks.push(e),e(this.validationErrors)}addRecipientCallback(e){this.recipientCallbacks.push(e),e(this.experience.getTransaction().recipient)}removeRecipientCallback(e){this.recipientCallbacks=this.recipientCallbacks.filter(t=>t!==e)}getLayouts(){return this.layouts}getAllLayoutData(){return this.commandContext.getAllLayouts().map(e=>e.layoutState)}getLayoutPreviewService(){return this.renderableContextService}getInformationResults(){return this.informationResults}getPreviewService(){return this.previewService}getCommandContext(){return this.commandContext}getRegionElements(e){return this.stepElements[e]||[]}getStepSpecificServices(e){return this.stepSpecificServices[e]}getTransactionCustomer(){return this.ownerCustomer}setTransactionCustomer(e){this.ownerCustomer=e}setTransactionCustomerDetails(e){this.ownerCustomer={...this.ownerCustomer,emailAddress:e.email}}getModelContainer(){return this.modelContainer}setModelContainer(e){(!e||this.previewService&&this.previewService.getAllModels().includes(e))&&(this.modelContainer=e,e&&e.metadata&&e.metadata instanceof Map&&this.modelContainer.metadata.set("workflowManager",this))}getCommandDispatcher(){return e=>this.commandContext.apply(e,!this.initialized)}getWorkflowSelections(){const e={};return this.experience.getWorkflow()?.steps.forEach(t=>{const n=this.stepSelections[t.stepName];n&&n.selectedVariants&&n.selectedVariants.length>0&&(e[t.stepName]={selections:n.selectedVariants})}),e}getStepSelections(){return this.stepSelections}markStepsAsInitialised(e){const t={...this.stepInitialised};e.forEach(n=>{t[n]=!0}),this.stepInitialised=t,this.onInitChange()}getUpdatesPending(){return this.pendingUpdates.length>0}markUpdateCompleted(e){this.pendingUpdates=this.pendingUpdates.filter(t=>t!==e)}markUpdatePending(){const e=Ar();return this.pendingUpdates=[...this.pendingUpdates,e],e}setEditedStatus(e,t){this.editedSteps={...this.editedSteps,[e]:t},this.onEditedChange()}setInformationResults(e){this.informationResults=[...e],this.onInformationResultChange()}setCurrentAdjustingStepId(e){this.currentAdjustingStepId=e,this.onMakingAdjustmentsChange()}setMandatoryFulfilled(e,t){this.mandatorySteps[e]!==t&&(this.mandatorySteps={...this.mandatorySteps,[e]:t},this.onMandatoryChange())}async getMandatoryUnfulfilledSteps(){return(await Ja(this.allScenes,this.stepSelections)).flatMap(a=>a.renderableSteps).filter(a=>a.mandatory).filter(a=>!this.mandatorySteps[a.stepName]).map(a=>a.stepName)}setStepError(e,t,n){let i=!1;if(!this.validationErrors.steps.has(e)&&n)i=!0,this.validationErrors.steps.set(e,new Map([[t,n]]));else if(this.validationErrors.steps.has(e)){const a=this.validationErrors.steps.get(e);n&&n!==a.get(t)?(i=!0,a.set(t,n)):n||(i=!0,a.delete(t),a.size===0&&this.validationErrors.steps.delete(e))}i&&this.onValidationChange()}getStepErrors(e){return this.validationErrors.steps.get(e)}getValidationErrors(){return this.validationErrors}toggleDesignConfirmed(){this.confirmedDesign=!this.confirmedDesign,this.onConfirmChange()}toggleMakingAdjustmentsCallback(e){e(this.mandatorySteps),this.mandatoryCallbacks.push(e)}async injectIntoPreviewService(e,t){if(this.modelContainer)throw new Error("You must eject from the preview service before injecting again.");this.previewService=e;const n=this.experience.getProduct();if(!n?.modelUrl||!this.previewService)return;const i=e.loadModel({model:n.modelUrl,contextService:this.getLayoutPreviewService()},{refocusCamera:t});this.setModelContainer(i),(await Ja(this.allScenes,this.stepSelections)).filter(o=>o).map(o=>o.renderableSteps).flat().filter(o=>o.type===Xe.Model||o.type===Xe.Material).forEach(o=>{if(!o.option?.id){console.error(`Failed to read option id from step: ${o.stepName}`);return}const l=this.stepSelections[o.stepName]?.selectedVariants||[];if(l.length===0)return;const u=l[0];if(o.type===Xe.Model){if(!this.modelContainer)throw new nn("We should always have a model container when injecting a preview!");const c=u.asset?.fileLink;if(!c){console.error(`Failed to read model url from variant: ${u.id} for step: ${o.stepName}`);return}const f=o.data;this.modelContainer.applyModelVariant(o.stepName,{model:c,contextService:this.getLayoutPreviewService()},f.replaceProductModel||!1)}else{const c=u.material;if(!c){console.error(`Failed to read material from variant: ${u.id} for step: ${o.stepName}`);return}o.data.targetMaterials.forEach(d=>{if(!this.modelContainer)throw new nn("We should always have a model container when injecting a preview!");this.modelContainer.applyMaterialVariant(d,o.option.id,c)})}}),await i.getInitializationPromise(),this.renderLayouts()}ejectFromPreviewService(){if(this.modelContainer){if(!this.modelContainer.dispose)throw new Error("This feature is not supported in the current preview service.");this.modelContainer.dispose(),this.modelContainer=void 0}this.previewService=void 0}updateStorage(e,t){const n={...this.storage,[e]:{...this.storage[e],...t}};if(!vf(n,this.storage)){this.storage=n;const i=new OS(this.constructSerializableWorkflow());this.commandContext.apply(i,!0),this.onStepSpecificStorageChange(e),this.onStorageChange()}}constructSerializableWorkflow(){const e=[];return this.allScenes.forEach(t=>{t.renderableSteps.forEach(n=>{const i={stepName:n.stepName};i.storage=this.storage[n.stepName],i.selectedVariants=this.stepSelections[n.stepName]?.selectedVariants?.map(a=>({id:a.id,priceModifier:a.priceModifier})),e.push(i)})}),{steps:e}}updateStateWithServer(){if(this.readOnly)return;const e=this.serialize();this.workflowStatePromiseQueue.enqueue(new xE(async()=>{await new Promise(t=>{setTimeout(()=>{t()},1)}),await this.updateTransaction({variables:{id:this.experience.getTransaction().id,workflowState:e}})}))}async updateStateWithServerImmediate(){if(this.readOnly)return;const e=this.serialize();return new xE(async()=>{await this.updateTransaction({variables:{id:this.experience.getTransaction().id,workflowState:e}})}).execute()}serialize(){const e=this.getCommandContext().getState();if(!e)throw new nn("Attempted to serialize state before it was initialized.");const t=mo(e.transaction),n=S9(t);return JSON.stringify(n,x9,void 0)}async getStateHash(){const e=this.getCommandContext().getState(),n=Object.values(e?.transaction.layouts||{}).map(s=>s.modificationID??"").sort().join(""),a=new TextEncoder().encode(n);if(typeof window<"u"&&window.crypto&&window.crypto.subtle&&window.crypto.subtle.digest){const s=await window.crypto.subtle.digest("SHA-256",a);return Array.from(new Uint8Array(s)).map(u=>u.toString(16).padStart(2,"0")).join("")}try{return(await import("crypto")).createHash("sha256").update(n,"utf8").digest("hex")}catch{throw new Error("Unable to compute SHA-256 hash: no suitable crypto implementation available.")}}async outstandingRequestsPromise(){return this.workflowStatePromiseQueue.finalize()}updateMetadata(e,t){this.stepMetadata={...this.stepMetadata,[e]:{...this.stepMetadata[e],...t}},this.onMetadataChange()}removeElements(e){const t=(n,i)=>Object.keys(n).reduce((a,s)=>{const o=[...n[s]||[]];return i.forEach(l=>{const u=o.findIndex(c=>c.id===l.id);u>-1&&o.splice(u,1)}),a[s]=o,a},{});this.stepElements=t(this.stepElements,e)}async getInvalidCanvasRegions(){let e=[];for(const t of this.experience.getWorkflow()?.steps||[])if(!await co(t,this.stepSelections)&&this.stepElements[t.stepName])for(const n of this.stepElements[t.stepName])e.push(n);return e}async getInvalidModelVariants(){let e=[];for(const t of this.experience.getWorkflow()?.steps||[])t.type===Xe.Model&&!await co(t,this.stepSelections)&&e.push(t.stepName);return e}async stepElementsForIntroducedSilentSteps(e,t){const n=this.experience.getProduct();if(!n)return Promise.resolve({stepElements:{},commands:[]});const i=async(u,c,f)=>{if(u.type===Xe.SilentIllustration){const d=await new BS(u,c).trigger();return{step:u,results:d}}else if(u.type===Xe.ProductOverlay){const d=await new BS(u,c,f).trigger();return{step:u,results:d}}return Promise.reject("Unknown silent step. This is a bug")},a=e.filter(u=>!this.stepInitialised[u.stepName]),s={stepElements:{},commands:[]},o=[];for(const u of a)this.markStepsAsInitialised([u.stepName]),t||o.push(i(u,this.layouts,n));const l=await Promise.all(o);for(const u of l)s.stepElements[u.step.stepName]=u.results.map(c=>c.regionElement),s.commands=[...s.commands,...u.results.map(c=>c.command)];return s}getStepStorage(e){return this.storage[e]}getMetadata(e){return this.stepMetadata[e]}getWorkflowMetadata(){return this.stepMetadata}getStepTags(e){return this.stepTags[e]||[]}getSerializedStep(e,t){return t.find(n=>n.stepName===e)}async updateTransactionShareActions(){const e=await this.client.getShareActionsForTransaction(this.experience.getTransaction().id);this.experience.getTransaction().transactionShareActions=e}async updateTransactionStakeholders(){const e=await ze.getShadowGraphqlClient().query({query:L3,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:this.experience.getTransaction().id}});!e?.data?.transactions||e.data.transactions.length!==1?(this.experience.getTransaction().currentStakeholder=void 0,this.experience.getTransaction().stakeholders=void 0):(this.experience.getTransaction().stakeholders=e.data.transactions[0].stakeholders,this.experience.getTransaction().currentStakeholder=e.data.transactions[0].currentStakeholder)}async approveTransaction(e){await ze.getShadowGraphqlClient().mutate({mutation:g9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:this.experience.getTransaction().id,note:e}})}async rejectTransaction(e){await ze.getShadowGraphqlClient().mutate({mutation:m9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:this.experience.getTransaction().id,note:e}})}async reset(){this.stepElements={},this.stepInitialised={},this.stepMetadata={},this.stepSelections={},this.storage={},await this.ensureStepsAreLoaded()}async setSelectionsAndElements(e,t,n,i){const a=this.experience.getWorkflow();if(!a)throw new Error("Attempted to set selections when no workflow is set!");const s=this.stepSelections;this.stepSelections={...this.stepSelections,[e]:{selectedVariants:t}};for(const R of a.steps)await co(R,this.stepSelections)||(this.stepInitialised[R.stepName]=!1,delete this.stepMetadata[R.stepName],delete this.stepSelections[R.stepName],delete this.storage[R.stepName]);const o=this.allScenes,l=await Ja(o,s),u=await Ja(o,this.stepSelections),c=l.map(R=>R.silentSteps).flat(),d=u.map(R=>R.silentSteps).flat().filter(R=>!c.some(B=>B.stepName===R.stepName));for(const R of c)await co(R,this.stepSelections)||(this.stepInitialised[R.stepName]=!1);const h=await this.getInvalidCanvasRegions(),{stepElements:g,commands:v}=await this.stepElementsForIntroducedSilentSteps(d,!1);this.stepElements={...this.stepElements,...g,[e]:n},this.removeElements(h);const y=a.steps.find(R=>R.stepName===e);y?.type===Xe.Frame&&this.getWorkflowExperience().getStepById(y.stepName)?.frameService?.setTargetElements(n.map(B=>B.id));const A=h.map(R=>new Ol(R.id)),C=new OS(this.constructSerializableWorkflow()),S=[...v,...A,C];S.length>0&&this.commandContext.apply(new On(S),!0),await this.ensureStepsAreLoaded(),this.selectionCost=Object.values(this.stepSelections).reduce((R,B)=>R+B.selectedVariants.map(j=>j.priceModifier||0).reduce((j,G)=>j+G,0),0),this.onElementsChange();const F=await this.getInvalidModelVariants(),E=this.modelContainer;if(E){const R=F.map(B=>E.applyModelVariant(B,{contextService:this.getLayoutPreviewService()},!1));await Promise.all(R)}await this.onSelectionChange(),await this.reapplyMaterialSteps(),y?.type!==Xe.Frame&&y?.type!==Xe.Text&&this.setMandatoryFulfilled(e,!0),i&&await i()}async ensureStepsAreLoaded(){const t=(await Ja(this.allScenes,this.stepSelections)).map(l=>l.renderableSteps),n=[],i=t.flat();for(const l of i)if(!this.stepInitialised[l.stepName])switch(this.stepInitialised[l.stepName]=!0,l.type){case Xe.DigitalContent:n.push(T1.init(l,this,this.reloadedState));break;case Xe.Frame:n.push(so.init(l,this,this.reloadedState));break;case Xe.Illustration:n.push(Jd.init(l,this,this.reloadedState));break;case Xe.Material:n.push(F1.init(l,this,this.reloadedState));break;case Xe.Model:n.push(I1.init(l,this,this.reloadedState));break;case Xe.Module:this.stepSpecificServices[l.stepName]={module:await sI(l.data.module)},n.push(P1.init(l,this,this.reloadedState));break;case Xe.Picture:n.push(D1.init(l,this,this.reloadedState));break;case Xe.Question:n.push(R1.init(l,this,this.reloadedState));break;case Xe.Shape:n.push(Nu.init(l,this,this.reloadedState));break;case Xe.Text:n.push(ri.init(l,this,this.reloadedState));break}const a=(await Promise.allSettled(n)).map(l=>{if(l.status==="rejected")throw new Error(`Step initialization failed: ${l.reason}`);return l.value}),s=a.flatMap(l=>l?.command?[l.command]:[]),o=a.flatMap(l=>l?.followup?[l.followup]:[]);s&&s.length>0&&this.commandContext.apply(new On(s),!0);for(const l of o)await l();o.length>0&&await this.ensureStepsAreLoaded(),this.onInitChange()}onConfirmChange(){this.confirmCallbacks.forEach(e=>e(this.confirmedDesign))}onEditedChange(){this.editedCallbacks.forEach(e=>e(this.editedSteps))}onElementsChange(){this.elementsCallbacks.forEach(e=>e(this.stepElements))}onInformationResultChange(){this.informationResultCallbacks.forEach(e=>e(this.informationResults))}onInitChange(){this.initCallbacks.forEach(e=>e(this.stepInitialised))}onMakingAdjustmentsChange(){this.makingAdjustmentsCallback.forEach(e=>{e(this.currentAdjustingStepId)})}onMandatoryChange(){this.mandatoryCallbacks.forEach(e=>e(this.mandatorySteps))}onMetadataChange(){this.metadataCallbacks.forEach(e=>{e(this.stepMetadata)})}async onSelectionChange(){const e=await this.traversableScenes();for(const t of this.selectionCallbacks)t({selectionCost:this.selectionCost,selections:this.stepSelections,traversableScenes:e})}onStepSpecificStorageChange(e){Object.keys(this.stepSpecificStorageCallbacks).includes(e)||(this.stepSpecificStorageCallbacks[e]=[]),this.stepSpecificStorageCallbacks[e].forEach(t=>t(this.storage[e]))}onStorageChange(){this.storageCallbacks.forEach(e=>e(this.storage))}onValidationChange(){this.validationCallbacks.forEach(e=>e(this.validationErrors))}traversableScenes(){return F_(this.allScenes,this.stepSelections,this.singleVariantsRenderable)}async reapplyMaterialSteps(){if(!this.modelContainer)return;const t=(await Ja(this.allScenes,this.stepSelections)).flatMap(n=>n.renderableSteps).filter(n=>n.type===Xe.Material);for(const n of t){const i=this.stepSelections[n.stepName]?.selectedVariants;if(!i||i.length===0)continue;const s=i[0].material;if(!s||!n.option?.id)continue;n.data.targetMaterials.forEach(l=>{this.modelContainer?.applyMaterialVariant(l,n.option.id,s)})}}};af.configurationPromiseMap=new Map;let dA=af;class Fa{constructor(e){this.variantData=e}getType(){return this.variantData.asset?.type}getId(){return this.variantData.id}getName(){return this.variantData.name}getPriceFormatted(e,t){return this.variantData.priceModifier.toLocaleString(e||"en-US",{style:"currency",currency:"USD",...t})}getPrice(){return this.variantData.priceModifier}getAsset(){return this.variantData.asset?.fileLink}getAssetResource(){return this.variantData.asset}getThumbnail(e=256,t){const n=this.variantData.thumbnail;if(!(!n||!n.fileLink))return $g(n,e,"webp",t)}getColor(){return this.variantData.color}isDefault(){return!!this.variantData.default}getResource(){return this.variantData}isEnabled(){return this.variantData.enabled}getCategory(){return this.variantData.category}getProduct(){return this.variantData.product}}const sf=class sf{constructor(e,t,n){this.manager=e,this.step=t,this.tags=n}setUpdateState(e){sf.updateState.set(`${this.step.stepName}-${this.manager.getWorkflowExperience().getTransaction().id}`,e)}getUpdateState(){return!!sf.updateState.get(`${this.step.stepName}-${this.manager.getWorkflowExperience().getTransaction().id}`)}getCurrentVariant(){const n=this.manager.getWorkflowSelections()[this.step.stepName]?.selections[0];if(n)return new Fa(n)}async getAvailableVariants(){return(await this.getAllVariants()).filter(t=>t.isEnabled())||[]}async getAllVariants(){if(!this.step.option?.id)return[];if(this.step.option.variants)return(this.step.option.variants||[]).map(t=>new Fa(t))||[];const e=await ct.getOption(this.step.option?.id);if(!e)throw new Error("Option not found, cannot fetch variants.");return(e.variants||[]).map(t=>new Fa(t))||[]}getId(){return this.step.stepName}getName(){return this.step.stepTitle}getHelpText(){return this.step.helpText}getType(){return this.step.type}getRaw(){return this.step}getTags(){return this.tags}hasTag(e){return this.tags.includes(e)||!1}getMandatory(){return this.step.mandatory||!1}getOverrideGlobalPropertyConfiguration(e){return(this.manager.getStepStorage(this.step.stepName)?.overrideGlobalConfigurations??{})[e.toString()]??!1}setOverrideGlobalPropertyConfiguration(e,t){const n=this.manager.getStepStorage(this.step.stepName)?.overrideGlobalConfigurations??{};this.manager.updateStorage(this.step.stepName,{overrideGlobalConfigurations:{...n,[e.toString()]:t}})}getGlobalPropertyAspects(e){return this.step.globalPropertyAspectConfigurations?.filter(t=>t.globalPropertyConfigurationId===e&&t.aspectName).map(t=>t.aspectName)??[]}executeAnimations(e){const t=this.manager.getPreviewService(),n=this.manager.getModelContainer(),i=this.step.data.modelAnimation,a=this.step.data.lookAtAnimation;t?a&&t.executeCameraAnimation(a):console.warn("No preview service available, cannot execute camera animations."),n?i&&n.executeAnimation(i,e):console.warn("No model container available, cannot execute model animations.")}};sf.updateState=new Map;let Ui=sf;class fI extends Ui{constructor(e,t,n){super(e,t,n)}async selectVariant(e){if(!this.getUpdateState()&&this.getCurrentVariant()!==e)return Jd.selectVariant(this.step,e.getResource(),this.manager.getRegionElements(this.step.stepName)||[],t=>this.setUpdateState(t),this.manager)}getColors(){const e=this.manager.getRegionElements(this.step.stepName)||[];if(e.length===0)return;const n=Un(e[0].id,this.manager.getAllLayoutData()).colors,a=this.getCurrentVariant()?.getAssetResource()?.assetConfiguration,s=a?.defaultColorVariants||[];if(s.length!==0){const o={};return s.forEach(l=>{const u=a.channelNumbers.find(c=>c.number===l.channelNumber);if(u){const c=u.id.replace(/\W/g,"");o[l.channelNumber]={browserValue:n[c]?.browserValue||""}}}),o}try{return n}catch(o){console.error(o)}}setColor(e,t,n){const i=new Map,s=this.getCurrentVariant()?.getAssetResource()?.assetConfiguration;return(s?.defaultColorVariants||[]).length!==0?s.channelNumbers.forEach(l=>{if(l.number.toString()===e){const u=l.id.replace(/\W/g,"");n?i.set(u,{browserValue:t,pmsValue:n}):i.set(u,t)}}):n?i.set(e,{browserValue:t,pmsValue:n}):i.set(e,t),Jd.changeColors(this.step,this.manager.getRegionElements(this.step.stepName),this.manager,i)}async getColorOption(){return await ct.ensureFullOption(this.step.data.colorOption)}getAvailableColors(){return this.step.data.colorPickerEnabled?Jd.availableColors(this.step,this.manager):Promise.resolve([])}isColorPickerEnabled(){return this.step.data.colorPickerEnabled??!1}isPMSPickerEnabled(){return this.step.data.pmsPickerEnabled??!1}isVariantSearchEnabled(){return this.step.data.enableVariantSearch??!1}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}class hI extends Ui{constructor(e,t,n){super(e,t,n)}selectVariant(e){return F1.selectVariant(this.step,e.getResource(),this.manager,t=>this.setUpdateState(t))}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}class pI extends Ui{constructor(e,t,n){super(e,t,n)}selectVariant(e){return I1.selectVariant(this.step,e.getResource(),this.manager,t=>this.setUpdateState(t))}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}class gI extends Ui{constructor(e,t,n){super(e,t,n)}selectVariant(e){return D1.selectVariant(this.step,e.getResource(),this.manager,t=>this.setUpdateState(t))}isVariantSearchEnabled(){return this.step.data.enableVariantSearch??!1}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}class mI extends Ui{constructor(e,t,n){super(e,t,n)}async selectVariant(e){if(!e.getId())throw new Error("Unable to select variant with a null ID");await R1.selectVariant(this.step,e.getId(),this.manager)}async getDisplayType(){return this.step.data.displayType?this.step.data.displayType:(await ct.getOptionForStep(this.step))?.displayType}}class vI extends Ui{constructor(e,t,n){super(e,t,n)}selectVariant(e){const t=e.getResource();return Nu.selectVariant(this.step,{fill:t.color,stroke:t.color,variant:t},this.manager.getRegionElements(this.step.stepName)||[],this.manager)}setColor(e){return Nu.selectVariant(this.step,e,this.manager.getRegionElements(this.step.stepName)||[],this.manager)}getColors(){return Nu.availableColours(this.step)}setCustomColor(e){return this.getCurrentVariant()?.getColor()!=="#custom"&&console.warn(`setting custom color for step ${this.step.stepName} but color is ${this.getCurrentVariant()?.getColor()}`),Nu.setCustomColor(e,this.step,this.manager)}getCustomColor(){this.getCurrentVariant()?.getColor()!=="#custom"&&console.warn(`setting custom color for step ${this.step.stepName} but color is ${this.getCurrentVariant()?.getColor()}`);const e=this.manager.getStepStorage(this.step.stepName)?.colour;if(!e)throw new Error(`Color not available on step ${this.step.stepName}. Set a default on the workflow to fix this.`);return e}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}class yI extends Ui{constructor(e,t,n){super(e,t,n)}async selectVariant(e){await ri.selectVariant(this.step,e.getResource(),this.manager,t=>{if(t)this.manager.setInformationResults([...this.manager.getInformationResults(),{message:t,messageType:Jf.Error,stepID:this.step.stepName}]);else{const n=this.manager.getInformationResults().filter(i=>i.stepID!==this.step.stepName);this.manager.setInformationResults(n)}},()=>{})}async getAvailableFillColors(){return this.step.data.colorPickerEnabled?ri.availableFillColors(this.step):[]}async setFillColor(e){const t=this.manager.getRegionElements(this.step.stepName);await ri.changeFillColor(this.step,e,t,this.manager)}getFillColor(){return this.manager.getStepStorage(this.step.stepName)?.color||"#000000"}getAvailableFillImages(){return ri.availableFillImages(this.step)}async setFillImage(e){const t=this.manager.getRegionElements(this.step.stepName);await ri.changeFillImage(this.step,e,t,this.manager)}getFillImage(){return this.manager.getStepStorage(this.step.stepName)?.fillImage}getAlignment(){return ri.findLayoutElements(this.manager,this.step)?.[0].align}setAlignment(e){const t=this.manager.getRegionElements(this.step.stepName);ri.changeAlignment(this.step,e,t,this.manager)}setFullTextCustomization(e){const t=this.manager.getStepStorage(this.step.stepName)?.inputText||"",n=this.step.data.replaceableText!==void 0?this.step.data.replaceableText.replace("{{}}",t):t,i=e?n:this.step.data.defaultText;return this.manager.updateStorage(this.step.stepName,{customiseAllText:e,text:i,defaultCleared:!1}),this.setText(i)}setText(e){const t={input:e,helperData:{}},n=ri.findLayoutElements(this.manager,this.step),i=ri.filterUnsupportedCharacters(e,n[0]?.fontData),a=ju(i,this.manager).length,s=!!this.step.data&&!!this.step.data.maxLength&&a>this.step.data.maxLength;s||(t.input=i);const o=n.length<=0,l=o?{inputText:i,text:i}:{inputText:i};this.manager.updateStorage(this.step.stepName,l);const u=this.manager.getStepStorage(this.step.stepName),c=ri.getProcessedInput(i,this.step.data,u?.customiseAllText??!1);if(o)s||this.manager.updateMetadata(this.step.stepName,{text:c});else{const{command:f,errorData:d,helperData:h}=ri.updateInputText(i,n,this.step,this.manager);f&&this.manager.getCommandDispatcher()(f),t.helperData=h,t.errorData=d,!s&&!d&&this.manager.updateMetadata(this.step.stepName,{text:c})}return t}getText(){const e=this.step.data.defaultText,t=this.manager.getStepStorage(this.step.stepName);return e&&t?.defaultCleared!==void 0&&!t?.defaultCleared?e:this.manager.getStepStorage(this.step.stepName)?.text||""}isReplaceable(){return this.step.data.userCanReplaceText}newLinesSupported(){return this.step.data.allowNewlines||!1}clearDefaultTextIfNecessary(){if(!this.manager.getStepStorage(this.step.stepName)?.defaultCleared&&this.step.data.deleteDefaultOnFocus){const t=this.setText("");this.manager.updateStorage(this.step.stepName,{defaultCleared:!0,inputText:""});const n=ri.findLayoutElements(this.manager,this.step);return ri.updateInputText("",n,this.step,this.manager),t}}hasColorPicker(){return this.step.data.colorPickerEnabled}getRegions(){return this.step.data.regions}getCharacterLimit(){return this.step.data.maxLength}getCharactersRemaining(){const e=this.step.data.maxLength;if(e===void 0)return;const t=ju(this.getText(),this.manager);return e-t.length}setCustomColor(e){this.getFillColor()!=="#custom"&&console.warn(`setting custom color for text step ${this.step.stepName} but current fill is not #custom`);const t=this.manager.getRegionElements(this.step.stepName);ri.applyCustomFillColor(this.step,e,t,this.manager)}getCustomColor(){return this.manager.getStepStorage(this.step.stepName)?.customColor||"#000000"}async getAvailableStrokeColors(){return this.step.data.strokeEnabled?ri.availableStrokeColors(this.step):[]}getStrokeColor(){return this.manager.getStepStorage(this.step.stepName)?.strokeColor?.browserValue||"#000000"}async setStrokeColor(e){const t=this.manager.getRegionElements(this.step.stepName);await ri.changeStrokeColor(this.step,e,t,this.manager)}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}class AI extends Ui{constructor(e,t,n){super(e,t,n)}async selectVariant(){}getContent(){return this.step.data.content}}class bI extends Ui{constructor(e,t,n){super(e,t,n)}async selectVariant(){}getPreviewURL(){return this.manager.getStepStorage(this.step.stepName)?.videoUrl||""}async selectVideo(e){return T1.regenerateQRCode(this.manager.getRegionElements(this.step.stepName),e.key,this.manager,this.step)}}class wI extends Ui{constructor(e,t,n){super(e,t,n)}async selectVariant(){console.info("Text Modules don't support variants.")}getCharactersRemaining(){const e=this.step.data.maxLength;if(e===void 0)return;const t=ju(this.getText(),this.manager);return e-t.length}getCharacterLimit(){return this.step.data.maxLength}getText(){return this.manager.getStepStorage(this.step.stepName)?.text||""}setText(e){P1.changeText(this.step,e,this.manager,t=>{if(t){const n=[...this.manager.getInformationResults(),{message:t,messageType:Jf.Error,stepID:this.step.stepName}];this.manager.setInformationResults(n)}else{const n=this.manager.getInformationResults().filter(i=>i.stepID!==this.step.stepName);this.manager.setInformationResults(n)}})}}class CI extends Ui{constructor(e,t,n){super(e,t,n)}async selectVariant(){}async getAvailableVariants(){const e=await super.getAvailableVariants();if(!this.cachedProductIds){this.cachedProductIds=new Set;for(const t of e){const n=t.getProduct();n?.id&&this.cachedProductIds.add(n.id)}}return e}isPersonalisable(e){const t=e.getProduct();return!!t?.workflows&&t.workflows.length>0}async addProduct(e){const t=this.manager.getWorkflowExperience().getBundle();if(!t)throw new Error("Product step requires bundle context");const n=e.getProduct();if(!n)throw new Error("Variant has no product. Ensure the option query includes the product field on variants.");if(!this.isPersonalisable(e)){await this.incrementNonPersonalisable(e);return}const i=this.manager.getWorkflowExperience().getTransaction(),a=i.integrationProduct?.integration?.id;let s;if(a&&n.integrationProducts&&(s=n.integrationProducts.find(d=>d.integration?.id===a)?.id),!s)throw new Error("No integration product found for bundle context");const o=this.manager.getClient(),l=n?.workflows||[];let u;if(l.length===1)u=l[0].id;else if(l.length>1){const f=this.step.data.workflows,d=l.find(h=>f.includes(h.id));if(d)u=d.id;else throw new Error("Multiple workflows available but none match step configuration")}const c=await o.getWorkflowExperience({type:"integration",integrationProductId:s,workflowId:u,parentTransactionId:i.id});await t.addWorkflowExperience(c)}async incrementNonPersonalisable(e){const t=this.manager.getWorkflowExperience().getBundle();if(!t)return;const n=e.getProduct(),i=this.findExperienceForProduct(n.id);if(i){const c=i.getTransaction().quantity||1;await i.setQuantity(c+1);return}const a=this.manager.getWorkflowExperience().getTransaction(),s=a.integrationProduct?.integration?.id;let o;if(s&&n.integrationProducts&&(o=n.integrationProducts.find(f=>f.integration?.id===s)?.id),!o)throw new Error("No integration product found for bundle context");const u=await this.manager.getClient().getWorkflowExperience({type:"integration",integrationProductId:o,parentTransactionId:a.id});await t.addWorkflowExperience(u)}async removeProduct(e){const t=this.manager.getWorkflowExperience().getBundle();if(!t)throw new Error("Product step requires bundle context");const i=t.getWorkflowExperiences().find(o=>o.getTransaction().id===e);if(!i)throw new Error("Transaction is not a child of this product step");const a=i.getTransaction(),s=a.quantity||1;if(s>1){await i.setQuantity(s-1);return}await t.removeWorkflowExperienceByTransaction(a)}isCategoryFilterEnabled(){return this.step.data.categoryFilterEnabled??!1}isSearchBarEnabled(){return this.step.data.searchBarEnabled??!1}getMin(){return this.step.data.min}getMax(){return this.step.data.max}getPricing(){return this.step.data.pricing}getWorkflows(){return this.step.data.workflows||[]}getChildTransactions(){const e=this.manager.getWorkflowExperience().getBundle();if(!e)return[];const t=this.manager.getWorkflowExperience().getTransaction().id,n=e.getWorkflowExperiences(),i=this.getStepProductIds();return n.map(a=>a.getTransaction()).filter(a=>a.parentTransaction?.id!==t||i.size===0?!1:a.product?.id?i.has(a.product.id):!1)}getStepProductIds(){if(this.cachedProductIds&&this.cachedProductIds.size>0)return this.cachedProductIds;const e=this.step.option?.variants||[],t=new Set;for(const n of e)n.product?.id&&t.add(n.product.id);return t}getLockedAddOns(){return this.step.data.lockedAddOns||[]}findExperienceForProduct(e){const t=this.manager.getWorkflowExperience().getBundle();if(!t)return;const n=this.manager.getWorkflowExperience().getTransaction().id,i=this.getStepProductIds();return t.getWorkflowExperiences().find(a=>{const s=a.getTransaction();return s.parentTransaction?.id!==n||i.size>0&&!i.has(e)?!1:s.product?.id===e})}}class Ep{static get(e,t){switch(t.type){case Xe.DigitalContent:return new bI(e,t,e.getStepTags(t.stepName));case Xe.Information:return new AI(e,t,e.getStepTags(t.stepName));case Xe.Question:return new mI(e,t,e.getStepTags(t.stepName));case Xe.Text:return new yI(e,t,e.getStepTags(t.stepName));case Xe.Illustration:return new fI(e,t,e.getStepTags(t.stepName));case Xe.Picture:return new gI(e,t,e.getStepTags(t.stepName));case Xe.Shape:return new vI(e,t,e.getStepTags(t.stepName));case Xe.Material:return new hI(e,t,e.getStepTags(t.stepName));case Xe.Model:return new pI(e,t,e.getStepTags(t.stepName));case Xe.Frame:return new GP(e,t,e.getStepTags(t.stepName));case Xe.Module:return new wI(e,t,e.getStepTags(t.stepName));case Xe.Product:return new CI(e,t,e.getStepTags(t.stepName));default:throw new nn(`Step type ${t.type} not yet supported in Core SDK`)}}}var Pv,SE;function F9(){if(SE)return Pv;SE=1;var r=1/0,e=9007199254740991,t=17976931348623157e292,n=NaN,i="[object Function]",a="[object GeneratorFunction]",s="[object Symbol]",o=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=/^(?:0|[1-9]\d*)$/,d=parseInt,h=Object.prototype,g=h.toString,v=Math.ceil,y=Math.max;function A(oe,he,ye){var Ue=-1,Re=oe.length;he<0&&(he=-he>Re?0:Re+he),ye=ye>Re?Re:ye,ye<0&&(ye+=Re),Re=he>ye?0:ye-he>>>0,he>>>=0;for(var Oe=Array(Re);++Ue<Re;)Oe[Ue]=oe[Ue+he];return Oe}function C(oe,he){return he=he??e,!!he&&(typeof oe=="number"||f.test(oe))&&oe>-1&&oe%1==0&&oe<he}function S(oe,he,ye){if(!G(ye))return!1;var Ue=typeof he;return(Ue=="number"?R(ye)&&C(he,ye.length):Ue=="string"&&he in ye)?E(ye[he],oe):!1}function F(oe,he,ye){(ye?S(oe,he,ye):he===void 0)?he=1:he=y(J(he),0);var Ue=oe?oe.length:0;if(!Ue||he<1)return[];for(var Re=0,Oe=0,ee=Array(v(Ue/he));Re<Ue;)ee[Oe++]=A(oe,Re,Re+=he);return ee}function E(oe,he){return oe===he||oe!==oe&&he!==he}function R(oe){return oe!=null&&j(oe.length)&&!B(oe)}function B(oe){var he=G(oe)?g.call(oe):"";return he==i||he==a}function j(oe){return typeof oe=="number"&&oe>-1&&oe%1==0&&oe<=e}function G(oe){var he=typeof oe;return!!oe&&(he=="object"||he=="function")}function ie(oe){return!!oe&&typeof oe=="object"}function q(oe){return typeof oe=="symbol"||ie(oe)&&g.call(oe)==s}function Y(oe){if(!oe)return oe===0?oe:0;if(oe=ae(oe),oe===r||oe===-r){var he=oe<0?-1:1;return he*t}return oe===oe?oe:0}function J(oe){var he=Y(oe),ye=he%1;return he===he?ye?he-ye:he:0}function ae(oe){if(typeof oe=="number")return oe;if(q(oe))return n;if(G(oe)){var he=typeof oe.valueOf=="function"?oe.valueOf():oe;oe=G(he)?he+"":he}if(typeof oe!="string")return oe===0?oe:+oe;oe=oe.replace(o,"");var ye=u.test(oe);return ye||c.test(oe)?d(oe.slice(2),ye?2:8):l.test(oe)?n:+oe}return Pv=F,Pv}var I9=F9();const fA=Ns(I9),P9=Se`
|
|
2656
2656
|
fragment CreateDesignTransaction on Transaction {
|
|
2657
2657
|
id
|
|
2658
2658
|
designName
|
|
@@ -3039,7 +3039,7 @@ Minimum version required to store current data is: `+q+`.
|
|
|
3039
3039
|
`;class AV{constructor(e,t=ze.getShadowGraphqlClient.bind(ze)){this.options=e,this.client=t}query(e){const t=this.options?.onQuery?this.options?.onQuery(e):{};return this.client().query({...t,...e,context:{...t.context??{},...e.context??{}}})}mutate(e){const t=this.options?.onMutate?this.options?.onMutate(e):{};return this.client().mutate({...t,...e,context:{...t.context??{},...e.context??{}}})}}function bV(r,e,t){return r.$source||(r.$source={}),r.$source[e]=t,r}const wV=r=>r?.body instanceof ReadableStream,fl=(r,e)=>{const t=[];if(r&&t.push(r),e)for(const n of e)t.push(n);return t},to=(r,e)=>`${r||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,bg=()=>{let r=[],e=[],t=!1;const n=new Set,i=f=>f.sort((d,h)=>DE[h.step]-DE[d.step]||RE[h.priority||"normal"]-RE[d.priority||"normal"]),a=f=>{let d=!1;const h=g=>{const v=fl(g.name,g.aliases);if(v.includes(f)){d=!0;for(const y of v)n.delete(y);return!1}return!0};return r=r.filter(h),e=e.filter(h),d},s=f=>{let d=!1;const h=g=>{if(g.middleware===f){d=!0;for(const v of fl(g.name,g.aliases))n.delete(v);return!1}return!0};return r=r.filter(h),e=e.filter(h),d},o=f=>(r.forEach(d=>{f.add(d.middleware,{...d})}),e.forEach(d=>{f.addRelativeTo(d.middleware,{...d})}),f.identifyOnResolve?.(c.identifyOnResolve()),f),l=f=>{const d=[];return f.before.forEach(h=>{h.before.length===0&&h.after.length===0?d.push(h):d.push(...l(h))}),d.push(f),f.after.reverse().forEach(h=>{h.before.length===0&&h.after.length===0?d.push(h):d.push(...l(h))}),d},u=(f=!1)=>{const d=[],h=[],g={};return r.forEach(y=>{const A={...y,before:[],after:[]};for(const C of fl(A.name,A.aliases))g[C]=A;d.push(A)}),e.forEach(y=>{const A={...y,before:[],after:[]};for(const C of fl(A.name,A.aliases))g[C]=A;h.push(A)}),h.forEach(y=>{if(y.toMiddleware){const A=g[y.toMiddleware];if(A===void 0){if(f)return;throw new Error(`${y.toMiddleware} is not found when adding ${to(y.name,y.aliases)} middleware ${y.relation} ${y.toMiddleware}`)}y.relation==="after"&&A.after.push(y),y.relation==="before"&&A.before.push(y)}}),i(d).map(l).reduce((y,A)=>(y.push(...A),y),[])},c={add:(f,d={})=>{const{name:h,override:g,aliases:v}=d,y={step:"initialize",priority:"normal",middleware:f,...d},A=fl(h,v);if(A.length>0){if(A.some(C=>n.has(C))){if(!g)throw new Error(`Duplicate middleware name '${to(h,v)}'`);for(const C of A){const S=r.findIndex(E=>E.name===C||E.aliases?.some(R=>R===C));if(S===-1)continue;const F=r[S];if(F.step!==y.step||y.priority!==F.priority)throw new Error(`"${to(F.name,F.aliases)}" middleware with ${F.priority} priority in ${F.step} step cannot be overridden by "${to(h,v)}" middleware with ${y.priority} priority in ${y.step} step.`);r.splice(S,1)}}for(const C of A)n.add(C)}r.push(y)},addRelativeTo:(f,d)=>{const{name:h,override:g,aliases:v}=d,y={middleware:f,...d},A=fl(h,v);if(A.length>0){if(A.some(C=>n.has(C))){if(!g)throw new Error(`Duplicate middleware name '${to(h,v)}'`);for(const C of A){const S=e.findIndex(E=>E.name===C||E.aliases?.some(R=>R===C));if(S===-1)continue;const F=e[S];if(F.toMiddleware!==y.toMiddleware||F.relation!==y.relation)throw new Error(`"${to(F.name,F.aliases)}" middleware ${F.relation} "${F.toMiddleware}" middleware cannot be overridden by "${to(h,v)}" middleware ${y.relation} "${y.toMiddleware}" middleware.`);e.splice(S,1)}}for(const C of A)n.add(C)}e.push(y)},clone:()=>o(bg()),use:f=>{f.applyToStack(c)},remove:f=>typeof f=="string"?a(f):s(f),removeByTag:f=>{let d=!1;const h=g=>{const{tags:v,name:y,aliases:A}=g;if(v&&v.includes(f)){const C=fl(y,A);for(const S of C)n.delete(S);return d=!0,!1}return!0};return r=r.filter(h),e=e.filter(h),d},concat:f=>{const d=o(bg());return d.use(f),d.identifyOnResolve(t||d.identifyOnResolve()||(f.identifyOnResolve?.()??!1)),d},applyToStack:o,identify:()=>u(!0).map(f=>{const d=f.step??f.relation+" "+f.toMiddleware;return to(f.name,f.aliases)+" - "+d}),identifyOnResolve(f){return typeof f=="boolean"&&(t=f),t},resolve:(f,d)=>{for(const h of u().map(g=>g.middleware).reverse())f=h(f,d);return t&&console.log(c.identify()),f}};return c},DE={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},RE={high:3,normal:2,low:1};var xf;(function(r){r.HTTP="http",r.HTTPS="https"})(xf||(xf={}));var Sf;(function(r){r.MD5="md5",r.CRC32="crc32",r.CRC32C="crc32c",r.SHA1="sha1",r.SHA256="sha256"})(Sf||(Sf={}));const mA="__smithy_context",vc=r=>r[mA]||(r[mA]={});class na{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const t=new na({...e,headers:{...e.headers}});return t.query&&(t.query=CV(t.query)),t}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&typeof t.query=="object"&&typeof t.headers=="object"}clone(){return na.clone(this)}}function CV(r){return Object.keys(r).reduce((e,t)=>{const n=r[t];return{...e,[t]:Array.isArray(n)?[...n]:n}},{})}class sc{statusCode;reason;headers;body;constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return typeof t.statusCode=="number"&&typeof t.headers=="object"}}const xV=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),Kg=(r,e=!1)=>{if(!e)return xV.test(r);const t=r.split(".");for(const n of t)if(!Kg(n))return!1;return!0},Bs=r=>{if(typeof r=="function")return r;const e=Promise.resolve(r);return()=>e};function SV(r){const e={};if(r=r.replace(/^\?/,""),r)for(const t of r.split("&")){let[n,i=null]=t.split("=");n=decodeURIComponent(n),i&&(i=decodeURIComponent(i)),n in e?Array.isArray(e[n])?e[n].push(i):e[n]=[e[n],i]:e[n]=i}return e}const wg=r=>{if(typeof r=="string")return wg(new URL(r));const{hostname:e,pathname:t,port:n,protocol:i,search:a}=r;let s;return a&&(s=SV(a)),{hostname:e,port:n?parseInt(n):void 0,protocol:i,path:t,query:s}},L1=r=>{if(typeof r=="object"){if("url"in r){const e=wg(r.url);if(r.headers){e.headers={};for(const t in r.headers)e.headers[t.toLowerCase()]=r.headers[t].join(", ")}return e}return r}return wg(r)},EV=r=>()=>Promise.reject(r);class kV{config;middlewareStack=bg();initConfig;handlers;constructor(e){this.config=e;const{protocol:t,protocolSettings:n}=e;n&&typeof t=="function"&&(e.protocol=new t(n))}send(e,t,n){const i=typeof t!="function"?t:void 0,a=typeof t=="function"?t:n,s=i===void 0&&this.config.cacheMiddleware===!0;let o;if(s){this.handlers||(this.handlers=new WeakMap);const l=this.handlers;l.has(e.constructor)?o=l.get(e.constructor):(o=e.resolveMiddleware(this.middlewareStack,this.config,i),l.set(e.constructor,o))}else delete this.handlers,o=e.resolveMiddleware(this.middlewareStack,this.config,i);if(a)o(e).then(l=>a(null,l.output),l=>a(l)).catch(()=>{});else return o(e).then(l=>l.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}const Yp=r=>typeof r=="function"?r():r,MI=(r,e,t,n,i)=>({name:e,namespace:r,traits:t,input:n,output:i}),TV=r=>(e,t)=>async n=>{const{response:i}=await e(n),{operationSchema:a}=vc(t),[,s,o,l,u,c]=a??[];try{const f=await r.protocol.deserializeResponse(MI(s,o,l,u,c),{...r,...t},i);return{response:i,output:f}}catch(f){if(Object.defineProperty(f,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in f)){const d="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{f.message+=`
|
|
3040
3040
|
`+d}catch{!t.logger||t.logger?.constructor?.name==="NoOpLogger"?console.warn(d):t.logger?.warn?.(d)}typeof f.$responseBodyText<"u"&&f.$response&&(f.$response.body=f.$responseBodyText);try{if(sc.isInstance(i)){const{headers:h={},statusCode:g}=i,v=Object.entries(h);f.$metadata={httpStatusCode:g,requestId:Bv(/^x-[\w-]+-request-?id$/,v),extendedRequestId:Bv(/^x-[\w-]+-id-2$/,v),cfId:Bv(/^x-[\w-]+-cf-id$/,v)}}}catch{}}throw f}},Bv=(r,e)=>(e.find(([t])=>t.match(r))||[void 0,void 0])[1],FV=r=>(e,t)=>async n=>{const{operationSchema:i}=vc(t),[,a,s,o,l,u]=i??[],c=t.endpointV2?async()=>L1(t.endpointV2):r.endpoint,f=await r.protocol.serializeRequest(MI(a,s,o,l,u),n.input,{...r,...t,endpoint:c});return e({...n,request:f})},IV={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},PV={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function DV(r){return{applyToStack:e=>{e.add(FV(r),PV),e.add(TV(r),IV),r.protocol.setSerdeContext(r)}}}const Mv=[];function zd(r){if(typeof r=="object")return r;if(r=r|0,Mv[r])return Mv[r];const e={};let t=0;for(const n of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(r>>t++&1)===1&&(e[n]=1);return Mv[r]=e}const kd={it:Symbol.for("@smithy/nor-struct-it"),ns:Symbol.for("@smithy/ns")},_v=[],Nv={};class vi{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=vi.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(e,t){this.ref=e,this.memberName=t;const n=[];let i=e,a=e;for(this._isMemberSchema=!1;Lv(i);)n.push(i[1]),i=i[0],a=Yp(i),this._isMemberSchema=!0;if(n.length>0){this.memberTraits={};for(let s=n.length-1;s>=0;--s){const o=n[s];Object.assign(this.memberTraits,zd(o))}}else this.memberTraits=0;if(a instanceof vi){const s=this.memberTraits;Object.assign(this,a),this.memberTraits=Object.assign({},s,a.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=t??a.memberName;return}if(this.schema=Yp(a),RV(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(a),this.traits=0),this._isMemberSchema&&!t)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){const t=this.prototype.isPrototypeOf(e);return!t&&typeof e=="object"&&e!==null?e.symbol===this.symbol:t}static of(e){const t=typeof e=="function"||typeof e=="object"&&e!==null;if(typeof e=="number"){if(_v[e])return _v[e]}else if(typeof e=="string"){if(Nv[e])return Nv[e]}else if(t&&e[kd.ns])return e[kd.ns];const n=Yp(e);if(n instanceof vi)return n;if(Lv(n)){const[a,s]=n;if(a instanceof vi)return Object.assign(a.getMergedTraits(),zd(s)),a;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}const i=new vi(n);return t?e[kd.ns]=i:typeof n=="string"?Nv[n]=i:typeof n=="number"?_v[n]=i:i}getSchema(){const e=this.schema;return Array.isArray(e)&&e[0]===0?e[4]:e}getName(e=!1){const{name:t}=this;return!e&&t&&t.includes("#")?t.split("#")[1]:t||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){const e=this.getSchema();return typeof e=="number"?e>=64&&e<128:e[0]===1}isMapSchema(){const e=this.getSchema();return typeof e=="number"?e>=128&&e<=255:e[0]===2}isStructSchema(){const e=this.getSchema();if(typeof e!="object")return!1;const t=e[0];return t===3||t===-3||t===4}isUnionSchema(){const e=this.getSchema();return typeof e!="object"?!1:e[0]===4}isBlobSchema(){const e=this.getSchema();return e===21||e===42}isTimestampSchema(){const e=this.getSchema();return typeof e=="number"&&e>=4&&e<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){const{streaming:e}=this.getMergedTraits();return!!e||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return zd(this.memberTraits)}getOwnTraits(){return zd(this.traits)}getKeySchema(){const[e,t]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!t)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const n=this.getSchema(),i=e?15:n[4]??0;return Td([i,0],"key")}getValueSchema(){const e=this.getSchema(),[t,n,i]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],a=typeof e=="number"?63&e:e&&typeof e=="object"&&(n||i)?e[3+e[0]]:t?15:void 0;if(a!=null)return Td([a,0],n?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){const t=this.getSchema();if(this.isStructSchema()&&t[4].includes(e)){const n=t[4].indexOf(e),i=t[5][n];return Td(Lv(i)?i:[i,0],e)}if(this.isDocumentSchema())return Td([15,0],e);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${e}.`)}getMemberSchemas(){const e={};try{for(const[t,n]of this.structIterator())e[t]=n}catch{}return e}getEventStreamMember(){if(this.isStructSchema()){for(const[e,t]of this.structIterator())if(t.isStreaming()&&t.isStructSchema())return e}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const e=this.getSchema(),t=e[4].length;let n=e[kd.it];if(n&&t===n.length){yield*n;return}n=Array(t);for(let i=0;i<t;++i){const a=e[4][i],s=Td([e[5][i],0],a);yield n[i]=[a,s]}e[kd.it]=n}}function Td(r,e){if(r instanceof vi)return Object.assign(r,{memberName:e,_isMemberSchema:!0});const t=vi;return new t(r,e)}const Lv=r=>Array.isArray(r)&&r.length===2,RV=r=>Array.isArray(r)&&r.length>=5;class Zi{namespace;schemas;exceptions;static registries=new Map;constructor(e,t=new Map,n=new Map){this.namespace=e,this.schemas=t,this.exceptions=n}static for(e){return Zi.registries.has(e)||Zi.registries.set(e,new Zi(e)),Zi.registries.get(e)}copyFrom(e){const{schemas:t,exceptions:n}=this;for(const[i,a]of e.schemas)t.has(i)||t.set(i,a);for(const[i,a]of e.exceptions)n.has(i)||n.set(i,a)}register(e,t){const n=this.normalizeShapeId(e);for(const i of[this,Zi.for(n.split("#")[0])])i.schemas.set(n,t)}getSchema(e){const t=this.normalizeShapeId(e);if(!this.schemas.has(t)){if(!e.includes("#")){const n="#"+e,i=[];for(const[a,s]of this.schemas.entries())a.endsWith(n)&&i.push(s);if(i.length===1)return i[0]}throw new Error(`@smithy/core/schema - schema not found for ${t}`)}return this.schemas.get(t)}registerError(e,t){const n=e,i=n[1];for(const a of[this,Zi.for(i)])a.schemas.set(i+"#"+n[2],n),a.exceptions.set(n,t)}getErrorCtor(e){const t=e;return this.exceptions.has(t)?this.exceptions.get(t):Zi.for(t[1]).exceptions.get(t)}getBaseException(){for(const e of this.exceptions.keys())if(Array.isArray(e)){const[,t,n]=e,i=t+"#"+n;if(i.startsWith("smithy.ts.sdk.synthetic.")&&i.endsWith("ServiceException"))return e}}find(e){for(const t of this.schemas.values())if(e(t))return t}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){return e.includes("#")?e:this.namespace+"#"+e}}const Uv="***SensitiveInformation***";function vA(r,e){if(e==null)return e;const t=vi.of(r);if(t.getMergedTraits().sensitive)return Uv;if(t.isListSchema()){if(!!t.getValueSchema().getMergedTraits().sensitive)return Uv}else if(t.isMapSchema()){if(!!t.getKeySchema().getMergedTraits().sensitive||!!t.getValueSchema().getMergedTraits().sensitive)return Uv}else if(t.isStructSchema()&&typeof e=="object"){const n=e,i={};for(const[a,s]of t.structIterator())n[a]!=null&&(i[a]=vA(s,n[a]));return i}return e}class U1{middlewareStack=bg();schema;static classBuilder(){return new OV}resolveMiddlewareWithContext(e,t,n,{middlewareFn:i,clientName:a,commandName:s,inputFilterSensitiveLog:o,outputFilterSensitiveLog:l,smithyContext:u,additionalContext:c,CommandCtor:f}){for(const A of i.bind(this)(f,e,t,n))this.middlewareStack.use(A);const d=e.concat(this.middlewareStack),{logger:h}=t,g={logger:h,clientName:a,commandName:s,inputFilterSensitiveLog:o,outputFilterSensitiveLog:l,[mA]:{commandInstance:this,...u},...c},{requestHandler:v}=t;let y=n??{};return u.eventStream&&(y={isEventStream:!0,...y}),d.resolve(A=>v.handle(A.request,y),g)}}class OV{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,n={}){return this._smithyContext={service:e,operation:t,...n},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=n=>n,t=n=>n){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){const e=this;let t;return t=class extends U1{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[n]){super(),this.input=n??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(n,i,a){const s=e._operationSchema,o=s?.[4]??s?.input,l=s?.[5]??s?.output;return this.resolveMiddlewareWithContext(n,i,a,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(s?vA.bind(null,o):u=>u),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(s?vA.bind(null,l):u=>u),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}class Lu extends Error{$fault;$response;$retryable;$metadata;constructor(e){super(e.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;const t=e;return Lu.prototype.isPrototypeOf(t)||!!t.$fault&&!!t.$metadata&&(t.$fault==="client"||t.$fault==="server")}static[Symbol.hasInstance](e){if(!e)return!1;const t=e;return this===Lu?Lu.isInstance(e):Lu.isInstance(e)?t.name&&this.name?this.prototype.isPrototypeOf(e)||t.name===this.name:this.prototype.isPrototypeOf(e):!1}}const OE=(r,e={})=>{Object.entries(e).filter(([,n])=>n!==void 0).forEach(([n,i])=>{(r[n]==null||r[n]==="")&&(r[n]=i)});const t=r.message||r.Message||"UnknownError";return r.message=t,delete r.Message,r},BV=r=>{switch(r){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},_I=Object.values(Sf),MV=r=>{const e=[];for(const t in Sf){const n=Sf[t];r[n]!==void 0&&e.push({algorithmId:()=>n,checksumConstructor:()=>r[n]})}for(const[t,n]of Object.entries(r.checksumAlgorithms??{}))e.push({algorithmId:()=>t,checksumConstructor:()=>n});return{addChecksumAlgorithm(t){r.checksumAlgorithms=r.checksumAlgorithms??{};const n=t.algorithmId(),i=t.checksumConstructor();_I.includes(n)?r.checksumAlgorithms[n.toUpperCase()]=i:r.checksumAlgorithms[n]=i,e.push(t)},checksumAlgorithms(){return e}}},_V=r=>{const e={};return r.checksumAlgorithms().forEach(t=>{const n=t.algorithmId();_I.includes(n)&&(e[n]=t.checksumConstructor())}),e},NV=r=>({setRetryStrategy(e){r.retryStrategy=e},retryStrategy(){return r.retryStrategy}}),LV=r=>{const e={};return e.retryStrategy=r.retryStrategy(),e},UV=r=>Object.assign(MV(r),NV(r)),VV=r=>Object.assign(_V(r),LV(r));class NI{trace(){}debug(){}info(){}warn(){}error(){}}const LI="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",BE=Object.entries(LI).reduce((r,[e,t])=>(r[t]=Number(e),r),{}),zV=LI.split(""),Gu=6,Zd=8,$V=63,Zg=r=>{let e=r.length/4*3;r.slice(-2)==="=="?e-=2:r.slice(-1)==="="&&e--;const t=new ArrayBuffer(e),n=new DataView(t);for(let i=0;i<r.length;i+=4){let a=0,s=0;for(let u=i,c=i+3;u<=c;u++)if(r[u]!=="="){if(!(r[u]in BE))throw new TypeError(`Invalid character ${r[u]} in base64 string.`);a|=BE[r[u]]<<(c-u)*Gu,s+=Gu}else a>>=Gu;const o=i/4*3;a>>=s%Zd;const l=Math.floor(s/Zd);for(let u=0;u<l;u++){const c=(l-u-1)*Zd;n.setUint8(o+u,(a&255<<c)>>c)}}return new Uint8Array(t)},kl=r=>new TextEncoder().encode(r);function Cg(r){let e;typeof r=="string"?e=kl(r):e=r;const t=typeof e=="object"&&typeof e.length=="number",n=typeof e=="object"&&typeof e.byteOffset=="number"&&typeof e.byteLength=="number";if(!t&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let i="";for(let a=0;a<e.length;a+=3){let s=0,o=0;for(let u=a,c=Math.min(a+3,e.length);u<c;u++)s|=e[u]<<(c-u-1)*Zd,o+=Zd;const l=Math.ceil(o/Gu);s<<=l*Gu-o;for(let u=1;u<=l;u++){const c=(l-u)*Gu;i+=zV[(s&$V<<c)>>c]}i+="==".slice(0,4-l)}return i}function HV(r,e,t,n){return class Xp extends Uint8Array{static fromString(a,s="utf-8"){if(typeof a=="string")return s==="base64"?Xp.mutate(n(a)):Xp.mutate(e(a));throw new Error(`Unsupported conversion from ${typeof a} to Uint8ArrayBlobAdapter.`)}static mutate(a){return Object.setPrototypeOf(a,Xp.prototype),a}transformToString(a="utf-8"){return a==="base64"?t(this):r(this)}}}const em=r=>{if(typeof r=="string")return r;if(typeof r!="object"||typeof r.byteOffset!="number"||typeof r.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(r)},Ii=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function jV(r){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?()=>crypto.randomUUID():()=>{const e=new Uint8Array(16);return r(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,Ii[e[0]]+Ii[e[1]]+Ii[e[2]]+Ii[e[3]]+"-"+Ii[e[4]]+Ii[e[5]]+"-"+Ii[e[6]]+Ii[e[7]]+"-"+Ii[e[8]]+Ii[e[9]]+"-"+Ii[e[10]]+Ii[e[11]]+Ii[e[12]]+Ii[e[13]]+Ii[e[14]]+Ii[e[15]]}}const yA=r=>{if(r!=null){if(typeof r=="string"){const e=parseFloat(r);if(!Number.isNaN(e))return String(e)!==String(r)&&ZV.warn(KV(`Expected number but observed string: ${r}`)),e}if(typeof r=="number")return r;throw new TypeError(`Expected number, got ${typeof r}: ${r}`)}},GV=Math.ceil(2**127*(2-2**-23)),ME=r=>{const e=yA(r);if(e!==void 0&&!Number.isNaN(e)&&e!==1/0&&e!==-1/0&&Math.abs(e)>GV)throw new TypeError(`Expected 32-bit float, got ${r}`);return e},qV=r=>{if(r!=null){if(Number.isInteger(r)&&!Number.isNaN(r))return r;throw new TypeError(`Expected integer, got ${typeof r}: ${r}`)}},_E=r=>UI(r,16),NE=r=>UI(r,8),UI=(r,e)=>{const t=qV(r);if(t!==void 0&&WV(t,e)!==t)throw new TypeError(`Expected ${e}-bit integer, got ${r}`);return t},WV=(r,e)=>{switch(e){case 32:return Int32Array.of(r)[0];case 16:return Int16Array.of(r)[0];case 8:return Int8Array.of(r)[0]}},QV=r=>yA(typeof r=="string"?tm(r):r),YV=r=>ME(typeof r=="string"?tm(r):r),XV=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,tm=r=>{const e=r.match(XV);if(e===null||e[0].length!==r.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(r)},xg=r=>_E(typeof r=="string"?tm(r):r),JV=r=>NE(typeof r=="string"?tm(r):r),KV=r=>String(new TypeError(r).stack||r).split(`
|
|
3041
3041
|
`).slice(0,5).filter(e=>!e.includes("stackTraceWarning")).join(`
|
|
3042
|
-
`),ZV={warn:console.warn},ez=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],V1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function tz(r){const e=r.getUTCFullYear(),t=r.getUTCMonth(),n=r.getUTCDay(),i=r.getUTCDate(),a=r.getUTCHours(),s=r.getUTCMinutes(),o=r.getUTCSeconds(),l=i<10?`0${i}`:`${i}`,u=a<10?`0${a}`:`${a}`,c=s<10?`0${s}`:`${s}`,f=o<10?`0${o}`:`${o}`;return`${ez[n]}, ${l} ${V1[t]} ${e} ${u}:${c}:${f} GMT`}const rz=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),nz=r=>{if(r==null)return;if(typeof r!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=rz.exec(r);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[t,n,i,a,s,o,l,u,c]=e,f=xg(Ef(n)),d=yo(i,"month",1,12),h=yo(a,"day",1,31),g=Jp(f,d,h,{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u});return c.toUpperCase()!="Z"&&g.setTime(g.getTime()-gz(c)),g},iz=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),az=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),sz=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),VI=r=>{if(r==null)return;if(typeof r!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let e=iz.exec(r);if(e){const[t,n,i,a,s,o,l,u]=e;return Jp(xg(Ef(a)),Vv(i),yo(n,"day",1,31),{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u})}if(e=az.exec(r),e){const[t,n,i,a,s,o,l,u]=e;return cz(Jp(lz(a),Vv(i),yo(n,"day",1,31),{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u}))}if(e=sz.exec(r),e){const[t,n,i,a,s,o,l,u]=e;return Jp(xg(Ef(u)),Vv(n),yo(i.trimLeft(),"day",1,31),{hours:a,minutes:s,seconds:o,fractionalMilliseconds:l})}throw new TypeError("Invalid RFC-7231 date-time value")},oz=r=>{if(r==null)return;let e;if(typeof r=="number")e=r;else if(typeof r=="string")e=QV(r);else if(typeof r=="object"&&r.tag===1)e=r.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(e)||e===1/0||e===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(e*1e3))},Jp=(r,e,t,n)=>{const i=e-1;return fz(r,i,t),new Date(Date.UTC(r,i,t,yo(n.hours,"hour",0,23),yo(n.minutes,"minute",0,59),yo(n.seconds,"seconds",0,60),pz(n.fractionalMilliseconds)))},lz=r=>{const e=new Date().getUTCFullYear(),t=Math.floor(e/100)*100+xg(Ef(r));return t<e?t+100:t},uz=50*365*24*60*60*1e3,cz=r=>r.getTime()-new Date().getTime()>uz?new Date(Date.UTC(r.getUTCFullYear()-100,r.getUTCMonth(),r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds())):r,Vv=r=>{const e=V1.indexOf(r);if(e<0)throw new TypeError(`Invalid month: ${r}`);return e+1},dz=[31,28,31,30,31,30,31,31,30,31,30,31],fz=(r,e,t)=>{let n=dz[e];if(e===1&&hz(r)&&(n=29),t>n)throw new TypeError(`Invalid day for ${V1[e]} in ${r}: ${t}`)},hz=r=>r%4===0&&(r%100!==0||r%400===0),yo=(r,e,t,n)=>{const i=JV(Ef(r));if(i<t||i>n)throw new TypeError(`${e} must be between ${t} and ${n}, inclusive`);return i},pz=r=>r==null?0:YV("0."+r)*1e3,gz=r=>{const e=r[0];let t=1;if(e=="+")t=1;else if(e=="-")t=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);const n=Number(r.substring(1,3)),i=Number(r.substring(4,6));return t*(n*60+i)*60*1e3},Ef=r=>{let e=0;for(;e<r.length-1&&r.charAt(e)==="0";)e++;return e===0?r:r.slice(e)},po=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})};po.from=r=>r&&typeof r=="object"&&(r instanceof po||"deserializeJSON"in r)?r:typeof r=="string"||Object.getPrototypeOf(r)===String.prototype?po(String(r)):po(JSON.stringify(r));po.fromObject=po.from;const LE=/^-?\d*(\.\d+)?$/;class ns{string;type;constructor(e,t){if(this.string=e,this.type=t,!LE.test(e))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!="object")return!1;const t=e;return ns.prototype.isPrototypeOf(e)||t.type==="bigDecimal"&&LE.test(t.string)}}const zI={},AA={};for(let r=0;r<256;r++){let e=r.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),zI[r]=e,AA[e]=r}function $I(r){if(r.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(r.length/2);for(let t=0;t<r.length;t+=2){const n=r.slice(t,t+2).toLowerCase();if(n in AA)e[t/2]=AA[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return e}function Ao(r){let e="";for(let t=0;t<r.byteLength;t++)e+=zI[r[t]];return e}const UE=typeof TextEncoder=="function"?new TextEncoder:null,mz=r=>{if(typeof r=="string"){if(UE)return UE.encode(r).byteLength;let e=r.length;for(let t=e-1;t>=0;t--){const n=r.charCodeAt(t);n>127&&n<=2047?e++:n>2047&&n<=65535&&(e+=2),n>=56320&&n<=57343&&t--}return e}else{if(typeof r.byteLength=="number")return r.byteLength;if(typeof r.size=="number")return r.size}throw new Error(`Body Length computation failed for ${r}`)},kf=r=>typeof r=="string"?kl(r):ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(r),vz=r=>typeof ArrayBuffer=="function"&&r instanceof ArrayBuffer||Object.prototype.toString.call(r)==="[object ArrayBuffer]",HI=async r=>{},yz=async r=>{const e=r?.Bucket||"";if(typeof r.Bucket=="string"&&(r.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),xz(e)){if(r.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!Cz(e)||e.indexOf(".")!==-1&&!String(r.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(r.ForcePathStyle=!0);return r.DisableMultiRegionAccessPoints&&(r.disableMultiRegionAccessPoints=!0,r.DisableMRAP=!0),r},Az=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,bz=/(\d+\.){3}\d+/,wz=/\.\./,Cz=r=>Az.test(r)&&!bz.test(r)&&!wz.test(r),xz=r=>{const[e,t,n,,,i]=r.split(":"),a=e==="arn"&&r.split(":").length>=6,s=!!(a&&t&&n&&i);if(a&&!s)throw new Error(`Invalid ARN: ${r} was an invalid ARN.`);return s},Sz=(r,e,t,n=!1)=>{const i=async()=>{let a;return n?a=t.clientContextParams?.[r]??t[r]??t[e]:a=t[r]??t[e],typeof a=="function"?a():a};return r==="credentialScope"||e==="CredentialScope"?async()=>{const a=typeof t.credentials=="function"?await t.credentials():t.credentials;return a?.credentialScope??a?.CredentialScope}:r==="accountId"||e==="AccountId"?async()=>{const a=typeof t.credentials=="function"?await t.credentials():t.credentials;return a?.accountId??a?.AccountId}:r==="endpoint"||e==="endpoint"?async()=>{if(t.isCustomEndpoint===!1)return;const a=await i();if(a&&typeof a=="object"){if("url"in a)return a.url.href;if("hostname"in a){const{protocol:s,hostname:o,port:l,path:u}=a;return`${s}//${o}${l?":"+l:""}${u}`}}return a}:i};function Ez(r){return async(e,t,n,i)=>{if(!n.isCustomEndpoint){let o;n.serviceConfiguredEndpoint?o=await n.serviceConfiguredEndpoint():o=await r(n.serviceId),o&&(n.endpoint=()=>Promise.resolve(L1(o)),n.isCustomEndpoint=!0)}const a=await kz(e,t,n);if(typeof n.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");const s=n.endpointProvider(a,i);if(n.isCustomEndpoint&&n.endpoint){const o=await n.endpoint();if(o?.headers){s.headers??={};for(const[l,u]of Object.entries(o.headers))s.headers[l]=Array.isArray(u)?u:[u]}}return s}}const kz=async(r,e,t)=>{const n={},i=e?.getEndpointParameterInstructions?.()||{};for(const[a,s]of Object.entries(i))switch(s.type){case"staticContextParams":n[a]=s.value;break;case"contextParams":n[a]=r[s.name];break;case"clientContextParams":case"builtInParams":n[a]=await Sz(s.name,a,t,s.type!=="builtInParams")();break;case"operationContextParams":n[a]=s.get(r);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(s))}return Object.keys(i).length===0&&Object.assign(n,t),String(t.serviceId).toLowerCase()==="s3"&&await yz(n),n};function Tz(r,e,t){r.__smithy_context?r.__smithy_context.features||(r.__smithy_context.features={}):r.__smithy_context={features:{}},r.__smithy_context.features[e]=t}function Fz(r){const e=Ez(r);return({config:t,instructions:n})=>(i,a)=>async s=>{t.isCustomEndpoint&&Tz(a,"ENDPOINT_OVERRIDE","N");const o=await e(s.input,{getEndpointParameterInstructions(){return n}},{...t},a);a.endpointV2=o,a.authSchemes=o.properties?.authSchemes;const l=a.authSchemes?.[0];if(l){a.signing_region=l.signingRegion,a.signing_service=l.signingName;const c=vc(a)?.selectedHttpAuthScheme?.httpAuthOption;c&&(c.signingProperties=Object.assign(c.signingProperties||{},{signing_region:l.signingRegion,signingRegion:l.signingRegion,signing_service:l.signingName,signingName:l.signingName,signingRegionSet:l.signingRegionSet},l.properties))}return i({...s})}}const Iz={name:"serializerMiddleware"},Pz={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Iz.name};function Dz(r){const e=Fz(r);return(t,n)=>({applyToStack:i=>{i.addRelativeTo(e({config:t,instructions:n}),Pz)}})}function Rz(r){return e=>{const t=e.tls??!0,{endpoint:n,useDualstackEndpoint:i,useFipsEndpoint:a}=e,s=n!=null?async()=>L1(await Bs(n)()):void 0,l=Object.assign(e,{endpoint:s,tls:t,isCustomEndpoint:!!n,useDualstackEndpoint:Bs(i??!1),useFipsEndpoint:Bs(a??!1)});let u;return l.serviceConfiguredEndpoint=async()=>(e.serviceId&&!u&&(u=r(e.serviceId)),u),l}}class z1{nodes;root;conditions;results;constructor(e,t,n,i){this.nodes=e,this.root=t,this.conditions=n,this.results=i}static from(e,t,n,i){return new z1(e,t,n,i)}}class Oz{capacity;data=new Map;parameters=[];constructor({size:e,params:t}){this.capacity=e??50,t&&(this.parameters=t)}get(e,t){const n=this.hash(e);if(n===!1)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const i=this.data.keys();let a=0;for(;;){const{value:s,done:o}=i.next();if(this.data.delete(s),o||++a>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t="";const{parameters:n}=this;if(n.length===0)return!1;for(const i of n){const a=String(e[i]??"");if(a.includes("|;"))return!1;t+=a+"|;"}return t}}class Ba extends Error{constructor(e){super(e),this.name="EndpointError"}}const Bz="endpoints";function Sg(r){return typeof r!="object"||r==null?r:"ref"in r?`$${Sg(r.ref)}`:"fn"in r?`${r.fn}(${(r.argv||[]).map(Sg).join(", ")})`:JSON.stringify(r,null,2)}const $1={},Mz=(r,e)=>r===e;function _z(...r){for(const e of r)if(e!=null)return e}const Nz=r=>{const e=r.split("."),t=[];for(const n of e){const i=n.indexOf("[");if(i!==-1){if(n.indexOf("]")!==n.length-1)throw new Ba(`Path: '${r}' does not end with ']'`);const a=n.slice(i+1,-1);if(Number.isNaN(parseInt(a)))throw new Ba(`Invalid array index: '${a}' in path: '${r}'`);i!==0&&t.push(n.slice(0,i)),t.push(a)}else t.push(n)}return t},jI=(r,e)=>Nz(e).reduce((t,n)=>{if(typeof t!="object")throw new Ba(`Index '${n}' in '${e}' not found in '${JSON.stringify(r)}'`);if(Array.isArray(t)){const i=parseInt(n);return t[i<0?t.length+i:i]}return t[n]},r),Lz=r=>r!=null;function Uz(r,e,t){return r?e:t}const Vz=r=>!r,zz=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),GI=r=>zz.test(r)||r.startsWith("[")&&r.endsWith("]"),zv={[xf.HTTP]:80,[xf.HTTPS]:443},$z=r=>{const e=(()=>{try{if(r instanceof URL)return r;if(typeof r=="object"&&"hostname"in r){const{hostname:d,port:h,protocol:g="",path:v="",query:y={}}=r,A=new URL(`${g}//${d}${h?`:${h}`:""}${v}`);return A.search=Object.entries(y).map(([C,S])=>`${C}=${S}`).join("&"),A}return new URL(r)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(r)} as a whatwg URL.`),null;const t=e.href,{host:n,hostname:i,pathname:a,protocol:s,search:o}=e;if(o)return null;const l=s.slice(0,-1);if(!Object.values(xf).includes(l))return null;const u=GI(i),c=t.includes(`${n}:${zv[l]}`)||typeof r=="string"&&r.includes(`${n}:${zv[l]}`),f=`${n}${c?`:${zv[l]}`:""}`;return{scheme:l,authority:f,path:a,normalizedPath:a.endsWith("/")?a:`${a}/`,isIp:u}};function Hz(r,e,t){if(t===1)return[r];if(r==="")return[""];const n=r.split(e);return t===0?n:n.slice(0,t-1).concat(n.slice(1).join(e))}const jz=(r,e)=>r===e,Gz=(r,e,t,n)=>r==null||e>=t||r.length<t||/[^\u0000-\u007f]/.test(r)?null:n?r.substring(r.length-t,r.length-e):r.substring(e,t),qz=r=>encodeURIComponent(r).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Wz={booleanEquals:Mz,coalesce:_z,getAttr:jI,isSet:Lz,isValidHostLabel:Kg,ite:Uz,not:Vz,parseURL:$z,split:Hz,stringEquals:jz,substring:Gz,uriEncode:qz},qI=(r,e)=>{const t=[],{referenceRecord:n,endpointParams:i}=e;let a=0;for(;a<r.length;){const s=r.indexOf("{",a);if(s===-1){t.push(r.slice(a));break}t.push(r.slice(a,s));const o=r.indexOf("}",s);if(o===-1){t.push(r.slice(s));break}r[s+1]==="{"&&r[o+1]==="}"&&(t.push(r.slice(s+1,o)),a=o+2);const l=r.substring(s+1,o);if(l.includes("#")){const[u,c]=l.split("#");t.push(jI(n[u]??i[u],c))}else t.push(n[l]??i[l]);a=o+1}return t.join("")},Qz=({ref:r},e)=>e.referenceRecord[r]??e.endpointParams[r],rm=(r,e,t)=>{if(typeof r=="string")return qI(r,t);if(r.fn)return QI.callFunction(r,t);if(r.ref)return Qz(r,t);throw new Ba(`'${e}': ${String(r)} is not a string, function or reference.`)},WI=({fn:r,argv:e},t)=>{const n=Array(e.length);for(let s=0;s<n.length;++s){const o=e[s];typeof o=="boolean"||typeof o=="number"?n[s]=o:n[s]=QI.evaluateExpression(o,"arg",t)}const i=r.indexOf(".");if(i!==-1){const o=$1[r.slice(0,i)]?.[r.slice(i+1)];if(typeof o=="function")return o(...n)}const a=Wz[r];if(typeof a=="function")return a(...n);throw new Error(`function ${r} not loaded in endpointFunctions.`)},QI={evaluateExpression:rm,callFunction:WI},Yz=(r,e)=>{const{assign:t}=r;if(t&&t in e.referenceRecord)throw new Ba(`'${t}' is already defined in Reference Record.`);const n=WI(r,e);e.logger?.debug?.(`${Bz} evaluateCondition: ${Sg(r)} = ${Sg(n)}`);const i=n===""?!0:!!n;return t!=null?{result:i,toAssign:{name:t,value:n}}:{result:i}},Xz=(r,e)=>Object.entries(r??{}).reduce((t,[n,i])=>(t[n]=i.map(a=>{const s=rm(a,"Header value entry",e);if(typeof s!="string")throw new Ba(`Header '${n}' value '${s}' is not a string`);return s}),t),{}),YI=(r,e)=>Object.entries(r).reduce((t,[n,i])=>(t[n]=JI.getEndpointProperty(i,e),t),{}),XI=(r,e)=>{if(Array.isArray(r))return r.map(t=>XI(t,e));switch(typeof r){case"string":return qI(r,e);case"object":if(r===null)throw new Ba(`Unexpected endpoint property: ${r}`);return JI.getEndpointProperties(r,e);case"boolean":return r;default:throw new Ba(`Unexpected endpoint property type: ${typeof r}`)}},JI={getEndpointProperty:XI,getEndpointProperties:YI},Jz=(r,e)=>{const t=rm(r,"Endpoint URL",e);if(typeof t=="string")try{return new URL(t)}catch(n){throw console.error(`Failed to construct URL with ${t}`,n),n}throw new Ba(`Endpoint URL must be a string, got ${typeof t}`)},$v=1e8,Kz=(r,e)=>{const{nodes:t,root:n,results:i,conditions:a}=r;let s=n;const o={},l={referenceRecord:o,endpointParams:e.endpointParams,logger:e.logger};for(;s!==1&&s!==-1&&s<$v;){const u=3*(Math.abs(s)-1),[c,f,d]=[t[u],t[u+1],t[u+2]],[h,g,v]=a[c],y=Yz({fn:h,assign:v,argv:g},l);if(y.toAssign){const{name:A,value:C}=y.toAssign;o[A]=C}s=s>=0===y.result?f:d}if(s>=$v){const u=i[s-$v];if(u[0]===-1){const[,h]=u;throw new Ba(rm(h,"Error",l))}const[c,f,d]=u;return{url:Jz(c,l),properties:YI(f,l),headers:Xz(d??{},l)}}throw new Ba("No matching endpoint.")},Zz=Rz(HI),KI=Dz(HI);class Hv extends HV(em,kl,Cg,Zg){}const e$=r=>crypto.getRandomValues(r),ZI=jV(e$),t$=ZI,bA=async(r=new Uint8Array,e)=>{if(r instanceof Uint8Array)return Hv.mutate(r);if(!r)return Hv.mutate(new Uint8Array);const t=e.streamCollector(r);return Hv.mutate(await t)};class r${serdeContext;setSerdeContext(e){this.serdeContext=e}}class n$ extends r${options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=Zi.for(e.defaultNamespace);for(const t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return na}getResponseType(){return sc}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,t){if("url"in t){e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,e.query||(e.query={});for(const[n,i]of t.url.searchParams.entries())e.query[n]=i;if(t.headers)for(const n in t.headers)e.headers[n]=t.headers[n].join(", ");return e}else{if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(const n in t.headers)e.headers[n]=t.headers[n];return e}}setHostPrefix(e,t,n){if(this.serdeContext?.disableHostPrefix)return;const i=vi.of(t.input),a=zd(t.traits??{});if(a.endpoint){let s=a.endpoint?.[0];if(typeof s=="string"){for(const[o,l]of i.structIterator()){if(!l.getMergedTraits().hostLabel)continue;const u=n[o];if(typeof u!="string")throw new Error(`@smithy/core/schema - ${o} in input must be a string as hostLabel.`);s=s.replace(`{${o}}`,u)}e.hostname=s+e.hostname}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n})}async loadEventStreamCapability(){const{EventStreamSerde:e,eventStreamSerdeProvider:t}=await Promise.resolve().then(()=>require("./index.browser-DvWaDnsa.cjs")),n=this.resolveEventStreamMarshaller(t);return new e({marshaller:n,serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}resolveEventStreamMarshaller(e){const t=this.serdeContext;return t.eventStreamMarshaller?t.eventStreamMarshaller:e(this.serdeContext)}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,t,n,i,a){return[]}getEventStreamMarshaller(){const e=this.serdeContext;if(!e.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class i$ extends n${async serializeRequest(e,t,n){const i=this.serializer,a={},s={},o=await n.endpoint(),l=vi.of(e?.input),u=l.getSchema();let c;const f=t&&typeof t=="object"?t:{},d=new na({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:a,headers:s,body:void 0});if(o&&(this.updateServiceEndpoint(d,o),this.setHostPrefix(d,e,f)),f){const h=l.getEventStreamMember();if(h){if(f[h]){const g={};for(const[v,y]of l.structIterator())v!==h&&f[v]&&(i.write(y,f[v]),g[v]=i.flush());c=await this.serializeEventStream({eventStream:f[h],requestSchema:l,initialRequest:g})}}else i.write(u,f),c=i.flush()}return d.headers=Object.assign(d.headers,s),d.query=a,d.body=c,d.method="POST",d}async deserializeResponse(e,t,n){const i=this.deserializer,a=vi.of(e.output),s={};if(n.statusCode>=300){const l=await bA(n.body,t);throw l.byteLength>0&&Object.assign(s,await i.read(15,l)),await this.handleError(e,t,n,s,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const l in n.headers){const u=n.headers[l];delete n.headers[l],n.headers[l.toLowerCase()]=u}const o=a.getEventStreamMember();if(o)s[o]=await this.deserializeEventStream({response:n,responseSchema:a,initialResponseContainer:s});else{const l=await bA(n.body,t);l.byteLength>0&&Object.assign(s,await i.read(a,l))}return s.$metadata=this.deserializeMetadata(n),s}}function eP(r,e){if(e.timestampFormat.useTrait&&r.isTimestampSchema()&&(r.getSchema()===5||r.getSchema()===6||r.getSchema()===7))return r.getSchema();const{httpLabel:t,httpPrefixHeaders:n,httpHeader:i,httpQuery:a}=r.getMergedTraits();return(e.httpBindings?typeof n=="string"||i?6:a||t?5:void 0:void 0)??e.timestampFormat.default}const a$=r=>({setHttpHandler(e){r.httpHandler=e},httpHandler(){return r.httpHandler},updateHttpClientConfig(e,t){r.httpHandler?.updateHttpClientConfig(e,t)},httpHandlerConfigs(){return r.httpHandler.httpHandlerConfigs()}}),s$=r=>({httpHandler:r.httpHandler()}),VE="content-length";function o$(r){return e=>async t=>{const n=t.request;if(na.isInstance(n)){const{body:i,headers:a}=n;if(i&&Object.keys(a).map(s=>s.toLowerCase()).indexOf(VE)===-1)try{const s=r(i);n.headers={...n.headers,[VE]:String(s)}}catch{}}return e({...t,request:n})}}const l$={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},u$=r=>({applyToStack:e=>{e.add(o$(r.bodyLengthChecker),l$)}}),Cl=r=>encodeURIComponent(r).replace(/[!'()*]/g,c$),c$=r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`;function d$(r){const e=[];for(let t of Object.keys(r).sort()){const n=r[t];if(t=Cl(t),Array.isArray(n))for(let i=0,a=n.length;i<a;i++)e.push(`${t}=${Cl(n[i])}`);else{let i=t;(n||typeof n=="string")&&(i+=`=${Cl(n)}`),e.push(i)}}return e.join("&")}const f$=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],h$=["TimeoutError","RequestTimeout","RequestTimeoutException"],p$=[500,502,503,504],g$=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],m$=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND","EAI_AGAIN"],v$=r=>r?.$retryable!==void 0,y$=r=>r.$metadata?.clockSkewCorrected,A$=r=>{const e=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return r&&r instanceof TypeError?e.has(r.message):!1},tP=r=>r.$metadata?.httpStatusCode===429||f$.includes(r.name)||r.$retryable?.throttling==!0,H1=(r,e=0)=>v$(r)||y$(r)||r.name==="InvalidSignatureException"&&r.message?.includes("Signature expired")||h$.includes(r.name)||g$.includes(r?.code||"")||m$.includes(r?.code||"")||p$.includes(r.$metadata?.httpStatusCode||0)||A$(r)||w$(r)||r.cause!==void 0&&e<=10&&H1(r.cause,e+1),b$=r=>{if(r.$metadata?.httpStatusCode!==void 0){const e=r.$metadata.httpStatusCode;return 500<=e&&e<=599&&!H1(r)}return!1};function w$(r){return r.code==="ERR_HTTP2_STREAM_ERROR"&&r.message.includes("NGHTTP2_REFUSED_STREAM")}const rP=20*1e3,zE=500,C$=1,x$="amz-sdk-invocation-id",S$="amz-sdk-request";function E$(r,e){if(sc.isInstance(r))for(const t of Object.keys(r.headers)){const n=t.toLowerCase();if(n==="retry-after"){const i=r.headers[t];let a=NaN;if(i.endsWith("GMT"))try{a=(VI(i).getTime()-Date.now())/1e3}catch(s){e?.trace?.("Failed to parse retry-after header"),e?.trace?.(s)}else i.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?a=Number(i.match(/ GMT, ([\d.]+)$/)?.[1]):i.match(/^((\d+)|(\d+\.\d+))$/)?a=Number(i):Date.parse(i)>=Date.now()&&(a=(Date.parse(i)-Date.now())/1e3);return isNaN(a)?void 0:new Date(Date.now()+a*1e3)}else if(n==="x-amz-retry-after"){const i=r.headers[t],a=Number(i);if(isNaN(a)){e?.trace?.(`Failed to parse x-amz-retry-after=${i}`);return}return new Date(Date.now()+a)}}}const k$=r=>r instanceof Error?r:r instanceof Object?Object.assign(new Error,r):typeof r=="string"?new Error(r):new Error(`AWS SDK error wrapper for ${r}`);function T$(r){return e=>(t,n)=>async i=>{let a=await e.retryStrategy();const s=await e.maxAttempts();if(I$(a)){a=a;let o=await a.acquireInitialRetryToken((n.partition_id??"")+(n.__retryLongPoll?":longpoll":"")),l=new Error,u=0,c=0;const{request:f}=i,d=na.isInstance(f);for(d&&(f.headers[x$]=ZI());;)try{d&&(f.headers[S$]=`attempt=${u+1}; max=${s}`);const{response:h,output:g}=await t(i);return a.recordSuccess(o),g.$metadata.attempts=u+1,g.$metadata.totalRetryDelay=c,{response:h,output:g}}catch(h){const g=P$(h,e.logger);if(l=k$(h),d&&r(f))throw(n.logger instanceof NI?console:n.logger)?.warn("An error was encountered in a non-retryable streaming request."),l;try{o=await a.refreshRetryTokenForRetry(o,g)}catch{throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=u+1,l.$metadata.totalRetryDelay=c,l}u=o.getRetryCount();const v=o.getRetryDelay();c+=(o?.$retryLog?.acquisitionDelay??0)+v,v>0&&await F$(v)}}else return a=a,a?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",a.mode]]),a.retry(t,i)}}const F$=r=>new Promise(e=>setTimeout(e,r)),I$=r=>typeof r.acquireInitialRetryToken<"u"&&typeof r.refreshRetryTokenForRetry<"u"&&typeof r.recordSuccess<"u",P$=(r,e)=>{const t={error:r,errorType:D$(r)},n=E$(r.$response,e);return n&&(t.retryAfterHint=n),t},D$=r=>tP(r)?"THROTTLING":H1(r)?"TRANSIENT":b$(r)?"SERVER_ERROR":"CLIENT_ERROR",R$={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0};function O$(r){const e=T$(r);return t=>({applyToStack:n=>{n.add(e(t),R$)}})}class j1{static setTimeoutFn=(e,t)=>setTimeout(e,t);beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(e){let t;this.updateMeasuredRate();const n=e;if(n?.errorType==="THROTTLING"||tP(n?.error??e)){const s=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=s,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(s),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const a=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(a)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(e){if(this.enabled){for(this.refillTokenBucket();e>this.availableTokens;){const t=(e-this.availableTokens)/this.fillRate*1e3;await new Promise(n=>j1.setTimeoutFn(n,t)),this.refillTokenBucket()}this.availableTokens=this.availableTokens-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}const t=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+t),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(e*2)/2;if(this.requestCount++,t>this.lastTxRateBucket){const n=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}class Ei{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return Ei.v2026?50:100}static throttlingDelay(){return Ei.v2026?1e3:500}static cost(){return Ei.v2026?14:5}static throttlingCost(){return Ei.v2026?5:10}static modifiedCostType(){return Ei.v2026?"THROTTLING":"TRANSIENT"}}class B${x=Ei.delay();computeNextBackoffDelay(e){const i=Math.random()*Math.min(this.x*2**e,rP);return Math.floor(i)}setDelayBase(e){this.x=e}}class $E{delay;count;cost;longPoll;$retryLog={acquisitionDelay:0};constructor(e,t,n,i){this.delay=e,this.count=t,this.cost=n,this.longPoll=i}getRetryCount(){return this.count}getRetryDelay(){return Math.min(rP,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}var Po;(function(r){r.STANDARD="standard",r.ADAPTIVE="adaptive"})(Po||(Po={}));const ef=3,M$=Po.STANDARD,kp={incompatible:1,attempts:2,capacity:3};class wA{mode=Po.STANDARD;retryBackoffStrategy;capacity=zE;maxAttemptsProvider;baseDelay;constructor(e){typeof e=="number"?this.maxAttemptsProvider=async()=>e:typeof e=="function"?this.maxAttemptsProvider=e:e&&typeof e=="object"&&(this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff),this.maxAttemptsProvider??=async()=>ef,this.baseDelay??=Ei.delay(),this.retryBackoffStrategy??=new B$}async acquireInitialRetryToken(e){return new $E(Ei.delay(),0,void 0,Ei.v2026&&e.includes(":longpoll"))}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts(),i=this.retryCode(e,t,n),a=i===0,s=e.isLongPoll?.();if(a||s){const o=t.errorType;this.retryBackoffStrategy.setDelayBase(o==="THROTTLING"?Ei.throttlingDelay():this.baseDelay);const l=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount());let u=l;if(t.retryAfterHint instanceof Date&&(u=Math.max(l,Math.min(t.retryAfterHint.getTime()-Date.now(),l+5e3))),a){const c=this.getCapacityCost(o);this.capacity-=c;const f=new $E(0,e.getRetryCount()+1,c,e.isLongPoll?.()??!1);return await new Promise(d=>setTimeout(d,u)),f.$retryLog.acquisitionDelay=u,f}else{const c=Ei.v2026&&i===kp.capacity&&s?u:0;c>0&&await new Promise(f=>setTimeout(f,c))}}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.min(zE,this.capacity+(e.getRetryCost()??C$))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${ef}`),ef}}retryCode(e,t,n){const i=e.getRetryCount()+1,a=this.isRetryableError(t.errorType)?0:kp.incompatible,s=i<n?0:kp.attempts,o=this.capacity>=this.getCapacityCost(t.errorType)?0:kp.capacity;return a||s||o}getCapacityCost(e){return e===Ei.modifiedCostType()?Ei.throttlingCost():Ei.cost()}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class _${mode=Po.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(e,t){const{rateLimiter:n}=t??{};this.rateLimiter=n??new j1,this.standardRetryStrategy=t?new wA({maxAttempts:typeof e=="number"?e:3,...t}):new wA(e)}async acquireInitialRetryToken(e){const t=await this.standardRetryStrategy.acquireInitialRetryToken(e);return await this.rateLimiter.getSendToken(),t}async refreshRetryTokenForRetry(e,t){this.rateLimiter.updateClientSendingRate(t);const n=await this.standardRetryStrategy.refreshRetryTokenForRetry(e,t);return await this.rateLimiter.getSendToken(),n}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}const N$=(r,e)=>{const{retryStrategy:t,retryMode:n}=r,{defaultMaxAttempts:i=ef,defaultBaseDelay:a=Ei.delay()}={},s=Bs(r.maxAttempts??i);let o=t?Promise.resolve(t):void 0;const l=async()=>{const u=await s();return await Bs(n)()===Po.ADAPTIVE?new _$(s,{maxAttempts:u,baseDelay:a}):new wA({maxAttempts:u,baseDelay:a})};return Object.assign(r,{maxAttempts:s,retryStrategy:()=>o??=l()})},L$=O$(wV);Ei.v2026||=typeof process=="object"&&process.env?.AWS_NEW_RETRIES_2026==="true";function Is(r,e,t){r.__aws_sdk_context?r.__aws_sdk_context.features||(r.__aws_sdk_context.features={}):r.__aws_sdk_context={features:{}},r.__aws_sdk_context.features[e]=t}const U$=r=>e=>async t=>{if(!na.isInstance(t.request))return e(t);const{request:n}=t,{handlerProtocol:i=""}=r.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!n.headers[":authority"])delete n.headers.host,n.headers[":authority"]=n.hostname+(n.port?":"+n.port:"");else if(!n.headers.host){let a=n.hostname;n.port!=null&&(a+=`:${n.port}`),n.headers.host=a}return e(t)},V$={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},z$=r=>({applyToStack:e=>{e.add(U$(r),V$)}}),$$=()=>(r,e)=>async t=>{try{const n=await r(t),{clientName:i,commandName:a,logger:s,dynamoDbDocumentClientOptions:o={}}=e,{overrideInputFilterSensitiveLog:l,overrideOutputFilterSensitiveLog:u}=o,c=l??e.inputFilterSensitiveLog,f=u??e.outputFilterSensitiveLog,{$metadata:d,...h}=n.output;return s?.info?.({clientName:i,commandName:a,input:c(t.input),output:f(h),metadata:d}),n}catch(n){const{clientName:i,commandName:a,logger:s,dynamoDbDocumentClientOptions:o={}}=e,{overrideInputFilterSensitiveLog:l}=o,u=l??e.inputFilterSensitiveLog;throw s?.error?.({clientName:i,commandName:a,input:u(t.input),error:n,metadata:n.$metadata}),n}},H$={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},j$=r=>({applyToStack:e=>{e.add($$(),H$)}}),G$=r=>({applyToStack:e=>{}}),q$=(r,e)=>{if(!e||e.length===0)return r;const t=[];for(const n of e)for(const i of r)i.schemeId.split("#")[1]===n&&t.push(i);for(const n of r)t.find(({schemeId:i})=>i===n.schemeId)||t.push(n);return t};function W$(r){const e=new Map;for(const t of r)e.set(t.schemeId,t);return e}const Q$=(r,e)=>(t,n)=>async i=>{const a=r.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(r,n,i.input)),s=r.authSchemePreference?await r.authSchemePreference():[],o=q$(a,s),l=W$(r.httpAuthSchemes),u=vc(n),c=[];for(const f of o){const d=l.get(f.schemeId);if(!d){c.push(`HttpAuthScheme \`${f.schemeId}\` was not enabled for this service.`);continue}const h=d.identityProvider(await e.identityProviderConfigProvider(r));if(!h){c.push(`HttpAuthScheme \`${f.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:g={},signingProperties:v={}}=f.propertiesExtractor?.(r,n)||{};f.identityProperties=Object.assign(f.identityProperties||{},g),f.signingProperties=Object.assign(f.signingProperties||{},v),u.selectedHttpAuthScheme={httpAuthOption:f,identity:await h(f.identityProperties),signer:d.signer};break}if(!u.selectedHttpAuthScheme)throw new Error(c.join(`
|
|
3042
|
+
`),ZV={warn:console.warn},ez=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],V1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function tz(r){const e=r.getUTCFullYear(),t=r.getUTCMonth(),n=r.getUTCDay(),i=r.getUTCDate(),a=r.getUTCHours(),s=r.getUTCMinutes(),o=r.getUTCSeconds(),l=i<10?`0${i}`:`${i}`,u=a<10?`0${a}`:`${a}`,c=s<10?`0${s}`:`${s}`,f=o<10?`0${o}`:`${o}`;return`${ez[n]}, ${l} ${V1[t]} ${e} ${u}:${c}:${f} GMT`}const rz=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),nz=r=>{if(r==null)return;if(typeof r!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=rz.exec(r);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[t,n,i,a,s,o,l,u,c]=e,f=xg(Ef(n)),d=yo(i,"month",1,12),h=yo(a,"day",1,31),g=Jp(f,d,h,{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u});return c.toUpperCase()!="Z"&&g.setTime(g.getTime()-gz(c)),g},iz=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),az=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),sz=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),VI=r=>{if(r==null)return;if(typeof r!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let e=iz.exec(r);if(e){const[t,n,i,a,s,o,l,u]=e;return Jp(xg(Ef(a)),Vv(i),yo(n,"day",1,31),{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u})}if(e=az.exec(r),e){const[t,n,i,a,s,o,l,u]=e;return cz(Jp(lz(a),Vv(i),yo(n,"day",1,31),{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u}))}if(e=sz.exec(r),e){const[t,n,i,a,s,o,l,u]=e;return Jp(xg(Ef(u)),Vv(n),yo(i.trimLeft(),"day",1,31),{hours:a,minutes:s,seconds:o,fractionalMilliseconds:l})}throw new TypeError("Invalid RFC-7231 date-time value")},oz=r=>{if(r==null)return;let e;if(typeof r=="number")e=r;else if(typeof r=="string")e=QV(r);else if(typeof r=="object"&&r.tag===1)e=r.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(e)||e===1/0||e===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(e*1e3))},Jp=(r,e,t,n)=>{const i=e-1;return fz(r,i,t),new Date(Date.UTC(r,i,t,yo(n.hours,"hour",0,23),yo(n.minutes,"minute",0,59),yo(n.seconds,"seconds",0,60),pz(n.fractionalMilliseconds)))},lz=r=>{const e=new Date().getUTCFullYear(),t=Math.floor(e/100)*100+xg(Ef(r));return t<e?t+100:t},uz=50*365*24*60*60*1e3,cz=r=>r.getTime()-new Date().getTime()>uz?new Date(Date.UTC(r.getUTCFullYear()-100,r.getUTCMonth(),r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds())):r,Vv=r=>{const e=V1.indexOf(r);if(e<0)throw new TypeError(`Invalid month: ${r}`);return e+1},dz=[31,28,31,30,31,30,31,31,30,31,30,31],fz=(r,e,t)=>{let n=dz[e];if(e===1&&hz(r)&&(n=29),t>n)throw new TypeError(`Invalid day for ${V1[e]} in ${r}: ${t}`)},hz=r=>r%4===0&&(r%100!==0||r%400===0),yo=(r,e,t,n)=>{const i=JV(Ef(r));if(i<t||i>n)throw new TypeError(`${e} must be between ${t} and ${n}, inclusive`);return i},pz=r=>r==null?0:YV("0."+r)*1e3,gz=r=>{const e=r[0];let t=1;if(e=="+")t=1;else if(e=="-")t=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);const n=Number(r.substring(1,3)),i=Number(r.substring(4,6));return t*(n*60+i)*60*1e3},Ef=r=>{let e=0;for(;e<r.length-1&&r.charAt(e)==="0";)e++;return e===0?r:r.slice(e)},po=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})};po.from=r=>r&&typeof r=="object"&&(r instanceof po||"deserializeJSON"in r)?r:typeof r=="string"||Object.getPrototypeOf(r)===String.prototype?po(String(r)):po(JSON.stringify(r));po.fromObject=po.from;const LE=/^-?\d*(\.\d+)?$/;class ns{string;type;constructor(e,t){if(this.string=e,this.type=t,!LE.test(e))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!="object")return!1;const t=e;return ns.prototype.isPrototypeOf(e)||t.type==="bigDecimal"&&LE.test(t.string)}}const zI={},AA={};for(let r=0;r<256;r++){let e=r.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),zI[r]=e,AA[e]=r}function $I(r){if(r.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(r.length/2);for(let t=0;t<r.length;t+=2){const n=r.slice(t,t+2).toLowerCase();if(n in AA)e[t/2]=AA[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return e}function Ao(r){let e="";for(let t=0;t<r.byteLength;t++)e+=zI[r[t]];return e}const UE=typeof TextEncoder=="function"?new TextEncoder:null,mz=r=>{if(typeof r=="string"){if(UE)return UE.encode(r).byteLength;let e=r.length;for(let t=e-1;t>=0;t--){const n=r.charCodeAt(t);n>127&&n<=2047?e++:n>2047&&n<=65535&&(e+=2),n>=56320&&n<=57343&&t--}return e}else{if(typeof r.byteLength=="number")return r.byteLength;if(typeof r.size=="number")return r.size}throw new Error(`Body Length computation failed for ${r}`)},kf=r=>typeof r=="string"?kl(r):ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(r),vz=r=>typeof ArrayBuffer=="function"&&r instanceof ArrayBuffer||Object.prototype.toString.call(r)==="[object ArrayBuffer]",HI=async r=>{},yz=async r=>{const e=r?.Bucket||"";if(typeof r.Bucket=="string"&&(r.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),xz(e)){if(r.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!Cz(e)||e.indexOf(".")!==-1&&!String(r.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(r.ForcePathStyle=!0);return r.DisableMultiRegionAccessPoints&&(r.disableMultiRegionAccessPoints=!0,r.DisableMRAP=!0),r},Az=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,bz=/(\d+\.){3}\d+/,wz=/\.\./,Cz=r=>Az.test(r)&&!bz.test(r)&&!wz.test(r),xz=r=>{const[e,t,n,,,i]=r.split(":"),a=e==="arn"&&r.split(":").length>=6,s=!!(a&&t&&n&&i);if(a&&!s)throw new Error(`Invalid ARN: ${r} was an invalid ARN.`);return s},Sz=(r,e,t,n=!1)=>{const i=async()=>{let a;return n?a=t.clientContextParams?.[r]??t[r]??t[e]:a=t[r]??t[e],typeof a=="function"?a():a};return r==="credentialScope"||e==="CredentialScope"?async()=>{const a=typeof t.credentials=="function"?await t.credentials():t.credentials;return a?.credentialScope??a?.CredentialScope}:r==="accountId"||e==="AccountId"?async()=>{const a=typeof t.credentials=="function"?await t.credentials():t.credentials;return a?.accountId??a?.AccountId}:r==="endpoint"||e==="endpoint"?async()=>{if(t.isCustomEndpoint===!1)return;const a=await i();if(a&&typeof a=="object"){if("url"in a)return a.url.href;if("hostname"in a){const{protocol:s,hostname:o,port:l,path:u}=a;return`${s}//${o}${l?":"+l:""}${u}`}}return a}:i};function Ez(r){return async(e,t,n,i)=>{if(!n.isCustomEndpoint){let o;n.serviceConfiguredEndpoint?o=await n.serviceConfiguredEndpoint():o=await r(n.serviceId),o&&(n.endpoint=()=>Promise.resolve(L1(o)),n.isCustomEndpoint=!0)}const a=await kz(e,t,n);if(typeof n.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");const s=n.endpointProvider(a,i);if(n.isCustomEndpoint&&n.endpoint){const o=await n.endpoint();if(o?.headers){s.headers??={};for(const[l,u]of Object.entries(o.headers))s.headers[l]=Array.isArray(u)?u:[u]}}return s}}const kz=async(r,e,t)=>{const n={},i=e?.getEndpointParameterInstructions?.()||{};for(const[a,s]of Object.entries(i))switch(s.type){case"staticContextParams":n[a]=s.value;break;case"contextParams":n[a]=r[s.name];break;case"clientContextParams":case"builtInParams":n[a]=await Sz(s.name,a,t,s.type!=="builtInParams")();break;case"operationContextParams":n[a]=s.get(r);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(s))}return Object.keys(i).length===0&&Object.assign(n,t),String(t.serviceId).toLowerCase()==="s3"&&await yz(n),n};function Tz(r,e,t){r.__smithy_context?r.__smithy_context.features||(r.__smithy_context.features={}):r.__smithy_context={features:{}},r.__smithy_context.features[e]=t}function Fz(r){const e=Ez(r);return({config:t,instructions:n})=>(i,a)=>async s=>{t.isCustomEndpoint&&Tz(a,"ENDPOINT_OVERRIDE","N");const o=await e(s.input,{getEndpointParameterInstructions(){return n}},{...t},a);a.endpointV2=o,a.authSchemes=o.properties?.authSchemes;const l=a.authSchemes?.[0];if(l){a.signing_region=l.signingRegion,a.signing_service=l.signingName;const c=vc(a)?.selectedHttpAuthScheme?.httpAuthOption;c&&(c.signingProperties=Object.assign(c.signingProperties||{},{signing_region:l.signingRegion,signingRegion:l.signingRegion,signing_service:l.signingName,signingName:l.signingName,signingRegionSet:l.signingRegionSet},l.properties))}return i({...s})}}const Iz={name:"serializerMiddleware"},Pz={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Iz.name};function Dz(r){const e=Fz(r);return(t,n)=>({applyToStack:i=>{i.addRelativeTo(e({config:t,instructions:n}),Pz)}})}function Rz(r){return e=>{const t=e.tls??!0,{endpoint:n,useDualstackEndpoint:i,useFipsEndpoint:a}=e,s=n!=null?async()=>L1(await Bs(n)()):void 0,l=Object.assign(e,{endpoint:s,tls:t,isCustomEndpoint:!!n,useDualstackEndpoint:Bs(i??!1),useFipsEndpoint:Bs(a??!1)});let u;return l.serviceConfiguredEndpoint=async()=>(e.serviceId&&!u&&(u=r(e.serviceId)),u),l}}class z1{nodes;root;conditions;results;constructor(e,t,n,i){this.nodes=e,this.root=t,this.conditions=n,this.results=i}static from(e,t,n,i){return new z1(e,t,n,i)}}class Oz{capacity;data=new Map;parameters=[];constructor({size:e,params:t}){this.capacity=e??50,t&&(this.parameters=t)}get(e,t){const n=this.hash(e);if(n===!1)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const i=this.data.keys();let a=0;for(;;){const{value:s,done:o}=i.next();if(this.data.delete(s),o||++a>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t="";const{parameters:n}=this;if(n.length===0)return!1;for(const i of n){const a=String(e[i]??"");if(a.includes("|;"))return!1;t+=a+"|;"}return t}}class Ba extends Error{constructor(e){super(e),this.name="EndpointError"}}const Bz="endpoints";function Sg(r){return typeof r!="object"||r==null?r:"ref"in r?`$${Sg(r.ref)}`:"fn"in r?`${r.fn}(${(r.argv||[]).map(Sg).join(", ")})`:JSON.stringify(r,null,2)}const $1={},Mz=(r,e)=>r===e;function _z(...r){for(const e of r)if(e!=null)return e}const Nz=r=>{const e=r.split("."),t=[];for(const n of e){const i=n.indexOf("[");if(i!==-1){if(n.indexOf("]")!==n.length-1)throw new Ba(`Path: '${r}' does not end with ']'`);const a=n.slice(i+1,-1);if(Number.isNaN(parseInt(a)))throw new Ba(`Invalid array index: '${a}' in path: '${r}'`);i!==0&&t.push(n.slice(0,i)),t.push(a)}else t.push(n)}return t},jI=(r,e)=>Nz(e).reduce((t,n)=>{if(typeof t!="object")throw new Ba(`Index '${n}' in '${e}' not found in '${JSON.stringify(r)}'`);if(Array.isArray(t)){const i=parseInt(n);return t[i<0?t.length+i:i]}return t[n]},r),Lz=r=>r!=null;function Uz(r,e,t){return r?e:t}const Vz=r=>!r,zz=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),GI=r=>zz.test(r)||r.startsWith("[")&&r.endsWith("]"),zv={[xf.HTTP]:80,[xf.HTTPS]:443},$z=r=>{const e=(()=>{try{if(r instanceof URL)return r;if(typeof r=="object"&&"hostname"in r){const{hostname:d,port:h,protocol:g="",path:v="",query:y={}}=r,A=new URL(`${g}//${d}${h?`:${h}`:""}${v}`);return A.search=Object.entries(y).map(([C,S])=>`${C}=${S}`).join("&"),A}return new URL(r)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(r)} as a whatwg URL.`),null;const t=e.href,{host:n,hostname:i,pathname:a,protocol:s,search:o}=e;if(o)return null;const l=s.slice(0,-1);if(!Object.values(xf).includes(l))return null;const u=GI(i),c=t.includes(`${n}:${zv[l]}`)||typeof r=="string"&&r.includes(`${n}:${zv[l]}`),f=`${n}${c?`:${zv[l]}`:""}`;return{scheme:l,authority:f,path:a,normalizedPath:a.endsWith("/")?a:`${a}/`,isIp:u}};function Hz(r,e,t){if(t===1)return[r];if(r==="")return[""];const n=r.split(e);return t===0?n:n.slice(0,t-1).concat(n.slice(1).join(e))}const jz=(r,e)=>r===e,Gz=(r,e,t,n)=>r==null||e>=t||r.length<t||/[^\u0000-\u007f]/.test(r)?null:n?r.substring(r.length-t,r.length-e):r.substring(e,t),qz=r=>encodeURIComponent(r).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Wz={booleanEquals:Mz,coalesce:_z,getAttr:jI,isSet:Lz,isValidHostLabel:Kg,ite:Uz,not:Vz,parseURL:$z,split:Hz,stringEquals:jz,substring:Gz,uriEncode:qz},qI=(r,e)=>{const t=[],{referenceRecord:n,endpointParams:i}=e;let a=0;for(;a<r.length;){const s=r.indexOf("{",a);if(s===-1){t.push(r.slice(a));break}t.push(r.slice(a,s));const o=r.indexOf("}",s);if(o===-1){t.push(r.slice(s));break}r[s+1]==="{"&&r[o+1]==="}"&&(t.push(r.slice(s+1,o)),a=o+2);const l=r.substring(s+1,o);if(l.includes("#")){const[u,c]=l.split("#");t.push(jI(n[u]??i[u],c))}else t.push(n[l]??i[l]);a=o+1}return t.join("")},Qz=({ref:r},e)=>e.referenceRecord[r]??e.endpointParams[r],rm=(r,e,t)=>{if(typeof r=="string")return qI(r,t);if(r.fn)return QI.callFunction(r,t);if(r.ref)return Qz(r,t);throw new Ba(`'${e}': ${String(r)} is not a string, function or reference.`)},WI=({fn:r,argv:e},t)=>{const n=Array(e.length);for(let s=0;s<n.length;++s){const o=e[s];typeof o=="boolean"||typeof o=="number"?n[s]=o:n[s]=QI.evaluateExpression(o,"arg",t)}const i=r.indexOf(".");if(i!==-1){const o=$1[r.slice(0,i)]?.[r.slice(i+1)];if(typeof o=="function")return o(...n)}const a=Wz[r];if(typeof a=="function")return a(...n);throw new Error(`function ${r} not loaded in endpointFunctions.`)},QI={evaluateExpression:rm,callFunction:WI},Yz=(r,e)=>{const{assign:t}=r;if(t&&t in e.referenceRecord)throw new Ba(`'${t}' is already defined in Reference Record.`);const n=WI(r,e);e.logger?.debug?.(`${Bz} evaluateCondition: ${Sg(r)} = ${Sg(n)}`);const i=n===""?!0:!!n;return t!=null?{result:i,toAssign:{name:t,value:n}}:{result:i}},Xz=(r,e)=>Object.entries(r??{}).reduce((t,[n,i])=>(t[n]=i.map(a=>{const s=rm(a,"Header value entry",e);if(typeof s!="string")throw new Ba(`Header '${n}' value '${s}' is not a string`);return s}),t),{}),YI=(r,e)=>Object.entries(r).reduce((t,[n,i])=>(t[n]=JI.getEndpointProperty(i,e),t),{}),XI=(r,e)=>{if(Array.isArray(r))return r.map(t=>XI(t,e));switch(typeof r){case"string":return qI(r,e);case"object":if(r===null)throw new Ba(`Unexpected endpoint property: ${r}`);return JI.getEndpointProperties(r,e);case"boolean":return r;default:throw new Ba(`Unexpected endpoint property type: ${typeof r}`)}},JI={getEndpointProperty:XI,getEndpointProperties:YI},Jz=(r,e)=>{const t=rm(r,"Endpoint URL",e);if(typeof t=="string")try{return new URL(t)}catch(n){throw console.error(`Failed to construct URL with ${t}`,n),n}throw new Ba(`Endpoint URL must be a string, got ${typeof t}`)},$v=1e8,Kz=(r,e)=>{const{nodes:t,root:n,results:i,conditions:a}=r;let s=n;const o={},l={referenceRecord:o,endpointParams:e.endpointParams,logger:e.logger};for(;s!==1&&s!==-1&&s<$v;){const u=3*(Math.abs(s)-1),[c,f,d]=[t[u],t[u+1],t[u+2]],[h,g,v]=a[c],y=Yz({fn:h,assign:v,argv:g},l);if(y.toAssign){const{name:A,value:C}=y.toAssign;o[A]=C}s=s>=0===y.result?f:d}if(s>=$v){const u=i[s-$v];if(u[0]===-1){const[,h]=u;throw new Ba(rm(h,"Error",l))}const[c,f,d]=u;return{url:Jz(c,l),properties:YI(f,l),headers:Xz(d??{},l)}}throw new Ba("No matching endpoint.")},Zz=Rz(HI),KI=Dz(HI);class Hv extends HV(em,kl,Cg,Zg){}const e$=r=>crypto.getRandomValues(r),ZI=jV(e$),t$=ZI,bA=async(r=new Uint8Array,e)=>{if(r instanceof Uint8Array)return Hv.mutate(r);if(!r)return Hv.mutate(new Uint8Array);const t=e.streamCollector(r);return Hv.mutate(await t)};class r${serdeContext;setSerdeContext(e){this.serdeContext=e}}class n$ extends r${options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=Zi.for(e.defaultNamespace);for(const t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return na}getResponseType(){return sc}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,t){if("url"in t){e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,e.query||(e.query={});for(const[n,i]of t.url.searchParams.entries())e.query[n]=i;if(t.headers)for(const n in t.headers)e.headers[n]=t.headers[n].join(", ");return e}else{if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(const n in t.headers)e.headers[n]=t.headers[n];return e}}setHostPrefix(e,t,n){if(this.serdeContext?.disableHostPrefix)return;const i=vi.of(t.input),a=zd(t.traits??{});if(a.endpoint){let s=a.endpoint?.[0];if(typeof s=="string"){for(const[o,l]of i.structIterator()){if(!l.getMergedTraits().hostLabel)continue;const u=n[o];if(typeof u!="string")throw new Error(`@smithy/core/schema - ${o} in input must be a string as hostLabel.`);s=s.replace(`{${o}}`,u)}e.hostname=s+e.hostname}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n})}async loadEventStreamCapability(){const{EventStreamSerde:e,eventStreamSerdeProvider:t}=await Promise.resolve().then(()=>require("./index.browser-HO1knCEY.cjs")),n=this.resolveEventStreamMarshaller(t);return new e({marshaller:n,serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}resolveEventStreamMarshaller(e){const t=this.serdeContext;return t.eventStreamMarshaller?t.eventStreamMarshaller:e(this.serdeContext)}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,t,n,i,a){return[]}getEventStreamMarshaller(){const e=this.serdeContext;if(!e.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class i$ extends n${async serializeRequest(e,t,n){const i=this.serializer,a={},s={},o=await n.endpoint(),l=vi.of(e?.input),u=l.getSchema();let c;const f=t&&typeof t=="object"?t:{},d=new na({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:a,headers:s,body:void 0});if(o&&(this.updateServiceEndpoint(d,o),this.setHostPrefix(d,e,f)),f){const h=l.getEventStreamMember();if(h){if(f[h]){const g={};for(const[v,y]of l.structIterator())v!==h&&f[v]&&(i.write(y,f[v]),g[v]=i.flush());c=await this.serializeEventStream({eventStream:f[h],requestSchema:l,initialRequest:g})}}else i.write(u,f),c=i.flush()}return d.headers=Object.assign(d.headers,s),d.query=a,d.body=c,d.method="POST",d}async deserializeResponse(e,t,n){const i=this.deserializer,a=vi.of(e.output),s={};if(n.statusCode>=300){const l=await bA(n.body,t);throw l.byteLength>0&&Object.assign(s,await i.read(15,l)),await this.handleError(e,t,n,s,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const l in n.headers){const u=n.headers[l];delete n.headers[l],n.headers[l.toLowerCase()]=u}const o=a.getEventStreamMember();if(o)s[o]=await this.deserializeEventStream({response:n,responseSchema:a,initialResponseContainer:s});else{const l=await bA(n.body,t);l.byteLength>0&&Object.assign(s,await i.read(a,l))}return s.$metadata=this.deserializeMetadata(n),s}}function eP(r,e){if(e.timestampFormat.useTrait&&r.isTimestampSchema()&&(r.getSchema()===5||r.getSchema()===6||r.getSchema()===7))return r.getSchema();const{httpLabel:t,httpPrefixHeaders:n,httpHeader:i,httpQuery:a}=r.getMergedTraits();return(e.httpBindings?typeof n=="string"||i?6:a||t?5:void 0:void 0)??e.timestampFormat.default}const a$=r=>({setHttpHandler(e){r.httpHandler=e},httpHandler(){return r.httpHandler},updateHttpClientConfig(e,t){r.httpHandler?.updateHttpClientConfig(e,t)},httpHandlerConfigs(){return r.httpHandler.httpHandlerConfigs()}}),s$=r=>({httpHandler:r.httpHandler()}),VE="content-length";function o$(r){return e=>async t=>{const n=t.request;if(na.isInstance(n)){const{body:i,headers:a}=n;if(i&&Object.keys(a).map(s=>s.toLowerCase()).indexOf(VE)===-1)try{const s=r(i);n.headers={...n.headers,[VE]:String(s)}}catch{}}return e({...t,request:n})}}const l$={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},u$=r=>({applyToStack:e=>{e.add(o$(r.bodyLengthChecker),l$)}}),Cl=r=>encodeURIComponent(r).replace(/[!'()*]/g,c$),c$=r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`;function d$(r){const e=[];for(let t of Object.keys(r).sort()){const n=r[t];if(t=Cl(t),Array.isArray(n))for(let i=0,a=n.length;i<a;i++)e.push(`${t}=${Cl(n[i])}`);else{let i=t;(n||typeof n=="string")&&(i+=`=${Cl(n)}`),e.push(i)}}return e.join("&")}const f$=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],h$=["TimeoutError","RequestTimeout","RequestTimeoutException"],p$=[500,502,503,504],g$=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],m$=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND","EAI_AGAIN"],v$=r=>r?.$retryable!==void 0,y$=r=>r.$metadata?.clockSkewCorrected,A$=r=>{const e=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return r&&r instanceof TypeError?e.has(r.message):!1},tP=r=>r.$metadata?.httpStatusCode===429||f$.includes(r.name)||r.$retryable?.throttling==!0,H1=(r,e=0)=>v$(r)||y$(r)||r.name==="InvalidSignatureException"&&r.message?.includes("Signature expired")||h$.includes(r.name)||g$.includes(r?.code||"")||m$.includes(r?.code||"")||p$.includes(r.$metadata?.httpStatusCode||0)||A$(r)||w$(r)||r.cause!==void 0&&e<=10&&H1(r.cause,e+1),b$=r=>{if(r.$metadata?.httpStatusCode!==void 0){const e=r.$metadata.httpStatusCode;return 500<=e&&e<=599&&!H1(r)}return!1};function w$(r){return r.code==="ERR_HTTP2_STREAM_ERROR"&&r.message.includes("NGHTTP2_REFUSED_STREAM")}const rP=20*1e3,zE=500,C$=1,x$="amz-sdk-invocation-id",S$="amz-sdk-request";function E$(r,e){if(sc.isInstance(r))for(const t of Object.keys(r.headers)){const n=t.toLowerCase();if(n==="retry-after"){const i=r.headers[t];let a=NaN;if(i.endsWith("GMT"))try{a=(VI(i).getTime()-Date.now())/1e3}catch(s){e?.trace?.("Failed to parse retry-after header"),e?.trace?.(s)}else i.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?a=Number(i.match(/ GMT, ([\d.]+)$/)?.[1]):i.match(/^((\d+)|(\d+\.\d+))$/)?a=Number(i):Date.parse(i)>=Date.now()&&(a=(Date.parse(i)-Date.now())/1e3);return isNaN(a)?void 0:new Date(Date.now()+a*1e3)}else if(n==="x-amz-retry-after"){const i=r.headers[t],a=Number(i);if(isNaN(a)){e?.trace?.(`Failed to parse x-amz-retry-after=${i}`);return}return new Date(Date.now()+a)}}}const k$=r=>r instanceof Error?r:r instanceof Object?Object.assign(new Error,r):typeof r=="string"?new Error(r):new Error(`AWS SDK error wrapper for ${r}`);function T$(r){return e=>(t,n)=>async i=>{let a=await e.retryStrategy();const s=await e.maxAttempts();if(I$(a)){a=a;let o=await a.acquireInitialRetryToken((n.partition_id??"")+(n.__retryLongPoll?":longpoll":"")),l=new Error,u=0,c=0;const{request:f}=i,d=na.isInstance(f);for(d&&(f.headers[x$]=ZI());;)try{d&&(f.headers[S$]=`attempt=${u+1}; max=${s}`);const{response:h,output:g}=await t(i);return a.recordSuccess(o),g.$metadata.attempts=u+1,g.$metadata.totalRetryDelay=c,{response:h,output:g}}catch(h){const g=P$(h,e.logger);if(l=k$(h),d&&r(f))throw(n.logger instanceof NI?console:n.logger)?.warn("An error was encountered in a non-retryable streaming request."),l;try{o=await a.refreshRetryTokenForRetry(o,g)}catch{throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=u+1,l.$metadata.totalRetryDelay=c,l}u=o.getRetryCount();const v=o.getRetryDelay();c+=(o?.$retryLog?.acquisitionDelay??0)+v,v>0&&await F$(v)}}else return a=a,a?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",a.mode]]),a.retry(t,i)}}const F$=r=>new Promise(e=>setTimeout(e,r)),I$=r=>typeof r.acquireInitialRetryToken<"u"&&typeof r.refreshRetryTokenForRetry<"u"&&typeof r.recordSuccess<"u",P$=(r,e)=>{const t={error:r,errorType:D$(r)},n=E$(r.$response,e);return n&&(t.retryAfterHint=n),t},D$=r=>tP(r)?"THROTTLING":H1(r)?"TRANSIENT":b$(r)?"SERVER_ERROR":"CLIENT_ERROR",R$={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0};function O$(r){const e=T$(r);return t=>({applyToStack:n=>{n.add(e(t),R$)}})}class j1{static setTimeoutFn=(e,t)=>setTimeout(e,t);beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(e){let t;this.updateMeasuredRate();const n=e;if(n?.errorType==="THROTTLING"||tP(n?.error??e)){const s=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=s,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(s),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const a=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(a)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(e){if(this.enabled){for(this.refillTokenBucket();e>this.availableTokens;){const t=(e-this.availableTokens)/this.fillRate*1e3;await new Promise(n=>j1.setTimeoutFn(n,t)),this.refillTokenBucket()}this.availableTokens=this.availableTokens-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}const t=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+t),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(e*2)/2;if(this.requestCount++,t>this.lastTxRateBucket){const n=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}class Ei{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return Ei.v2026?50:100}static throttlingDelay(){return Ei.v2026?1e3:500}static cost(){return Ei.v2026?14:5}static throttlingCost(){return Ei.v2026?5:10}static modifiedCostType(){return Ei.v2026?"THROTTLING":"TRANSIENT"}}class B${x=Ei.delay();computeNextBackoffDelay(e){const i=Math.random()*Math.min(this.x*2**e,rP);return Math.floor(i)}setDelayBase(e){this.x=e}}class $E{delay;count;cost;longPoll;$retryLog={acquisitionDelay:0};constructor(e,t,n,i){this.delay=e,this.count=t,this.cost=n,this.longPoll=i}getRetryCount(){return this.count}getRetryDelay(){return Math.min(rP,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}var Po;(function(r){r.STANDARD="standard",r.ADAPTIVE="adaptive"})(Po||(Po={}));const ef=3,M$=Po.STANDARD,kp={incompatible:1,attempts:2,capacity:3};class wA{mode=Po.STANDARD;retryBackoffStrategy;capacity=zE;maxAttemptsProvider;baseDelay;constructor(e){typeof e=="number"?this.maxAttemptsProvider=async()=>e:typeof e=="function"?this.maxAttemptsProvider=e:e&&typeof e=="object"&&(this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff),this.maxAttemptsProvider??=async()=>ef,this.baseDelay??=Ei.delay(),this.retryBackoffStrategy??=new B$}async acquireInitialRetryToken(e){return new $E(Ei.delay(),0,void 0,Ei.v2026&&e.includes(":longpoll"))}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts(),i=this.retryCode(e,t,n),a=i===0,s=e.isLongPoll?.();if(a||s){const o=t.errorType;this.retryBackoffStrategy.setDelayBase(o==="THROTTLING"?Ei.throttlingDelay():this.baseDelay);const l=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount());let u=l;if(t.retryAfterHint instanceof Date&&(u=Math.max(l,Math.min(t.retryAfterHint.getTime()-Date.now(),l+5e3))),a){const c=this.getCapacityCost(o);this.capacity-=c;const f=new $E(0,e.getRetryCount()+1,c,e.isLongPoll?.()??!1);return await new Promise(d=>setTimeout(d,u)),f.$retryLog.acquisitionDelay=u,f}else{const c=Ei.v2026&&i===kp.capacity&&s?u:0;c>0&&await new Promise(f=>setTimeout(f,c))}}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.min(zE,this.capacity+(e.getRetryCost()??C$))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${ef}`),ef}}retryCode(e,t,n){const i=e.getRetryCount()+1,a=this.isRetryableError(t.errorType)?0:kp.incompatible,s=i<n?0:kp.attempts,o=this.capacity>=this.getCapacityCost(t.errorType)?0:kp.capacity;return a||s||o}getCapacityCost(e){return e===Ei.modifiedCostType()?Ei.throttlingCost():Ei.cost()}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class _${mode=Po.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(e,t){const{rateLimiter:n}=t??{};this.rateLimiter=n??new j1,this.standardRetryStrategy=t?new wA({maxAttempts:typeof e=="number"?e:3,...t}):new wA(e)}async acquireInitialRetryToken(e){const t=await this.standardRetryStrategy.acquireInitialRetryToken(e);return await this.rateLimiter.getSendToken(),t}async refreshRetryTokenForRetry(e,t){this.rateLimiter.updateClientSendingRate(t);const n=await this.standardRetryStrategy.refreshRetryTokenForRetry(e,t);return await this.rateLimiter.getSendToken(),n}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}const N$=(r,e)=>{const{retryStrategy:t,retryMode:n}=r,{defaultMaxAttempts:i=ef,defaultBaseDelay:a=Ei.delay()}={},s=Bs(r.maxAttempts??i);let o=t?Promise.resolve(t):void 0;const l=async()=>{const u=await s();return await Bs(n)()===Po.ADAPTIVE?new _$(s,{maxAttempts:u,baseDelay:a}):new wA({maxAttempts:u,baseDelay:a})};return Object.assign(r,{maxAttempts:s,retryStrategy:()=>o??=l()})},L$=O$(wV);Ei.v2026||=typeof process=="object"&&process.env?.AWS_NEW_RETRIES_2026==="true";function Is(r,e,t){r.__aws_sdk_context?r.__aws_sdk_context.features||(r.__aws_sdk_context.features={}):r.__aws_sdk_context={features:{}},r.__aws_sdk_context.features[e]=t}const U$=r=>e=>async t=>{if(!na.isInstance(t.request))return e(t);const{request:n}=t,{handlerProtocol:i=""}=r.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!n.headers[":authority"])delete n.headers.host,n.headers[":authority"]=n.hostname+(n.port?":"+n.port:"");else if(!n.headers.host){let a=n.hostname;n.port!=null&&(a+=`:${n.port}`),n.headers.host=a}return e(t)},V$={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},z$=r=>({applyToStack:e=>{e.add(U$(r),V$)}}),$$=()=>(r,e)=>async t=>{try{const n=await r(t),{clientName:i,commandName:a,logger:s,dynamoDbDocumentClientOptions:o={}}=e,{overrideInputFilterSensitiveLog:l,overrideOutputFilterSensitiveLog:u}=o,c=l??e.inputFilterSensitiveLog,f=u??e.outputFilterSensitiveLog,{$metadata:d,...h}=n.output;return s?.info?.({clientName:i,commandName:a,input:c(t.input),output:f(h),metadata:d}),n}catch(n){const{clientName:i,commandName:a,logger:s,dynamoDbDocumentClientOptions:o={}}=e,{overrideInputFilterSensitiveLog:l}=o,u=l??e.inputFilterSensitiveLog;throw s?.error?.({clientName:i,commandName:a,input:u(t.input),error:n,metadata:n.$metadata}),n}},H$={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},j$=r=>({applyToStack:e=>{e.add($$(),H$)}}),G$=r=>({applyToStack:e=>{}}),q$=(r,e)=>{if(!e||e.length===0)return r;const t=[];for(const n of e)for(const i of r)i.schemeId.split("#")[1]===n&&t.push(i);for(const n of r)t.find(({schemeId:i})=>i===n.schemeId)||t.push(n);return t};function W$(r){const e=new Map;for(const t of r)e.set(t.schemeId,t);return e}const Q$=(r,e)=>(t,n)=>async i=>{const a=r.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(r,n,i.input)),s=r.authSchemePreference?await r.authSchemePreference():[],o=q$(a,s),l=W$(r.httpAuthSchemes),u=vc(n),c=[];for(const f of o){const d=l.get(f.schemeId);if(!d){c.push(`HttpAuthScheme \`${f.schemeId}\` was not enabled for this service.`);continue}const h=d.identityProvider(await e.identityProviderConfigProvider(r));if(!h){c.push(`HttpAuthScheme \`${f.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:g={},signingProperties:v={}}=f.propertiesExtractor?.(r,n)||{};f.identityProperties=Object.assign(f.identityProperties||{},g),f.signingProperties=Object.assign(f.signingProperties||{},v),u.selectedHttpAuthScheme={httpAuthOption:f,identity:await h(f.identityProperties),signer:d.signer};break}if(!u.selectedHttpAuthScheme)throw new Error(c.join(`
|
|
3043
3043
|
`));return t(i)},Y$={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},X$=(r,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:t})=>({applyToStack:n=>{n.addRelativeTo(Q$(r,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:t}),Y$)}}),J$=r=>e=>{throw e},K$=(r,e)=>{},Z$=r=>(e,t)=>async n=>{if(!na.isInstance(n.request))return e(n);const a=vc(t).selectedHttpAuthScheme;if(!a)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:s={}},identity:o,signer:l}=a,u=await e({...n,request:await l.sign(n.request,o,s)}).catch((l.errorHandler||J$)(s));return(l.successHandler||K$)(u.response,s),u},eH={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},tH=r=>({applyToStack:e=>{e.addRelativeTo(Z$(),eH)}}),tf=r=>{if(typeof r=="function")return r;const e=Promise.resolve(r);return()=>e};class rH{authSchemes=new Map;constructor(e){for(const t in e){const n=e[t];n!==void 0&&this.authSchemes.set(t,n)}}getIdentityProvider(e){return this.authSchemes.get(e)}}class nH{async sign(e,t,n){return e}}const iH=r=>function(t){return nP(t)&&t.expiration.getTime()-Date.now()<r},aH=3e5,sH=iH(aH),nP=r=>r.expiration!==void 0,oH=(r,e,t)=>{if(r===void 0)return;const n=typeof r!="function"?async()=>Promise.resolve(r):r;let i,a,s,o=!1;const l=async u=>{a||(a=n(u));try{i=await a,s=!0,o=!1}finally{a=void 0}return i};return e===void 0?async u=>((!s||u?.forceRefresh)&&(i=await l(u)),i):async u=>((!s||u?.forceRefresh)&&(i=await l(u)),o?i:t(i)?(e(i)&&await l(u),i):(o=!0,i))},lH=void 0;function uH(r){return r===void 0?!0:typeof r=="string"&&r.length<=50}function cH(r){const e=tf(r.userAgentAppId??lH),{customUserAgent:t}=r;return Object.assign(r,{customUserAgent:typeof t=="string"?[[t]]:t,userAgentAppId:async()=>{const n=await e();if(!uH(n)){const i=r.logger?.constructor?.name==="NoOpLogger"||!r.logger?console:r.logger;typeof n!="string"?i?.warn("userAgentAppId must be a string or undefined."):n.length>50&&i?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return n}})}const dH={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}]};let fH=dH;const hH=r=>{const{partitions:e}=fH;for(const n of e){const{regions:i,outputs:a}=n;for(const[s,o]of Object.entries(i))if(s===r)return{...a,...o}}for(const n of e){const{regionRegex:i,outputs:a}=n;if(new RegExp(i).test(r))return{...a}}const t=e.find(n=>n.id==="aws");if(!t)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...t.outputs}},pH=/\d{12}\.ddb/;async function gH(r,e,t){if(t.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&Is(r,"PROTOCOL_RPC_V2_CBOR","M"),typeof e.retryStrategy=="function"){const a=await e.retryStrategy();if(typeof a.mode=="string")switch(a.mode){case Po.ADAPTIVE:Is(r,"RETRY_MODE_ADAPTIVE","F");break;case Po.STANDARD:Is(r,"RETRY_MODE_STANDARD","E");break}}if(typeof e.accountIdEndpointMode=="function"){const a=r.endpointV2;switch(String(a?.url?.hostname).match(pH)&&Is(r,"ACCOUNT_ID_ENDPOINT","O"),await e.accountIdEndpointMode?.()){case"disabled":Is(r,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":Is(r,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":Is(r,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const i=r.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const a=i;a.accountId&&Is(r,"RESOLVED_ACCOUNT_ID","T");for(const[s,o]of Object.entries(a.$source??{}))Is(r,s,o)}}const HE="user-agent",jv="x-amz-user-agent",jE=" ",Gv="/",mH=/[^!$%&'*+\-.^_`|~\w]/g,vH=/[^!$%&'*+\-.^_`|~\w#]/g,GE="-",yH=1024;function AH(r){let e="";for(const t in r){const n=r[t];if(e.length+n.length+1<=yH){e.length?e+=","+n:e+=n;continue}break}return e}const bH=r=>(e,t)=>async n=>{const{request:i}=n;if(!na.isInstance(i))return e(n);const{headers:a}=i,s=t?.userAgent?.map(Tp)||[],o=(await r.defaultUserAgentProvider()).map(Tp);await gH(t,r,n);const l=t;o.push(`m/${AH(Object.assign({},t.__smithy_context?.features,l.__aws_sdk_context?.features))}`);const u=r?.customUserAgent?.map(Tp)||[],c=await r.userAgentAppId();c&&o.push(Tp(["app",`${c}`]));const f=[].concat([...o,...s,...u]).join(jE),d=[...o.filter(h=>h.startsWith("aws-sdk-")),...u].join(jE);return r.runtime!=="browser"?(d&&(a[jv]=a[jv]?`${a[HE]} ${d}`:d),a[HE]=f):a[jv]=f,e({...n,request:i})},Tp=r=>{const e=r[0].split(Gv).map(s=>s.replace(mH,GE)).join(Gv),t=r[1]?.replace(vH,GE),n=e.indexOf(Gv),i=e.substring(0,n);let a=e.substring(n+1);return i==="api"&&(a=a.toLowerCase()),[i,a,t].filter(s=>s&&s.length>0).reduce((s,o,l)=>{switch(l){case 0:return o;case 1:return`${s}/${o}`;default:return`${s}#${o}`}},"")},wH={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},CH=r=>({applyToStack:e=>{e.add(bH(r),wH)}}),xH=({serviceId:r,clientVersion:e})=>async t=>{const n=typeof window<"u"?window.navigator:void 0,i=n?.userAgent??"",a=n?.userAgentData?.platform??qE.os(i)??"other",s=void 0,o=n?.userAgentData?.brands??[],l=o[o.length-1],u=l?.brand??qE.browser(i)??"unknown",c=l?.version??"unknown",f=[["aws-sdk-js",e],["ua","2.1"],[`os/${a}`,s],["lang/js"],["md/browser",`${u}_${c}`]];r&&f.push([`api/${r}`,e]);const d=await t?.userAgentAppId?.();return d&&f.push([`app/${d}`]),f},qE={os(r){if(/iPhone|iPad|iPod/.test(r))return"iOS";if(/Macintosh|Mac OS X/.test(r))return"macOS";if(/Windows NT/.test(r))return"Windows";if(/Android/.test(r))return"Android";if(/Linux/.test(r))return"Linux"},browser(r){if(/EdgiOS|EdgA|Edg\//.test(r))return"Microsoft Edge";if(/Firefox\//.test(r))return"Firefox";if(/Chrome\//.test(r))return"Chrome";if(/Safari\//.test(r))return"Safari"}},iP=(r,e=!1)=>{if(e){for(const t of r.split("."))if(!iP(t))return!1;return!0}return!(!Kg(r)||r.length<3||r.length>63||r!==r.toLowerCase()||GI(r))},WE=":",SH="/",EH=r=>{const e=r.split(WE);if(e.length<6)return null;const[t,n,i,a,s,...o]=e;if(t!=="arn"||n===""||i===""||o.join(WE)==="")return null;const l=o.map(u=>u.split(SH)).flat();return{partition:n,service:i,region:a,accountId:s,resourceId:l}},aP={isVirtualHostableS3Bucket:iP,parseArn:EH,partition:hH};$1.aws=aP;const kH=(r,e,t)=>{let n,i,a,s=!1;const o=async()=>{i||(i=r());try{n=await i,a=!0,s=!1}finally{i=void 0}return n};return async l=>((!a||l?.forceRefresh)&&(n=await o()),n)},QE=new Set,TH=(r,e=Kg)=>{if(!QE.has(r)&&!e(r))if(r==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw new Error(`Region not accepted: region="${r}" is not a valid hostname component.`);else QE.add(r)},sP=r=>typeof r=="string"&&(r.startsWith("fips-")||r.endsWith("-fips")),FH=r=>sP(r)?["fips-aws-global","aws-fips"].includes(r)?"us-east-1":r.replace(/fips-(dkr-|prod-)?|-fips/,""):r,IH=r=>{const{region:e,useFipsEndpoint:t}=r;if(!e)throw new Error("Region is missing");return Object.assign(r,{region:async()=>{const n=typeof e=="function"?await e():e,i=FH(n);return TH(i),i},useFipsEndpoint:async()=>{const n=typeof e=="string"?e:await e();return sP(n)?!0:typeof t!="function"?Promise.resolve(!!t):t()}})},PH=["in-region","cross-region","mobile","standard","legacy"],DH=({defaultsMode:r}={})=>kH(async()=>{const e=typeof r=="function"?await r():r;switch(e?.toLowerCase()){case"auto":return Promise.resolve(RH()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(e?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${PH.join(", ")}, got ${e}`)}}),RH=()=>{const r=window?.navigator;if(r?.connection){const{effectiveType:e,rtt:t,downlink:n}=r?.connection;if(typeof e=="string"&&e!=="4g"||Number(t)>100||Number(n)<10)return!0}return r?.userAgentData?.mobile||typeof r?.maxTouchPoints=="number"&&r?.maxTouchPoints>1},OH=!1,BH=!1,MH=r=>({setRegion(e){r.region=e},region(){return r.region}}),_H=r=>({region:r.region()}),YE=r=>sc.isInstance(r)?r.headers?.date??r.headers?.Date:void 0,oP=r=>new Date(Date.now()+r),NH=(r,e)=>Math.abs(oP(e).getTime()-r)>=3e5,XE=(r,e)=>{const t=Date.parse(r);return NH(t,e)?t-Date.now():e},rf=(r,e)=>{if(!e)throw new Error(`Property \`${r}\` is not resolved for AWS SDK SigV4Auth`);return e},LH=async r=>{const e=rf("context",r.context),t=rf("config",r.config),n=e.endpointV2?.properties?.authSchemes?.[0],a=await rf("signer",t.signer)(n),s=r?.signingRegion,o=r?.signingRegionSet,l=r?.signingName;return{config:t,signer:a,signingRegion:s,signingRegionSet:o,signingName:l}};class UH{async sign(e,t,n){if(!na.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const i=await LH(n),{config:a,signer:s}=i;let{signingRegion:o,signingName:l}=i;const u=n.context;if(u?.authSchemes?.length??!1){const[f,d]=u.authSchemes;f?.name==="sigv4a"&&d?.name==="sigv4"&&(o=d?.signingRegion??o,l=d?.signingName??l)}return n._preRequestSystemClockOffset=a.systemClockOffset,await s.sign(e,{signingDate:oP(a.systemClockOffset),signingRegion:o,signingService:l})}errorHandler(e){return t=>{const n=t,i=n.ServerTime??YE(n.$response);if(i){const a=rf("config",e.config),s=e._preRequestSystemClockOffset,o=XE(i,a.systemClockOffset);(o!==a.systemClockOffset||s!==void 0&&s!==o)&&n.$metadata&&(a.systemClockOffset=o,n.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){const n=YE(e);if(n){const i=rf("config",t.config);i.systemClockOffset=XE(n,i.systemClockOffset)}}}class VH{format(e){const t=[];for(const a of Object.keys(e)){const s=kl(a);t.push(Uint8Array.from([s.byteLength]),s,this.formatHeaderValue(e[a]))}const n=new Uint8Array(t.reduce((a,s)=>a+s.byteLength,0));let i=0;for(const a of t)n.set(a,i),i+=a.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const i=new Uint8Array(9);return i[0]=5,i.set(e.value.bytes,1),i;case"binary":const a=new DataView(new ArrayBuffer(3+e.value.byteLength));a.setUint8(0,6),a.setUint16(1,e.value.byteLength,!1);const s=new Uint8Array(a.buffer);return s.set(e.value,3),s;case"string":const o=kl(e.value),l=new DataView(new ArrayBuffer(3+o.byteLength));l.setUint8(0,7),l.setUint16(1,o.byteLength,!1);const u=new Uint8Array(l.buffer);return u.set(o,3),u;case"timestamp":const c=new Uint8Array(9);return c[0]=8,c.set(G1.fromNumber(e.value.valueOf()).bytes,1),c;case"uuid":if(!zH.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const f=new Uint8Array(17);return f[0]=9,f.set($I(e.value.replace(/\-/g,"")),1),f}}}var JE;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(JE||(JE={}));const zH=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class G1{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const t=new Uint8Array(8);for(let n=7,i=Math.abs(Math.round(e));n>-1&&i>0;n--,i/=256)t[n]=i;return e<0&&KE(t),new G1(t)}valueOf(){const e=this.bytes.slice(0),t=e[0]&128;return t&&KE(e),parseInt(Ao(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function KE(r){for(let e=0;e<8;e++)r[e]^=255;for(let e=7;e>-1&&(r[e]++,r[e]===0);e--);}const $H="X-Amz-Algorithm",HH="X-Amz-Credential",lP="X-Amz-Date",jH="X-Amz-SignedHeaders",GH="X-Amz-Expires",uP="X-Amz-Signature",cP="X-Amz-Security-Token",dP="authorization",fP=lP.toLowerCase(),qH="date",WH=[dP,fP,qH],QH=uP.toLowerCase(),CA="x-amz-content-sha256",YH=cP.toLowerCase(),XH={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},JH=/^proxy-/,KH=/^sec-/,qv="AWS4-HMAC-SHA256",ZH="AWS4-HMAC-SHA256-PAYLOAD",ej="UNSIGNED-PAYLOAD",tj=50,hP="aws4_request",rj=3600*24*7,nj=({query:r={}})=>{const e=[],t={};for(const n of Object.keys(r)){if(n.toLowerCase()===QH)continue;const i=Cl(n);e.push(i);const a=r[n];typeof a=="string"?t[i]=`${i}=${Cl(a)}`:Array.isArray(a)&&(t[i]=a.slice(0).reduce((s,o)=>s.concat([`${i}=${Cl(o)}`]),[]).sort().join("&"))}return e.sort().map(n=>t[n]).filter(n=>n).join("&")},ij=r=>aj(r).toISOString().replace(/\.\d{3}Z$/,"Z"),aj=r=>typeof r=="number"?new Date(r*1e3):typeof r=="string"?Number(r)?new Date(Number(r)*1e3):new Date(r):r;class sj{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:t,region:n,service:i,sha256:a,uriEscapePath:s=!0}){this.service=i,this.sha256=a,this.uriEscapePath=s,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=Bs(n),this.credentialProvider=Bs(t)}createCanonicalRequest(e,t,n){const i=Object.keys(t).sort();return`${e.method}
|
|
3044
3044
|
${this.getCanonicalPath(e)}
|
|
3045
3045
|
${nj(e)}
|
|
@@ -3053,7 +3053,7 @@ ${t}
|
|
|
3053
3053
|
${Ao(s)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const t=[];for(const a of e.split("/"))a?.length!==0&&a!=="."&&(a===".."?t.pop():t.push(a));const n=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return Cl(n).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(e){const t=ij(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}}const Fp={},Wv=[],Qv=(r,e,t)=>`${r}/${e}/${t}/${hP}`,oj=async(r,e,t,n,i)=>{const a=await ZE(r,e.secretAccessKey,e.accessKeyId),s=`${t}:${n}:${i}:${Ao(a)}:${e.sessionToken}`;if(s in Fp)return Fp[s];for(Wv.push(s);Wv.length>tj;)delete Fp[Wv.shift()];let o=`AWS4${e.secretAccessKey}`;for(const l of[t,n,i,hP])o=await ZE(r,o,l);return Fp[s]=o},ZE=(r,e,t)=>{const n=new r(e);return n.update(kf(t)),n.digest()},e2=({headers:r},e,t)=>{const n={};for(const i of Object.keys(r).sort()){if(r[i]==null)continue;const a=i.toLowerCase();(a in XH||e?.has(a)||JH.test(a)||KH.test(a))&&(!t||t&&!t.has(a))||(n[a]=r[i].trim().replace(/\s+/g," "))}return n},Yv=async({headers:r,body:e},t)=>{for(const n of Object.keys(r))if(n.toLowerCase()===CA)return r[n];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||vz(e)){const n=new t;return n.update(kf(e)),Ao(await n.digest())}return ej},lj=(r,e)=>{r=r.toLowerCase();for(const t of Object.keys(e))if(r===t.toLowerCase())return!0;return!1},uj=(r,e={})=>{const{headers:t,query:n={}}=na.clone(r);for(const i of Object.keys(t)){const a=i.toLowerCase();(a.slice(0,6)==="x-amz-"&&!e.unhoistableHeaders?.has(a)||e.hoistableHeaders?.has(a))&&(n[i]=t[i],delete t[i])}return{...r,headers:t,query:n}},t2=r=>{r=na.clone(r);for(const e of Object.keys(r.headers))WH.indexOf(e.toLowerCase())>-1&&delete r.headers[e];return r};class r2 extends sj{headerFormatter=new VH;constructor({applyChecksum:e,credentials:t,region:n,service:i,sha256:a,uriEscapePath:s=!0}){super({applyChecksum:e,credentials:t,region:n,service:i,sha256:a,uriEscapePath:s})}async presign(e,t={}){const{signingDate:n=new Date,expiresIn:i=3600,unsignableHeaders:a,unhoistableHeaders:s,signableHeaders:o,hoistableHeaders:l,signingRegion:u,signingService:c}=t,f=await this.credentialProvider();this.validateResolvedCredentials(f);const d=u??await this.regionProvider(),{longDate:h,shortDate:g}=this.formatDate(n);if(i>rj)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const v=Qv(g,d,c??this.service),y=uj(t2(e),{unhoistableHeaders:s,hoistableHeaders:l});f.sessionToken&&(y.query[cP]=f.sessionToken),y.query[$H]=qv,y.query[HH]=`${f.accessKeyId}/${v}`,y.query[lP]=h,y.query[GH]=i.toString(10);const A=e2(y,a,o);return y.query[jH]=this.getCanonicalHeaderList(A),y.query[uP]=await this.getSignature(h,v,this.getSigningKey(f,d,g,c),this.createCanonicalRequest(y,A,await Yv(e,this.sha256))),y}async sign(e,t){return typeof e=="string"?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:n=new Date,priorSignature:i,signingRegion:a,signingService:s,eventStreamCredentials:o}){const l=a??await this.regionProvider(),{shortDate:u,longDate:c}=this.formatDate(n),f=Qv(u,l,s??this.service),d=await Yv({headers:{},body:t},this.sha256),h=new this.sha256;h.update(e);const g=Ao(await h.digest()),v=[ZH,c,f,i,g,d].join(`
|
|
3054
3054
|
`);return this.signString(v,{signingDate:n,signingRegion:l,signingService:s,eventStreamCredentials:o})}async signMessage(e,{signingDate:t=new Date,signingRegion:n,signingService:i,eventStreamCredentials:a}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:n,signingService:i,priorSignature:e.priorSignature,eventStreamCredentials:a}).then(o=>({message:e.message,signature:o}))}async signString(e,{signingDate:t=new Date,signingRegion:n,signingService:i,eventStreamCredentials:a}={}){const s=a??await this.credentialProvider();this.validateResolvedCredentials(s);const o=n??await this.regionProvider(),{shortDate:l}=this.formatDate(t),u=new this.sha256(await this.getSigningKey(s,o,l,i));return u.update(kf(e)),Ao(await u.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:n,unsignableHeaders:i,signingRegion:a,signingService:s}={}){const o=await this.credentialProvider();this.validateResolvedCredentials(o);const l=a??await this.regionProvider(),u=t2(e),{longDate:c,shortDate:f}=this.formatDate(t),d=Qv(f,l,s??this.service);u.headers[fP]=c,o.sessionToken&&(u.headers[YH]=o.sessionToken);const h=await Yv(u,this.sha256);!lj(CA,u.headers)&&this.applyChecksum&&(u.headers[CA]=h);const g=e2(u,i,n),v=await this.getSignature(c,d,this.getSigningKey(o,l,f,s),this.createCanonicalRequest(u,g,h));return u.headers[dP]=`${qv} Credential=${o.accessKeyId}/${d}, SignedHeaders=${this.getCanonicalHeaderList(g)}, Signature=${v}`,u}async getSignature(e,t,n,i){const a=await this.createStringToSign(e,t,i,qv),s=new this.sha256(await n);return s.update(kf(a)),Ao(await s.digest())}getSigningKey(e,t,n,i){return oj(this.sha256,e,n,t,i||this.service)}}const cj=r=>{let e=r.credentials,t=!!r.credentials,n;Object.defineProperty(r,"credentials",{set(u){u&&u!==e&&u!==n&&(t=!0),e=u;const c=dj(r,{credentials:e,credentialDefaultProvider:r.credentialDefaultProvider}),f=fj(r,c);if(t&&!f.attributed){const d=typeof e=="object"&&e!==null;n=async h=>{const v=await f(h);return d&&(!v.$source||Object.keys(v.$source).length===0)?bV(v,"CREDENTIALS_CODE","e"):v},n.memoized=f.memoized,n.configBound=f.configBound,n.attributed=!0}else n=f},get(){return n},enumerable:!0,configurable:!0}),r.credentials=e;const{signingEscapePath:i=!0,systemClockOffset:a=r.systemClockOffset||0,sha256:s}=r;let o;return r.signer?o=tf(r.signer):r.regionInfoProvider?o=()=>tf(r.region)().then(async u=>[await r.regionInfoProvider(u,{useFipsEndpoint:await r.useFipsEndpoint(),useDualstackEndpoint:await r.useDualstackEndpoint()})||{},u]).then(([u,c])=>{const{signingRegion:f,signingService:d}=u;r.signingRegion=r.signingRegion||f||c,r.signingName=r.signingName||d||r.serviceId;const h={...r,credentials:r.credentials,region:r.signingRegion,service:r.signingName,sha256:s,uriEscapePath:i},g=r.signerConstructor||r2;return new g(h)}):o=async u=>{u=Object.assign({},{name:"sigv4",signingName:r.signingName||r.defaultSigningName,signingRegion:await tf(r.region)(),properties:{}},u);const c=u.signingRegion,f=u.signingName;r.signingRegion=r.signingRegion||c,r.signingName=r.signingName||f||r.serviceId;const d={...r,credentials:r.credentials,region:r.signingRegion,service:r.signingName,sha256:s,uriEscapePath:i},h=r.signerConstructor||r2;return new h(d)},Object.assign(r,{systemClockOffset:a,signingEscapePath:i,signer:o})};function dj(r,{credentials:e,credentialDefaultProvider:t}){let n;return e?e?.memoized?n=e:n=oH(e,sH,nP):t?n=tf(t(Object.assign({},r,{parentClientConfig:r}))):n=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},n.memoized=!0,n}function fj(r,e){if(e.configBound)return e;const t=async n=>e({...n,callerClientConfig:r});return t.memoized=e.memoized,t.configBound=!0,t}const hj=async(r,e,t)=>({operation:vc(e).operation,region:await Bs(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function pj(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-idp",region:r.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function Ur(r){return{schemeId:"smithy.api#noAuth"}}const gj=r=>{const e=[];switch(r.operation){case"AssociateSoftwareToken":{e.push(Ur());break}case"ChangePassword":{e.push(Ur());break}case"CompleteWebAuthnRegistration":{e.push(Ur());break}case"ConfirmDevice":{e.push(Ur());break}case"ConfirmForgotPassword":{e.push(Ur());break}case"ConfirmSignUp":{e.push(Ur());break}case"DeleteUser":{e.push(Ur());break}case"DeleteUserAttributes":{e.push(Ur());break}case"DeleteWebAuthnCredential":{e.push(Ur());break}case"ForgetDevice":{e.push(Ur());break}case"ForgotPassword":{e.push(Ur());break}case"GetDevice":{e.push(Ur());break}case"GetTokensFromRefreshToken":{e.push(Ur());break}case"GetUser":{e.push(Ur());break}case"GetUserAttributeVerificationCode":{e.push(Ur());break}case"GetUserAuthFactors":{e.push(Ur());break}case"GlobalSignOut":{e.push(Ur());break}case"InitiateAuth":{e.push(Ur());break}case"ListDevices":{e.push(Ur());break}case"ListWebAuthnCredentials":{e.push(Ur());break}case"ResendConfirmationCode":{e.push(Ur());break}case"RespondToAuthChallenge":{e.push(Ur());break}case"RevokeToken":{e.push(Ur());break}case"SetUserMFAPreference":{e.push(Ur());break}case"SetUserSettings":{e.push(Ur());break}case"SignUp":{e.push(Ur());break}case"StartWebAuthnRegistration":{e.push(Ur());break}case"UpdateAuthEventFeedback":{e.push(Ur());break}case"UpdateDeviceStatus":{e.push(Ur());break}case"UpdateUserAttributes":{e.push(Ur());break}case"VerifySoftwareToken":{e.push(Ur());break}case"VerifyUserAttribute":{e.push(Ur());break}default:e.push(pj(r))}return e},mj=r=>{const e=cj(r);return Object.assign(e,{authSchemePreference:Bs(r.authSchemePreference??[])})},vj=r=>Object.assign(r,{useDualstackEndpoint:r.useDualstackEndpoint??!1,useFipsEndpoint:r.useFipsEndpoint??!1,defaultSigningName:"cognito-idp"}),pP={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},yj="3.1075.0",Aj={version:yj},bj=r=>new TextEncoder().encode(r);var wj=typeof Buffer<"u"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:bj;function Tf(r){return r instanceof Uint8Array?r:typeof r=="string"?wj(r):ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(r)}function xA(r){return typeof r=="string"?r.length===0:r.byteLength===0}var gP={name:"SHA-256"},n2={name:"HMAC",hash:gP},Cj=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]);const xj={};function Kp(){return typeof window<"u"?window:typeof self<"u"?self:xj}var Sj=(function(){function r(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return r.prototype.update=function(e){if(!xA(e)){var t=Tf(e),n=new Uint8Array(this.toHash.byteLength+t.byteLength);n.set(this.toHash,0),n.set(t,this.toHash.byteLength),this.toHash=n}},r.prototype.digest=function(){var e=this;return this.key?this.key.then(function(t){return Kp().crypto.subtle.sign(n2,t,e.toHash).then(function(n){return new Uint8Array(n)})}):xA(this.toHash)?Promise.resolve(Cj):Promise.resolve().then(function(){return Kp().crypto.subtle.digest(gP,e.toHash)}).then(function(t){return Promise.resolve(new Uint8Array(t))})},r.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(t,n){Kp().crypto.subtle.importKey("raw",Tf(e.secret),n2,!1,["sign"]).then(t,n)}),this.key.catch(function(){}))},r})(),ha=64,Ej=32,kj=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Tj=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Fj=Math.pow(2,53)-1,Zp=(function(){function r(){this.state=Int32Array.from(Tj),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return r.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,this.bytesHashed*8>Fj)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===ha&&(this.hashBuffer(),this.bufferLength=0)},r.prototype.digest=function(){if(!this.finished){var e=this.bytesHashed*8,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%ha>=ha-8){for(var i=this.bufferLength;i<ha;i++)t.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(var i=this.bufferLength;i<ha-8;i++)t.setUint8(i,0);t.setUint32(ha-8,Math.floor(e/4294967296),!0),t.setUint32(ha-4,e),this.hashBuffer(),this.finished=!0}for(var a=new Uint8Array(Ej),i=0;i<8;i++)a[i*4]=this.state[i]>>>24&255,a[i*4+1]=this.state[i]>>>16&255,a[i*4+2]=this.state[i]>>>8&255,a[i*4+3]=this.state[i]>>>0&255;return a},r.prototype.hashBuffer=function(){for(var e=this,t=e.buffer,n=e.state,i=n[0],a=n[1],s=n[2],o=n[3],l=n[4],u=n[5],c=n[6],f=n[7],d=0;d<ha;d++){if(d<16)this.temp[d]=(t[d*4]&255)<<24|(t[d*4+1]&255)<<16|(t[d*4+2]&255)<<8|t[d*4+3]&255;else{var h=this.temp[d-2],g=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10;h=this.temp[d-15];var v=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;this.temp[d]=(g+this.temp[d-7]|0)+(v+this.temp[d-16]|0)}var y=(((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&u^~l&c)|0)+(f+(kj[d]+this.temp[d]|0)|0)|0,A=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&a^i&s^a&s)|0;f=c,c=u,u=l,l=o+y|0,o=s,s=a,a=i,i=y+A|0}n[0]+=i,n[1]+=a,n[2]+=s,n[3]+=o,n[4]+=l,n[5]+=u,n[6]+=c,n[7]+=f},r})(),Ij=(function(){function r(e){this.secret=e,this.hash=new Zp,this.reset()}return r.prototype.update=function(e){if(!(xA(e)||this.error))try{this.hash.update(Tf(e))}catch(t){this.error=t}},r.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},r.prototype.digest=function(){return es(this,void 0,void 0,function(){return ts(this,function(e){return[2,this.digestSync()]})})},r.prototype.reset=function(){if(this.hash=new Zp,this.secret){this.outer=new Zp;var e=Pj(this.secret),t=new Uint8Array(ha);t.set(e);for(var n=0;n<ha;n++)e[n]^=54,t[n]^=92;this.hash.update(e),this.outer.update(t);for(var n=0;n<e.byteLength;n++)e[n]=0}},r})();function Pj(r){var e=Tf(r);if(e.byteLength>ha){var t=new Zp;t.update(e),e=t.digest()}var n=new Uint8Array(ha);return n.set(e),n}var Dj=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function Rj(r){if(Oj(r)&&typeof r.crypto.subtle=="object"){var e=r.crypto.subtle;return Bj(e)}return!1}function Oj(r){if(typeof r=="object"&&typeof r.crypto=="object"){var e=r.crypto.getRandomValues;return typeof e=="function"}return!1}function Bj(r){return r&&Dj.every(function(e){return typeof r[e]=="function"})}var Mj=(function(){function r(e){Rj(Kp())?this.hash=new Sj(e):this.hash=new Ij(e)}return r.prototype.update=function(e,t){this.hash.update(Tf(e))},r.prototype.digest=function(){return this.hash.digest()},r.prototype.reset=function(){this.hash.reset()},r})();function i2(r,e){return new Request(r,e)}function _j(r=0){return new Promise((e,t)=>{r&&setTimeout(()=>{const n=new Error(`Request did not complete within ${r} ms`);n.name="TimeoutError",t(n)},r)})}const Xv={supported:void 0};class q1{config;configProvider;static create(e){return typeof e?.handle=="function"?e:new q1(e)}constructor(e){typeof e=="function"?this.configProvider=e().then(t=>t||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),Xv.supported===void 0&&(Xv.supported=typeof Request<"u"&&"keepalive"in i2("https://[::1]"))}destroy(){}async handle(e,{abortSignal:t,requestTimeout:n}={}){this.config||(this.config=await this.configProvider);const i=n??this.config.requestTimeout,a=this.config.keepAlive===!0,s=this.config.credentials;if(t?.aborted){const C=a2(t);return Promise.reject(C)}let o=e.path;const l=d$(e.query||{});l&&(o+=`?${l}`),e.fragment&&(o+=`#${e.fragment}`);let u="";if(e.username!=null||e.password!=null){const C=e.username??"",S=e.password??"";u=`${C}:${S}@`}const{port:c,method:f}=e,d=`${e.protocol}//${u}${e.hostname}${c?`:${c}`:""}${o}`,h=f==="GET"||f==="HEAD"?void 0:e.body,g={body:h,headers:new Headers(e.headers),method:f,credentials:s};this.config?.cache&&(g.cache=this.config.cache),h&&(g.duplex="half"),typeof AbortController<"u"&&(g.signal=t),Xv.supported&&(g.keepalive=a),typeof this.config.requestInit=="function"&&Object.assign(g,this.config.requestInit(e));let v=()=>{};const y=i2(d,g),A=[fetch(y).then(C=>{const S=C.headers,F={};for(const R of S.entries())F[R[0]]=R[1];return C.body!=null?{response:new sc({headers:F,reason:C.statusText,statusCode:C.status,body:C.body})}:C.blob().then(R=>({response:new sc({headers:F,reason:C.statusText,statusCode:C.status,body:R})}))}),_j(i)];return t&&A.push(new Promise((C,S)=>{const F=()=>{const E=a2(t);S(E)};if(typeof t.addEventListener=="function"){const E=t;E.addEventListener("abort",F,{once:!0}),v=()=>E.removeEventListener("abort",F)}else t.onabort=F})),Promise.race(A).finally(v)}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[e]=t,n))}httpHandlerConfigs(){return this.config??{}}}function a2(r){const e=r&&typeof r=="object"&&"reason"in r?r.reason:void 0;if(e){if(e instanceof Error){const i=new Error("Request aborted");return i.name="AbortError",i.cause=e,i}const n=new Error(String(e));return n.name="AbortError",n}const t=new Error("Request aborted");return t.name="AbortError",t}const Nj=async r=>typeof Blob=="function"&&r instanceof Blob||r.constructor?.name==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await r.arrayBuffer()):Lj(r):Uj(r);async function Lj(r){const e=await Vj(r),t=Zg(e);return new Uint8Array(t)}async function Uj(r){const e=[],t=r.getReader();let n=!1,i=0;for(;!n;){const{done:o,value:l}=await t.read();l&&(e.push(l),i+=l.length),n=o}const a=new Uint8Array(i);let s=0;for(const o of e)a.set(o,s),s+=o.length;return a}function Vj(r){return new Promise((e,t)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return t(new Error("Reader aborted too early"));const i=n.result??"",a=i.indexOf(","),s=a>-1?a+1:i.length;e(i.substring(s))},n.onabort=()=>t(new Error("Read aborted")),n.onerror=()=>t(n.error),n.readAsDataURL(r)})}class zj{queryCompat;errorRegistry;constructor(e=!1){this.queryCompat=e}resolveRestContentType(e,t){const n=t.getMemberSchemas(),i=Object.values(n).find(a=>!!a.getMergedTraits().httpPayload);if(i){const a=i.getMergedTraits().mediaType;return a||(i.isStringSchema()?"text/plain":i.isBlobSchema()?"application/octet-stream":e)}else if(!t.isUnitSchema()&&Object.values(n).find(s=>{const{httpQuery:o,httpQueryParams:l,httpHeader:u,httpLabel:c,httpPrefixHeaders:f}=s.getMergedTraits();return!o&&!l&&!u&&!c&&f===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,t,n,i,a,s){let o=e;e.includes("#")&&([,o]=e.split("#"));const l={$metadata:a,$fault:n.statusCode<500?"client":"server"};if(!this.errorRegistry)throw new Error("@aws-sdk/core/protocols - error handler not initialized.");try{return{errorSchema:s?.(this.errorRegistry,o)??this.errorRegistry.getSchema(e),errorMetadata:l}}catch{i.message=i.message??i.Message??"UnknownError";const c=this.errorRegistry,f=c.getBaseException();if(f){const g=c.getErrorCtor(f)??Error;throw this.decorateServiceException(Object.assign(new g({name:o}),l),i)}const d=i,h=d?.message??d?.Message??d?.Error?.Message??d?.Error?.message;throw this.decorateServiceException(Object.assign(new Error(h),{name:o},l),i)}}compose(e,t,n){let i=n;t.includes("#")&&([i]=t.split("#"));const a=Zi.for(i),s=Zi.for("smithy.ts.sdk.synthetic."+n);e.copyFrom(a),e.copyFrom(s),this.errorRegistry=e}decorateServiceException(e,t={}){if(this.queryCompat){const n=e.Message??t.Message,i=OE(e,t);n&&(i.message=n);const a=i.Error??{};a.Type=i.Error?.Type,a.Code=i.Error?.Code,a.Message=i.Error?.message??i.Error?.Message??n,i.Error=a;const s=i.$metadata.requestId;return s&&(i.RequestId=s),i}return OE(e,t)}setQueryCompatError(e,t){const n=t.headers?.["x-amzn-query-error"];if(e!==void 0&&n!=null){const[i,a]=n.split(";"),s=Object.keys(e),o={Code:i,Type:a};e.Code=i,e.Type=a;for(let l=0;l<s.length;l++){const u=s[l];o[u==="message"?"Message":u]=e[u]}delete o.__type,e.Error=o}}queryCompatOutput(e,t){e.Error&&(t.Error=e.Error),e.Type&&(t.Type=e.Type),e.Code&&(t.Code=e.Code)}findQueryCompatibleError(e,t){try{return e.getSchema(t)}catch{return e.find(i=>vi.of(i).getMergedTraits().awsQueryError?.[0]===t)}}}class W1{serdeContext;setSerdeContext(e){this.serdeContext=e}}class $j{from;to;keys;constructor(e,t){this.from=e,this.to=t;const n=Object.keys(this.from),i=new Set(n);i.delete("__type"),this.keys=i}mark(e){this.keys.delete(e)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){const e=this.keys.values().next().value,t=this.from[e];this.to.$unknown=[e,t]}}}function Hj(r,e,t){if(t?.source){const n=t.source;if(typeof e=="number"&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER||n!==String(e)))return n.includes(".")?new ns(n,"bigDecimal"):BigInt(n)}return e}const jj=(r,e)=>bA(r,e).then(t=>(e?.utf8Encoder??em)(t)),Gj=(r,e)=>jj(r,e).then(t=>{if(t.length)try{return JSON.parse(t)}catch(n){throw n?.name==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:t}),n}return{}}),s2=(r,e)=>Object.keys(r).find(t=>t.toLowerCase()===e.toLowerCase()),Jv=r=>{let e=r;return typeof e=="number"&&(e=e.toString()),e.indexOf(",")>=0&&(e=e.split(",")[0]),e.indexOf(":")>=0&&(e=e.split(":")[0]),e.indexOf("#")>=0&&(e=e.split("#")[1]),e},qj=(r,e,t=!1)=>Wj(r,e,t?["code","header","type"]:["type","code","header"]),Wj=({headers:r},e,t)=>{for(;t.length>0;)switch(t.shift()){case"header":const i=s2(r??{},"x-amzn-errortype");if(i!==void 0)return Jv(r[i]);break;case"code":const a=s2(e??{},"code");if(a&&e[a]!==void 0)return Jv(e[a]);break;case"type":if(e?.__type!==void 0)return Jv(e.__type);break}};class Qj extends W1{settings;constructor(e){super(),this.settings=e}async read(e,t){return this._read(e,typeof t=="string"?JSON.parse(t,Hj):await Gj(t,this.serdeContext))}readObject(e,t){return this._read(e,t)}_read(e,t){const n=t!==null&&typeof t=="object",i=vi.of(e);if(n){if(i.isStructSchema()){const s=t,o=i.isUnionSchema(),l={};let u;const{jsonName:c}=this.settings;c&&(u={});let f;o&&(f=new $j(s,l));for(const[d,h]of i.structIterator()){let g=d;c&&(g=h.getMergedTraits().jsonName??g,u[g]=d),o&&f.mark(g),s[g]!=null&&(l[d]=this._read(h,s[g]))}if(o)f.writeUnknown();else if(typeof s.__type=="string")for(const d in s){const h=s[d],g=c?u[d]??d:d;g in l||(l[g]=h)}return l}if(Array.isArray(t)&&i.isListSchema()){const s=i.getValueSchema(),o=[];for(const l of t)o.push(this._read(s,l));return o}if(i.isMapSchema()){const s=i.getValueSchema(),o={};for(const l in t)o[l]=this._read(s,t[l]);return o}}if(i.isBlobSchema()&&typeof t=="string")return Zg(t);const a=i.getMergedTraits().mediaType;if(i.isStringSchema()&&typeof t=="string"&&a)return a==="application/json"||a.endsWith("+json")?po.from(t):t;if(i.isTimestampSchema()&&t!=null)switch(eP(i,this.settings)){case 5:return nz(t);case 6:return VI(t);case 7:return oz(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}if(i.isBigIntegerSchema()&&(typeof t=="number"||typeof t=="string"))return BigInt(t);if(i.isBigDecimalSchema()&&t!=null){if(t instanceof ns)return t;const s=t;return s.type==="bigDecimal"&&"string"in s?new ns(s.string,s.type):new ns(String(t),"bigDecimal")}if(i.isNumericSchema()&&typeof t=="string"){switch(t){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return t}if(i.isDocumentSchema())if(n){const s=Array.isArray(t)?[]:{};for(const o in t){const l=t[o];l instanceof ns?s[o]=l:s[o]=this._read(i,l)}return s}else return structuredClone(t);return t}}const o2="Ν";class Yj{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(e,t)=>{if(t instanceof ns){const n=`${o2+"nv"+this.counter++}_`+t.string;return this.values.set(`"${n}"`,t.string),n}if(typeof t=="bigint"){const n=t.toString(),i=`${o2+"b"+this.counter++}_`+n;return this.values.set(`"${i}"`,n),i}return t}}replaceInJson(e){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return e;for(const[t,n]of this.values)e=e.replace(t,n);return e}}class Xj extends W1{settings;buffer;useReplacer=!1;rootSchema;constructor(e){super(),this.settings=e}write(e,t){this.rootSchema=vi.of(e),this.buffer=this._write(this.rootSchema,t)}flush(){const{rootSchema:e,useReplacer:t}=this;if(this.rootSchema=void 0,this.useReplacer=!1,e?.isStructSchema()||e?.isDocumentSchema()){if(!t)return JSON.stringify(this.buffer);const n=new Yj;return n.replaceInJson(JSON.stringify(this.buffer,n.createReplacer(),0))}return this.buffer}writeDiscriminatedDocument(e,t){this.write(e,t),typeof this.buffer=="object"&&(this.buffer.__type=vi.of(e).getName(!0))}_write(e,t,n){const i=t!==null&&typeof t=="object",a=vi.of(e);if(i){if(a.isStructSchema()){const s=t,o={},{jsonName:l}=this.settings;let u;l&&(u={});let c=0;for(const[f,d]of a.structIterator()){const h=this._write(d,s[f],a);if(h!==void 0){let g=f;l&&(g=d.getMergedTraits().jsonName??f,u[f]=g),o[g]=h,c++}}if(a.isUnionSchema()&&c===0){const{$unknown:f}=s;if(Array.isArray(f)){const[d,h]=f;o[d]=this._write(15,h)}}else if(typeof s.__type=="string")for(const f in s){const d=s[f],h=l?u[f]??f:f;h in o||(o[h]=this._write(15,d))}return o}if(Array.isArray(t)&&a.isListSchema()){const s=a.getValueSchema(),o=[],l=!!a.getMergedTraits().sparse;for(const u of t)(l||u!=null)&&o.push(this._write(s,u));return o}if(a.isMapSchema()){const s=a.getValueSchema(),o={},l=!!a.getMergedTraits().sparse;for(const u in t){const c=t[u];(l||c!=null)&&(o[u]=this._write(s,c))}return o}if(t instanceof Uint8Array&&(a.isBlobSchema()||a.isDocumentSchema()))return a===this.rootSchema?t:(this.serdeContext?.base64Encoder??Cg)(t);if(t instanceof Date&&(a.isTimestampSchema()||a.isDocumentSchema()))switch(eP(a,this.settings)){case 5:return t.toISOString().replace(".000Z","Z");case 6:return tz(t);case 7:return t.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",t),t.getTime()/1e3}t instanceof ns&&(this.useReplacer=!0)}if(!(t===null&&n?.isStructSchema())){if(a.isStringSchema()){if(typeof t>"u"&&a.isIdempotencyToken())return t$();const s=a.getMergedTraits().mediaType;return t!=null&&s&&(s==="application/json"||s.endsWith("+json"))?po.from(t):t}if(typeof t=="number"&&a.isNumericSchema())return Math.abs(t)===1/0||isNaN(t)?String(t):t;if(typeof t=="string"&&a.isBlobSchema())return a===this.rootSchema?t:(this.serdeContext?.base64Encoder??Cg)(t);if(typeof t=="bigint"&&(this.useReplacer=!0),a.isDocumentSchema())if(i){const s=Array.isArray(t)?[]:{};for(const o in t){const l=t[o];l instanceof ns?(this.useReplacer=!0,s[o]=l):s[o]=this._write(a,l)}return s}else return structuredClone(t);return t}}}class Jj extends W1{settings;constructor(e){super(),this.settings=e}createSerializer(){const e=new Xj(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){const e=new Qj(this.settings);return e.setSerdeContext(this.serdeContext),e}}class Kj extends i${serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:i,jsonCodec:a}){super({defaultNamespace:e,errorTypeRegistries:t}),this.serviceTarget=n,this.codec=a??new Jj({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!i,this.mixin=new zj(this.awsQueryCompatible)}async serializeRequest(e,t,n){const i=await super.serializeRequest(e,t,n);return i.path.endsWith("/")||(i.path+="/"),i.headers["content-type"]=`application/x-amz-json-${this.getJsonRpcVersion()}`,i.headers["x-amz-target"]=`${this.serviceTarget}.${e.name}`,this.awsQueryCompatible&&(i.headers["x-amzn-query-mode"]="true"),(Yp(e.input)==="unit"||!i.body)&&(i.body="{}"),i}getPayloadCodec(){return this.codec}async handleError(e,t,n,i,a){const{awsQueryCompatible:s}=this;s&&this.mixin.setQueryCompatError(i,n);const o=qj(n,i,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace);const{errorSchema:l,errorMetadata:u}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,n,i,a,s?this.mixin.findQueryCompatibleError:void 0),c=vi.of(l),f=i.message??i.Message??"UnknownError",d=this.compositeErrorRegistry.getErrorCtor(l)??Error,h=new d({}),g={},v=this.codec.createDeserializer();for(const[y,A]of c.structIterator())i[y]!=null&&(g[y]=v.readObject(A,i[y]));throw s&&this.mixin.queryCompatOutput(i,g),this.mixin.decorateServiceException(Object.assign(h,u,{$fault:c.getMergedTraits().error,message:f},g),i)}}class Zj extends Kj{constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:i,jsonCodec:a}){super({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:i,jsonCodec:a})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}const Ff="ref",hl=-1,Ip=!0,l2="isSet",mP="PartitionResult",Pp="booleanEquals",Kv="getAttr",Fd="stringEquals",u2={[Ff]:"Endpoint"},Zv={[Ff]:mP},$d={[Ff]:"Region"},Ya={},c2=[$d],d2={conditions:[[l2,[u2]],[l2,c2],["aws.partition",c2,mP],[Pp,[{[Ff]:"UseFIPS"},Ip]],[Pp,[{fn:Kv,argv:[Zv,"supportsFIPS"]},Ip]],[Pp,[{[Ff]:"UseDualStack"},Ip]],[Pp,[{fn:Kv,argv:[Zv,"supportsDualStack"]},Ip]],[Fd,[{fn:Kv,argv:[Zv,"name"]},"aws"]],[Fd,[$d,"us-east-1"]],[Fd,[$d,"us-east-2"]],[Fd,[$d,"us-west-1"]],[Fd,[$d,"us-west-2"]]],results:[[hl],[hl,"Invalid Configuration: FIPS and custom endpoint are not supported"],[hl,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[u2,Ya],["https://cognito-idp-fips.us-east-1.amazonaws.com",Ya],["https://cognito-idp-fips.us-east-2.amazonaws.com",Ya],["https://cognito-idp-fips.us-west-1.amazonaws.com",Ya],["https://cognito-idp-fips.us-west-2.amazonaws.com",Ya],["https://cognito-idp-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",Ya],[hl,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://cognito-idp-fips.{Region}.{PartitionResult#dnsSuffix}",Ya],[hl,"FIPS is enabled but this partition does not support FIPS"],["https://cognito-idp.{Region}.amazonaws.com",Ya],["https://cognito-idp.{Region}.{PartitionResult#dualStackDnsSuffix}",Ya],[hl,"DualStack is enabled but this partition does not support DualStack"],["https://cognito-idp.{Region}.{PartitionResult#dnsSuffix}",Ya],[hl,"Invalid Configuration: Missing Region"]]},eG=2,pi=1e8,tG=new Int32Array([-1,1,-1,0,17,3,1,4,pi+16,2,5,pi+16,3,9,6,5,7,pi+15,6,8,pi+14,7,pi+12,pi+13,4,11,10,5,pi+9,pi+11,5,12,pi+10,6,13,pi+9,8,pi+4,14,9,pi+5,15,10,pi+6,16,11,pi+7,pi+8,3,pi+1,18,5,pi+2,pi+3]),rG=z1.from(tG,eG,d2.conditions,d2.results),nG=new Oz({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),iG=(r,e={})=>nG.get(r,()=>Kz(rG,{endpointParams:r,logger:e.logger}));$1.aws=aP;class Ct extends Lu{constructor(e){super(e),Object.setPrototypeOf(this,Ct.prototype)}}class Q1 extends Ct{name="AccessDeniedException";$fault="client";constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,Q1.prototype)}}class Y1 extends Ct{name="InternalErrorException";$fault="server";constructor(e){super({name:"InternalErrorException",$fault:"server",...e}),Object.setPrototypeOf(this,Y1.prototype)}}class X1 extends Ct{name="InvalidParameterException";$fault="client";reasonCode;constructor(e){super({name:"InvalidParameterException",$fault:"client",...e}),Object.setPrototypeOf(this,X1.prototype),this.reasonCode=e.reasonCode}}class J1 extends Ct{name="NotAuthorizedException";$fault="client";constructor(e){super({name:"NotAuthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,J1.prototype)}}class K1 extends Ct{name="OperationNotEnabledException";$fault="client";constructor(e){super({name:"OperationNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,K1.prototype)}}class Z1 extends Ct{name="ResourceNotFoundException";$fault="client";constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,Z1.prototype)}}class eb extends Ct{name="TooManyRequestsException";$fault="client";constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),Object.setPrototypeOf(this,eb.prototype)}}class tb extends Ct{name="UserImportInProgressException";$fault="client";constructor(e){super({name:"UserImportInProgressException",$fault:"client",...e}),Object.setPrototypeOf(this,tb.prototype)}}class rb extends Ct{name="InternalServerException";$fault="server";constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,rb.prototype)}}class nb extends Ct{name="LimitExceededException";$fault="client";constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),Object.setPrototypeOf(this,nb.prototype)}}class ib extends Ct{name="UserNotFoundException";$fault="client";constructor(e){super({name:"UserNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,ib.prototype)}}class ab extends Ct{name="InvalidLambdaResponseException";$fault="client";constructor(e){super({name:"InvalidLambdaResponseException",$fault:"client",...e}),Object.setPrototypeOf(this,ab.prototype)}}class sb extends Ct{name="TooManyFailedAttemptsException";$fault="client";constructor(e){super({name:"TooManyFailedAttemptsException",$fault:"client",...e}),Object.setPrototypeOf(this,sb.prototype)}}class ob extends Ct{name="UnexpectedLambdaException";$fault="client";constructor(e){super({name:"UnexpectedLambdaException",$fault:"client",...e}),Object.setPrototypeOf(this,ob.prototype)}}class lb extends Ct{name="UserLambdaValidationException";$fault="client";constructor(e){super({name:"UserLambdaValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,lb.prototype)}}class ub extends Ct{name="CodeDeliveryFailureException";$fault="client";constructor(e){super({name:"CodeDeliveryFailureException",$fault:"client",...e}),Object.setPrototypeOf(this,ub.prototype)}}class cb extends Ct{name="InvalidPasswordException";$fault="client";constructor(e){super({name:"InvalidPasswordException",$fault:"client",...e}),Object.setPrototypeOf(this,cb.prototype)}}class db extends Ct{name="InvalidSmsRoleAccessPolicyException";$fault="client";constructor(e){super({name:"InvalidSmsRoleAccessPolicyException",$fault:"client",...e}),Object.setPrototypeOf(this,db.prototype)}}class fb extends Ct{name="InvalidSmsRoleTrustRelationshipException";$fault="client";constructor(e){super({name:"InvalidSmsRoleTrustRelationshipException",$fault:"client",...e}),Object.setPrototypeOf(this,fb.prototype)}}class hb extends Ct{name="PreconditionNotMetException";$fault="client";constructor(e){super({name:"PreconditionNotMetException",$fault:"client",...e}),Object.setPrototypeOf(this,hb.prototype)}}class pb extends Ct{name="UnsupportedUserStateException";$fault="client";constructor(e){super({name:"UnsupportedUserStateException",$fault:"client",...e}),Object.setPrototypeOf(this,pb.prototype)}}class gb extends Ct{name="UsernameExistsException";$fault="client";constructor(e){super({name:"UsernameExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,gb.prototype)}}class mb extends Ct{name="AliasExistsException";$fault="client";constructor(e){super({name:"AliasExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,mb.prototype)}}class vb extends Ct{name="InvalidUserPoolConfigurationException";$fault="client";constructor(e){super({name:"InvalidUserPoolConfigurationException",$fault:"client",...e}),Object.setPrototypeOf(this,vb.prototype)}}class yb extends Ct{name="InvalidEmailRoleAccessPolicyException";$fault="client";constructor(e){super({name:"InvalidEmailRoleAccessPolicyException",$fault:"client",...e}),Object.setPrototypeOf(this,yb.prototype)}}class Ab extends Ct{name="MFAMethodNotFoundException";$fault="client";constructor(e){super({name:"MFAMethodNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,Ab.prototype)}}class bb extends Ct{name="PasswordResetRequiredException";$fault="client";constructor(e){super({name:"PasswordResetRequiredException",$fault:"client",...e}),Object.setPrototypeOf(this,bb.prototype)}}class wb extends Ct{name="UnsupportedOperationException";$fault="client";constructor(e){super({name:"UnsupportedOperationException",$fault:"client",...e}),Object.setPrototypeOf(this,wb.prototype)}}class Cb extends Ct{name="UserNotConfirmedException";$fault="client";constructor(e){super({name:"UserNotConfirmedException",$fault:"client",...e}),Object.setPrototypeOf(this,Cb.prototype)}}class xb extends Ct{name="UserPoolAddOnNotEnabledException";$fault="client";constructor(e){super({name:"UserPoolAddOnNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,xb.prototype)}}class Sb extends Ct{name="CodeMismatchException";$fault="client";constructor(e){super({name:"CodeMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,Sb.prototype)}}class Eb extends Ct{name="ExpiredCodeException";$fault="client";constructor(e){super({name:"ExpiredCodeException",$fault:"client",...e}),Object.setPrototypeOf(this,Eb.prototype)}}class kb extends Ct{name="PasswordHistoryPolicyViolationException";$fault="client";constructor(e){super({name:"PasswordHistoryPolicyViolationException",$fault:"client",...e}),Object.setPrototypeOf(this,kb.prototype)}}class Tb extends Ct{name="SoftwareTokenMFANotFoundException";$fault="client";constructor(e){super({name:"SoftwareTokenMFANotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,Tb.prototype)}}class Fb extends Ct{name="ConcurrentModificationException";$fault="client";constructor(e){super({name:"ConcurrentModificationException",$fault:"client",...e}),Object.setPrototypeOf(this,Fb.prototype)}}class Ib extends Ct{name="ForbiddenException";$fault="client";constructor(e){super({name:"ForbiddenException",$fault:"client",...e}),Object.setPrototypeOf(this,Ib.prototype)}}class Pb extends Ct{name="WebAuthnChallengeNotFoundException";$fault="client";constructor(e){super({name:"WebAuthnChallengeNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,Pb.prototype)}}class Db extends Ct{name="WebAuthnClientMismatchException";$fault="client";constructor(e){super({name:"WebAuthnClientMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,Db.prototype)}}class Rb extends Ct{name="WebAuthnCredentialNotSupportedException";$fault="client";constructor(e){super({name:"WebAuthnCredentialNotSupportedException",$fault:"client",...e}),Object.setPrototypeOf(this,Rb.prototype)}}class Ob extends Ct{name="WebAuthnNotEnabledException";$fault="client";constructor(e){super({name:"WebAuthnNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,Ob.prototype)}}class Bb extends Ct{name="WebAuthnOriginNotAllowedException";$fault="client";constructor(e){super({name:"WebAuthnOriginNotAllowedException",$fault:"client",...e}),Object.setPrototypeOf(this,Bb.prototype)}}class Mb extends Ct{name="WebAuthnRelyingPartyMismatchException";$fault="client";constructor(e){super({name:"WebAuthnRelyingPartyMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,Mb.prototype)}}class _b extends Ct{name="DeviceKeyExistsException";$fault="client";constructor(e){super({name:"DeviceKeyExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,_b.prototype)}}class Nb extends Ct{name="GroupExistsException";$fault="client";constructor(e){super({name:"GroupExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,Nb.prototype)}}class Lb extends Ct{name="DuplicateProviderException";$fault="client";constructor(e){super({name:"DuplicateProviderException",$fault:"client",...e}),Object.setPrototypeOf(this,Lb.prototype)}}class Ub extends Ct{name="ManagedLoginBrandingExistsException";$fault="client";constructor(e){super({name:"ManagedLoginBrandingExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,Ub.prototype)}}class Vb extends Ct{name="TermsExistsException";$fault="client";constructor(e){super({name:"TermsExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,Vb.prototype)}}class zb extends Ct{name="FeatureUnavailableInTierException";$fault="client";constructor(e){super({name:"FeatureUnavailableInTierException",$fault:"client",...e}),Object.setPrototypeOf(this,zb.prototype)}}class $b extends Ct{name="TierChangeNotAllowedException";$fault="client";constructor(e){super({name:"TierChangeNotAllowedException",$fault:"client",...e}),Object.setPrototypeOf(this,$b.prototype)}}class Hb extends Ct{name="UserPoolTaggingException";$fault="client";constructor(e){super({name:"UserPoolTaggingException",$fault:"client",...e}),Object.setPrototypeOf(this,Hb.prototype)}}class jb extends Ct{name="InvalidOAuthFlowException";$fault="client";constructor(e){super({name:"InvalidOAuthFlowException",$fault:"client",...e}),Object.setPrototypeOf(this,jb.prototype)}}class Gb extends Ct{name="ScopeDoesNotExistException";$fault="client";constructor(e){super({name:"ScopeDoesNotExistException",$fault:"client",...e}),Object.setPrototypeOf(this,Gb.prototype)}}class qb extends Ct{name="UnsupportedIdentityProviderException";$fault="client";constructor(e){super({name:"UnsupportedIdentityProviderException",$fault:"client",...e}),Object.setPrototypeOf(this,qb.prototype)}}class Wb extends Ct{name="RefreshTokenReuseException";$fault="client";constructor(e){super({name:"RefreshTokenReuseException",$fault:"client",...e}),Object.setPrototypeOf(this,Wb.prototype)}}class Qb extends Ct{name="UnauthorizedException";$fault="client";constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,Qb.prototype)}}class Yb extends Ct{name="UnsupportedTokenTypeException";$fault="client";constructor(e){super({name:"UnsupportedTokenTypeException",$fault:"client",...e}),Object.setPrototypeOf(this,Yb.prototype)}}class Xb extends Ct{name="WebAuthnConfigurationMissingException";$fault="client";constructor(e){super({name:"WebAuthnConfigurationMissingException",$fault:"client",...e}),Object.setPrototypeOf(this,Xb.prototype)}}class Jb extends Ct{name="EnableSoftwareTokenMFAException";$fault="client";constructor(e){super({name:"EnableSoftwareTokenMFAException",$fault:"client",...e}),Object.setPrototypeOf(this,Jb.prototype)}}const aG="AvailableChallenges",sG="AccessDeniedException",oG="AliasExistsException",lG="AnalyticsEndpointId",uG="AuthFlow",vP="AnalyticsMetadata",cG="AnalyticsMetadataType",dG="AuthParameters",fG="AuthParametersType",yP="AuthenticationResult",hG="AuthenticationResultType",pG="AccessToken",gG="CodeDeliveryFailureException",AP="ClientId",mG="ClientIdType",bP="ClientMetadata",vG="CodeMismatchException",yG="ConcurrentModificationException",Kb="ChallengeName",wP="ChallengeParameters",AG="ChallengeResponses",bG="ChallengeResponsesType",wG="DeviceGroupKey",CG="DeviceKey",xG="DeviceKeyExistsException",SG="DuplicateProviderException",EG="ExpiredCodeException",kG="EncodedData",TG="ExpiresIn",FG="EnableSoftwareTokenMFAException",IG="ForbiddenException",PG="FeatureUnavailableInTierException",DG="GroupExistsException",RG="IpAddress",OG="InitiateAuthRequest",BG="InitiateAuthResponse",MG="InitiateAuth",_G="InternalErrorException",NG="InvalidEmailRoleAccessPolicyException",LG="InvalidLambdaResponseException",UG="InvalidOAuthFlowException",VG="InvalidParameterException",zG="InvalidPasswordException",$G="InternalServerException",HG="InvalidSmsRoleAccessPolicyException",jG="InvalidSmsRoleTrustRelationshipException",GG="IdToken",qG="InvalidUserPoolConfigurationException",WG="LimitExceededException",QG="MFAMethodNotFoundException",YG="ManagedLoginBrandingExistsException",XG="NotAuthorizedException",JG="NewDeviceMetadata",KG="NewDeviceMetadataType",ZG="OperationNotEnabledException",eq="PasswordHistoryPolicyViolationException",tq="PreconditionNotMetException",rq="PasswordResetRequiredException",nq="ResourceNotFoundException",iq="RefreshToken",aq="RespondToAuthChallenge",sq="RespondToAuthChallengeRequest",oq="RespondToAuthChallengeResponse",lq="RefreshTokenReuseException",nm="Session",uq="ScopeDoesNotExistException",cq="SessionType",dq="SoftwareTokenMFANotFoundException",fq="TierChangeNotAllowedException",hq="TermsExistsException",pq="TooManyFailedAttemptsException",gq="TooManyRequestsException",mq="TokenModelType",vq="TokenType",yq="UserContextDataType",CP="UserContextData",Aq="UnauthorizedException",bq="UsernameExistsException",wq="UserImportInProgressException",Cq="UnsupportedIdentityProviderException",xq="UnexpectedLambdaException",Sq="UserLambdaValidationException",Eq="UserNotConfirmedException",kq="UserNotFoundException",Tq="UnsupportedOperationException",Fq="UserPoolAddOnNotEnabledException",Iq="UserPoolTaggingException",Pq="UnsupportedTokenTypeException",Dq="UnsupportedUserStateException",Rq="WebAuthnClientMismatchException",Oq="WebAuthnConfigurationMissingException",Bq="WebAuthnChallengeNotFoundException",Mq="WebAuthnCredentialNotSupportedException",_q="WebAuthnNotEnabledException",Nq="WebAuthnOriginNotAllowedException",Lq="WebAuthnRelyingPartyMismatchException",It="client",Tt="error",Pt="httpError",Ft="message",Uq="reasonCode",xP="smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentityprovider",SP="server",at="com.amazonaws.cognitoidentityprovider",EP=Zi.for(xP);var Vq=[-3,xP,"CognitoIdentityProviderServiceException",0,[],[]];EP.registerError(Vq,Ct);const kt=Zi.for(at);var zq=[-3,at,sG,{[Tt]:It,[Pt]:403},[Ft],[0]];kt.registerError(zq,Q1);var $q=[-3,at,oG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError($q,mb);var Hq=[-3,at,gG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(Hq,ub);var jq=[-3,at,vG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(jq,Sb);var Gq=[-3,at,yG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(Gq,Fb);var qq=[-3,at,xG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(qq,_b);var Wq=[-3,at,SG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(Wq,Lb);var Qq=[-3,at,FG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(Qq,Jb);var Yq=[-3,at,EG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(Yq,Eb);var Xq=[-3,at,PG,{[Tt]:It,[Pt]:403},[Ft],[0]];kt.registerError(Xq,zb);var Jq=[-3,at,IG,{[Tt]:It,[Pt]:403},[Ft],[0]];kt.registerError(Jq,Ib);var Kq=[-3,at,DG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(Kq,Nb);var Zq=[-3,at,_G,{[Tt]:SP},[Ft],[0]];kt.registerError(Zq,Y1);var eW=[-3,at,$G,{[Tt]:SP},[Ft],[0]];kt.registerError(eW,rb);var tW=[-3,at,NG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(tW,yb);var rW=[-3,at,LG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(rW,ab);var nW=[-3,at,UG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(nW,jb);var iW=[-3,at,VG,{[Tt]:It,[Pt]:400},[Ft,Uq],[0,0]];kt.registerError(iW,X1);var aW=[-3,at,zG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(aW,cb);var sW=[-3,at,HG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(sW,db);var oW=[-3,at,jG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(oW,fb);var lW=[-3,at,qG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(lW,vb);var uW=[-3,at,WG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(uW,nb);var cW=[-3,at,YG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(cW,Ub);var dW=[-3,at,QG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(dW,Ab);var fW=[-3,at,XG,{[Tt]:It,[Pt]:403},[Ft],[0]];kt.registerError(fW,J1);var hW=[-3,at,ZG,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(hW,K1);var pW=[-3,at,eq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(pW,kb);var gW=[-3,at,rq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(gW,bb);var mW=[-3,at,tq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(mW,hb);var vW=[-3,at,lq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(vW,Wb);var yW=[-3,at,nq,{[Tt]:It,[Pt]:404},[Ft],[0]];kt.registerError(yW,Z1);var AW=[-3,at,uq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(AW,Gb);var bW=[-3,at,dq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(bW,Tb);var wW=[-3,at,hq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(wW,Vb);var CW=[-3,at,fq,{[Tt]:It,[Pt]:403},[Ft],[0]];kt.registerError(CW,$b);var xW=[-3,at,pq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(xW,sb);var SW=[-3,at,gq,{[Tt]:It,[Pt]:429},[Ft],[0]];kt.registerError(SW,eb);var EW=[-3,at,Aq,{[Tt]:It,[Pt]:401},[Ft],[0]];kt.registerError(EW,Qb);var kW=[-3,at,xq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(kW,ob);var TW=[-3,at,Cq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(TW,qb);var FW=[-3,at,Tq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(FW,wb);var IW=[-3,at,Pq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(IW,Yb);var PW=[-3,at,Dq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(PW,pb);var DW=[-3,at,wq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(DW,tb);var RW=[-3,at,Sq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(RW,lb);var OW=[-3,at,bq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(OW,gb);var BW=[-3,at,Eq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(BW,Cb);var MW=[-3,at,kq,{[Tt]:It,[Pt]:404},[Ft],[0]];kt.registerError(MW,ib);var _W=[-3,at,Fq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(_W,xb);var NW=[-3,at,Iq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(NW,Hb);var LW=[-3,at,Bq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(LW,Pb);var UW=[-3,at,Rq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(UW,Db);var VW=[-3,at,Oq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(VW,Xb);var zW=[-3,at,Mq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(zW,Rb);var $W=[-3,at,_q,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError($W,Ob);var HW=[-3,at,Nq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(HW,Bb);var jW=[-3,at,Lq,{[Tt]:It,[Pt]:400},[Ft],[0]];kt.registerError(jW,Mb);const GW=[EP,kt];var kP=[0,at,mG,8,0],im=[0,at,cq,8,0],ey=[0,at,mq,8,0],TP=[3,at,cG,0,[lG],[0]],FP=[3,at,hG,0,[pG,TG,vq,iq,GG,JG],[[()=>ey,0],1,0,[()=>ey,0],[()=>ey,0],()=>QW]],qW=[3,at,OG,0,[uG,AP,dG,bP,vP,CP,nm],[0,[()=>kP,0],[()=>JW,0],128,()=>TP,[()=>IP,0],[()=>im,0]],2],WW=[3,at,BG,0,[Kb,nm,wP,yP,aG],[0,[()=>im,0],128,[()=>FP,0],64]],QW=[3,at,KG,0,[CG,wG],[0,0]],YW=[3,at,sq,0,[AP,Kb,nm,AG,vP,CP,bP],[[()=>kP,0],0,[()=>im,0],[()=>KW,0],()=>TP,[()=>IP,0],128],2],XW=[3,at,oq,0,[Kb,nm,wP,yP],[0,[()=>im,0],128,[()=>FP,0]]],IP=[3,at,yq,8,[RG,kG],[0,0]],JW=[2,at,fG,8,0,0],KW=[2,at,bG,8,0,0],ZW=[9,at,MG,0,()=>qW,()=>WW],eQ=[9,at,aq,0,()=>YW,()=>XW];const tQ=r=>({apiVersion:"2016-04-18",base64Decoder:r?.base64Decoder??Zg,base64Encoder:r?.base64Encoder??Cg,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??iG,extensions:r?.extensions??[],httpAuthSchemeProvider:r?.httpAuthSchemeProvider??gj,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new UH},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new nH}],logger:r?.logger??new NI,protocol:r?.protocol??Zj,protocolSettings:r?.protocolSettings??{defaultNamespace:"com.amazonaws.cognitoidentityprovider",errorTypeRegistries:GW,xmlNamespace:"http://cognito-idp.amazonaws.com/doc/2016-04-18/",version:"2016-04-18",serviceTarget:"AWSCognitoIdentityProviderService"},serviceId:r?.serviceId??"Cognito Identity Provider",urlParser:r?.urlParser??wg,utf8Decoder:r?.utf8Decoder??kl,utf8Encoder:r?.utf8Encoder??em}),rQ=r=>{const e=DH(r),t=()=>e().then(BV),n=tQ(r);return{...n,...r,runtime:"browser",defaultsMode:e,bodyLengthChecker:r?.bodyLengthChecker??mz,credentialDefaultProvider:r?.credentialDefaultProvider??(i=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:r?.defaultUserAgentProvider??xH({serviceId:n.serviceId,clientVersion:Aj.version}),maxAttempts:r?.maxAttempts??ef,region:r?.region??EV("Region is missing"),requestHandler:q1.create(r?.requestHandler??t),retryMode:r?.retryMode??(async()=>(await t()).retryMode||M$),sha256:r?.sha256??Mj,streamCollector:r?.streamCollector??Nj,useDualstackEndpoint:r?.useDualstackEndpoint??(()=>Promise.resolve(OH)),useFipsEndpoint:r?.useFipsEndpoint??(()=>Promise.resolve(BH))}},nQ=r=>{const e=r.httpAuthSchemes;let t=r.httpAuthSchemeProvider,n=r.credentials;return{setHttpAuthScheme(i){const a=e.findIndex(s=>s.schemeId===i.schemeId);a===-1?e.push(i):e.splice(a,1,i)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(i){t=i},httpAuthSchemeProvider(){return t},setCredentials(i){n=i},credentials(){return n}}},iQ=r=>({httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}),aQ=(r,e)=>{const t=Object.assign(MH(r),UV(r),a$(r),nQ(r));return e.forEach(n=>n.configure(t)),Object.assign(r,_H(t),VV(t),s$(t),iQ(t))};class sQ extends kV{config;constructor(...[e]){const t=rQ(e||{});super(t),this.initConfig=t;const n=vj(t),i=cH(n),a=N$(i),s=IH(a),o=s,l=Zz(o),u=mj(l),c=aQ(u,e?.extensions||[]);this.config=c,this.middlewareStack.use(DV(this.config)),this.middlewareStack.use(CH(this.config)),this.middlewareStack.use(L$(this.config)),this.middlewareStack.use(u$(this.config)),this.middlewareStack.use(z$(this.config)),this.middlewareStack.use(j$(this.config)),this.middlewareStack.use(G$(this.config)),this.middlewareStack.use(X$(this.config,{httpAuthSchemeParametersProvider:hj,identityProviderConfigProvider:async f=>new rH({"aws.auth#sigv4":f.credentials})})),this.middlewareStack.use(tH(this.config))}destroy(){super.destroy()}}class f2 extends U1.classBuilder().ep(pP).m(function(e,t,n,i){return[KI(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","InitiateAuth",{}).n("CognitoIdentityProviderClient","InitiateAuthCommand").sc(ZW).build(){}class oQ extends U1.classBuilder().ep(pP).m(function(e,t,n,i){return[KI(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","RespondToAuthChallenge",{}).n("CognitoIdentityProviderClient","RespondToAuthChallengeCommand").sc(eQ).build(){}class lQ{init(e,t,n){this.cognitoClient=new sQ({region:t}),this.spiffRegion=e,this.userPoolClientId=n}async generateCode(e){const t=await this.cognitoClient?.send(new f2({AuthFlow:"CUSTOM_AUTH",ClientId:this.userPoolClientId,AuthParameters:{USERNAME:e}}));t?.ChallengeName==="CUSTOM_CHALLENGE"&&(this.challengeSession=t.Session)}async verifyCode(e,t,n){const i=await this.cognitoClient?.send(new oQ({ClientId:this.userPoolClientId,ChallengeName:"CUSTOM_CHALLENGE",Session:this.challengeSession,ChallengeResponses:{USERNAME:e,ANSWER:t},ClientMetadata:{partnerId:n,environment:(this.spiffRegion||"").toLowerCase()}}));return i?.ChallengeName==="CUSTOM_CHALLENGE"&&(this.challengeSession=i.Session),i}async refreshTokens(){const e=localStorage.getItem("cognito-tokens");if(!e)throw new Error("Failed to find existing tokens.");const t=JSON.parse(e);return await this.cognitoClient?.send(new f2({AuthFlow:"REFRESH_TOKEN_AUTH",ClientId:this.userPoolClientId,AuthParameters:{REFRESH_TOKEN:t.RefreshToken||""}}))}}const Id=new lQ;var uQ={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},cQ={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function nf(r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?nf=function(e){return typeof e}:nf=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nf(r)}function h2(r){return dQ(r)||fQ(r)||hQ(r)||pQ()}function dQ(r){if(Array.isArray(r))return r}function fQ(r){if(typeof Symbol<"u"&&Symbol.iterator in Object(r))return Array.from(r)}function hQ(r,e){if(r){if(typeof r=="string")return p2(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p2(r,e)}}function p2(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function pQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3055
3055
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var gQ={normalizePrecision:function(e){var t=e.reduce(function(n,i){return Math.max(n.getPrecision(),i.getPrecision())});return e.map(function(n){return n.getPrecision()!==t?n.convertPrecision(t):n})},minimum:function(e){var t=h2(e),n=t[0],i=t.slice(1),a=n;return i.forEach(function(s){a=a.lessThan(s)?a:s}),a},maximum:function(e){var t=h2(e),n=t[0],i=t.slice(1),a=n;return i.forEach(function(s){a=a.greaterThan(s)?a:s}),a}};function PP(r){return!isNaN(parseInt(r))&&isFinite(r)}function mQ(r){return PP(r)&&r<=100&&r>=0}function vQ(r){return r.length>0&&r.every(function(e){return e>=0})&&r.some(function(e){return e>0})}function g2(r){return r%2===0}function m2(r){return PP(r)&&!Number.isInteger(r)}function yQ(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=r.toString();if(e.indexOf("e-")>0)return parseInt(e.split("e-")[1]);var t=e.split(".")[1];return t?t.length:0}function Pd(r){return Math.abs(r)%1===.5}function AQ(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(t,n){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){i.readyState===4&&(i.status>=200&&i.status<400?t(JSON.parse(i.responseText)):n(new Error(i.statusText)))},onerror:function(){n(new Error("Network error"))}});i.open("GET",r,!0),bQ(i,e.headers),i.send()})}function bQ(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var t in e)r.setRequestHeader(t,e[t]);return r}function Hd(r){return typeof r>"u"}function DP(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",t={};return Object.entries(r).forEach(function(n){if(nf(n[1])==="object"){var i=DP(n[1]);Object.entries(i).forEach(function(a){t[n[0]+e+a[0]]=a[1]})}else t[n[0]]=n[1]}),t}function wQ(r){return!!r&&(nf(r)==="object"||typeof r=="function")&&typeof r.then=="function"}function RP(){var r=function(n,i){var a=function(l){return Math.pow(10,yQ(l))},s=Math.max(a(n),a(i));return Math.round(n*s)*Math.round(i*s)/(s*s)},e={HALF_ODD:function(n){var i=Math.round(n);return Pd(n)&&g2(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return Pd(n)?g2(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return Pd(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return Pd(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return Pd(n)?Math.sign(n)*Math.ceil(Math.abs(n)):Math.round(n)},DOWN:function(n){return Math.floor(n)}};return{add:function(n,i){return n+i},subtract:function(n,i){return n-i},multiply:function(n,i){return m2(n)||m2(i)?r(n,i):n*i},divide:function(n,i){return n/i},modulo:function(n,i){return n%i},round:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return e[i](n)}}}var CQ=RP();function xQ(r){var e=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(r);return{getMatches:function(){return e!==null?e.slice(1).filter(function(n){return!Hd(n)}):[]},getMinimumFractionDigits:function(){var n=function(a){return a==="."};return Hd(this.getMatches().find(n))?0:this.getMatches()[CQ.add(this.getMatches().findIndex(n),1)].split("").length},getCurrencyDisplay:function(){var n={USD:"code",dollar:"name",$:"symbol"};return n[this.getMatches().find(function(i){return i==="USD"||i==="dollar"||i==="$"})]},getStyle:function(){return Hd(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Hd(this.getMatches().find(function(n){return n===","}))}}}function SQ(r){var e=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;for(var s in a)i=i.replace("{{".concat(s,"}}"),a[s]);return i},t=function(i,a){return AQ(e(r.endpoint,{from:i,to:a}),{headers:r.headers})};return{getExchangeRate:function(i,a){return(wQ(r.endpoint)?r.endpoint:t(i,a)).then(function(s){return DP(s)[e(r.propertyPath,{from:i,to:a})]})}}}function If(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!r)throw new t(e)}function EQ(r){If(mQ(r),"You must provide a numeric value between 0 and 100.",RangeError)}function kQ(r){If(vQ(r),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function ty(r){If(Number.isInteger(r),"You must provide an integer.",TypeError)}var kn=RP(),TQ=function r(e){var t=Object.assign({},{amount:r.defaultAmount,currency:r.defaultCurrency,precision:r.defaultPrecision},e),n=t.amount,i=t.currency,a=t.precision;ty(n),ty(a);var s=r.globalLocale,o=r.globalFormat,l=r.globalRoundingMode,u=r.globalFormatRoundingMode,c=Object.assign({},r.globalExchangeRatesApi),f=function(g){var v=Object.assign({},Object.assign({},{amount:n,currency:i,precision:a},g),Object.assign({},{locale:this.locale},g));return Object.assign(r({amount:v.amount,currency:v.currency,precision:v.precision}),{locale:v.locale})},d=function(g){If(this.hasSameCurrency(g),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return n},getCurrency:function(){return i},getLocale:function(){return this.locale||s},setLocale:function(g){return f.call(this,{locale:g})},getPrecision:function(){return a},convertPrecision:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;ty(g);var y=this.getPrecision(),A=g>y,C=A?kn.multiply:kn.divide,S=A?[g,y]:[y,g],F=Math.pow(10,kn.subtract.apply(kn,S));return f.call(this,{amount:kn.round(C(this.getAmount(),F),v),precision:g})},add:function(g){d.call(this,g);var v=r.normalizePrecision([this,g]);return f.call(this,{amount:kn.add(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},subtract:function(g){d.call(this,g);var v=r.normalizePrecision([this,g]);return f.call(this,{amount:kn.subtract(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},multiply:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return f.call(this,{amount:kn.round(kn.multiply(this.getAmount(),g),v)})},divide:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return f.call(this,{amount:kn.round(kn.divide(this.getAmount(),g),v)})},percentage:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return EQ(g),this.multiply(kn.divide(g,100),v)},allocate:function(g){var v=this;kQ(g);for(var y=g.reduce(function(F,E){return kn.add(F,E)}),A=this.getAmount(),C=g.map(function(F){var E=Math.floor(kn.divide(kn.multiply(v.getAmount(),F),y));return A=kn.subtract(A,E),f.call(v,{amount:E})}),S=0;A>0;)g[S]>0&&(C[S]=C[S].add(f.call(this,{amount:1})),A=kn.subtract(A,1)),S+=1;return C},convert:function(g){var v=this,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=y.endpoint,C=A===void 0?c.endpoint:A,S=y.propertyPath,F=S===void 0?c.propertyPath||"rates.{{to}}":S,E=y.headers,R=E===void 0?c.headers:E,B=y.roundingMode,j=B===void 0?l:B,G=Object.assign({},{endpoint:C,propertyPath:F,headers:R,roundingMode:j});return SQ(G).getExchangeRate(this.getCurrency(),g).then(function(ie){return If(!Hd(ie),'No rate was found for the destination currency "'.concat(g,'".'),TypeError),f.call(v,{amount:kn.round(kn.multiply(v.getAmount(),parseFloat(ie)),G.roundingMode),currency:g})})},equalsTo:function(g){return this.hasSameAmount(g)&&this.hasSameCurrency(g)},lessThan:function(g){d.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()<v[1].getAmount()},lessThanOrEqual:function(g){d.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()<=v[1].getAmount()},greaterThan:function(g){d.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()>v[1].getAmount()},greaterThanOrEqual:function(g){d.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()>=v[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return kn.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return kn.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(g){return this.getCurrency()===g.getCurrency()},hasSameAmount:function(g){var v=r.normalizePrecision([this,g]);return v[0].getAmount()===v[1].getAmount()},toFormat:function(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=xQ(g);return this.toRoundedUnit(y.getMinimumFractionDigits(),v).toLocaleString(this.getLocale(),{currencyDisplay:y.getCurrencyDisplay(),useGrouping:y.getUseGrouping(),minimumFractionDigits:y.getMinimumFractionDigits(),style:y.getStyle(),currency:this.getCurrency()})},toUnit:function(){return kn.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=Math.pow(10,g);return kn.divide(kn.round(kn.multiply(this.toUnit(),y),v),y)},toObject:function(){return{amount:n,currency:i,precision:a}},toJSON:function(){return this.toObject()}}},FQ=Object.assign(TQ,uQ,cQ,gQ),Xa={},ry,v2;function IQ(){if(v2)return ry;v2=1;function r(t){return t}function e(t,a,s){for(var a=a||r,s=s||t,o=0,l=t.length;o<l;o+=1)if(a.call(s,t[o],o))return t[o]}return ry=e,ry}var ny={exports:{}},y2;function PQ(){if(y2)return ny.exports;y2=1;var r=ny.exports=function(e,t){if(typeof e=="function"||t)return r.by(e,t);for(var n={object:[],function:[],string:{},number:{},boolean:{},undefined:{}},i=[],a=0;a<e.length;a++){var s=e[a],o=s==="__proto__"?n.objects:n[typeof s]||n.objects;Array.isArray(o)?o.indexOf(s)<0&&(o.push(s),i.push(s)):Object.hasOwnProperty.call(o,s)||(o[s]=!0,i.push(s))}return i};return r.by=function(e,t){if(typeof e=="function"){var n=t;t=e,e=n}for(var i=[],a=0;a<e.length;a++){for(var s=e[a],o=!1,l=0;l<i.length;l++){var u=i[l];if(t.call(i,s,u)){o=!0;break}}o||i.push(s)}return i},ny.exports}var iy,A2;function DQ(){return A2||(A2=1,iy=[{code:"AED",number:"784",digits:2,currency:"UAE Dirham",countries:["United Arab Emirates (The)"]},{code:"AFN",number:"971",digits:2,currency:"Afghani",countries:["Afghanistan"]},{code:"ALL",number:"008",digits:2,currency:"Lek",countries:["Albania"]},{code:"AMD",number:"051",digits:2,currency:"Armenian Dram",countries:["Armenia"]},{code:"ANG",number:"532",digits:2,currency:"Netherlands Antillean Guilder",countries:["Curaçao","Sint Maarten (Dutch Part)"]},{code:"AOA",number:"973",digits:2,currency:"Kwanza",countries:["Angola"]},{code:"ARS",number:"032",digits:2,currency:"Argentine Peso",countries:["Argentina"]},{code:"AUD",number:"036",digits:2,currency:"Australian Dollar",countries:["Australia","Christmas Island","Cocos (Keeling) Islands (The)","Heard Island and Mcdonald Islands","Kiribati","Nauru","Norfolk Island","Tuvalu"]},{code:"AWG",number:"533",digits:2,currency:"Aruban Florin",countries:["Aruba"]},{code:"AZN",number:"944",digits:2,currency:"Azerbaijan Manat",countries:["Azerbaijan"]},{code:"BAM",number:"977",digits:2,currency:"Convertible Mark",countries:["Bosnia and Herzegovina"]},{code:"BBD",number:"052",digits:2,currency:"Barbados Dollar",countries:["Barbados"]},{code:"BDT",number:"050",digits:2,currency:"Taka",countries:["Bangladesh"]},{code:"BGN",number:"975",digits:2,currency:"Bulgarian Lev",countries:["Bulgaria"]},{code:"BHD",number:"048",digits:3,currency:"Bahraini Dinar",countries:["Bahrain"]},{code:"BIF",number:"108",digits:0,currency:"Burundi Franc",countries:["Burundi"]},{code:"BMD",number:"060",digits:2,currency:"Bermudian Dollar",countries:["Bermuda"]},{code:"BND",number:"096",digits:2,currency:"Brunei Dollar",countries:["Brunei Darussalam"]},{code:"BOB",number:"068",digits:2,currency:"Boliviano",countries:["Bolivia (Plurinational State Of)"]},{code:"BOV",number:"984",digits:2,currency:"Mvdol",countries:["Bolivia (Plurinational State Of)"]},{code:"BRL",number:"986",digits:2,currency:"Brazilian Real",countries:["Brazil"]},{code:"BSD",number:"044",digits:2,currency:"Bahamian Dollar",countries:["Bahamas (The)"]},{code:"BTN",number:"064",digits:2,currency:"Ngultrum",countries:["Bhutan"]},{code:"BWP",number:"072",digits:2,currency:"Pula",countries:["Botswana"]},{code:"BYN",number:"933",digits:2,currency:"Belarusian Ruble",countries:["Belarus"]},{code:"BZD",number:"084",digits:2,currency:"Belize Dollar",countries:["Belize"]},{code:"CAD",number:"124",digits:2,currency:"Canadian Dollar",countries:["Canada"]},{code:"CDF",number:"976",digits:2,currency:"Congolese Franc",countries:["Congo (The Democratic Republic of The)"]},{code:"CHE",number:"947",digits:2,currency:"WIR Euro",countries:["Switzerland"]},{code:"CHF",number:"756",digits:2,currency:"Swiss Franc",countries:["Liechtenstein","Switzerland"]},{code:"CHW",number:"948",digits:2,currency:"WIR Franc",countries:["Switzerland"]},{code:"CLF",number:"990",digits:4,currency:"Unidad de Fomento",countries:["Chile"]},{code:"CLP",number:"152",digits:0,currency:"Chilean Peso",countries:["Chile"]},{code:"CNY",number:"156",digits:2,currency:"Yuan Renminbi",countries:["China"]},{code:"COP",number:"170",digits:2,currency:"Colombian Peso",countries:["Colombia"]},{code:"COU",number:"970",digits:2,currency:"Unidad de Valor Real",countries:["Colombia"]},{code:"CRC",number:"188",digits:2,currency:"Costa Rican Colon",countries:["Costa Rica"]},{code:"CUC",number:"931",digits:2,currency:"Peso Convertible",countries:["Cuba"]},{code:"CUP",number:"192",digits:2,currency:"Cuban Peso",countries:["Cuba"]},{code:"CVE",number:"132",digits:2,currency:"Cabo Verde Escudo",countries:["Cabo Verde"]},{code:"CZK",number:"203",digits:2,currency:"Czech Koruna",countries:["Czechia"]},{code:"DJF",number:"262",digits:0,currency:"Djibouti Franc",countries:["Djibouti"]},{code:"DKK",number:"208",digits:2,currency:"Danish Krone",countries:["Denmark","Faroe Islands (The)","Greenland"]},{code:"DOP",number:"214",digits:2,currency:"Dominican Peso",countries:["Dominican Republic (The)"]},{code:"DZD",number:"012",digits:2,currency:"Algerian Dinar",countries:["Algeria"]},{code:"EGP",number:"818",digits:2,currency:"Egyptian Pound",countries:["Egypt"]},{code:"ERN",number:"232",digits:2,currency:"Nakfa",countries:["Eritrea"]},{code:"ETB",number:"230",digits:2,currency:"Ethiopian Birr",countries:["Ethiopia"]},{code:"EUR",number:"978",digits:2,currency:"Euro",countries:["Åland Islands","Andorra","Austria","Belgium","Croatia","Cyprus","Estonia","European Union","Finland","France","French Guiana","French Southern Territories (The)","Germany","Greece","Guadeloupe","Holy See (The)","Ireland","Italy","Latvia","Lithuania","Luxembourg","Malta","Martinique","Mayotte","Monaco","Montenegro","Netherlands (The)","Portugal","Réunion","Saint Barthélemy","Saint Martin (French Part)","Saint Pierre and Miquelon","San Marino","Slovakia","Slovenia","Spain"]},{code:"FJD",number:"242",digits:2,currency:"Fiji Dollar",countries:["Fiji"]},{code:"FKP",number:"238",digits:2,currency:"Falkland Islands Pound",countries:["Falkland Islands (The) [Malvinas]"]},{code:"GBP",number:"826",digits:2,currency:"Pound Sterling",countries:["Guernsey","Isle of Man","Jersey","United Kingdom of Great Britain and Northern Ireland (The)"]},{code:"GEL",number:"981",digits:2,currency:"Lari",countries:["Georgia"]},{code:"GHS",number:"936",digits:2,currency:"Ghana Cedi",countries:["Ghana"]},{code:"GIP",number:"292",digits:2,currency:"Gibraltar Pound",countries:["Gibraltar"]},{code:"GMD",number:"270",digits:2,currency:"Dalasi",countries:["Gambia (The)"]},{code:"GNF",number:"324",digits:0,currency:"Guinean Franc",countries:["Guinea"]},{code:"GTQ",number:"320",digits:2,currency:"Quetzal",countries:["Guatemala"]},{code:"GYD",number:"328",digits:2,currency:"Guyana Dollar",countries:["Guyana"]},{code:"HKD",number:"344",digits:2,currency:"Hong Kong Dollar",countries:["Hong Kong"]},{code:"HNL",number:"340",digits:2,currency:"Lempira",countries:["Honduras"]},{code:"HTG",number:"332",digits:2,currency:"Gourde",countries:["Haiti"]},{code:"HUF",number:"348",digits:2,currency:"Forint",countries:["Hungary"]},{code:"IDR",number:"360",digits:2,currency:"Rupiah",countries:["Indonesia"]},{code:"ILS",number:"376",digits:2,currency:"New Israeli Sheqel",countries:["Israel"]},{code:"INR",number:"356",digits:2,currency:"Indian Rupee",countries:["Bhutan","India"]},{code:"IQD",number:"368",digits:3,currency:"Iraqi Dinar",countries:["Iraq"]},{code:"IRR",number:"364",digits:2,currency:"Iranian Rial",countries:["Iran (Islamic Republic Of)"]},{code:"ISK",number:"352",digits:0,currency:"Iceland Krona",countries:["Iceland"]},{code:"JMD",number:"388",digits:2,currency:"Jamaican Dollar",countries:["Jamaica"]},{code:"JOD",number:"400",digits:3,currency:"Jordanian Dinar",countries:["Jordan"]},{code:"JPY",number:"392",digits:0,currency:"Yen",countries:["Japan"]},{code:"KES",number:"404",digits:2,currency:"Kenyan Shilling",countries:["Kenya"]},{code:"KGS",number:"417",digits:2,currency:"Som",countries:["Kyrgyzstan"]},{code:"KHR",number:"116",digits:2,currency:"Riel",countries:["Cambodia"]},{code:"KMF",number:"174",digits:0,currency:"Comorian Franc ",countries:["Comoros (The)"]},{code:"KPW",number:"408",digits:2,currency:"North Korean Won",countries:["Korea (The Democratic People’s Republic Of)"]},{code:"KRW",number:"410",digits:0,currency:"Won",countries:["Korea (The Republic Of)"]},{code:"KWD",number:"414",digits:3,currency:"Kuwaiti Dinar",countries:["Kuwait"]},{code:"KYD",number:"136",digits:2,currency:"Cayman Islands Dollar",countries:["Cayman Islands (The)"]},{code:"KZT",number:"398",digits:2,currency:"Tenge",countries:["Kazakhstan"]},{code:"LAK",number:"418",digits:2,currency:"Lao Kip",countries:["Lao People’s Democratic Republic (The)"]},{code:"LBP",number:"422",digits:2,currency:"Lebanese Pound",countries:["Lebanon"]},{code:"LKR",number:"144",digits:2,currency:"Sri Lanka Rupee",countries:["Sri Lanka"]},{code:"LRD",number:"430",digits:2,currency:"Liberian Dollar",countries:["Liberia"]},{code:"LSL",number:"426",digits:2,currency:"Loti",countries:["Lesotho"]},{code:"LYD",number:"434",digits:3,currency:"Libyan Dinar",countries:["Libya"]},{code:"MAD",number:"504",digits:2,currency:"Moroccan Dirham",countries:["Morocco","Western Sahara"]},{code:"MDL",number:"498",digits:2,currency:"Moldovan Leu",countries:["Moldova (The Republic Of)"]},{code:"MGA",number:"969",digits:2,currency:"Malagasy Ariary",countries:["Madagascar"]},{code:"MKD",number:"807",digits:2,currency:"Denar",countries:["North Macedonia"]},{code:"MMK",number:"104",digits:2,currency:"Kyat",countries:["Myanmar"]},{code:"MNT",number:"496",digits:2,currency:"Tugrik",countries:["Mongolia"]},{code:"MOP",number:"446",digits:2,currency:"Pataca",countries:["Macao"]},{code:"MRU",number:"929",digits:2,currency:"Ouguiya",countries:["Mauritania"]},{code:"MUR",number:"480",digits:2,currency:"Mauritius Rupee",countries:["Mauritius"]},{code:"MVR",number:"462",digits:2,currency:"Rufiyaa",countries:["Maldives"]},{code:"MWK",number:"454",digits:2,currency:"Malawi Kwacha",countries:["Malawi"]},{code:"MXN",number:"484",digits:2,currency:"Mexican Peso",countries:["Mexico"]},{code:"MXV",number:"979",digits:2,currency:"Mexican Unidad de Inversion (UDI)",countries:["Mexico"]},{code:"MYR",number:"458",digits:2,currency:"Malaysian Ringgit",countries:["Malaysia"]},{code:"MZN",number:"943",digits:2,currency:"Mozambique Metical",countries:["Mozambique"]},{code:"NAD",number:"516",digits:2,currency:"Namibia Dollar",countries:["Namibia"]},{code:"NGN",number:"566",digits:2,currency:"Naira",countries:["Nigeria"]},{code:"NIO",number:"558",digits:2,currency:"Cordoba Oro",countries:["Nicaragua"]},{code:"NOK",number:"578",digits:2,currency:"Norwegian Krone",countries:["Bouvet Island","Norway","Svalbard and Jan Mayen"]},{code:"NPR",number:"524",digits:2,currency:"Nepalese Rupee",countries:["Nepal"]},{code:"NZD",number:"554",digits:2,currency:"New Zealand Dollar",countries:["Cook Islands (The)","New Zealand","Niue","Pitcairn","Tokelau"]},{code:"OMR",number:"512",digits:3,currency:"Rial Omani",countries:["Oman"]},{code:"PAB",number:"590",digits:2,currency:"Balboa",countries:["Panama"]},{code:"PEN",number:"604",digits:2,currency:"Sol",countries:["Peru"]},{code:"PGK",number:"598",digits:2,currency:"Kina",countries:["Papua New Guinea"]},{code:"PHP",number:"608",digits:2,currency:"Philippine Peso",countries:["Philippines (The)"]},{code:"PKR",number:"586",digits:2,currency:"Pakistan Rupee",countries:["Pakistan"]},{code:"PLN",number:"985",digits:2,currency:"Zloty",countries:["Poland"]},{code:"PYG",number:"600",digits:0,currency:"Guarani",countries:["Paraguay"]},{code:"QAR",number:"634",digits:2,currency:"Qatari Rial",countries:["Qatar"]},{code:"RON",number:"946",digits:2,currency:"Romanian Leu",countries:["Romania"]},{code:"RSD",number:"941",digits:2,currency:"Serbian Dinar",countries:["Serbia"]},{code:"RUB",number:"643",digits:2,currency:"Russian Ruble",countries:["Russian Federation (The)"]},{code:"RWF",number:"646",digits:0,currency:"Rwanda Franc",countries:["Rwanda"]},{code:"SAR",number:"682",digits:2,currency:"Saudi Riyal",countries:["Saudi Arabia"]},{code:"SBD",number:"090",digits:2,currency:"Solomon Islands Dollar",countries:["Solomon Islands"]},{code:"SCR",number:"690",digits:2,currency:"Seychelles Rupee",countries:["Seychelles"]},{code:"SDG",number:"938",digits:2,currency:"Sudanese Pound",countries:["Sudan (The)"]},{code:"SEK",number:"752",digits:2,currency:"Swedish Krona",countries:["Sweden"]},{code:"SGD",number:"702",digits:2,currency:"Singapore Dollar",countries:["Singapore"]},{code:"SHP",number:"654",digits:2,currency:"Saint Helena Pound",countries:["Saint Helena, Ascension and Tristan Da Cunha"]},{code:"SLE",number:"925",digits:2,currency:"Leone",countries:["Sierra Leone"]},{code:"SOS",number:"706",digits:2,currency:"Somali Shilling",countries:["Somalia"]},{code:"SRD",number:"968",digits:2,currency:"Surinam Dollar",countries:["Suriname"]},{code:"SSP",number:"728",digits:2,currency:"South Sudanese Pound",countries:["South Sudan"]},{code:"STN",number:"930",digits:2,currency:"Dobra",countries:["Sao Tome and Principe"]},{code:"SVC",number:"222",digits:2,currency:"El Salvador Colon",countries:["El Salvador"]},{code:"SYP",number:"760",digits:2,currency:"Syrian Pound",countries:["Syrian Arab Republic"]},{code:"SZL",number:"748",digits:2,currency:"Lilangeni",countries:["Eswatini"]},{code:"THB",number:"764",digits:2,currency:"Baht",countries:["Thailand"]},{code:"TJS",number:"972",digits:2,currency:"Somoni",countries:["Tajikistan"]},{code:"TMT",number:"934",digits:2,currency:"Turkmenistan New Manat",countries:["Turkmenistan"]},{code:"TND",number:"788",digits:3,currency:"Tunisian Dinar",countries:["Tunisia"]},{code:"TOP",number:"776",digits:2,currency:"Pa’anga",countries:["Tonga"]},{code:"TRY",number:"949",digits:2,currency:"Turkish Lira",countries:["Türki̇ye"]},{code:"TTD",number:"780",digits:2,currency:"Trinidad and Tobago Dollar",countries:["Trinidad and Tobago"]},{code:"TWD",number:"901",digits:2,currency:"New Taiwan Dollar",countries:["Taiwan (Province of China)"]},{code:"TZS",number:"834",digits:2,currency:"Tanzanian Shilling",countries:["Tanzania, United Republic Of"]},{code:"UAH",number:"980",digits:2,currency:"Hryvnia",countries:["Ukraine"]},{code:"UGX",number:"800",digits:0,currency:"Uganda Shilling",countries:["Uganda"]},{code:"USD",number:"840",digits:2,currency:"US Dollar",countries:["American Samoa","Bonaire, Sint Eustatius and Saba","British Indian Ocean Territory (The)","Ecuador","El Salvador","Guam","Haiti","Marshall Islands (The)","Micronesia (Federated States Of)","Northern Mariana Islands (The)","Palau","Panama","Puerto Rico","Timor-Leste","Turks and Caicos Islands (The)","United States Minor Outlying Islands (The)","United States of America (The)","Virgin Islands (British)","Virgin Islands (u.s.)"]},{code:"USN",number:"997",digits:2,currency:"US Dollar (Next day)",countries:["United States of America (The)"]},{code:"UYI",number:"940",digits:0,currency:"Uruguay Peso en Unidades Indexadas (UI)",countries:["Uruguay"]},{code:"UYU",number:"858",digits:2,currency:"Peso Uruguayo",countries:["Uruguay"]},{code:"UYW",number:"927",digits:4,currency:"Unidad Previsional",countries:["Uruguay"]},{code:"UZS",number:"860",digits:2,currency:"Uzbekistan Sum",countries:["Uzbekistan"]},{code:"VED",number:"926",digits:2,currency:"Bolívar Soberano",countries:["Venezuela (Bolivarian Republic Of)"]},{code:"VES",number:"928",digits:2,currency:"Bolívar Soberano",countries:["Venezuela (Bolivarian Republic Of)"]},{code:"VND",number:"704",digits:0,currency:"Dong",countries:["Viet Nam"]},{code:"VUV",number:"548",digits:0,currency:"Vatu",countries:["Vanuatu"]},{code:"WST",number:"882",digits:2,currency:"Tala",countries:["Samoa"]},{code:"XAF",number:"950",digits:0,currency:"CFA Franc BEAC",countries:["Cameroon","Central African Republic (The)","Chad","Congo (The)","Equatorial Guinea","Gabon"]},{code:"XAG",number:"961",digits:0,currency:"Silver",countries:["Zz11_silver"]},{code:"XAU",number:"959",digits:0,currency:"Gold",countries:["Zz08_gold"]},{code:"XBA",number:"955",digits:0,currency:"Bond Markets Unit European Composite Unit (EURCO)",countries:["Zz01_bond Markets Unit European_eurco"]},{code:"XBB",number:"956",digits:0,currency:"Bond Markets Unit European Monetary Unit (E.M.U.-6)",countries:["Zz02_bond Markets Unit European_emu-6"]},{code:"XBC",number:"957",digits:0,currency:"Bond Markets Unit European Unit of Account 9 (E.U.A.-9)",countries:["Zz03_bond Markets Unit European_eua-9"]},{code:"XBD",number:"958",digits:0,currency:"Bond Markets Unit European Unit of Account 17 (E.U.A.-17)",countries:["Zz04_bond Markets Unit European_eua-17"]},{code:"XCD",number:"951",digits:2,currency:"East Caribbean Dollar",countries:["Anguilla","Antigua and Barbuda","Dominica","Grenada","Montserrat","Saint Kitts and Nevis","Saint Lucia","Saint Vincent and the Grenadines"]},{code:"XDR",number:"960",digits:0,currency:"SDR (Special Drawing Right)",countries:["International Monetary Fund (Imf) "]},{code:"XOF",number:"952",digits:0,currency:"CFA Franc BCEAO",countries:["Benin","Burkina Faso","Côte D'ivoire","Guinea-Bissau","Mali","Niger (The)","Senegal","Togo"]},{code:"XPD",number:"964",digits:0,currency:"Palladium",countries:["Zz09_palladium"]},{code:"XPF",number:"953",digits:0,currency:"CFP Franc",countries:["French Polynesia","New Caledonia","Wallis and Futuna"]},{code:"XPT",number:"962",digits:0,currency:"Platinum",countries:["Zz10_platinum"]},{code:"XSU",number:"994",digits:0,currency:"Sucre",countries:['Sistema Unitario De Compensacion Regional De Pagos "Sucre"']},{code:"XTS",number:"963",digits:0,currency:"Codes specifically reserved for testing purposes",countries:["Zz06_testing_code"]},{code:"XUA",number:"965",digits:0,currency:"ADB Unit of Account",countries:["Member Countries of the African Development Bank Group"]},{code:"XXX",number:"999",digits:0,currency:"The codes assigned for transactions where no currency is involved",countries:["Zz07_no_currency"]},{code:"YER",number:"886",digits:2,currency:"Yemeni Rial",countries:["Yemen"]},{code:"ZAR",number:"710",digits:2,currency:"Rand",countries:["Lesotho","Namibia","South Africa"]},{code:"ZMW",number:"967",digits:2,currency:"Zambian Kwacha",countries:["Zambia"]},{code:"ZWG",number:"924",digits:2,currency:"Zimbabwe Gold",countries:["Zimbabwe"]}]),iy}var ay,b2;function RQ(){return b2||(b2=1,ay="2024-06-25"),ay}var w2;function OQ(){if(w2)return Xa;w2=1;var r=IQ(),e=PQ(),t=DQ(),n=RQ(),i=function(c){return c=c.toUpperCase(),r(t,function(f){return f.code===c})},a=function(c){return c=c.toLowerCase(),t.filter(function(f){return(f.countries.map(function(d){return d.toLowerCase()})||[]).indexOf(c)>-1})},s=function(c){return r(t,function(f){return f.number===String(c)})},o=function(){return t.map(function(c){return c.code})},l=function(){var c=t.map(function(f){return f.number});return c.filter(function(f){if(f)return f})},u=function(){var c=t.filter(function(f){return f.countries}).map(function(f){return f.countries});return e(Array.prototype.concat.apply([],c))};return Xa.code=i,Xa.country=a,Xa.number=s,Xa.codes=o,Xa.numbers=l,Xa.countries=u,Xa.publishDate=n,Xa.data=t,Xa}var C2=OQ();class OP{formatCurrencyForDisplay(e,t){const n={amount:t||0,currency:e,precision:this.getPrecisionForCurrency(e)};return FQ(n).toFormat(this.getSpecialFormat(e))}getPrecisionForCurrency(e){const t=e,n=C2.code(t);return n?n.digits:2}getSpecialFormat(e){const t=e;if(C2.code(t)?.code==="CLP")return"USD0,0"}}const x2=new OP;class BP{constructor(e,t,n,i){this.presentmentCurrency=void 0,this.presentmentCurrency=i,this.partnerCurrency=n,this.rateFrom=e,this.rateTo=t}code(){return this.presentmentCurrency?this.presentmentCurrency:this.partnerCurrency}conversionRequired(){return this.presentmentCurrency!==void 0&&this.code()!==this.partnerCurrency}getConvertedSubunits(e){return this.conversionRequired()?Math.ceil(this.subunits(this.units(e,this.partnerCurrency)/this.rateFrom*this.rateTo,this.code())):e}units(e,t){return e/Math.pow(10,x2.getPrecisionForCurrency(t))}subunits(e,t){return e*Math.pow(10,x2.getPrecisionForCurrency(t))}}const BQ=async(r,e)=>{const t=j3(e?.assets?.metadata||!1),n={ids:r};console.log("[getWorkflowsInternal] Requesting workflows.",{url:`${ss.getServerUrl()}/graphql`,variables:JSON.stringify(n)}),console.log(`[getWorkflowsInternal] Query:
|
|
3056
|
-
${N2(t)}`);const i=await ze.getShadowGraphqlClient().query({query:t,errorPolicy:"all",variables:n,context:{logRequestHeaders:!0}});if(i.error)throw console.log("[getWorkflowsInternal] Response errored."),i.error;if(i.errors)throw i.errors.forEach(s=>console.error(s)),new Error("Unable to read workflows. Consult GraphQL errors.");if(!i.data.workflows||i.data.workflows.length!==r.length)throw new Error(`Unable to read workflows: ${i.errors??"Length mismatch in response"}`);const a=mo(i.data.workflows);return a.forEach(s=>{s.finalizeStepConfig||(s.finalizeStepConfig={}),s.finalizeStepConfig.termsMarkdown=s.finalizeStepConfig.termsMarkdown||s.partner.termsMarkdown}),a},MQ=async(r,e)=>{const n=(await e).find(i=>i.id===r);if(!n)throw new Error(`Workflow not found: ${r}`);return n},Zb=async(r,e)=>{const t=r.map(o=>mf.get({id:o,options:e})),n=r.filter((o,l)=>t[l]===void 0);if(n.length===0)return Promise.all(t);const i=BQ(n,e),a=n.map(o=>mf.set({id:o,options:e},MQ(o,i))),s=t.filter(o=>o!==void 0);return await Promise.all(s.concat(a))},MP=async(r,e)=>(await Zb([r],e))[0],_P=async r=>{const e=await ze.getShadowGraphqlClient().query({query:vT,variables:{ids:r},errorPolicy:"all",fetchPolicy:"no-cache"});return e.errors&&console.error(e.errors),e.data.integrationProducts||[]};class _Q{constructor(e){this.activeIntegration=void 0,this.updateTransactionState=async t=>{try{return ze.getShadowGraphqlClient().mutate({...t,mutation:I3})}catch(n){throw console.error(n),new lo("Critical - Unable to synchronize workflow state with server.")}},this.options=e,this.options.applicationKey&&Qk(this.options.applicationKey),console.debug("------------------------"),console.debug("Spiff Commerce Core SDK"),console.debug("Version: 44.5.2"),console.debug(`Application Key Provided: ${!!this.options.applicationKey}`),console.debug("------------------------")}configure(e){ss.setHubUrl(e.hubUrl),ss.setServerUrl(e.serverUrl),ss.setServicesApiUrl(e.servicesApiUrl),this.marketplaceThemeInstallId=e.marketplaceThemeInstallId,this.marketplaceThemeInstallConfigurationId=e.marketplaceThemeInstallConfigurationId,this.userPoolClientId=e.userPoolClientId,this.userPoolRegion=e.userPoolRegion,this.spiffRegion=e.spiffRegion,e.bearerAuthenticationToken&&Xk(e.bearerAuthenticationToken),this.options.applicationKey&&this.getIntegration(),this.spiffRegion&&this.userPoolRegion&&this.userPoolClientId&&Id.init(this.spiffRegion,this.userPoolRegion,this.userPoolClientId)}getVersion(){return"44.5.2"}getAssetManager(){return Ln}async getBetaEnabled(){return this.options.enableBetaFeatures?!0:(await this.getIntegration()).partner.beta===!0}getFlowService(){if(!Y4())throw new Error("Application key required to use Flow Service.");return new RI}async getCurrencyContext(e){const n=(await this.getIntegration()).partner.currencyCode,a=await ze.getShadowGraphqlClient().query({query:X3,errorPolicy:"all",fetchPolicy:"cache-first",variables:{from:n,to:e}}),{rateFrom:s,rateTo:o}=a.data.currencyConversion;return new BP(s,o,n,e)}async getIntegration(){if(this.activeIntegration)return this.activeIntegration;if(!this.options.applicationKey)throw new Error("Cannot get current Integration without specifying an Application Key.");return this.activeIntegration=NP(this.options.applicationKey),this.activeIntegration}async canUseAddon(e){try{return(await this.getIntegration()).partner.activeAddons?.includes(e)??!1}catch(t){return console.error(t),!1}}clearCustomer(){this.customer=void 0}clearCustomerForTransaction(e){const t=wr.getMap("transactionCustomerIds");t?.has(e)&&(t.delete(e),wr.setMap("transactionCustomerIds",t))}async customerHasBundleTemplates(e){const i=(await ze.getShadowGraphqlClient().query({query:Ov,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e}})).data.customer;return i.id?i.hasBundleTemplates??!1:!1}getStakeholderTypeForTransaction(e){const t=this.customer?.stakeholders?.find(n=>n.transaction?.id===e);if(t)return t.type}async getOrCreateCustomer(e){this.customer=void 0;const t=ze.getShadowGraphqlClient(),i=(await t.query({query:Ov,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e}})).data.customer;if(!i.id){const o=(await t.mutate({mutation:gV,errorPolicy:"all",fetchPolicy:"no-cache",variables:{details:{emailAddress:e}}})).data?.customerCreate;if(!o)throw new Error("Unable to create customer.");return this.storeCustomer(o),this.customer=o,{customer:o,isAuthenticated:!1}}this.storeCustomer(i);const a=await this.reloadLoggedInCustomer();return{customer:this.customer||i,isAuthenticated:a}}getCustomer(){return this.customer}async reloadLoggedInCustomer(){const e=localStorage.getItem("last-refreshed-cognito-tokens"),t=localStorage.getItem("cognito-tokens"),n=localStorage.getItem("cognito-email");if(!e||!t||!n)return!1;const i=JSON.parse(t),a=new Date().getTime()/1e3;if(!i.ExpiresIn||i.ExpiresIn<a-parseInt(e)){const u=await Id.refreshTokens();if(u?.AuthenticationResult)localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),i.AccessToken=u.AuthenticationResult.AccessToken,localStorage.setItem("cognito-tokens",JSON.stringify(i));else return this.logOut(),console.error("Failed to refresh tokens."),!1}const s=localStorage.getItem("customer-login-token");s&&p0(s);const l=(await ze.getShadowGraphqlClient().query({query:Ov,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:n}})).data.customer;return l.id?(this.customer=l,!0):(console.error("Failed to get customer."),!1)}async generateVerificationCode(e){await ze.getShadowGraphqlClient().mutate({mutation:mV,variables:{emailAddress:e}}),await Id.generateCode(e)}async verifyCode(e,t){const n=(await this.getIntegration()).partner.id||"",i=await Id.verifyCode(e,t,n);if(i?.AuthenticationResult){localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),localStorage.setItem("cognito-tokens",JSON.stringify(i.AuthenticationResult)),localStorage.setItem("cognito-email",e);const s=(await ze.getShadowGraphqlClient().mutate({mutation:vV,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e,verificationCode:t}})).data?.customerVerifyCode;if(!s?.id)throw new Error("Failed to get customer.");return this.customer=s,s.loginToken&&(localStorage.setItem("customer-login-token",s.loginToken),p0(s.loginToken)),!0}else throw new Error}async logOut(){localStorage.removeItem("last-refreshed-cognito-tokens"),localStorage.removeItem("cognito-tokens"),localStorage.removeItem("cognito-email"),localStorage.removeItem("customer-login-token"),p0(""),this.clearCustomer()}async loggedInBearerToken(){const e=localStorage.getItem("last-refreshed-cognito-tokens"),t=localStorage.getItem("cognito-tokens");if(!e||!t)throw new Error("No token data in storage.");const n=JSON.parse(t),i=new Date().getTime()/1e3,a=!n?.AccessToken||vg(n.AccessToken);if(!n.ExpiresIn||n.ExpiresIn<i-parseInt(e)||a){const s=await Id.refreshTokens();if(s?.AuthenticationResult)localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),n.AccessToken=s.AuthenticationResult.AccessToken,localStorage.setItem("cognito-tokens",JSON.stringify(n));else throw this.logOut(),new Error("Failed to refresh tokens.")}if(!n.AccessToken)throw new Error("No bearer token in storage.");return n.AccessToken}async getCustomerMetafields(){if(!this.customer?.id)throw new Error("Customer must be logged in before calling this function.");return(await ze.getShadowGraphqlClient().query({query:yV,variables:{id:this.customer.id}})).data.metafields}async getNewBundle(e,t,n,i){const s=(await ze.getShadowGraphqlClient().mutate({mutation:ZU(n?.graphql?.productCollection?.eagerFetchProducts||!1),variables:{collectionId:e,initialMetadata:t?Object.entries(t).map((c,f)=>({key:c[0],value:c[1]})):void 0,marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId,activationId:i,test:n?.test},fetchPolicy:"no-cache"})).data?.bundleCreate;if(!s?.id)throw new Error("Unable to create bundle");const o=wr.getMap("bundlePartnerIds")||new Map;o.set(s.id,s.partner.id),wr.setMap("bundlePartnerIds",o);const l=wr.getMap("bundleOwnerIds")||new Map;l.set(s.id,s.bundleOwnerId),wr.setMap("bundleOwnerIds",l);const u=new PE(this,s,void 0,void 0,s.bundleOwnerId,{eagerFetchProducts:n?.graphql?.productCollection?.eagerFetchProducts});return await u.getInitializationPromise(),u}async getExistingBundle(e,t,n,i,a){const o=wr.getMap("bundleOwnerIds")?.get(e),l={};try{const g=await this.loggedInBearerToken();l.Authorization=`Bearer ${g}`}catch{const y=Object.entries(localStorage).find(([C,S])=>C.startsWith("CognitoIdentityServiceProvider")&&C.endsWith("idToken"))?.[0]||"",A=localStorage.getItem(y);A&&!vg(A)&&(l.Authorization=`Bearer ${A}`)}const u={bundleOwnerId:o,...l,...i?.graphql?.additionalHeaders},c=await ze.getShadowGraphqlClient().query({query:YU(i?.graphql?.productCollection?.eagerFetchProducts||!1),variables:{id:e},fetchPolicy:"no-cache",context:{headers:u}});if(!c.data?.bundles||c.data?.bundles.length===0||!c.data?.bundles[0])throw new Error(`Unable to find bundle: ${e}`);const f=c.data?.bundles[0],d=wr.getMap("bundlePartnerIds")||new Map;d.set(f.id,f.partner.id),wr.setMap("bundlePartnerIds",d);const h=new PE(this,f,t,n,o,{additionalHeaders:i?.graphql?.additionalHeaders,eagerFetchProducts:i?.graphql?.productCollection?.eagerFetchProducts,existingGlobalPropertyState:c.data.globalPropertyState,readonly:i?.readonly},a);return await h.getInitializationPromise(),h}async duplicateBundle(e,t,n,i){const s={...await VP(e),...i?.graphql?.additionalHeaders},l=(await ze.getShadowGraphqlClient().mutate({mutation:e9(),variables:{id:e,template:t,marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId,duplicateTransactions:n,test:i?.test},context:{headers:s},fetchPolicy:"no-cache"})).data?.bundleDuplicate;if(!l?.id)throw new Error("Unable to duplicate bundle");const u=wr.getMap("bundlePartnerIds")||new Map;u.set(l.id,l.partner.id),wr.setMap("bundlePartnerIds",u);const c=wr.getMap("bundleOwnerIds")||new Map;return c.set(l.id,l.bundleOwnerId),wr.setMap("bundleOwnerIds",c),async()=>await this.getExistingBundle(l.id,void 0,void 0,{graphql:{productCollection:{eagerFetchProducts:i?.graphql?.productCollection?.eagerFetchProducts||!1}}})}async getBundlesForCustomer(e){if(!this.customer?.id)throw new Error("Customer not authenticated.");const{includeMetadata:t,...n}=e;return(await ze.getShadowGraphqlClient().query({query:d9(t??!1),variables:{...n,id:this.customer.id},fetchPolicy:"no-cache"})).data.customerBundlesFeed}async getBundleStakeholders(){if(!this.customer)throw new Error("Customer not authenticated.");const e=await ze.getShadowGraphqlClient().query({query:XU,variables:{id:this.customer.id},fetchPolicy:"no-cache"});if(!e.data?.customers||e.data.customers.length===0)throw new Error("Unable to find customer.");const n=e.data.customers[0].bundleStakeholders||[],i=wr.getMap("bundlePartnerIds")||new Map;return n.forEach(a=>{a.bundle?.id&&a.bundle.partner?.id&&i.set(a.bundle.id,a.bundle.partner.id)}),wr.setMap("bundlePartnerIds",i),n}async getWorkflowExperience(e,t){if(!e)throw new Error("getWorkflowExperience has been called without an options object! This is not supported.");const n=await this.getWorkflowExperiences([e],e.graphql),i=n[0],a=i.getWorkflow();return t&&!a&&console.error("No workflow instantiated when trying to create preview service."),t&&a&&await i.getWorkflowManager().injectIntoPreviewService(t(a)),n[0]}async getWorkflowExperiences(e,t,n,i){if(e.length===0)throw new lo("No options provided!");const a=e.map((q,Y)=>({option:q,index:Y})),s=a.filter(q=>q.option.type==="transaction"),o=a.filter(q=>q.option.type==="integration"||q.option.type==="external"||q.option.type==="blank"),l=50,u=fA(s,l),c=fA(o,l);let f=0;const d=ze.getShadowGraphqlClient(),h=async q=>{if(q.length===0)return[];const Y=q.map(oe=>oe.option.transactionId),J=await d.query({query:F3,variables:{ids:Y},errorPolicy:"all",fetchPolicy:"no-cache"}),ae=J.data.transactions;if(f=f+ae.length,i&&i(f,s.length),ae.length!==q.length){const oe=J.errors?.[0]?.message||"Unknown error";throw new lo(`Not all transactions were found: ${oe}`)}return!this.activeIntegration&&ae[0].integrationProduct?.integration&&(this.activeIntegration=Promise.resolve(ae[0].integrationProduct.integration)),ae.map((oe,he)=>({transaction:oe,workflowId:oe.workflowId,readOnly:q.find(ye=>ye.option.transactionId===oe.id)?.option.readOnly??!1,index:q[he].index}))},g=async q=>{if(q.length===0)return[];const Y=await d.mutate({mutation:T3,variables:{inputs:q.map(ae=>({integrationProductId:ae.option.type==="integration"?ae.option.integrationProductId:void 0,externalIntegrationId:ae.option.type==="external"?ae.option.externalIntegrationId:void 0,externalProductId:ae.option.type==="external"?ae.option.externalProductId:void 0,workflowId:ae.option.workflowId,designName:ae.option.designName,claim:!0,quantity:ae.option.quantity,recipient:ae.option.recipient,parentTransactionId:ae.option.parentTransactionId})),marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId},errorPolicy:"all",fetchPolicy:"no-cache",context:this.getCreateTransactionContext(q,t)}),J=Y.data?.transactionCreateMany;if(!J||J.length===0){const ae=Y.errors?.[0]?.message||"Unknown error";throw new lo(`Failed to create transactions: ${ae}`)}return f=f+J.length,i&&i(f,s.length),J.map((ae,oe)=>({transaction:ae,workflowId:ae.workflowId,readOnly:!1,index:q[oe].index}))},v=(await Promise.all([...u.map(h),...c.map(g)])).flat();let y=[...new Set(v.map(q=>q.transaction.integrationProductId))].filter(q=>!!q);y=y.filter(q=>!!q);let A=[...new Set(v.map(q=>q.workflowId))].filter(q=>!!q);A=A.filter(q=>!!q);const[C,S]=await Promise.all([(async()=>y.length>0?await _P(y):[])(),(async()=>A.length>0?await Zb(A,t):[])()]),F=new Map(C.map(q=>[q.id,q])),E=new Map(S.map(q=>[q.id,q])),R=v.map(async q=>{const{transaction:Y,workflowId:J,readOnly:ae,index:oe}=q,he=J?E.get(J):void 0,ye=e[oe];if(Y.integrationProductId){const re=F.get(Y.integrationProductId);Y.integrationProduct=re,Y.product=re?.product,Y.integrationProduct||console.error("failed to find transaction's product")}const Ue=wr.getMap("transactionOwnerIds")||new Map;!Ue.get(Y.id)&&Y.transactionOwnerId&&(Ue.set(Y.id,Y.transactionOwnerId),wr.setMap("transactionOwnerIds",Ue));const Re=Ue.get(Y.id)||void 0,Oe=new AV({onMutate:()=>({context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}}),onQuery:()=>({context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}})}),ee={workflow:he,transaction:Y,singleVariantsRenderable:ye?.workflowConfiguration?.singleVariantsRenderable,stateMutationFunc:ae?async()=>{throw new nn("State mutation is forbidden in read only mode!")}:async re=>this.updateTransactionState({...re,context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}}),graphQlClient:()=>Oe,readOnly:ae,isReloadedTransaction:ye.type==="transaction"};if(ye.type==="transaction"&&Y.workflowState){const re=JSON.parse(Y.workflowState);await sA(re),ee.reloadedState=re}else if(!ae&&ye.workflowState){const re=JSON.parse(ye.workflowState);await sA(re),ee.reloadedState=re}return ee.delayWorkflowStateSync=!0,{experienceOptions:ee,index:oe,options:ye}}),j=(await Promise.all(R)).sort((q,Y)=>q.index-Y.index);let G=[],ie=[];for(const q of j){const{experienceOptions:Y,options:J}=q,ae=new kI(this,Y);await ae.getWorkflowManager().getInitializationPromise(),n&&n(),J.type!=="transaction"&&this.customer&&ie.push(ae),G=[...G,ae],ae.getWorkflowManager().setWorkflowStateSyncEnabled(!0)}if(ie.length>0){const q=this.customer.emailAddress,Y=ie.map(oe=>oe.getTransaction().id),ae=(await d.mutate({mutation:H9,variables:{ids:Y,details:{emailAddress:q},type:"Owner"},errorPolicy:"all"})).data?.transactionsAddStakeholder;if(ae&&ae?.length>0){const oe=ae[0].stakeholders?.find(he=>he.customer?.emailAddress===q);if(oe?.customer)for(const he of ie)he.assignCustomerInternal(oe.customer)}}return G}getCreateTransactionContext(e,t){const n=e.find(s=>s.option.parentTransactionId)?.option.parentTransactionId;if(!n&&!t?.bundleOwnerId)return;const i=wr.getMap("transactionOwnerIds")||new Map,a=n?i.get(n):void 0;return{...a?{transactionOwnerId:a}:{},...t?.bundleOwnerId?{bundleOwnerId:t.bundleOwnerId}:{}}}storeCustomer(e){const t=wr.getMap("partnerCustomerIds")||new Map;t.set(e.partner.id,e.id),wr.setMap("partnerCustomerIds",t)}async getIntegrationProductById(e,t){const a=(await ze.getShadowGraphqlClient().query({query:_3(t),variables:{ids:[e]},fetchPolicy:"no-cache",errorPolicy:"all"})).data?.integrationProducts;if(!a||a.length===0||!a[0]?.id)throw new Error("Integration product not found.");return new gA(a[0])}async getIntegrationProductFromExternalIds(e,t,n){const s=(await ze.getShadowGraphqlClient().query({query:N3(n),variables:{externalProductId:t,externalIntegrationId:e},fetchPolicy:"no-cache",errorPolicy:"all"})).data?.integrationProductFromExternalIds;if(!s?.id)throw new Error("Integration product not found.");return new gA(s)}async getIntegrationProduct(e){return e.type==="integration"?this.getIntegrationProductById(e.integrationProductId):this.getIntegrationProductFromExternalIds(e.externalIntegrationId,e.externalProductId)}async getShareActionsForTransaction(e){const n=(wr.getMap("transactionOwnerIds")||new Map).get(e)||void 0,i=await ze.getShadowGraphqlClient().query({query:B3,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:e},context:{transactionOwnerId:n}});if(!i.data.transactions||i.data.transactions.length!==1)throw new Error(`Failed to fetch share actions for transaction: ${e}`);return i.data.transactions[0].transactionShareActions}async placeOrder(e){const t=await ze.getShadowGraphqlClient().mutate({mutation:Y3,variables:{orderItems:e}});if(t.errors)throw new Error(t.errors[0].message);if(!t.data)throw new Error("Failed to create order: No order data in response.");return{id:t.data.orderCreate.id,internalId:t.data.orderCreate.internalId}}}const NP=async(r,e)=>(await ze.getShadowGraphqlClient().query({query:q3,errorPolicy:"all",fetchPolicy:"no-cache",context:{headers:{"x-application-key":r},skipIntegrationCheck:!0},variables:{themeConfigurationId:e}})).data.currentIntegration,NQ=async r=>{const t=await ze.getShadowGraphqlClient().query({query:O3,errorPolicy:"all",fetchPolicy:"network-only",variables:{id:r}});if(t.data.transactions.length!==0)return t.data.transactions[0]},LQ=async(r,e)=>(await ze.getShadowGraphqlClient().query({query:G3,errorPolicy:"all",variables:{themeConfigurationId:r,themeInstallId:e}})).data?.marketplaceThemeInstallConfiguration,UQ=async r=>(await ze.getShadowGraphqlClient().query({query:Q3,errorPolicy:"all",variables:{id:r}})).data?.bundles?.[0]?.marketplaceThemeInstallConfiguration,VQ=async r=>(await ze.getShadowGraphqlClient().query({query:W3,errorPolicy:"all",variables:{id:r}})).data?.transactions?.[0]?.marketplaceThemeInstallConfiguration,LP=async(r,e)=>(await ze.getShadowGraphqlClient().query({query:nM(!!e),errorPolicy:"all",variables:{id:r,productIds:e}})).data?.activation,zQ=async r=>(await LP(r))?.marketplaceThemeInstallConfiguration;async function UP(){const r={};try{const e=await this.loggedInBearerToken();r.Authorization=`Bearer ${e}`}catch{const n=Object.entries(localStorage).find(([a,s])=>a.startsWith("CognitoIdentityServiceProvider")&&a.endsWith("idToken"))?.[0]||"",i=localStorage.getItem(n);i&&!vg(i)&&(r.Authorization=`Bearer ${i}`)}return r}async function VP(r){const t=wr.getMap("bundleOwnerIds")?.get(r),n=await UP();return{bundleOwnerId:t,...n}}async function $Q(r){const t=wr.getMap("transactionOwnerIds")?.get(r),n=await UP();return{transactionOwnerId:t,...n}}const HQ=async r=>{const e=await VP(r),t=await ze.getShadowGraphqlClient().mutate({mutation:b9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:r},context:{headers:e}});if(t.data?.bundleDelete!==r)throw new Error(`Failed to delete bundle: ${t.errors}`)},jQ=async r=>{const e=await $Q(r),t=await ze.getShadowGraphqlClient().mutate({mutation:w9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{ids:[r]},context:{headers:e}});if(!t.data?.transactions||t.data.transactions.length!==1||t.data.transactions[0].id!==r)throw new Error(`Failed to find transaction to read bundle id: ${JSON.stringify(t.errors)}`);return t.data.transactions[0].bundle?.id};function zP(r,e,t,n){const i=t.width*r.zoom,a=t.height*r.zoom;if(n){const s=Math.max(e.width/t.width,e.height/t.height),o=Math.max(s,r.zoom),l=t.width*o,u=t.height*o;return{...r,x:Dp(r.x,e.width-l,0),y:Dp(r.y,e.height-u,0),zoom:o}}return{...r,x:Dp(r.x,-i,e.width),y:Dp(r.y,-a,e.height)}}function Dp(r,e,t){return Math.min(Math.max(r,e),t)}class $P{constructor(e,t){this.minZoomScale=[.03],this.maxZoomScale=[20],this._debouncedUpdateFrameOffsets=EI(this.updateFrameOffsets,200),this.targetElements=[],this.onFrameDataChangeListeners=[],this.onZoomChangeListeners=[],this.onRotationChangeListeners=[],this.forceImageCover=e,this.initialZoom=t,this.thresholdSettings={useThreshold:!1,invertThreshold:!1,threshold:128,thresholdSaturation:.5}}connectWorkflowManager(e,t){t&&e.addStepSpecificStorageCallback(async n=>{if(n){const i=n;if(i.currentFrameSources){let a=!1;for(let s=0;s<i.currentFrameSources.length;s++){const o=i.currentFrameSources[s],l=await Xf(o),u=this.frameData?this.frameData[s]:void 0;vf(l,u)||(this.frameData||(this.frameData=new Array(i.currentFrameSources.length)),this.frameData[s]=l,a=!0)}a&&(this.onFrameDataChangeListeners.forEach(s=>s(this.frameData)),this.frameData&&this.imageData&&(this.recalculateOffsets(this.imageData),this.updateOffsets(this.offsets),this.recalculateZoomLimits(this.imageData,this.frameData)))}}},t),this.workflowManager=e,this.stepName=t}setTargetElements(e){this.targetElements=e}getFrameData(){return this.frameData}setFrameData(e){if(!e){this.frameData=void 0;return}e.forEach((t,n)=>{const i=_u.get(t);i&&(this.frameData||(this.frameData=new Array(e.length)),this.frameData[n]=i)})}getImageData(){return this.imageData}getImageSrc(){if(this.imageData){if(this.imageData.svg){const e=zg(this.imageData.svg,this.imageData.colors||{},!1);return Ug(e)}return this.imageData.src}}getOffsets(){return this.offsets}setOffsets(e){this.offsets=e}setZoom(e,t,n,i){if(this.imageData&&this.offsets&&this.frameData){(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length));const a=this.frameData.map((s,o)=>{const l=(t[o]-this.offsets[o].x)/this.offsets[o].zoom,u=(n[o]-this.offsets[o].y)/this.offsets[o].zoom,c=t[o]-l*e[o],f=n[o]-u*e[o];return{x:c,y:f,zoom:this.imageData.width*e[o]/this.imageData.width,rotation:this.offsets[o].rotation}});this.updateOffsets(a,i),this.onZoomChangeListeners.forEach(s=>s(e))}}setRotation(e,t){if(this.imageData&&this.offsets&&this.frameData){(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length));const n=this.frameData.map((i,a)=>({...this.offsets[a],rotation:e[a]}));this.updateOffsets(n,t),this.onRotationChangeListeners.forEach(i=>i(e))}}setPatternData(e,t=!0){this.imageData=e,e&&this.frameData&&((t||!this.offsets)&&this.recalculateOffsets(e,t),this.updateOffsets(this.offsets,void 0,!0)),this.imageData&&this.frameData&&this.recalculateZoomLimits(this.imageData,this.frameData)}updateOffsets(e,t,n){const i=this.imageData;if(!i||!this.frameData)return;if(this.frameData.length!==e.length)throw new nn("Frame data and offsets are not the same length. This is a bug. Please report it.");if(!this.offsets.some((s,o)=>!(e[o].x===s.x&&e[o].y===s.y&&e[o].zoom===s.zoom&&e[o].rotation===s.rotation))&&!n){t&&t();return}(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length)),this.frameData.forEach((s,o)=>{this.offsets[o]=zP(e[o],s,this.imageData,this.forceImageCover)}),this._debouncedUpdateFrameOffsets(this.offsets,i,this.frameData,this.thresholdSettings,t)}getThresholdSettings(){return this.thresholdSettings}setThresholdSettings(e){this.thresholdSettings=e,this.imageData&&this.frameData&&this._debouncedUpdateFrameOffsets(this.offsets,this.imageData,this.frameData,e)}onFrameDataChanged(e){e(this.frameData),this.onFrameDataChangeListeners.push(e)}onZoom(e){this.onZoomChangeListeners.push(e)}onRotation(e){this.onRotationChangeListeners.push(e)}updateFrameOffsets(e,t,n,i,a){if(!n||n.length===0||n.some(l=>!l))throw new nn("Frame data not set. This is a bug");if(!this.workflowManager)throw new nn("No workflow manager set, cannot update offsets.");const s=this.workflowManager.getRegionElements(this.stepName||""),o=this.workflowManager.getCommandDispatcher();this.targetElements.forEach((l,u)=>{let c=s.find(f=>f.id===l)?.regionIndex??u;c>=e.length&&(c=u);try{o(new On([new AL(l,t,e[c]),new bL(l,i.useThreshold,i.invertThreshold,i.threshold,i.thresholdSaturation)]))}catch{}}),this.stepName&&this.workflowManager.updateStorage(this.stepName,{frameOffsetsList:e}),a&&a()}recalculateZoomLimits(e,t){(this.minZoomScale.length!==t.length||this.maxZoomScale.length!==t.length)&&(this.minZoomScale=new Array(t.length),this.maxZoomScale=new Array(t.length)),t.forEach((n,i)=>{const a=Math.max(n.width/e.width,n.height/e.height);this.forceImageCover?(this.minZoomScale[i]=a,this.maxZoomScale[i]=a*2.5):(this.minZoomScale[i]=a/10,this.maxZoomScale[i]=a*2.5)})}recalculateOffsets(e,t=!0){this.frameData&&((!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length)),this.frameData.forEach((n,i)=>{const a=t?0:this.offsets[i]?.rotation||0;this.offsets[i]={...C1(e,n,this.initialZoom&&!this.forceImageCover?{scale:this.initialZoom}:void 0,this.forceImageCover),rotation:a}}),this._debouncedUpdateFrameOffsets(this.offsets,e,this.frameData,this.thresholdSettings))}}class GQ{traversableScenes(){throw new Error("Method not implemented.")}updateRecipient(e,t,n,i,a,s,o,l,u,c,f,d,h,g,v,y,A){throw new Error("Method not implemented.")}approveTransaction(e){throw new Error("Method not implemented.")}rejectTransaction(e){throw new Error("Method not implemented.")}getClient(){return this.client??{}}getWorkflowExperience(){return{}}setClient(e){this.client=e}getInitializationPromise(){return Promise.resolve()}isInitialized(){return!0}getInformationResults(){return[]}async reset(){}updateStateWithServer(e){}async outstandingRequestsPromise(){}async updateStateWithServerImmediate(e){}addPoller(e){}addConfirmCallback(e){}addEditedCallback(e){}addElementsCallback(e){}addInformationResultCallback(e){}addInitCallback(e){}addMakingAdjustmentsCallback(e){}addMandatoryCallback(e){}addMetadataCallback(e){}addSelectionCallback(e){}addStepSpecificStorageCallback(e,t){}addStorageCallback(e){}getCommandDispatcher(){return e=>{}}getLayouts(){return[]}getLayoutPreviewService(){return{getAll:()=>new Map}}getPreviewService(){}getModelContainer(){}getRegionElements(e){return[]}getSerializedStep(e,t){}getStepSpecificServices(e){}getTransaction(){return{id:""}}getTransactionCustomer(){}setTransactionCustomer(){}setTransactionCustomerDetails(){}getInitialOptionIds(){return new Promise(()=>new Set)}getWorkflow(){return{id:"",name:"",panels:[],steps:[],showModelOnFinishStep:!1,allowProofDownload:!1,introduction:"",stepGroups:[]}}markStepsAsInitialised(e){}markUpdateCompleted(e){}markUpdatePending(){return"123"}getWorkflowSelections(){return{}}getStepSelections(){return{}}setCurrentAdjustingStepId(e){}setEditedStatus(e,t){}setInformationResults(e){}setMandatoryFulfilled(e,t){}async setSelectionsAndElements(e,t,n){}toggleDesignConfirmed(){}updateMetadata(e,t){}async updateStorage(e,t){}injectIntoPreviewService(e){return Promise.resolve()}ejectFromPreviewService(){}setWorkflowStateSyncEnabled(e){}async updateTransactionShareActions(){}addValidationCallback(e){}setStepError(e,t,n){}getStepErrors(e){}getValidationErrors(){return{steps:new Map}}async updateTransactionStakeholders(){}getStepTags(e){return[]}}var HP=(r=>(r.SelectFrame="SelectFrame",r.SelectImage="SelectImage",r.Position="Position",r))(HP||{}),jP=(r=>(r.Original="original",r.BackgroundRemoved="backgroundRemoved",r.Optimized="optimized",r))(jP||{});class GP extends Ui{constructor(e,t,n){super(e,t,n);const i=t.data;this.frameService=new $P(i.forceImageCover,i.initialZoomLevel),this.frameService.connectWorkflowManager(e,t.stepName)}selectVariant(e){const t=this.manager.getRegionElements(this.step.stepName);return so.selectVariant(this.step,e.getResource(),t,this.manager,n=>this.setUpdateState(n))}onFrameDataChanged(e){this.frameService&&this.frameService.onFrameDataChanged(t=>{t&&e(t)})}async selectImage(e,t=!0,n=!0){await so.selectImage(this.step,e,this.manager,n),t&&this.manager.updateStorage(this.step.stepName,{framePatternData:{originalAssetKey:e.key,backgroundRemovedAssetKey:void 0,vectorizedAssetKey:void 0,enhancedAssetKey:void 0,useOriginalAsset:void 0}})}async canUseAdvancedImageManipulation(){return this.manager.getClient().canUseAddon(Bg.AdvancedImageManipulation)}async canRemoveBackground(){return await this.canUseAdvancedImageManipulation()&&this.hasOriginalImageSelection()&&!!this.frameService?.getImageData()?.src&&!this.frameService?.getImageData()?.svg}async removeBackgroundFromImageSelection(e=!0){if(!await this.canUseAdvancedImageManipulation())throw new Error("The current Integration does not have access to the Background Remover. Please call canUseAdvancedImageManipulation to ensure you disable this feature when appropriate.");const t=await this.getOriginalImageSelection();if(!t)throw new Error("You must supply an image selection before attempting to remove the background.");const n=await Ln.removeBackgroundFromAsset(t);e&&await so.selectImage(this.step,n,this.manager,!1);const i=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{...i,backgroundRemovedAssetKey:n.key,useOriginalAsset:!e}}),n}async vectorize(e,t=void 0){const n=e??await this.getOriginalImageSelection();if(!n)throw new Error("You must supply an image selection before attempting to vectorize the image.");const i=await Ln.vectorizeAsset(n,t);await this.selectImage(i,!1);const a=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{...a,vectorizedAssetKey:i.key,useOriginalAsset:!1}}),i}async enhanceWithAI(e,t){const n=e??await this.getOriginalImageSelection();if(!n)throw new Error("You must supply an image selection before attempting to enhance the image with AI.");const i=await Ln.enhanceWithAI(n,t);await this.selectImage(i,!1);const a=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{originalAssetKey:a.originalAssetKey,backgroundRemovedAssetKey:a.backgroundRemovedAssetKey,vectorizedAssetKey:a.vectorizedAssetKey,enhancedAssetKey:i.key,useOriginalAsset:!1}}),i}async getBackgroundRemovedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.backgroundRemovedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}async getVectorizedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.vectorizedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}async getEnhancedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.enhancedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}hasOriginalImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.originalAssetKey}hasBackgroundRemovedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.backgroundRemovedAssetKey}hasVectorizedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.vectorizedAssetKey}hasEnhancedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.enhancedAssetKey}async changeColors(e){await so.changeColors(this.step,this.manager,e)}getImageData(){if(this.frameService)return this.frameService.getImageData()}async getColorOption(){return await ct.ensureFullOption(this.step.data.colorOption)}getAvailableColors(){return this.step.data.colorPickerEnabled?so.availableColors(this.step,this.manager):Promise.resolve([])}isColorPickerEnabled(){return this.step.data.colorPickerEnabled??!1}async getOriginalImageColors(){const e=this.getImageData();return e?.svg?(await Pa(e.svg)).colors:void 0}async mergeColors(e,t,n){const i=this.frameService.getImageData();if(!i?.svg||!i.colors)throw new Error("Cannot merge colors on non-SVG image or image without color information");const{svg:a,colors:s}=dT(i.svg,i.colors,e,t,n);this.frameService.setPatternData({...i,svg:a,colors:s},!1),this.manager.updateStorage(this.step.stepName,{colors:s})}async unmergeColors(e,t,n,i){const a=this.frameService.getImageData();if(!a?.svg||!a.colors)throw new Error("Cannot unmerge colors on non-SVG image or image without color information");this.frameService.setPatternData({...a,svg:i,colors:n},!1),this.manager.updateStorage(this.step.stepName,{colors:n})}getShouldVectorize(){return this.step.data.shouldVectorize??!1}getVectorizeMaxColors(){return this.step.data.vectorizeMaxColors}getMinimumPixelThresholdForOptimization(){return this.step.data.vectorizationMinimumPixelThreshold}getMaxAllowedColors(){return this.step.data.maxColors}getUniqueColorCount(){return so.getUniqueColorCount(this.step,this.manager)}getCurrentFrameStep(e,t,n,i){return i&&i.length>1&&e===void 0?"SelectFrame":t||n||this.getImageData()?"Position":"SelectImage"}getFrameService(){return this.frameService}hasOverlayImageKey(){return this.step.data.overlayImageKey}hasOverlayImageUrl(){return this.step.data.overlayImageUrl}getWhitelistedExtensions(){return[...this.step.data.whitelistedExtensions,...this.step.data.whitelistedExtensions.includes(".jpg")?[".jpeg"]:[]]}async getOriginalImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.originalAssetKey;if(e)return Ln.getLocalOrFromServer(e)}getCurrentImageState(){const e=this.getFrameStepStorage()?.framePatternData;return e?e.vectorizedAssetKey&&!e.useOriginalAsset?"optimized":e.useOriginalAsset!==!1?"original":"backgroundRemoved":"original"}async setImageState(e){const t=this.getFrameStepStorage()?.framePatternData||{};let n,i;switch(e){case"original":if(n=await this.getOriginalImageSelection(),!n)throw new Error("No original image available");i=!0;break;case"backgroundRemoved":if(n=await this.getBackgroundRemovedImageSelection(),!n)throw new Error("No background-removed image available. Call removeBackgroundFromImageSelection first.");i=!1;break;case"optimized":if(n=await this.getVectorizedImageSelection(),!n)throw new Error("No optimized image available. Call vectorize first.");i=!1;break}await this.selectImage(n,!1,!0),this.manager.updateStorage(this.step.stepName,{framePatternData:{...t,useOriginalAsset:i}})}getUseOriginalImageSelection(){return this.getFrameStepStorage()?.framePatternData?.useOriginalAsset??!1}async setUseOriginalImageSelection(e){const t=this.getFrameStepStorage()?.framePatternData||{};if(t.useOriginalAsset===e)return;const n=await this.getOriginalImageSelection();if(!n)throw new Error("You must provide an image selection before calling setUseOriginalImageSelection");if(e)await this.selectImage(n,!1,!1);else{const i=await this.getBackgroundRemovedImageSelection();if(!i)throw new Error("You must call removeBackgroundFromImageSelection before attempting to apply the image.");await this.selectImage(i,!1,!1)}this.manager.updateStorage(this.step.stepName,{framePatternData:{...t,useOriginalAsset:e}})}getFrameStepStorage(){return this.manager.getStepStorage(this.step.stepName)}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}const qQ=Se`
|
|
3056
|
+
${N2(t)}`);const i=await ze.getShadowGraphqlClient().query({query:t,errorPolicy:"all",variables:n,context:{logRequestHeaders:!0}});if(i.error)throw console.log("[getWorkflowsInternal] Response errored."),i.error;if(i.errors)throw i.errors.forEach(s=>console.error(s)),new Error("Unable to read workflows. Consult GraphQL errors.");if(!i.data.workflows||i.data.workflows.length!==r.length)throw new Error(`Unable to read workflows: ${i.errors??"Length mismatch in response"}`);const a=mo(i.data.workflows);return a.forEach(s=>{s.finalizeStepConfig||(s.finalizeStepConfig={}),s.finalizeStepConfig.termsMarkdown=s.finalizeStepConfig.termsMarkdown||s.partner.termsMarkdown}),a},MQ=async(r,e)=>{const n=(await e).find(i=>i.id===r);if(!n)throw new Error(`Workflow not found: ${r}`);return n},Zb=async(r,e)=>{const t=r.map(o=>mf.get({id:o,options:e})),n=r.filter((o,l)=>t[l]===void 0);if(n.length===0)return Promise.all(t);const i=BQ(n,e),a=n.map(o=>mf.set({id:o,options:e},MQ(o,i))),s=t.filter(o=>o!==void 0);return await Promise.all(s.concat(a))},MP=async(r,e)=>(await Zb([r],e))[0],_P=async r=>{const e=await ze.getShadowGraphqlClient().query({query:vT,variables:{ids:r},errorPolicy:"all",fetchPolicy:"no-cache"});return e.errors&&console.error(e.errors),e.data.integrationProducts||[]};class _Q{constructor(e){this.activeIntegration=void 0,this.updateTransactionState=async t=>{try{return ze.getShadowGraphqlClient().mutate({...t,mutation:I3})}catch(n){throw console.error(n),new lo("Critical - Unable to synchronize workflow state with server.")}},this.options=e,this.options.applicationKey&&Qk(this.options.applicationKey),console.debug("------------------------"),console.debug("Spiff Commerce Core SDK"),console.debug("Version: 44.5.3"),console.debug(`Application Key Provided: ${!!this.options.applicationKey}`),console.debug("------------------------")}configure(e){ss.setHubUrl(e.hubUrl),ss.setServerUrl(e.serverUrl),ss.setServicesApiUrl(e.servicesApiUrl),this.marketplaceThemeInstallId=e.marketplaceThemeInstallId,this.marketplaceThemeInstallConfigurationId=e.marketplaceThemeInstallConfigurationId,this.userPoolClientId=e.userPoolClientId,this.userPoolRegion=e.userPoolRegion,this.spiffRegion=e.spiffRegion,e.bearerAuthenticationToken&&Xk(e.bearerAuthenticationToken),this.options.applicationKey&&this.getIntegration(),this.spiffRegion&&this.userPoolRegion&&this.userPoolClientId&&Id.init(this.spiffRegion,this.userPoolRegion,this.userPoolClientId)}getVersion(){return"44.5.3"}getAssetManager(){return Ln}async getBetaEnabled(){return this.options.enableBetaFeatures?!0:(await this.getIntegration()).partner.beta===!0}getFlowService(){if(!Y4())throw new Error("Application key required to use Flow Service.");return new RI}async getCurrencyContext(e){const n=(await this.getIntegration()).partner.currencyCode,a=await ze.getShadowGraphqlClient().query({query:X3,errorPolicy:"all",fetchPolicy:"cache-first",variables:{from:n,to:e}}),{rateFrom:s,rateTo:o}=a.data.currencyConversion;return new BP(s,o,n,e)}async getIntegration(){if(this.activeIntegration)return this.activeIntegration;if(!this.options.applicationKey)throw new Error("Cannot get current Integration without specifying an Application Key.");return this.activeIntegration=NP(this.options.applicationKey),this.activeIntegration}async canUseAddon(e){try{return(await this.getIntegration()).partner.activeAddons?.includes(e)??!1}catch(t){return console.error(t),!1}}clearCustomer(){this.customer=void 0}clearCustomerForTransaction(e){const t=wr.getMap("transactionCustomerIds");t?.has(e)&&(t.delete(e),wr.setMap("transactionCustomerIds",t))}async customerHasBundleTemplates(e){const i=(await ze.getShadowGraphqlClient().query({query:Ov,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e}})).data.customer;return i.id?i.hasBundleTemplates??!1:!1}getStakeholderTypeForTransaction(e){const t=this.customer?.stakeholders?.find(n=>n.transaction?.id===e);if(t)return t.type}async getOrCreateCustomer(e){this.customer=void 0;const t=ze.getShadowGraphqlClient(),i=(await t.query({query:Ov,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e}})).data.customer;if(!i.id){const o=(await t.mutate({mutation:gV,errorPolicy:"all",fetchPolicy:"no-cache",variables:{details:{emailAddress:e}}})).data?.customerCreate;if(!o)throw new Error("Unable to create customer.");return this.storeCustomer(o),this.customer=o,{customer:o,isAuthenticated:!1}}this.storeCustomer(i);const a=await this.reloadLoggedInCustomer();return{customer:this.customer||i,isAuthenticated:a}}getCustomer(){return this.customer}async reloadLoggedInCustomer(){const e=localStorage.getItem("last-refreshed-cognito-tokens"),t=localStorage.getItem("cognito-tokens"),n=localStorage.getItem("cognito-email");if(!e||!t||!n)return!1;const i=JSON.parse(t),a=new Date().getTime()/1e3;if(!i.ExpiresIn||i.ExpiresIn<a-parseInt(e)){const u=await Id.refreshTokens();if(u?.AuthenticationResult)localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),i.AccessToken=u.AuthenticationResult.AccessToken,localStorage.setItem("cognito-tokens",JSON.stringify(i));else return this.logOut(),console.error("Failed to refresh tokens."),!1}const s=localStorage.getItem("customer-login-token");s&&p0(s);const l=(await ze.getShadowGraphqlClient().query({query:Ov,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:n}})).data.customer;return l.id?(this.customer=l,!0):(console.error("Failed to get customer."),!1)}async generateVerificationCode(e){await ze.getShadowGraphqlClient().mutate({mutation:mV,variables:{emailAddress:e}}),await Id.generateCode(e)}async verifyCode(e,t){const n=(await this.getIntegration()).partner.id||"",i=await Id.verifyCode(e,t,n);if(i?.AuthenticationResult){localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),localStorage.setItem("cognito-tokens",JSON.stringify(i.AuthenticationResult)),localStorage.setItem("cognito-email",e);const s=(await ze.getShadowGraphqlClient().mutate({mutation:vV,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e,verificationCode:t}})).data?.customerVerifyCode;if(!s?.id)throw new Error("Failed to get customer.");return this.customer=s,s.loginToken&&(localStorage.setItem("customer-login-token",s.loginToken),p0(s.loginToken)),!0}else throw new Error}async logOut(){localStorage.removeItem("last-refreshed-cognito-tokens"),localStorage.removeItem("cognito-tokens"),localStorage.removeItem("cognito-email"),localStorage.removeItem("customer-login-token"),p0(""),this.clearCustomer()}async loggedInBearerToken(){const e=localStorage.getItem("last-refreshed-cognito-tokens"),t=localStorage.getItem("cognito-tokens");if(!e||!t)throw new Error("No token data in storage.");const n=JSON.parse(t),i=new Date().getTime()/1e3,a=!n?.AccessToken||vg(n.AccessToken);if(!n.ExpiresIn||n.ExpiresIn<i-parseInt(e)||a){const s=await Id.refreshTokens();if(s?.AuthenticationResult)localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),n.AccessToken=s.AuthenticationResult.AccessToken,localStorage.setItem("cognito-tokens",JSON.stringify(n));else throw this.logOut(),new Error("Failed to refresh tokens.")}if(!n.AccessToken)throw new Error("No bearer token in storage.");return n.AccessToken}async getCustomerMetafields(){if(!this.customer?.id)throw new Error("Customer must be logged in before calling this function.");return(await ze.getShadowGraphqlClient().query({query:yV,variables:{id:this.customer.id}})).data.metafields}async getNewBundle(e,t,n,i){const s=(await ze.getShadowGraphqlClient().mutate({mutation:ZU(n?.graphql?.productCollection?.eagerFetchProducts||!1),variables:{collectionId:e,initialMetadata:t?Object.entries(t).map((c,f)=>({key:c[0],value:c[1]})):void 0,marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId,activationId:i,test:n?.test},fetchPolicy:"no-cache"})).data?.bundleCreate;if(!s?.id)throw new Error("Unable to create bundle");const o=wr.getMap("bundlePartnerIds")||new Map;o.set(s.id,s.partner.id),wr.setMap("bundlePartnerIds",o);const l=wr.getMap("bundleOwnerIds")||new Map;l.set(s.id,s.bundleOwnerId),wr.setMap("bundleOwnerIds",l);const u=new PE(this,s,void 0,void 0,s.bundleOwnerId,{eagerFetchProducts:n?.graphql?.productCollection?.eagerFetchProducts});return await u.getInitializationPromise(),u}async getExistingBundle(e,t,n,i,a){const o=wr.getMap("bundleOwnerIds")?.get(e),l={};try{const g=await this.loggedInBearerToken();l.Authorization=`Bearer ${g}`}catch{const y=Object.entries(localStorage).find(([C,S])=>C.startsWith("CognitoIdentityServiceProvider")&&C.endsWith("idToken"))?.[0]||"",A=localStorage.getItem(y);A&&!vg(A)&&(l.Authorization=`Bearer ${A}`)}const u={bundleOwnerId:o,...l,...i?.graphql?.additionalHeaders},c=await ze.getShadowGraphqlClient().query({query:YU(i?.graphql?.productCollection?.eagerFetchProducts||!1),variables:{id:e},fetchPolicy:"no-cache",context:{headers:u}});if(!c.data?.bundles||c.data?.bundles.length===0||!c.data?.bundles[0])throw new Error(`Unable to find bundle: ${e}`);const f=c.data?.bundles[0],d=wr.getMap("bundlePartnerIds")||new Map;d.set(f.id,f.partner.id),wr.setMap("bundlePartnerIds",d);const h=new PE(this,f,t,n,o,{additionalHeaders:i?.graphql?.additionalHeaders,eagerFetchProducts:i?.graphql?.productCollection?.eagerFetchProducts,existingGlobalPropertyState:c.data.globalPropertyState,readonly:i?.readonly},a);return await h.getInitializationPromise(),h}async duplicateBundle(e,t,n,i){const s={...await VP(e),...i?.graphql?.additionalHeaders},l=(await ze.getShadowGraphqlClient().mutate({mutation:e9(),variables:{id:e,template:t,marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId,duplicateTransactions:n,test:i?.test},context:{headers:s},fetchPolicy:"no-cache"})).data?.bundleDuplicate;if(!l?.id)throw new Error("Unable to duplicate bundle");const u=wr.getMap("bundlePartnerIds")||new Map;u.set(l.id,l.partner.id),wr.setMap("bundlePartnerIds",u);const c=wr.getMap("bundleOwnerIds")||new Map;return c.set(l.id,l.bundleOwnerId),wr.setMap("bundleOwnerIds",c),async()=>await this.getExistingBundle(l.id,void 0,void 0,{graphql:{productCollection:{eagerFetchProducts:i?.graphql?.productCollection?.eagerFetchProducts||!1}}})}async getBundlesForCustomer(e){if(!this.customer?.id)throw new Error("Customer not authenticated.");const{includeMetadata:t,...n}=e;return(await ze.getShadowGraphqlClient().query({query:d9(t??!1),variables:{...n,id:this.customer.id},fetchPolicy:"no-cache"})).data.customerBundlesFeed}async getBundleStakeholders(){if(!this.customer)throw new Error("Customer not authenticated.");const e=await ze.getShadowGraphqlClient().query({query:XU,variables:{id:this.customer.id},fetchPolicy:"no-cache"});if(!e.data?.customers||e.data.customers.length===0)throw new Error("Unable to find customer.");const n=e.data.customers[0].bundleStakeholders||[],i=wr.getMap("bundlePartnerIds")||new Map;return n.forEach(a=>{a.bundle?.id&&a.bundle.partner?.id&&i.set(a.bundle.id,a.bundle.partner.id)}),wr.setMap("bundlePartnerIds",i),n}async getWorkflowExperience(e,t){if(!e)throw new Error("getWorkflowExperience has been called without an options object! This is not supported.");const n=await this.getWorkflowExperiences([e],e.graphql),i=n[0],a=i.getWorkflow();return t&&!a&&console.error("No workflow instantiated when trying to create preview service."),t&&a&&await i.getWorkflowManager().injectIntoPreviewService(t(a)),n[0]}async getWorkflowExperiences(e,t,n,i){if(e.length===0)throw new lo("No options provided!");const a=e.map((q,Y)=>({option:q,index:Y})),s=a.filter(q=>q.option.type==="transaction"),o=a.filter(q=>q.option.type==="integration"||q.option.type==="external"||q.option.type==="blank"),l=50,u=fA(s,l),c=fA(o,l);let f=0;const d=ze.getShadowGraphqlClient(),h=async q=>{if(q.length===0)return[];const Y=q.map(oe=>oe.option.transactionId),J=await d.query({query:F3,variables:{ids:Y},errorPolicy:"all",fetchPolicy:"no-cache"}),ae=J.data.transactions;if(f=f+ae.length,i&&i(f,s.length),ae.length!==q.length){const oe=J.errors?.[0]?.message||"Unknown error";throw new lo(`Not all transactions were found: ${oe}`)}return!this.activeIntegration&&ae[0].integrationProduct?.integration&&(this.activeIntegration=Promise.resolve(ae[0].integrationProduct.integration)),ae.map((oe,he)=>({transaction:oe,workflowId:oe.workflowId,readOnly:q.find(ye=>ye.option.transactionId===oe.id)?.option.readOnly??!1,index:q[he].index}))},g=async q=>{if(q.length===0)return[];const Y=await d.mutate({mutation:T3,variables:{inputs:q.map(ae=>({integrationProductId:ae.option.type==="integration"?ae.option.integrationProductId:void 0,externalIntegrationId:ae.option.type==="external"?ae.option.externalIntegrationId:void 0,externalProductId:ae.option.type==="external"?ae.option.externalProductId:void 0,workflowId:ae.option.workflowId,designName:ae.option.designName,claim:!0,quantity:ae.option.quantity,recipient:ae.option.recipient,parentTransactionId:ae.option.parentTransactionId})),marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId},errorPolicy:"all",fetchPolicy:"no-cache",context:this.getCreateTransactionContext(q,t)}),J=Y.data?.transactionCreateMany;if(!J||J.length===0){const ae=Y.errors?.[0]?.message||"Unknown error";throw new lo(`Failed to create transactions: ${ae}`)}return f=f+J.length,i&&i(f,s.length),J.map((ae,oe)=>({transaction:ae,workflowId:ae.workflowId,readOnly:!1,index:q[oe].index}))},v=(await Promise.all([...u.map(h),...c.map(g)])).flat();let y=[...new Set(v.map(q=>q.transaction.integrationProductId))].filter(q=>!!q);y=y.filter(q=>!!q);let A=[...new Set(v.map(q=>q.workflowId))].filter(q=>!!q);A=A.filter(q=>!!q);const[C,S]=await Promise.all([(async()=>y.length>0?await _P(y):[])(),(async()=>A.length>0?await Zb(A,t):[])()]),F=new Map(C.map(q=>[q.id,q])),E=new Map(S.map(q=>[q.id,q])),R=v.map(async q=>{const{transaction:Y,workflowId:J,readOnly:ae,index:oe}=q,he=J?E.get(J):void 0,ye=e[oe];if(Y.integrationProductId){const re=F.get(Y.integrationProductId);Y.integrationProduct=re,Y.product=re?.product,Y.integrationProduct||console.error("failed to find transaction's product")}const Ue=wr.getMap("transactionOwnerIds")||new Map;!Ue.get(Y.id)&&Y.transactionOwnerId&&(Ue.set(Y.id,Y.transactionOwnerId),wr.setMap("transactionOwnerIds",Ue));const Re=Ue.get(Y.id)||void 0,Oe=new AV({onMutate:()=>({context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}}),onQuery:()=>({context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}})}),ee={workflow:he,transaction:Y,singleVariantsRenderable:ye?.workflowConfiguration?.singleVariantsRenderable,stateMutationFunc:ae?async()=>{throw new nn("State mutation is forbidden in read only mode!")}:async re=>this.updateTransactionState({...re,context:{transactionOwnerId:Re,bundleOwnerId:t?.bundleOwnerId}}),graphQlClient:()=>Oe,readOnly:ae,isReloadedTransaction:ye.type==="transaction"};if(ye.type==="transaction"&&Y.workflowState){const re=JSON.parse(Y.workflowState);await sA(re),ee.reloadedState=re}else if(!ae&&ye.workflowState){const re=JSON.parse(ye.workflowState);await sA(re),ee.reloadedState=re}return ee.delayWorkflowStateSync=!0,{experienceOptions:ee,index:oe,options:ye}}),j=(await Promise.all(R)).sort((q,Y)=>q.index-Y.index);let G=[],ie=[];for(const q of j){const{experienceOptions:Y,options:J}=q,ae=new kI(this,Y);await ae.getWorkflowManager().getInitializationPromise(),n&&n(),J.type!=="transaction"&&this.customer&&ie.push(ae),G=[...G,ae],ae.getWorkflowManager().setWorkflowStateSyncEnabled(!0)}if(ie.length>0){const q=this.customer.emailAddress,Y=ie.map(oe=>oe.getTransaction().id),ae=(await d.mutate({mutation:H9,variables:{ids:Y,details:{emailAddress:q},type:"Owner"},errorPolicy:"all"})).data?.transactionsAddStakeholder;if(ae&&ae?.length>0){const oe=ae[0].stakeholders?.find(he=>he.customer?.emailAddress===q);if(oe?.customer)for(const he of ie)he.assignCustomerInternal(oe.customer)}}return G}getCreateTransactionContext(e,t){const n=e.find(s=>s.option.parentTransactionId)?.option.parentTransactionId;if(!n&&!t?.bundleOwnerId)return;const i=wr.getMap("transactionOwnerIds")||new Map,a=n?i.get(n):void 0;return{...a?{transactionOwnerId:a}:{},...t?.bundleOwnerId?{bundleOwnerId:t.bundleOwnerId}:{}}}storeCustomer(e){const t=wr.getMap("partnerCustomerIds")||new Map;t.set(e.partner.id,e.id),wr.setMap("partnerCustomerIds",t)}async getIntegrationProductById(e,t){const a=(await ze.getShadowGraphqlClient().query({query:_3(t),variables:{ids:[e]},fetchPolicy:"no-cache",errorPolicy:"all"})).data?.integrationProducts;if(!a||a.length===0||!a[0]?.id)throw new Error("Integration product not found.");return new gA(a[0])}async getIntegrationProductFromExternalIds(e,t,n){const s=(await ze.getShadowGraphqlClient().query({query:N3(n),variables:{externalProductId:t,externalIntegrationId:e},fetchPolicy:"no-cache",errorPolicy:"all"})).data?.integrationProductFromExternalIds;if(!s?.id)throw new Error("Integration product not found.");return new gA(s)}async getIntegrationProduct(e){return e.type==="integration"?this.getIntegrationProductById(e.integrationProductId):this.getIntegrationProductFromExternalIds(e.externalIntegrationId,e.externalProductId)}async getShareActionsForTransaction(e){const n=(wr.getMap("transactionOwnerIds")||new Map).get(e)||void 0,i=await ze.getShadowGraphqlClient().query({query:B3,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:e},context:{transactionOwnerId:n}});if(!i.data.transactions||i.data.transactions.length!==1)throw new Error(`Failed to fetch share actions for transaction: ${e}`);return i.data.transactions[0].transactionShareActions}async placeOrder(e){const t=await ze.getShadowGraphqlClient().mutate({mutation:Y3,variables:{orderItems:e}});if(t.errors)throw new Error(t.errors[0].message);if(!t.data)throw new Error("Failed to create order: No order data in response.");return{id:t.data.orderCreate.id,internalId:t.data.orderCreate.internalId}}}const NP=async(r,e)=>(await ze.getShadowGraphqlClient().query({query:q3,errorPolicy:"all",fetchPolicy:"no-cache",context:{headers:{"x-application-key":r},skipIntegrationCheck:!0},variables:{themeConfigurationId:e}})).data.currentIntegration,NQ=async r=>{const t=await ze.getShadowGraphqlClient().query({query:O3,errorPolicy:"all",fetchPolicy:"network-only",variables:{id:r}});if(t.data.transactions.length!==0)return t.data.transactions[0]},LQ=async(r,e)=>(await ze.getShadowGraphqlClient().query({query:G3,errorPolicy:"all",variables:{themeConfigurationId:r,themeInstallId:e}})).data?.marketplaceThemeInstallConfiguration,UQ=async r=>(await ze.getShadowGraphqlClient().query({query:Q3,errorPolicy:"all",variables:{id:r}})).data?.bundles?.[0]?.marketplaceThemeInstallConfiguration,VQ=async r=>(await ze.getShadowGraphqlClient().query({query:W3,errorPolicy:"all",variables:{id:r}})).data?.transactions?.[0]?.marketplaceThemeInstallConfiguration,LP=async(r,e)=>(await ze.getShadowGraphqlClient().query({query:nM(!!e),errorPolicy:"all",variables:{id:r,productIds:e}})).data?.activation,zQ=async r=>(await LP(r))?.marketplaceThemeInstallConfiguration;async function UP(){const r={};try{const e=await this.loggedInBearerToken();r.Authorization=`Bearer ${e}`}catch{const n=Object.entries(localStorage).find(([a,s])=>a.startsWith("CognitoIdentityServiceProvider")&&a.endsWith("idToken"))?.[0]||"",i=localStorage.getItem(n);i&&!vg(i)&&(r.Authorization=`Bearer ${i}`)}return r}async function VP(r){const t=wr.getMap("bundleOwnerIds")?.get(r),n=await UP();return{bundleOwnerId:t,...n}}async function $Q(r){const t=wr.getMap("transactionOwnerIds")?.get(r),n=await UP();return{transactionOwnerId:t,...n}}const HQ=async r=>{const e=await VP(r),t=await ze.getShadowGraphqlClient().mutate({mutation:b9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:r},context:{headers:e}});if(t.data?.bundleDelete!==r)throw new Error(`Failed to delete bundle: ${t.errors}`)},jQ=async r=>{const e=await $Q(r),t=await ze.getShadowGraphqlClient().mutate({mutation:w9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{ids:[r]},context:{headers:e}});if(!t.data?.transactions||t.data.transactions.length!==1||t.data.transactions[0].id!==r)throw new Error(`Failed to find transaction to read bundle id: ${JSON.stringify(t.errors)}`);return t.data.transactions[0].bundle?.id};function zP(r,e,t,n){const i=t.width*r.zoom,a=t.height*r.zoom;if(n){const s=Math.max(e.width/t.width,e.height/t.height),o=Math.max(s,r.zoom),l=t.width*o,u=t.height*o;return{...r,x:Dp(r.x,e.width-l,0),y:Dp(r.y,e.height-u,0),zoom:o}}return{...r,x:Dp(r.x,-i,e.width),y:Dp(r.y,-a,e.height)}}function Dp(r,e,t){return Math.min(Math.max(r,e),t)}class $P{constructor(e,t){this.minZoomScale=[.03],this.maxZoomScale=[20],this._debouncedUpdateFrameOffsets=EI(this.updateFrameOffsets,200),this.targetElements=[],this.onFrameDataChangeListeners=[],this.onZoomChangeListeners=[],this.onRotationChangeListeners=[],this.forceImageCover=e,this.initialZoom=t,this.thresholdSettings={useThreshold:!1,invertThreshold:!1,threshold:128,thresholdSaturation:.5}}connectWorkflowManager(e,t){t&&e.addStepSpecificStorageCallback(async n=>{if(n){const i=n;if(i.currentFrameSources){let a=!1;for(let s=0;s<i.currentFrameSources.length;s++){const o=i.currentFrameSources[s],l=await Xf(o),u=this.frameData?this.frameData[s]:void 0;vf(l,u)||(this.frameData||(this.frameData=new Array(i.currentFrameSources.length)),this.frameData[s]=l,a=!0)}a&&(this.onFrameDataChangeListeners.forEach(s=>s(this.frameData)),this.frameData&&this.imageData&&(this.recalculateOffsets(this.imageData),this.updateOffsets(this.offsets),this.recalculateZoomLimits(this.imageData,this.frameData)))}}},t),this.workflowManager=e,this.stepName=t}setTargetElements(e){this.targetElements=e}getFrameData(){return this.frameData}setFrameData(e){if(!e){this.frameData=void 0;return}e.forEach((t,n)=>{const i=_u.get(t);i&&(this.frameData||(this.frameData=new Array(e.length)),this.frameData[n]=i)})}getImageData(){return this.imageData}getImageSrc(){if(this.imageData){if(this.imageData.svg){const e=zg(this.imageData.svg,this.imageData.colors||{},!1);return Ug(e)}return this.imageData.src}}getOffsets(){return this.offsets}setOffsets(e){this.offsets=e}setZoom(e,t,n,i){if(this.imageData&&this.offsets&&this.frameData){(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length));const a=this.frameData.map((s,o)=>{const l=(t[o]-this.offsets[o].x)/this.offsets[o].zoom,u=(n[o]-this.offsets[o].y)/this.offsets[o].zoom,c=t[o]-l*e[o],f=n[o]-u*e[o];return{x:c,y:f,zoom:this.imageData.width*e[o]/this.imageData.width,rotation:this.offsets[o].rotation}});this.updateOffsets(a,i),this.onZoomChangeListeners.forEach(s=>s(e))}}setRotation(e,t){if(this.imageData&&this.offsets&&this.frameData){(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length));const n=this.frameData.map((i,a)=>({...this.offsets[a],rotation:e[a]}));this.updateOffsets(n,t),this.onRotationChangeListeners.forEach(i=>i(e))}}setPatternData(e,t=!0){this.imageData=e,e&&this.frameData&&((t||!this.offsets)&&this.recalculateOffsets(e,t),this.updateOffsets(this.offsets,void 0,!0)),this.imageData&&this.frameData&&this.recalculateZoomLimits(this.imageData,this.frameData)}updateOffsets(e,t,n){const i=this.imageData;if(!i||!this.frameData)return;if(this.frameData.length!==e.length)throw new nn("Frame data and offsets are not the same length. This is a bug. Please report it.");if(!this.offsets.some((s,o)=>!(e[o].x===s.x&&e[o].y===s.y&&e[o].zoom===s.zoom&&e[o].rotation===s.rotation))&&!n){t&&t();return}(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length)),this.frameData.forEach((s,o)=>{this.offsets[o]=zP(e[o],s,this.imageData,this.forceImageCover)}),this._debouncedUpdateFrameOffsets(this.offsets,i,this.frameData,this.thresholdSettings,t)}getThresholdSettings(){return this.thresholdSettings}setThresholdSettings(e){this.thresholdSettings=e,this.imageData&&this.frameData&&this._debouncedUpdateFrameOffsets(this.offsets,this.imageData,this.frameData,e)}onFrameDataChanged(e){e(this.frameData),this.onFrameDataChangeListeners.push(e)}onZoom(e){this.onZoomChangeListeners.push(e)}onRotation(e){this.onRotationChangeListeners.push(e)}updateFrameOffsets(e,t,n,i,a){if(!n||n.length===0||n.some(l=>!l))throw new nn("Frame data not set. This is a bug");if(!this.workflowManager)throw new nn("No workflow manager set, cannot update offsets.");const s=this.workflowManager.getRegionElements(this.stepName||""),o=this.workflowManager.getCommandDispatcher();this.targetElements.forEach((l,u)=>{let c=s.find(f=>f.id===l)?.regionIndex??u;c>=e.length&&(c=u);try{o(new On([new AL(l,t,e[c]),new bL(l,i.useThreshold,i.invertThreshold,i.threshold,i.thresholdSaturation)]))}catch{}}),this.stepName&&this.workflowManager.updateStorage(this.stepName,{frameOffsetsList:e}),a&&a()}recalculateZoomLimits(e,t){(this.minZoomScale.length!==t.length||this.maxZoomScale.length!==t.length)&&(this.minZoomScale=new Array(t.length),this.maxZoomScale=new Array(t.length)),t.forEach((n,i)=>{const a=Math.max(n.width/e.width,n.height/e.height);this.forceImageCover?(this.minZoomScale[i]=a,this.maxZoomScale[i]=a*2.5):(this.minZoomScale[i]=a/10,this.maxZoomScale[i]=a*2.5)})}recalculateOffsets(e,t=!0){this.frameData&&((!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length)),this.frameData.forEach((n,i)=>{const a=t?0:this.offsets[i]?.rotation||0;this.offsets[i]={...C1(e,n,this.initialZoom&&!this.forceImageCover?{scale:this.initialZoom}:void 0,this.forceImageCover),rotation:a}}),this._debouncedUpdateFrameOffsets(this.offsets,e,this.frameData,this.thresholdSettings))}}class GQ{traversableScenes(){throw new Error("Method not implemented.")}updateRecipient(e,t,n,i,a,s,o,l,u,c,f,d,h,g,v,y,A){throw new Error("Method not implemented.")}approveTransaction(e){throw new Error("Method not implemented.")}rejectTransaction(e){throw new Error("Method not implemented.")}getClient(){return this.client??{}}getWorkflowExperience(){return{}}setClient(e){this.client=e}getInitializationPromise(){return Promise.resolve()}isInitialized(){return!0}getInformationResults(){return[]}async reset(){}updateStateWithServer(e){}async outstandingRequestsPromise(){}async updateStateWithServerImmediate(e){}addPoller(e){}addConfirmCallback(e){}addEditedCallback(e){}addElementsCallback(e){}addInformationResultCallback(e){}addInitCallback(e){}addMakingAdjustmentsCallback(e){}addMandatoryCallback(e){}addMetadataCallback(e){}addSelectionCallback(e){}addStepSpecificStorageCallback(e,t){}addStorageCallback(e){}getCommandDispatcher(){return e=>{}}getLayouts(){return[]}getLayoutPreviewService(){return{getAll:()=>new Map}}getPreviewService(){}getModelContainer(){}getRegionElements(e){return[]}getSerializedStep(e,t){}getStepSpecificServices(e){}getTransaction(){return{id:""}}getTransactionCustomer(){}setTransactionCustomer(){}setTransactionCustomerDetails(){}getInitialOptionIds(){return new Promise(()=>new Set)}getWorkflow(){return{id:"",name:"",panels:[],steps:[],showModelOnFinishStep:!1,allowProofDownload:!1,introduction:"",stepGroups:[]}}markStepsAsInitialised(e){}markUpdateCompleted(e){}markUpdatePending(){return"123"}getWorkflowSelections(){return{}}getStepSelections(){return{}}setCurrentAdjustingStepId(e){}setEditedStatus(e,t){}setInformationResults(e){}setMandatoryFulfilled(e,t){}async setSelectionsAndElements(e,t,n){}toggleDesignConfirmed(){}updateMetadata(e,t){}async updateStorage(e,t){}injectIntoPreviewService(e){return Promise.resolve()}ejectFromPreviewService(){}setWorkflowStateSyncEnabled(e){}async updateTransactionShareActions(){}addValidationCallback(e){}setStepError(e,t,n){}getStepErrors(e){}getValidationErrors(){return{steps:new Map}}async updateTransactionStakeholders(){}getStepTags(e){return[]}}var HP=(r=>(r.SelectFrame="SelectFrame",r.SelectImage="SelectImage",r.Position="Position",r))(HP||{}),jP=(r=>(r.Original="original",r.BackgroundRemoved="backgroundRemoved",r.Optimized="optimized",r))(jP||{});class GP extends Ui{constructor(e,t,n){super(e,t,n);const i=t.data;this.frameService=new $P(i.forceImageCover,i.initialZoomLevel),this.frameService.connectWorkflowManager(e,t.stepName)}selectVariant(e){const t=this.manager.getRegionElements(this.step.stepName);return so.selectVariant(this.step,e.getResource(),t,this.manager,n=>this.setUpdateState(n))}onFrameDataChanged(e){this.frameService&&this.frameService.onFrameDataChanged(t=>{t&&e(t)})}async selectImage(e,t=!0,n=!0){await so.selectImage(this.step,e,this.manager,n),t&&this.manager.updateStorage(this.step.stepName,{framePatternData:{originalAssetKey:e.key,backgroundRemovedAssetKey:void 0,vectorizedAssetKey:void 0,enhancedAssetKey:void 0,useOriginalAsset:void 0}})}async canUseAdvancedImageManipulation(){return this.manager.getClient().canUseAddon(Bg.AdvancedImageManipulation)}async canRemoveBackground(){return await this.canUseAdvancedImageManipulation()&&this.hasOriginalImageSelection()&&!!this.frameService?.getImageData()?.src&&!this.frameService?.getImageData()?.svg}async removeBackgroundFromImageSelection(e=!0){if(!await this.canUseAdvancedImageManipulation())throw new Error("The current Integration does not have access to the Background Remover. Please call canUseAdvancedImageManipulation to ensure you disable this feature when appropriate.");const t=await this.getOriginalImageSelection();if(!t)throw new Error("You must supply an image selection before attempting to remove the background.");const n=await Ln.removeBackgroundFromAsset(t);e&&await so.selectImage(this.step,n,this.manager,!1);const i=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{...i,backgroundRemovedAssetKey:n.key,useOriginalAsset:!e}}),n}async vectorize(e,t=void 0){const n=e??await this.getOriginalImageSelection();if(!n)throw new Error("You must supply an image selection before attempting to vectorize the image.");const i=await Ln.vectorizeAsset(n,t);await this.selectImage(i,!1);const a=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{...a,vectorizedAssetKey:i.key,useOriginalAsset:!1}}),i}async enhanceWithAI(e,t){const n=e??await this.getOriginalImageSelection();if(!n)throw new Error("You must supply an image selection before attempting to enhance the image with AI.");const i=await Ln.enhanceWithAI(n,t);await this.selectImage(i,!1);const a=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{originalAssetKey:a.originalAssetKey,backgroundRemovedAssetKey:a.backgroundRemovedAssetKey,vectorizedAssetKey:a.vectorizedAssetKey,enhancedAssetKey:i.key,useOriginalAsset:!1}}),i}async getBackgroundRemovedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.backgroundRemovedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}async getVectorizedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.vectorizedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}async getEnhancedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.enhancedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}hasOriginalImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.originalAssetKey}hasBackgroundRemovedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.backgroundRemovedAssetKey}hasVectorizedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.vectorizedAssetKey}hasEnhancedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.enhancedAssetKey}async changeColors(e){await so.changeColors(this.step,this.manager,e)}getImageData(){if(this.frameService)return this.frameService.getImageData()}async getColorOption(){return await ct.ensureFullOption(this.step.data.colorOption)}getAvailableColors(){return this.step.data.colorPickerEnabled?so.availableColors(this.step,this.manager):Promise.resolve([])}isColorPickerEnabled(){return this.step.data.colorPickerEnabled??!1}async getOriginalImageColors(){const e=this.getImageData();return e?.svg?(await Pa(e.svg)).colors:void 0}async mergeColors(e,t,n){const i=this.frameService.getImageData();if(!i?.svg||!i.colors)throw new Error("Cannot merge colors on non-SVG image or image without color information");const{svg:a,colors:s}=dT(i.svg,i.colors,e,t,n);this.frameService.setPatternData({...i,svg:a,colors:s},!1),this.manager.updateStorage(this.step.stepName,{colors:s})}async unmergeColors(e,t,n,i){const a=this.frameService.getImageData();if(!a?.svg||!a.colors)throw new Error("Cannot unmerge colors on non-SVG image or image without color information");this.frameService.setPatternData({...a,svg:i,colors:n},!1),this.manager.updateStorage(this.step.stepName,{colors:n})}getShouldVectorize(){return this.step.data.shouldVectorize??!1}getVectorizeMaxColors(){return this.step.data.vectorizeMaxColors}getMinimumPixelThresholdForOptimization(){return this.step.data.vectorizationMinimumPixelThreshold}getMaxAllowedColors(){return this.step.data.maxColors}getUniqueColorCount(){return so.getUniqueColorCount(this.step,this.manager)}getCurrentFrameStep(e,t,n,i){return i&&i.length>1&&e===void 0?"SelectFrame":t||n||this.getImageData()?"Position":"SelectImage"}getFrameService(){return this.frameService}hasOverlayImageKey(){return this.step.data.overlayImageKey}hasOverlayImageUrl(){return this.step.data.overlayImageUrl}getWhitelistedExtensions(){return[...this.step.data.whitelistedExtensions,...this.step.data.whitelistedExtensions.includes(".jpg")?[".jpeg"]:[]]}async getOriginalImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.originalAssetKey;if(e)return Ln.getLocalOrFromServer(e)}getCurrentImageState(){const e=this.getFrameStepStorage()?.framePatternData;return e?e.vectorizedAssetKey&&!e.useOriginalAsset?"optimized":e.useOriginalAsset!==!1?"original":"backgroundRemoved":"original"}async setImageState(e){const t=this.getFrameStepStorage()?.framePatternData||{};let n,i;switch(e){case"original":if(n=await this.getOriginalImageSelection(),!n)throw new Error("No original image available");i=!0;break;case"backgroundRemoved":if(n=await this.getBackgroundRemovedImageSelection(),!n)throw new Error("No background-removed image available. Call removeBackgroundFromImageSelection first.");i=!1;break;case"optimized":if(n=await this.getVectorizedImageSelection(),!n)throw new Error("No optimized image available. Call vectorize first.");i=!1;break}await this.selectImage(n,!1,!0),this.manager.updateStorage(this.step.stepName,{framePatternData:{...t,useOriginalAsset:i}})}getUseOriginalImageSelection(){return this.getFrameStepStorage()?.framePatternData?.useOriginalAsset??!1}async setUseOriginalImageSelection(e){const t=this.getFrameStepStorage()?.framePatternData||{};if(t.useOriginalAsset===e)return;const n=await this.getOriginalImageSelection();if(!n)throw new Error("You must provide an image selection before calling setUseOriginalImageSelection");if(e)await this.selectImage(n,!1,!1);else{const i=await this.getBackgroundRemovedImageSelection();if(!i)throw new Error("You must call removeBackgroundFromImageSelection before attempting to apply the image.");await this.selectImage(i,!1,!1)}this.manager.updateStorage(this.step.stepName,{framePatternData:{...t,useOriginalAsset:e}})}getFrameStepStorage(){return this.manager.getStepStorage(this.step.stepName)}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}const qQ=Se`
|
|
3057
3057
|
query GetLoggedInCustomer($email: String!) {
|
|
3058
3058
|
customer(emailAddress: $email) {
|
|
3059
3059
|
id
|
|
@@ -3266,4 +3266,4 @@ ${N2(t)}`);const i=await ze.getShadowGraphqlClient().query({query:t,errorPolicy:
|
|
|
3266
3266
|
}
|
|
3267
3267
|
}
|
|
3268
3268
|
`,SY=async r=>(await ze.getShadowGraphqlClient().query({query:xY,variables:{ids:r}})).data.integrationProducts;exports.AddonHandle=Bg;exports.AddressValidationJobStatus=QP;exports.AddressValidationResultConfirmationLevel=WP;exports.AddressValidationStatus=Og;exports.ArrayInput=pV;exports.AspectType=Hn;exports.AssetNotFoundError=So;exports.AssetType=ff;exports.BringForwardCommand=EL;exports.BringToBackCommand=SL;exports.BringToFrontCommand=xL;exports.BundleDesignCreationCartAddMode=_k;exports.CanvasCommand=Fn;exports.CollectionProduct=Pu;exports.ColorOptionGlobalPropertyHandle=hA;exports.CommandContext=jF;exports.ConversionDataType=Qd;exports.CreateElementCommand=ai;exports.CreateLayoutCommand=E1;exports.CurrencyContext=BP;exports.CurrencyService=OP;exports.DeleteElementCommand=Ol;exports.DigitalContentStepHandle=bI;exports.FileUploadGlobalPropertyHandle=TI;exports.FlowExecutionNodeResult=Vd;exports.FlowExecutionResult=OI;exports.FlowService=RI;exports.FontAlignmentCommand=YF;exports.FontColorCommand=oA;exports.FontSizeCommand=QF;exports.FontSourceCommand=lA;exports.FrameService=$P;exports.FrameStep=HP;exports.FrameStepHandle=GP;exports.GlobalPropertyHandle=Jg;exports.GroupCommand=On;exports.IllustrationStepHandle=fI;exports.ImageState=jP;exports.InformationMessageType=Jf;exports.InformationStepHandle=AI;exports.IntegrationProduct=gA;exports.IntegrationType=Lk;exports.LayoutElementFactory=gL;exports.LayoutElementType=er;exports.LayoutNotFoundError=Ai;exports.LayoutRenderingPurpose=Ku;exports.MaterialStepHandle=hI;exports.MisconfigurationError=as;exports.MockWorkflowManager=GQ;exports.ModelStepHandle=pI;exports.ModuleStepHandle=wI;exports.MoveCommand=mL;exports.ObjectInput=N1;exports.ObjectInputType=BI;exports.OptionGlobalPropertyHandle=B1;exports.OptionNotFoundError=hf;exports.ParseError=Al;exports.PictureStepHandle=gI;exports.ProductCameraRig=Uk;exports.ProductCollection=M1;exports.ProductCollectionProductSortKey=DI;exports.ProductStepHandle=CI;exports.ProductWorkflow=oo;exports.PromiseQueue=Gg;exports.QuestionStepHandle=mI;exports.QueueablePromise=jg;exports.ResizeCommand=yL;exports.ResourceNotFoundError=Zu;exports.RotateCommand=vL;exports.ScaleAxis=gi;exports.SendBackwardsCommand=kL;exports.ShapeStepHandle=vI;exports.ShareActionType=Nk;exports.SpiffCommerceClient=_Q;exports.StakeholderType=GA;exports.StepAspectType=Mk;exports.StepHandle=Ui;exports.StepType=Xe;exports.TextAlgorithm=Fl;exports.TextChangeCommand=XF;exports.TextGlobalPropertyHandle=FI;exports.TextInput=hV;exports.TextStepHandle=yI;exports.UnhandledBehaviorError=nn;exports.UnitOfMeasurement=Vk;exports.UpdateImageSourceCommand=wL;exports.Variant=Fa;exports.WorkflowExperienceEventType=yg;exports.WorkflowExperienceImpl=kI;exports.__values=nD;exports.amtChannelsForAspect=II;exports.assetConfigurationDeleteMutation=Z3;exports.assetConfigurationUpdateMutation=K3;exports.assetConfigurationsQuery=J3;exports.assetService=Ln;exports.browserColorToHex=oT;exports.bundleEmailMutation=C9;exports.cmPerPixel=W_;exports.currentDirection=j_;exports.dataUrlFromExternalUrl=N4;exports.deleteBundle=HQ;exports.designService=Qp;exports.determineCorrectFontSizeAndLines=Kd;exports.digitalContentStepService=T1;exports.domParser=us;exports.duplicateBundle=rY;exports.duplicateTransaction=nY;exports.fetchAsString=ra;exports.findAngle=N_;exports.findElement=Un;exports.findPmsColors=t3;exports.frameDataCache=_u;exports.frameStepService=so;exports.fromHex=$I;exports.fromUtf8=kl;exports.generate=Ar;exports.generateCommands=oI;exports.generateSVGWithUnknownColors=Pa;exports.generateStateFromDesignInputSteps=$U;exports.getActivation=LP;exports.getActivationThemeConfiguration=zQ;exports.getAddressValidationJobs=yY;exports.getAssetsForProductImagesQuery=eM;exports.getAttributesFromArrayBuffer=_f;exports.getAxisAlignedBoundingBox=__;exports.getBoundedOffsets=zP;exports.getBundleIdForTransaction=jQ;exports.getBundleThemeConfiguration=UQ;exports.getCustomer=iY;exports.getCustomerBundles=aY;exports.getElementVertices=G_;exports.getFrameData=Xf;exports.getGlobalPropertyStateForBundle=qU;exports.getIntegration=NP;exports.getIntegrationProducts=SY;exports.getNEPoint=$_;exports.getNWPoint=z_;exports.getOrderedTransactions=lY;exports.getOverrideThemeConfiguration=LQ;exports.getPointOfRotation=V_;exports.getProductCollections=oV;exports.getSEPoint=H_;exports.getSvgElement=Qg;exports.getTemplateBundles=cY;exports.getTemplateTransactions=uY;exports.getTransaction=NQ;exports.getTransactionThemeConfiguration=VQ;exports.getTransactionsForBundle=sY;exports.getTransformedAssetURL=$g;exports.getTrueCoordinates=U_;exports.getUnorderedTransactions=oY;exports.getValidationJobsForWorkflowExperiences=vY;exports.getWorkflow=MP;exports.getWorkflows=Zb;exports.graphQlManager=ze;exports.illustrationStepService=Jd;exports.isCloseToValue=L_;exports.loadFont=Rl;exports.matchHexToPms=KB;exports.materialStepService=F1;exports.mergeColorClasses=dT;exports.metafieldManager=Ag;exports.mmPerPixel=q_;exports.modelStepService=I1;exports.modifySVGColors=zg;exports.moduleStepService=P1;exports.nameBundle=eY;exports.nameTransaction=tY;exports.optionService=ct;exports.outlineFontsInSvg=S7;exports.overrideWorkflowExperienceRecipientAddress=wY;exports.patternImageDataCache=Ds;exports.persistenceService=wr;exports.pictureStepService=D1;exports.pmsToRgb=JB;exports.promiseCache=mf;exports.questionStepService=R1;exports.registerFetchImplementation=R4;exports.registerWindowImplementation=D4;exports.rehydrateSerializedLayout=sA;exports.rgbToPms=sT;exports.rotateAroundPoint=Ld;exports.sanitizeSvgTree=Vg;exports.setApplicationKey=Qk;exports.setBearerAuthenticationToken=Xk;exports.setCanvasModule=WA;exports.shapeStepService=Nu;exports.shortenUrl=rI;exports.skipWorkflowExperienceRecipientAddress=CY;exports.spiffCoreConfiguration=ss;exports.stepAspectValuesToDesignInputSteps=zU;exports.svgColorValueToDefinition=$y;exports.svgStringDimensions=S1;exports.svgToDataUrl=Ug;exports.textStepService=ri;exports.toHex=Ao;exports.toUtf8=em;exports.toast=iI;exports.validateWorkflowExperienceRecipient=AY;exports.validateWorkflowExperienceRecipients=bY;exports.xmlSerializer=Do;
|
|
3269
|
-
//# sourceMappingURL=index-
|
|
3269
|
+
//# sourceMappingURL=index-CIPNLGSC.cjs.map
|