@mappedin/react-sdk 6.0.1-beta.35 → 6.0.1-beta.37
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/THIRD_PARTY_LICENSES.txt +36 -1
- package/lib/esm/{GLTFExporter-BDGPNYHM.js → GLTFExporter-3DPEZKOC.js} +1 -1
- package/lib/esm/{GLTFLoader-2GIBUHIX.js → GLTFLoader-FNDPGHTV.js} +1 -1
- package/lib/esm/{browser-4UXHM37M.js → browser-PUDTREP5.js} +1 -1
- package/lib/esm/{chunk-QF4V22LW.js → chunk-7H7HYUVU.js} +1 -1
- package/lib/esm/{chunk-LYRA4TKN.js → chunk-CBBFEVN4.js} +1 -1
- package/lib/esm/chunk-PFDTT6ZZ.js +1 -0
- package/lib/esm/{chunk-I3XTLF7N.js → chunk-RGA6MUTU.js} +1 -1
- package/lib/esm/{chunk-O3IJUOIG.js → chunk-S7CLJZMO.js} +1 -1
- package/lib/esm/chunk-YP5ZSRNK.js +1 -0
- package/lib/esm/index.d.ts +244 -227
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-MHWKNZ6X.js → inspector-4J34N3O3.js} +1 -1
- package/lib/esm/{internal-Q6AOCG2U.js → internal-OHZQTK3N.js} +1 -1
- package/lib/esm/{outdoor-context-v4-RYTQRCM2.js → outdoor-context-v4-VQWUPKMU.js} +1 -1
- package/lib/esm/{text3d-MHMEA6G6.js → text3d-ZXEDJBSG.js} +1 -1
- package/package.json +2 -2
- package/lib/esm/chunk-CTVNP4EF.js +0 -1
- package/lib/esm/chunk-GAQJPOTZ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Z as An,pa as ze}from"./chunk-GAQJPOTZ.js";import"./chunk-I3XTLF7N.js";import"./chunk-QF4V22LW.js";import{Aa as Yt,B as gn,D as mn,E as ot,F as yn,Ga as Sn,Ha as wn,I as bn,J as Sr,M as He,N as wr,O as xn,P as Ft,S as Mt,U as Tn,Wa as Fn,X as At,Z as _n,cb as Mn,e as kr,ha as kn,ja as Un,m as Ur,q as dn,r as vn,x as pn}from"./chunk-LYRA4TKN.js";import{a as Ie,b as Qe}from"./chunk-O3IJUOIG.js";import{a as p}from"./chunk-J5IUISYU.js";Ie();Ie();Ie();function da(){var h=Object.create(null);function r(t,e){var a=t.id,o=t.name,n=t.dependencies;n===void 0&&(n=[]);var i=t.init;i===void 0&&(i=p(function(){},"init"));var s=t.getTransferables;if(s===void 0&&(s=null),!h[a])try{n=n.map(function(u){return u&&u.isWorkerModule&&(r(u,function(c){if(c instanceof Error)throw c}),u=h[u.id].value),u}),i=f("<"+o+">.init",i),s&&(s=f("<"+o+">.getTransferables",s));var l=null;typeof i=="function"?l=i.apply(void 0,n):console.error("worker module init function failed to rehydrate"),h[a]={id:a,value:l,getTransferables:s},e(l)}catch(u){u&&u.noLog||console.error(u),e(u)}}p(r,"registerModule");function d(t,e){var a,o=t.id,n=t.args;(!h[o]||typeof h[o].value!="function")&&e(new Error("Worker module "+o+": not found or its 'init' did not return a function"));try{var i=(a=h[o]).value.apply(a,n);i&&typeof i.then=="function"?i.then(s,function(l){return e(l instanceof Error?l:new Error(""+l))}):s(i)}catch(l){e(l)}function s(l){try{var u=h[o].getTransferables&&h[o].getTransferables(l);(!u||!Array.isArray(u)||!u.length)&&(u=void 0),e(l,u)}catch(c){console.error(c),e(c)}}p(s,"handleResult")}p(d,"callModule");function f(t,e){var a=void 0;self.troikaDefine=function(n){return a=n};var o=URL.createObjectURL(new Blob(["/** "+t.replace(/\*/g,"")+" **/\n\ntroikaDefine(\n"+e+"\n)"],{type:"application/javascript"}));try{importScripts(o)}catch(n){console.error(n)}return URL.revokeObjectURL(o),delete self.troikaDefine,a}p(f,"rehydrate"),self.addEventListener("message",function(t){var e=t.data,a=e.messageId,o=e.action,n=e.data;try{o==="registerModule"&&r(n,function(i){i instanceof Error?postMessage({messageId:a,success:!1,error:i.message}):postMessage({messageId:a,success:!0,result:{isCallable:typeof i=="function"}})}),o==="callModule"&&d(n,function(i,s){i instanceof Error?postMessage({messageId:a,success:!1,error:i.message}):postMessage({messageId:a,success:!0,result:i},s||void 0)})}catch(i){postMessage({messageId:a,success:!1,error:i.stack})}})}p(da,"workerBootstrap");function va(h){var r=p(function(){for(var d=[],f=arguments.length;f--;)d[f]=arguments[f];return r._getInitResult().then(function(t){if(typeof t=="function")return t.apply(void 0,d);throw new Error("Worker module function was called but `init` did not return a callable function")})},"moduleFunc");return r._getInitResult=function(){var d=h.dependencies,f=h.init;d=Array.isArray(d)?d.map(function(e){return e&&(e=e.onMainThread||e,e._getInitResult&&(e=e._getInitResult())),e}):[];var t=Promise.all(d).then(function(e){return f.apply(null,e)});return r._getInitResult=function(){return t},t},r}p(va,"defineMainThreadModule");var Cn=p(function(){var h=!1;if(typeof window<"u"&&typeof window.document<"u")try{var r=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));r.terminate(),h=!0}catch(d){typeof Qe<"u"&&Qe.env.NODE_ENV==="test"||console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+d.message+"]")}return Cn=p(function(){return h},"supportsWorkers"),h},"supportsWorkers"),pa=0,ga=0,Fr=!1,Dt=Object.create(null),Ct=Object.create(null),Mr=Object.create(null);function it(h){if((!h||typeof h.init!="function")&&!Fr)throw new Error("requires `options.init` function");var r=h.dependencies,d=h.init,f=h.getTransferables,t=h.workerId,e=va(h);t==null&&(t="#default");var a="workerModule"+ ++pa,o=h.name||a,n=null;r=r&&r.map(function(s){return typeof s=="function"&&!s.workerModuleData&&(Fr=!0,s=it({workerId:t,name:"<"+o+"> function dependency: "+s.name,init:"function(){return (\n"+Jt(s)+"\n)}"}),Fr=!1),s&&s.workerModuleData&&(s=s.workerModuleData),s});function i(){for(var s=[],l=arguments.length;l--;)s[l]=arguments[l];if(!Cn())return e.apply(void 0,s);if(!n){n=Dn(t,"registerModule",i.workerModuleData);var u=p(function(){n=null,Ct[t].delete(u)},"unregister");(Ct[t]||(Ct[t]=new Set)).add(u)}return n.then(function(c){var g=c.isCallable;if(g)return Dn(t,"callModule",{id:a,args:s});throw new Error("Worker module function was called but `init` did not return a callable function")})}return p(i,"moduleFunc"),i.workerModuleData={isWorkerModule:!0,id:a,name:o,dependencies:r,init:Jt(d),getTransferables:f&&Jt(f)},i.onMainThread=e,i}p(it,"defineWorkerModule");function En(h){Ct[h]&&Ct[h].forEach(function(r){r()}),Dt[h]&&(Dt[h].terminate(),delete Dt[h])}p(En,"terminateWorker");function Jt(h){var r=h.toString();return!/^function/.test(r)&&/^\w+\s*\(/.test(r)&&(r="function "+r),r}p(Jt,"stringifyFunction");function ma(h){var r=Dt[h];if(!r){var d=Jt(da);r=Dt[h]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+h.replace(/\*/g,"")+" **/\n\n;("+d+")()"],{type:"application/javascript"}))),r.onmessage=function(f){var t=f.data,e=t.messageId,a=Mr[e];if(!a)throw new Error("WorkerModule response with empty or unknown messageId");delete Mr[e],a(t)}}return r}p(ma,"getWorker");function Dn(h,r,d){return new Promise(function(f,t){var e=++ga;Mr[e]=function(a){a.success?f(a.result):t(new Error("Error in worker "+r+" call: "+a.error))},ma(h).postMessage({messageId:e,action:r,data:d})})}p(Dn,"callWorker");Ie();function Ar(){var h=function(r){function d(I,R,v,T,M,C,k,N){var E=1-k;N.x=E*E*I+2*E*k*v+k*k*M,N.y=E*E*R+2*E*k*T+k*k*C}p(d,"pointOnQuadraticBezier");function f(I,R,v,T,M,C,k,N,E,z){var J=1-E;z.x=J*J*J*I+3*J*J*E*v+3*J*E*E*M+E*E*E*k,z.y=J*J*J*R+3*J*J*E*T+3*J*E*E*C+E*E*E*N}p(f,"pointOnCubicBezier");function t(I,R){for(var v=/([MLQCZ])([^MLQCZ]*)/g,T,M,C,k,N;T=v.exec(I);){var E=T[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(z){return parseFloat(z)});switch(T[1]){case"M":k=M=E[0],N=C=E[1];break;case"L":(E[0]!==k||E[1]!==N)&&R("L",k,N,k=E[0],N=E[1]);break;case"Q":{R("Q",k,N,k=E[2],N=E[3],E[0],E[1]);break}case"C":{R("C",k,N,k=E[4],N=E[5],E[0],E[1],E[2],E[3]);break}case"Z":(k!==M||N!==C)&&R("L",k,N,M,C);break}}}p(t,"forEachPathCommand");function e(I,R,v){v===void 0&&(v=16);var T={x:0,y:0};t(I,function(M,C,k,N,E,z,J,ee,H){switch(M){case"L":R(C,k,N,E);break;case"Q":{for(var V=C,ge=k,ce=1;ce<v;ce++)d(C,k,z,J,N,E,ce/(v-1),T),R(V,ge,T.x,T.y),V=T.x,ge=T.y;break}case"C":{for(var q=C,te=k,le=1;le<v;le++)f(C,k,z,J,ee,H,N,E,le/(v-1),T),R(q,te,T.x,T.y),q=T.x,te=T.y;break}}})}p(e,"pathToLineSegments");var a="precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",o="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",n=new WeakMap,i={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function s(I,R){var v=I.getContext?I.getContext("webgl",i):I,T=n.get(v);if(!T){let J=function(q){var te=C[q];if(!te&&(te=C[q]=v.getExtension(q),!te))throw new Error(q+" not supported");return te},ee=function(q,te){var le=v.createShader(te);return v.shaderSource(le,q),v.compileShader(le),le},H=function(q,te,le,X){if(!k[q]){var re={},$={},G=v.createProgram();v.attachShader(G,ee(te,v.VERTEX_SHADER)),v.attachShader(G,ee(le,v.FRAGMENT_SHADER)),v.linkProgram(G),k[q]={program:G,transaction:p(function(Q){v.useProgram(G),Q({setUniform:p(function(K,xe){for(var ne=[],oe=arguments.length-2;oe-- >0;)ne[oe]=arguments[oe+2];var ue=$[xe]||($[xe]=v.getUniformLocation(G,xe));v["uniform"+K].apply(v,[ue].concat(ne))},"setUniform"),setAttribute:p(function(K,xe,ne,oe,ue){var ve=re[K];ve||(ve=re[K]={buf:v.createBuffer(),loc:v.getAttribLocation(G,K),data:null}),v.bindBuffer(v.ARRAY_BUFFER,ve.buf),v.vertexAttribPointer(ve.loc,xe,v.FLOAT,!1,0,0),v.enableVertexAttribArray(ve.loc),M?v.vertexAttribDivisor(ve.loc,oe):J("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(ve.loc,oe),ue!==ve.data&&(v.bufferData(v.ARRAY_BUFFER,ue,ne),ve.data=ue)},"setAttribute")})},"transaction")}}k[q].transaction(X)},V=function(q,te){E++;try{v.activeTexture(v.TEXTURE0+E);var le=N[q];le||(le=N[q]=v.createTexture(),v.bindTexture(v.TEXTURE_2D,le),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,v.NEAREST),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,v.NEAREST)),v.bindTexture(v.TEXTURE_2D,le),te(le,E)}finally{E--}},ge=function(q,te,le){var X=v.createFramebuffer();z.push(X),v.bindFramebuffer(v.FRAMEBUFFER,X),v.activeTexture(v.TEXTURE0+te),v.bindTexture(v.TEXTURE_2D,q),v.framebufferTexture2D(v.FRAMEBUFFER,v.COLOR_ATTACHMENT0,v.TEXTURE_2D,q,0);try{le(X)}finally{v.deleteFramebuffer(X),v.bindFramebuffer(v.FRAMEBUFFER,z[--z.length-1]||null)}},ce=function(){C={},k={},N={},E=-1,z.length=0};p(J,"getExtension"),p(ee,"compileShader"),p(H,"withProgram"),p(V,"withTexture"),p(ge,"withTextureFramebuffer"),p(ce,"handleContextLoss");var M=typeof WebGL2RenderingContext<"u"&&v instanceof WebGL2RenderingContext,C={},k={},N={},E=-1,z=[];v.canvas.addEventListener("webglcontextlost",function(q){ce(),q.preventDefault()},!1),n.set(v,T={gl:v,isWebGL2:M,getExtension:J,withProgram:H,withTexture:V,withTextureFramebuffer:ge,handleContextLoss:ce})}R(T)}p(s,"withWebGLContext");function l(I,R,v,T,M,C,k,N){k===void 0&&(k=15),N===void 0&&(N=null),s(I,function(E){var z=E.gl,J=E.withProgram,ee=E.withTexture;ee("copy",function(H,V){z.texImage2D(z.TEXTURE_2D,0,z.RGBA,M,C,0,z.RGBA,z.UNSIGNED_BYTE,R),J("copy",a,o,function(ge){var ce=ge.setUniform,q=ge.setAttribute;q("aUV",2,z.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),ce("1i","image",V),z.bindFramebuffer(z.FRAMEBUFFER,N||null),z.disable(z.BLEND),z.colorMask(k&8,k&4,k&2,k&1),z.viewport(v,T,M,C),z.scissor(v,T,M,C),z.drawArrays(z.TRIANGLES,0,3)})})})}p(l,"renderImageData");function u(I,R,v){var T=I.width,M=I.height;s(I,function(C){var k=C.gl,N=new Uint8Array(T*M*4);k.readPixels(0,0,T,M,k.RGBA,k.UNSIGNED_BYTE,N),I.width=R,I.height=v,l(k,N,0,0,T,M)})}p(u,"resizeWebGLCanvasWithoutClearing");var c=Object.freeze({__proto__:null,withWebGLContext:s,renderImageData:l,resizeWebGLCanvasWithoutClearing:u});function g(I,R,v,T,M,C){C===void 0&&(C=1);var k=new Uint8Array(I*R),N=T[2]-T[0],E=T[3]-T[1],z=[];e(v,function(q,te,le,X){z.push({x1:q,y1:te,x2:le,y2:X,minX:Math.min(q,le),minY:Math.min(te,X),maxX:Math.max(q,le),maxY:Math.max(te,X)})}),z.sort(function(q,te){return q.maxX-te.maxX});for(var J=0;J<I;J++)for(var ee=0;ee<R;ee++){var H=ge(T[0]+N*(J+.5)/I,T[1]+E*(ee+.5)/R),V=Math.pow(1-Math.abs(H)/M,C)/2;H<0&&(V=1-V),V=Math.max(0,Math.min(255,Math.round(V*255))),k[ee*I+J]=V}return k;function ge(q,te){for(var le=1/0,X=1/0,re=z.length;re--;){var $=z[re];if($.maxX+X<=q)break;if(q+X>$.minX&&te-X<$.maxY&&te+X>$.minY){var G=L(q,te,$.x1,$.y1,$.x2,$.y2);G<le&&(le=G,X=Math.sqrt(le))}}return ce(q,te)&&(X=-X),X}function ce(q,te){for(var le=0,X=z.length;X--;){var re=z[X];if(re.maxX<=q)break;var $=re.y1>te!=re.y2>te&&q<(re.x2-re.x1)*(te-re.y1)/(re.y2-re.y1)+re.x1;$&&(le+=re.y1<re.y2?1:-1)}return le!==0}}p(g,"generate$2");function m(I,R,v,T,M,C,k,N,E,z){C===void 0&&(C=1),N===void 0&&(N=0),E===void 0&&(E=0),z===void 0&&(z=0),b(I,R,v,T,M,C,k,null,N,E,z)}p(m,"generateIntoCanvas$2");function b(I,R,v,T,M,C,k,N,E,z,J){C===void 0&&(C=1),E===void 0&&(E=0),z===void 0&&(z=0),J===void 0&&(J=0);for(var ee=g(I,R,v,T,M,C),H=new Uint8Array(ee.length*4),V=0;V<ee.length;V++)H[V*4+J]=ee[V];l(k,H,E,z,I,R,1<<3-J,N)}p(b,"generateIntoFramebuffer$1");function L(I,R,v,T,M,C){var k=M-v,N=C-T,E=k*k+N*N,z=E?Math.max(0,Math.min(1,((I-v)*k+(R-T)*N)/E)):0,J=I-(v+z*k),ee=R-(T+z*N);return J*J+ee*ee}p(L,"absSquareDistanceToLineSegment");var F=Object.freeze({__proto__:null,generate:g,generateIntoCanvas:m,generateIntoFramebuffer:b}),U="precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",_="precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}",S="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}",D=new Float32Array([0,0,2,0,0,2]),x=null,A=!1,W={},B=new WeakMap;function Y(I){if(!A&&!j(I))throw new Error("WebGL generation not supported")}p(Y,"validateSupport");function y(I,R,v,T,M,C,k){if(C===void 0&&(C=1),k===void 0&&(k=null),!k&&(k=x,!k)){var N=typeof OffscreenCanvas=="function"?new OffscreenCanvas(1,1):typeof document<"u"?document.createElement("canvas"):null;if(!N)throw new Error("OffscreenCanvas or DOM canvas not supported");k=x=N.getContext("webgl",{depth:!1})}Y(k);var E=new Uint8Array(I*R*4);s(k,function(H){var V=H.gl,ge=H.withTexture,ce=H.withTextureFramebuffer;ge("readable",function(q,te){V.texImage2D(V.TEXTURE_2D,0,V.RGBA,I,R,0,V.RGBA,V.UNSIGNED_BYTE,null),ce(q,te,function(le){w(I,R,v,T,M,C,V,le,0,0,0),V.readPixels(0,0,I,R,V.RGBA,V.UNSIGNED_BYTE,E)})})});for(var z=new Uint8Array(I*R),J=0,ee=0;J<E.length;J+=4)z[ee++]=E[J];return z}p(y,"generate$1");function O(I,R,v,T,M,C,k,N,E,z){C===void 0&&(C=1),N===void 0&&(N=0),E===void 0&&(E=0),z===void 0&&(z=0),w(I,R,v,T,M,C,k,null,N,E,z)}p(O,"generateIntoCanvas$1");function w(I,R,v,T,M,C,k,N,E,z,J){C===void 0&&(C=1),E===void 0&&(E=0),z===void 0&&(z=0),J===void 0&&(J=0),Y(k);var ee=[];e(v,function(H,V,ge,ce){ee.push(H,V,ge,ce)}),ee=new Float32Array(ee),s(k,function(H){var V=H.gl,ge=H.isWebGL2,ce=H.getExtension,q=H.withProgram,te=H.withTexture,le=H.withTextureFramebuffer,X=H.handleContextLoss;if(te("rawDistances",function(re,$){(I!==re._lastWidth||R!==re._lastHeight)&&V.texImage2D(V.TEXTURE_2D,0,V.RGBA,re._lastWidth=I,re._lastHeight=R,0,V.RGBA,V.UNSIGNED_BYTE,null),q("main",U,_,function(G){var de=G.setAttribute,Q=G.setUniform,ae=!ge&&ce("ANGLE_instanced_arrays"),K=!ge&&ce("EXT_blend_minmax");de("aUV",2,V.STATIC_DRAW,0,D),de("aLineSegment",4,V.DYNAMIC_DRAW,1,ee),Q.apply(void 0,["4f","uGlyphBounds"].concat(T)),Q("1f","uMaxDistance",M),Q("1f","uExponent",C),le(re,$,function(xe){V.enable(V.BLEND),V.colorMask(!0,!0,!0,!0),V.viewport(0,0,I,R),V.scissor(0,0,I,R),V.blendFunc(V.ONE,V.ONE),V.blendEquationSeparate(V.FUNC_ADD,ge?V.MAX:K.MAX_EXT),V.clear(V.COLOR_BUFFER_BIT),ge?V.drawArraysInstanced(V.TRIANGLES,0,3,ee.length/4):ae.drawArraysInstancedANGLE(V.TRIANGLES,0,3,ee.length/4)})}),q("post",a,S,function(G){G.setAttribute("aUV",2,V.STATIC_DRAW,0,D),G.setUniform("1i","tex",$),V.bindFramebuffer(V.FRAMEBUFFER,N),V.disable(V.BLEND),V.colorMask(J===0,J===1,J===2,J===3),V.viewport(E,z,I,R),V.scissor(E,z,I,R),V.drawArrays(V.TRIANGLES,0,3)})}),V.isContextLost())throw X(),new Error("webgl context lost")})}p(w,"generateIntoFramebuffer");function j(I){var R=!I||I===x?W:I.canvas||I,v=B.get(R);if(v===void 0){A=!0;var T=null;try{var M=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],C=y(4,4,"M8,8L16,8L24,24L16,24Z",[0,0,32,32],24,1,I);v=C&&M.length===C.length&&C.every(function(k,N){return k===M[N]}),v||(T="bad trial run results",console.info(M,C))}catch(k){v=!1,T=k.message}T&&console.warn("WebGL SDF generation not supported:",T),A=!1,B.set(R,v)}return v}p(j,"isSupported");var P=Object.freeze({__proto__:null,generate:y,generateIntoCanvas:O,generateIntoFramebuffer:w,isSupported:j});function Z(I,R,v,T,M,C){M===void 0&&(M=Math.max(T[2]-T[0],T[3]-T[1])/2),C===void 0&&(C=1);try{return y.apply(P,arguments)}catch(k){return console.info("WebGL SDF generation failed, falling back to JS",k),g.apply(F,arguments)}}p(Z,"generate");function se(I,R,v,T,M,C,k,N,E,z){M===void 0&&(M=Math.max(T[2]-T[0],T[3]-T[1])/2),C===void 0&&(C=1),N===void 0&&(N=0),E===void 0&&(E=0),z===void 0&&(z=0);try{return O.apply(P,arguments)}catch(J){return console.info("WebGL SDF generation failed, falling back to JS",J),m.apply(F,arguments)}}return p(se,"generateIntoCanvas"),r.forEachPathCommand=t,r.generate=Z,r.generateIntoCanvas=se,r.javascript=F,r.pathToLineSegments=e,r.webgl=P,r.webglUtils=c,Object.defineProperty(r,"__esModule",{value:!0}),r}({});return h}p(Ar,"SDFGenerator");Ie();function ya(){var h=function(r){var d={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},f={},t={};f.L=1,t[1]="L",Object.keys(d).forEach(function(X,re){f[X]=1<<re+1,t[f[X]]=X}),Object.freeze(f);var e=f.LRI|f.RLI|f.FSI,a=f.L|f.R|f.AL,o=f.B|f.S|f.WS|f.ON|f.FSI|f.LRI|f.RLI|f.PDI,n=f.BN|f.RLE|f.LRE|f.RLO|f.LRO|f.PDF,i=f.S|f.WS|f.B|e|f.PDI|n,s=null;function l(){if(!s){s=new Map;var X=p(function($){if(d.hasOwnProperty($)){var G=0;d[$].split(",").forEach(function(de){var Q=de.split("+"),ae=Q[0],K=Q[1];ae=parseInt(ae,36),K=K?parseInt(K,36):0,s.set(G+=ae,f[$]);for(var xe=0;xe<K;xe++)s.set(++G,f[$])})}},"loop");for(var re in d)X(re)}}p(l,"parseData");function u(X){return l(),s.get(X.codePointAt(0))||f.L}p(u,"getBidiCharType");function c(X){return t[u(X)]}p(c,"getBidiCharTypeName");var g={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function m(X,re){var $=36,G=0,de=new Map,Q=re&&new Map,ae;return X.split(",").forEach(p(function K(xe){if(xe.indexOf("+")!==-1)for(var ne=+xe;ne--;)K(ae);else{ae=xe;var oe=xe.split(">"),ue=oe[0],ve=oe[1];ue=String.fromCodePoint(G+=parseInt(ue,$)),ve=String.fromCodePoint(G+=parseInt(ve,$)),de.set(ue,ve),re&&Q.set(ve,ue)}},"visit")),{map:de,reverseMap:Q}}p(m,"parseCharacterMap");var b,L,F;function U(){if(!b){var X=m(g.pairs,!0),re=X.map,$=X.reverseMap;b=re,L=$,F=m(g.canonical,!1).map}}p(U,"parse$1");function _(X){return U(),b.get(X)||null}p(_,"openingToClosingBracket");function S(X){return U(),L.get(X)||null}p(S,"closingToOpeningBracket");function D(X){return U(),F.get(X)||null}p(D,"getCanonicalBracket");var x=f.L,A=f.R,W=f.EN,B=f.ES,Y=f.ET,y=f.AN,O=f.CS,w=f.B,j=f.S,P=f.ON,Z=f.BN,se=f.NSM,I=f.AL,R=f.LRO,v=f.RLO,T=f.LRE,M=f.RLE,C=f.PDF,k=f.LRI,N=f.RLI,E=f.FSI,z=f.PDI;function J(X,re){for(var $=125,G=new Uint32Array(X.length),de=0;de<X.length;de++)G[de]=u(X[de]);var Q=new Map;function ae(Ge,je){var Pe=G[Ge];G[Ge]=je,Q.set(Pe,Q.get(Pe)-1),Pe&o&&Q.set(o,Q.get(o)-1),Q.set(je,(Q.get(je)||0)+1),je&o&&Q.set(o,(Q.get(o)||0)+1)}p(ae,"changeCharType");for(var K=new Uint8Array(X.length),xe=new Map,ne=[],oe=null,ue=0;ue<X.length;ue++)oe||ne.push(oe={start:ue,end:X.length-1,level:re==="rtl"?1:re==="ltr"?0:cn(ue,!1)}),G[ue]&w&&(oe.end=ue,oe=null);for(var ve=M|T|v|R|e|z|C|w,ke=p(function(Ge){return Ge+(Ge&1?1:2)},"nextEven"),Ae=p(function(Ge){return Ge+(Ge&1?2:1)},"nextOdd"),me=0;me<ne.length;me++){oe=ne[me];var ye=[{_level:oe.level,_override:0,_isolate:0}],fe=void 0,Se=0,we=0,Le=0;Q.clear();for(var Ue=oe.start;Ue<=oe.end;Ue++){var he=G[Ue];if(fe=ye[ye.length-1],Q.set(he,(Q.get(he)||0)+1),he&o&&Q.set(o,(Q.get(o)||0)+1),he&ve)if(he&(M|T)){K[Ue]=fe._level;var Te=(he===M?Ae:ke)(fe._level);Te<=$&&!Se&&!we?ye.push({_level:Te,_override:0,_isolate:0}):Se||we++}else if(he&(v|R)){K[Ue]=fe._level;var Ze=(he===v?Ae:ke)(fe._level);Ze<=$&&!Se&&!we?ye.push({_level:Ze,_override:he&v?A:x,_isolate:0}):Se||we++}else if(he&e){he&E&&(he=cn(Ue+1,!0)===1?N:k),K[Ue]=fe._level,fe._override&&ae(Ue,fe._override);var _e=(he===N?Ae:ke)(fe._level);_e<=$&&Se===0&&we===0?(Le++,ye.push({_level:_e,_override:0,_isolate:1,_isolInitIndex:Ue})):Se++}else if(he&z){if(Se>0)Se--;else if(Le>0){for(we=0;!ye[ye.length-1]._isolate;)ye.pop();var be=ye[ye.length-1]._isolInitIndex;be!=null&&(xe.set(be,Ue),xe.set(Ue,be)),ye.pop(),Le--}fe=ye[ye.length-1],K[Ue]=fe._level,fe._override&&ae(Ue,fe._override)}else he&C?(Se===0&&(we>0?we--:!fe._isolate&&ye.length>1&&(ye.pop(),fe=ye[ye.length-1])),K[Ue]=fe._level):he&w&&(K[Ue]=oe.level);else K[Ue]=fe._level,fe._override&&he!==Z&&ae(Ue,fe._override)}for(var De=[],Fe=null,pe=oe.start;pe<=oe.end;pe++){var Me=G[pe];if(!(Me&n)){var Oe=K[pe],Be=Me&e,Ce=Me===z;Fe&&Oe===Fe._level?(Fe._end=pe,Fe._endsWithIsolInit=Be):De.push(Fe={_start:pe,_end:pe,_level:Oe,_startsWithPDI:Ce,_endsWithIsolInit:Be})}}for(var Ne=[],qe=0;qe<De.length;qe++){var Je=De[qe];if(!Je._startsWithPDI||Je._startsWithPDI&&!xe.has(Je._start)){for(var $e=[Fe=Je],nt=void 0;Fe&&Fe._endsWithIsolInit&&(nt=xe.get(Fe._end))!=null;)for(var Ke=qe+1;Ke<De.length;Ke++)if(De[Ke]._start===nt){$e.push(Fe=De[Ke]);break}for(var Re=[],at=0;at<$e.length;at++)for(var jr=$e[at],nr=jr._start;nr<=jr._end;nr++)Re.push(nr);for(var sa=K[Re[0]],Xr=oe.level,Ot=Re[0]-1;Ot>=0;Ot--)if(!(G[Ot]&n)){Xr=K[Ot];break}var ar=Re[Re.length-1],la=K[ar],Hr=oe.level;if(!(G[ar]&e)){for(var Rt=ar+1;Rt<=oe.end;Rt++)if(!(G[Rt]&n)){Hr=K[Rt];break}}Ne.push({_seqIndices:Re,_sosType:Math.max(Xr,sa)%2?A:x,_eosType:Math.max(Hr,la)%2?A:x})}}for(var or=0;or<Ne.length;or++){var ir=Ne[or],ie=ir._seqIndices,mt=ir._sosType,fa=ir._eosType,ut=K[ie[0]]&1?A:x;if(Q.get(se))for(var Lt=0;Lt<ie.length;Lt++){var Yr=ie[Lt];if(G[Yr]&se){for(var sr=mt,Gt=Lt-1;Gt>=0;Gt--)if(!(G[ie[Gt]]&n)){sr=G[ie[Gt]];break}ae(Yr,sr&(e|z)?P:sr)}}if(Q.get(W))for(var Pt=0;Pt<ie.length;Pt++){var Jr=ie[Pt];if(G[Jr]&W)for(var It=Pt-1;It>=-1;It--){var Kr=It===-1?mt:G[ie[It]];if(Kr&a){Kr===I&&ae(Jr,y);break}}}if(Q.get(I))for(var lr=0;lr<ie.length;lr++){var Qr=ie[lr];G[Qr]&I&&ae(Qr,A)}if(Q.get(B)||Q.get(O))for(var yt=1;yt<ie.length-1;yt++){var fr=ie[yt];if(G[fr]&(B|O)){for(var ct=0,ur=0,cr=yt-1;cr>=0&&(ct=G[ie[cr]],!!(ct&n));cr--);for(var hr=yt+1;hr<ie.length&&(ur=G[ie[hr]],!!(ur&n));hr++);ct===ur&&(G[fr]===B?ct===W:ct&(W|y))&&ae(fr,ct)}}if(Q.get(W))for(var Xe=0;Xe<ie.length;Xe++){var ua=ie[Xe];if(G[ua]&W){for(var zt=Xe-1;zt>=0&&G[ie[zt]]&(Y|n);zt--)ae(ie[zt],W);for(Xe++;Xe<ie.length&&G[ie[Xe]]&(Y|n|W);Xe++)G[ie[Xe]]!==W&&ae(ie[Xe],W)}}if(Q.get(Y)||Q.get(B)||Q.get(O))for(var bt=0;bt<ie.length;bt++){var Zr=ie[bt];if(G[Zr]&(Y|B|O)){ae(Zr,P);for(var Wt=bt-1;Wt>=0&&G[ie[Wt]]&n;Wt--)ae(ie[Wt],P);for(var Nt=bt+1;Nt<ie.length&&G[ie[Nt]]&n;Nt++)ae(ie[Nt],P)}}if(Q.get(W))for(var dr=0,qr=mt;dr<ie.length;dr++){var $r=ie[dr],vr=G[$r];vr&W?qr===x&&ae($r,x):vr&a&&(qr=vr)}if(Q.get(o)){var xt=A|W|y,en=xt|x,Vt=[];{for(var ht=[],dt=0;dt<ie.length;dt++)if(G[ie[dt]]&o){var Tt=X[ie[dt]],tn=void 0;if(_(Tt)!==null)if(ht.length<63)ht.push({char:Tt,seqIndex:dt});else break;else if((tn=S(Tt))!==null)for(var _t=ht.length-1;_t>=0;_t--){var pr=ht[_t].char;if(pr===tn||pr===S(D(Tt))||_(D(pr))===Tt){Vt.push([ht[_t].seqIndex,dt]),ht.length=_t;break}}}Vt.sort(function(Ge,je){return Ge[0]-je[0]})}for(var gr=0;gr<Vt.length;gr++){for(var rn=Vt[gr],jt=rn[0],mr=rn[1],nn=!1,Ve=0,yr=jt+1;yr<mr;yr++){var an=ie[yr];if(G[an]&en){nn=!0;var on=G[an]&xt?A:x;if(on===ut){Ve=on;break}}}if(nn&&!Ve){Ve=mt;for(var br=jt-1;br>=0;br--){var sn=ie[br];if(G[sn]&en){var ln=G[sn]&xt?A:x;ln!==ut?Ve=ln:Ve=ut;break}}}if(Ve){if(G[ie[jt]]=G[ie[mr]]=Ve,Ve!==ut){for(var kt=jt+1;kt<ie.length;kt++)if(!(G[ie[kt]]&n)){u(X[ie[kt]])&se&&(G[ie[kt]]=Ve);break}}if(Ve!==ut){for(var Ut=mr+1;Ut<ie.length;Ut++)if(!(G[ie[Ut]]&n)){u(X[ie[Ut]])&se&&(G[ie[Ut]]=Ve);break}}}}for(var et=0;et<ie.length;et++)if(G[ie[et]]&o){for(var fn=et,xr=et,Tr=mt,St=et-1;St>=0;St--)if(G[ie[St]]&n)fn=St;else{Tr=G[ie[St]]&xt?A:x;break}for(var un=fa,wt=et+1;wt<ie.length;wt++)if(G[ie[wt]]&(o|n))xr=wt;else{un=G[ie[wt]]&xt?A:x;break}for(var _r=fn;_r<=xr;_r++)G[ie[_r]]=Tr===un?Tr:ut;et=xr}}}for(var We=oe.start;We<=oe.end;We++){var ca=K[We],Xt=G[We];if(ca&1?Xt&(x|W|y)&&K[We]++:Xt&A?K[We]++:Xt&(y|W)&&(K[We]+=2),Xt&n&&(K[We]=We===0?oe.level:K[We-1]),We===oe.end||u(X[We])&(j|w))for(var Ht=We;Ht>=0&&u(X[Ht])&i;Ht--)K[Ht]=oe.level}}return{levels:K,paragraphs:ne};function cn(Ge,je){for(var Pe=Ge;Pe<X.length;Pe++){var tt=G[Pe];if(tt&(A|I))return 1;if(tt&(w|x)||je&&tt===z)return 0;if(tt&e){var hn=ha(Pe);Pe=hn===-1?X.length:hn}}return 0}function ha(Ge){for(var je=1,Pe=Ge+1;Pe<X.length;Pe++){var tt=G[Pe];if(tt&w)break;if(tt&z){if(--je===0)return Pe}else tt&e&&je++}return-1}}p(J,"getEmbeddingLevels");var ee="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",H;function V(){if(!H){var X=m(ee,!0),re=X.map,$=X.reverseMap;$.forEach(function(G,de){re.set(de,G)}),H=re}}p(V,"parse");function ge(X){return V(),H.get(X)||null}p(ge,"getMirroredCharacter");function ce(X,re,$,G){var de=X.length;$=Math.max(0,$==null?0:+$),G=Math.min(de-1,G==null?de-1:+G);for(var Q=new Map,ae=$;ae<=G;ae++)if(re[ae]&1){var K=ge(X[ae]);K!==null&&Q.set(ae,K)}return Q}p(ce,"getMirroredCharactersMap");function q(X,re,$,G){var de=X.length;$=Math.max(0,$==null?0:+$),G=Math.min(de-1,G==null?de-1:+G);var Q=[];return re.paragraphs.forEach(function(ae){var K=Math.max($,ae.start),xe=Math.min(G,ae.end);if(K<xe){for(var ne=re.levels.slice(K,xe+1),oe=xe;oe>=K&&u(X[oe])&i;oe--)ne[oe]=ae.level;for(var ue=ae.level,ve=1/0,ke=0;ke<ne.length;ke++){var Ae=ne[ke];Ae>ue&&(ue=Ae),Ae<ve&&(ve=Ae|1)}for(var me=ue;me>=ve;me--)for(var ye=0;ye<ne.length;ye++)if(ne[ye]>=me){for(var fe=ye;ye+1<ne.length&&ne[ye+1]>=me;)ye++;ye>fe&&Q.push([fe+K,ye+K])}}}),Q}p(q,"getReorderSegments");function te(X,re,$,G){var de=le(X,re,$,G),Q=[].concat(X);return de.forEach(function(ae,K){Q[K]=(re.levels[ae]&1?ge(X[ae]):null)||X[ae]}),Q.join("")}p(te,"getReorderedString");function le(X,re,$,G){for(var de=q(X,re,$,G),Q=[],ae=0;ae<X.length;ae++)Q[ae]=ae;return de.forEach(function(K){for(var xe=K[0],ne=K[1],oe=Q.slice(xe,ne+1),ue=oe.length;ue--;)Q[ne-ue]=oe[ue]}),Q}return p(le,"getReorderedIndices"),r.closingToOpeningBracket=S,r.getBidiCharType=u,r.getBidiCharTypeName=c,r.getCanonicalBracket=D,r.getEmbeddingLevels=J,r.getMirroredCharacter=ge,r.getMirroredCharactersMap=ce,r.getReorderSegments=q,r.getReorderedIndices=le,r.getReorderedString=te,r.openingToClosingBracket=_,Object.defineProperty(r,"__esModule",{value:!0}),r}({});return h}p(ya,"bidiFactory");var Bn=ya;Ie();var Cr=/\bvoid\s+main\s*\(\s*\)\s*{/g;function Dr(h){let r=/^[ \t]*#include +<([\w\d./]+)>/gm;function d(f,t){let e=Mn[t];return e?Dr(e):f}return p(d,"replace"),h.replace(r,d)}p(Dr,"expandShaderIncludes");var Ee=[];for(let h=0;h<256;h++)Ee[h]=(h<16?"0":"")+h.toString(16);function ba(){let h=Math.random()*4294967295|0,r=Math.random()*4294967295|0,d=Math.random()*4294967295|0,f=Math.random()*4294967295|0;return(Ee[h&255]+Ee[h>>8&255]+Ee[h>>16&255]+Ee[h>>24&255]+"-"+Ee[r&255]+Ee[r>>8&255]+"-"+Ee[r>>16&15|64]+Ee[r>>24&255]+"-"+Ee[d&63|128]+Ee[d>>8&255]+"-"+Ee[d>>16&255]+Ee[d>>24&255]+Ee[f&255]+Ee[f>>8&255]+Ee[f>>16&255]+Ee[f>>24&255]).toUpperCase()}p(ba,"generateUUID");var st=Object.assign||function(){let h=arguments[0];for(let r=1,d=arguments.length;r<d;r++){let f=arguments[r];if(f)for(let t in f)Object.prototype.hasOwnProperty.call(f,t)&&(h[t]=f[t])}return h},xa=Date.now(),On=new WeakMap,Rn=new Map,Ta=1e10;function vt(h,r){let d=Sa(r),f=On.get(h);if(f||On.set(h,f=Object.create(null)),f[d])return new f[d];let t="_onBeforeCompile".concat(d),e=p(function(i,s){h.onBeforeCompile.call(this,i,s);let l=this.customProgramCacheKey()+"|"+i.vertexShader+"|"+i.fragmentShader,u=Rn[l];if(!u){let c=_a(this,i,r,d);u=Rn[l]=c}i.vertexShader=u.vertexShader,i.fragmentShader=u.fragmentShader,st(i.uniforms,this.uniforms),r.timeUniform&&(i.uniforms[r.timeUniform]={get value(){return Date.now()-xa}}),this[t]&&this[t](i)},"onBeforeCompile"),a=p(function(){return o(r.chained?h:h.clone())},"DerivedMaterial"),o=p(function(i){let s=Object.create(i,n);return Object.defineProperty(s,"baseMaterial",{value:h}),Object.defineProperty(s,"id",{value:Ta++}),s.uuid=ba(),s.uniforms=st({},i.uniforms,r.uniforms),s.defines=st({},i.defines,r.defines),s.defines["TROIKA_DERIVED_MATERIAL_".concat(d)]="",s.extensions=st({},i.extensions,r.extensions),s._listeners=void 0,s},"derive"),n={constructor:{value:a},isDerivedMaterial:{value:!0},type:{get:()=>h.type,set:i=>{h.type=i}},isDerivedFrom:{writable:!0,configurable:!0,value:function(i){let s=this.baseMaterial;return i===s||s.isDerivedMaterial&&s.isDerivedFrom(i)||!1}},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return h.customProgramCacheKey()+"|"+d}},onBeforeCompile:{get(){return e},set(i){this[t]=i}},copy:{writable:!0,configurable:!0,value:function(i){return h.copy.call(this,i),!h.isShaderMaterial&&!h.isDerivedMaterial&&(st(this.extensions,i.extensions),st(this.defines,i.defines),st(this.uniforms,_n.clone(i.uniforms))),this}},clone:{writable:!0,configurable:!0,value:function(){let i=new h.constructor;return o(i).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let i=this._depthMaterial;return i||(i=this._depthMaterial=vt(h.isDerivedMaterial?h.getDepthMaterial():new Sn({depthPacking:pn}),r),i.defines.IS_DEPTH_MATERIAL="",i.uniforms=this.uniforms),i}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let i=this._distanceMaterial;return i||(i=this._distanceMaterial=vt(h.isDerivedMaterial?h.getDistanceMaterial():new wn,r),i.defines.IS_DISTANCE_MATERIAL="",i.uniforms=this.uniforms),i}},dispose:{writable:!0,configurable:!0,value(){let{_depthMaterial:i,_distanceMaterial:s}=this;i&&i.dispose(),s&&s.dispose(),h.dispose.call(this)}}};return f[d]=a,new a}p(vt,"createDerivedMaterial");function _a(h,{vertexShader:r,fragmentShader:d},f,t){let{vertexDefs:e,vertexMainIntro:a,vertexMainOutro:o,vertexTransform:n,fragmentDefs:i,fragmentMainIntro:s,fragmentMainOutro:l,fragmentColorTransform:u,customRewriter:c,timeUniform:g}=f;if(e=e||"",a=a||"",o=o||"",i=i||"",s=s||"",l=l||"",(n||c)&&(r=Dr(r)),(u||c)&&(d=d.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm,"\n//!BEGIN_POST_CHUNK $1\n$&\n//!END_POST_CHUNK\n"),d=Dr(d)),c){let m=c({vertexShader:r,fragmentShader:d});r=m.vertexShader,d=m.fragmentShader}if(u){let m=[];d=d.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,b=>(m.push(b),"")),l="".concat(u,"\n").concat(m.join("\n"),"\n").concat(l)}if(g){let m="\nuniform float ".concat(g,";\n");e=m+e,i=m+i}return n&&(r="vec3 troika_position_".concat(t,";\nvec3 troika_normal_").concat(t,";\nvec2 troika_uv_").concat(t,";\n").concat(r,"\n"),e="".concat(e,"\nvoid troikaVertexTransform").concat(t,"(inout vec3 position, inout vec3 normal, inout vec2 uv) {\n ").concat(n,"\n}\n"),a="\ntroika_position_".concat(t," = vec3(position);\ntroika_normal_").concat(t," = vec3(normal);\ntroika_uv_").concat(t," = vec2(uv);\ntroikaVertexTransform").concat(t,"(troika_position_").concat(t,", troika_normal_").concat(t,", troika_uv_").concat(t,");\n").concat(a,"\n"),r=r.replace(/\b(position|normal|uv)\b/g,(m,b,L,F)=>/\battribute\s+vec[23]\s+$/.test(F.substr(0,L))?b:"troika_".concat(b,"_").concat(t)),h.map&&h.map.channel>0||(r=r.replace(/\bMAP_UV\b/g,"troika_uv_".concat(t)))),r=Ln(r,t,e,a,o),d=Ln(d,t,i,s,l),{vertexShader:r,fragmentShader:d}}p(_a,"upgradeShaders");function Ln(h,r,d,f,t){return(f||t||d)&&(h=h.replace(Cr,"\n".concat(d,"\nvoid troikaOrigMain").concat(r,"() {")),h+="\nvoid main() {\n ".concat(f,"\n troikaOrigMain").concat(r,"();\n ").concat(t,"\n}")),h}p(Ln,"injectIntoShaderCode");function ka(h,r){return h==="uniforms"?void 0:typeof r=="function"?r.toString():r}p(ka,"optionsJsonReplacer");var Ua=0,Gn=new Map;function Sa(h){let r=JSON.stringify(h,ka),d=Gn.get(r);return d==null&&Gn.set(r,d=++Ua),d}p(Sa,"getKeyForOptions");function wa(){return typeof window>"u"&&(self.window=self),function(h){var r={parse:function(t){var e=r._bin,a=new Uint8Array(t);if(e.readASCII(a,0,4)=="ttcf"){var o=4;e.readUshort(a,o),o+=2,e.readUshort(a,o),o+=2;var n=e.readUint(a,o);o+=4;for(var i=[],s=0;s<n;s++){var l=e.readUint(a,o);o+=4,i.push(r._readFont(a,l))}return i}return[r._readFont(a,0)]},_readFont:function(t,e){var a=r._bin,o=e;a.readFixed(t,e),e+=4;var n=a.readUshort(t,e);e+=2,a.readUshort(t,e),e+=2,a.readUshort(t,e),e+=2,a.readUshort(t,e),e+=2;for(var i=["cmap","head","hhea","maxp","hmtx","name","OS/2","post","loca","glyf","kern","CFF ","GDEF","GPOS","GSUB","SVG "],s={_data:t,_offset:o},l={},u=0;u<n;u++){var c=a.readASCII(t,e,4);e+=4,a.readUint(t,e),e+=4;var g=a.readUint(t,e);e+=4;var m=a.readUint(t,e);e+=4,l[c]={offset:g,length:m}}for(u=0;u<i.length;u++){var b=i[u];l[b]&&(s[b.trim()]=r[b.trim()].parse(t,l[b].offset,l[b].length,s))}return s},_tabOffset:function(t,e,a){for(var o=r._bin,n=o.readUshort(t,a+4),i=a+12,s=0;s<n;s++){var l=o.readASCII(t,i,4);i+=4,o.readUint(t,i),i+=4;var u=o.readUint(t,i);if(i+=4,o.readUint(t,i),i+=4,l==e)return u}return 0}};r._bin={readFixed:function(t,e){return(t[e]<<8|t[e+1])+(t[e+2]<<8|t[e+3])/65540},readF2dot14:function(t,e){return r._bin.readShort(t,e)/16384},readInt:function(t,e){return r._bin._view(t).getInt32(e)},readInt8:function(t,e){return r._bin._view(t).getInt8(e)},readShort:function(t,e){return r._bin._view(t).getInt16(e)},readUshort:function(t,e){return r._bin._view(t).getUint16(e)},readUshorts:function(t,e,a){for(var o=[],n=0;n<a;n++)o.push(r._bin.readUshort(t,e+2*n));return o},readUint:function(t,e){return r._bin._view(t).getUint32(e)},readUint64:function(t,e){return 4294967296*r._bin.readUint(t,e)+r._bin.readUint(t,e+4)},readASCII:function(t,e,a){for(var o="",n=0;n<a;n++)o+=String.fromCharCode(t[e+n]);return o},readUnicode:function(t,e,a){for(var o="",n=0;n<a;n++){var i=t[e++]<<8|t[e++];o+=String.fromCharCode(i)}return o},_tdec:typeof window<"u"&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(t,e,a){var o=r._bin._tdec;return o&&e==0&&a==t.length?o.decode(t):r._bin.readASCII(t,e,a)},readBytes:function(t,e,a){for(var o=[],n=0;n<a;n++)o.push(t[e+n]);return o},readASCIIArray:function(t,e,a){for(var o=[],n=0;n<a;n++)o.push(String.fromCharCode(t[e+n]));return o},_view:function(t){return t._dataView||(t._dataView=t.buffer?new DataView(t.buffer,t.byteOffset,t.byteLength):new DataView(new Uint8Array(t).buffer))}},r._lctf={},r._lctf.parse=function(t,e,a,o,n){var i=r._bin,s={},l=e;i.readFixed(t,e),e+=4;var u=i.readUshort(t,e);e+=2;var c=i.readUshort(t,e);e+=2;var g=i.readUshort(t,e);return e+=2,s.scriptList=r._lctf.readScriptList(t,l+u),s.featureList=r._lctf.readFeatureList(t,l+c),s.lookupList=r._lctf.readLookupList(t,l+g,n),s},r._lctf.readLookupList=function(t,e,a){var o=r._bin,n=e,i=[],s=o.readUshort(t,e);e+=2;for(var l=0;l<s;l++){var u=o.readUshort(t,e);e+=2;var c=r._lctf.readLookupTable(t,n+u,a);i.push(c)}return i},r._lctf.readLookupTable=function(t,e,a){var o=r._bin,n=e,i={tabs:[]};i.ltype=o.readUshort(t,e),e+=2,i.flag=o.readUshort(t,e),e+=2;var s=o.readUshort(t,e);e+=2;for(var l=i.ltype,u=0;u<s;u++){var c=o.readUshort(t,e);e+=2;var g=a(t,l,n+c,i);i.tabs.push(g)}return i},r._lctf.numOfOnes=function(t){for(var e=0,a=0;a<32;a++)t>>>a&1&&e++;return e},r._lctf.readClassDef=function(t,e){var a=r._bin,o=[],n=a.readUshort(t,e);if(e+=2,n==1){var i=a.readUshort(t,e);e+=2;var s=a.readUshort(t,e);e+=2;for(var l=0;l<s;l++)o.push(i+l),o.push(i+l),o.push(a.readUshort(t,e)),e+=2}if(n==2){var u=a.readUshort(t,e);for(e+=2,l=0;l<u;l++)o.push(a.readUshort(t,e)),e+=2,o.push(a.readUshort(t,e)),e+=2,o.push(a.readUshort(t,e)),e+=2}return o},r._lctf.getInterval=function(t,e){for(var a=0;a<t.length;a+=3){var o=t[a],n=t[a+1];if(t[a+2],o<=e&&e<=n)return a}return-1},r._lctf.readCoverage=function(t,e){var a=r._bin,o={};o.fmt=a.readUshort(t,e),e+=2;var n=a.readUshort(t,e);return e+=2,o.fmt==1&&(o.tab=a.readUshorts(t,e,n)),o.fmt==2&&(o.tab=a.readUshorts(t,e,3*n)),o},r._lctf.coverageIndex=function(t,e){var a=t.tab;if(t.fmt==1)return a.indexOf(e);if(t.fmt==2){var o=r._lctf.getInterval(a,e);if(o!=-1)return a[o+2]+(e-a[o])}return-1},r._lctf.readFeatureList=function(t,e){var a=r._bin,o=e,n=[],i=a.readUshort(t,e);e+=2;for(var s=0;s<i;s++){var l=a.readASCII(t,e,4);e+=4;var u=a.readUshort(t,e);e+=2;var c=r._lctf.readFeatureTable(t,o+u);c.tag=l.trim(),n.push(c)}return n},r._lctf.readFeatureTable=function(t,e){var a=r._bin,o=e,n={},i=a.readUshort(t,e);e+=2,i>0&&(n.featureParams=o+i);var s=a.readUshort(t,e);e+=2,n.tab=[];for(var l=0;l<s;l++)n.tab.push(a.readUshort(t,e+2*l));return n},r._lctf.readScriptList=function(t,e){var a=r._bin,o=e,n={},i=a.readUshort(t,e);e+=2;for(var s=0;s<i;s++){var l=a.readASCII(t,e,4);e+=4;var u=a.readUshort(t,e);e+=2,n[l.trim()]=r._lctf.readScriptTable(t,o+u)}return n},r._lctf.readScriptTable=function(t,e){var a=r._bin,o=e,n={},i=a.readUshort(t,e);e+=2,i>0&&(n.default=r._lctf.readLangSysTable(t,o+i));var s=a.readUshort(t,e);e+=2;for(var l=0;l<s;l++){var u=a.readASCII(t,e,4);e+=4;var c=a.readUshort(t,e);e+=2,n[u.trim()]=r._lctf.readLangSysTable(t,o+c)}return n},r._lctf.readLangSysTable=function(t,e){var a=r._bin,o={};a.readUshort(t,e),e+=2,o.reqFeature=a.readUshort(t,e),e+=2;var n=a.readUshort(t,e);return e+=2,o.features=a.readUshorts(t,e,n),o},r.CFF={},r.CFF.parse=function(t,e,a){var o=r._bin;(t=new Uint8Array(t.buffer,e,a))[e=0],t[++e],t[++e],t[++e],e++;var n=[];e=r.CFF.readIndex(t,e,n);for(var i=[],s=0;s<n.length-1;s++)i.push(o.readASCII(t,e+n[s],n[s+1]-n[s]));e+=n[n.length-1];var l=[];e=r.CFF.readIndex(t,e,l);var u=[];for(s=0;s<l.length-1;s++)u.push(r.CFF.readDict(t,e+l[s],e+l[s+1]));e+=l[l.length-1];var c=u[0],g=[];e=r.CFF.readIndex(t,e,g);var m=[];for(s=0;s<g.length-1;s++)m.push(o.readASCII(t,e+g[s],g[s+1]-g[s]));if(e+=g[g.length-1],r.CFF.readSubrs(t,e,c),c.CharStrings){e=c.CharStrings,g=[],e=r.CFF.readIndex(t,e,g);var b=[];for(s=0;s<g.length-1;s++)b.push(o.readBytes(t,e+g[s],g[s+1]-g[s]));c.CharStrings=b}if(c.ROS){e=c.FDArray;var L=[];for(e=r.CFF.readIndex(t,e,L),c.FDArray=[],s=0;s<L.length-1;s++){var F=r.CFF.readDict(t,e+L[s],e+L[s+1]);r.CFF._readFDict(t,F,m),c.FDArray.push(F)}e+=L[L.length-1],e=c.FDSelect,c.FDSelect=[];var U=t[e];if(e++,U!=3)throw U;var _=o.readUshort(t,e);for(e+=2,s=0;s<_+1;s++)c.FDSelect.push(o.readUshort(t,e),t[e+2]),e+=3}return c.Encoding&&(c.Encoding=r.CFF.readEncoding(t,c.Encoding,c.CharStrings.length)),c.charset&&(c.charset=r.CFF.readCharset(t,c.charset,c.CharStrings.length)),r.CFF._readFDict(t,c,m),c},r.CFF._readFDict=function(t,e,a){var o;for(var n in e.Private&&(o=e.Private[1],e.Private=r.CFF.readDict(t,o,o+e.Private[0]),e.Private.Subrs&&r.CFF.readSubrs(t,o+e.Private.Subrs,e.Private)),e)["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(n)!=-1&&(e[n]=a[e[n]-426+35])},r.CFF.readSubrs=function(t,e,a){var o=r._bin,n=[];e=r.CFF.readIndex(t,e,n);var i,s=n.length;i=s<1240?107:s<33900?1131:32768,a.Bias=i,a.Subrs=[];for(var l=0;l<n.length-1;l++)a.Subrs.push(o.readBytes(t,e+n[l],n[l+1]-n[l]))},r.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],r.CFF.glyphByUnicode=function(t,e){for(var a=0;a<t.charset.length;a++)if(t.charset[a]==e)return a;return-1},r.CFF.glyphBySE=function(t,e){return e<0||e>255?-1:r.CFF.glyphByUnicode(t,r.CFF.tableSE[e])},r.CFF.readEncoding=function(t,e,a){r._bin;var o=[".notdef"],n=t[e];if(e++,n!=0)throw"error: unknown encoding format: "+n;var i=t[e];e++;for(var s=0;s<i;s++)o.push(t[e+s]);return o},r.CFF.readCharset=function(t,e,a){var o=r._bin,n=[".notdef"],i=t[e];if(e++,i==0)for(var s=0;s<a;s++){var l=o.readUshort(t,e);e+=2,n.push(l)}else{if(i!=1&&i!=2)throw"error: format: "+i;for(;n.length<a;){l=o.readUshort(t,e),e+=2;var u=0;for(i==1?(u=t[e],e++):(u=o.readUshort(t,e),e+=2),s=0;s<=u;s++)n.push(l),l++}}return n},r.CFF.readIndex=function(t,e,a){var o=r._bin,n=o.readUshort(t,e)+1,i=t[e+=2];if(e++,i==1)for(var s=0;s<n;s++)a.push(t[e+s]);else if(i==2)for(s=0;s<n;s++)a.push(o.readUshort(t,e+2*s));else if(i==3)for(s=0;s<n;s++)a.push(16777215&o.readUint(t,e+3*s-1));else if(n!=1)throw"unsupported offset size: "+i+", count: "+n;return(e+=n*i)-1},r.CFF.getCharString=function(t,e,a){var o=r._bin,n=t[e],i=t[e+1];t[e+2],t[e+3],t[e+4];var s=1,l=null,u=null;n<=20&&(l=n,s=1),n==12&&(l=100*n+i,s=2),21<=n&&n<=27&&(l=n,s=1),n==28&&(u=o.readShort(t,e+1),s=3),29<=n&&n<=31&&(l=n,s=1),32<=n&&n<=246&&(u=n-139,s=1),247<=n&&n<=250&&(u=256*(n-247)+i+108,s=2),251<=n&&n<=254&&(u=256*-(n-251)-i-108,s=2),n==255&&(u=o.readInt(t,e+1)/65535,s=5),a.val=u!=null?u:"o"+l,a.size=s},r.CFF.readCharString=function(t,e,a){for(var o=e+a,n=r._bin,i=[];e<o;){var s=t[e],l=t[e+1];t[e+2],t[e+3],t[e+4];var u=1,c=null,g=null;s<=20&&(c=s,u=1),s==12&&(c=100*s+l,u=2),s!=19&&s!=20||(c=s,u=2),21<=s&&s<=27&&(c=s,u=1),s==28&&(g=n.readShort(t,e+1),u=3),29<=s&&s<=31&&(c=s,u=1),32<=s&&s<=246&&(g=s-139,u=1),247<=s&&s<=250&&(g=256*(s-247)+l+108,u=2),251<=s&&s<=254&&(g=256*-(s-251)-l-108,u=2),s==255&&(g=n.readInt(t,e+1)/65535,u=5),i.push(g!=null?g:"o"+c),e+=u}return i},r.CFF.readDict=function(t,e,a){for(var o=r._bin,n={},i=[];e<a;){var s=t[e],l=t[e+1];t[e+2],t[e+3],t[e+4];var u=1,c=null,g=null;if(s==28&&(g=o.readShort(t,e+1),u=3),s==29&&(g=o.readInt(t,e+1),u=5),32<=s&&s<=246&&(g=s-139,u=1),247<=s&&s<=250&&(g=256*(s-247)+l+108,u=2),251<=s&&s<=254&&(g=256*-(s-251)-l-108,u=2),s==255)throw g=o.readInt(t,e+1)/65535,u=5,"unknown number";if(s==30){var m=[];for(u=1;;){var b=t[e+u];u++;var L=b>>4,F=15&b;if(L!=15&&m.push(L),F!=15&&m.push(F),F==15)break}for(var U="",_=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],S=0;S<m.length;S++)U+=_[m[S]];g=parseFloat(U)}s<=21&&(c=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][s],u=1,s==12&&(c=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][l],u=2)),c!=null?(n[c]=i.length==1?i[0]:i,i=[]):i.push(g),e+=u}return n},r.cmap={},r.cmap.parse=function(t,e,a){t=new Uint8Array(t.buffer,e,a),e=0;var o=r._bin,n={};o.readUshort(t,e),e+=2;var i=o.readUshort(t,e);e+=2;var s=[];n.tables=[];for(var l=0;l<i;l++){var u=o.readUshort(t,e);e+=2;var c=o.readUshort(t,e);e+=2;var g=o.readUint(t,e);e+=4;var m="p"+u+"e"+c,b=s.indexOf(g);if(b==-1){var L;b=n.tables.length,s.push(g);var F=o.readUshort(t,g);F==0?L=r.cmap.parse0(t,g):F==4?L=r.cmap.parse4(t,g):F==6?L=r.cmap.parse6(t,g):F==12?L=r.cmap.parse12(t,g):console.debug("unknown format: "+F,u,c,g),n.tables.push(L)}if(n[m]!=null)throw"multiple tables for one platform+encoding";n[m]=b}return n},r.cmap.parse0=function(t,e){var a=r._bin,o={};o.format=a.readUshort(t,e),e+=2;var n=a.readUshort(t,e);e+=2,a.readUshort(t,e),e+=2,o.map=[];for(var i=0;i<n-6;i++)o.map.push(t[e+i]);return o},r.cmap.parse4=function(t,e){var a=r._bin,o=e,n={};n.format=a.readUshort(t,e),e+=2;var i=a.readUshort(t,e);e+=2,a.readUshort(t,e),e+=2;var s=a.readUshort(t,e);e+=2;var l=s/2;n.searchRange=a.readUshort(t,e),e+=2,n.entrySelector=a.readUshort(t,e),e+=2,n.rangeShift=a.readUshort(t,e),e+=2,n.endCount=a.readUshorts(t,e,l),e+=2*l,e+=2,n.startCount=a.readUshorts(t,e,l),e+=2*l,n.idDelta=[];for(var u=0;u<l;u++)n.idDelta.push(a.readShort(t,e)),e+=2;for(n.idRangeOffset=a.readUshorts(t,e,l),e+=2*l,n.glyphIdArray=[];e<o+i;)n.glyphIdArray.push(a.readUshort(t,e)),e+=2;return n},r.cmap.parse6=function(t,e){var a=r._bin,o={};o.format=a.readUshort(t,e),e+=2,a.readUshort(t,e),e+=2,a.readUshort(t,e),e+=2,o.firstCode=a.readUshort(t,e),e+=2;var n=a.readUshort(t,e);e+=2,o.glyphIdArray=[];for(var i=0;i<n;i++)o.glyphIdArray.push(a.readUshort(t,e)),e+=2;return o},r.cmap.parse12=function(t,e){var a=r._bin,o={};o.format=a.readUshort(t,e),e+=2,e+=2,a.readUint(t,e),e+=4,a.readUint(t,e),e+=4;var n=a.readUint(t,e);e+=4,o.groups=[];for(var i=0;i<n;i++){var s=e+12*i,l=a.readUint(t,s+0),u=a.readUint(t,s+4),c=a.readUint(t,s+8);o.groups.push([l,u,c])}return o},r.glyf={},r.glyf.parse=function(t,e,a,o){for(var n=[],i=0;i<o.maxp.numGlyphs;i++)n.push(null);return n},r.glyf._parseGlyf=function(t,e){var a=r._bin,o=t._data,n=r._tabOffset(o,"glyf",t._offset)+t.loca[e];if(t.loca[e]==t.loca[e+1])return null;var i={};if(i.noc=a.readShort(o,n),n+=2,i.xMin=a.readShort(o,n),n+=2,i.yMin=a.readShort(o,n),n+=2,i.xMax=a.readShort(o,n),n+=2,i.yMax=a.readShort(o,n),n+=2,i.xMin>=i.xMax||i.yMin>=i.yMax)return null;if(i.noc>0){i.endPts=[];for(var s=0;s<i.noc;s++)i.endPts.push(a.readUshort(o,n)),n+=2;var l=a.readUshort(o,n);if(n+=2,o.length-n<l)return null;i.instructions=a.readBytes(o,n,l),n+=l;var u=i.endPts[i.noc-1]+1;for(i.flags=[],s=0;s<u;s++){var c=o[n];if(n++,i.flags.push(c),(8&c)!=0){var g=o[n];n++;for(var m=0;m<g;m++)i.flags.push(c),s++}}for(i.xs=[],s=0;s<u;s++){var b=(2&i.flags[s])!=0,L=(16&i.flags[s])!=0;b?(i.xs.push(L?o[n]:-o[n]),n++):L?i.xs.push(0):(i.xs.push(a.readShort(o,n)),n+=2)}for(i.ys=[],s=0;s<u;s++)b=(4&i.flags[s])!=0,L=(32&i.flags[s])!=0,b?(i.ys.push(L?o[n]:-o[n]),n++):L?i.ys.push(0):(i.ys.push(a.readShort(o,n)),n+=2);var F=0,U=0;for(s=0;s<u;s++)F+=i.xs[s],U+=i.ys[s],i.xs[s]=F,i.ys[s]=U}else{var _;i.parts=[];do{_=a.readUshort(o,n),n+=2;var S={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(i.parts.push(S),S.glyphIndex=a.readUshort(o,n),n+=2,1&_){var D=a.readShort(o,n);n+=2;var x=a.readShort(o,n);n+=2}else D=a.readInt8(o,n),n++,x=a.readInt8(o,n),n++;2&_?(S.m.tx=D,S.m.ty=x):(S.p1=D,S.p2=x),8&_?(S.m.a=S.m.d=a.readF2dot14(o,n),n+=2):64&_?(S.m.a=a.readF2dot14(o,n),n+=2,S.m.d=a.readF2dot14(o,n),n+=2):128&_&&(S.m.a=a.readF2dot14(o,n),n+=2,S.m.b=a.readF2dot14(o,n),n+=2,S.m.c=a.readF2dot14(o,n),n+=2,S.m.d=a.readF2dot14(o,n),n+=2)}while(32&_);if(256&_){var A=a.readUshort(o,n);for(n+=2,i.instr=[],s=0;s<A;s++)i.instr.push(o[n]),n++}}return i},r.GDEF={},r.GDEF.parse=function(t,e,a,o){var n=e;e+=4;var i=r._bin.readUshort(t,e);return{glyphClassDef:i===0?null:r._lctf.readClassDef(t,n+i)}},r.GPOS={},r.GPOS.parse=function(t,e,a,o){return r._lctf.parse(t,e,a,o,r.GPOS.subt)},r.GPOS.subt=function(t,e,a,o){var n=r._bin,i=a,s={};if(s.fmt=n.readUshort(t,a),a+=2,e==1||e==2||e==3||e==7||e==8&&s.fmt<=2){var l=n.readUshort(t,a);a+=2,s.coverage=r._lctf.readCoverage(t,l+i)}if(e==1&&s.fmt==1){var u=n.readUshort(t,a);a+=2,u!=0&&(s.pos=r.GPOS.readValueRecord(t,a,u))}else if(e==2&&s.fmt>=1&&s.fmt<=2){u=n.readUshort(t,a),a+=2;var c=n.readUshort(t,a);a+=2;var g=r._lctf.numOfOnes(u),m=r._lctf.numOfOnes(c);if(s.fmt==1){s.pairsets=[];var b=n.readUshort(t,a);a+=2;for(var L=0;L<b;L++){var F=i+n.readUshort(t,a);a+=2;var U=n.readUshort(t,F);F+=2;for(var _=[],S=0;S<U;S++){var D=n.readUshort(t,F);F+=2,u!=0&&(y=r.GPOS.readValueRecord(t,F,u),F+=2*g),c!=0&&(O=r.GPOS.readValueRecord(t,F,c),F+=2*m),_.push({gid2:D,val1:y,val2:O})}s.pairsets.push(_)}}if(s.fmt==2){var x=n.readUshort(t,a);a+=2;var A=n.readUshort(t,a);a+=2;var W=n.readUshort(t,a);a+=2;var B=n.readUshort(t,a);for(a+=2,s.classDef1=r._lctf.readClassDef(t,i+x),s.classDef2=r._lctf.readClassDef(t,i+A),s.matrix=[],L=0;L<W;L++){var Y=[];for(S=0;S<B;S++){var y=null,O=null;u!=0&&(y=r.GPOS.readValueRecord(t,a,u),a+=2*g),c!=0&&(O=r.GPOS.readValueRecord(t,a,c),a+=2*m),Y.push({val1:y,val2:O})}s.matrix.push(Y)}}}else if(e==4&&s.fmt==1)s.markCoverage=r._lctf.readCoverage(t,n.readUshort(t,a)+i),s.baseCoverage=r._lctf.readCoverage(t,n.readUshort(t,a+2)+i),s.markClassCount=n.readUshort(t,a+4),s.markArray=r.GPOS.readMarkArray(t,n.readUshort(t,a+6)+i),s.baseArray=r.GPOS.readBaseArray(t,n.readUshort(t,a+8)+i,s.markClassCount);else if(e==6&&s.fmt==1)s.mark1Coverage=r._lctf.readCoverage(t,n.readUshort(t,a)+i),s.mark2Coverage=r._lctf.readCoverage(t,n.readUshort(t,a+2)+i),s.markClassCount=n.readUshort(t,a+4),s.mark1Array=r.GPOS.readMarkArray(t,n.readUshort(t,a+6)+i),s.mark2Array=r.GPOS.readBaseArray(t,n.readUshort(t,a+8)+i,s.markClassCount);else{if(e==9&&s.fmt==1){var w=n.readUshort(t,a);a+=2;var j=n.readUint(t,a);if(a+=4,o.ltype==9)o.ltype=w;else if(o.ltype!=w)throw"invalid extension substitution";return r.GPOS.subt(t,o.ltype,i+j)}console.debug("unsupported GPOS table LookupType",e,"format",s.fmt)}return s},r.GPOS.readValueRecord=function(t,e,a){var o=r._bin,n=[];return n.push(1&a?o.readShort(t,e):0),e+=1&a?2:0,n.push(2&a?o.readShort(t,e):0),e+=2&a?2:0,n.push(4&a?o.readShort(t,e):0),e+=4&a?2:0,n.push(8&a?o.readShort(t,e):0),e+=8&a?2:0,n},r.GPOS.readBaseArray=function(t,e,a){var o=r._bin,n=[],i=e,s=o.readUshort(t,e);e+=2;for(var l=0;l<s;l++){for(var u=[],c=0;c<a;c++)u.push(r.GPOS.readAnchorRecord(t,i+o.readUshort(t,e))),e+=2;n.push(u)}return n},r.GPOS.readMarkArray=function(t,e){var a=r._bin,o=[],n=e,i=a.readUshort(t,e);e+=2;for(var s=0;s<i;s++){var l=r.GPOS.readAnchorRecord(t,a.readUshort(t,e+2)+n);l.markClass=a.readUshort(t,e),o.push(l),e+=4}return o},r.GPOS.readAnchorRecord=function(t,e){var a=r._bin,o={};return o.fmt=a.readUshort(t,e),o.x=a.readShort(t,e+2),o.y=a.readShort(t,e+4),o},r.GSUB={},r.GSUB.parse=function(t,e,a,o){return r._lctf.parse(t,e,a,o,r.GSUB.subt)},r.GSUB.subt=function(t,e,a,o){var n=r._bin,i=a,s={};if(s.fmt=n.readUshort(t,a),a+=2,e!=1&&e!=2&&e!=4&&e!=5&&e!=6)return null;if(e==1||e==2||e==4||e==5&&s.fmt<=2||e==6&&s.fmt<=2){var l=n.readUshort(t,a);a+=2,s.coverage=r._lctf.readCoverage(t,i+l)}if(e==1&&s.fmt>=1&&s.fmt<=2){if(s.fmt==1)s.delta=n.readShort(t,a),a+=2;else if(s.fmt==2){var u=n.readUshort(t,a);a+=2,s.newg=n.readUshorts(t,a,u),a+=2*s.newg.length}}else if(e==2&&s.fmt==1){u=n.readUshort(t,a),a+=2,s.seqs=[];for(var c=0;c<u;c++){var g=n.readUshort(t,a)+i;a+=2;var m=n.readUshort(t,g);s.seqs.push(n.readUshorts(t,g+2,m))}}else if(e==4)for(s.vals=[],u=n.readUshort(t,a),a+=2,c=0;c<u;c++){var b=n.readUshort(t,a);a+=2,s.vals.push(r.GSUB.readLigatureSet(t,i+b))}else if(e==5&&s.fmt==2){if(s.fmt==2){var L=n.readUshort(t,a);a+=2,s.cDef=r._lctf.readClassDef(t,i+L),s.scset=[];var F=n.readUshort(t,a);for(a+=2,c=0;c<F;c++){var U=n.readUshort(t,a);a+=2,s.scset.push(U==0?null:r.GSUB.readSubClassSet(t,i+U))}}}else if(e==6&&s.fmt==3){if(s.fmt==3){for(c=0;c<3;c++){u=n.readUshort(t,a),a+=2;for(var _=[],S=0;S<u;S++)_.push(r._lctf.readCoverage(t,i+n.readUshort(t,a+2*S)));a+=2*u,c==0&&(s.backCvg=_),c==1&&(s.inptCvg=_),c==2&&(s.ahedCvg=_)}u=n.readUshort(t,a),a+=2,s.lookupRec=r.GSUB.readSubstLookupRecords(t,a,u)}}else{if(e==7&&s.fmt==1){var D=n.readUshort(t,a);a+=2;var x=n.readUint(t,a);if(a+=4,o.ltype==9)o.ltype=D;else if(o.ltype!=D)throw"invalid extension substitution";return r.GSUB.subt(t,o.ltype,i+x)}console.debug("unsupported GSUB table LookupType",e,"format",s.fmt)}return s},r.GSUB.readSubClassSet=function(t,e){var a=r._bin.readUshort,o=e,n=[],i=a(t,e);e+=2;for(var s=0;s<i;s++){var l=a(t,e);e+=2,n.push(r.GSUB.readSubClassRule(t,o+l))}return n},r.GSUB.readSubClassRule=function(t,e){var a=r._bin.readUshort,o={},n=a(t,e),i=a(t,e+=2);e+=2,o.input=[];for(var s=0;s<n-1;s++)o.input.push(a(t,e)),e+=2;return o.substLookupRecords=r.GSUB.readSubstLookupRecords(t,e,i),o},r.GSUB.readSubstLookupRecords=function(t,e,a){for(var o=r._bin.readUshort,n=[],i=0;i<a;i++)n.push(o(t,e),o(t,e+2)),e+=4;return n},r.GSUB.readChainSubClassSet=function(t,e){var a=r._bin,o=e,n=[],i=a.readUshort(t,e);e+=2;for(var s=0;s<i;s++){var l=a.readUshort(t,e);e+=2,n.push(r.GSUB.readChainSubClassRule(t,o+l))}return n},r.GSUB.readChainSubClassRule=function(t,e){for(var a=r._bin,o={},n=["backtrack","input","lookahead"],i=0;i<n.length;i++){var s=a.readUshort(t,e);e+=2,i==1&&s--,o[n[i]]=a.readUshorts(t,e,s),e+=2*o[n[i]].length}return s=a.readUshort(t,e),e+=2,o.subst=a.readUshorts(t,e,2*s),e+=2*o.subst.length,o},r.GSUB.readLigatureSet=function(t,e){var a=r._bin,o=e,n=[],i=a.readUshort(t,e);e+=2;for(var s=0;s<i;s++){var l=a.readUshort(t,e);e+=2,n.push(r.GSUB.readLigature(t,o+l))}return n},r.GSUB.readLigature=function(t,e){var a=r._bin,o={chain:[]};o.nglyph=a.readUshort(t,e),e+=2;var n=a.readUshort(t,e);e+=2;for(var i=0;i<n-1;i++)o.chain.push(a.readUshort(t,e)),e+=2;return o},r.head={},r.head.parse=function(t,e,a){var o=r._bin,n={};return o.readFixed(t,e),e+=4,n.fontRevision=o.readFixed(t,e),e+=4,o.readUint(t,e),e+=4,o.readUint(t,e),e+=4,n.flags=o.readUshort(t,e),e+=2,n.unitsPerEm=o.readUshort(t,e),e+=2,n.created=o.readUint64(t,e),e+=8,n.modified=o.readUint64(t,e),e+=8,n.xMin=o.readShort(t,e),e+=2,n.yMin=o.readShort(t,e),e+=2,n.xMax=o.readShort(t,e),e+=2,n.yMax=o.readShort(t,e),e+=2,n.macStyle=o.readUshort(t,e),e+=2,n.lowestRecPPEM=o.readUshort(t,e),e+=2,n.fontDirectionHint=o.readShort(t,e),e+=2,n.indexToLocFormat=o.readShort(t,e),e+=2,n.glyphDataFormat=o.readShort(t,e),e+=2,n},r.hhea={},r.hhea.parse=function(t,e,a){var o=r._bin,n={};return o.readFixed(t,e),e+=4,n.ascender=o.readShort(t,e),e+=2,n.descender=o.readShort(t,e),e+=2,n.lineGap=o.readShort(t,e),e+=2,n.advanceWidthMax=o.readUshort(t,e),e+=2,n.minLeftSideBearing=o.readShort(t,e),e+=2,n.minRightSideBearing=o.readShort(t,e),e+=2,n.xMaxExtent=o.readShort(t,e),e+=2,n.caretSlopeRise=o.readShort(t,e),e+=2,n.caretSlopeRun=o.readShort(t,e),e+=2,n.caretOffset=o.readShort(t,e),e+=2,e+=8,n.metricDataFormat=o.readShort(t,e),e+=2,n.numberOfHMetrics=o.readUshort(t,e),e+=2,n},r.hmtx={},r.hmtx.parse=function(t,e,a,o){for(var n=r._bin,i={aWidth:[],lsBearing:[]},s=0,l=0,u=0;u<o.maxp.numGlyphs;u++)u<o.hhea.numberOfHMetrics&&(s=n.readUshort(t,e),e+=2,l=n.readShort(t,e),e+=2),i.aWidth.push(s),i.lsBearing.push(l);return i},r.kern={},r.kern.parse=function(t,e,a,o){var n=r._bin,i=n.readUshort(t,e);if(e+=2,i==1)return r.kern.parseV1(t,e-2,a,o);var s=n.readUshort(t,e);e+=2;for(var l={glyph1:[],rval:[]},u=0;u<s;u++){e+=2,a=n.readUshort(t,e),e+=2;var c=n.readUshort(t,e);e+=2;var g=c>>>8;if((g&=15)!=0)throw"unknown kern table format: "+g;e=r.kern.readFormat0(t,e,l)}return l},r.kern.parseV1=function(t,e,a,o){var n=r._bin;n.readFixed(t,e),e+=4;var i=n.readUint(t,e);e+=4;for(var s={glyph1:[],rval:[]},l=0;l<i;l++){n.readUint(t,e),e+=4;var u=n.readUshort(t,e);e+=2,n.readUshort(t,e),e+=2;var c=u>>>8;if((c&=15)!=0)throw"unknown kern table format: "+c;e=r.kern.readFormat0(t,e,s)}return s},r.kern.readFormat0=function(t,e,a){var o=r._bin,n=-1,i=o.readUshort(t,e);e+=2,o.readUshort(t,e),e+=2,o.readUshort(t,e),e+=2,o.readUshort(t,e),e+=2;for(var s=0;s<i;s++){var l=o.readUshort(t,e);e+=2;var u=o.readUshort(t,e);e+=2;var c=o.readShort(t,e);e+=2,l!=n&&(a.glyph1.push(l),a.rval.push({glyph2:[],vals:[]}));var g=a.rval[a.rval.length-1];g.glyph2.push(u),g.vals.push(c),n=l}return e},r.loca={},r.loca.parse=function(t,e,a,o){var n=r._bin,i=[],s=o.head.indexToLocFormat,l=o.maxp.numGlyphs+1;if(s==0)for(var u=0;u<l;u++)i.push(n.readUshort(t,e+(u<<1))<<1);if(s==1)for(u=0;u<l;u++)i.push(n.readUint(t,e+(u<<2)));return i},r.maxp={},r.maxp.parse=function(t,e,a){var o=r._bin,n={},i=o.readUint(t,e);return e+=4,n.numGlyphs=o.readUshort(t,e),e+=2,i==65536&&(n.maxPoints=o.readUshort(t,e),e+=2,n.maxContours=o.readUshort(t,e),e+=2,n.maxCompositePoints=o.readUshort(t,e),e+=2,n.maxCompositeContours=o.readUshort(t,e),e+=2,n.maxZones=o.readUshort(t,e),e+=2,n.maxTwilightPoints=o.readUshort(t,e),e+=2,n.maxStorage=o.readUshort(t,e),e+=2,n.maxFunctionDefs=o.readUshort(t,e),e+=2,n.maxInstructionDefs=o.readUshort(t,e),e+=2,n.maxStackElements=o.readUshort(t,e),e+=2,n.maxSizeOfInstructions=o.readUshort(t,e),e+=2,n.maxComponentElements=o.readUshort(t,e),e+=2,n.maxComponentDepth=o.readUshort(t,e),e+=2),n},r.name={},r.name.parse=function(t,e,a){var o=r._bin,n={};o.readUshort(t,e),e+=2;var i=o.readUshort(t,e);e+=2,o.readUshort(t,e);for(var s,l=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],u=e+=2,c=0;c<i;c++){var g=o.readUshort(t,e);e+=2;var m=o.readUshort(t,e);e+=2;var b=o.readUshort(t,e);e+=2;var L=o.readUshort(t,e);e+=2;var F=o.readUshort(t,e);e+=2;var U=o.readUshort(t,e);e+=2;var _,S=l[L],D=u+12*i+U;if(g==0)_=o.readUnicode(t,D,F/2);else if(g==3&&m==0)_=o.readUnicode(t,D,F/2);else if(m==0)_=o.readASCII(t,D,F);else if(m==1)_=o.readUnicode(t,D,F/2);else if(m==3)_=o.readUnicode(t,D,F/2);else{if(g!=1)throw"unknown encoding "+m+", platformID: "+g;_=o.readASCII(t,D,F),console.debug("reading unknown MAC encoding "+m+" as ASCII")}var x="p"+g+","+b.toString(16);n[x]==null&&(n[x]={}),n[x][S!==void 0?S:L]=_,n[x]._lang=b}for(var A in n)if(n[A].postScriptName!=null&&n[A]._lang==1033)return n[A];for(var A in n)if(n[A].postScriptName!=null&&n[A]._lang==0)return n[A];for(var A in n)if(n[A].postScriptName!=null&&n[A]._lang==3084)return n[A];for(var A in n)if(n[A].postScriptName!=null)return n[A];for(var A in n){s=A;break}return console.debug("returning name table with languageID "+n[s]._lang),n[s]},r["OS/2"]={},r["OS/2"].parse=function(t,e,a){var o=r._bin.readUshort(t,e);e+=2;var n={};if(o==0)r["OS/2"].version0(t,e,n);else if(o==1)r["OS/2"].version1(t,e,n);else if(o==2||o==3||o==4)r["OS/2"].version2(t,e,n);else{if(o!=5)throw"unknown OS/2 table version: "+o;r["OS/2"].version5(t,e,n)}return n},r["OS/2"].version0=function(t,e,a){var o=r._bin;return a.xAvgCharWidth=o.readShort(t,e),e+=2,a.usWeightClass=o.readUshort(t,e),e+=2,a.usWidthClass=o.readUshort(t,e),e+=2,a.fsType=o.readUshort(t,e),e+=2,a.ySubscriptXSize=o.readShort(t,e),e+=2,a.ySubscriptYSize=o.readShort(t,e),e+=2,a.ySubscriptXOffset=o.readShort(t,e),e+=2,a.ySubscriptYOffset=o.readShort(t,e),e+=2,a.ySuperscriptXSize=o.readShort(t,e),e+=2,a.ySuperscriptYSize=o.readShort(t,e),e+=2,a.ySuperscriptXOffset=o.readShort(t,e),e+=2,a.ySuperscriptYOffset=o.readShort(t,e),e+=2,a.yStrikeoutSize=o.readShort(t,e),e+=2,a.yStrikeoutPosition=o.readShort(t,e),e+=2,a.sFamilyClass=o.readShort(t,e),e+=2,a.panose=o.readBytes(t,e,10),e+=10,a.ulUnicodeRange1=o.readUint(t,e),e+=4,a.ulUnicodeRange2=o.readUint(t,e),e+=4,a.ulUnicodeRange3=o.readUint(t,e),e+=4,a.ulUnicodeRange4=o.readUint(t,e),e+=4,a.achVendID=[o.readInt8(t,e),o.readInt8(t,e+1),o.readInt8(t,e+2),o.readInt8(t,e+3)],e+=4,a.fsSelection=o.readUshort(t,e),e+=2,a.usFirstCharIndex=o.readUshort(t,e),e+=2,a.usLastCharIndex=o.readUshort(t,e),e+=2,a.sTypoAscender=o.readShort(t,e),e+=2,a.sTypoDescender=o.readShort(t,e),e+=2,a.sTypoLineGap=o.readShort(t,e),e+=2,a.usWinAscent=o.readUshort(t,e),e+=2,a.usWinDescent=o.readUshort(t,e),e+=2},r["OS/2"].version1=function(t,e,a){var o=r._bin;return e=r["OS/2"].version0(t,e,a),a.ulCodePageRange1=o.readUint(t,e),e+=4,a.ulCodePageRange2=o.readUint(t,e),e+=4},r["OS/2"].version2=function(t,e,a){var o=r._bin;return e=r["OS/2"].version1(t,e,a),a.sxHeight=o.readShort(t,e),e+=2,a.sCapHeight=o.readShort(t,e),e+=2,a.usDefault=o.readUshort(t,e),e+=2,a.usBreak=o.readUshort(t,e),e+=2,a.usMaxContext=o.readUshort(t,e),e+=2},r["OS/2"].version5=function(t,e,a){var o=r._bin;return e=r["OS/2"].version2(t,e,a),a.usLowerOpticalPointSize=o.readUshort(t,e),e+=2,a.usUpperOpticalPointSize=o.readUshort(t,e),e+=2},r.post={},r.post.parse=function(t,e,a){var o=r._bin,n={};return n.version=o.readFixed(t,e),e+=4,n.italicAngle=o.readFixed(t,e),e+=4,n.underlinePosition=o.readShort(t,e),e+=2,n.underlineThickness=o.readShort(t,e),e+=2,n},r==null&&(r={}),r.U==null&&(r.U={}),r.U.codeToGlyph=function(t,e){var a=t.cmap,o=-1;if(a.p0e4!=null?o=a.p0e4:a.p3e1!=null?o=a.p3e1:a.p1e0!=null?o=a.p1e0:a.p0e3!=null&&(o=a.p0e3),o==-1)throw"no familiar platform and encoding!";var n=a.tables[o];if(n.format==0)return e>=n.map.length?0:n.map[e];if(n.format==4){for(var i=-1,s=0;s<n.endCount.length;s++)if(e<=n.endCount[s]){i=s;break}return i==-1||n.startCount[i]>e?0:65535&(n.idRangeOffset[i]!=0?n.glyphIdArray[e-n.startCount[i]+(n.idRangeOffset[i]>>1)-(n.idRangeOffset.length-i)]:e+n.idDelta[i])}if(n.format==12){if(e>n.groups[n.groups.length-1][1])return 0;for(s=0;s<n.groups.length;s++){var l=n.groups[s];if(l[0]<=e&&e<=l[1])return l[2]+(e-l[0])}return 0}throw"unknown cmap table format "+n.format},r.U.glyphToPath=function(t,e){var a={cmds:[],crds:[]};if(t.SVG&&t.SVG.entries[e]){var o=t.SVG.entries[e];return o==null?a:(typeof o=="string"&&(o=r.SVG.toPath(o),t.SVG.entries[e]=o),o)}if(t.CFF){var n={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:t.CFF.Private?t.CFF.Private.defaultWidthX:0,open:!1},i=t.CFF,s=t.CFF.Private;if(i.ROS){for(var l=0;i.FDSelect[l+2]<=e;)l+=2;s=i.FDArray[i.FDSelect[l+1]].Private}r.U._drawCFF(t.CFF.CharStrings[e],n,i,s,a)}else t.glyf&&r.U._drawGlyf(e,t,a);return a},r.U._drawGlyf=function(t,e,a){var o=e.glyf[t];o==null&&(o=e.glyf[t]=r.glyf._parseGlyf(e,t)),o!=null&&(o.noc>-1?r.U._simpleGlyph(o,a):r.U._compoGlyph(o,e,a))},r.U._simpleGlyph=function(t,e){for(var a=0;a<t.noc;a++){for(var o=a==0?0:t.endPts[a-1]+1,n=t.endPts[a],i=o;i<=n;i++){var s=i==o?n:i-1,l=i==n?o:i+1,u=1&t.flags[i],c=1&t.flags[s],g=1&t.flags[l],m=t.xs[i],b=t.ys[i];if(i==o)if(u){if(!c){r.U.P.moveTo(e,m,b);continue}r.U.P.moveTo(e,t.xs[s],t.ys[s])}else c?r.U.P.moveTo(e,t.xs[s],t.ys[s]):r.U.P.moveTo(e,(t.xs[s]+m)/2,(t.ys[s]+b)/2);u?c&&r.U.P.lineTo(e,m,b):g?r.U.P.qcurveTo(e,m,b,t.xs[l],t.ys[l]):r.U.P.qcurveTo(e,m,b,(m+t.xs[l])/2,(b+t.ys[l])/2)}r.U.P.closePath(e)}},r.U._compoGlyph=function(t,e,a){for(var o=0;o<t.parts.length;o++){var n={cmds:[],crds:[]},i=t.parts[o];r.U._drawGlyf(i.glyphIndex,e,n);for(var s=i.m,l=0;l<n.crds.length;l+=2){var u=n.crds[l],c=n.crds[l+1];a.crds.push(u*s.a+c*s.b+s.tx),a.crds.push(u*s.c+c*s.d+s.ty)}for(l=0;l<n.cmds.length;l++)a.cmds.push(n.cmds[l])}},r.U._getGlyphClass=function(t,e){var a=r._lctf.getInterval(e,t);return a==-1?0:e[a+2]},r.U._applySubs=function(t,e,a,o){for(var n=t.length-e-1,i=0;i<a.tabs.length;i++)if(a.tabs[i]!=null){var s,l=a.tabs[i];if(!l.coverage||(s=r._lctf.coverageIndex(l.coverage,t[e]))!=-1){if(a.ltype==1)t[e],l.fmt==1?t[e]=t[e]+l.delta:t[e]=l.newg[s];else if(a.ltype==4)for(var u=l.vals[s],c=0;c<u.length;c++){var g=u[c],m=g.chain.length;if(!(m>n)){for(var b=!0,L=0,F=0;F<m;F++){for(;t[e+L+(1+F)]==-1;)L++;g.chain[F]!=t[e+L+(1+F)]&&(b=!1)}if(b){for(t[e]=g.nglyph,F=0;F<m+L;F++)t[e+F+1]=-1;break}}}else if(a.ltype==5&&l.fmt==2)for(var U=r._lctf.getInterval(l.cDef,t[e]),_=l.cDef[U+2],S=l.scset[_],D=0;D<S.length;D++){var x=S[D],A=x.input;if(!(A.length>n)){for(b=!0,F=0;F<A.length;F++){var W=r._lctf.getInterval(l.cDef,t[e+1+F]);if(U==-1&&l.cDef[W+2]!=A[F]){b=!1;break}}if(b){var B=x.substLookupRecords;for(c=0;c<B.length;c+=2)B[c],B[c+1]}}}else if(a.ltype==6&&l.fmt==3){if(!r.U._glsCovered(t,l.backCvg,e-l.backCvg.length)||!r.U._glsCovered(t,l.inptCvg,e)||!r.U._glsCovered(t,l.ahedCvg,e+l.inptCvg.length))continue;var Y=l.lookupRec;for(D=0;D<Y.length;D+=2){U=Y[D];var y=o[Y[D+1]];r.U._applySubs(t,e+U,y,o)}}}}},r.U._glsCovered=function(t,e,a){for(var o=0;o<e.length;o++)if(r._lctf.coverageIndex(e[o],t[a+o])==-1)return!1;return!0},r.U.glyphsToPath=function(t,e,a){for(var o={cmds:[],crds:[]},n=0,i=0;i<e.length;i++){var s=e[i];if(s!=-1){for(var l=i<e.length-1&&e[i+1]!=-1?e[i+1]:0,u=r.U.glyphToPath(t,s),c=0;c<u.crds.length;c+=2)o.crds.push(u.crds[c]+n),o.crds.push(u.crds[c+1]);for(a&&o.cmds.push(a),c=0;c<u.cmds.length;c++)o.cmds.push(u.cmds[c]);a&&o.cmds.push("X"),n+=t.hmtx.aWidth[s],i<e.length-1&&(n+=r.U.getPairAdjustment(t,s,l))}}return o},r.U.P={},r.U.P.moveTo=function(t,e,a){t.cmds.push("M"),t.crds.push(e,a)},r.U.P.lineTo=function(t,e,a){t.cmds.push("L"),t.crds.push(e,a)},r.U.P.curveTo=function(t,e,a,o,n,i,s){t.cmds.push("C"),t.crds.push(e,a,o,n,i,s)},r.U.P.qcurveTo=function(t,e,a,o,n){t.cmds.push("Q"),t.crds.push(e,a,o,n)},r.U.P.closePath=function(t){t.cmds.push("Z")},r.U._drawCFF=function(t,e,a,o,n){for(var i=e.stack,s=e.nStems,l=e.haveWidth,u=e.width,c=e.open,g=0,m=e.x,b=e.y,L=0,F=0,U=0,_=0,S=0,D=0,x=0,A=0,W=0,B=0,Y={val:0,size:0};g<t.length;){r.CFF.getCharString(t,g,Y);var y=Y.val;if(g+=Y.size,y=="o1"||y=="o18")i.length%2!=0&&!l&&(u=i.shift()+o.nominalWidthX),s+=i.length>>1,i.length=0,l=!0;else if(y=="o3"||y=="o23")i.length%2!=0&&!l&&(u=i.shift()+o.nominalWidthX),s+=i.length>>1,i.length=0,l=!0;else if(y=="o4")i.length>1&&!l&&(u=i.shift()+o.nominalWidthX,l=!0),c&&r.U.P.closePath(n),b+=i.pop(),r.U.P.moveTo(n,m,b),c=!0;else if(y=="o5")for(;i.length>0;)m+=i.shift(),b+=i.shift(),r.U.P.lineTo(n,m,b);else if(y=="o6"||y=="o7")for(var O=i.length,w=y=="o6",j=0;j<O;j++){var P=i.shift();w?m+=P:b+=P,w=!w,r.U.P.lineTo(n,m,b)}else if(y=="o8"||y=="o24"){O=i.length;for(var Z=0;Z+6<=O;)L=m+i.shift(),F=b+i.shift(),U=L+i.shift(),_=F+i.shift(),m=U+i.shift(),b=_+i.shift(),r.U.P.curveTo(n,L,F,U,_,m,b),Z+=6;y=="o24"&&(m+=i.shift(),b+=i.shift(),r.U.P.lineTo(n,m,b))}else{if(y=="o11")break;if(y=="o1234"||y=="o1235"||y=="o1236"||y=="o1237")y=="o1234"&&(F=b,U=(L=m+i.shift())+i.shift(),B=_=F+i.shift(),D=_,A=b,m=(x=(S=(W=U+i.shift())+i.shift())+i.shift())+i.shift(),r.U.P.curveTo(n,L,F,U,_,W,B),r.U.P.curveTo(n,S,D,x,A,m,b)),y=="o1235"&&(L=m+i.shift(),F=b+i.shift(),U=L+i.shift(),_=F+i.shift(),W=U+i.shift(),B=_+i.shift(),S=W+i.shift(),D=B+i.shift(),x=S+i.shift(),A=D+i.shift(),m=x+i.shift(),b=A+i.shift(),i.shift(),r.U.P.curveTo(n,L,F,U,_,W,B),r.U.P.curveTo(n,S,D,x,A,m,b)),y=="o1236"&&(L=m+i.shift(),F=b+i.shift(),U=L+i.shift(),B=_=F+i.shift(),D=_,x=(S=(W=U+i.shift())+i.shift())+i.shift(),A=D+i.shift(),m=x+i.shift(),r.U.P.curveTo(n,L,F,U,_,W,B),r.U.P.curveTo(n,S,D,x,A,m,b)),y=="o1237"&&(L=m+i.shift(),F=b+i.shift(),U=L+i.shift(),_=F+i.shift(),W=U+i.shift(),B=_+i.shift(),S=W+i.shift(),D=B+i.shift(),x=S+i.shift(),A=D+i.shift(),Math.abs(x-m)>Math.abs(A-b)?m=x+i.shift():b=A+i.shift(),r.U.P.curveTo(n,L,F,U,_,W,B),r.U.P.curveTo(n,S,D,x,A,m,b));else if(y=="o14"){if(i.length>0&&!l&&(u=i.shift()+a.nominalWidthX,l=!0),i.length==4){var se=i.shift(),I=i.shift(),R=i.shift(),v=i.shift(),T=r.CFF.glyphBySE(a,R),M=r.CFF.glyphBySE(a,v);r.U._drawCFF(a.CharStrings[T],e,a,o,n),e.x=se,e.y=I,r.U._drawCFF(a.CharStrings[M],e,a,o,n)}c&&(r.U.P.closePath(n),c=!1)}else if(y=="o19"||y=="o20")i.length%2!=0&&!l&&(u=i.shift()+o.nominalWidthX),s+=i.length>>1,i.length=0,l=!0,g+=s+7>>3;else if(y=="o21")i.length>2&&!l&&(u=i.shift()+o.nominalWidthX,l=!0),b+=i.pop(),m+=i.pop(),c&&r.U.P.closePath(n),r.U.P.moveTo(n,m,b),c=!0;else if(y=="o22")i.length>1&&!l&&(u=i.shift()+o.nominalWidthX,l=!0),m+=i.pop(),c&&r.U.P.closePath(n),r.U.P.moveTo(n,m,b),c=!0;else if(y=="o25"){for(;i.length>6;)m+=i.shift(),b+=i.shift(),r.U.P.lineTo(n,m,b);L=m+i.shift(),F=b+i.shift(),U=L+i.shift(),_=F+i.shift(),m=U+i.shift(),b=_+i.shift(),r.U.P.curveTo(n,L,F,U,_,m,b)}else if(y=="o26")for(i.length%2&&(m+=i.shift());i.length>0;)L=m,F=b+i.shift(),m=U=L+i.shift(),b=(_=F+i.shift())+i.shift(),r.U.P.curveTo(n,L,F,U,_,m,b);else if(y=="o27")for(i.length%2&&(b+=i.shift());i.length>0;)F=b,U=(L=m+i.shift())+i.shift(),_=F+i.shift(),m=U+i.shift(),b=_,r.U.P.curveTo(n,L,F,U,_,m,b);else if(y=="o10"||y=="o29"){var C=y=="o10"?o:a;if(i.length==0)console.debug("error: empty stack");else{var k=i.pop(),N=C.Subrs[k+C.Bias];e.x=m,e.y=b,e.nStems=s,e.haveWidth=l,e.width=u,e.open=c,r.U._drawCFF(N,e,a,o,n),m=e.x,b=e.y,s=e.nStems,l=e.haveWidth,u=e.width,c=e.open}}else if(y=="o30"||y=="o31"){var E=i.length,z=(Z=0,y=="o31");for(Z+=E-(O=-3&E);Z<O;)z?(F=b,U=(L=m+i.shift())+i.shift(),b=(_=F+i.shift())+i.shift(),O-Z==5?(m=U+i.shift(),Z++):m=U,z=!1):(L=m,F=b+i.shift(),U=L+i.shift(),_=F+i.shift(),m=U+i.shift(),O-Z==5?(b=_+i.shift(),Z++):b=_,z=!0),r.U.P.curveTo(n,L,F,U,_,m,b),Z+=4}else{if((y+"").charAt(0)=="o")throw console.debug("Unknown operation: "+y,t),y;i.push(y)}}}e.x=m,e.y=b,e.nStems=s,e.haveWidth=l,e.width=u,e.open=c};var d=r,f={Typr:d};return h.Typr=d,h.default=f,Object.defineProperty(h,"__esModule",{value:!0}),h}({}).Typr}p(wa,"typrFactory");function Fa(){return function(h){var r=Uint8Array,d=Uint16Array,f=Uint32Array,t=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),e=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=p(function(y,O){for(var w=new d(31),j=0;j<31;++j)w[j]=O+=1<<y[j-1];var P=new f(w[30]);for(j=1;j<30;++j)for(var Z=w[j];Z<w[j+1];++Z)P[Z]=Z-w[j]<<5|j;return[w,P]},"f"),n=o(t,2),i=n[0],s=n[1];i[28]=258,s[258]=28;for(var l=o(e,0)[0],u=new d(32768),c=0;c<32768;++c){var g=(43690&c)>>>1|(21845&c)<<1;g=(61680&(g=(52428&g)>>>2|(13107&g)<<2))>>>4|(3855&g)<<4,u[c]=((65280&g)>>>8|(255&g)<<8)>>>1}var m=p(function(y,O,w){for(var j=y.length,P=0,Z=new d(O);P<j;++P)++Z[y[P]-1];var se,I=new d(O);for(P=0;P<O;++P)I[P]=I[P-1]+Z[P-1]<<1;if(w){se=new d(1<<O);var R=15-O;for(P=0;P<j;++P)if(y[P])for(var v=P<<4|y[P],T=O-y[P],M=I[y[P]-1]++<<T,C=M|(1<<T)-1;M<=C;++M)se[u[M]>>>R]=v}else for(se=new d(j),P=0;P<j;++P)y[P]&&(se[P]=u[I[y[P]-1]++]>>>15-y[P]);return se},"w"),b=new r(288);for(c=0;c<144;++c)b[c]=8;for(c=144;c<256;++c)b[c]=9;for(c=256;c<280;++c)b[c]=7;for(c=280;c<288;++c)b[c]=8;var L=new r(32);for(c=0;c<32;++c)L[c]=5;var F=m(b,9,1),U=m(L,5,1),_=p(function(y){for(var O=y[0],w=1;w<y.length;++w)y[w]>O&&(O=y[w]);return O},"y"),S=p(function(y,O,w){var j=O/8|0;return(y[j]|y[j+1]<<8)>>(7&O)&w},"L"),D=p(function(y,O){var w=O/8|0;return(y[w]|y[w+1]<<8|y[w+2]<<16)>>(7&O)},"U"),x=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],A=p(function(y,O,w){var j=new Error(O||x[y]);if(j.code=y,Error.captureStackTrace&&Error.captureStackTrace(j,A),!w)throw j;return j},"T"),W=p(function(y,O,w){var j=y.length;if(!j||w&&!w.l&&j<5)return O||new r(0);var P=!O||w,Z=!w||w.i;w||(w={}),O||(O=new r(3*j));var se,I=p(function(fe){var Se=O.length;if(fe>Se){var we=new r(Math.max(2*Se,fe));we.set(O),O=we}},"d"),R=w.f||0,v=w.p||0,T=w.b||0,M=w.l,C=w.d,k=w.m,N=w.n,E=8*j;do{if(!M){w.f=R=S(y,v,1);var z=S(y,v+1,3);if(v+=3,!z){var J=y[($=((se=v)/8|0)+(7&se&&1)+4)-4]|y[$-3]<<8,ee=$+J;if(ee>j){Z&&A(0);break}P&&I(T+J),O.set(y.subarray($,ee),T),w.b=T+=J,w.p=v=8*ee;continue}if(z==1)M=F,C=U,k=9,N=5;else if(z==2){var H=S(y,v,31)+257,V=S(y,v+10,15)+4,ge=H+S(y,v+5,31)+1;v+=14;for(var ce=new r(ge),q=new r(19),te=0;te<V;++te)q[a[te]]=S(y,v+3*te,7);v+=3*V;var le=_(q),X=(1<<le)-1,re=m(q,le,1);for(te=0;te<ge;){var $,G=re[S(y,v,X)];if(v+=15&G,($=G>>>4)<16)ce[te++]=$;else{var de=0,Q=0;for($==16?(Q=3+S(y,v,3),v+=2,de=ce[te-1]):$==17?(Q=3+S(y,v,7),v+=3):$==18&&(Q=11+S(y,v,127),v+=7);Q--;)ce[te++]=de}}var ae=ce.subarray(0,H),K=ce.subarray(H);k=_(ae),N=_(K),M=m(ae,k,1),C=m(K,N,1)}else A(1);if(v>E){Z&&A(0);break}}P&&I(T+131072);for(var xe=(1<<k)-1,ne=(1<<N)-1,oe=v;;oe=v){var ue=(de=M[D(y,v)&xe])>>>4;if((v+=15&de)>E){Z&&A(0);break}if(de||A(2),ue<256)O[T++]=ue;else{if(ue==256){oe=v,M=null;break}var ve=ue-254;if(ue>264){var ke=t[te=ue-257];ve=S(y,v,(1<<ke)-1)+i[te],v+=ke}var Ae=C[D(y,v)&ne],me=Ae>>>4;if(Ae||A(3),v+=15&Ae,K=l[me],me>3&&(ke=e[me],K+=D(y,v)&(1<<ke)-1,v+=ke),v>E){Z&&A(0);break}P&&I(T+131072);for(var ye=T+ve;T<ye;T+=4)O[T]=O[T-K],O[T+1]=O[T+1-K],O[T+2]=O[T+2-K],O[T+3]=O[T+3-K];T=ye}}w.l=M,w.p=oe,w.b=T,M&&(R=1,w.m=k,w.d=C,w.n=N)}while(!R);return T==O.length?O:function(fe,Se,we){(Se==null||Se<0)&&(Se=0),(we==null||we>fe.length)&&(we=fe.length);var Le=new(fe instanceof d?d:fe instanceof f?f:r)(we-Se);return Le.set(fe.subarray(Se,we)),Le}(O,0,T)},"O"),B=new r(0),Y=typeof TextDecoder<"u"&&new TextDecoder;try{Y.decode(B,{stream:!0})}catch{}return h.convert_streams=function(y){var O=new DataView(y),w=0;function j(){var H=O.getUint16(w);return w+=2,H}p(j,"t");function P(){var H=O.getUint32(w);return w+=4,H}p(P,"a");function Z(H){J.setUint16(ee,H),ee+=2}p(Z,"i");function se(H){J.setUint32(ee,H),ee+=4}p(se,"o");for(var I={signature:P(),flavor:P(),length:P(),numTables:j(),reserved:j(),totalSfntSize:P(),majorVersion:j(),minorVersion:j(),metaOffset:P(),metaLength:P(),metaOrigLength:P(),privOffset:P(),privLength:P()},R=0;Math.pow(2,R)<=I.numTables;)R++;R--;for(var v=16*Math.pow(2,R),T=16*I.numTables-v,M=12,C=[],k=0;k<I.numTables;k++)C.push({tag:P(),offset:P(),compLength:P(),origLength:P(),origChecksum:P()}),M+=16;var N,E=new Uint8Array(12+16*C.length+C.reduce(function(H,V){return H+V.origLength+4},0)),z=E.buffer,J=new DataView(z),ee=0;return se(I.flavor),Z(I.numTables),Z(v),Z(R),Z(T),C.forEach(function(H){se(H.tag),se(H.origChecksum),se(M),se(H.origLength),H.outOffset=M,(M+=H.origLength)%4!=0&&(M+=4-M%4)}),C.forEach(function(H){var V,ge=y.slice(H.offset,H.offset+H.compLength);if(H.compLength!=H.origLength){var ce=new Uint8Array(H.origLength);V=new Uint8Array(ge,2),W(V,ce)}else ce=new Uint8Array(ge);E.set(ce,H.outOffset);var q=0;(M=H.outOffset+H.origLength)%4!=0&&(q=4-M%4),E.set(new Uint8Array(q).buffer,H.outOffset+H.origLength),N=M+q}),z.slice(0,N)},Object.defineProperty(h,"__esModule",{value:!0}),h}({}).convert_streams}p(Fa,"woff2otfFactory");function Ma(h,r){let d={M:2,L:2,Q:4,C:6,Z:0},f={C:"18g,ca,368,1kz",D:"17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",R:"17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",L:"x9u,jff,a,fd,jv",T:"4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"},t=1,e=2,a=4,o=8,n=16,i=32,s;function l(x){if(!s){let A={R:e,L:t,D:a,C:n,U:i,T:o};s=new Map;for(let W in f){let B=0;f[W].split(",").forEach(Y=>{let[y,O]=Y.split("+");y=parseInt(y,36),O=O?parseInt(O,36):0,s.set(B+=y,A[W]);for(let w=O;w--;)s.set(++B,A[W])})}}return s.get(x)||i}p(l,"getCharJoiningType");let u=1,c=2,g=3,m=4,b=[null,"isol","init","fina","medi"];function L(x){let A=new Uint8Array(x.length),W=i,B=u,Y=-1;for(let y=0;y<x.length;y++){let O=x.codePointAt(y),w=l(O)|0,j=u;w&o||(W&(t|a|n)?w&(e|a|n)?(j=g,(B===u||B===g)&&A[Y]++):w&(t|i)&&(B===c||B===m)&&A[Y]--:W&(e|i)&&(B===c||B===m)&&A[Y]--,B=A[y]=j,W=w,Y=y,O>65535&&y++)}return A}p(L,"detectJoiningForms");function F(x,A){let W=[];for(let Y=0;Y<A.length;Y++){let y=A.codePointAt(Y);y>65535&&Y++,W.push(h.U.codeToGlyph(x,y))}let B=x.GSUB;if(B){let{lookupList:Y,featureList:y}=B,O,w=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,j=[];y.forEach(P=>{if(w.test(P.tag))for(let Z=0;Z<P.tab.length;Z++){if(j[P.tab[Z]])continue;j[P.tab[Z]]=!0;let se=Y[P.tab[Z]],I=/^(isol|init|fina|medi)$/.test(P.tag);I&&!O&&(O=L(A));for(let R=0;R<W.length;R++)(!O||!I||b[O[R]]===P.tag)&&h.U._applySubs(W,R,se,Y)}})}return W}p(F,"stringToGlyphs");function U(x,A){let W=new Int16Array(A.length*3),B=0;for(;B<A.length;B++){let w=A[B];if(w===-1)continue;W[B*3+2]=x.hmtx.aWidth[w];let j=x.GPOS;if(j){let P=j.lookupList;for(let Z=0;Z<P.length;Z++){let se=P[Z];for(let I=0;I<se.tabs.length;I++){let R=se.tabs[I];if(se.ltype===1){if(h._lctf.coverageIndex(R.coverage,w)!==-1&&R.pos){O(R.pos,B);break}}else if(se.ltype===2){let v=null,T=Y();if(T!==-1){let M=h._lctf.coverageIndex(R.coverage,A[T]);if(M!==-1){if(R.fmt===1){let C=R.pairsets[M];for(let k=0;k<C.length;k++)C[k].gid2===w&&(v=C[k])}else if(R.fmt===2){let C=h.U._getGlyphClass(A[T],R.classDef1),k=h.U._getGlyphClass(w,R.classDef2);v=R.matrix[C][k]}if(v){v.val1&&O(v.val1,T),v.val2&&O(v.val2,B);break}}}}else if(se.ltype===4){let v=h._lctf.coverageIndex(R.markCoverage,w);if(v!==-1){let T=Y(y),M=T===-1?-1:h._lctf.coverageIndex(R.baseCoverage,A[T]);if(M!==-1){let C=R.markArray[v],k=R.baseArray[M][C.markClass];W[B*3]=k.x-C.x+W[T*3]-W[T*3+2],W[B*3+1]=k.y-C.y+W[T*3+1];break}}}else if(se.ltype===6){let v=h._lctf.coverageIndex(R.mark1Coverage,w);if(v!==-1){let T=Y();if(T!==-1){let M=A[T];if(_(x,M)===3){let C=h._lctf.coverageIndex(R.mark2Coverage,M);if(C!==-1){let k=R.mark1Array[v],N=R.mark2Array[C][k.markClass];W[B*3]=N.x-k.x+W[T*3]-W[T*3+2],W[B*3+1]=N.y-k.y+W[T*3+1];break}}}}}}}}else if(x.kern&&!x.cff){let P=Y();if(P!==-1){let Z=x.kern.glyph1.indexOf(A[P]);if(Z!==-1){let se=x.kern.rval[Z].glyph2.indexOf(w);se!==-1&&(W[P*3+2]+=x.kern.rval[Z].vals[se])}}}}return W;function Y(w){for(let j=B-1;j>=0;j--)if(A[j]!==-1&&(!w||w(A[j])))return j;return-1}function y(w){return _(x,w)===1}function O(w,j){for(let P=0;P<3;P++)W[j*3+P]+=w[P]||0}}p(U,"calcGlyphPositions");function _(x,A){let W=x.GDEF&&x.GDEF.glyphClassDef;return W?h.U._getGlyphClass(A,W):0}p(_,"getGlyphClass");function S(...x){for(let A=0;A<x.length;A++)if(typeof x[A]=="number")return x[A]}p(S,"firstNum");function D(x){let A=Object.create(null),W=x["OS/2"],B=x.hhea,Y=x.head.unitsPerEm,y=S(W&&W.sTypoAscender,B&&B.ascender,Y),O={unitsPerEm:Y,ascender:y,descender:S(W&&W.sTypoDescender,B&&B.descender,0),capHeight:S(W&&W.sCapHeight,y),xHeight:S(W&&W.sxHeight,y),lineGap:S(W&&W.sTypoLineGap,B&&B.lineGap),supportsCodePoint(w){return h.U.codeToGlyph(x,w)>0},forEachGlyph(w,j,P,Z){let se=0,I=1/O.unitsPerEm*j,R=F(x,w),v=0,T=U(x,R);return R.forEach((M,C)=>{if(M!==-1){let k=A[M];if(!k){let{cmds:N,crds:E}=h.U.glyphToPath(x,M),z="",J=0;for(let ce=0,q=N.length;ce<q;ce++){let te=d[N[ce]];z+=N[ce];for(let le=1;le<=te;le++)z+=(le>1?",":"")+E[J++]}let ee,H,V,ge;if(E.length){ee=H=1/0,V=ge=-1/0;for(let ce=0,q=E.length;ce<q;ce+=2){let te=E[ce],le=E[ce+1];te<ee&&(ee=te),le<H&&(H=le),te>V&&(V=te),le>ge&&(ge=le)}}else ee=V=H=ge=0;k=A[M]={index:M,advanceWidth:x.hmtx.aWidth[M],xMin:ee,yMin:H,xMax:V,yMax:ge,path:z}}Z.call(null,k,se+T[C*3]*I,T[C*3+1]*I,v),se+=T[C*3+2]*I,P&&(se+=P*j)}v+=w.codePointAt(v)>65535?2:1}),se}};return O}return p(D,"wrapFontObj"),p(function(A){let W=new Uint8Array(A,0,4),B=h._bin.readASCII(W,0,4);if(B==="wOFF")A=r(A);else if(B==="wOF2")throw new Error("woff2 fonts not supported");return D(h.parse(A)[0])},"parse")}p(Ma,"parserFactory");var Aa=it({name:"Typr Font Parser",dependencies:[wa,Fa,Ma],init(h,r,d){let f=h(),t=r();return d(f,t)}});function Da(){return function(h){var r=p(function(){this.buckets=new Map},"n");r.prototype.add=function(U){var _=U>>5;this.buckets.set(_,(this.buckets.get(_)||0)|1<<(31&U))},r.prototype.has=function(U){var _=this.buckets.get(U>>5);return _!==void 0&&(_&1<<(31&U))!=0},r.prototype.serialize=function(){var U=[];return this.buckets.forEach(function(_,S){U.push((+S).toString(36)+":"+_.toString(36))}),U.join(",")},r.prototype.deserialize=function(U){var _=this;this.buckets.clear(),U.split(",").forEach(function(S){var D=S.split(":");_.buckets.set(parseInt(D[0],36),parseInt(D[1],36))})};var d=Math.pow(2,8),f=d-1,t=~f;function e(U){var _=function(D){return D&t}(U).toString(16),S=function(D){return(D&t)+d-1}(U).toString(16);return"codepoint-index/plane"+(U>>16)+"/"+_+"-"+S+".json"}p(e,"a");function a(U,_){var S=U&f,D=_.codePointAt(S/6|0);return((D=(D||48)-48)&1<<S%6)!=0}p(a,"i");function o(U,_){var S;(S=U,S.replace(/U\+/gi,"").replace(/^,+|,+$/g,"").split(/,+/).map(function(D){return D.split("-").map(function(x){return parseInt(x.trim(),16)})})).forEach(function(D){var x=D[0],A=D[1];A===void 0&&(A=x),_(x,A)})}p(o,"u");function n(U,_){o(U,function(S,D){for(var x=S;x<=D;x++)_(x)})}p(n,"c");var i={},s={},l=new WeakMap,u="https://cdn.jsdelivr.net/gh/lojjic/unicode-font-resolver@v1.0.1/packages/data";function c(U){var _=l.get(U);return _||(_=new r,n(U.ranges,function(S){return _.add(S)}),l.set(U,_)),_}p(c,"d");var g,m=new Map;function b(U,_,S){return U[_]?_:U[S]?S:function(D){for(var x in D)return x}(U)}p(b,"g");function L(U,_){var S=_;if(!U.includes(S)){S=1/0;for(var D=0;D<U.length;D++)Math.abs(U[D]-_)<Math.abs(S-_)&&(S=U[D])}return S}p(L,"w");function F(U){return g||(g=new Set,n("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000",function(_){g.add(_)})),g.has(U)}return p(F,"k"),h.CodePointSet=r,h.clearCache=function(){i={},s={}},h.getFontsForString=function(U,_){_===void 0&&(_={});var S,D=_.lang;D===void 0&&(D=new RegExp("\\p{Script=Hangul}","u").test(S=U)?"ko":new RegExp("\\p{Script=Hiragana}|\\p{Script=Katakana}","u").test(S)?"ja":"en");var x=_.category;x===void 0&&(x="sans-serif");var A=_.style;A===void 0&&(A="normal");var W=_.weight;W===void 0&&(W=400);var B=(_.dataUrl||u).replace(/\/$/g,""),Y=new Map,y=new Uint8Array(U.length),O={},w={},j=new Array(U.length),P=new Map,Z=!1;function se(v){var T=m.get(v);return T||(T=fetch(B+"/"+v).then(function(M){if(!M.ok)throw new Error(M.statusText);return M.json().then(function(C){if(!Array.isArray(C)||C[0]!==1)throw new Error("Incorrect schema version; need 1, got "+C[0]);return C[1]})}).catch(function(M){if(B!==u)return Z||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+B+'", trying default CDN. '+M.message),Z=!0),B=u,m.delete(v),se(v);throw M}),m.set(v,T)),T}p(se,"M");for(var I=function(v){var T=U.codePointAt(v),M=e(T);j[v]=M,i[M]||P.has(M)||P.set(M,se(M).then(function(C){i[M]=C})),T>65535&&(v++,R=v)},R=0;R<U.length;R++)I(R);return Promise.all(P.values()).then(function(){P.clear();for(var v=function(M){var C=U.codePointAt(M),k=null,N=i[j[M]],E=void 0;for(var z in N){var J=w[z];if(J===void 0&&(J=w[z]=new RegExp(z).test(D||"en")),J){for(var ee in E=z,N[z])if(a(C,N[z][ee])){k=ee;break}break}}if(!k){e:for(var H in N)if(H!==E){for(var V in N[H])if(a(C,N[H][V])){k=V;break e}}}k||(console.debug("No font coverage for U+"+C.toString(16)),k="latin"),j[M]=k,s[k]||P.has(k)||P.set(k,se("font-meta/"+k+".json").then(function(ge){s[k]=ge})),C>65535&&(M++,T=M)},T=0;T<U.length;T++)v(T);return Promise.all(P.values())}).then(function(){for(var v,T=null,M=0;M<U.length;M++){var C=U.codePointAt(M);if(T&&(F(C)||c(T).has(C)))y[M]=y[M-1];else{T=s[j[M]];var k=O[T.id];if(!k){var N=T.typeforms,E=b(N,x,"sans-serif"),z=b(N[E],A,"normal"),J=L((v=N[E])===null||v===void 0?void 0:v[z],W);k=O[T.id]=B+"/font-files/"+T.id+"/"+E+"."+z+"."+J+".woff"}var ee=Y.get(k);ee==null&&(ee=Y.size,Y.set(k,ee)),y[M]=ee}C>65535&&(M++,y[M]=y[M-1])}return{fontUrls:Array.from(Y.keys()),chars:y}})},Object.defineProperty(h,"__esModule",{value:!0}),h}({})}p(Da,"unicodeFontResolverClientFactory");function Ca(h,r){let d=Object.create(null),f=Object.create(null);function t(a,o){let n=p(i=>{console.error("Failure loading font ".concat(a),i)},"onError");try{let i=new XMLHttpRequest;i.open("get",a,!0),i.responseType="arraybuffer",i.onload=function(){if(i.status>=400)n(new Error(i.statusText));else if(i.status>0)try{let s=h(i.response);s.src=a,o(s)}catch(s){n(s)}},i.onerror=n,i.send()}catch(i){n(i)}}p(t,"doLoadFont");function e(a,o){let n=d[a];n?o(n):f[a]?f[a].push(o):(f[a]=[o],t(a,i=>{i.src=a,d[a]=i,f[a].forEach(s=>s(i)),delete f[a]}))}return p(e,"loadFont"),function(a,o,{lang:n,fonts:i=[],style:s="normal",weight:l="normal",unicodeFontsURL:u}={}){let c=new Uint8Array(a.length),g=[];a.length||F();let m=new Map,b=[];if(s!=="italic"&&(s="normal"),typeof l!="number"&&(l=l==="bold"?700:400),i&&!Array.isArray(i)&&(i=[i]),i=i.slice().filter(_=>!_.lang||_.lang.test(n)).reverse(),i.length){let x=0;p(function A(W=0){for(let B=W,Y=a.length;B<Y;B++){let y=a.codePointAt(B);if(x===1&&g[c[B-1]].supportsCodePoint(y)||B>0&&/\s/.test(a[B]))c[B]=c[B-1],x===2&&(b[b.length-1][1]=B);else for(let O=c[B],w=i.length;O<=w;O++)if(O===w){let j=x===2?b[b.length-1]:b[b.length]=[B,B];j[1]=B,x=2}else{c[B]=O;let{src:j,unicodeRange:P}=i[O];if(!P||U(y,P)){let Z=d[j];if(!Z){e(j,()=>{A(B)});return}if(Z.supportsCodePoint(y)){let se=m.get(Z);typeof se!="number"&&(se=g.length,g.push(Z),m.set(Z,se)),c[B]=se,x=1;break}}}y>65535&&B+1<Y&&(c[B+1]=c[B],B++,x===2&&(b[b.length-1][1]=B))}L()},"resolveUserFonts")()}else b.push([0,a.length-1]),L();function L(){if(b.length){let _=b.map(S=>a.substring(S[0],S[1]+1)).join("\n");r.getFontsForString(_,{lang:n||void 0,style:s,weight:l,dataUrl:u}).then(({fontUrls:S,chars:D})=>{let x=g.length,A=0;b.forEach(B=>{for(let Y=0,y=B[1]-B[0];Y<=y;Y++)c[B[0]+Y]=D[A++]+x;A++});let W=0;S.forEach((B,Y)=>{e(B,y=>{g[Y+x]=y,++W===S.length&&F()})})})}else F()}p(L,"resolveFallbacks");function F(){o({chars:c,fonts:g})}p(F,"allDone");function U(_,S){for(let D=0;D<S.length;D++){let[x,A=x]=S[D];if(x<=_&&_<=A)return!0}return!1}p(U,"isCodeInRanges")}}p(Ca,"createFontResolver");var Ea=it({name:"FontResolver",dependencies:[Ca,Aa,Da],init(h,r,d){return h(r,d())}});function Ba(h,r){let f=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,t="[^\\S\\u00A0]",e=new RegExp("".concat(t,"|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]"));function a({text:g,lang:m,fonts:b,style:L,weight:F,preResolvedFonts:U,unicodeFontsURL:_},S){let D=p(({chars:x,fonts:A})=>{let W,B,Y=[];for(let y=0;y<x.length;y++)x[y]!==B?(B=x[y],Y.push(W={start:y,end:y,fontObj:A[x[y]]})):W.end=y;S(Y)},"onResolved");U?D(U):h(g,D,{lang:m,fonts:b,style:L,weight:F,unicodeFontsURL:_})}p(a,"calculateFontRuns");function o({text:g="",font:m,lang:b,sdfGlyphSize:L=64,fontSize:F=400,fontWeight:U=1,fontStyle:_="normal",letterSpacing:S=0,lineHeight:D="normal",maxWidth:x=1/0,direction:A,textAlign:W="left",textIndent:B=0,whiteSpace:Y="normal",overflowWrap:y="normal",anchorX:O=0,anchorY:w=0,metricsOnly:j=!1,unicodeFontsURL:P,preResolvedFonts:Z=null,includeCaretPositions:se=!1,chunkedBoundsSize:I=8192,colorRanges:R=null},v){let T=l(),M={fontLoad:0,typesetting:0};g.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),g=g.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),F=+F,S=+S,x=+x,D=D||"normal",B=+B,a({text:g,lang:b,style:_,weight:U,fonts:typeof m=="string"?[{src:m}]:m,unicodeFontsURL:P,preResolvedFonts:Z},C=>{M.fontLoad=l()-T;let k=isFinite(x),N=null,E=null,z=null,J=null,ee=null,H=null,V=null,ge=null,ce=0,q=0,te=Y!=="nowrap",le=new Map,X=l(),re=B,$=0,G=new u,de=[G];C.forEach(ne=>{let{fontObj:oe}=ne,{ascender:ue,descender:ve,unitsPerEm:ke,lineGap:Ae,capHeight:me,xHeight:ye}=oe,fe=le.get(oe);if(!fe){let he=F/ke,Te=D==="normal"?(ue-ve+Ae)*he:D*F,Ze=(Te-(ue-ve)*he)/2,_e=Math.min(Te,(ue-ve)*he),be=(ue+ve)/2*he+_e/2;fe={index:le.size,src:oe.src,fontObj:oe,fontSizeMult:he,unitsPerEm:ke,ascender:ue*he,descender:ve*he,capHeight:me*he,xHeight:ye*he,lineHeight:Te,baseline:-Ze-ue*he,caretTop:be,caretBottom:be-_e},le.set(oe,fe)}let{fontSizeMult:Se}=fe,we=g.slice(ne.start,ne.end+1),Le,Ue;oe.forEachGlyph(we,F,S,(he,Te,Ze,_e)=>{Te+=$,_e+=ne.start,Le=Te,Ue=he;let be=g.charAt(_e),De=he.advanceWidth*Se,Fe=G.count,pe;if("isEmpty"in he||(he.isWhitespace=!!be&&new RegExp(t).test(be),he.canBreakAfter=!!be&&e.test(be),he.isEmpty=he.xMin===he.xMax||he.yMin===he.yMax||f.test(be)),!he.isWhitespace&&!he.isEmpty&&q++,te&&k&&!he.isWhitespace&&Te+De+re>x&&Fe){if(G.glyphAt(Fe-1).glyphObj.canBreakAfter)pe=new u,re=-Te;else for(let Oe=Fe;Oe--;)if(Oe===0&&y==="break-word"){pe=new u,re=-Te;break}else if(G.glyphAt(Oe).glyphObj.canBreakAfter){pe=G.splitAt(Oe+1);let Be=pe.glyphAt(0).x;re-=Be;for(let Ce=pe.count;Ce--;)pe.glyphAt(Ce).x-=Be;break}pe&&(G.isSoftWrapped=!0,G=pe,de.push(G),ce=x)}let Me=G.glyphAt(G.count);Me.glyphObj=he,Me.x=Te+re,Me.y=Ze,Me.width=De,Me.charIndex=_e,Me.fontData=fe,be==="\n"&&(G=new u,de.push(G),re=-(Te+De+S*F)+B)}),$=Le+Ue.advanceWidth*Se+S*F});let Q=0;de.forEach(ne=>{let oe=!0;for(let ue=ne.count;ue--;){let ve=ne.glyphAt(ue);oe&&!ve.glyphObj.isWhitespace&&(ne.width=ve.x+ve.width,ne.width>ce&&(ce=ne.width),oe=!1);let{lineHeight:ke,capHeight:Ae,xHeight:me,baseline:ye}=ve.fontData;ke>ne.lineHeight&&(ne.lineHeight=ke);let fe=ye-ne.baseline;fe<0&&(ne.baseline+=fe,ne.cap+=fe,ne.ex+=fe),ne.cap=Math.max(ne.cap,ne.baseline+Ae),ne.ex=Math.max(ne.ex,ne.baseline+me)}ne.baseline-=Q,ne.cap-=Q,ne.ex-=Q,Q+=ne.lineHeight});let ae=0,K=0;if(O&&(typeof O=="number"?ae=-O:typeof O=="string"&&(ae=-ce*(O==="left"?0:O==="center"?.5:O==="right"?1:i(O)))),w&&(typeof w=="number"?K=-w:typeof w=="string"&&(K=w==="top"?0:w==="top-baseline"?-de[0].baseline:w==="top-cap"?-de[0].cap:w==="top-ex"?-de[0].ex:w==="middle"?Q/2:w==="bottom"?Q:w==="bottom-baseline"?-de[de.length-1].baseline:i(w)*Q)),!j){let ne=r.getEmbeddingLevels(g,A);N=new Uint16Array(q),E=new Uint8Array(q),z=new Float32Array(q*2),J={},V=[1/0,1/0,-1/0,-1/0],ge=[],se&&(H=new Float32Array(g.length*4)),R&&(ee=new Uint8Array(q*3));let oe=0,ue=-1,ve=-1,ke,Ae;if(de.forEach((me,ye)=>{let{count:fe,width:Se}=me;if(fe>0){let we=0;for(let _e=fe;_e--&&me.glyphAt(_e).glyphObj.isWhitespace;)we++;let Le=0,Ue=0;if(W==="center")Le=(ce-Se)/2;else if(W==="right")Le=ce-Se;else if(W==="justify"&&me.isSoftWrapped){let _e=0;for(let be=fe-we;be--;)me.glyphAt(be).glyphObj.isWhitespace&&_e++;Ue=(ce-Se)/_e}if(Ue||Le){let _e=0;for(let be=0;be<fe;be++){let De=me.glyphAt(be),Fe=De.glyphObj;De.x+=Le+_e,Ue!==0&&Fe.isWhitespace&&be<fe-we&&(_e+=Ue,De.width+=Ue)}}let he=r.getReorderSegments(g,ne,me.glyphAt(0).charIndex,me.glyphAt(me.count-1).charIndex);for(let _e=0;_e<he.length;_e++){let[be,De]=he[_e],Fe=1/0,pe=-1/0;for(let Me=0;Me<fe;Me++)if(me.glyphAt(Me).charIndex>=be){let Oe=Me,Be=Me;for(;Be<fe;Be++){let Ce=me.glyphAt(Be);if(Ce.charIndex>De)break;Be<fe-we&&(Fe=Math.min(Fe,Ce.x),pe=Math.max(pe,Ce.x+Ce.width))}for(let Ce=Oe;Ce<Be;Ce++){let Ne=me.glyphAt(Ce);Ne.x=pe-(Ne.x+Ne.width-Fe)}break}}let Te,Ze=p(_e=>Te=_e,"setGlyphObj");for(let _e=0;_e<fe;_e++){let be=me.glyphAt(_e);Te=be.glyphObj;let De=Te.index,Fe=ne.levels[be.charIndex]&1;if(Fe){let pe=r.getMirroredCharacter(g[be.charIndex]);pe&&be.fontData.fontObj.forEachGlyph(pe,0,0,Ze)}if(se){let{charIndex:pe,fontData:Me}=be,Oe=be.x+ae,Be=be.x+be.width+ae;H[pe*4]=Fe?Be:Oe,H[pe*4+1]=Fe?Oe:Be,H[pe*4+2]=me.baseline+Me.caretBottom+K,H[pe*4+3]=me.baseline+Me.caretTop+K;let Ce=pe-ue;Ce>1&&s(H,ue,Ce),ue=pe}if(R){let{charIndex:pe}=be;for(;pe>ve;)ve++,R.hasOwnProperty(ve)&&(Ae=R[ve])}if(!Te.isWhitespace&&!Te.isEmpty){let pe=oe++,{fontSizeMult:Me,src:Oe,index:Be}=be.fontData,Ce=J[Oe]||(J[Oe]={});Ce[De]||(Ce[De]={path:Te.path,pathBounds:[Te.xMin,Te.yMin,Te.xMax,Te.yMax]});let Ne=be.x+ae,qe=be.y+me.baseline+K;z[pe*2]=Ne,z[pe*2+1]=qe;let Je=Ne+Te.xMin*Me,$e=qe+Te.yMin*Me,nt=Ne+Te.xMax*Me,Ke=qe+Te.yMax*Me;Je<V[0]&&(V[0]=Je),$e<V[1]&&(V[1]=$e),nt>V[2]&&(V[2]=nt),Ke>V[3]&&(V[3]=Ke),pe%I===0&&(ke={start:pe,end:pe,rect:[1/0,1/0,-1/0,-1/0]},ge.push(ke)),ke.end++;let Re=ke.rect;if(Je<Re[0]&&(Re[0]=Je),$e<Re[1]&&(Re[1]=$e),nt>Re[2]&&(Re[2]=nt),Ke>Re[3]&&(Re[3]=Ke),N[pe]=De,E[pe]=Be,R){let at=pe*3;ee[at]=Ae>>16&255,ee[at+1]=Ae>>8&255,ee[at+2]=Ae&255}}}}}),H){let me=g.length-ue;me>1&&s(H,ue,me)}}let xe=[];le.forEach(({index:ne,src:oe,unitsPerEm:ue,ascender:ve,descender:ke,lineHeight:Ae,capHeight:me,xHeight:ye})=>{xe[ne]={src:oe,unitsPerEm:ue,ascender:ve,descender:ke,lineHeight:Ae,capHeight:me,xHeight:ye}}),M.typesetting=l()-X,v({glyphIds:N,glyphFontIndices:E,glyphPositions:z,glyphData:J,fontData:xe,caretPositions:H,glyphColors:ee,chunkedBounds:ge,fontSize:F,topBaseline:K+de[0].baseline,blockBounds:[ae,K-Q,ae+ce,K],visibleBounds:V,timings:M})})}p(o,"typeset");function n(g,m){o({...g,metricsOnly:!0},b=>{let[L,F,U,_]=b.blockBounds;m({width:U-L,height:_-F})})}p(n,"measure");function i(g){let m=g.match(/^([\d.]+)%$/),b=m?parseFloat(m[1]):NaN;return isNaN(b)?0:b/100}p(i,"parsePercent");function s(g,m,b){let L=g[m*4],F=g[m*4+1],U=g[m*4+2],_=g[m*4+3],S=(F-L)/b;for(let D=0;D<b;D++){let x=(m+D)*4;g[x]=L+S*D,g[x+1]=L+S*(D+1),g[x+2]=U,g[x+3]=_}}p(s,"fillLigatureCaretPositions");function l(){return(self.performance||Date).now()}p(l,"now");function u(){this.data=[]}p(u,"TextLine");let c=["glyphObj","x","y","width","charIndex","fontData"];return u.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/c.length)},glyphAt(g){let m=u.flyweight;return m.data=this.data,m.index=g,m},splitAt(g){let m=new u;return m.data=this.data.splice(g*c.length),m}},u.flyweight=c.reduce((g,m,b,L)=>(Object.defineProperty(g,m,{get(){return this.data[this.index*c.length+b]},set(F){this.data[this.index*c.length+b]=F}}),g),{data:null,index:0}),{typeset:o,measure:n}}p(Ba,"createTypesetter");var ft=p(()=>(self.performance||Date).now(),"now"),er=Ar(),Pn;function Oa(h,r,d,f,t,e,a,o,n,i,s=!0){return s?La(h,r,d,f,t,e,a,o,n,i).then(null,l=>(Pn||(console.warn("WebGL SDF generation failed, falling back to JS",l),Pn=!0),zn(h,r,d,f,t,e,a,o,n,i))):zn(h,r,d,f,t,e,a,o,n,i)}p(Oa,"generateSDF");var Zt=[],Ra=5,Rr=0;function Kn(){let h=ft();for(;Zt.length&&ft()-h<Ra;)Zt.shift()();Rr=Zt.length?setTimeout(Kn,0):0}p(Kn,"nextChunk");var La=p((...h)=>new Promise((r,d)=>{Zt.push(()=>{let f=ft();try{er.webgl.generateIntoCanvas(...h),r({timing:ft()-f})}catch(t){d(t)}}),Rr||(Rr=setTimeout(Kn,0))}),"generateSDF_GL"),Ga=4,Pa=2e3,In={},Ia=0;function zn(h,r,d,f,t,e,a,o,n,i){let s="TroikaTextSDFGenerator_JS_"+Ia++%Ga,l=In[s];return l||(l=In[s]={workerModule:it({name:s,workerId:s,dependencies:[Ar,ft],init(u,c){let g=u().javascript.generate;return function(...m){let b=c();return{textureData:g(...m),timing:c()-b}}},getTransferables(u){return[u.textureData.buffer]}}),requests:0,idleTimer:null}),l.requests++,clearTimeout(l.idleTimer),l.workerModule(h,r,d,f,t,e).then(({textureData:u,timing:c})=>{let g=ft(),m=new Uint8Array(u.length*4);for(let b=0;b<u.length;b++)m[b*4+i]=u[b];return er.webglUtils.renderImageData(a,m,o,n,h,r,1<<3-i),c+=ft()-g,--l.requests===0&&(l.idleTimer=setTimeout(()=>{En(s)},Pa)),{timing:c}})}p(zn,"generateSDF_JS_Worker");function za(h){h._warm||(er.webgl.isSupported(h),h._warm=!0)}p(za,"warmUpSDFCanvas");var Wa=er.webglUtils.resizeWebGLCanvasWithoutClearing,lt={defaultFontURL:null,unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048,useWorker:!0},Na=new Mt,Va=!1;function pt(){return(self.performance||Date).now()}p(pt,"now$1");var Wn=Object.create(null);function Qn(h,r){Va=!0,h=Xa({},h);let d=pt(),{defaultFontURL:f}=lt,t=[];if(f&&t.push({label:"default",src:Nn(f)}),h.font&&t.push({label:"user",src:Nn(h.font)}),h.font=t,h.text=""+h.text,h.sdfGlyphSize=h.sdfGlyphSize||lt.sdfGlyphSize,h.unicodeFontsURL=h.unicodeFontsURL||lt.unicodeFontsURL,h.colorRanges!=null){let c={};for(let g in h.colorRanges)if(h.colorRanges.hasOwnProperty(g)){let m=h.colorRanges[g];typeof m!="number"&&(m=Na.set(m).getHex()),c[g]=m}h.colorRanges=c}Object.freeze(h);let{textureWidth:e,sdfExponent:a}=lt,{sdfGlyphSize:o}=h,n=e/o*4,i=Wn[o];if(!i){let c=document.createElement("canvas");c.width=e,c.height=o*256/n,i=Wn[o]={glyphCount:0,sdfGlyphSize:o,sdfCanvas:c,sdfTexture:new bn(c,void 0,void 0,void 0,Ur,Ur),contextLost:!1,glyphsByFont:new Map},i.sdfTexture.generateMipmaps=!1,ja(i)}let{sdfTexture:s,sdfCanvas:l}=i;(lt.useWorker?$n:Ya)(h).then(c=>{let{glyphIds:g,glyphFontIndices:m,fontData:b,glyphPositions:L,fontSize:F,timings:U}=c,_=[],S=new Float32Array(g.length*4),D=0,x=0,A=pt(),W=b.map(w=>{let j=i.glyphsByFont.get(w.src);return j||i.glyphsByFont.set(w.src,j=new Map),j});g.forEach((w,j)=>{let P=m[j],{src:Z,unitsPerEm:se}=b[P],I=W[P].get(w);if(!I){let{path:C,pathBounds:k}=c.glyphData[Z][w],N=Math.max(k[2]-k[0],k[3]-k[1])/o*(lt.sdfMargin*o+.5),E=i.glyphCount++,z=[k[0]-N,k[1]-N,k[2]+N,k[3]+N];W[P].set(w,I={path:C,atlasIndex:E,sdfViewBox:z}),_.push(I)}let{sdfViewBox:R}=I,v=L[x++],T=L[x++],M=F/se;S[D++]=v+R[0]*M,S[D++]=T+R[1]*M,S[D++]=v+R[2]*M,S[D++]=T+R[3]*M,g[j]=I.atlasIndex}),U.quads=(U.quads||0)+(pt()-A);let B=pt();U.sdf={};let Y=l.height,y=Math.ceil(i.glyphCount/n),O=Math.pow(2,Math.ceil(Math.log2(y*o)));O>Y&&(console.info("Increasing SDF texture size ".concat(Y,"->").concat(O)),Wa(l,e,O),s.dispose()),Promise.all(_.map(w=>Zn(w,i,h.gpuAccelerateSDF).then(({timing:j})=>{U.sdf[w.atlasIndex]=j}))).then(()=>{_.length&&!i.contextLost&&(qn(i),s.needsUpdate=!0),U.sdfTotal=pt()-B,U.total=pt()-d,r(Object.freeze({parameters:h,sdfTexture:s,sdfGlyphSize:o,sdfExponent:a,glyphBounds:S,glyphAtlasIndices:g,glyphColors:c.glyphColors,caretPositions:c.caretPositions,chunkedBounds:c.chunkedBounds,ascender:c.ascender,descender:c.descender,lineHeight:c.lineHeight,capHeight:c.capHeight,xHeight:c.xHeight,topBaseline:c.topBaseline,blockBounds:c.blockBounds,visibleBounds:c.visibleBounds,timings:c.timings}))})}),Promise.resolve().then(()=>{i.contextLost||za(l)})}p(Qn,"getTextRenderInfo");function Zn({path:h,atlasIndex:r,sdfViewBox:d},{sdfGlyphSize:f,sdfCanvas:t,contextLost:e},a){if(e)return Promise.resolve({timing:-1});let{textureWidth:o,sdfExponent:n}=lt,i=Math.max(d[2]-d[0],d[3]-d[1]),s=Math.floor(r/4),l=s%(o/f)*f,u=Math.floor(s/(o/f))*f,c=r%4;return Oa(f,f,h,d,i,n,t,l,u,c,a)}p(Zn,"generateGlyphSDF");function ja(h){let r=h.sdfCanvas;r.addEventListener("webglcontextlost",d=>{console.log("Context Lost",d),d.preventDefault(),h.contextLost=!0}),r.addEventListener("webglcontextrestored",d=>{console.log("Context Restored",d),h.contextLost=!1;let f=[];h.glyphsByFont.forEach(t=>{t.forEach(e=>{f.push(Zn(e,h,!0))})}),Promise.all(f).then(()=>{qn(h),h.sdfTexture.needsUpdate=!0})})}p(ja,"initContextLossHandling");function Ir({font:h,characters:r,sdfGlyphSize:d},f){let t=Array.isArray(r)?r.join("\n"):""+r;Qn({font:h,sdfGlyphSize:d,text:t},f)}p(Ir,"preloadFont");function Xa(h,r){for(let d in r)r.hasOwnProperty(d)&&(h[d]=r[d]);return h}p(Xa,"assign");var Kt;function Nn(h){return Kt||(Kt=typeof document>"u"?{}:document.createElement("a")),Kt.href=h,Kt.href}p(Nn,"toAbsoluteURL");function qn(h){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");let{sdfCanvas:r,sdfTexture:d}=h,{width:f,height:t}=r,e=h.sdfCanvas.getContext("webgl"),a=d.image.data;(!a||a.length!==f*t*4)&&(a=new Uint8Array(f*t*4),d.image={width:f,height:t,data:a},d.flipY=!1,d.isDataTexture=!0),e.readPixels(0,0,f,t,e.RGBA,e.UNSIGNED_BYTE,a)}}p(qn,"safariPre15Workaround");var Ha=it({name:"Typesetter",dependencies:[Ba,Ea,Bn],init(h,r,d){return h(r,d())}}),$n=it({name:"Typesetter",dependencies:[Ha],init(h){return function(r){return new Promise(d=>{h.typeset(r,d)})}},getTransferables(h){let r=[];for(let d in h)h[d]&&h[d].buffer&&r.push(h[d].buffer);return r}}),Ya=$n.onMainThread;var Vn={};function Ja(h){let r=Vn[h];return r||(r=Vn[h]=new Yt(1,1,h,h).translate(.5,.5,0)),r}p(Ja,"getTemplateGeometry");var qt="aTroikaGlyphBounds",Bt="aTroikaGlyphIndex",Ka="aTroikaGlyphColor",Wr=class Wr extends Fn{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new xn,this.boundingBox=new wr}computeBoundingSphere(){}computeBoundingBox(){}set detail(r){if(r!==this._detail){this._detail=r,(typeof r!="number"||r<1)&&(r=1);let d=Ja(r);["position","normal","uv"].forEach(f=>{this.attributes[f]=d.attributes[f].clone()}),this.setIndex(d.getIndex().clone())}}get detail(){return this._detail}set curveRadius(r){r!==this._curveRadius&&(this._curveRadius=r,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(r,d,f,t,e){this.updateAttributeData(qt,r,4),this.updateAttributeData(Bt,d,1),this.updateAttributeData(Ka,e,3),this._blockBounds=f,this._chunkedBounds=t,this.instanceCount=d.length,this._updateBounds()}_updateBounds(){let r=this._blockBounds;if(r){let{curveRadius:d,boundingBox:f}=this;if(d){let{PI:t,floor:e,min:a,max:o,sin:n,cos:i}=Math,s=t/2,l=t*2,u=Math.abs(d),c=r[0]/u,g=r[2]/u,m=e((c+s)/l)!==e((g+s)/l)?-u:a(n(c)*u,n(g)*u),b=e((c-s)/l)!==e((g-s)/l)?u:o(n(c)*u,n(g)*u),L=e((c+t)/l)!==e((g+t)/l)?u*2:o(u-i(c)*u,u-i(g)*u);f.min.set(m,r[1],d<0?-L:0),f.max.set(b,r[3],d<0?0:L)}else f.min.set(r[0],r[1],0),f.max.set(r[2],r[3],0);f.getBoundingSphere(this.boundingSphere)}}applyClipRect(r){let d=this.getAttribute(Bt).count,f=this._chunkedBounds;if(f)for(let t=f.length;t--;){d=f[t].end;let e=f[t].rect;if(e[1]<r.w&&e[3]>r.y&&e[0]<r.z&&e[2]>r.x)break}this.instanceCount=d}updateAttributeData(r,d,f){let t=this.getAttribute(r);d?t&&t.array.length===d.length?(t.array.set(d),t.needsUpdate=!0):(this.setAttribute(r,new Un(d,f)),delete this._maxInstanceCount,this.dispose()):t&&this.deleteAttribute(r)}};p(Wr,"GlyphsGeometry");var Lr=Wr,Qa="\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform vec4 uTroikaTotalBounds;\nuniform vec4 uTroikaClipRect;\nuniform mat3 uTroikaOrient;\nuniform bool uTroikaUseGlyphColors;\nuniform float uTroikaEdgeOffset;\nuniform float uTroikaBlurRadius;\nuniform vec2 uTroikaPositionOffset;\nuniform float uTroikaCurveRadius;\nattribute vec4 aTroikaGlyphBounds;\nattribute float aTroikaGlyphIndex;\nattribute vec3 aTroikaGlyphColor;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec3 vTroikaGlyphColor;\nvarying vec2 vTroikaGlyphDimensions;\n",Za="\nvec4 bounds = aTroikaGlyphBounds;\nbounds.xz += uTroikaPositionOffset.x;\nbounds.yw -= uTroikaPositionOffset.y;\n\nvec4 outlineBounds = vec4(\n bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius,\n bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius\n);\nvec4 clippedBounds = vec4(\n clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),\n clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)\n);\n\nvec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);\n\nposition.xy = mix(bounds.xy, bounds.zw, clippedXY);\n\nuv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);\n\nfloat rad = uTroikaCurveRadius;\nif (rad != 0.0) {\n float angle = position.x / rad;\n position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);\n normal.xz = vec2(sin(angle), cos(angle));\n}\n \nposition = uTroikaOrient * position;\nnormal = uTroikaOrient * normal;\n\nvTroikaGlyphUV = clippedXY.xy;\nvTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);\n\n\nfloat txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;\nvec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;\nvec2 txStartUV = txUvPerSquare * vec2(\n mod(floor(aTroikaGlyphIndex / 4.0), txCols),\n floor(floor(aTroikaGlyphIndex / 4.0) / txCols)\n);\nvTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);\nvTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);\n",qa="\nuniform sampler2D uTroikaSDFTexture;\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform float uTroikaSDFExponent;\nuniform float uTroikaEdgeOffset;\nuniform float uTroikaFillOpacity;\nuniform float uTroikaBlurRadius;\nuniform vec3 uTroikaStrokeColor;\nuniform float uTroikaStrokeWidth;\nuniform float uTroikaStrokeOpacity;\nuniform bool uTroikaSDFDebug;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec2 vTroikaGlyphDimensions;\n\nfloat troikaSdfValueToSignedDistance(float alpha) {\n // Inverse of exponential encoding in webgl-sdf-generator\n \n float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);\n float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;\n float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);\n return signedDist;\n}\n\nfloat troikaGlyphUvToSdfValue(vec2 glyphUV) {\n vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);\n vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);\n float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1\n return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;\n}\n\nfloat troikaGlyphUvToDistance(vec2 uv) {\n return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));\n}\n\nfloat troikaGetAADist() {\n \n #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300\n return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;\n #else\n return vTroikaGlyphDimensions.x / 64.0;\n #endif\n}\n\nfloat troikaGetFragDistValue() {\n vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);\n float distance = troikaGlyphUvToDistance(clampedGlyphUV);\n \n // Extrapolate distance when outside bounds:\n distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : \n length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);\n\n \n\n return distance;\n}\n\nfloat troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {\n #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)\n float alpha = step(-distanceOffset, -distance);\n #else\n\n float alpha = smoothstep(\n distanceOffset + aaDist,\n distanceOffset - aaDist,\n distance\n );\n #endif\n\n return alpha;\n}\n",$a="\nfloat aaDist = troikaGetAADist();\nfloat fragDistance = troikaGetFragDistValue();\nfloat edgeAlpha = uTroikaSDFDebug ?\n troikaGlyphUvToSdfValue(vTroikaGlyphUV) :\n troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius));\n\n#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)\nvec4 fillRGBA = gl_FragColor;\nfillRGBA.a *= uTroikaFillOpacity;\nvec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);\nif (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;\ngl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(\n -uTroikaStrokeWidth - aaDist,\n -uTroikaStrokeWidth + aaDist,\n fragDistance\n));\ngl_FragColor.a *= edgeAlpha;\n#endif\n\nif (edgeAlpha == 0.0) {\n discard;\n}\n";function ea(h){let r=vt(h,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new ot},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new Sr(0,0,0,0)},uTroikaClipRect:{value:new Sr(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new ot},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new Mt},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new yn},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:Qa,vertexTransform:Za,fragmentDefs:qa,fragmentColorTransform:$a,customRewriter({vertexShader:d,fragmentShader:f}){let t=/\buniform\s+vec3\s+diffuse\b/;return t.test(f)&&(f=f.replace(t,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),t.test(d)||(d=d.replace(Cr,"uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n"))),{vertexShader:d,fragmentShader:f}}});return r.transparent=!0,r.forceSinglePass=!0,Object.defineProperties(r,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),r}p(ea,"createTextDerivedMaterial");var zr=new Tn({color:16777215,side:kr,transparent:!0}),jn=8421504,Xn=new Ft,Qt=new He,Er=new He,Et=[],eo=new He,Br="+x+y";function Hn(h){return Array.isArray(h)?h[0]:h}p(Hn,"first");var ta=p(()=>{let h=new At(new Yt(1,1),zr);return ta=p(()=>h,"getFlatRaycastMesh"),h},"getFlatRaycastMesh"),ra=p(()=>{let h=new At(new Yt(1,1,32,1),zr);return ra=p(()=>h,"getCurvedRaycastMesh"),h},"getCurvedRaycastMesh"),to={type:"syncstart"},ro={type:"synccomplete"},na=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],no=na.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail"),Nr=class Nr extends At{constructor(){let r=new Lr;super(r,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=jn,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=Br,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(r){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(r):(this._isSyncing=!0,this.dispatchEvent(to),Qn({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},d=>{this._isSyncing=!1,this._textRenderInfo=d,this.geometry.updateGlyphs(d.glyphBounds,d.glyphAtlasIndices,d.blockBounds,d.chunkedBounds,d.glyphColors);let f=this._queuedSyncs;f&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{f.forEach(t=>t&&t())})),this.dispatchEvent(ro),r&&r()})))}onBeforeRender(r,d,f,t,e,a){this.sync(),e.isTroikaTextMaterial&&this._prepareForRender(e)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(r){return ea(r)}get material(){let r=this._derivedMaterial,d=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=zr.clone());if((!r||!r.isDerivedFrom(d))&&(r=this._derivedMaterial=this.createDerivedMaterial(d),d.addEventListener("dispose",p(function f(){d.removeEventListener("dispose",f),r.dispose()},"onDispose"))),this.hasOutline()){let f=r._outlineMtl;return f||(f=r._outlineMtl=Object.create(r,{id:{value:r.id+.1}}),f.isTextOutlineMaterial=!0,f.depthWrite=!1,f.map=null,r.addEventListener("dispose",p(function t(){r.removeEventListener("dispose",t),f.dispose()},"onDispose"))),[f,r]}else return r}set material(r){r&&r.isTroikaTextMaterial?(this._derivedMaterial=r,this._baseMaterial=r.baseMaterial):this._baseMaterial=r}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(r){this.geometry.detail=r}get curveRadius(){return this.geometry.curveRadius}set curveRadius(r){this.geometry.curveRadius=r}get customDepthMaterial(){return Hn(this.material).getDepthMaterial()}get customDistanceMaterial(){return Hn(this.material).getDistanceMaterial()}_prepareForRender(r){let d=r.isTextOutlineMaterial,f=r.uniforms,t=this.textRenderInfo;if(t){let{sdfTexture:o,blockBounds:n}=t;f.uTroikaSDFTexture.value=o,f.uTroikaSDFTextureSize.value.set(o.image.width,o.image.height),f.uTroikaSDFGlyphSize.value=t.sdfGlyphSize,f.uTroikaSDFExponent.value=t.sdfExponent,f.uTroikaTotalBounds.value.fromArray(n),f.uTroikaUseGlyphColors.value=!d&&!!t.glyphColors;let i=0,s=0,l=0,u,c,g,m=0,b=0;if(d){let{outlineWidth:F,outlineOffsetX:U,outlineOffsetY:_,outlineBlur:S,outlineOpacity:D}=this;i=this._parsePercent(F)||0,s=Math.max(0,this._parsePercent(S)||0),u=D,m=this._parsePercent(U)||0,b=this._parsePercent(_)||0}else l=Math.max(0,this._parsePercent(this.strokeWidth)||0),l&&(g=this.strokeColor,f.uTroikaStrokeColor.value.set(g==null?jn:g),c=this.strokeOpacity,c==null&&(c=1)),u=this.fillOpacity;f.uTroikaEdgeOffset.value=i,f.uTroikaPositionOffset.value.set(m,b),f.uTroikaBlurRadius.value=s,f.uTroikaStrokeWidth.value=l,f.uTroikaStrokeOpacity.value=c,f.uTroikaFillOpacity.value=u==null?1:u,f.uTroikaCurveRadius.value=this.curveRadius||0;let L=this.clipRect;if(L&&Array.isArray(L)&&L.length===4)f.uTroikaClipRect.value.fromArray(L);else{let F=(this.fontSize||.1)*100;f.uTroikaClipRect.value.set(n[0]-F,n[1]-F,n[2]+F,n[3]+F)}this.geometry.applyClipRect(f.uTroikaClipRect.value)}f.uTroikaSDFDebug.value=!!this.debugSDF,r.polygonOffset=!!this.depthOffset,r.polygonOffsetFactor=r.polygonOffsetUnits=this.depthOffset||0;let e=d?this.outlineColor||0:this.color;if(e==null)delete r.color;else{let o=r.hasOwnProperty("color")?r.color:r.color=new Mt;(e!==o._input||typeof e=="object")&&o.set(o._input=e)}let a=this.orientation||Br;if(a!==r._orientation){let o=f.uTroikaOrient.value;a=a.replace(/[^-+xyz]/g,"");let n=a!==Br&&a.match(/^([-+])([xyz])([-+])([xyz])$/);if(n){let[,i,s,l,u]=n;Qt.set(0,0,0)[s]=i==="-"?1:-1,Er.set(0,0,0)[u]=l==="-"?-1:1,Xn.lookAt(eo,Qt.cross(Er),Er),o.setFromMatrix4(Xn)}else o.identity();r._orientation=a}}_parsePercent(r){if(typeof r=="string"){let d=r.match(/^(-?[\d.]+)%$/),f=d?parseFloat(d[1]):NaN;r=(isNaN(f)?0:f/100)*this.fontSize}return r}localPositionToTextCoords(r,d=new ot){d.copy(r);let f=this.curveRadius;return f&&(d.x=Math.atan2(r.x,Math.abs(f)-Math.abs(r.z))*Math.abs(f)),d}worldPositionToTextCoords(r,d=new ot){return Qt.copy(r),this.localPositionToTextCoords(this.worldToLocal(Qt),d)}raycast(r,d){let{textRenderInfo:f,curveRadius:t}=this;if(f){let e=f.blockBounds,a=t?ra():ta(),o=a.geometry,{position:n,uv:i}=o.attributes;for(let s=0;s<i.count;s++){let l=e[0]+i.getX(s)*(e[2]-e[0]),u=e[1]+i.getY(s)*(e[3]-e[1]),c=0;t&&(c=t-Math.cos(l/t)*t,l=Math.sin(l/t)*t),n.setXYZ(s,l,u,c)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,a.matrixWorld=this.matrixWorld,a.material.side=this.material.side,Et.length=0,a.raycast(r,Et);for(let s=0;s<Et.length;s++)Et[s].object=this,d.push(Et[s])}}copy(r){let d=this.geometry;return super.copy(r),this.geometry=d,no.forEach(f=>{this[f]=r[f]}),this}clone(){return new this.constructor().copy(this)}};p(Nr,"Text");var rt=Nr;na.forEach(h=>{let r="_private_"+h;Object.defineProperty(rt.prototype,h,{get(){return this[r]},set(d){d!==this[r]&&(this[r]=d,this._needsSync=!0)}})});var ao={type:"syncstart"},oo={type:"synccomplete"},gt="aTroikaTextBatchMemberIndex",Gr=32,Yn=new wr,Jn=new Mt,$t=class $t extends rt{constructor(){super(),this._members=new Map,this._dataTextures={},this._onMemberSynced=r=>{this._members.get(r.target).dirty=!0}}add(...r){for(let d=0;d<r.length;d++)r[d]instanceof rt?this.addText(r[d]):super.add(r[d]);return this}remove(...r){for(let d=0;d<r.length;d++)r[d]instanceof rt?this.removeText(r[d]):super.remove(r[d]);return this}addText(r){this._members.has(r)||(this._members.set(r,{index:-1,glyphCount:-1,dirty:!0}),r.addEventListener("synccomplete",this._onMemberSynced))}removeText(r){this._needsRepack=!0,r.removeEventListener("synccomplete",this._onMemberSynced),this._members.delete(r)}createDerivedMaterial(r){return io(r)}updateMatrixWorld(r){super.updateMatrixWorld(r),this.updateBounds()}updateBounds(){let r=this.geometry.boundingBox.makeEmpty();this._members.forEach((d,f)=>{f.matrixAutoUpdate&&f.updateMatrix(),Yn.copy(f.geometry.boundingBox).applyMatrix4(f.matrix),r.union(Yn)}),r.getBoundingSphere(this.geometry.boundingSphere)}hasOutline(){for(let r of this._members.keys())if(r.hasOutline())return!0;return!1}_prepareForRender(r){let d=r.isTextOutlineMaterial;r.uniforms.uTroikaIsOutline.value=d;let f=this._dataTextures[d?"outline":"main"],t=Math.pow(2,Math.ceil(Math.log2(this._members.size*Gr)));if(!f||t!==f.image.data.length){f&&f.dispose();let o=Math.min(t/4,1024);f=this._dataTextures[d?"outline":"main"]=new kn(new Float32Array(t),o,t/4/o,vn,dn)}let e=f.image.data,a=p((o,n)=>{n!==e[o]&&(e[o]=n,f.needsUpdate=!0)},"setTexData");this._members.forEach(({index:o,dirty:n},i)=>{if(o>-1){let s=o*Gr,l=i.matrix.elements;for(let x=0;x<16;x++)a(s+x,l[x]);i._prepareForRender(r);let{uTroikaTotalBounds:u,uTroikaClipRect:c,uTroikaPositionOffset:g,uTroikaEdgeOffset:m,uTroikaBlurRadius:b,uTroikaStrokeWidth:L,uTroikaStrokeColor:F,uTroikaStrokeOpacity:U,uTroikaFillOpacity:_,uTroikaCurveRadius:S}=r.uniforms;for(let x=0;x<4;x++)a(s+16+x,u.value.getComponent(x));for(let x=0;x<4;x++)a(s+20+x,c.value.getComponent(x));let D=d?i.outlineColor||0:i.color;D==null&&(D=this.color),D==null&&(D=this.material.color),D==null&&(D=16777215),a(s+24,Jn.set(D).getHex()),a(s+25,_.value),a(s+26,S.value),d?(a(s+28,g.value.x),a(s+29,g.value.y),a(s+30,m.value),a(s+31,b.value)):(a(s+28,L.value),a(s+29,Jn.set(F.value).getHex()),a(s+30,U.value))}}),r.setMatrixTexture(f),super._prepareForRender(r)}sync(r){let d=this._needsRepack?[]:null;this._needsRepack=!1,this._members.forEach((f,t)=>{(f.dirty||t._needsSync)&&(f.dirty=!1,(d||(d=[])).push(new Promise(e=>{t._needsSync?t.sync(e):e()})))}),d&&(this.dispatchEvent(ao),Promise.all(d).then(()=>{let{geometry:f}=this,t=f.attributes,e=t[gt]&&t[gt].array||new Uint16Array(0),a=t[Bt]&&t[Bt].array||new Float32Array(0),o=t[qt]&&t[qt].array||new Float32Array(0),n=0;this._members.forEach((l,{textRenderInfo:u})=>{u&&(n+=u.glyphAtlasIndices.length,this._textRenderInfo=u)}),n!==e.length&&(e=Or(e,n),a=Or(a,n),o=Or(o,n*4));let i=0,s=0;this._members.forEach((l,{textRenderInfo:u})=>{if(u){let c=u.glyphAtlasIndices.length;e.fill(i,s,s+c),a.set(u.glyphAtlasIndices,s,s+c),o.set(u.glyphBounds,s*4,(s+c)*4),s+=c,l.index=i++}}),f.updateAttributeData(gt,e,1),f.getAttribute(gt).setUsage(gn),f.updateAttributeData(Bt,a,1),f.updateAttributeData(qt,o,4),this.updateBounds(),this.dispatchEvent(oo),r&&r()}))}copy(r){return r instanceof $t&&(super.copy(r),this._members.forEach((d,f)=>this.removeText(f)),r._members.forEach((d,f)=>this.addText(f))),this}dispose(){super.dispose(),Object.values(this._dataTextures).forEach(r=>r.dispose())}};p($t,"BatchedText");var Pr=$t;function Or(h,r){let d=new h.constructor(r);return d.set(h.subarray(0,r)),d}p(Or,"cloneAndResize");function io(h){let r="uTroikaMatricesTexture",d="uTroikaMatricesTextureSize",f=vt(h,{chained:!0,uniforms:{[d]:{value:new ot},[r]:{value:null}},vertexDefs:"\n uniform highp sampler2D ".concat(r,";\n uniform vec2 ").concat(d,";\n attribute float ").concat(gt,";\n\n vec4 troikaBatchTexel(float offset) {\n offset += ").concat(gt," * ").concat(Gr.toFixed(1)," / 4.0;\n float w = ").concat(d,".x;\n vec2 uv = (vec2(mod(offset, w), floor(offset / w)) + 0.5) / ").concat(d,";\n return texture2D(").concat(r,", uv);\n }\n "),vertexTransform:"\n mat4 matrix = mat4(\n troikaBatchTexel(0.0),\n troikaBatchTexel(1.0),\n troikaBatchTexel(2.0),\n troikaBatchTexel(3.0)\n );\n position.xyz = (matrix * vec4(position, 1.0)).xyz;\n "});return f=ea(f),f=vt(f,{chained:!0,uniforms:{uTroikaIsOutline:{value:!1}},customRewriter(t){return["uTroikaTotalBounds","uTroikaClipRect","uTroikaPositionOffset","uTroikaEdgeOffset","uTroikaBlurRadius","uTroikaStrokeWidth","uTroikaStrokeColor","uTroikaStrokeOpacity","uTroikaFillOpacity","uTroikaCurveRadius","diffuse"].forEach(a=>{t=so(t,a)}),t},vertexDefs:"\n uniform bool uTroikaIsOutline;\n vec3 troikaFloatToColor(float v) {\n return mod(floor(vec3(v / 65536.0, v / 256.0, v)), 256.0) / 256.0;\n }\n ",vertexTransform:"\n uTroikaTotalBounds = troikaBatchTexel(4.0);\n uTroikaClipRect = troikaBatchTexel(5.0);\n \n vec4 data = troikaBatchTexel(6.0);\n diffuse = troikaFloatToColor(data.x);\n uTroikaFillOpacity = data.y;\n uTroikaCurveRadius = data.z;\n \n data = troikaBatchTexel(7.0);\n if (uTroikaIsOutline) {\n if (data == vec4(0.0)) { // degenerate if zero outline\n position = vec3(0.0);\n } else {\n uTroikaPositionOffset = data.xy;\n uTroikaEdgeOffset = data.z;\n uTroikaBlurRadius = data.w;\n }\n } else {\n uTroikaStrokeWidth = data.x;\n uTroikaStrokeColor = troikaFloatToColor(data.y);\n uTroikaStrokeOpacity = data.z;\n }\n "}),f.setMatrixTexture=t=>{f.uniforms[r].value=t,f.uniforms[d].value.set(t.image.width,t.image.height)},f}p(io,"createBatchedTextMaterial");function so({vertexShader:h,fragmentShader:r},d,f=d){let t=new RegExp("uniform\\s+(bool|float|vec[234]|mat[34])\\s+".concat(d,"\\b")),e,a=!1;r=r.replace(t,(n,i)=>(a=!0,"varying ".concat(e=i," ").concat(f)));let o=!1;return h=h.replace(t,(n,i)=>(o=!0,"".concat(a?"varying":""," ").concat(e=i," ").concat(f))),o||(h="".concat(a?"varying":""," ").concat(e," ").concat(f,";\n").concat(h)),{vertexShader:h,fragmentShader:r}}p(so,"uniformToVarying");Ie();var aa="abcdefghijklmnopqrstuvwxyz";function oa(h){return new Promise((r,d)=>{h?typeof h=="string"?Ir({font:h,characters:aa},()=>{r(h)}):d(new Error("bad fontUrl ".concat(h))):import("./roboto-regular-V36DLM4S.js").then(f=>{Ir({font:f.default,characters:aa},()=>{r(f.default)})})})}p(oa,"preloadFont");var Vr=.1,lo=new He;function ia(h,r,d,f){return r<=0||d<=0?Promise.reject("incoorect dimension [".concat(r,", ").concat(d,"]")):new Promise((t,e)=>{h.sync(a);function a(){if(!h.geometry.boundingBox)return;let{x:o,y:n}=h.geometry.boundingBox.getSize(lo);if(n>d||o>r){if(h.fontSize===Vr)return e("cannot find suitable font size for ".concat(h.text,". MaxSize: [").concat(r,", ").concat(d,"], Current size: [").concat(o,", ").concat(n,"]. min font size").concat(Vr,"."));h.fontSize=Math.max(Vr,h.fontSize-f),h.sync(a)}else return t({size:[o,n]})}p(a,"syncCallback")})}p(ia,"fitTextToArea");async function Ho(h,r,d,f){var U,_,S,D,x,A,W,B,Y,y,O,w,j,P;let t=r.feature.properties,{textArea:e}=t;if(!e)throw new Error("textArea is required");let a=(U=d.margin)!=null?U:ze.margin,[o,n,i,s]=Array.isArray(a)?a:[a,a,a,a],l=new rt;r.textMesh=l,l.text=t.content;let u=e.maxHeight-o-i,c=e.maxWidth-s-n;l.fontSize=Math.min(u,(_=d.fontSize)!=null?_:ze.fontSize),l.color=(S=d.color)!=null?S:ze.color,l.maxWidth=(D=d.maxWidth)!=null?D:c,l.anchorX="center",l.anchorY="middle",l.textAlign="center";let g=(x=d.font)!=null?x:ze.font;g?l.font=g:rr?l.font=await rr:l.font=await uo(),l.outlineOpacity=(A=d.outlineOpacity)!=null?A:ze.outlineOpacity,l.outlineColor=(W=d.outlineColor)!=null?W:ze.outlineColor,l.outlineOffsetY=(B=d.outlineOffsetY)!=null?B:ze.outlineOffsetY,l.outlineOffsetX=(Y=d.outlineOffsetX)!=null?Y:ze.outlineOffsetX,l.outlineWidth=(y=d.outlineWidth)!=null?y:ze.outlineWidth,l.outlineBlur=(O=d.outlineBlur)!=null?O:ze.outlineBlur,l.strokeWidth=(w=d.strokeWidth)!=null?w:ze.strokeWidth,l.strokeColor=(j=d.strokeColor)!=null?j:ze.strokeColor,l.strokeOpacity=(P=d.strokeOpacity)!=null?P:ze.strokeOpacity;let m=f(e.position,Ye);l.position.copy(m);let b=An(Math.PI/2-mn.degToRad(e.rotation));l.rotation.z=b,l.userData={entityId:h.toString(),rotationZ:b};let L,F;try{F=(await ia(l,c,u,l.fontSize*.2)).size}catch(Z){throw new Error("Cannot fit text to area: entityId: ".concat(r.polygonEntityId," ").concat(Z))}if(F)return tr.identity(),Ye.set(0,0,1),tr.makeRotationAxis(fo,b),Ye.set(e.align==="near"?s+F[0]/2:e.maxWidth/2,0,0),Ye.applyMatrix4(tr),l.position.x-=Ye.x,l.position.y-=Ye.y,L&&(Ye.set(e.maxWidth/2,0,0),Ye.applyMatrix4(tr),L.position.x-=Ye.x,L.position.y-=Ye.y),{text:l}}p(Ho,"createTroikaText");var tr=new Ft,Ye=new He,fo=new He(0,0,1),rr;function uo(h){return rr=oa(h),rr}p(uo,"preloadFont");export{Pr as BatchedText,rt as Text,Ho as createTroikaText,uo as preloadFont};
|
|
1
|
+
import{_ as An,ra as ze}from"./chunk-PFDTT6ZZ.js";import"./chunk-RGA6MUTU.js";import"./chunk-7H7HYUVU.js";import{Aa as Yt,B as gn,D as mn,E as ot,F as yn,Ga as Sn,Ha as wn,I as bn,J as Sr,M as He,N as wr,O as xn,P as Ft,S as Mt,U as Tn,Wa as Fn,X as At,Z as _n,cb as Mn,e as kr,ha as kn,ja as Un,m as Ur,q as dn,r as vn,x as pn}from"./chunk-CBBFEVN4.js";import{a as Ie,b as Qe}from"./chunk-S7CLJZMO.js";import{a as p}from"./chunk-J5IUISYU.js";Ie();Ie();Ie();function da(){var h=Object.create(null);function r(t,e){var a=t.id,o=t.name,n=t.dependencies;n===void 0&&(n=[]);var i=t.init;i===void 0&&(i=p(function(){},"init"));var s=t.getTransferables;if(s===void 0&&(s=null),!h[a])try{n=n.map(function(u){return u&&u.isWorkerModule&&(r(u,function(c){if(c instanceof Error)throw c}),u=h[u.id].value),u}),i=f("<"+o+">.init",i),s&&(s=f("<"+o+">.getTransferables",s));var l=null;typeof i=="function"?l=i.apply(void 0,n):console.error("worker module init function failed to rehydrate"),h[a]={id:a,value:l,getTransferables:s},e(l)}catch(u){u&&u.noLog||console.error(u),e(u)}}p(r,"registerModule");function d(t,e){var a,o=t.id,n=t.args;(!h[o]||typeof h[o].value!="function")&&e(new Error("Worker module "+o+": not found or its 'init' did not return a function"));try{var i=(a=h[o]).value.apply(a,n);i&&typeof i.then=="function"?i.then(s,function(l){return e(l instanceof Error?l:new Error(""+l))}):s(i)}catch(l){e(l)}function s(l){try{var u=h[o].getTransferables&&h[o].getTransferables(l);(!u||!Array.isArray(u)||!u.length)&&(u=void 0),e(l,u)}catch(c){console.error(c),e(c)}}p(s,"handleResult")}p(d,"callModule");function f(t,e){var a=void 0;self.troikaDefine=function(n){return a=n};var o=URL.createObjectURL(new Blob(["/** "+t.replace(/\*/g,"")+" **/\n\ntroikaDefine(\n"+e+"\n)"],{type:"application/javascript"}));try{importScripts(o)}catch(n){console.error(n)}return URL.revokeObjectURL(o),delete self.troikaDefine,a}p(f,"rehydrate"),self.addEventListener("message",function(t){var e=t.data,a=e.messageId,o=e.action,n=e.data;try{o==="registerModule"&&r(n,function(i){i instanceof Error?postMessage({messageId:a,success:!1,error:i.message}):postMessage({messageId:a,success:!0,result:{isCallable:typeof i=="function"}})}),o==="callModule"&&d(n,function(i,s){i instanceof Error?postMessage({messageId:a,success:!1,error:i.message}):postMessage({messageId:a,success:!0,result:i},s||void 0)})}catch(i){postMessage({messageId:a,success:!1,error:i.stack})}})}p(da,"workerBootstrap");function va(h){var r=p(function(){for(var d=[],f=arguments.length;f--;)d[f]=arguments[f];return r._getInitResult().then(function(t){if(typeof t=="function")return t.apply(void 0,d);throw new Error("Worker module function was called but `init` did not return a callable function")})},"moduleFunc");return r._getInitResult=function(){var d=h.dependencies,f=h.init;d=Array.isArray(d)?d.map(function(e){return e&&(e=e.onMainThread||e,e._getInitResult&&(e=e._getInitResult())),e}):[];var t=Promise.all(d).then(function(e){return f.apply(null,e)});return r._getInitResult=function(){return t},t},r}p(va,"defineMainThreadModule");var Cn=p(function(){var h=!1;if(typeof window<"u"&&typeof window.document<"u")try{var r=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));r.terminate(),h=!0}catch(d){typeof Qe<"u"&&Qe.env.NODE_ENV==="test"||console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+d.message+"]")}return Cn=p(function(){return h},"supportsWorkers"),h},"supportsWorkers"),pa=0,ga=0,Fr=!1,Dt=Object.create(null),Ct=Object.create(null),Mr=Object.create(null);function it(h){if((!h||typeof h.init!="function")&&!Fr)throw new Error("requires `options.init` function");var r=h.dependencies,d=h.init,f=h.getTransferables,t=h.workerId,e=va(h);t==null&&(t="#default");var a="workerModule"+ ++pa,o=h.name||a,n=null;r=r&&r.map(function(s){return typeof s=="function"&&!s.workerModuleData&&(Fr=!0,s=it({workerId:t,name:"<"+o+"> function dependency: "+s.name,init:"function(){return (\n"+Jt(s)+"\n)}"}),Fr=!1),s&&s.workerModuleData&&(s=s.workerModuleData),s});function i(){for(var s=[],l=arguments.length;l--;)s[l]=arguments[l];if(!Cn())return e.apply(void 0,s);if(!n){n=Dn(t,"registerModule",i.workerModuleData);var u=p(function(){n=null,Ct[t].delete(u)},"unregister");(Ct[t]||(Ct[t]=new Set)).add(u)}return n.then(function(c){var g=c.isCallable;if(g)return Dn(t,"callModule",{id:a,args:s});throw new Error("Worker module function was called but `init` did not return a callable function")})}return p(i,"moduleFunc"),i.workerModuleData={isWorkerModule:!0,id:a,name:o,dependencies:r,init:Jt(d),getTransferables:f&&Jt(f)},i.onMainThread=e,i}p(it,"defineWorkerModule");function En(h){Ct[h]&&Ct[h].forEach(function(r){r()}),Dt[h]&&(Dt[h].terminate(),delete Dt[h])}p(En,"terminateWorker");function Jt(h){var r=h.toString();return!/^function/.test(r)&&/^\w+\s*\(/.test(r)&&(r="function "+r),r}p(Jt,"stringifyFunction");function ma(h){var r=Dt[h];if(!r){var d=Jt(da);r=Dt[h]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+h.replace(/\*/g,"")+" **/\n\n;("+d+")()"],{type:"application/javascript"}))),r.onmessage=function(f){var t=f.data,e=t.messageId,a=Mr[e];if(!a)throw new Error("WorkerModule response with empty or unknown messageId");delete Mr[e],a(t)}}return r}p(ma,"getWorker");function Dn(h,r,d){return new Promise(function(f,t){var e=++ga;Mr[e]=function(a){a.success?f(a.result):t(new Error("Error in worker "+r+" call: "+a.error))},ma(h).postMessage({messageId:e,action:r,data:d})})}p(Dn,"callWorker");Ie();function Ar(){var h=function(r){function d(I,R,v,T,M,C,k,N){var E=1-k;N.x=E*E*I+2*E*k*v+k*k*M,N.y=E*E*R+2*E*k*T+k*k*C}p(d,"pointOnQuadraticBezier");function f(I,R,v,T,M,C,k,N,E,z){var J=1-E;z.x=J*J*J*I+3*J*J*E*v+3*J*E*E*M+E*E*E*k,z.y=J*J*J*R+3*J*J*E*T+3*J*E*E*C+E*E*E*N}p(f,"pointOnCubicBezier");function t(I,R){for(var v=/([MLQCZ])([^MLQCZ]*)/g,T,M,C,k,N;T=v.exec(I);){var E=T[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(z){return parseFloat(z)});switch(T[1]){case"M":k=M=E[0],N=C=E[1];break;case"L":(E[0]!==k||E[1]!==N)&&R("L",k,N,k=E[0],N=E[1]);break;case"Q":{R("Q",k,N,k=E[2],N=E[3],E[0],E[1]);break}case"C":{R("C",k,N,k=E[4],N=E[5],E[0],E[1],E[2],E[3]);break}case"Z":(k!==M||N!==C)&&R("L",k,N,M,C);break}}}p(t,"forEachPathCommand");function e(I,R,v){v===void 0&&(v=16);var T={x:0,y:0};t(I,function(M,C,k,N,E,z,J,ee,H){switch(M){case"L":R(C,k,N,E);break;case"Q":{for(var V=C,ge=k,ce=1;ce<v;ce++)d(C,k,z,J,N,E,ce/(v-1),T),R(V,ge,T.x,T.y),V=T.x,ge=T.y;break}case"C":{for(var q=C,te=k,le=1;le<v;le++)f(C,k,z,J,ee,H,N,E,le/(v-1),T),R(q,te,T.x,T.y),q=T.x,te=T.y;break}}})}p(e,"pathToLineSegments");var a="precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",o="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",n=new WeakMap,i={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function s(I,R){var v=I.getContext?I.getContext("webgl",i):I,T=n.get(v);if(!T){let J=function(q){var te=C[q];if(!te&&(te=C[q]=v.getExtension(q),!te))throw new Error(q+" not supported");return te},ee=function(q,te){var le=v.createShader(te);return v.shaderSource(le,q),v.compileShader(le),le},H=function(q,te,le,X){if(!k[q]){var re={},$={},G=v.createProgram();v.attachShader(G,ee(te,v.VERTEX_SHADER)),v.attachShader(G,ee(le,v.FRAGMENT_SHADER)),v.linkProgram(G),k[q]={program:G,transaction:p(function(Q){v.useProgram(G),Q({setUniform:p(function(K,xe){for(var ne=[],oe=arguments.length-2;oe-- >0;)ne[oe]=arguments[oe+2];var ue=$[xe]||($[xe]=v.getUniformLocation(G,xe));v["uniform"+K].apply(v,[ue].concat(ne))},"setUniform"),setAttribute:p(function(K,xe,ne,oe,ue){var ve=re[K];ve||(ve=re[K]={buf:v.createBuffer(),loc:v.getAttribLocation(G,K),data:null}),v.bindBuffer(v.ARRAY_BUFFER,ve.buf),v.vertexAttribPointer(ve.loc,xe,v.FLOAT,!1,0,0),v.enableVertexAttribArray(ve.loc),M?v.vertexAttribDivisor(ve.loc,oe):J("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(ve.loc,oe),ue!==ve.data&&(v.bufferData(v.ARRAY_BUFFER,ue,ne),ve.data=ue)},"setAttribute")})},"transaction")}}k[q].transaction(X)},V=function(q,te){E++;try{v.activeTexture(v.TEXTURE0+E);var le=N[q];le||(le=N[q]=v.createTexture(),v.bindTexture(v.TEXTURE_2D,le),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,v.NEAREST),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,v.NEAREST)),v.bindTexture(v.TEXTURE_2D,le),te(le,E)}finally{E--}},ge=function(q,te,le){var X=v.createFramebuffer();z.push(X),v.bindFramebuffer(v.FRAMEBUFFER,X),v.activeTexture(v.TEXTURE0+te),v.bindTexture(v.TEXTURE_2D,q),v.framebufferTexture2D(v.FRAMEBUFFER,v.COLOR_ATTACHMENT0,v.TEXTURE_2D,q,0);try{le(X)}finally{v.deleteFramebuffer(X),v.bindFramebuffer(v.FRAMEBUFFER,z[--z.length-1]||null)}},ce=function(){C={},k={},N={},E=-1,z.length=0};p(J,"getExtension"),p(ee,"compileShader"),p(H,"withProgram"),p(V,"withTexture"),p(ge,"withTextureFramebuffer"),p(ce,"handleContextLoss");var M=typeof WebGL2RenderingContext<"u"&&v instanceof WebGL2RenderingContext,C={},k={},N={},E=-1,z=[];v.canvas.addEventListener("webglcontextlost",function(q){ce(),q.preventDefault()},!1),n.set(v,T={gl:v,isWebGL2:M,getExtension:J,withProgram:H,withTexture:V,withTextureFramebuffer:ge,handleContextLoss:ce})}R(T)}p(s,"withWebGLContext");function l(I,R,v,T,M,C,k,N){k===void 0&&(k=15),N===void 0&&(N=null),s(I,function(E){var z=E.gl,J=E.withProgram,ee=E.withTexture;ee("copy",function(H,V){z.texImage2D(z.TEXTURE_2D,0,z.RGBA,M,C,0,z.RGBA,z.UNSIGNED_BYTE,R),J("copy",a,o,function(ge){var ce=ge.setUniform,q=ge.setAttribute;q("aUV",2,z.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),ce("1i","image",V),z.bindFramebuffer(z.FRAMEBUFFER,N||null),z.disable(z.BLEND),z.colorMask(k&8,k&4,k&2,k&1),z.viewport(v,T,M,C),z.scissor(v,T,M,C),z.drawArrays(z.TRIANGLES,0,3)})})})}p(l,"renderImageData");function u(I,R,v){var T=I.width,M=I.height;s(I,function(C){var k=C.gl,N=new Uint8Array(T*M*4);k.readPixels(0,0,T,M,k.RGBA,k.UNSIGNED_BYTE,N),I.width=R,I.height=v,l(k,N,0,0,T,M)})}p(u,"resizeWebGLCanvasWithoutClearing");var c=Object.freeze({__proto__:null,withWebGLContext:s,renderImageData:l,resizeWebGLCanvasWithoutClearing:u});function g(I,R,v,T,M,C){C===void 0&&(C=1);var k=new Uint8Array(I*R),N=T[2]-T[0],E=T[3]-T[1],z=[];e(v,function(q,te,le,X){z.push({x1:q,y1:te,x2:le,y2:X,minX:Math.min(q,le),minY:Math.min(te,X),maxX:Math.max(q,le),maxY:Math.max(te,X)})}),z.sort(function(q,te){return q.maxX-te.maxX});for(var J=0;J<I;J++)for(var ee=0;ee<R;ee++){var H=ge(T[0]+N*(J+.5)/I,T[1]+E*(ee+.5)/R),V=Math.pow(1-Math.abs(H)/M,C)/2;H<0&&(V=1-V),V=Math.max(0,Math.min(255,Math.round(V*255))),k[ee*I+J]=V}return k;function ge(q,te){for(var le=1/0,X=1/0,re=z.length;re--;){var $=z[re];if($.maxX+X<=q)break;if(q+X>$.minX&&te-X<$.maxY&&te+X>$.minY){var G=L(q,te,$.x1,$.y1,$.x2,$.y2);G<le&&(le=G,X=Math.sqrt(le))}}return ce(q,te)&&(X=-X),X}function ce(q,te){for(var le=0,X=z.length;X--;){var re=z[X];if(re.maxX<=q)break;var $=re.y1>te!=re.y2>te&&q<(re.x2-re.x1)*(te-re.y1)/(re.y2-re.y1)+re.x1;$&&(le+=re.y1<re.y2?1:-1)}return le!==0}}p(g,"generate$2");function m(I,R,v,T,M,C,k,N,E,z){C===void 0&&(C=1),N===void 0&&(N=0),E===void 0&&(E=0),z===void 0&&(z=0),b(I,R,v,T,M,C,k,null,N,E,z)}p(m,"generateIntoCanvas$2");function b(I,R,v,T,M,C,k,N,E,z,J){C===void 0&&(C=1),E===void 0&&(E=0),z===void 0&&(z=0),J===void 0&&(J=0);for(var ee=g(I,R,v,T,M,C),H=new Uint8Array(ee.length*4),V=0;V<ee.length;V++)H[V*4+J]=ee[V];l(k,H,E,z,I,R,1<<3-J,N)}p(b,"generateIntoFramebuffer$1");function L(I,R,v,T,M,C){var k=M-v,N=C-T,E=k*k+N*N,z=E?Math.max(0,Math.min(1,((I-v)*k+(R-T)*N)/E)):0,J=I-(v+z*k),ee=R-(T+z*N);return J*J+ee*ee}p(L,"absSquareDistanceToLineSegment");var F=Object.freeze({__proto__:null,generate:g,generateIntoCanvas:m,generateIntoFramebuffer:b}),U="precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",_="precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}",S="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}",D=new Float32Array([0,0,2,0,0,2]),x=null,A=!1,W={},B=new WeakMap;function Y(I){if(!A&&!j(I))throw new Error("WebGL generation not supported")}p(Y,"validateSupport");function y(I,R,v,T,M,C,k){if(C===void 0&&(C=1),k===void 0&&(k=null),!k&&(k=x,!k)){var N=typeof OffscreenCanvas=="function"?new OffscreenCanvas(1,1):typeof document<"u"?document.createElement("canvas"):null;if(!N)throw new Error("OffscreenCanvas or DOM canvas not supported");k=x=N.getContext("webgl",{depth:!1})}Y(k);var E=new Uint8Array(I*R*4);s(k,function(H){var V=H.gl,ge=H.withTexture,ce=H.withTextureFramebuffer;ge("readable",function(q,te){V.texImage2D(V.TEXTURE_2D,0,V.RGBA,I,R,0,V.RGBA,V.UNSIGNED_BYTE,null),ce(q,te,function(le){w(I,R,v,T,M,C,V,le,0,0,0),V.readPixels(0,0,I,R,V.RGBA,V.UNSIGNED_BYTE,E)})})});for(var z=new Uint8Array(I*R),J=0,ee=0;J<E.length;J+=4)z[ee++]=E[J];return z}p(y,"generate$1");function O(I,R,v,T,M,C,k,N,E,z){C===void 0&&(C=1),N===void 0&&(N=0),E===void 0&&(E=0),z===void 0&&(z=0),w(I,R,v,T,M,C,k,null,N,E,z)}p(O,"generateIntoCanvas$1");function w(I,R,v,T,M,C,k,N,E,z,J){C===void 0&&(C=1),E===void 0&&(E=0),z===void 0&&(z=0),J===void 0&&(J=0),Y(k);var ee=[];e(v,function(H,V,ge,ce){ee.push(H,V,ge,ce)}),ee=new Float32Array(ee),s(k,function(H){var V=H.gl,ge=H.isWebGL2,ce=H.getExtension,q=H.withProgram,te=H.withTexture,le=H.withTextureFramebuffer,X=H.handleContextLoss;if(te("rawDistances",function(re,$){(I!==re._lastWidth||R!==re._lastHeight)&&V.texImage2D(V.TEXTURE_2D,0,V.RGBA,re._lastWidth=I,re._lastHeight=R,0,V.RGBA,V.UNSIGNED_BYTE,null),q("main",U,_,function(G){var de=G.setAttribute,Q=G.setUniform,ae=!ge&&ce("ANGLE_instanced_arrays"),K=!ge&&ce("EXT_blend_minmax");de("aUV",2,V.STATIC_DRAW,0,D),de("aLineSegment",4,V.DYNAMIC_DRAW,1,ee),Q.apply(void 0,["4f","uGlyphBounds"].concat(T)),Q("1f","uMaxDistance",M),Q("1f","uExponent",C),le(re,$,function(xe){V.enable(V.BLEND),V.colorMask(!0,!0,!0,!0),V.viewport(0,0,I,R),V.scissor(0,0,I,R),V.blendFunc(V.ONE,V.ONE),V.blendEquationSeparate(V.FUNC_ADD,ge?V.MAX:K.MAX_EXT),V.clear(V.COLOR_BUFFER_BIT),ge?V.drawArraysInstanced(V.TRIANGLES,0,3,ee.length/4):ae.drawArraysInstancedANGLE(V.TRIANGLES,0,3,ee.length/4)})}),q("post",a,S,function(G){G.setAttribute("aUV",2,V.STATIC_DRAW,0,D),G.setUniform("1i","tex",$),V.bindFramebuffer(V.FRAMEBUFFER,N),V.disable(V.BLEND),V.colorMask(J===0,J===1,J===2,J===3),V.viewport(E,z,I,R),V.scissor(E,z,I,R),V.drawArrays(V.TRIANGLES,0,3)})}),V.isContextLost())throw X(),new Error("webgl context lost")})}p(w,"generateIntoFramebuffer");function j(I){var R=!I||I===x?W:I.canvas||I,v=B.get(R);if(v===void 0){A=!0;var T=null;try{var M=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],C=y(4,4,"M8,8L16,8L24,24L16,24Z",[0,0,32,32],24,1,I);v=C&&M.length===C.length&&C.every(function(k,N){return k===M[N]}),v||(T="bad trial run results",console.info(M,C))}catch(k){v=!1,T=k.message}T&&console.warn("WebGL SDF generation not supported:",T),A=!1,B.set(R,v)}return v}p(j,"isSupported");var P=Object.freeze({__proto__:null,generate:y,generateIntoCanvas:O,generateIntoFramebuffer:w,isSupported:j});function Z(I,R,v,T,M,C){M===void 0&&(M=Math.max(T[2]-T[0],T[3]-T[1])/2),C===void 0&&(C=1);try{return y.apply(P,arguments)}catch(k){return console.info("WebGL SDF generation failed, falling back to JS",k),g.apply(F,arguments)}}p(Z,"generate");function se(I,R,v,T,M,C,k,N,E,z){M===void 0&&(M=Math.max(T[2]-T[0],T[3]-T[1])/2),C===void 0&&(C=1),N===void 0&&(N=0),E===void 0&&(E=0),z===void 0&&(z=0);try{return O.apply(P,arguments)}catch(J){return console.info("WebGL SDF generation failed, falling back to JS",J),m.apply(F,arguments)}}return p(se,"generateIntoCanvas"),r.forEachPathCommand=t,r.generate=Z,r.generateIntoCanvas=se,r.javascript=F,r.pathToLineSegments=e,r.webgl=P,r.webglUtils=c,Object.defineProperty(r,"__esModule",{value:!0}),r}({});return h}p(Ar,"SDFGenerator");Ie();function ya(){var h=function(r){var d={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},f={},t={};f.L=1,t[1]="L",Object.keys(d).forEach(function(X,re){f[X]=1<<re+1,t[f[X]]=X}),Object.freeze(f);var e=f.LRI|f.RLI|f.FSI,a=f.L|f.R|f.AL,o=f.B|f.S|f.WS|f.ON|f.FSI|f.LRI|f.RLI|f.PDI,n=f.BN|f.RLE|f.LRE|f.RLO|f.LRO|f.PDF,i=f.S|f.WS|f.B|e|f.PDI|n,s=null;function l(){if(!s){s=new Map;var X=p(function($){if(d.hasOwnProperty($)){var G=0;d[$].split(",").forEach(function(de){var Q=de.split("+"),ae=Q[0],K=Q[1];ae=parseInt(ae,36),K=K?parseInt(K,36):0,s.set(G+=ae,f[$]);for(var xe=0;xe<K;xe++)s.set(++G,f[$])})}},"loop");for(var re in d)X(re)}}p(l,"parseData");function u(X){return l(),s.get(X.codePointAt(0))||f.L}p(u,"getBidiCharType");function c(X){return t[u(X)]}p(c,"getBidiCharTypeName");var g={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function m(X,re){var $=36,G=0,de=new Map,Q=re&&new Map,ae;return X.split(",").forEach(p(function K(xe){if(xe.indexOf("+")!==-1)for(var ne=+xe;ne--;)K(ae);else{ae=xe;var oe=xe.split(">"),ue=oe[0],ve=oe[1];ue=String.fromCodePoint(G+=parseInt(ue,$)),ve=String.fromCodePoint(G+=parseInt(ve,$)),de.set(ue,ve),re&&Q.set(ve,ue)}},"visit")),{map:de,reverseMap:Q}}p(m,"parseCharacterMap");var b,L,F;function U(){if(!b){var X=m(g.pairs,!0),re=X.map,$=X.reverseMap;b=re,L=$,F=m(g.canonical,!1).map}}p(U,"parse$1");function _(X){return U(),b.get(X)||null}p(_,"openingToClosingBracket");function S(X){return U(),L.get(X)||null}p(S,"closingToOpeningBracket");function D(X){return U(),F.get(X)||null}p(D,"getCanonicalBracket");var x=f.L,A=f.R,W=f.EN,B=f.ES,Y=f.ET,y=f.AN,O=f.CS,w=f.B,j=f.S,P=f.ON,Z=f.BN,se=f.NSM,I=f.AL,R=f.LRO,v=f.RLO,T=f.LRE,M=f.RLE,C=f.PDF,k=f.LRI,N=f.RLI,E=f.FSI,z=f.PDI;function J(X,re){for(var $=125,G=new Uint32Array(X.length),de=0;de<X.length;de++)G[de]=u(X[de]);var Q=new Map;function ae(Ge,je){var Pe=G[Ge];G[Ge]=je,Q.set(Pe,Q.get(Pe)-1),Pe&o&&Q.set(o,Q.get(o)-1),Q.set(je,(Q.get(je)||0)+1),je&o&&Q.set(o,(Q.get(o)||0)+1)}p(ae,"changeCharType");for(var K=new Uint8Array(X.length),xe=new Map,ne=[],oe=null,ue=0;ue<X.length;ue++)oe||ne.push(oe={start:ue,end:X.length-1,level:re==="rtl"?1:re==="ltr"?0:cn(ue,!1)}),G[ue]&w&&(oe.end=ue,oe=null);for(var ve=M|T|v|R|e|z|C|w,ke=p(function(Ge){return Ge+(Ge&1?1:2)},"nextEven"),Ae=p(function(Ge){return Ge+(Ge&1?2:1)},"nextOdd"),me=0;me<ne.length;me++){oe=ne[me];var ye=[{_level:oe.level,_override:0,_isolate:0}],fe=void 0,Se=0,we=0,Le=0;Q.clear();for(var Ue=oe.start;Ue<=oe.end;Ue++){var he=G[Ue];if(fe=ye[ye.length-1],Q.set(he,(Q.get(he)||0)+1),he&o&&Q.set(o,(Q.get(o)||0)+1),he&ve)if(he&(M|T)){K[Ue]=fe._level;var Te=(he===M?Ae:ke)(fe._level);Te<=$&&!Se&&!we?ye.push({_level:Te,_override:0,_isolate:0}):Se||we++}else if(he&(v|R)){K[Ue]=fe._level;var Ze=(he===v?Ae:ke)(fe._level);Ze<=$&&!Se&&!we?ye.push({_level:Ze,_override:he&v?A:x,_isolate:0}):Se||we++}else if(he&e){he&E&&(he=cn(Ue+1,!0)===1?N:k),K[Ue]=fe._level,fe._override&&ae(Ue,fe._override);var _e=(he===N?Ae:ke)(fe._level);_e<=$&&Se===0&&we===0?(Le++,ye.push({_level:_e,_override:0,_isolate:1,_isolInitIndex:Ue})):Se++}else if(he&z){if(Se>0)Se--;else if(Le>0){for(we=0;!ye[ye.length-1]._isolate;)ye.pop();var be=ye[ye.length-1]._isolInitIndex;be!=null&&(xe.set(be,Ue),xe.set(Ue,be)),ye.pop(),Le--}fe=ye[ye.length-1],K[Ue]=fe._level,fe._override&&ae(Ue,fe._override)}else he&C?(Se===0&&(we>0?we--:!fe._isolate&&ye.length>1&&(ye.pop(),fe=ye[ye.length-1])),K[Ue]=fe._level):he&w&&(K[Ue]=oe.level);else K[Ue]=fe._level,fe._override&&he!==Z&&ae(Ue,fe._override)}for(var De=[],Fe=null,pe=oe.start;pe<=oe.end;pe++){var Me=G[pe];if(!(Me&n)){var Oe=K[pe],Be=Me&e,Ce=Me===z;Fe&&Oe===Fe._level?(Fe._end=pe,Fe._endsWithIsolInit=Be):De.push(Fe={_start:pe,_end:pe,_level:Oe,_startsWithPDI:Ce,_endsWithIsolInit:Be})}}for(var Ne=[],qe=0;qe<De.length;qe++){var Je=De[qe];if(!Je._startsWithPDI||Je._startsWithPDI&&!xe.has(Je._start)){for(var $e=[Fe=Je],nt=void 0;Fe&&Fe._endsWithIsolInit&&(nt=xe.get(Fe._end))!=null;)for(var Ke=qe+1;Ke<De.length;Ke++)if(De[Ke]._start===nt){$e.push(Fe=De[Ke]);break}for(var Re=[],at=0;at<$e.length;at++)for(var jr=$e[at],nr=jr._start;nr<=jr._end;nr++)Re.push(nr);for(var sa=K[Re[0]],Xr=oe.level,Ot=Re[0]-1;Ot>=0;Ot--)if(!(G[Ot]&n)){Xr=K[Ot];break}var ar=Re[Re.length-1],la=K[ar],Hr=oe.level;if(!(G[ar]&e)){for(var Rt=ar+1;Rt<=oe.end;Rt++)if(!(G[Rt]&n)){Hr=K[Rt];break}}Ne.push({_seqIndices:Re,_sosType:Math.max(Xr,sa)%2?A:x,_eosType:Math.max(Hr,la)%2?A:x})}}for(var or=0;or<Ne.length;or++){var ir=Ne[or],ie=ir._seqIndices,mt=ir._sosType,fa=ir._eosType,ut=K[ie[0]]&1?A:x;if(Q.get(se))for(var Lt=0;Lt<ie.length;Lt++){var Yr=ie[Lt];if(G[Yr]&se){for(var sr=mt,Gt=Lt-1;Gt>=0;Gt--)if(!(G[ie[Gt]]&n)){sr=G[ie[Gt]];break}ae(Yr,sr&(e|z)?P:sr)}}if(Q.get(W))for(var Pt=0;Pt<ie.length;Pt++){var Jr=ie[Pt];if(G[Jr]&W)for(var It=Pt-1;It>=-1;It--){var Kr=It===-1?mt:G[ie[It]];if(Kr&a){Kr===I&&ae(Jr,y);break}}}if(Q.get(I))for(var lr=0;lr<ie.length;lr++){var Qr=ie[lr];G[Qr]&I&&ae(Qr,A)}if(Q.get(B)||Q.get(O))for(var yt=1;yt<ie.length-1;yt++){var fr=ie[yt];if(G[fr]&(B|O)){for(var ct=0,ur=0,cr=yt-1;cr>=0&&(ct=G[ie[cr]],!!(ct&n));cr--);for(var hr=yt+1;hr<ie.length&&(ur=G[ie[hr]],!!(ur&n));hr++);ct===ur&&(G[fr]===B?ct===W:ct&(W|y))&&ae(fr,ct)}}if(Q.get(W))for(var Xe=0;Xe<ie.length;Xe++){var ua=ie[Xe];if(G[ua]&W){for(var zt=Xe-1;zt>=0&&G[ie[zt]]&(Y|n);zt--)ae(ie[zt],W);for(Xe++;Xe<ie.length&&G[ie[Xe]]&(Y|n|W);Xe++)G[ie[Xe]]!==W&&ae(ie[Xe],W)}}if(Q.get(Y)||Q.get(B)||Q.get(O))for(var bt=0;bt<ie.length;bt++){var Zr=ie[bt];if(G[Zr]&(Y|B|O)){ae(Zr,P);for(var Wt=bt-1;Wt>=0&&G[ie[Wt]]&n;Wt--)ae(ie[Wt],P);for(var Nt=bt+1;Nt<ie.length&&G[ie[Nt]]&n;Nt++)ae(ie[Nt],P)}}if(Q.get(W))for(var dr=0,qr=mt;dr<ie.length;dr++){var $r=ie[dr],vr=G[$r];vr&W?qr===x&&ae($r,x):vr&a&&(qr=vr)}if(Q.get(o)){var xt=A|W|y,en=xt|x,Vt=[];{for(var ht=[],dt=0;dt<ie.length;dt++)if(G[ie[dt]]&o){var Tt=X[ie[dt]],tn=void 0;if(_(Tt)!==null)if(ht.length<63)ht.push({char:Tt,seqIndex:dt});else break;else if((tn=S(Tt))!==null)for(var _t=ht.length-1;_t>=0;_t--){var pr=ht[_t].char;if(pr===tn||pr===S(D(Tt))||_(D(pr))===Tt){Vt.push([ht[_t].seqIndex,dt]),ht.length=_t;break}}}Vt.sort(function(Ge,je){return Ge[0]-je[0]})}for(var gr=0;gr<Vt.length;gr++){for(var rn=Vt[gr],jt=rn[0],mr=rn[1],nn=!1,Ve=0,yr=jt+1;yr<mr;yr++){var an=ie[yr];if(G[an]&en){nn=!0;var on=G[an]&xt?A:x;if(on===ut){Ve=on;break}}}if(nn&&!Ve){Ve=mt;for(var br=jt-1;br>=0;br--){var sn=ie[br];if(G[sn]&en){var ln=G[sn]&xt?A:x;ln!==ut?Ve=ln:Ve=ut;break}}}if(Ve){if(G[ie[jt]]=G[ie[mr]]=Ve,Ve!==ut){for(var kt=jt+1;kt<ie.length;kt++)if(!(G[ie[kt]]&n)){u(X[ie[kt]])&se&&(G[ie[kt]]=Ve);break}}if(Ve!==ut){for(var Ut=mr+1;Ut<ie.length;Ut++)if(!(G[ie[Ut]]&n)){u(X[ie[Ut]])&se&&(G[ie[Ut]]=Ve);break}}}}for(var et=0;et<ie.length;et++)if(G[ie[et]]&o){for(var fn=et,xr=et,Tr=mt,St=et-1;St>=0;St--)if(G[ie[St]]&n)fn=St;else{Tr=G[ie[St]]&xt?A:x;break}for(var un=fa,wt=et+1;wt<ie.length;wt++)if(G[ie[wt]]&(o|n))xr=wt;else{un=G[ie[wt]]&xt?A:x;break}for(var _r=fn;_r<=xr;_r++)G[ie[_r]]=Tr===un?Tr:ut;et=xr}}}for(var We=oe.start;We<=oe.end;We++){var ca=K[We],Xt=G[We];if(ca&1?Xt&(x|W|y)&&K[We]++:Xt&A?K[We]++:Xt&(y|W)&&(K[We]+=2),Xt&n&&(K[We]=We===0?oe.level:K[We-1]),We===oe.end||u(X[We])&(j|w))for(var Ht=We;Ht>=0&&u(X[Ht])&i;Ht--)K[Ht]=oe.level}}return{levels:K,paragraphs:ne};function cn(Ge,je){for(var Pe=Ge;Pe<X.length;Pe++){var tt=G[Pe];if(tt&(A|I))return 1;if(tt&(w|x)||je&&tt===z)return 0;if(tt&e){var hn=ha(Pe);Pe=hn===-1?X.length:hn}}return 0}function ha(Ge){for(var je=1,Pe=Ge+1;Pe<X.length;Pe++){var tt=G[Pe];if(tt&w)break;if(tt&z){if(--je===0)return Pe}else tt&e&&je++}return-1}}p(J,"getEmbeddingLevels");var ee="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",H;function V(){if(!H){var X=m(ee,!0),re=X.map,$=X.reverseMap;$.forEach(function(G,de){re.set(de,G)}),H=re}}p(V,"parse");function ge(X){return V(),H.get(X)||null}p(ge,"getMirroredCharacter");function ce(X,re,$,G){var de=X.length;$=Math.max(0,$==null?0:+$),G=Math.min(de-1,G==null?de-1:+G);for(var Q=new Map,ae=$;ae<=G;ae++)if(re[ae]&1){var K=ge(X[ae]);K!==null&&Q.set(ae,K)}return Q}p(ce,"getMirroredCharactersMap");function q(X,re,$,G){var de=X.length;$=Math.max(0,$==null?0:+$),G=Math.min(de-1,G==null?de-1:+G);var Q=[];return re.paragraphs.forEach(function(ae){var K=Math.max($,ae.start),xe=Math.min(G,ae.end);if(K<xe){for(var ne=re.levels.slice(K,xe+1),oe=xe;oe>=K&&u(X[oe])&i;oe--)ne[oe]=ae.level;for(var ue=ae.level,ve=1/0,ke=0;ke<ne.length;ke++){var Ae=ne[ke];Ae>ue&&(ue=Ae),Ae<ve&&(ve=Ae|1)}for(var me=ue;me>=ve;me--)for(var ye=0;ye<ne.length;ye++)if(ne[ye]>=me){for(var fe=ye;ye+1<ne.length&&ne[ye+1]>=me;)ye++;ye>fe&&Q.push([fe+K,ye+K])}}}),Q}p(q,"getReorderSegments");function te(X,re,$,G){var de=le(X,re,$,G),Q=[].concat(X);return de.forEach(function(ae,K){Q[K]=(re.levels[ae]&1?ge(X[ae]):null)||X[ae]}),Q.join("")}p(te,"getReorderedString");function le(X,re,$,G){for(var de=q(X,re,$,G),Q=[],ae=0;ae<X.length;ae++)Q[ae]=ae;return de.forEach(function(K){for(var xe=K[0],ne=K[1],oe=Q.slice(xe,ne+1),ue=oe.length;ue--;)Q[ne-ue]=oe[ue]}),Q}return p(le,"getReorderedIndices"),r.closingToOpeningBracket=S,r.getBidiCharType=u,r.getBidiCharTypeName=c,r.getCanonicalBracket=D,r.getEmbeddingLevels=J,r.getMirroredCharacter=ge,r.getMirroredCharactersMap=ce,r.getReorderSegments=q,r.getReorderedIndices=le,r.getReorderedString=te,r.openingToClosingBracket=_,Object.defineProperty(r,"__esModule",{value:!0}),r}({});return h}p(ya,"bidiFactory");var Bn=ya;Ie();var Cr=/\bvoid\s+main\s*\(\s*\)\s*{/g;function Dr(h){let r=/^[ \t]*#include +<([\w\d./]+)>/gm;function d(f,t){let e=Mn[t];return e?Dr(e):f}return p(d,"replace"),h.replace(r,d)}p(Dr,"expandShaderIncludes");var Ee=[];for(let h=0;h<256;h++)Ee[h]=(h<16?"0":"")+h.toString(16);function ba(){let h=Math.random()*4294967295|0,r=Math.random()*4294967295|0,d=Math.random()*4294967295|0,f=Math.random()*4294967295|0;return(Ee[h&255]+Ee[h>>8&255]+Ee[h>>16&255]+Ee[h>>24&255]+"-"+Ee[r&255]+Ee[r>>8&255]+"-"+Ee[r>>16&15|64]+Ee[r>>24&255]+"-"+Ee[d&63|128]+Ee[d>>8&255]+"-"+Ee[d>>16&255]+Ee[d>>24&255]+Ee[f&255]+Ee[f>>8&255]+Ee[f>>16&255]+Ee[f>>24&255]).toUpperCase()}p(ba,"generateUUID");var st=Object.assign||function(){let h=arguments[0];for(let r=1,d=arguments.length;r<d;r++){let f=arguments[r];if(f)for(let t in f)Object.prototype.hasOwnProperty.call(f,t)&&(h[t]=f[t])}return h},xa=Date.now(),On=new WeakMap,Rn=new Map,Ta=1e10;function vt(h,r){let d=Sa(r),f=On.get(h);if(f||On.set(h,f=Object.create(null)),f[d])return new f[d];let t="_onBeforeCompile".concat(d),e=p(function(i,s){h.onBeforeCompile.call(this,i,s);let l=this.customProgramCacheKey()+"|"+i.vertexShader+"|"+i.fragmentShader,u=Rn[l];if(!u){let c=_a(this,i,r,d);u=Rn[l]=c}i.vertexShader=u.vertexShader,i.fragmentShader=u.fragmentShader,st(i.uniforms,this.uniforms),r.timeUniform&&(i.uniforms[r.timeUniform]={get value(){return Date.now()-xa}}),this[t]&&this[t](i)},"onBeforeCompile"),a=p(function(){return o(r.chained?h:h.clone())},"DerivedMaterial"),o=p(function(i){let s=Object.create(i,n);return Object.defineProperty(s,"baseMaterial",{value:h}),Object.defineProperty(s,"id",{value:Ta++}),s.uuid=ba(),s.uniforms=st({},i.uniforms,r.uniforms),s.defines=st({},i.defines,r.defines),s.defines["TROIKA_DERIVED_MATERIAL_".concat(d)]="",s.extensions=st({},i.extensions,r.extensions),s._listeners=void 0,s},"derive"),n={constructor:{value:a},isDerivedMaterial:{value:!0},type:{get:()=>h.type,set:i=>{h.type=i}},isDerivedFrom:{writable:!0,configurable:!0,value:function(i){let s=this.baseMaterial;return i===s||s.isDerivedMaterial&&s.isDerivedFrom(i)||!1}},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return h.customProgramCacheKey()+"|"+d}},onBeforeCompile:{get(){return e},set(i){this[t]=i}},copy:{writable:!0,configurable:!0,value:function(i){return h.copy.call(this,i),!h.isShaderMaterial&&!h.isDerivedMaterial&&(st(this.extensions,i.extensions),st(this.defines,i.defines),st(this.uniforms,_n.clone(i.uniforms))),this}},clone:{writable:!0,configurable:!0,value:function(){let i=new h.constructor;return o(i).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let i=this._depthMaterial;return i||(i=this._depthMaterial=vt(h.isDerivedMaterial?h.getDepthMaterial():new Sn({depthPacking:pn}),r),i.defines.IS_DEPTH_MATERIAL="",i.uniforms=this.uniforms),i}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let i=this._distanceMaterial;return i||(i=this._distanceMaterial=vt(h.isDerivedMaterial?h.getDistanceMaterial():new wn,r),i.defines.IS_DISTANCE_MATERIAL="",i.uniforms=this.uniforms),i}},dispose:{writable:!0,configurable:!0,value(){let{_depthMaterial:i,_distanceMaterial:s}=this;i&&i.dispose(),s&&s.dispose(),h.dispose.call(this)}}};return f[d]=a,new a}p(vt,"createDerivedMaterial");function _a(h,{vertexShader:r,fragmentShader:d},f,t){let{vertexDefs:e,vertexMainIntro:a,vertexMainOutro:o,vertexTransform:n,fragmentDefs:i,fragmentMainIntro:s,fragmentMainOutro:l,fragmentColorTransform:u,customRewriter:c,timeUniform:g}=f;if(e=e||"",a=a||"",o=o||"",i=i||"",s=s||"",l=l||"",(n||c)&&(r=Dr(r)),(u||c)&&(d=d.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm,"\n//!BEGIN_POST_CHUNK $1\n$&\n//!END_POST_CHUNK\n"),d=Dr(d)),c){let m=c({vertexShader:r,fragmentShader:d});r=m.vertexShader,d=m.fragmentShader}if(u){let m=[];d=d.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,b=>(m.push(b),"")),l="".concat(u,"\n").concat(m.join("\n"),"\n").concat(l)}if(g){let m="\nuniform float ".concat(g,";\n");e=m+e,i=m+i}return n&&(r="vec3 troika_position_".concat(t,";\nvec3 troika_normal_").concat(t,";\nvec2 troika_uv_").concat(t,";\n").concat(r,"\n"),e="".concat(e,"\nvoid troikaVertexTransform").concat(t,"(inout vec3 position, inout vec3 normal, inout vec2 uv) {\n ").concat(n,"\n}\n"),a="\ntroika_position_".concat(t," = vec3(position);\ntroika_normal_").concat(t," = vec3(normal);\ntroika_uv_").concat(t," = vec2(uv);\ntroikaVertexTransform").concat(t,"(troika_position_").concat(t,", troika_normal_").concat(t,", troika_uv_").concat(t,");\n").concat(a,"\n"),r=r.replace(/\b(position|normal|uv)\b/g,(m,b,L,F)=>/\battribute\s+vec[23]\s+$/.test(F.substr(0,L))?b:"troika_".concat(b,"_").concat(t)),h.map&&h.map.channel>0||(r=r.replace(/\bMAP_UV\b/g,"troika_uv_".concat(t)))),r=Ln(r,t,e,a,o),d=Ln(d,t,i,s,l),{vertexShader:r,fragmentShader:d}}p(_a,"upgradeShaders");function Ln(h,r,d,f,t){return(f||t||d)&&(h=h.replace(Cr,"\n".concat(d,"\nvoid troikaOrigMain").concat(r,"() {")),h+="\nvoid main() {\n ".concat(f,"\n troikaOrigMain").concat(r,"();\n ").concat(t,"\n}")),h}p(Ln,"injectIntoShaderCode");function ka(h,r){return h==="uniforms"?void 0:typeof r=="function"?r.toString():r}p(ka,"optionsJsonReplacer");var Ua=0,Gn=new Map;function Sa(h){let r=JSON.stringify(h,ka),d=Gn.get(r);return d==null&&Gn.set(r,d=++Ua),d}p(Sa,"getKeyForOptions");function wa(){return typeof window>"u"&&(self.window=self),function(h){var r={parse:function(t){var e=r._bin,a=new Uint8Array(t);if(e.readASCII(a,0,4)=="ttcf"){var o=4;e.readUshort(a,o),o+=2,e.readUshort(a,o),o+=2;var n=e.readUint(a,o);o+=4;for(var i=[],s=0;s<n;s++){var l=e.readUint(a,o);o+=4,i.push(r._readFont(a,l))}return i}return[r._readFont(a,0)]},_readFont:function(t,e){var a=r._bin,o=e;a.readFixed(t,e),e+=4;var n=a.readUshort(t,e);e+=2,a.readUshort(t,e),e+=2,a.readUshort(t,e),e+=2,a.readUshort(t,e),e+=2;for(var i=["cmap","head","hhea","maxp","hmtx","name","OS/2","post","loca","glyf","kern","CFF ","GDEF","GPOS","GSUB","SVG "],s={_data:t,_offset:o},l={},u=0;u<n;u++){var c=a.readASCII(t,e,4);e+=4,a.readUint(t,e),e+=4;var g=a.readUint(t,e);e+=4;var m=a.readUint(t,e);e+=4,l[c]={offset:g,length:m}}for(u=0;u<i.length;u++){var b=i[u];l[b]&&(s[b.trim()]=r[b.trim()].parse(t,l[b].offset,l[b].length,s))}return s},_tabOffset:function(t,e,a){for(var o=r._bin,n=o.readUshort(t,a+4),i=a+12,s=0;s<n;s++){var l=o.readASCII(t,i,4);i+=4,o.readUint(t,i),i+=4;var u=o.readUint(t,i);if(i+=4,o.readUint(t,i),i+=4,l==e)return u}return 0}};r._bin={readFixed:function(t,e){return(t[e]<<8|t[e+1])+(t[e+2]<<8|t[e+3])/65540},readF2dot14:function(t,e){return r._bin.readShort(t,e)/16384},readInt:function(t,e){return r._bin._view(t).getInt32(e)},readInt8:function(t,e){return r._bin._view(t).getInt8(e)},readShort:function(t,e){return r._bin._view(t).getInt16(e)},readUshort:function(t,e){return r._bin._view(t).getUint16(e)},readUshorts:function(t,e,a){for(var o=[],n=0;n<a;n++)o.push(r._bin.readUshort(t,e+2*n));return o},readUint:function(t,e){return r._bin._view(t).getUint32(e)},readUint64:function(t,e){return 4294967296*r._bin.readUint(t,e)+r._bin.readUint(t,e+4)},readASCII:function(t,e,a){for(var o="",n=0;n<a;n++)o+=String.fromCharCode(t[e+n]);return o},readUnicode:function(t,e,a){for(var o="",n=0;n<a;n++){var i=t[e++]<<8|t[e++];o+=String.fromCharCode(i)}return o},_tdec:typeof window<"u"&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(t,e,a){var o=r._bin._tdec;return o&&e==0&&a==t.length?o.decode(t):r._bin.readASCII(t,e,a)},readBytes:function(t,e,a){for(var o=[],n=0;n<a;n++)o.push(t[e+n]);return o},readASCIIArray:function(t,e,a){for(var o=[],n=0;n<a;n++)o.push(String.fromCharCode(t[e+n]));return o},_view:function(t){return t._dataView||(t._dataView=t.buffer?new DataView(t.buffer,t.byteOffset,t.byteLength):new DataView(new Uint8Array(t).buffer))}},r._lctf={},r._lctf.parse=function(t,e,a,o,n){var i=r._bin,s={},l=e;i.readFixed(t,e),e+=4;var u=i.readUshort(t,e);e+=2;var c=i.readUshort(t,e);e+=2;var g=i.readUshort(t,e);return e+=2,s.scriptList=r._lctf.readScriptList(t,l+u),s.featureList=r._lctf.readFeatureList(t,l+c),s.lookupList=r._lctf.readLookupList(t,l+g,n),s},r._lctf.readLookupList=function(t,e,a){var o=r._bin,n=e,i=[],s=o.readUshort(t,e);e+=2;for(var l=0;l<s;l++){var u=o.readUshort(t,e);e+=2;var c=r._lctf.readLookupTable(t,n+u,a);i.push(c)}return i},r._lctf.readLookupTable=function(t,e,a){var o=r._bin,n=e,i={tabs:[]};i.ltype=o.readUshort(t,e),e+=2,i.flag=o.readUshort(t,e),e+=2;var s=o.readUshort(t,e);e+=2;for(var l=i.ltype,u=0;u<s;u++){var c=o.readUshort(t,e);e+=2;var g=a(t,l,n+c,i);i.tabs.push(g)}return i},r._lctf.numOfOnes=function(t){for(var e=0,a=0;a<32;a++)t>>>a&1&&e++;return e},r._lctf.readClassDef=function(t,e){var a=r._bin,o=[],n=a.readUshort(t,e);if(e+=2,n==1){var i=a.readUshort(t,e);e+=2;var s=a.readUshort(t,e);e+=2;for(var l=0;l<s;l++)o.push(i+l),o.push(i+l),o.push(a.readUshort(t,e)),e+=2}if(n==2){var u=a.readUshort(t,e);for(e+=2,l=0;l<u;l++)o.push(a.readUshort(t,e)),e+=2,o.push(a.readUshort(t,e)),e+=2,o.push(a.readUshort(t,e)),e+=2}return o},r._lctf.getInterval=function(t,e){for(var a=0;a<t.length;a+=3){var o=t[a],n=t[a+1];if(t[a+2],o<=e&&e<=n)return a}return-1},r._lctf.readCoverage=function(t,e){var a=r._bin,o={};o.fmt=a.readUshort(t,e),e+=2;var n=a.readUshort(t,e);return e+=2,o.fmt==1&&(o.tab=a.readUshorts(t,e,n)),o.fmt==2&&(o.tab=a.readUshorts(t,e,3*n)),o},r._lctf.coverageIndex=function(t,e){var a=t.tab;if(t.fmt==1)return a.indexOf(e);if(t.fmt==2){var o=r._lctf.getInterval(a,e);if(o!=-1)return a[o+2]+(e-a[o])}return-1},r._lctf.readFeatureList=function(t,e){var a=r._bin,o=e,n=[],i=a.readUshort(t,e);e+=2;for(var s=0;s<i;s++){var l=a.readASCII(t,e,4);e+=4;var u=a.readUshort(t,e);e+=2;var c=r._lctf.readFeatureTable(t,o+u);c.tag=l.trim(),n.push(c)}return n},r._lctf.readFeatureTable=function(t,e){var a=r._bin,o=e,n={},i=a.readUshort(t,e);e+=2,i>0&&(n.featureParams=o+i);var s=a.readUshort(t,e);e+=2,n.tab=[];for(var l=0;l<s;l++)n.tab.push(a.readUshort(t,e+2*l));return n},r._lctf.readScriptList=function(t,e){var a=r._bin,o=e,n={},i=a.readUshort(t,e);e+=2;for(var s=0;s<i;s++){var l=a.readASCII(t,e,4);e+=4;var u=a.readUshort(t,e);e+=2,n[l.trim()]=r._lctf.readScriptTable(t,o+u)}return n},r._lctf.readScriptTable=function(t,e){var a=r._bin,o=e,n={},i=a.readUshort(t,e);e+=2,i>0&&(n.default=r._lctf.readLangSysTable(t,o+i));var s=a.readUshort(t,e);e+=2;for(var l=0;l<s;l++){var u=a.readASCII(t,e,4);e+=4;var c=a.readUshort(t,e);e+=2,n[u.trim()]=r._lctf.readLangSysTable(t,o+c)}return n},r._lctf.readLangSysTable=function(t,e){var a=r._bin,o={};a.readUshort(t,e),e+=2,o.reqFeature=a.readUshort(t,e),e+=2;var n=a.readUshort(t,e);return e+=2,o.features=a.readUshorts(t,e,n),o},r.CFF={},r.CFF.parse=function(t,e,a){var o=r._bin;(t=new Uint8Array(t.buffer,e,a))[e=0],t[++e],t[++e],t[++e],e++;var n=[];e=r.CFF.readIndex(t,e,n);for(var i=[],s=0;s<n.length-1;s++)i.push(o.readASCII(t,e+n[s],n[s+1]-n[s]));e+=n[n.length-1];var l=[];e=r.CFF.readIndex(t,e,l);var u=[];for(s=0;s<l.length-1;s++)u.push(r.CFF.readDict(t,e+l[s],e+l[s+1]));e+=l[l.length-1];var c=u[0],g=[];e=r.CFF.readIndex(t,e,g);var m=[];for(s=0;s<g.length-1;s++)m.push(o.readASCII(t,e+g[s],g[s+1]-g[s]));if(e+=g[g.length-1],r.CFF.readSubrs(t,e,c),c.CharStrings){e=c.CharStrings,g=[],e=r.CFF.readIndex(t,e,g);var b=[];for(s=0;s<g.length-1;s++)b.push(o.readBytes(t,e+g[s],g[s+1]-g[s]));c.CharStrings=b}if(c.ROS){e=c.FDArray;var L=[];for(e=r.CFF.readIndex(t,e,L),c.FDArray=[],s=0;s<L.length-1;s++){var F=r.CFF.readDict(t,e+L[s],e+L[s+1]);r.CFF._readFDict(t,F,m),c.FDArray.push(F)}e+=L[L.length-1],e=c.FDSelect,c.FDSelect=[];var U=t[e];if(e++,U!=3)throw U;var _=o.readUshort(t,e);for(e+=2,s=0;s<_+1;s++)c.FDSelect.push(o.readUshort(t,e),t[e+2]),e+=3}return c.Encoding&&(c.Encoding=r.CFF.readEncoding(t,c.Encoding,c.CharStrings.length)),c.charset&&(c.charset=r.CFF.readCharset(t,c.charset,c.CharStrings.length)),r.CFF._readFDict(t,c,m),c},r.CFF._readFDict=function(t,e,a){var o;for(var n in e.Private&&(o=e.Private[1],e.Private=r.CFF.readDict(t,o,o+e.Private[0]),e.Private.Subrs&&r.CFF.readSubrs(t,o+e.Private.Subrs,e.Private)),e)["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(n)!=-1&&(e[n]=a[e[n]-426+35])},r.CFF.readSubrs=function(t,e,a){var o=r._bin,n=[];e=r.CFF.readIndex(t,e,n);var i,s=n.length;i=s<1240?107:s<33900?1131:32768,a.Bias=i,a.Subrs=[];for(var l=0;l<n.length-1;l++)a.Subrs.push(o.readBytes(t,e+n[l],n[l+1]-n[l]))},r.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],r.CFF.glyphByUnicode=function(t,e){for(var a=0;a<t.charset.length;a++)if(t.charset[a]==e)return a;return-1},r.CFF.glyphBySE=function(t,e){return e<0||e>255?-1:r.CFF.glyphByUnicode(t,r.CFF.tableSE[e])},r.CFF.readEncoding=function(t,e,a){r._bin;var o=[".notdef"],n=t[e];if(e++,n!=0)throw"error: unknown encoding format: "+n;var i=t[e];e++;for(var s=0;s<i;s++)o.push(t[e+s]);return o},r.CFF.readCharset=function(t,e,a){var o=r._bin,n=[".notdef"],i=t[e];if(e++,i==0)for(var s=0;s<a;s++){var l=o.readUshort(t,e);e+=2,n.push(l)}else{if(i!=1&&i!=2)throw"error: format: "+i;for(;n.length<a;){l=o.readUshort(t,e),e+=2;var u=0;for(i==1?(u=t[e],e++):(u=o.readUshort(t,e),e+=2),s=0;s<=u;s++)n.push(l),l++}}return n},r.CFF.readIndex=function(t,e,a){var o=r._bin,n=o.readUshort(t,e)+1,i=t[e+=2];if(e++,i==1)for(var s=0;s<n;s++)a.push(t[e+s]);else if(i==2)for(s=0;s<n;s++)a.push(o.readUshort(t,e+2*s));else if(i==3)for(s=0;s<n;s++)a.push(16777215&o.readUint(t,e+3*s-1));else if(n!=1)throw"unsupported offset size: "+i+", count: "+n;return(e+=n*i)-1},r.CFF.getCharString=function(t,e,a){var o=r._bin,n=t[e],i=t[e+1];t[e+2],t[e+3],t[e+4];var s=1,l=null,u=null;n<=20&&(l=n,s=1),n==12&&(l=100*n+i,s=2),21<=n&&n<=27&&(l=n,s=1),n==28&&(u=o.readShort(t,e+1),s=3),29<=n&&n<=31&&(l=n,s=1),32<=n&&n<=246&&(u=n-139,s=1),247<=n&&n<=250&&(u=256*(n-247)+i+108,s=2),251<=n&&n<=254&&(u=256*-(n-251)-i-108,s=2),n==255&&(u=o.readInt(t,e+1)/65535,s=5),a.val=u!=null?u:"o"+l,a.size=s},r.CFF.readCharString=function(t,e,a){for(var o=e+a,n=r._bin,i=[];e<o;){var s=t[e],l=t[e+1];t[e+2],t[e+3],t[e+4];var u=1,c=null,g=null;s<=20&&(c=s,u=1),s==12&&(c=100*s+l,u=2),s!=19&&s!=20||(c=s,u=2),21<=s&&s<=27&&(c=s,u=1),s==28&&(g=n.readShort(t,e+1),u=3),29<=s&&s<=31&&(c=s,u=1),32<=s&&s<=246&&(g=s-139,u=1),247<=s&&s<=250&&(g=256*(s-247)+l+108,u=2),251<=s&&s<=254&&(g=256*-(s-251)-l-108,u=2),s==255&&(g=n.readInt(t,e+1)/65535,u=5),i.push(g!=null?g:"o"+c),e+=u}return i},r.CFF.readDict=function(t,e,a){for(var o=r._bin,n={},i=[];e<a;){var s=t[e],l=t[e+1];t[e+2],t[e+3],t[e+4];var u=1,c=null,g=null;if(s==28&&(g=o.readShort(t,e+1),u=3),s==29&&(g=o.readInt(t,e+1),u=5),32<=s&&s<=246&&(g=s-139,u=1),247<=s&&s<=250&&(g=256*(s-247)+l+108,u=2),251<=s&&s<=254&&(g=256*-(s-251)-l-108,u=2),s==255)throw g=o.readInt(t,e+1)/65535,u=5,"unknown number";if(s==30){var m=[];for(u=1;;){var b=t[e+u];u++;var L=b>>4,F=15&b;if(L!=15&&m.push(L),F!=15&&m.push(F),F==15)break}for(var U="",_=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],S=0;S<m.length;S++)U+=_[m[S]];g=parseFloat(U)}s<=21&&(c=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][s],u=1,s==12&&(c=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][l],u=2)),c!=null?(n[c]=i.length==1?i[0]:i,i=[]):i.push(g),e+=u}return n},r.cmap={},r.cmap.parse=function(t,e,a){t=new Uint8Array(t.buffer,e,a),e=0;var o=r._bin,n={};o.readUshort(t,e),e+=2;var i=o.readUshort(t,e);e+=2;var s=[];n.tables=[];for(var l=0;l<i;l++){var u=o.readUshort(t,e);e+=2;var c=o.readUshort(t,e);e+=2;var g=o.readUint(t,e);e+=4;var m="p"+u+"e"+c,b=s.indexOf(g);if(b==-1){var L;b=n.tables.length,s.push(g);var F=o.readUshort(t,g);F==0?L=r.cmap.parse0(t,g):F==4?L=r.cmap.parse4(t,g):F==6?L=r.cmap.parse6(t,g):F==12?L=r.cmap.parse12(t,g):console.debug("unknown format: "+F,u,c,g),n.tables.push(L)}if(n[m]!=null)throw"multiple tables for one platform+encoding";n[m]=b}return n},r.cmap.parse0=function(t,e){var a=r._bin,o={};o.format=a.readUshort(t,e),e+=2;var n=a.readUshort(t,e);e+=2,a.readUshort(t,e),e+=2,o.map=[];for(var i=0;i<n-6;i++)o.map.push(t[e+i]);return o},r.cmap.parse4=function(t,e){var a=r._bin,o=e,n={};n.format=a.readUshort(t,e),e+=2;var i=a.readUshort(t,e);e+=2,a.readUshort(t,e),e+=2;var s=a.readUshort(t,e);e+=2;var l=s/2;n.searchRange=a.readUshort(t,e),e+=2,n.entrySelector=a.readUshort(t,e),e+=2,n.rangeShift=a.readUshort(t,e),e+=2,n.endCount=a.readUshorts(t,e,l),e+=2*l,e+=2,n.startCount=a.readUshorts(t,e,l),e+=2*l,n.idDelta=[];for(var u=0;u<l;u++)n.idDelta.push(a.readShort(t,e)),e+=2;for(n.idRangeOffset=a.readUshorts(t,e,l),e+=2*l,n.glyphIdArray=[];e<o+i;)n.glyphIdArray.push(a.readUshort(t,e)),e+=2;return n},r.cmap.parse6=function(t,e){var a=r._bin,o={};o.format=a.readUshort(t,e),e+=2,a.readUshort(t,e),e+=2,a.readUshort(t,e),e+=2,o.firstCode=a.readUshort(t,e),e+=2;var n=a.readUshort(t,e);e+=2,o.glyphIdArray=[];for(var i=0;i<n;i++)o.glyphIdArray.push(a.readUshort(t,e)),e+=2;return o},r.cmap.parse12=function(t,e){var a=r._bin,o={};o.format=a.readUshort(t,e),e+=2,e+=2,a.readUint(t,e),e+=4,a.readUint(t,e),e+=4;var n=a.readUint(t,e);e+=4,o.groups=[];for(var i=0;i<n;i++){var s=e+12*i,l=a.readUint(t,s+0),u=a.readUint(t,s+4),c=a.readUint(t,s+8);o.groups.push([l,u,c])}return o},r.glyf={},r.glyf.parse=function(t,e,a,o){for(var n=[],i=0;i<o.maxp.numGlyphs;i++)n.push(null);return n},r.glyf._parseGlyf=function(t,e){var a=r._bin,o=t._data,n=r._tabOffset(o,"glyf",t._offset)+t.loca[e];if(t.loca[e]==t.loca[e+1])return null;var i={};if(i.noc=a.readShort(o,n),n+=2,i.xMin=a.readShort(o,n),n+=2,i.yMin=a.readShort(o,n),n+=2,i.xMax=a.readShort(o,n),n+=2,i.yMax=a.readShort(o,n),n+=2,i.xMin>=i.xMax||i.yMin>=i.yMax)return null;if(i.noc>0){i.endPts=[];for(var s=0;s<i.noc;s++)i.endPts.push(a.readUshort(o,n)),n+=2;var l=a.readUshort(o,n);if(n+=2,o.length-n<l)return null;i.instructions=a.readBytes(o,n,l),n+=l;var u=i.endPts[i.noc-1]+1;for(i.flags=[],s=0;s<u;s++){var c=o[n];if(n++,i.flags.push(c),(8&c)!=0){var g=o[n];n++;for(var m=0;m<g;m++)i.flags.push(c),s++}}for(i.xs=[],s=0;s<u;s++){var b=(2&i.flags[s])!=0,L=(16&i.flags[s])!=0;b?(i.xs.push(L?o[n]:-o[n]),n++):L?i.xs.push(0):(i.xs.push(a.readShort(o,n)),n+=2)}for(i.ys=[],s=0;s<u;s++)b=(4&i.flags[s])!=0,L=(32&i.flags[s])!=0,b?(i.ys.push(L?o[n]:-o[n]),n++):L?i.ys.push(0):(i.ys.push(a.readShort(o,n)),n+=2);var F=0,U=0;for(s=0;s<u;s++)F+=i.xs[s],U+=i.ys[s],i.xs[s]=F,i.ys[s]=U}else{var _;i.parts=[];do{_=a.readUshort(o,n),n+=2;var S={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(i.parts.push(S),S.glyphIndex=a.readUshort(o,n),n+=2,1&_){var D=a.readShort(o,n);n+=2;var x=a.readShort(o,n);n+=2}else D=a.readInt8(o,n),n++,x=a.readInt8(o,n),n++;2&_?(S.m.tx=D,S.m.ty=x):(S.p1=D,S.p2=x),8&_?(S.m.a=S.m.d=a.readF2dot14(o,n),n+=2):64&_?(S.m.a=a.readF2dot14(o,n),n+=2,S.m.d=a.readF2dot14(o,n),n+=2):128&_&&(S.m.a=a.readF2dot14(o,n),n+=2,S.m.b=a.readF2dot14(o,n),n+=2,S.m.c=a.readF2dot14(o,n),n+=2,S.m.d=a.readF2dot14(o,n),n+=2)}while(32&_);if(256&_){var A=a.readUshort(o,n);for(n+=2,i.instr=[],s=0;s<A;s++)i.instr.push(o[n]),n++}}return i},r.GDEF={},r.GDEF.parse=function(t,e,a,o){var n=e;e+=4;var i=r._bin.readUshort(t,e);return{glyphClassDef:i===0?null:r._lctf.readClassDef(t,n+i)}},r.GPOS={},r.GPOS.parse=function(t,e,a,o){return r._lctf.parse(t,e,a,o,r.GPOS.subt)},r.GPOS.subt=function(t,e,a,o){var n=r._bin,i=a,s={};if(s.fmt=n.readUshort(t,a),a+=2,e==1||e==2||e==3||e==7||e==8&&s.fmt<=2){var l=n.readUshort(t,a);a+=2,s.coverage=r._lctf.readCoverage(t,l+i)}if(e==1&&s.fmt==1){var u=n.readUshort(t,a);a+=2,u!=0&&(s.pos=r.GPOS.readValueRecord(t,a,u))}else if(e==2&&s.fmt>=1&&s.fmt<=2){u=n.readUshort(t,a),a+=2;var c=n.readUshort(t,a);a+=2;var g=r._lctf.numOfOnes(u),m=r._lctf.numOfOnes(c);if(s.fmt==1){s.pairsets=[];var b=n.readUshort(t,a);a+=2;for(var L=0;L<b;L++){var F=i+n.readUshort(t,a);a+=2;var U=n.readUshort(t,F);F+=2;for(var _=[],S=0;S<U;S++){var D=n.readUshort(t,F);F+=2,u!=0&&(y=r.GPOS.readValueRecord(t,F,u),F+=2*g),c!=0&&(O=r.GPOS.readValueRecord(t,F,c),F+=2*m),_.push({gid2:D,val1:y,val2:O})}s.pairsets.push(_)}}if(s.fmt==2){var x=n.readUshort(t,a);a+=2;var A=n.readUshort(t,a);a+=2;var W=n.readUshort(t,a);a+=2;var B=n.readUshort(t,a);for(a+=2,s.classDef1=r._lctf.readClassDef(t,i+x),s.classDef2=r._lctf.readClassDef(t,i+A),s.matrix=[],L=0;L<W;L++){var Y=[];for(S=0;S<B;S++){var y=null,O=null;u!=0&&(y=r.GPOS.readValueRecord(t,a,u),a+=2*g),c!=0&&(O=r.GPOS.readValueRecord(t,a,c),a+=2*m),Y.push({val1:y,val2:O})}s.matrix.push(Y)}}}else if(e==4&&s.fmt==1)s.markCoverage=r._lctf.readCoverage(t,n.readUshort(t,a)+i),s.baseCoverage=r._lctf.readCoverage(t,n.readUshort(t,a+2)+i),s.markClassCount=n.readUshort(t,a+4),s.markArray=r.GPOS.readMarkArray(t,n.readUshort(t,a+6)+i),s.baseArray=r.GPOS.readBaseArray(t,n.readUshort(t,a+8)+i,s.markClassCount);else if(e==6&&s.fmt==1)s.mark1Coverage=r._lctf.readCoverage(t,n.readUshort(t,a)+i),s.mark2Coverage=r._lctf.readCoverage(t,n.readUshort(t,a+2)+i),s.markClassCount=n.readUshort(t,a+4),s.mark1Array=r.GPOS.readMarkArray(t,n.readUshort(t,a+6)+i),s.mark2Array=r.GPOS.readBaseArray(t,n.readUshort(t,a+8)+i,s.markClassCount);else{if(e==9&&s.fmt==1){var w=n.readUshort(t,a);a+=2;var j=n.readUint(t,a);if(a+=4,o.ltype==9)o.ltype=w;else if(o.ltype!=w)throw"invalid extension substitution";return r.GPOS.subt(t,o.ltype,i+j)}console.debug("unsupported GPOS table LookupType",e,"format",s.fmt)}return s},r.GPOS.readValueRecord=function(t,e,a){var o=r._bin,n=[];return n.push(1&a?o.readShort(t,e):0),e+=1&a?2:0,n.push(2&a?o.readShort(t,e):0),e+=2&a?2:0,n.push(4&a?o.readShort(t,e):0),e+=4&a?2:0,n.push(8&a?o.readShort(t,e):0),e+=8&a?2:0,n},r.GPOS.readBaseArray=function(t,e,a){var o=r._bin,n=[],i=e,s=o.readUshort(t,e);e+=2;for(var l=0;l<s;l++){for(var u=[],c=0;c<a;c++)u.push(r.GPOS.readAnchorRecord(t,i+o.readUshort(t,e))),e+=2;n.push(u)}return n},r.GPOS.readMarkArray=function(t,e){var a=r._bin,o=[],n=e,i=a.readUshort(t,e);e+=2;for(var s=0;s<i;s++){var l=r.GPOS.readAnchorRecord(t,a.readUshort(t,e+2)+n);l.markClass=a.readUshort(t,e),o.push(l),e+=4}return o},r.GPOS.readAnchorRecord=function(t,e){var a=r._bin,o={};return o.fmt=a.readUshort(t,e),o.x=a.readShort(t,e+2),o.y=a.readShort(t,e+4),o},r.GSUB={},r.GSUB.parse=function(t,e,a,o){return r._lctf.parse(t,e,a,o,r.GSUB.subt)},r.GSUB.subt=function(t,e,a,o){var n=r._bin,i=a,s={};if(s.fmt=n.readUshort(t,a),a+=2,e!=1&&e!=2&&e!=4&&e!=5&&e!=6)return null;if(e==1||e==2||e==4||e==5&&s.fmt<=2||e==6&&s.fmt<=2){var l=n.readUshort(t,a);a+=2,s.coverage=r._lctf.readCoverage(t,i+l)}if(e==1&&s.fmt>=1&&s.fmt<=2){if(s.fmt==1)s.delta=n.readShort(t,a),a+=2;else if(s.fmt==2){var u=n.readUshort(t,a);a+=2,s.newg=n.readUshorts(t,a,u),a+=2*s.newg.length}}else if(e==2&&s.fmt==1){u=n.readUshort(t,a),a+=2,s.seqs=[];for(var c=0;c<u;c++){var g=n.readUshort(t,a)+i;a+=2;var m=n.readUshort(t,g);s.seqs.push(n.readUshorts(t,g+2,m))}}else if(e==4)for(s.vals=[],u=n.readUshort(t,a),a+=2,c=0;c<u;c++){var b=n.readUshort(t,a);a+=2,s.vals.push(r.GSUB.readLigatureSet(t,i+b))}else if(e==5&&s.fmt==2){if(s.fmt==2){var L=n.readUshort(t,a);a+=2,s.cDef=r._lctf.readClassDef(t,i+L),s.scset=[];var F=n.readUshort(t,a);for(a+=2,c=0;c<F;c++){var U=n.readUshort(t,a);a+=2,s.scset.push(U==0?null:r.GSUB.readSubClassSet(t,i+U))}}}else if(e==6&&s.fmt==3){if(s.fmt==3){for(c=0;c<3;c++){u=n.readUshort(t,a),a+=2;for(var _=[],S=0;S<u;S++)_.push(r._lctf.readCoverage(t,i+n.readUshort(t,a+2*S)));a+=2*u,c==0&&(s.backCvg=_),c==1&&(s.inptCvg=_),c==2&&(s.ahedCvg=_)}u=n.readUshort(t,a),a+=2,s.lookupRec=r.GSUB.readSubstLookupRecords(t,a,u)}}else{if(e==7&&s.fmt==1){var D=n.readUshort(t,a);a+=2;var x=n.readUint(t,a);if(a+=4,o.ltype==9)o.ltype=D;else if(o.ltype!=D)throw"invalid extension substitution";return r.GSUB.subt(t,o.ltype,i+x)}console.debug("unsupported GSUB table LookupType",e,"format",s.fmt)}return s},r.GSUB.readSubClassSet=function(t,e){var a=r._bin.readUshort,o=e,n=[],i=a(t,e);e+=2;for(var s=0;s<i;s++){var l=a(t,e);e+=2,n.push(r.GSUB.readSubClassRule(t,o+l))}return n},r.GSUB.readSubClassRule=function(t,e){var a=r._bin.readUshort,o={},n=a(t,e),i=a(t,e+=2);e+=2,o.input=[];for(var s=0;s<n-1;s++)o.input.push(a(t,e)),e+=2;return o.substLookupRecords=r.GSUB.readSubstLookupRecords(t,e,i),o},r.GSUB.readSubstLookupRecords=function(t,e,a){for(var o=r._bin.readUshort,n=[],i=0;i<a;i++)n.push(o(t,e),o(t,e+2)),e+=4;return n},r.GSUB.readChainSubClassSet=function(t,e){var a=r._bin,o=e,n=[],i=a.readUshort(t,e);e+=2;for(var s=0;s<i;s++){var l=a.readUshort(t,e);e+=2,n.push(r.GSUB.readChainSubClassRule(t,o+l))}return n},r.GSUB.readChainSubClassRule=function(t,e){for(var a=r._bin,o={},n=["backtrack","input","lookahead"],i=0;i<n.length;i++){var s=a.readUshort(t,e);e+=2,i==1&&s--,o[n[i]]=a.readUshorts(t,e,s),e+=2*o[n[i]].length}return s=a.readUshort(t,e),e+=2,o.subst=a.readUshorts(t,e,2*s),e+=2*o.subst.length,o},r.GSUB.readLigatureSet=function(t,e){var a=r._bin,o=e,n=[],i=a.readUshort(t,e);e+=2;for(var s=0;s<i;s++){var l=a.readUshort(t,e);e+=2,n.push(r.GSUB.readLigature(t,o+l))}return n},r.GSUB.readLigature=function(t,e){var a=r._bin,o={chain:[]};o.nglyph=a.readUshort(t,e),e+=2;var n=a.readUshort(t,e);e+=2;for(var i=0;i<n-1;i++)o.chain.push(a.readUshort(t,e)),e+=2;return o},r.head={},r.head.parse=function(t,e,a){var o=r._bin,n={};return o.readFixed(t,e),e+=4,n.fontRevision=o.readFixed(t,e),e+=4,o.readUint(t,e),e+=4,o.readUint(t,e),e+=4,n.flags=o.readUshort(t,e),e+=2,n.unitsPerEm=o.readUshort(t,e),e+=2,n.created=o.readUint64(t,e),e+=8,n.modified=o.readUint64(t,e),e+=8,n.xMin=o.readShort(t,e),e+=2,n.yMin=o.readShort(t,e),e+=2,n.xMax=o.readShort(t,e),e+=2,n.yMax=o.readShort(t,e),e+=2,n.macStyle=o.readUshort(t,e),e+=2,n.lowestRecPPEM=o.readUshort(t,e),e+=2,n.fontDirectionHint=o.readShort(t,e),e+=2,n.indexToLocFormat=o.readShort(t,e),e+=2,n.glyphDataFormat=o.readShort(t,e),e+=2,n},r.hhea={},r.hhea.parse=function(t,e,a){var o=r._bin,n={};return o.readFixed(t,e),e+=4,n.ascender=o.readShort(t,e),e+=2,n.descender=o.readShort(t,e),e+=2,n.lineGap=o.readShort(t,e),e+=2,n.advanceWidthMax=o.readUshort(t,e),e+=2,n.minLeftSideBearing=o.readShort(t,e),e+=2,n.minRightSideBearing=o.readShort(t,e),e+=2,n.xMaxExtent=o.readShort(t,e),e+=2,n.caretSlopeRise=o.readShort(t,e),e+=2,n.caretSlopeRun=o.readShort(t,e),e+=2,n.caretOffset=o.readShort(t,e),e+=2,e+=8,n.metricDataFormat=o.readShort(t,e),e+=2,n.numberOfHMetrics=o.readUshort(t,e),e+=2,n},r.hmtx={},r.hmtx.parse=function(t,e,a,o){for(var n=r._bin,i={aWidth:[],lsBearing:[]},s=0,l=0,u=0;u<o.maxp.numGlyphs;u++)u<o.hhea.numberOfHMetrics&&(s=n.readUshort(t,e),e+=2,l=n.readShort(t,e),e+=2),i.aWidth.push(s),i.lsBearing.push(l);return i},r.kern={},r.kern.parse=function(t,e,a,o){var n=r._bin,i=n.readUshort(t,e);if(e+=2,i==1)return r.kern.parseV1(t,e-2,a,o);var s=n.readUshort(t,e);e+=2;for(var l={glyph1:[],rval:[]},u=0;u<s;u++){e+=2,a=n.readUshort(t,e),e+=2;var c=n.readUshort(t,e);e+=2;var g=c>>>8;if((g&=15)!=0)throw"unknown kern table format: "+g;e=r.kern.readFormat0(t,e,l)}return l},r.kern.parseV1=function(t,e,a,o){var n=r._bin;n.readFixed(t,e),e+=4;var i=n.readUint(t,e);e+=4;for(var s={glyph1:[],rval:[]},l=0;l<i;l++){n.readUint(t,e),e+=4;var u=n.readUshort(t,e);e+=2,n.readUshort(t,e),e+=2;var c=u>>>8;if((c&=15)!=0)throw"unknown kern table format: "+c;e=r.kern.readFormat0(t,e,s)}return s},r.kern.readFormat0=function(t,e,a){var o=r._bin,n=-1,i=o.readUshort(t,e);e+=2,o.readUshort(t,e),e+=2,o.readUshort(t,e),e+=2,o.readUshort(t,e),e+=2;for(var s=0;s<i;s++){var l=o.readUshort(t,e);e+=2;var u=o.readUshort(t,e);e+=2;var c=o.readShort(t,e);e+=2,l!=n&&(a.glyph1.push(l),a.rval.push({glyph2:[],vals:[]}));var g=a.rval[a.rval.length-1];g.glyph2.push(u),g.vals.push(c),n=l}return e},r.loca={},r.loca.parse=function(t,e,a,o){var n=r._bin,i=[],s=o.head.indexToLocFormat,l=o.maxp.numGlyphs+1;if(s==0)for(var u=0;u<l;u++)i.push(n.readUshort(t,e+(u<<1))<<1);if(s==1)for(u=0;u<l;u++)i.push(n.readUint(t,e+(u<<2)));return i},r.maxp={},r.maxp.parse=function(t,e,a){var o=r._bin,n={},i=o.readUint(t,e);return e+=4,n.numGlyphs=o.readUshort(t,e),e+=2,i==65536&&(n.maxPoints=o.readUshort(t,e),e+=2,n.maxContours=o.readUshort(t,e),e+=2,n.maxCompositePoints=o.readUshort(t,e),e+=2,n.maxCompositeContours=o.readUshort(t,e),e+=2,n.maxZones=o.readUshort(t,e),e+=2,n.maxTwilightPoints=o.readUshort(t,e),e+=2,n.maxStorage=o.readUshort(t,e),e+=2,n.maxFunctionDefs=o.readUshort(t,e),e+=2,n.maxInstructionDefs=o.readUshort(t,e),e+=2,n.maxStackElements=o.readUshort(t,e),e+=2,n.maxSizeOfInstructions=o.readUshort(t,e),e+=2,n.maxComponentElements=o.readUshort(t,e),e+=2,n.maxComponentDepth=o.readUshort(t,e),e+=2),n},r.name={},r.name.parse=function(t,e,a){var o=r._bin,n={};o.readUshort(t,e),e+=2;var i=o.readUshort(t,e);e+=2,o.readUshort(t,e);for(var s,l=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],u=e+=2,c=0;c<i;c++){var g=o.readUshort(t,e);e+=2;var m=o.readUshort(t,e);e+=2;var b=o.readUshort(t,e);e+=2;var L=o.readUshort(t,e);e+=2;var F=o.readUshort(t,e);e+=2;var U=o.readUshort(t,e);e+=2;var _,S=l[L],D=u+12*i+U;if(g==0)_=o.readUnicode(t,D,F/2);else if(g==3&&m==0)_=o.readUnicode(t,D,F/2);else if(m==0)_=o.readASCII(t,D,F);else if(m==1)_=o.readUnicode(t,D,F/2);else if(m==3)_=o.readUnicode(t,D,F/2);else{if(g!=1)throw"unknown encoding "+m+", platformID: "+g;_=o.readASCII(t,D,F),console.debug("reading unknown MAC encoding "+m+" as ASCII")}var x="p"+g+","+b.toString(16);n[x]==null&&(n[x]={}),n[x][S!==void 0?S:L]=_,n[x]._lang=b}for(var A in n)if(n[A].postScriptName!=null&&n[A]._lang==1033)return n[A];for(var A in n)if(n[A].postScriptName!=null&&n[A]._lang==0)return n[A];for(var A in n)if(n[A].postScriptName!=null&&n[A]._lang==3084)return n[A];for(var A in n)if(n[A].postScriptName!=null)return n[A];for(var A in n){s=A;break}return console.debug("returning name table with languageID "+n[s]._lang),n[s]},r["OS/2"]={},r["OS/2"].parse=function(t,e,a){var o=r._bin.readUshort(t,e);e+=2;var n={};if(o==0)r["OS/2"].version0(t,e,n);else if(o==1)r["OS/2"].version1(t,e,n);else if(o==2||o==3||o==4)r["OS/2"].version2(t,e,n);else{if(o!=5)throw"unknown OS/2 table version: "+o;r["OS/2"].version5(t,e,n)}return n},r["OS/2"].version0=function(t,e,a){var o=r._bin;return a.xAvgCharWidth=o.readShort(t,e),e+=2,a.usWeightClass=o.readUshort(t,e),e+=2,a.usWidthClass=o.readUshort(t,e),e+=2,a.fsType=o.readUshort(t,e),e+=2,a.ySubscriptXSize=o.readShort(t,e),e+=2,a.ySubscriptYSize=o.readShort(t,e),e+=2,a.ySubscriptXOffset=o.readShort(t,e),e+=2,a.ySubscriptYOffset=o.readShort(t,e),e+=2,a.ySuperscriptXSize=o.readShort(t,e),e+=2,a.ySuperscriptYSize=o.readShort(t,e),e+=2,a.ySuperscriptXOffset=o.readShort(t,e),e+=2,a.ySuperscriptYOffset=o.readShort(t,e),e+=2,a.yStrikeoutSize=o.readShort(t,e),e+=2,a.yStrikeoutPosition=o.readShort(t,e),e+=2,a.sFamilyClass=o.readShort(t,e),e+=2,a.panose=o.readBytes(t,e,10),e+=10,a.ulUnicodeRange1=o.readUint(t,e),e+=4,a.ulUnicodeRange2=o.readUint(t,e),e+=4,a.ulUnicodeRange3=o.readUint(t,e),e+=4,a.ulUnicodeRange4=o.readUint(t,e),e+=4,a.achVendID=[o.readInt8(t,e),o.readInt8(t,e+1),o.readInt8(t,e+2),o.readInt8(t,e+3)],e+=4,a.fsSelection=o.readUshort(t,e),e+=2,a.usFirstCharIndex=o.readUshort(t,e),e+=2,a.usLastCharIndex=o.readUshort(t,e),e+=2,a.sTypoAscender=o.readShort(t,e),e+=2,a.sTypoDescender=o.readShort(t,e),e+=2,a.sTypoLineGap=o.readShort(t,e),e+=2,a.usWinAscent=o.readUshort(t,e),e+=2,a.usWinDescent=o.readUshort(t,e),e+=2},r["OS/2"].version1=function(t,e,a){var o=r._bin;return e=r["OS/2"].version0(t,e,a),a.ulCodePageRange1=o.readUint(t,e),e+=4,a.ulCodePageRange2=o.readUint(t,e),e+=4},r["OS/2"].version2=function(t,e,a){var o=r._bin;return e=r["OS/2"].version1(t,e,a),a.sxHeight=o.readShort(t,e),e+=2,a.sCapHeight=o.readShort(t,e),e+=2,a.usDefault=o.readUshort(t,e),e+=2,a.usBreak=o.readUshort(t,e),e+=2,a.usMaxContext=o.readUshort(t,e),e+=2},r["OS/2"].version5=function(t,e,a){var o=r._bin;return e=r["OS/2"].version2(t,e,a),a.usLowerOpticalPointSize=o.readUshort(t,e),e+=2,a.usUpperOpticalPointSize=o.readUshort(t,e),e+=2},r.post={},r.post.parse=function(t,e,a){var o=r._bin,n={};return n.version=o.readFixed(t,e),e+=4,n.italicAngle=o.readFixed(t,e),e+=4,n.underlinePosition=o.readShort(t,e),e+=2,n.underlineThickness=o.readShort(t,e),e+=2,n},r==null&&(r={}),r.U==null&&(r.U={}),r.U.codeToGlyph=function(t,e){var a=t.cmap,o=-1;if(a.p0e4!=null?o=a.p0e4:a.p3e1!=null?o=a.p3e1:a.p1e0!=null?o=a.p1e0:a.p0e3!=null&&(o=a.p0e3),o==-1)throw"no familiar platform and encoding!";var n=a.tables[o];if(n.format==0)return e>=n.map.length?0:n.map[e];if(n.format==4){for(var i=-1,s=0;s<n.endCount.length;s++)if(e<=n.endCount[s]){i=s;break}return i==-1||n.startCount[i]>e?0:65535&(n.idRangeOffset[i]!=0?n.glyphIdArray[e-n.startCount[i]+(n.idRangeOffset[i]>>1)-(n.idRangeOffset.length-i)]:e+n.idDelta[i])}if(n.format==12){if(e>n.groups[n.groups.length-1][1])return 0;for(s=0;s<n.groups.length;s++){var l=n.groups[s];if(l[0]<=e&&e<=l[1])return l[2]+(e-l[0])}return 0}throw"unknown cmap table format "+n.format},r.U.glyphToPath=function(t,e){var a={cmds:[],crds:[]};if(t.SVG&&t.SVG.entries[e]){var o=t.SVG.entries[e];return o==null?a:(typeof o=="string"&&(o=r.SVG.toPath(o),t.SVG.entries[e]=o),o)}if(t.CFF){var n={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:t.CFF.Private?t.CFF.Private.defaultWidthX:0,open:!1},i=t.CFF,s=t.CFF.Private;if(i.ROS){for(var l=0;i.FDSelect[l+2]<=e;)l+=2;s=i.FDArray[i.FDSelect[l+1]].Private}r.U._drawCFF(t.CFF.CharStrings[e],n,i,s,a)}else t.glyf&&r.U._drawGlyf(e,t,a);return a},r.U._drawGlyf=function(t,e,a){var o=e.glyf[t];o==null&&(o=e.glyf[t]=r.glyf._parseGlyf(e,t)),o!=null&&(o.noc>-1?r.U._simpleGlyph(o,a):r.U._compoGlyph(o,e,a))},r.U._simpleGlyph=function(t,e){for(var a=0;a<t.noc;a++){for(var o=a==0?0:t.endPts[a-1]+1,n=t.endPts[a],i=o;i<=n;i++){var s=i==o?n:i-1,l=i==n?o:i+1,u=1&t.flags[i],c=1&t.flags[s],g=1&t.flags[l],m=t.xs[i],b=t.ys[i];if(i==o)if(u){if(!c){r.U.P.moveTo(e,m,b);continue}r.U.P.moveTo(e,t.xs[s],t.ys[s])}else c?r.U.P.moveTo(e,t.xs[s],t.ys[s]):r.U.P.moveTo(e,(t.xs[s]+m)/2,(t.ys[s]+b)/2);u?c&&r.U.P.lineTo(e,m,b):g?r.U.P.qcurveTo(e,m,b,t.xs[l],t.ys[l]):r.U.P.qcurveTo(e,m,b,(m+t.xs[l])/2,(b+t.ys[l])/2)}r.U.P.closePath(e)}},r.U._compoGlyph=function(t,e,a){for(var o=0;o<t.parts.length;o++){var n={cmds:[],crds:[]},i=t.parts[o];r.U._drawGlyf(i.glyphIndex,e,n);for(var s=i.m,l=0;l<n.crds.length;l+=2){var u=n.crds[l],c=n.crds[l+1];a.crds.push(u*s.a+c*s.b+s.tx),a.crds.push(u*s.c+c*s.d+s.ty)}for(l=0;l<n.cmds.length;l++)a.cmds.push(n.cmds[l])}},r.U._getGlyphClass=function(t,e){var a=r._lctf.getInterval(e,t);return a==-1?0:e[a+2]},r.U._applySubs=function(t,e,a,o){for(var n=t.length-e-1,i=0;i<a.tabs.length;i++)if(a.tabs[i]!=null){var s,l=a.tabs[i];if(!l.coverage||(s=r._lctf.coverageIndex(l.coverage,t[e]))!=-1){if(a.ltype==1)t[e],l.fmt==1?t[e]=t[e]+l.delta:t[e]=l.newg[s];else if(a.ltype==4)for(var u=l.vals[s],c=0;c<u.length;c++){var g=u[c],m=g.chain.length;if(!(m>n)){for(var b=!0,L=0,F=0;F<m;F++){for(;t[e+L+(1+F)]==-1;)L++;g.chain[F]!=t[e+L+(1+F)]&&(b=!1)}if(b){for(t[e]=g.nglyph,F=0;F<m+L;F++)t[e+F+1]=-1;break}}}else if(a.ltype==5&&l.fmt==2)for(var U=r._lctf.getInterval(l.cDef,t[e]),_=l.cDef[U+2],S=l.scset[_],D=0;D<S.length;D++){var x=S[D],A=x.input;if(!(A.length>n)){for(b=!0,F=0;F<A.length;F++){var W=r._lctf.getInterval(l.cDef,t[e+1+F]);if(U==-1&&l.cDef[W+2]!=A[F]){b=!1;break}}if(b){var B=x.substLookupRecords;for(c=0;c<B.length;c+=2)B[c],B[c+1]}}}else if(a.ltype==6&&l.fmt==3){if(!r.U._glsCovered(t,l.backCvg,e-l.backCvg.length)||!r.U._glsCovered(t,l.inptCvg,e)||!r.U._glsCovered(t,l.ahedCvg,e+l.inptCvg.length))continue;var Y=l.lookupRec;for(D=0;D<Y.length;D+=2){U=Y[D];var y=o[Y[D+1]];r.U._applySubs(t,e+U,y,o)}}}}},r.U._glsCovered=function(t,e,a){for(var o=0;o<e.length;o++)if(r._lctf.coverageIndex(e[o],t[a+o])==-1)return!1;return!0},r.U.glyphsToPath=function(t,e,a){for(var o={cmds:[],crds:[]},n=0,i=0;i<e.length;i++){var s=e[i];if(s!=-1){for(var l=i<e.length-1&&e[i+1]!=-1?e[i+1]:0,u=r.U.glyphToPath(t,s),c=0;c<u.crds.length;c+=2)o.crds.push(u.crds[c]+n),o.crds.push(u.crds[c+1]);for(a&&o.cmds.push(a),c=0;c<u.cmds.length;c++)o.cmds.push(u.cmds[c]);a&&o.cmds.push("X"),n+=t.hmtx.aWidth[s],i<e.length-1&&(n+=r.U.getPairAdjustment(t,s,l))}}return o},r.U.P={},r.U.P.moveTo=function(t,e,a){t.cmds.push("M"),t.crds.push(e,a)},r.U.P.lineTo=function(t,e,a){t.cmds.push("L"),t.crds.push(e,a)},r.U.P.curveTo=function(t,e,a,o,n,i,s){t.cmds.push("C"),t.crds.push(e,a,o,n,i,s)},r.U.P.qcurveTo=function(t,e,a,o,n){t.cmds.push("Q"),t.crds.push(e,a,o,n)},r.U.P.closePath=function(t){t.cmds.push("Z")},r.U._drawCFF=function(t,e,a,o,n){for(var i=e.stack,s=e.nStems,l=e.haveWidth,u=e.width,c=e.open,g=0,m=e.x,b=e.y,L=0,F=0,U=0,_=0,S=0,D=0,x=0,A=0,W=0,B=0,Y={val:0,size:0};g<t.length;){r.CFF.getCharString(t,g,Y);var y=Y.val;if(g+=Y.size,y=="o1"||y=="o18")i.length%2!=0&&!l&&(u=i.shift()+o.nominalWidthX),s+=i.length>>1,i.length=0,l=!0;else if(y=="o3"||y=="o23")i.length%2!=0&&!l&&(u=i.shift()+o.nominalWidthX),s+=i.length>>1,i.length=0,l=!0;else if(y=="o4")i.length>1&&!l&&(u=i.shift()+o.nominalWidthX,l=!0),c&&r.U.P.closePath(n),b+=i.pop(),r.U.P.moveTo(n,m,b),c=!0;else if(y=="o5")for(;i.length>0;)m+=i.shift(),b+=i.shift(),r.U.P.lineTo(n,m,b);else if(y=="o6"||y=="o7")for(var O=i.length,w=y=="o6",j=0;j<O;j++){var P=i.shift();w?m+=P:b+=P,w=!w,r.U.P.lineTo(n,m,b)}else if(y=="o8"||y=="o24"){O=i.length;for(var Z=0;Z+6<=O;)L=m+i.shift(),F=b+i.shift(),U=L+i.shift(),_=F+i.shift(),m=U+i.shift(),b=_+i.shift(),r.U.P.curveTo(n,L,F,U,_,m,b),Z+=6;y=="o24"&&(m+=i.shift(),b+=i.shift(),r.U.P.lineTo(n,m,b))}else{if(y=="o11")break;if(y=="o1234"||y=="o1235"||y=="o1236"||y=="o1237")y=="o1234"&&(F=b,U=(L=m+i.shift())+i.shift(),B=_=F+i.shift(),D=_,A=b,m=(x=(S=(W=U+i.shift())+i.shift())+i.shift())+i.shift(),r.U.P.curveTo(n,L,F,U,_,W,B),r.U.P.curveTo(n,S,D,x,A,m,b)),y=="o1235"&&(L=m+i.shift(),F=b+i.shift(),U=L+i.shift(),_=F+i.shift(),W=U+i.shift(),B=_+i.shift(),S=W+i.shift(),D=B+i.shift(),x=S+i.shift(),A=D+i.shift(),m=x+i.shift(),b=A+i.shift(),i.shift(),r.U.P.curveTo(n,L,F,U,_,W,B),r.U.P.curveTo(n,S,D,x,A,m,b)),y=="o1236"&&(L=m+i.shift(),F=b+i.shift(),U=L+i.shift(),B=_=F+i.shift(),D=_,x=(S=(W=U+i.shift())+i.shift())+i.shift(),A=D+i.shift(),m=x+i.shift(),r.U.P.curveTo(n,L,F,U,_,W,B),r.U.P.curveTo(n,S,D,x,A,m,b)),y=="o1237"&&(L=m+i.shift(),F=b+i.shift(),U=L+i.shift(),_=F+i.shift(),W=U+i.shift(),B=_+i.shift(),S=W+i.shift(),D=B+i.shift(),x=S+i.shift(),A=D+i.shift(),Math.abs(x-m)>Math.abs(A-b)?m=x+i.shift():b=A+i.shift(),r.U.P.curveTo(n,L,F,U,_,W,B),r.U.P.curveTo(n,S,D,x,A,m,b));else if(y=="o14"){if(i.length>0&&!l&&(u=i.shift()+a.nominalWidthX,l=!0),i.length==4){var se=i.shift(),I=i.shift(),R=i.shift(),v=i.shift(),T=r.CFF.glyphBySE(a,R),M=r.CFF.glyphBySE(a,v);r.U._drawCFF(a.CharStrings[T],e,a,o,n),e.x=se,e.y=I,r.U._drawCFF(a.CharStrings[M],e,a,o,n)}c&&(r.U.P.closePath(n),c=!1)}else if(y=="o19"||y=="o20")i.length%2!=0&&!l&&(u=i.shift()+o.nominalWidthX),s+=i.length>>1,i.length=0,l=!0,g+=s+7>>3;else if(y=="o21")i.length>2&&!l&&(u=i.shift()+o.nominalWidthX,l=!0),b+=i.pop(),m+=i.pop(),c&&r.U.P.closePath(n),r.U.P.moveTo(n,m,b),c=!0;else if(y=="o22")i.length>1&&!l&&(u=i.shift()+o.nominalWidthX,l=!0),m+=i.pop(),c&&r.U.P.closePath(n),r.U.P.moveTo(n,m,b),c=!0;else if(y=="o25"){for(;i.length>6;)m+=i.shift(),b+=i.shift(),r.U.P.lineTo(n,m,b);L=m+i.shift(),F=b+i.shift(),U=L+i.shift(),_=F+i.shift(),m=U+i.shift(),b=_+i.shift(),r.U.P.curveTo(n,L,F,U,_,m,b)}else if(y=="o26")for(i.length%2&&(m+=i.shift());i.length>0;)L=m,F=b+i.shift(),m=U=L+i.shift(),b=(_=F+i.shift())+i.shift(),r.U.P.curveTo(n,L,F,U,_,m,b);else if(y=="o27")for(i.length%2&&(b+=i.shift());i.length>0;)F=b,U=(L=m+i.shift())+i.shift(),_=F+i.shift(),m=U+i.shift(),b=_,r.U.P.curveTo(n,L,F,U,_,m,b);else if(y=="o10"||y=="o29"){var C=y=="o10"?o:a;if(i.length==0)console.debug("error: empty stack");else{var k=i.pop(),N=C.Subrs[k+C.Bias];e.x=m,e.y=b,e.nStems=s,e.haveWidth=l,e.width=u,e.open=c,r.U._drawCFF(N,e,a,o,n),m=e.x,b=e.y,s=e.nStems,l=e.haveWidth,u=e.width,c=e.open}}else if(y=="o30"||y=="o31"){var E=i.length,z=(Z=0,y=="o31");for(Z+=E-(O=-3&E);Z<O;)z?(F=b,U=(L=m+i.shift())+i.shift(),b=(_=F+i.shift())+i.shift(),O-Z==5?(m=U+i.shift(),Z++):m=U,z=!1):(L=m,F=b+i.shift(),U=L+i.shift(),_=F+i.shift(),m=U+i.shift(),O-Z==5?(b=_+i.shift(),Z++):b=_,z=!0),r.U.P.curveTo(n,L,F,U,_,m,b),Z+=4}else{if((y+"").charAt(0)=="o")throw console.debug("Unknown operation: "+y,t),y;i.push(y)}}}e.x=m,e.y=b,e.nStems=s,e.haveWidth=l,e.width=u,e.open=c};var d=r,f={Typr:d};return h.Typr=d,h.default=f,Object.defineProperty(h,"__esModule",{value:!0}),h}({}).Typr}p(wa,"typrFactory");function Fa(){return function(h){var r=Uint8Array,d=Uint16Array,f=Uint32Array,t=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),e=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=p(function(y,O){for(var w=new d(31),j=0;j<31;++j)w[j]=O+=1<<y[j-1];var P=new f(w[30]);for(j=1;j<30;++j)for(var Z=w[j];Z<w[j+1];++Z)P[Z]=Z-w[j]<<5|j;return[w,P]},"f"),n=o(t,2),i=n[0],s=n[1];i[28]=258,s[258]=28;for(var l=o(e,0)[0],u=new d(32768),c=0;c<32768;++c){var g=(43690&c)>>>1|(21845&c)<<1;g=(61680&(g=(52428&g)>>>2|(13107&g)<<2))>>>4|(3855&g)<<4,u[c]=((65280&g)>>>8|(255&g)<<8)>>>1}var m=p(function(y,O,w){for(var j=y.length,P=0,Z=new d(O);P<j;++P)++Z[y[P]-1];var se,I=new d(O);for(P=0;P<O;++P)I[P]=I[P-1]+Z[P-1]<<1;if(w){se=new d(1<<O);var R=15-O;for(P=0;P<j;++P)if(y[P])for(var v=P<<4|y[P],T=O-y[P],M=I[y[P]-1]++<<T,C=M|(1<<T)-1;M<=C;++M)se[u[M]>>>R]=v}else for(se=new d(j),P=0;P<j;++P)y[P]&&(se[P]=u[I[y[P]-1]++]>>>15-y[P]);return se},"w"),b=new r(288);for(c=0;c<144;++c)b[c]=8;for(c=144;c<256;++c)b[c]=9;for(c=256;c<280;++c)b[c]=7;for(c=280;c<288;++c)b[c]=8;var L=new r(32);for(c=0;c<32;++c)L[c]=5;var F=m(b,9,1),U=m(L,5,1),_=p(function(y){for(var O=y[0],w=1;w<y.length;++w)y[w]>O&&(O=y[w]);return O},"y"),S=p(function(y,O,w){var j=O/8|0;return(y[j]|y[j+1]<<8)>>(7&O)&w},"L"),D=p(function(y,O){var w=O/8|0;return(y[w]|y[w+1]<<8|y[w+2]<<16)>>(7&O)},"U"),x=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],A=p(function(y,O,w){var j=new Error(O||x[y]);if(j.code=y,Error.captureStackTrace&&Error.captureStackTrace(j,A),!w)throw j;return j},"T"),W=p(function(y,O,w){var j=y.length;if(!j||w&&!w.l&&j<5)return O||new r(0);var P=!O||w,Z=!w||w.i;w||(w={}),O||(O=new r(3*j));var se,I=p(function(fe){var Se=O.length;if(fe>Se){var we=new r(Math.max(2*Se,fe));we.set(O),O=we}},"d"),R=w.f||0,v=w.p||0,T=w.b||0,M=w.l,C=w.d,k=w.m,N=w.n,E=8*j;do{if(!M){w.f=R=S(y,v,1);var z=S(y,v+1,3);if(v+=3,!z){var J=y[($=((se=v)/8|0)+(7&se&&1)+4)-4]|y[$-3]<<8,ee=$+J;if(ee>j){Z&&A(0);break}P&&I(T+J),O.set(y.subarray($,ee),T),w.b=T+=J,w.p=v=8*ee;continue}if(z==1)M=F,C=U,k=9,N=5;else if(z==2){var H=S(y,v,31)+257,V=S(y,v+10,15)+4,ge=H+S(y,v+5,31)+1;v+=14;for(var ce=new r(ge),q=new r(19),te=0;te<V;++te)q[a[te]]=S(y,v+3*te,7);v+=3*V;var le=_(q),X=(1<<le)-1,re=m(q,le,1);for(te=0;te<ge;){var $,G=re[S(y,v,X)];if(v+=15&G,($=G>>>4)<16)ce[te++]=$;else{var de=0,Q=0;for($==16?(Q=3+S(y,v,3),v+=2,de=ce[te-1]):$==17?(Q=3+S(y,v,7),v+=3):$==18&&(Q=11+S(y,v,127),v+=7);Q--;)ce[te++]=de}}var ae=ce.subarray(0,H),K=ce.subarray(H);k=_(ae),N=_(K),M=m(ae,k,1),C=m(K,N,1)}else A(1);if(v>E){Z&&A(0);break}}P&&I(T+131072);for(var xe=(1<<k)-1,ne=(1<<N)-1,oe=v;;oe=v){var ue=(de=M[D(y,v)&xe])>>>4;if((v+=15&de)>E){Z&&A(0);break}if(de||A(2),ue<256)O[T++]=ue;else{if(ue==256){oe=v,M=null;break}var ve=ue-254;if(ue>264){var ke=t[te=ue-257];ve=S(y,v,(1<<ke)-1)+i[te],v+=ke}var Ae=C[D(y,v)&ne],me=Ae>>>4;if(Ae||A(3),v+=15&Ae,K=l[me],me>3&&(ke=e[me],K+=D(y,v)&(1<<ke)-1,v+=ke),v>E){Z&&A(0);break}P&&I(T+131072);for(var ye=T+ve;T<ye;T+=4)O[T]=O[T-K],O[T+1]=O[T+1-K],O[T+2]=O[T+2-K],O[T+3]=O[T+3-K];T=ye}}w.l=M,w.p=oe,w.b=T,M&&(R=1,w.m=k,w.d=C,w.n=N)}while(!R);return T==O.length?O:function(fe,Se,we){(Se==null||Se<0)&&(Se=0),(we==null||we>fe.length)&&(we=fe.length);var Le=new(fe instanceof d?d:fe instanceof f?f:r)(we-Se);return Le.set(fe.subarray(Se,we)),Le}(O,0,T)},"O"),B=new r(0),Y=typeof TextDecoder<"u"&&new TextDecoder;try{Y.decode(B,{stream:!0})}catch{}return h.convert_streams=function(y){var O=new DataView(y),w=0;function j(){var H=O.getUint16(w);return w+=2,H}p(j,"t");function P(){var H=O.getUint32(w);return w+=4,H}p(P,"a");function Z(H){J.setUint16(ee,H),ee+=2}p(Z,"i");function se(H){J.setUint32(ee,H),ee+=4}p(se,"o");for(var I={signature:P(),flavor:P(),length:P(),numTables:j(),reserved:j(),totalSfntSize:P(),majorVersion:j(),minorVersion:j(),metaOffset:P(),metaLength:P(),metaOrigLength:P(),privOffset:P(),privLength:P()},R=0;Math.pow(2,R)<=I.numTables;)R++;R--;for(var v=16*Math.pow(2,R),T=16*I.numTables-v,M=12,C=[],k=0;k<I.numTables;k++)C.push({tag:P(),offset:P(),compLength:P(),origLength:P(),origChecksum:P()}),M+=16;var N,E=new Uint8Array(12+16*C.length+C.reduce(function(H,V){return H+V.origLength+4},0)),z=E.buffer,J=new DataView(z),ee=0;return se(I.flavor),Z(I.numTables),Z(v),Z(R),Z(T),C.forEach(function(H){se(H.tag),se(H.origChecksum),se(M),se(H.origLength),H.outOffset=M,(M+=H.origLength)%4!=0&&(M+=4-M%4)}),C.forEach(function(H){var V,ge=y.slice(H.offset,H.offset+H.compLength);if(H.compLength!=H.origLength){var ce=new Uint8Array(H.origLength);V=new Uint8Array(ge,2),W(V,ce)}else ce=new Uint8Array(ge);E.set(ce,H.outOffset);var q=0;(M=H.outOffset+H.origLength)%4!=0&&(q=4-M%4),E.set(new Uint8Array(q).buffer,H.outOffset+H.origLength),N=M+q}),z.slice(0,N)},Object.defineProperty(h,"__esModule",{value:!0}),h}({}).convert_streams}p(Fa,"woff2otfFactory");function Ma(h,r){let d={M:2,L:2,Q:4,C:6,Z:0},f={C:"18g,ca,368,1kz",D:"17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",R:"17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",L:"x9u,jff,a,fd,jv",T:"4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"},t=1,e=2,a=4,o=8,n=16,i=32,s;function l(x){if(!s){let A={R:e,L:t,D:a,C:n,U:i,T:o};s=new Map;for(let W in f){let B=0;f[W].split(",").forEach(Y=>{let[y,O]=Y.split("+");y=parseInt(y,36),O=O?parseInt(O,36):0,s.set(B+=y,A[W]);for(let w=O;w--;)s.set(++B,A[W])})}}return s.get(x)||i}p(l,"getCharJoiningType");let u=1,c=2,g=3,m=4,b=[null,"isol","init","fina","medi"];function L(x){let A=new Uint8Array(x.length),W=i,B=u,Y=-1;for(let y=0;y<x.length;y++){let O=x.codePointAt(y),w=l(O)|0,j=u;w&o||(W&(t|a|n)?w&(e|a|n)?(j=g,(B===u||B===g)&&A[Y]++):w&(t|i)&&(B===c||B===m)&&A[Y]--:W&(e|i)&&(B===c||B===m)&&A[Y]--,B=A[y]=j,W=w,Y=y,O>65535&&y++)}return A}p(L,"detectJoiningForms");function F(x,A){let W=[];for(let Y=0;Y<A.length;Y++){let y=A.codePointAt(Y);y>65535&&Y++,W.push(h.U.codeToGlyph(x,y))}let B=x.GSUB;if(B){let{lookupList:Y,featureList:y}=B,O,w=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,j=[];y.forEach(P=>{if(w.test(P.tag))for(let Z=0;Z<P.tab.length;Z++){if(j[P.tab[Z]])continue;j[P.tab[Z]]=!0;let se=Y[P.tab[Z]],I=/^(isol|init|fina|medi)$/.test(P.tag);I&&!O&&(O=L(A));for(let R=0;R<W.length;R++)(!O||!I||b[O[R]]===P.tag)&&h.U._applySubs(W,R,se,Y)}})}return W}p(F,"stringToGlyphs");function U(x,A){let W=new Int16Array(A.length*3),B=0;for(;B<A.length;B++){let w=A[B];if(w===-1)continue;W[B*3+2]=x.hmtx.aWidth[w];let j=x.GPOS;if(j){let P=j.lookupList;for(let Z=0;Z<P.length;Z++){let se=P[Z];for(let I=0;I<se.tabs.length;I++){let R=se.tabs[I];if(se.ltype===1){if(h._lctf.coverageIndex(R.coverage,w)!==-1&&R.pos){O(R.pos,B);break}}else if(se.ltype===2){let v=null,T=Y();if(T!==-1){let M=h._lctf.coverageIndex(R.coverage,A[T]);if(M!==-1){if(R.fmt===1){let C=R.pairsets[M];for(let k=0;k<C.length;k++)C[k].gid2===w&&(v=C[k])}else if(R.fmt===2){let C=h.U._getGlyphClass(A[T],R.classDef1),k=h.U._getGlyphClass(w,R.classDef2);v=R.matrix[C][k]}if(v){v.val1&&O(v.val1,T),v.val2&&O(v.val2,B);break}}}}else if(se.ltype===4){let v=h._lctf.coverageIndex(R.markCoverage,w);if(v!==-1){let T=Y(y),M=T===-1?-1:h._lctf.coverageIndex(R.baseCoverage,A[T]);if(M!==-1){let C=R.markArray[v],k=R.baseArray[M][C.markClass];W[B*3]=k.x-C.x+W[T*3]-W[T*3+2],W[B*3+1]=k.y-C.y+W[T*3+1];break}}}else if(se.ltype===6){let v=h._lctf.coverageIndex(R.mark1Coverage,w);if(v!==-1){let T=Y();if(T!==-1){let M=A[T];if(_(x,M)===3){let C=h._lctf.coverageIndex(R.mark2Coverage,M);if(C!==-1){let k=R.mark1Array[v],N=R.mark2Array[C][k.markClass];W[B*3]=N.x-k.x+W[T*3]-W[T*3+2],W[B*3+1]=N.y-k.y+W[T*3+1];break}}}}}}}}else if(x.kern&&!x.cff){let P=Y();if(P!==-1){let Z=x.kern.glyph1.indexOf(A[P]);if(Z!==-1){let se=x.kern.rval[Z].glyph2.indexOf(w);se!==-1&&(W[P*3+2]+=x.kern.rval[Z].vals[se])}}}}return W;function Y(w){for(let j=B-1;j>=0;j--)if(A[j]!==-1&&(!w||w(A[j])))return j;return-1}function y(w){return _(x,w)===1}function O(w,j){for(let P=0;P<3;P++)W[j*3+P]+=w[P]||0}}p(U,"calcGlyphPositions");function _(x,A){let W=x.GDEF&&x.GDEF.glyphClassDef;return W?h.U._getGlyphClass(A,W):0}p(_,"getGlyphClass");function S(...x){for(let A=0;A<x.length;A++)if(typeof x[A]=="number")return x[A]}p(S,"firstNum");function D(x){let A=Object.create(null),W=x["OS/2"],B=x.hhea,Y=x.head.unitsPerEm,y=S(W&&W.sTypoAscender,B&&B.ascender,Y),O={unitsPerEm:Y,ascender:y,descender:S(W&&W.sTypoDescender,B&&B.descender,0),capHeight:S(W&&W.sCapHeight,y),xHeight:S(W&&W.sxHeight,y),lineGap:S(W&&W.sTypoLineGap,B&&B.lineGap),supportsCodePoint(w){return h.U.codeToGlyph(x,w)>0},forEachGlyph(w,j,P,Z){let se=0,I=1/O.unitsPerEm*j,R=F(x,w),v=0,T=U(x,R);return R.forEach((M,C)=>{if(M!==-1){let k=A[M];if(!k){let{cmds:N,crds:E}=h.U.glyphToPath(x,M),z="",J=0;for(let ce=0,q=N.length;ce<q;ce++){let te=d[N[ce]];z+=N[ce];for(let le=1;le<=te;le++)z+=(le>1?",":"")+E[J++]}let ee,H,V,ge;if(E.length){ee=H=1/0,V=ge=-1/0;for(let ce=0,q=E.length;ce<q;ce+=2){let te=E[ce],le=E[ce+1];te<ee&&(ee=te),le<H&&(H=le),te>V&&(V=te),le>ge&&(ge=le)}}else ee=V=H=ge=0;k=A[M]={index:M,advanceWidth:x.hmtx.aWidth[M],xMin:ee,yMin:H,xMax:V,yMax:ge,path:z}}Z.call(null,k,se+T[C*3]*I,T[C*3+1]*I,v),se+=T[C*3+2]*I,P&&(se+=P*j)}v+=w.codePointAt(v)>65535?2:1}),se}};return O}return p(D,"wrapFontObj"),p(function(A){let W=new Uint8Array(A,0,4),B=h._bin.readASCII(W,0,4);if(B==="wOFF")A=r(A);else if(B==="wOF2")throw new Error("woff2 fonts not supported");return D(h.parse(A)[0])},"parse")}p(Ma,"parserFactory");var Aa=it({name:"Typr Font Parser",dependencies:[wa,Fa,Ma],init(h,r,d){let f=h(),t=r();return d(f,t)}});function Da(){return function(h){var r=p(function(){this.buckets=new Map},"n");r.prototype.add=function(U){var _=U>>5;this.buckets.set(_,(this.buckets.get(_)||0)|1<<(31&U))},r.prototype.has=function(U){var _=this.buckets.get(U>>5);return _!==void 0&&(_&1<<(31&U))!=0},r.prototype.serialize=function(){var U=[];return this.buckets.forEach(function(_,S){U.push((+S).toString(36)+":"+_.toString(36))}),U.join(",")},r.prototype.deserialize=function(U){var _=this;this.buckets.clear(),U.split(",").forEach(function(S){var D=S.split(":");_.buckets.set(parseInt(D[0],36),parseInt(D[1],36))})};var d=Math.pow(2,8),f=d-1,t=~f;function e(U){var _=function(D){return D&t}(U).toString(16),S=function(D){return(D&t)+d-1}(U).toString(16);return"codepoint-index/plane"+(U>>16)+"/"+_+"-"+S+".json"}p(e,"a");function a(U,_){var S=U&f,D=_.codePointAt(S/6|0);return((D=(D||48)-48)&1<<S%6)!=0}p(a,"i");function o(U,_){var S;(S=U,S.replace(/U\+/gi,"").replace(/^,+|,+$/g,"").split(/,+/).map(function(D){return D.split("-").map(function(x){return parseInt(x.trim(),16)})})).forEach(function(D){var x=D[0],A=D[1];A===void 0&&(A=x),_(x,A)})}p(o,"u");function n(U,_){o(U,function(S,D){for(var x=S;x<=D;x++)_(x)})}p(n,"c");var i={},s={},l=new WeakMap,u="https://cdn.jsdelivr.net/gh/lojjic/unicode-font-resolver@v1.0.1/packages/data";function c(U){var _=l.get(U);return _||(_=new r,n(U.ranges,function(S){return _.add(S)}),l.set(U,_)),_}p(c,"d");var g,m=new Map;function b(U,_,S){return U[_]?_:U[S]?S:function(D){for(var x in D)return x}(U)}p(b,"g");function L(U,_){var S=_;if(!U.includes(S)){S=1/0;for(var D=0;D<U.length;D++)Math.abs(U[D]-_)<Math.abs(S-_)&&(S=U[D])}return S}p(L,"w");function F(U){return g||(g=new Set,n("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000",function(_){g.add(_)})),g.has(U)}return p(F,"k"),h.CodePointSet=r,h.clearCache=function(){i={},s={}},h.getFontsForString=function(U,_){_===void 0&&(_={});var S,D=_.lang;D===void 0&&(D=new RegExp("\\p{Script=Hangul}","u").test(S=U)?"ko":new RegExp("\\p{Script=Hiragana}|\\p{Script=Katakana}","u").test(S)?"ja":"en");var x=_.category;x===void 0&&(x="sans-serif");var A=_.style;A===void 0&&(A="normal");var W=_.weight;W===void 0&&(W=400);var B=(_.dataUrl||u).replace(/\/$/g,""),Y=new Map,y=new Uint8Array(U.length),O={},w={},j=new Array(U.length),P=new Map,Z=!1;function se(v){var T=m.get(v);return T||(T=fetch(B+"/"+v).then(function(M){if(!M.ok)throw new Error(M.statusText);return M.json().then(function(C){if(!Array.isArray(C)||C[0]!==1)throw new Error("Incorrect schema version; need 1, got "+C[0]);return C[1]})}).catch(function(M){if(B!==u)return Z||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+B+'", trying default CDN. '+M.message),Z=!0),B=u,m.delete(v),se(v);throw M}),m.set(v,T)),T}p(se,"M");for(var I=function(v){var T=U.codePointAt(v),M=e(T);j[v]=M,i[M]||P.has(M)||P.set(M,se(M).then(function(C){i[M]=C})),T>65535&&(v++,R=v)},R=0;R<U.length;R++)I(R);return Promise.all(P.values()).then(function(){P.clear();for(var v=function(M){var C=U.codePointAt(M),k=null,N=i[j[M]],E=void 0;for(var z in N){var J=w[z];if(J===void 0&&(J=w[z]=new RegExp(z).test(D||"en")),J){for(var ee in E=z,N[z])if(a(C,N[z][ee])){k=ee;break}break}}if(!k){e:for(var H in N)if(H!==E){for(var V in N[H])if(a(C,N[H][V])){k=V;break e}}}k||(console.debug("No font coverage for U+"+C.toString(16)),k="latin"),j[M]=k,s[k]||P.has(k)||P.set(k,se("font-meta/"+k+".json").then(function(ge){s[k]=ge})),C>65535&&(M++,T=M)},T=0;T<U.length;T++)v(T);return Promise.all(P.values())}).then(function(){for(var v,T=null,M=0;M<U.length;M++){var C=U.codePointAt(M);if(T&&(F(C)||c(T).has(C)))y[M]=y[M-1];else{T=s[j[M]];var k=O[T.id];if(!k){var N=T.typeforms,E=b(N,x,"sans-serif"),z=b(N[E],A,"normal"),J=L((v=N[E])===null||v===void 0?void 0:v[z],W);k=O[T.id]=B+"/font-files/"+T.id+"/"+E+"."+z+"."+J+".woff"}var ee=Y.get(k);ee==null&&(ee=Y.size,Y.set(k,ee)),y[M]=ee}C>65535&&(M++,y[M]=y[M-1])}return{fontUrls:Array.from(Y.keys()),chars:y}})},Object.defineProperty(h,"__esModule",{value:!0}),h}({})}p(Da,"unicodeFontResolverClientFactory");function Ca(h,r){let d=Object.create(null),f=Object.create(null);function t(a,o){let n=p(i=>{console.error("Failure loading font ".concat(a),i)},"onError");try{let i=new XMLHttpRequest;i.open("get",a,!0),i.responseType="arraybuffer",i.onload=function(){if(i.status>=400)n(new Error(i.statusText));else if(i.status>0)try{let s=h(i.response);s.src=a,o(s)}catch(s){n(s)}},i.onerror=n,i.send()}catch(i){n(i)}}p(t,"doLoadFont");function e(a,o){let n=d[a];n?o(n):f[a]?f[a].push(o):(f[a]=[o],t(a,i=>{i.src=a,d[a]=i,f[a].forEach(s=>s(i)),delete f[a]}))}return p(e,"loadFont"),function(a,o,{lang:n,fonts:i=[],style:s="normal",weight:l="normal",unicodeFontsURL:u}={}){let c=new Uint8Array(a.length),g=[];a.length||F();let m=new Map,b=[];if(s!=="italic"&&(s="normal"),typeof l!="number"&&(l=l==="bold"?700:400),i&&!Array.isArray(i)&&(i=[i]),i=i.slice().filter(_=>!_.lang||_.lang.test(n)).reverse(),i.length){let x=0;p(function A(W=0){for(let B=W,Y=a.length;B<Y;B++){let y=a.codePointAt(B);if(x===1&&g[c[B-1]].supportsCodePoint(y)||B>0&&/\s/.test(a[B]))c[B]=c[B-1],x===2&&(b[b.length-1][1]=B);else for(let O=c[B],w=i.length;O<=w;O++)if(O===w){let j=x===2?b[b.length-1]:b[b.length]=[B,B];j[1]=B,x=2}else{c[B]=O;let{src:j,unicodeRange:P}=i[O];if(!P||U(y,P)){let Z=d[j];if(!Z){e(j,()=>{A(B)});return}if(Z.supportsCodePoint(y)){let se=m.get(Z);typeof se!="number"&&(se=g.length,g.push(Z),m.set(Z,se)),c[B]=se,x=1;break}}}y>65535&&B+1<Y&&(c[B+1]=c[B],B++,x===2&&(b[b.length-1][1]=B))}L()},"resolveUserFonts")()}else b.push([0,a.length-1]),L();function L(){if(b.length){let _=b.map(S=>a.substring(S[0],S[1]+1)).join("\n");r.getFontsForString(_,{lang:n||void 0,style:s,weight:l,dataUrl:u}).then(({fontUrls:S,chars:D})=>{let x=g.length,A=0;b.forEach(B=>{for(let Y=0,y=B[1]-B[0];Y<=y;Y++)c[B[0]+Y]=D[A++]+x;A++});let W=0;S.forEach((B,Y)=>{e(B,y=>{g[Y+x]=y,++W===S.length&&F()})})})}else F()}p(L,"resolveFallbacks");function F(){o({chars:c,fonts:g})}p(F,"allDone");function U(_,S){for(let D=0;D<S.length;D++){let[x,A=x]=S[D];if(x<=_&&_<=A)return!0}return!1}p(U,"isCodeInRanges")}}p(Ca,"createFontResolver");var Ea=it({name:"FontResolver",dependencies:[Ca,Aa,Da],init(h,r,d){return h(r,d())}});function Ba(h,r){let f=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,t="[^\\S\\u00A0]",e=new RegExp("".concat(t,"|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]"));function a({text:g,lang:m,fonts:b,style:L,weight:F,preResolvedFonts:U,unicodeFontsURL:_},S){let D=p(({chars:x,fonts:A})=>{let W,B,Y=[];for(let y=0;y<x.length;y++)x[y]!==B?(B=x[y],Y.push(W={start:y,end:y,fontObj:A[x[y]]})):W.end=y;S(Y)},"onResolved");U?D(U):h(g,D,{lang:m,fonts:b,style:L,weight:F,unicodeFontsURL:_})}p(a,"calculateFontRuns");function o({text:g="",font:m,lang:b,sdfGlyphSize:L=64,fontSize:F=400,fontWeight:U=1,fontStyle:_="normal",letterSpacing:S=0,lineHeight:D="normal",maxWidth:x=1/0,direction:A,textAlign:W="left",textIndent:B=0,whiteSpace:Y="normal",overflowWrap:y="normal",anchorX:O=0,anchorY:w=0,metricsOnly:j=!1,unicodeFontsURL:P,preResolvedFonts:Z=null,includeCaretPositions:se=!1,chunkedBoundsSize:I=8192,colorRanges:R=null},v){let T=l(),M={fontLoad:0,typesetting:0};g.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),g=g.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),F=+F,S=+S,x=+x,D=D||"normal",B=+B,a({text:g,lang:b,style:_,weight:U,fonts:typeof m=="string"?[{src:m}]:m,unicodeFontsURL:P,preResolvedFonts:Z},C=>{M.fontLoad=l()-T;let k=isFinite(x),N=null,E=null,z=null,J=null,ee=null,H=null,V=null,ge=null,ce=0,q=0,te=Y!=="nowrap",le=new Map,X=l(),re=B,$=0,G=new u,de=[G];C.forEach(ne=>{let{fontObj:oe}=ne,{ascender:ue,descender:ve,unitsPerEm:ke,lineGap:Ae,capHeight:me,xHeight:ye}=oe,fe=le.get(oe);if(!fe){let he=F/ke,Te=D==="normal"?(ue-ve+Ae)*he:D*F,Ze=(Te-(ue-ve)*he)/2,_e=Math.min(Te,(ue-ve)*he),be=(ue+ve)/2*he+_e/2;fe={index:le.size,src:oe.src,fontObj:oe,fontSizeMult:he,unitsPerEm:ke,ascender:ue*he,descender:ve*he,capHeight:me*he,xHeight:ye*he,lineHeight:Te,baseline:-Ze-ue*he,caretTop:be,caretBottom:be-_e},le.set(oe,fe)}let{fontSizeMult:Se}=fe,we=g.slice(ne.start,ne.end+1),Le,Ue;oe.forEachGlyph(we,F,S,(he,Te,Ze,_e)=>{Te+=$,_e+=ne.start,Le=Te,Ue=he;let be=g.charAt(_e),De=he.advanceWidth*Se,Fe=G.count,pe;if("isEmpty"in he||(he.isWhitespace=!!be&&new RegExp(t).test(be),he.canBreakAfter=!!be&&e.test(be),he.isEmpty=he.xMin===he.xMax||he.yMin===he.yMax||f.test(be)),!he.isWhitespace&&!he.isEmpty&&q++,te&&k&&!he.isWhitespace&&Te+De+re>x&&Fe){if(G.glyphAt(Fe-1).glyphObj.canBreakAfter)pe=new u,re=-Te;else for(let Oe=Fe;Oe--;)if(Oe===0&&y==="break-word"){pe=new u,re=-Te;break}else if(G.glyphAt(Oe).glyphObj.canBreakAfter){pe=G.splitAt(Oe+1);let Be=pe.glyphAt(0).x;re-=Be;for(let Ce=pe.count;Ce--;)pe.glyphAt(Ce).x-=Be;break}pe&&(G.isSoftWrapped=!0,G=pe,de.push(G),ce=x)}let Me=G.glyphAt(G.count);Me.glyphObj=he,Me.x=Te+re,Me.y=Ze,Me.width=De,Me.charIndex=_e,Me.fontData=fe,be==="\n"&&(G=new u,de.push(G),re=-(Te+De+S*F)+B)}),$=Le+Ue.advanceWidth*Se+S*F});let Q=0;de.forEach(ne=>{let oe=!0;for(let ue=ne.count;ue--;){let ve=ne.glyphAt(ue);oe&&!ve.glyphObj.isWhitespace&&(ne.width=ve.x+ve.width,ne.width>ce&&(ce=ne.width),oe=!1);let{lineHeight:ke,capHeight:Ae,xHeight:me,baseline:ye}=ve.fontData;ke>ne.lineHeight&&(ne.lineHeight=ke);let fe=ye-ne.baseline;fe<0&&(ne.baseline+=fe,ne.cap+=fe,ne.ex+=fe),ne.cap=Math.max(ne.cap,ne.baseline+Ae),ne.ex=Math.max(ne.ex,ne.baseline+me)}ne.baseline-=Q,ne.cap-=Q,ne.ex-=Q,Q+=ne.lineHeight});let ae=0,K=0;if(O&&(typeof O=="number"?ae=-O:typeof O=="string"&&(ae=-ce*(O==="left"?0:O==="center"?.5:O==="right"?1:i(O)))),w&&(typeof w=="number"?K=-w:typeof w=="string"&&(K=w==="top"?0:w==="top-baseline"?-de[0].baseline:w==="top-cap"?-de[0].cap:w==="top-ex"?-de[0].ex:w==="middle"?Q/2:w==="bottom"?Q:w==="bottom-baseline"?-de[de.length-1].baseline:i(w)*Q)),!j){let ne=r.getEmbeddingLevels(g,A);N=new Uint16Array(q),E=new Uint8Array(q),z=new Float32Array(q*2),J={},V=[1/0,1/0,-1/0,-1/0],ge=[],se&&(H=new Float32Array(g.length*4)),R&&(ee=new Uint8Array(q*3));let oe=0,ue=-1,ve=-1,ke,Ae;if(de.forEach((me,ye)=>{let{count:fe,width:Se}=me;if(fe>0){let we=0;for(let _e=fe;_e--&&me.glyphAt(_e).glyphObj.isWhitespace;)we++;let Le=0,Ue=0;if(W==="center")Le=(ce-Se)/2;else if(W==="right")Le=ce-Se;else if(W==="justify"&&me.isSoftWrapped){let _e=0;for(let be=fe-we;be--;)me.glyphAt(be).glyphObj.isWhitespace&&_e++;Ue=(ce-Se)/_e}if(Ue||Le){let _e=0;for(let be=0;be<fe;be++){let De=me.glyphAt(be),Fe=De.glyphObj;De.x+=Le+_e,Ue!==0&&Fe.isWhitespace&&be<fe-we&&(_e+=Ue,De.width+=Ue)}}let he=r.getReorderSegments(g,ne,me.glyphAt(0).charIndex,me.glyphAt(me.count-1).charIndex);for(let _e=0;_e<he.length;_e++){let[be,De]=he[_e],Fe=1/0,pe=-1/0;for(let Me=0;Me<fe;Me++)if(me.glyphAt(Me).charIndex>=be){let Oe=Me,Be=Me;for(;Be<fe;Be++){let Ce=me.glyphAt(Be);if(Ce.charIndex>De)break;Be<fe-we&&(Fe=Math.min(Fe,Ce.x),pe=Math.max(pe,Ce.x+Ce.width))}for(let Ce=Oe;Ce<Be;Ce++){let Ne=me.glyphAt(Ce);Ne.x=pe-(Ne.x+Ne.width-Fe)}break}}let Te,Ze=p(_e=>Te=_e,"setGlyphObj");for(let _e=0;_e<fe;_e++){let be=me.glyphAt(_e);Te=be.glyphObj;let De=Te.index,Fe=ne.levels[be.charIndex]&1;if(Fe){let pe=r.getMirroredCharacter(g[be.charIndex]);pe&&be.fontData.fontObj.forEachGlyph(pe,0,0,Ze)}if(se){let{charIndex:pe,fontData:Me}=be,Oe=be.x+ae,Be=be.x+be.width+ae;H[pe*4]=Fe?Be:Oe,H[pe*4+1]=Fe?Oe:Be,H[pe*4+2]=me.baseline+Me.caretBottom+K,H[pe*4+3]=me.baseline+Me.caretTop+K;let Ce=pe-ue;Ce>1&&s(H,ue,Ce),ue=pe}if(R){let{charIndex:pe}=be;for(;pe>ve;)ve++,R.hasOwnProperty(ve)&&(Ae=R[ve])}if(!Te.isWhitespace&&!Te.isEmpty){let pe=oe++,{fontSizeMult:Me,src:Oe,index:Be}=be.fontData,Ce=J[Oe]||(J[Oe]={});Ce[De]||(Ce[De]={path:Te.path,pathBounds:[Te.xMin,Te.yMin,Te.xMax,Te.yMax]});let Ne=be.x+ae,qe=be.y+me.baseline+K;z[pe*2]=Ne,z[pe*2+1]=qe;let Je=Ne+Te.xMin*Me,$e=qe+Te.yMin*Me,nt=Ne+Te.xMax*Me,Ke=qe+Te.yMax*Me;Je<V[0]&&(V[0]=Je),$e<V[1]&&(V[1]=$e),nt>V[2]&&(V[2]=nt),Ke>V[3]&&(V[3]=Ke),pe%I===0&&(ke={start:pe,end:pe,rect:[1/0,1/0,-1/0,-1/0]},ge.push(ke)),ke.end++;let Re=ke.rect;if(Je<Re[0]&&(Re[0]=Je),$e<Re[1]&&(Re[1]=$e),nt>Re[2]&&(Re[2]=nt),Ke>Re[3]&&(Re[3]=Ke),N[pe]=De,E[pe]=Be,R){let at=pe*3;ee[at]=Ae>>16&255,ee[at+1]=Ae>>8&255,ee[at+2]=Ae&255}}}}}),H){let me=g.length-ue;me>1&&s(H,ue,me)}}let xe=[];le.forEach(({index:ne,src:oe,unitsPerEm:ue,ascender:ve,descender:ke,lineHeight:Ae,capHeight:me,xHeight:ye})=>{xe[ne]={src:oe,unitsPerEm:ue,ascender:ve,descender:ke,lineHeight:Ae,capHeight:me,xHeight:ye}}),M.typesetting=l()-X,v({glyphIds:N,glyphFontIndices:E,glyphPositions:z,glyphData:J,fontData:xe,caretPositions:H,glyphColors:ee,chunkedBounds:ge,fontSize:F,topBaseline:K+de[0].baseline,blockBounds:[ae,K-Q,ae+ce,K],visibleBounds:V,timings:M})})}p(o,"typeset");function n(g,m){o({...g,metricsOnly:!0},b=>{let[L,F,U,_]=b.blockBounds;m({width:U-L,height:_-F})})}p(n,"measure");function i(g){let m=g.match(/^([\d.]+)%$/),b=m?parseFloat(m[1]):NaN;return isNaN(b)?0:b/100}p(i,"parsePercent");function s(g,m,b){let L=g[m*4],F=g[m*4+1],U=g[m*4+2],_=g[m*4+3],S=(F-L)/b;for(let D=0;D<b;D++){let x=(m+D)*4;g[x]=L+S*D,g[x+1]=L+S*(D+1),g[x+2]=U,g[x+3]=_}}p(s,"fillLigatureCaretPositions");function l(){return(self.performance||Date).now()}p(l,"now");function u(){this.data=[]}p(u,"TextLine");let c=["glyphObj","x","y","width","charIndex","fontData"];return u.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/c.length)},glyphAt(g){let m=u.flyweight;return m.data=this.data,m.index=g,m},splitAt(g){let m=new u;return m.data=this.data.splice(g*c.length),m}},u.flyweight=c.reduce((g,m,b,L)=>(Object.defineProperty(g,m,{get(){return this.data[this.index*c.length+b]},set(F){this.data[this.index*c.length+b]=F}}),g),{data:null,index:0}),{typeset:o,measure:n}}p(Ba,"createTypesetter");var ft=p(()=>(self.performance||Date).now(),"now"),er=Ar(),Pn;function Oa(h,r,d,f,t,e,a,o,n,i,s=!0){return s?La(h,r,d,f,t,e,a,o,n,i).then(null,l=>(Pn||(console.warn("WebGL SDF generation failed, falling back to JS",l),Pn=!0),zn(h,r,d,f,t,e,a,o,n,i))):zn(h,r,d,f,t,e,a,o,n,i)}p(Oa,"generateSDF");var Zt=[],Ra=5,Rr=0;function Kn(){let h=ft();for(;Zt.length&&ft()-h<Ra;)Zt.shift()();Rr=Zt.length?setTimeout(Kn,0):0}p(Kn,"nextChunk");var La=p((...h)=>new Promise((r,d)=>{Zt.push(()=>{let f=ft();try{er.webgl.generateIntoCanvas(...h),r({timing:ft()-f})}catch(t){d(t)}}),Rr||(Rr=setTimeout(Kn,0))}),"generateSDF_GL"),Ga=4,Pa=2e3,In={},Ia=0;function zn(h,r,d,f,t,e,a,o,n,i){let s="TroikaTextSDFGenerator_JS_"+Ia++%Ga,l=In[s];return l||(l=In[s]={workerModule:it({name:s,workerId:s,dependencies:[Ar,ft],init(u,c){let g=u().javascript.generate;return function(...m){let b=c();return{textureData:g(...m),timing:c()-b}}},getTransferables(u){return[u.textureData.buffer]}}),requests:0,idleTimer:null}),l.requests++,clearTimeout(l.idleTimer),l.workerModule(h,r,d,f,t,e).then(({textureData:u,timing:c})=>{let g=ft(),m=new Uint8Array(u.length*4);for(let b=0;b<u.length;b++)m[b*4+i]=u[b];return er.webglUtils.renderImageData(a,m,o,n,h,r,1<<3-i),c+=ft()-g,--l.requests===0&&(l.idleTimer=setTimeout(()=>{En(s)},Pa)),{timing:c}})}p(zn,"generateSDF_JS_Worker");function za(h){h._warm||(er.webgl.isSupported(h),h._warm=!0)}p(za,"warmUpSDFCanvas");var Wa=er.webglUtils.resizeWebGLCanvasWithoutClearing,lt={defaultFontURL:null,unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048,useWorker:!0},Na=new Mt,Va=!1;function pt(){return(self.performance||Date).now()}p(pt,"now$1");var Wn=Object.create(null);function Qn(h,r){Va=!0,h=Xa({},h);let d=pt(),{defaultFontURL:f}=lt,t=[];if(f&&t.push({label:"default",src:Nn(f)}),h.font&&t.push({label:"user",src:Nn(h.font)}),h.font=t,h.text=""+h.text,h.sdfGlyphSize=h.sdfGlyphSize||lt.sdfGlyphSize,h.unicodeFontsURL=h.unicodeFontsURL||lt.unicodeFontsURL,h.colorRanges!=null){let c={};for(let g in h.colorRanges)if(h.colorRanges.hasOwnProperty(g)){let m=h.colorRanges[g];typeof m!="number"&&(m=Na.set(m).getHex()),c[g]=m}h.colorRanges=c}Object.freeze(h);let{textureWidth:e,sdfExponent:a}=lt,{sdfGlyphSize:o}=h,n=e/o*4,i=Wn[o];if(!i){let c=document.createElement("canvas");c.width=e,c.height=o*256/n,i=Wn[o]={glyphCount:0,sdfGlyphSize:o,sdfCanvas:c,sdfTexture:new bn(c,void 0,void 0,void 0,Ur,Ur),contextLost:!1,glyphsByFont:new Map},i.sdfTexture.generateMipmaps=!1,ja(i)}let{sdfTexture:s,sdfCanvas:l}=i;(lt.useWorker?$n:Ya)(h).then(c=>{let{glyphIds:g,glyphFontIndices:m,fontData:b,glyphPositions:L,fontSize:F,timings:U}=c,_=[],S=new Float32Array(g.length*4),D=0,x=0,A=pt(),W=b.map(w=>{let j=i.glyphsByFont.get(w.src);return j||i.glyphsByFont.set(w.src,j=new Map),j});g.forEach((w,j)=>{let P=m[j],{src:Z,unitsPerEm:se}=b[P],I=W[P].get(w);if(!I){let{path:C,pathBounds:k}=c.glyphData[Z][w],N=Math.max(k[2]-k[0],k[3]-k[1])/o*(lt.sdfMargin*o+.5),E=i.glyphCount++,z=[k[0]-N,k[1]-N,k[2]+N,k[3]+N];W[P].set(w,I={path:C,atlasIndex:E,sdfViewBox:z}),_.push(I)}let{sdfViewBox:R}=I,v=L[x++],T=L[x++],M=F/se;S[D++]=v+R[0]*M,S[D++]=T+R[1]*M,S[D++]=v+R[2]*M,S[D++]=T+R[3]*M,g[j]=I.atlasIndex}),U.quads=(U.quads||0)+(pt()-A);let B=pt();U.sdf={};let Y=l.height,y=Math.ceil(i.glyphCount/n),O=Math.pow(2,Math.ceil(Math.log2(y*o)));O>Y&&(console.info("Increasing SDF texture size ".concat(Y,"->").concat(O)),Wa(l,e,O),s.dispose()),Promise.all(_.map(w=>Zn(w,i,h.gpuAccelerateSDF).then(({timing:j})=>{U.sdf[w.atlasIndex]=j}))).then(()=>{_.length&&!i.contextLost&&(qn(i),s.needsUpdate=!0),U.sdfTotal=pt()-B,U.total=pt()-d,r(Object.freeze({parameters:h,sdfTexture:s,sdfGlyphSize:o,sdfExponent:a,glyphBounds:S,glyphAtlasIndices:g,glyphColors:c.glyphColors,caretPositions:c.caretPositions,chunkedBounds:c.chunkedBounds,ascender:c.ascender,descender:c.descender,lineHeight:c.lineHeight,capHeight:c.capHeight,xHeight:c.xHeight,topBaseline:c.topBaseline,blockBounds:c.blockBounds,visibleBounds:c.visibleBounds,timings:c.timings}))})}),Promise.resolve().then(()=>{i.contextLost||za(l)})}p(Qn,"getTextRenderInfo");function Zn({path:h,atlasIndex:r,sdfViewBox:d},{sdfGlyphSize:f,sdfCanvas:t,contextLost:e},a){if(e)return Promise.resolve({timing:-1});let{textureWidth:o,sdfExponent:n}=lt,i=Math.max(d[2]-d[0],d[3]-d[1]),s=Math.floor(r/4),l=s%(o/f)*f,u=Math.floor(s/(o/f))*f,c=r%4;return Oa(f,f,h,d,i,n,t,l,u,c,a)}p(Zn,"generateGlyphSDF");function ja(h){let r=h.sdfCanvas;r.addEventListener("webglcontextlost",d=>{console.log("Context Lost",d),d.preventDefault(),h.contextLost=!0}),r.addEventListener("webglcontextrestored",d=>{console.log("Context Restored",d),h.contextLost=!1;let f=[];h.glyphsByFont.forEach(t=>{t.forEach(e=>{f.push(Zn(e,h,!0))})}),Promise.all(f).then(()=>{qn(h),h.sdfTexture.needsUpdate=!0})})}p(ja,"initContextLossHandling");function Ir({font:h,characters:r,sdfGlyphSize:d},f){let t=Array.isArray(r)?r.join("\n"):""+r;Qn({font:h,sdfGlyphSize:d,text:t},f)}p(Ir,"preloadFont");function Xa(h,r){for(let d in r)r.hasOwnProperty(d)&&(h[d]=r[d]);return h}p(Xa,"assign");var Kt;function Nn(h){return Kt||(Kt=typeof document>"u"?{}:document.createElement("a")),Kt.href=h,Kt.href}p(Nn,"toAbsoluteURL");function qn(h){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");let{sdfCanvas:r,sdfTexture:d}=h,{width:f,height:t}=r,e=h.sdfCanvas.getContext("webgl"),a=d.image.data;(!a||a.length!==f*t*4)&&(a=new Uint8Array(f*t*4),d.image={width:f,height:t,data:a},d.flipY=!1,d.isDataTexture=!0),e.readPixels(0,0,f,t,e.RGBA,e.UNSIGNED_BYTE,a)}}p(qn,"safariPre15Workaround");var Ha=it({name:"Typesetter",dependencies:[Ba,Ea,Bn],init(h,r,d){return h(r,d())}}),$n=it({name:"Typesetter",dependencies:[Ha],init(h){return function(r){return new Promise(d=>{h.typeset(r,d)})}},getTransferables(h){let r=[];for(let d in h)h[d]&&h[d].buffer&&r.push(h[d].buffer);return r}}),Ya=$n.onMainThread;var Vn={};function Ja(h){let r=Vn[h];return r||(r=Vn[h]=new Yt(1,1,h,h).translate(.5,.5,0)),r}p(Ja,"getTemplateGeometry");var qt="aTroikaGlyphBounds",Bt="aTroikaGlyphIndex",Ka="aTroikaGlyphColor",Wr=class Wr extends Fn{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new xn,this.boundingBox=new wr}computeBoundingSphere(){}computeBoundingBox(){}set detail(r){if(r!==this._detail){this._detail=r,(typeof r!="number"||r<1)&&(r=1);let d=Ja(r);["position","normal","uv"].forEach(f=>{this.attributes[f]=d.attributes[f].clone()}),this.setIndex(d.getIndex().clone())}}get detail(){return this._detail}set curveRadius(r){r!==this._curveRadius&&(this._curveRadius=r,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(r,d,f,t,e){this.updateAttributeData(qt,r,4),this.updateAttributeData(Bt,d,1),this.updateAttributeData(Ka,e,3),this._blockBounds=f,this._chunkedBounds=t,this.instanceCount=d.length,this._updateBounds()}_updateBounds(){let r=this._blockBounds;if(r){let{curveRadius:d,boundingBox:f}=this;if(d){let{PI:t,floor:e,min:a,max:o,sin:n,cos:i}=Math,s=t/2,l=t*2,u=Math.abs(d),c=r[0]/u,g=r[2]/u,m=e((c+s)/l)!==e((g+s)/l)?-u:a(n(c)*u,n(g)*u),b=e((c-s)/l)!==e((g-s)/l)?u:o(n(c)*u,n(g)*u),L=e((c+t)/l)!==e((g+t)/l)?u*2:o(u-i(c)*u,u-i(g)*u);f.min.set(m,r[1],d<0?-L:0),f.max.set(b,r[3],d<0?0:L)}else f.min.set(r[0],r[1],0),f.max.set(r[2],r[3],0);f.getBoundingSphere(this.boundingSphere)}}applyClipRect(r){let d=this.getAttribute(Bt).count,f=this._chunkedBounds;if(f)for(let t=f.length;t--;){d=f[t].end;let e=f[t].rect;if(e[1]<r.w&&e[3]>r.y&&e[0]<r.z&&e[2]>r.x)break}this.instanceCount=d}updateAttributeData(r,d,f){let t=this.getAttribute(r);d?t&&t.array.length===d.length?(t.array.set(d),t.needsUpdate=!0):(this.setAttribute(r,new Un(d,f)),delete this._maxInstanceCount,this.dispose()):t&&this.deleteAttribute(r)}};p(Wr,"GlyphsGeometry");var Lr=Wr,Qa="\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform vec4 uTroikaTotalBounds;\nuniform vec4 uTroikaClipRect;\nuniform mat3 uTroikaOrient;\nuniform bool uTroikaUseGlyphColors;\nuniform float uTroikaEdgeOffset;\nuniform float uTroikaBlurRadius;\nuniform vec2 uTroikaPositionOffset;\nuniform float uTroikaCurveRadius;\nattribute vec4 aTroikaGlyphBounds;\nattribute float aTroikaGlyphIndex;\nattribute vec3 aTroikaGlyphColor;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec3 vTroikaGlyphColor;\nvarying vec2 vTroikaGlyphDimensions;\n",Za="\nvec4 bounds = aTroikaGlyphBounds;\nbounds.xz += uTroikaPositionOffset.x;\nbounds.yw -= uTroikaPositionOffset.y;\n\nvec4 outlineBounds = vec4(\n bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius,\n bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius\n);\nvec4 clippedBounds = vec4(\n clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),\n clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)\n);\n\nvec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);\n\nposition.xy = mix(bounds.xy, bounds.zw, clippedXY);\n\nuv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);\n\nfloat rad = uTroikaCurveRadius;\nif (rad != 0.0) {\n float angle = position.x / rad;\n position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);\n normal.xz = vec2(sin(angle), cos(angle));\n}\n \nposition = uTroikaOrient * position;\nnormal = uTroikaOrient * normal;\n\nvTroikaGlyphUV = clippedXY.xy;\nvTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);\n\n\nfloat txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;\nvec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;\nvec2 txStartUV = txUvPerSquare * vec2(\n mod(floor(aTroikaGlyphIndex / 4.0), txCols),\n floor(floor(aTroikaGlyphIndex / 4.0) / txCols)\n);\nvTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);\nvTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);\n",qa="\nuniform sampler2D uTroikaSDFTexture;\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform float uTroikaSDFExponent;\nuniform float uTroikaEdgeOffset;\nuniform float uTroikaFillOpacity;\nuniform float uTroikaBlurRadius;\nuniform vec3 uTroikaStrokeColor;\nuniform float uTroikaStrokeWidth;\nuniform float uTroikaStrokeOpacity;\nuniform bool uTroikaSDFDebug;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec2 vTroikaGlyphDimensions;\n\nfloat troikaSdfValueToSignedDistance(float alpha) {\n // Inverse of exponential encoding in webgl-sdf-generator\n \n float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);\n float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;\n float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);\n return signedDist;\n}\n\nfloat troikaGlyphUvToSdfValue(vec2 glyphUV) {\n vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);\n vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);\n float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1\n return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;\n}\n\nfloat troikaGlyphUvToDistance(vec2 uv) {\n return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));\n}\n\nfloat troikaGetAADist() {\n \n #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300\n return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;\n #else\n return vTroikaGlyphDimensions.x / 64.0;\n #endif\n}\n\nfloat troikaGetFragDistValue() {\n vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);\n float distance = troikaGlyphUvToDistance(clampedGlyphUV);\n \n // Extrapolate distance when outside bounds:\n distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : \n length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);\n\n \n\n return distance;\n}\n\nfloat troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {\n #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)\n float alpha = step(-distanceOffset, -distance);\n #else\n\n float alpha = smoothstep(\n distanceOffset + aaDist,\n distanceOffset - aaDist,\n distance\n );\n #endif\n\n return alpha;\n}\n",$a="\nfloat aaDist = troikaGetAADist();\nfloat fragDistance = troikaGetFragDistValue();\nfloat edgeAlpha = uTroikaSDFDebug ?\n troikaGlyphUvToSdfValue(vTroikaGlyphUV) :\n troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius));\n\n#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)\nvec4 fillRGBA = gl_FragColor;\nfillRGBA.a *= uTroikaFillOpacity;\nvec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);\nif (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;\ngl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(\n -uTroikaStrokeWidth - aaDist,\n -uTroikaStrokeWidth + aaDist,\n fragDistance\n));\ngl_FragColor.a *= edgeAlpha;\n#endif\n\nif (edgeAlpha == 0.0) {\n discard;\n}\n";function ea(h){let r=vt(h,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new ot},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new Sr(0,0,0,0)},uTroikaClipRect:{value:new Sr(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new ot},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new Mt},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new yn},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:Qa,vertexTransform:Za,fragmentDefs:qa,fragmentColorTransform:$a,customRewriter({vertexShader:d,fragmentShader:f}){let t=/\buniform\s+vec3\s+diffuse\b/;return t.test(f)&&(f=f.replace(t,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),t.test(d)||(d=d.replace(Cr,"uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n"))),{vertexShader:d,fragmentShader:f}}});return r.transparent=!0,r.forceSinglePass=!0,Object.defineProperties(r,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),r}p(ea,"createTextDerivedMaterial");var zr=new Tn({color:16777215,side:kr,transparent:!0}),jn=8421504,Xn=new Ft,Qt=new He,Er=new He,Et=[],eo=new He,Br="+x+y";function Hn(h){return Array.isArray(h)?h[0]:h}p(Hn,"first");var ta=p(()=>{let h=new At(new Yt(1,1),zr);return ta=p(()=>h,"getFlatRaycastMesh"),h},"getFlatRaycastMesh"),ra=p(()=>{let h=new At(new Yt(1,1,32,1),zr);return ra=p(()=>h,"getCurvedRaycastMesh"),h},"getCurvedRaycastMesh"),to={type:"syncstart"},ro={type:"synccomplete"},na=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],no=na.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail"),Nr=class Nr extends At{constructor(){let r=new Lr;super(r,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=jn,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=Br,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(r){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(r):(this._isSyncing=!0,this.dispatchEvent(to),Qn({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},d=>{this._isSyncing=!1,this._textRenderInfo=d,this.geometry.updateGlyphs(d.glyphBounds,d.glyphAtlasIndices,d.blockBounds,d.chunkedBounds,d.glyphColors);let f=this._queuedSyncs;f&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{f.forEach(t=>t&&t())})),this.dispatchEvent(ro),r&&r()})))}onBeforeRender(r,d,f,t,e,a){this.sync(),e.isTroikaTextMaterial&&this._prepareForRender(e)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(r){return ea(r)}get material(){let r=this._derivedMaterial,d=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=zr.clone());if((!r||!r.isDerivedFrom(d))&&(r=this._derivedMaterial=this.createDerivedMaterial(d),d.addEventListener("dispose",p(function f(){d.removeEventListener("dispose",f),r.dispose()},"onDispose"))),this.hasOutline()){let f=r._outlineMtl;return f||(f=r._outlineMtl=Object.create(r,{id:{value:r.id+.1}}),f.isTextOutlineMaterial=!0,f.depthWrite=!1,f.map=null,r.addEventListener("dispose",p(function t(){r.removeEventListener("dispose",t),f.dispose()},"onDispose"))),[f,r]}else return r}set material(r){r&&r.isTroikaTextMaterial?(this._derivedMaterial=r,this._baseMaterial=r.baseMaterial):this._baseMaterial=r}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(r){this.geometry.detail=r}get curveRadius(){return this.geometry.curveRadius}set curveRadius(r){this.geometry.curveRadius=r}get customDepthMaterial(){return Hn(this.material).getDepthMaterial()}get customDistanceMaterial(){return Hn(this.material).getDistanceMaterial()}_prepareForRender(r){let d=r.isTextOutlineMaterial,f=r.uniforms,t=this.textRenderInfo;if(t){let{sdfTexture:o,blockBounds:n}=t;f.uTroikaSDFTexture.value=o,f.uTroikaSDFTextureSize.value.set(o.image.width,o.image.height),f.uTroikaSDFGlyphSize.value=t.sdfGlyphSize,f.uTroikaSDFExponent.value=t.sdfExponent,f.uTroikaTotalBounds.value.fromArray(n),f.uTroikaUseGlyphColors.value=!d&&!!t.glyphColors;let i=0,s=0,l=0,u,c,g,m=0,b=0;if(d){let{outlineWidth:F,outlineOffsetX:U,outlineOffsetY:_,outlineBlur:S,outlineOpacity:D}=this;i=this._parsePercent(F)||0,s=Math.max(0,this._parsePercent(S)||0),u=D,m=this._parsePercent(U)||0,b=this._parsePercent(_)||0}else l=Math.max(0,this._parsePercent(this.strokeWidth)||0),l&&(g=this.strokeColor,f.uTroikaStrokeColor.value.set(g==null?jn:g),c=this.strokeOpacity,c==null&&(c=1)),u=this.fillOpacity;f.uTroikaEdgeOffset.value=i,f.uTroikaPositionOffset.value.set(m,b),f.uTroikaBlurRadius.value=s,f.uTroikaStrokeWidth.value=l,f.uTroikaStrokeOpacity.value=c,f.uTroikaFillOpacity.value=u==null?1:u,f.uTroikaCurveRadius.value=this.curveRadius||0;let L=this.clipRect;if(L&&Array.isArray(L)&&L.length===4)f.uTroikaClipRect.value.fromArray(L);else{let F=(this.fontSize||.1)*100;f.uTroikaClipRect.value.set(n[0]-F,n[1]-F,n[2]+F,n[3]+F)}this.geometry.applyClipRect(f.uTroikaClipRect.value)}f.uTroikaSDFDebug.value=!!this.debugSDF,r.polygonOffset=!!this.depthOffset,r.polygonOffsetFactor=r.polygonOffsetUnits=this.depthOffset||0;let e=d?this.outlineColor||0:this.color;if(e==null)delete r.color;else{let o=r.hasOwnProperty("color")?r.color:r.color=new Mt;(e!==o._input||typeof e=="object")&&o.set(o._input=e)}let a=this.orientation||Br;if(a!==r._orientation){let o=f.uTroikaOrient.value;a=a.replace(/[^-+xyz]/g,"");let n=a!==Br&&a.match(/^([-+])([xyz])([-+])([xyz])$/);if(n){let[,i,s,l,u]=n;Qt.set(0,0,0)[s]=i==="-"?1:-1,Er.set(0,0,0)[u]=l==="-"?-1:1,Xn.lookAt(eo,Qt.cross(Er),Er),o.setFromMatrix4(Xn)}else o.identity();r._orientation=a}}_parsePercent(r){if(typeof r=="string"){let d=r.match(/^(-?[\d.]+)%$/),f=d?parseFloat(d[1]):NaN;r=(isNaN(f)?0:f/100)*this.fontSize}return r}localPositionToTextCoords(r,d=new ot){d.copy(r);let f=this.curveRadius;return f&&(d.x=Math.atan2(r.x,Math.abs(f)-Math.abs(r.z))*Math.abs(f)),d}worldPositionToTextCoords(r,d=new ot){return Qt.copy(r),this.localPositionToTextCoords(this.worldToLocal(Qt),d)}raycast(r,d){let{textRenderInfo:f,curveRadius:t}=this;if(f){let e=f.blockBounds,a=t?ra():ta(),o=a.geometry,{position:n,uv:i}=o.attributes;for(let s=0;s<i.count;s++){let l=e[0]+i.getX(s)*(e[2]-e[0]),u=e[1]+i.getY(s)*(e[3]-e[1]),c=0;t&&(c=t-Math.cos(l/t)*t,l=Math.sin(l/t)*t),n.setXYZ(s,l,u,c)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,a.matrixWorld=this.matrixWorld,a.material.side=this.material.side,Et.length=0,a.raycast(r,Et);for(let s=0;s<Et.length;s++)Et[s].object=this,d.push(Et[s])}}copy(r){let d=this.geometry;return super.copy(r),this.geometry=d,no.forEach(f=>{this[f]=r[f]}),this}clone(){return new this.constructor().copy(this)}};p(Nr,"Text");var rt=Nr;na.forEach(h=>{let r="_private_"+h;Object.defineProperty(rt.prototype,h,{get(){return this[r]},set(d){d!==this[r]&&(this[r]=d,this._needsSync=!0)}})});var ao={type:"syncstart"},oo={type:"synccomplete"},gt="aTroikaTextBatchMemberIndex",Gr=32,Yn=new wr,Jn=new Mt,$t=class $t extends rt{constructor(){super(),this._members=new Map,this._dataTextures={},this._onMemberSynced=r=>{this._members.get(r.target).dirty=!0}}add(...r){for(let d=0;d<r.length;d++)r[d]instanceof rt?this.addText(r[d]):super.add(r[d]);return this}remove(...r){for(let d=0;d<r.length;d++)r[d]instanceof rt?this.removeText(r[d]):super.remove(r[d]);return this}addText(r){this._members.has(r)||(this._members.set(r,{index:-1,glyphCount:-1,dirty:!0}),r.addEventListener("synccomplete",this._onMemberSynced))}removeText(r){this._needsRepack=!0,r.removeEventListener("synccomplete",this._onMemberSynced),this._members.delete(r)}createDerivedMaterial(r){return io(r)}updateMatrixWorld(r){super.updateMatrixWorld(r),this.updateBounds()}updateBounds(){let r=this.geometry.boundingBox.makeEmpty();this._members.forEach((d,f)=>{f.matrixAutoUpdate&&f.updateMatrix(),Yn.copy(f.geometry.boundingBox).applyMatrix4(f.matrix),r.union(Yn)}),r.getBoundingSphere(this.geometry.boundingSphere)}hasOutline(){for(let r of this._members.keys())if(r.hasOutline())return!0;return!1}_prepareForRender(r){let d=r.isTextOutlineMaterial;r.uniforms.uTroikaIsOutline.value=d;let f=this._dataTextures[d?"outline":"main"],t=Math.pow(2,Math.ceil(Math.log2(this._members.size*Gr)));if(!f||t!==f.image.data.length){f&&f.dispose();let o=Math.min(t/4,1024);f=this._dataTextures[d?"outline":"main"]=new kn(new Float32Array(t),o,t/4/o,vn,dn)}let e=f.image.data,a=p((o,n)=>{n!==e[o]&&(e[o]=n,f.needsUpdate=!0)},"setTexData");this._members.forEach(({index:o,dirty:n},i)=>{if(o>-1){let s=o*Gr,l=i.matrix.elements;for(let x=0;x<16;x++)a(s+x,l[x]);i._prepareForRender(r);let{uTroikaTotalBounds:u,uTroikaClipRect:c,uTroikaPositionOffset:g,uTroikaEdgeOffset:m,uTroikaBlurRadius:b,uTroikaStrokeWidth:L,uTroikaStrokeColor:F,uTroikaStrokeOpacity:U,uTroikaFillOpacity:_,uTroikaCurveRadius:S}=r.uniforms;for(let x=0;x<4;x++)a(s+16+x,u.value.getComponent(x));for(let x=0;x<4;x++)a(s+20+x,c.value.getComponent(x));let D=d?i.outlineColor||0:i.color;D==null&&(D=this.color),D==null&&(D=this.material.color),D==null&&(D=16777215),a(s+24,Jn.set(D).getHex()),a(s+25,_.value),a(s+26,S.value),d?(a(s+28,g.value.x),a(s+29,g.value.y),a(s+30,m.value),a(s+31,b.value)):(a(s+28,L.value),a(s+29,Jn.set(F.value).getHex()),a(s+30,U.value))}}),r.setMatrixTexture(f),super._prepareForRender(r)}sync(r){let d=this._needsRepack?[]:null;this._needsRepack=!1,this._members.forEach((f,t)=>{(f.dirty||t._needsSync)&&(f.dirty=!1,(d||(d=[])).push(new Promise(e=>{t._needsSync?t.sync(e):e()})))}),d&&(this.dispatchEvent(ao),Promise.all(d).then(()=>{let{geometry:f}=this,t=f.attributes,e=t[gt]&&t[gt].array||new Uint16Array(0),a=t[Bt]&&t[Bt].array||new Float32Array(0),o=t[qt]&&t[qt].array||new Float32Array(0),n=0;this._members.forEach((l,{textRenderInfo:u})=>{u&&(n+=u.glyphAtlasIndices.length,this._textRenderInfo=u)}),n!==e.length&&(e=Or(e,n),a=Or(a,n),o=Or(o,n*4));let i=0,s=0;this._members.forEach((l,{textRenderInfo:u})=>{if(u){let c=u.glyphAtlasIndices.length;e.fill(i,s,s+c),a.set(u.glyphAtlasIndices,s,s+c),o.set(u.glyphBounds,s*4,(s+c)*4),s+=c,l.index=i++}}),f.updateAttributeData(gt,e,1),f.getAttribute(gt).setUsage(gn),f.updateAttributeData(Bt,a,1),f.updateAttributeData(qt,o,4),this.updateBounds(),this.dispatchEvent(oo),r&&r()}))}copy(r){return r instanceof $t&&(super.copy(r),this._members.forEach((d,f)=>this.removeText(f)),r._members.forEach((d,f)=>this.addText(f))),this}dispose(){super.dispose(),Object.values(this._dataTextures).forEach(r=>r.dispose())}};p($t,"BatchedText");var Pr=$t;function Or(h,r){let d=new h.constructor(r);return d.set(h.subarray(0,r)),d}p(Or,"cloneAndResize");function io(h){let r="uTroikaMatricesTexture",d="uTroikaMatricesTextureSize",f=vt(h,{chained:!0,uniforms:{[d]:{value:new ot},[r]:{value:null}},vertexDefs:"\n uniform highp sampler2D ".concat(r,";\n uniform vec2 ").concat(d,";\n attribute float ").concat(gt,";\n\n vec4 troikaBatchTexel(float offset) {\n offset += ").concat(gt," * ").concat(Gr.toFixed(1)," / 4.0;\n float w = ").concat(d,".x;\n vec2 uv = (vec2(mod(offset, w), floor(offset / w)) + 0.5) / ").concat(d,";\n return texture2D(").concat(r,", uv);\n }\n "),vertexTransform:"\n mat4 matrix = mat4(\n troikaBatchTexel(0.0),\n troikaBatchTexel(1.0),\n troikaBatchTexel(2.0),\n troikaBatchTexel(3.0)\n );\n position.xyz = (matrix * vec4(position, 1.0)).xyz;\n "});return f=ea(f),f=vt(f,{chained:!0,uniforms:{uTroikaIsOutline:{value:!1}},customRewriter(t){return["uTroikaTotalBounds","uTroikaClipRect","uTroikaPositionOffset","uTroikaEdgeOffset","uTroikaBlurRadius","uTroikaStrokeWidth","uTroikaStrokeColor","uTroikaStrokeOpacity","uTroikaFillOpacity","uTroikaCurveRadius","diffuse"].forEach(a=>{t=so(t,a)}),t},vertexDefs:"\n uniform bool uTroikaIsOutline;\n vec3 troikaFloatToColor(float v) {\n return mod(floor(vec3(v / 65536.0, v / 256.0, v)), 256.0) / 256.0;\n }\n ",vertexTransform:"\n uTroikaTotalBounds = troikaBatchTexel(4.0);\n uTroikaClipRect = troikaBatchTexel(5.0);\n \n vec4 data = troikaBatchTexel(6.0);\n diffuse = troikaFloatToColor(data.x);\n uTroikaFillOpacity = data.y;\n uTroikaCurveRadius = data.z;\n \n data = troikaBatchTexel(7.0);\n if (uTroikaIsOutline) {\n if (data == vec4(0.0)) { // degenerate if zero outline\n position = vec3(0.0);\n } else {\n uTroikaPositionOffset = data.xy;\n uTroikaEdgeOffset = data.z;\n uTroikaBlurRadius = data.w;\n }\n } else {\n uTroikaStrokeWidth = data.x;\n uTroikaStrokeColor = troikaFloatToColor(data.y);\n uTroikaStrokeOpacity = data.z;\n }\n "}),f.setMatrixTexture=t=>{f.uniforms[r].value=t,f.uniforms[d].value.set(t.image.width,t.image.height)},f}p(io,"createBatchedTextMaterial");function so({vertexShader:h,fragmentShader:r},d,f=d){let t=new RegExp("uniform\\s+(bool|float|vec[234]|mat[34])\\s+".concat(d,"\\b")),e,a=!1;r=r.replace(t,(n,i)=>(a=!0,"varying ".concat(e=i," ").concat(f)));let o=!1;return h=h.replace(t,(n,i)=>(o=!0,"".concat(a?"varying":""," ").concat(e=i," ").concat(f))),o||(h="".concat(a?"varying":""," ").concat(e," ").concat(f,";\n").concat(h)),{vertexShader:h,fragmentShader:r}}p(so,"uniformToVarying");Ie();var aa="abcdefghijklmnopqrstuvwxyz";function oa(h){return new Promise((r,d)=>{h?typeof h=="string"?Ir({font:h,characters:aa},()=>{r(h)}):d(new Error("bad fontUrl ".concat(h))):import("./roboto-regular-V36DLM4S.js").then(f=>{Ir({font:f.default,characters:aa},()=>{r(f.default)})})})}p(oa,"preloadFont");var Vr=.1,lo=new He;function ia(h,r,d,f){return r<=0||d<=0?Promise.reject("incoorect dimension [".concat(r,", ").concat(d,"]")):new Promise((t,e)=>{h.sync(a);function a(){if(!h.geometry.boundingBox)return;let{x:o,y:n}=h.geometry.boundingBox.getSize(lo);if(n>d||o>r){if(h.fontSize===Vr)return e("cannot find suitable font size for ".concat(h.text,". MaxSize: [").concat(r,", ").concat(d,"], Current size: [").concat(o,", ").concat(n,"]. min font size").concat(Vr,"."));h.fontSize=Math.max(Vr,h.fontSize-f),h.sync(a)}else return t({size:[o,n]})}p(a,"syncCallback")})}p(ia,"fitTextToArea");async function Ho(h,r,d,f){var U,_,S,D,x,A,W,B,Y,y,O,w,j,P;let t=r.feature.properties,{textArea:e}=t;if(!e)throw new Error("textArea is required");let a=(U=d.margin)!=null?U:ze.margin,[o,n,i,s]=Array.isArray(a)?a:[a,a,a,a],l=new rt;r.textMesh=l,l.text=t.content;let u=e.maxHeight-o-i,c=e.maxWidth-s-n;l.fontSize=Math.min(u,(_=d.fontSize)!=null?_:ze.fontSize),l.color=(S=d.color)!=null?S:ze.color,l.maxWidth=(D=d.maxWidth)!=null?D:c,l.anchorX="center",l.anchorY="middle",l.textAlign="center";let g=(x=d.font)!=null?x:ze.font;g?l.font=g:rr?l.font=await rr:l.font=await uo(),l.outlineOpacity=(A=d.outlineOpacity)!=null?A:ze.outlineOpacity,l.outlineColor=(W=d.outlineColor)!=null?W:ze.outlineColor,l.outlineOffsetY=(B=d.outlineOffsetY)!=null?B:ze.outlineOffsetY,l.outlineOffsetX=(Y=d.outlineOffsetX)!=null?Y:ze.outlineOffsetX,l.outlineWidth=(y=d.outlineWidth)!=null?y:ze.outlineWidth,l.outlineBlur=(O=d.outlineBlur)!=null?O:ze.outlineBlur,l.strokeWidth=(w=d.strokeWidth)!=null?w:ze.strokeWidth,l.strokeColor=(j=d.strokeColor)!=null?j:ze.strokeColor,l.strokeOpacity=(P=d.strokeOpacity)!=null?P:ze.strokeOpacity;let m=f(e.position,Ye);l.position.copy(m);let b=An(Math.PI/2-mn.degToRad(e.rotation));l.rotation.z=b,l.userData={entityId:h.toString(),rotationZ:b};let L,F;try{F=(await ia(l,c,u,l.fontSize*.2)).size}catch(Z){throw new Error("Cannot fit text to area: entityId: ".concat(r.polygonEntityId," ").concat(Z))}if(F)return tr.identity(),Ye.set(0,0,1),tr.makeRotationAxis(fo,b),Ye.set(e.align==="near"?s+F[0]/2:e.maxWidth/2,0,0),Ye.applyMatrix4(tr),l.position.x-=Ye.x,l.position.y-=Ye.y,L&&(Ye.set(e.maxWidth/2,0,0),Ye.applyMatrix4(tr),L.position.x-=Ye.x,L.position.y-=Ye.y),{text:l}}p(Ho,"createTroikaText");var tr=new Ft,Ye=new He,fo=new He(0,0,1),rr;function uo(h){return rr=oa(h),rr}p(uo,"preloadFont");export{Pr as BatchedText,rt as Text,Ho as createTroikaText,uo as preloadFont};
|