UNPKG

scrawl-canvas

Version:

Responsive, interactive and more accessible HTML5 canvas elements. Scrawl-canvas is a JavaScript library designed to make using the HTML5 canvas element easier, and more fun

1 lines 704 kB
const t={},e=[],i={},n=[],s={},r=[],o={},a=[],l={},c=[],h={},u=[],d={},f=[],p={},g=[],y={},m=[],b={},S=[],C={},A=[],w={},k=[],D={},O={},P=[],v={},F=[],x={},T=[],R={},E=[],I={},H=[],L={},B=[],$={};function G(h=""){const u=function(t,e,i=!1){t.forEach(t=>{const n=e[t];n&&n.kill&&n.kill(i)})};if(h){u(a.filter(t=>0===t.indexOf(h)),o);u(c.filter(t=>0===t.indexOf(h)),l);u(k.filter(t=>0===t.indexOf(h)),w,!0);u(B.filter(t=>0===t.indexOf(h)),L);u(H.filter(t=>0===t.indexOf(h)),I);u(n.filter(t=>0===t.indexOf(h)),i);u(r.filter(t=>0===t.indexOf(h)),s);u(S.filter(t=>0===t.indexOf(h)),b);u(e.filter(t=>0===t.indexOf(h)),t);u(P.filter(t=>0===t.indexOf(h)),O);u(F.filter(t=>0===t.indexOf(h)),v);u(T.filter(t=>0===t.indexOf(h)),x)}}function M(t=""){const e=`100px ${t}`;return A.includes(e)}function X(t=""){const e=`100px ${t}`;return A.includes(e)?C[e]:null}function Y(t=""){return a.includes(t)?o[t]:null}function N(t=""){return c.includes(t)?l[t]:null}function U(t=""){return m.includes(t)?y[t]:null}function z(t=""){return u.includes(t)?h[t]:null}function j(t=""){return B.includes(t)?L[t]:null}function V(t=""){return H.includes(t)?I[t]:null}function W(t=""){return B.includes(t)?L[t]:f.includes(t)?d[t]:null}function Z(t=""){return f.includes(t)?d[t]:null}function _(t=""){return S.includes(t)?b[t]:null}function q(t=""){return k.includes(t)?w[t]:null}function K(t=""){return E.includes(t)?R[t]:null}function Q(t=""){return g.includes(t)?p[t]:null}const J={};var tt=Object.freeze({__proto__:null,anchor:t,anchornames:e,animation:i,animationnames:n,animationtickers:s,animationtickersnames:r,artefact:o,artefactnames:a,asset:l,assetnames:c,canvas:h,canvasnames:u,cell:d,cellnames:f,checkFontIsLoaded:M,constructors:J,element:p,elementnames:g,entity:y,entitynames:m,filter:b,filternames:S,findArtefact:Y,findAsset:N,findCanvas:z,findCell:Z,findElement:Q,findEntity:U,findFilter:_,findGroup:q,findPattern:W,findStack:K,findStyles:j,findTween:V,fontfamilymetadata:C,fontfamilymetadatanames:A,force:O,forcenames:P,getFontMetadata:X,group:w,groupnames:k,palette:{},palettenames:[],particle:D,particlenames:[],purge:G,spring:v,springnames:F,stack:R,stacknames:E,styles:L,stylesnames:B,tween:I,tweennames:H,unstackedelement:$,unstackedelementnames:[],version:"8.19.0",world:x,worldnames:T});const et=Math.abs,it=Object.assign,nt=Math.acos,st=Math.atan2,rt=Math.ceil,ot=window.getComputedStyle,at=Math.cos,lt=Object.create,ct=Object.entries,ht=Math.floor,ut=Math.hypot,dt=Array.isArray,ft=Number.isFinite,pt=Object.keys,gt=Math.max,yt=Math.min,mt=Date.now,bt=JSON.parse,St=2*Math.PI,Ct=.5*Math.PI,At=Math.pow,wt=Math.PI/180,kt=Math.random,Dt=Math.round,Ot=Object.setPrototypeOf,Pt=Math.sin,vt=Math.sqrt,Ft=Math.tan,xt=.016,Tt=Object.values,Rt="BODY",Et="image_",It="video_",Ht="2d",Lt="absolute",Bt=["Canvas","Stack"],$t="addEventListener",Gt="add-ease",Mt="add-map-contour",Xt="add-map-displace",Yt="add-map-ease",Nt="add-map-flow",Ut="add-map-rotate",zt="add-map-threshold",jt="add-map-warp",Vt="add-noise",Wt="add-ripple",Zt="add-wave",_t="after-spread",qt="alpha-to-channels",Kt="alpha-to-luminance",Qt="alphabetic",Jt="anchor",te="animation",ee="anonymous",ie="area-alpha",ne=",",se="aria-hidden",re="aria-live",oe="asset",ae=/.*\/(.*?)\./,le="auto",ce="autofocus",he="average-channels",ue="before-spread",de="bezier",fe="rgb(0 0 0 / 1)",pe="black-white",ge="rgb(0 0 0 / 0)",ye="blend",me="block",be="bluenoise",Se="blur",Ce="blurAction",Ae="border-box",we="bottom",ke="canvas",De="center",Oe="channels-to-alpha",Pe="chroma",ve="clamp-channels",Fe=["down","round","up"],xe="clear",Te="click",Re="clickAction",Ee="close",Ie="color",He="colors-to-alpha",Le="compose",Be="control",$e="coord",Ge=["topLeft","topRight","bottomRight","bottomLeft"],Me='[data-scrawl-corner-div="sc"]',Xe="corrode",Ye="data-scrawl-group",Ne="data-tab-order",Ue="12px sans-serif",ze="any_random_string_will_do",je="description",Ve="destination-out",We="destination-over",Ze="dimensions",_e="disabled",qe="displace",Ke="display-p3",Qe="div",Je="down",ti="download",ei="draw",ii="element",ni="emboss",si="end",ri="endControl",oi="enter",ai="entity",li="euler",ci="fill",hi="flood",ui="focus",di="focusAction",fi=["Label","EnhancedLabel"],pi="form",gi="function",yi="gaussian-blur",mi="glitch",bi=["Cell","CellFragment"],Si=["Gradient","RadialGradient","ConicGradient"],Ci="grayscale",Ai="green",wi="hanging",ki="height",Di="high",Oi="href",Pi="hreflang",vi="ideographic",Fi="img",xi=["rgb","hsl","hwb","xyz","lab","lch","oklab","oklch"],Ti="invert-channels",Ri="leave",Ei="left",Ii="lineDash",Hi="linear",Li="lock-channels-to-levels",Bi="ltr",$i="luminance-to-alpha",Gi="map-to-gradient",Mi="matrix",Xi="mean",Yi="middle",Ni="mimic",Ui="modify-ok-channels",zi="modulate-channels",ji="modulate-ok-channels",Vi="mouse",Wi="mousedown",Zi="mouseenter",_i="mouseleave",qi="mousemove",Ki="mouseup",Qi="move",Ji="multiply",tn="name",en="negative",nn="newsprint",sn="none",rn="normal",on="offset",an="ok-perceptual-curves",ln="on-coordinates",cn="ordered",hn="pad",un="particle",dn="path",fn=["Bezier","Cog","Line","LineSpiral","Oval","Polygon","Polyline","Quadratic","Rectangle","Shape","Spiral","Star","Tetragon"],pn="%",gn="0%",yn="100%",mn="50%",bn=["random","bluenoise","ordered"],Sn="ping",Cn="pivot",An="pixelate",wn="pointerdown",kn="pointerenter",Dn="pointerleave",On="pointermove",Pn="pointerup",vn="polite",Fn="process-image",xn="0px",Tn="quadratic",Rn=["radiusX"],En=["radiusX","radiusY"],In=["radiusY"],Hn="random",Ln="random-noise",Bn="rectangle",$n="red",Gn="reduce-palette",Mn="referrerpolicy",Xn="reflect",Yn="rel",Nn="relative",Un="removeEventListener",zn="repeat",jn="reverseByDelta",Vn="rgb",Wn="right",Zn="role",_n="root",qn="rotate-hue",Kn="round",Qn="set-channel-to-level",Jn="source",ts="source-in",es="source-out",is="source-over",ns=" ",ss="srgb",rs="start",os="startControl",as=["direction","fillStyle","filter","font","fontKerning","fontStretch","fontVariantCaps","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","imageSmoothingQuality","letterSpacing","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","strokeStyle","textAlign","textBaseline","textRendering","wordSpacing"],ls=["fillStyle","filter","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","imageSmoothingQuality","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","strokeStyle"],cs=["direction","font","fontKerning","fontStretch","fontVariantCaps","letterSpacing","textRendering","wordSpacing"],hs="step-channels",us="styles",ds="subscribe",fs="swirl",ps="Action",gs="Bezier",ys="Canvas",ms="Cell",bs="Color",Ss="ConicGradient",Cs="Coordinate",As="EnhancedLabel",ws="Filter",ks="Gradient",Ds="Grid",Os="Group",Ps="Image",vs="Label",Fs="Line",xs="Palette",Ts="Particle",Rs="Picture",Es="Polyline",Is="Quadratic",Hs="Quaternion",Ls="RadialGradient",Bs="RenderAnimation",$s="Sprite",Gs="Stack",Ms="Ticker",Xs="Tween",Ys="Vector",Ns="Video",Us="World",zs="tabOrder",js="target",Vs="threshold",Ws=["rect","hex","random","points"],Zs="tiles",_s="tint-channels",qs="top",Ks="touchcancel",Qs="touchend",Js="touchmove",tr="touchstart",er="transparent",ir="true",nr="tween",sr="type",rr="undefined",or="unknown",ar="unsharp",lr="up",cr="updateByDelta",hr="user-defined-legacy",ur="value",dr="vary-channels-by-weights",fr="video",pr="rgb(255 255 255 / 1)",gr="width",yr="M0,0",mr="",br="zoom-blur",Sr=Math.PI,Cr="ms",Ar=(t,e)=>{if(null==e)return t;if(Mr(t)&&Mr(e))return t+e;t.substring&&(Ei===t||qs===t?t=gn:Wn===t||we===t?t=yn:De===t&&(t=mn));const i=!(!t.substring&&!e.substring),n=(Mr(t)?t:parseFloat(t)||0)+(Mr(e)?e:parseFloat(e)||0);return i?n+pn:n},wr=t=>{if(Mr(t))return[Cr,t];if(t.substring){const e=t.match(/^\d+\.?\d*(\D*)/);let i=e[1].toLowerCase?e[1].toLowerCase():Cr,n=parseFloat(t);if(ft(n)){switch(i){case"s":n*=1e3;break;case"%":break;default:i=Cr}return[i,n]}return[Cr,0]}},kr=t=>(t%360+360)%360,Dr=t=>{if(ft(t)){if(t<-1e-6)return t;if(t>1e-6)return t}return 0},Or=()=>{},Pr=function(t){return t},vr=function(){return new Error("Clone functionality is not supported for this object")},Fr={},xr=()=>{function t(){return ht(65536*(1+kt())).toString(16).substring(1)}return`${t()}${t()}-${t()}-${t()}-${t()}-${t()}${t()}${t()}`},Tr=()=>performance.now().toString(36)+kt().toString(36).substr(2),Rr=t=>`${t.type}_${t.name}_${Tr()}`,Er=function(t,e,i){return e+t*(i-e)},Ir=t=>t<0?0:t>255?255:0|t,Hr=(t,e,i)=>t<e?e:t>i?i:t,Lr=t=>"boolean"==typeof t,Br=t=>"[object HTMLCanvasElement]"===Object.prototype.toString.call(t),$r=t=>!!(t&&t.querySelector&&t.dispatchEvent),Gr=t=>typeof t===gi,Mr=t=>!!ft(t),Xr=t=>"[object Object]"===Object.prototype.toString.call(t),Yr=t=>!(!t||!t.type||t.type!==Hs),Nr=(t,e)=>{if(Xr(t)&&Xr(e))for(const i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},Ur=(t,e)=>(Xr(t)&&Xr(e)&&ct(e).forEach(([i,n])=>{null==n?delete t[i]:t[i]=e[i]}),t),zr=(t,e)=>(dt(t)&&(dt(e)?e.forEach(e=>zr(t,e)):t.includes(e)||t.push(e)),t),jr=(t,e)=>{if(dt(t)){const i=t.indexOf(e);i>=0&&t.splice(i,1)}return t},Vr=t=>typeof t!==rr,Wr=(...t)=>t.every(t=>typeof t!==rr),Zr=(...t)=>t.find(t=>typeof t!==rr),_r=(...t)=>!!t.find(t=>typeof t!==rr),qr={out:t=>1-at(t*Sr/2),in:t=>Pt(t*Sr/2),easeIn:t=>{const e=1-t;return 1-e*e},easeIn3:t=>{const e=1-t;return 1-e*e*e},easeIn4:t=>{const e=1-t;return 1-e*e*e*e},easeIn5:t=>{const e=1-t;return 1-e*e*e*e*e},easeOutIn:t=>t<.5?2*t*t:1-At(-2*t+2,2)/2,easeOutIn3:t=>t<.5?4*t*t*t:1-At(-2*t+2,3)/2,easeOutIn4:t=>t<.5?8*t*t*t*t:1-At(-2*t+2,4)/2,easeOutIn5:t=>t<.5?16*t*t*t*t*t:1-At(-2*t+2,5)/2,easeInOut:t=>{const e=.5-t;return t<.5?.5+-2*e*e:.5+At(2*(t-.5),2)/2},easeInOut3:t=>{const e=.5-t;return t<.5?.5+-4*e*e*e:.5+At(2*(t-.5),3)/2},easeInOut4:t=>{const e=.5-t;return t<.5?.5+-8*e*e*e*e:.5+At(2*(t-.5),4)/2},easeInOut5:t=>{const e=.5-t;return t<.5?.5+-16*e*e*e*e*e:.5+At(2*(t-.5),5)/2},easeOut:t=>t*t,easeOut3:t=>t*t*t,easeOut4:t=>t*t*t*t,easeOut5:t=>t*t*t*t*t,none:t=>t,linear:t=>t,cosine:t=>.5*(1+at((1-t)*Sr)),hermite:t=>t*t*(2*-t+3),quintic:t=>t*t*t*(t*(6*t-15)+10),easeOutSine:t=>1-at(t*Sr/2),easeInSine:t=>Pt(t*Sr/2),easeOutInSine:t=>-(at(Sr*t)-1)/2,easeOutQuad:t=>t*t,easeInQuad:t=>1-(1-t)*(1-t),easeOutInQuad:t=>t<.5?2*t*t:1-At(-2*t+2,2)/2,easeOutCubic:t=>t*t*t,easeInCubic:t=>1-At(1-t,3),easeOutInCubic:t=>t<.5?4*t*t*t:1-At(-2*t+2,3)/2,easeOutQuart:t=>t*t*t*t,easeInQuart:t=>1-At(1-t,4),easeOutInQuart:t=>t<.5?8*t*t*t*t:1-At(-2*t+2,4)/2,easeOutQuint:t=>t*t*t*t*t,easeInQuint:t=>1-At(1-t,5),easeOutInQuint:t=>t<.5?16*t*t*t*t*t:1-At(-2*t+2,5)/2,easeOutExpo:t=>0===t?0:At(2,10*t-10),easeInExpo:t=>1===t?1:1-At(2,-10*t),easeOutInExpo:t=>0===t||1===t?t:t<.5?At(2,20*t-10)/2:(2-At(2,-20*t+10))/2,easeOutCirc:t=>1-vt(1-At(t,2)),easeInCirc:t=>vt(1-At(t-1,2)),easeOutInCirc:t=>t<.5?(1-vt(1-At(2*t,2)))/2:(vt(1-At(-2*t+2,2))+1)/2,easeOutBack:t=>2.70158*t*t*t-1.70158*t*t,easeInBack:t=>1+2.70158*At(t-1,3)+1.70158*At(t-1,2),easeOutInBack:t=>{const e=2.5949095;return t<.5?At(2*t,2)*(7.189819*t-e)/2:(At(2*t-2,2)*((e+1)*(2*t-2)+e)+2)/2},easeOutElastic:t=>{const e=2*Sr/3;return 0===t||1===t?t:-At(2,10*t-10)*Pt((10*t-10.75)*e)},easeInElastic:t=>{const e=2*Sr/3;return 0===t||1===t?t:At(2,-10*t)*Pt((10*t-.75)*e)+1},easeOutInElastic:t=>{const e=2*Sr/4.5;return 0===t||1===t?t:t<.5?-At(2,20*t-10)*Pt((20*t-11.125)*e)/2:At(2,-20*t+10)*Pt((20*t-11.125)*e)/2+1},easeOutBounce:t=>{const e=7.5625,i=2.75;return(t=1-t)<1/i?1-e*t*t:t<2/i?1-(e*(t-=1.5/i)*t+.75):t<2.5/i?1-(e*(t-=2.25/i)*t+.9375):1-(e*(t-=2.625/i)*t+.984375)},easeInBounce:t=>{const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeOutInBounce:t=>{const e=7.5625,i=2.75;let n;return t<.5?(n=(t=1-2*t)<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375,(1-n)/2):(n=(t=2*t-1)<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375,(1+n)/2)},steppedEasing2:t=>t<.5?1/4:3/4,steppedEasing3:t=>t<1/3?1/6:t<2/3?.5:5/6,steppedEasing4:t=>t<1/4?1/8:t<.5?3/8:t<3/4?5/8:7/8,steppedEasing5:t=>t<.2?.1:t<.4?.3:t<.6?.5:t<.8?.7:.9,steppedEasing6:t=>t<1/6?1/12:t<2/6?.25:t<.5?5/12:t<4/6?7/12:t<5/6?.75:11/12,steppedEasing7:t=>t<1/7?1/14:t<2/7?3/14:t<3/7?5/14:t<4/7?.5:t<5/7?9/14:t<6/7?11/14:13/14,steppedEasing8:t=>t<1/8?1/16:t<2/8?3/16:t<3/8?5/16:t<.5?7/16:t<5/8?9/16:t<6/8?11/16:t<7/8?13/16:15/16},Kr=()=>lt(Object.prototype);let Qr=!1;const Jr=()=>Qr,to=t=>Qr=t;let eo=!1;const io=()=>eo,no=t=>eo=t;let so=!1;const ro=()=>so,oo=t=>so=t;let ao=!1;const lo=()=>ao,co=t=>ao=t;let ho=!1;const uo=()=>ho,fo=t=>ho=t;let po=!1;const go=()=>po,yo=t=>po=t;let mo=!1;const bo=()=>mo,So=t=>mo=t;let Co=!1;const Ao=()=>Co,wo=t=>Co=t;let ko=!1;const Do=()=>ko,Oo=t=>ko=t;let Po=!1;const vo=()=>Po,Fo=t=>Po=t;let xo=!0;const To=t=>xo=t;let Ro=!1;const Eo=t=>Ro=t;let Io=!0;const Ho=t=>Io=t,Lo=function(){eo=!0,so=!0},Bo="GenericArray",$o=function(){const t=[];return Ot(t,$o.prototype),t};J.GenericArray=$o;const Go=$o.prototype=lt(Array.prototype);Go.constructor=$o,Go.type=Bo;const Mo=[],Xo=function(...t){Mo.length||Mo.push(new $o);const e=Mo.pop();return t.length&&e.push(...t),e},Yo=function(...t){t.forEach(t=>{t&&t.type===Bo&&(t.length=0,Mo.push(t),Mo.length>512&&(console.log("purging genericArrayPool"),Mo.length=256))})},No=[],Uo=[],zo=t=>{zr(Uo,t),To(!0)},jo=t=>{jr(Uo,t),To(!0)},Vo=t=>Uo.includes(t),Wo=()=>{xo&&(To(!1),(()=>{const t=Xo();let e,n,s,r;for(s=0,r=Uo.length;s<r;s++)e=i[Uo[s]],e&&(n=ht(e.order)||0,t[n]||(t[n]=Xo()),t[n].push(e));for(No.length=0,s=0,r=t.length;s<r;s++)e=t[s],e&&(No.push(...e),Yo(e));Yo(t)})());for(let t=0,e=No.length;t<e;t++){const e=No[t];if(e.chokedAnimation){const t=mt();e.lastRun+825/e.maxFrameRate<t&&(e.fn(),e.lastRun=t)}else e.fn()}Ro&&window.requestAnimationFrame(Wo)},Zo=()=>{Eo(!0),Wo()},_o=()=>Eo(!1),qo=function(t,e,i=Fr){if(typeof window.IntersectionObserver===gi&&t&&t.run){const n=new IntersectionObserver(e=>{let i,n,s;for(i=0,n=e.length;i<n;i++)s=e[i],s.isIntersecting&&!t.isRunning()?t.run():!s.isIntersecting&&t.isRunning()&&t.halt()},i);return e&&e.domElement&&n.observe(e.domElement),function(){n.disconnect()}}return Or},Ko=function(t,e,i){return t&&Gr(e)&&i?(Jo(t,e,i,Un),Jo(t,e,i,$t),function(){Qo(t,e,i)}):Or},Qo=function(t,e,i){t&&Gr(e)&&i&&Jo(t,e,i,Un)},Jo=function(t,e,i,n){const s=Xo(),r=Xo();dt(t)?s.push(...t):s.push(t),i.substring?r.push(...document.body.querySelectorAll(i)):dt(i)?r.push(...i):r.push(i),navigator.pointerEnabled||navigator.msPointerEnabled?ea(s,e,r,n):ta(s,e,r,n),Yo(r,s)},ta=function(t,e,i,n){let s,r,o,a,l,c;for(s=0,r=t.length;s<r;s++)for(l=t[s],o=0,a=i.length;o<a;o++)if(c=i[o],$r(c)||c.document||c.characterSet)switch(l){case Qi:c[n](qi,e,!1),c[n](Js,e,{passive:!1}),c[n]("touchfollow",e,{passive:!1});break;case lr:c[n](Ki,e,!1),c[n](Qs,e,{passive:!1});break;case Je:c[n](Wi,e,!1),c[n](tr,e,{passive:!1});break;case Ri:c[n](_i,e,!1),c[n]("touchleave",e,{passive:!1});break;case oi:c[n](Zi,e,!1),c[n]("touchenter",e,{passive:!1})}},ea=function(t,e,i,n){let s,r,o,a,l,c;for(s=0,r=t.length;s<r;s++)for(l=t[s],o=0,a=i.length;o<a;o++)if(c=i[o],$r(c)||c.document||c.characterSet)switch(l){case Qi:c[n](On,e,!1);break;case lr:c[n](Pn,e,!1);break;case Je:c[n](wn,e,!1);break;case Ri:c[n](Dn,e,!1);break;case oi:c[n](kn,e,!1)}},ia=function(t,e,i){return t&&Gr(e)&&i?(sa(t,e,i,Un),sa(t,e,i,$t),function(){na(t,e,i)}):Or},na=function(t,e,i){t&&Gr(e)&&i&&sa(t,e,i,Un)},sa=function(t,e,i,n){const s=Xo(),r=Xo();let o,a,l,c,h,u;for(dt(t)?s.push(...t):s.push(t),i.substring?r.push(...document.body.querySelectorAll(i)):dt(i)?r.push(...i):r.push(i),o=0,a=s.length;o<a;o++)for(h=s[o],l=0,c=r.length;l<c;l++)u=r[l],($r(u)||u.document||u.characterSet)&&u[n](h,e,!1);Yo(r,s)},ra="~~~",oa=["Image","Sprite","Video","Canvas","Stack"];function aa(t=Fr){t.defs={},t.getters={},t.setters={},t.deltaSetters={},t.get=function(t){let e,i;if(Vr(t)){if(i=this.getters[t],i)return i.call(this);{const i=this.defs[t];if(typeof i!==rr)return e=this[t],typeof e!==rr?e:i}}return null},t.set=function(t=Fr){let e,i,n,s;const r=pt(t),o=r.length;if(o){const a=this.setters,l=this.defs;for(e=0;e<o;e++)i=r[e],n=t[i],i&&i!==tn&&null!=n&&(s=a[i],s?s.call(this,n):typeof l[i]!==rr&&(this[i]=n))}return this},t.setDelta=function(t=Fr){let e,i,n,s;const r=pt(t),o=r.length;if(o){const a=this.deltaSetters,l=this.defs;for(e=0;e<o;e++)i=r[e],n=t[i],i&&i!==tn&&null!=n&&(s=a[i],s?s.call(this,n):typeof l[i]!==rr&&(this[i]=Ar(this[i],n)))}return this};t.defs=Nr(t.defs,{name:""});const e=t.getters;e.type=function(){return this.type},e.isArtefact=function(){return this.isArtefact},e.isAsset=function(){return this.isAsset},t.packetExclusions=[],t.packetExclusionsByRegex=[],t.packetCoordinates=[],t.packetObjects=[],t.packetFunctions=[],t.saveAsPacket=function(t=Fr){Lr(t)&&t&&(t={includeDefaults:!0});const e=this.defs,i=pt(e),n=this.packetExclusions,s=this.packetExclusionsByRegex,r=this.packetCoordinates,o=this.packetObjects,a=this.packetFunctions;let l=t.includeDefaults||!1,c={};return l&&!dt(l)?l=pt(e):l||(l=[]),ct(this).forEach(([t,e])=>{let h,u=!0;if(i.includes(t)||(u=!1),u&&n.includes(t)&&(u=!1),u&&(h=s.some(e=>new RegExp(e).test(t)),h&&(u=!1)),u)if(a.includes(t)){if(Vr(e)&&null!=e){const i=this.stringifyFunction(e);i&&i.length&&(c[t]=i)}}else o.includes(t)&&this[t]&&this[t].name?c[t]=this[t].name:r.includes(t)?(l.includes(t)||e[0]||e[1])&&(c[t]=e):(h=this.processPacketOut(t,e,l),h&&(c[t]=e))},this),c=this.finalizePacketOut(c,t),JSON.stringify([this.name,this.type,this.lib,c])},t.stringifyFunction=function(t){const e=t.toString().match(/\(([\s\S]*?)\)[\s\S]*?\{([\s\S]*)\}/),i=e[1],n=e[2],s=`${i}${ra}${n}`;return s!==ra&&s},t.processPacketOut=function(t,e,i){let n=!0;return i.includes(t)||e!==this.defs[t]||(n=!1),n},t.finalizePacketOut=function(t){return t},t.importPacket=function(t,e=Fr){const i=this,n=function(t){return new Promise((n,s)=>{let r;t.substring||s(new Error("Packet url supplied for import is not a string")),"["===t[0]?(r=i.actionPacket(t,e),r&&r.lib?n(r):s(r)):t.includes('"name":')?s(new Error("Bad packet supplied for import")):fetch(t).then(t=>{if(!t.ok)throw new Error(`Packet import from server failed - ${t.status}: ${t.statusText} - ${t.url}`);return t.text()}).then(t=>{if(r=i.actionPacket(t,e),!r||!r.lib)throw r;n(r)}).catch(t=>s(t))})};if(dt(t)){const e=[];return t.forEach(t=>e.push(n(t))),new Promise((t,i)=>{Promise.all(e).then(e=>t(e)).catch(t=>i(t))})}if(t.substring)return n(t);Promise.reject(new Error("Argument supplied for packet import is not a string or array of strings"))},t.actionPacket=function(t,e=Fr){const i={reviveFunctions:!1,allowDOMElementCreation:!1,logWarnings:!0,...e};try{if(t&&t.substring){if("["===t[0]){let e,n,s,r;try{[e,n,s,r]=bt(t)}catch(t){throw new Error(`Failed to process packet due to JSON parsing error - ${t.message}`)}if(Wr(e,n,s,r)){if(oa.includes(n))throw new Error("Failed to process packet - Stacks, Canvases and visual assets are excluded from the packet system");i.allowDOMElementCreation||((r.outerHTML||r.host||r.anchor||r.button)&&i.logWarnings&&console.warn(`SC packet import skipped DOM element data for ${e}`),delete r.outerHTML,delete r.host,delete r.anchor,delete r.button);let t=tt[s][e];if(t)t.set(r);else{if(i.allowDOMElementCreation&&r.outerHTML&&r.host){const t=document.getElementById(r.host);if(t){const i=document.createElement("div");i.innerHTML=r.outerHTML;const n=i.firstElementChild;n&&(n.id=e,t.appendChild(n),r.domElement=n)}else i.logWarnings&&console.warn(`SC packet import rejected missing host element for ${e}`)}if(t=new J[n](r),!t)throw new Error("Failed to create Scrawl-canvas object from supplied packet")}if(t.packetFunctions.forEach(e=>this.actionPacketFunctions(t,e,i)),i.allowDOMElementCreation&&r.anchor&&t.anchor&&t.anchor.packetFunctions.forEach(e=>{t.anchor[e]=r.anchor[e],this.actionPacketFunctions(t.anchor,e,i),t.anchor.build()}),i.allowDOMElementCreation&&r.button&&t.button&&t.button.packetFunctions.forEach(e=>{t.button[e]=r.button[e],this.actionPacketFunctions(t.button,e,i),t.button.build()}),t)return t;throw new Error("Failed to process supplied packet")}throw new Error("Failed to process packet - JSON string holds incomplete data")}throw new Error("Failed to process packet - JSON string does not represent an array")}throw new Error("Failed to process packet - not a JSON string")}catch(t){return i.logWarnings&&console.warn(t.message),t}},t.actionPacketFunctions=function(t,e,i=Fr){const n=t[e];if(Vr(n)&&null!=n&&n.substring)if(n===ra)t[e]=Or;else{if(!i.reviveFunctions)return t[e]=Or,void(i.logWarnings&&console.warn(`SC packet import skipped function revival for ${t.name||t.type}.${e}`));let s,r,o;const a=n.split(ra);if(2!==a.length)return t[e]=Or,void(i.logWarnings&&console.warn(`SC packet import rejected malformed function packet for ${t.name||t.type}.${e}`));[s,r]=a,s=s.split(ne),s=s.map(t=>t.trim()),r.includes("[native code]")?t[e]=Or:(o=new Function(...s,r),t[e]=o.bind(t))}},t.clone=function(t=Fr){const e=this.name;let i,n,s,r;this.name=t.name||mr,t.useNewTicker?(n=this.ticker,this.ticker=null,i=this.saveAsPacket(),this.ticker=n):(this.anchor&&(s=this.anchor,this.anchor=null),this.button&&(r=this.button,this.button=null),i=this.saveAsPacket(),s&&(this.anchor=s),r&&(this.button=r)),this.name=e;let o=this.actionPacket(i,{reviveFunctions:!0,allowDOMElementCreation:!0,logWarnings:!0});return this.packetFunctions.forEach(t=>{this[t]&&(o[t]=this[t])}),o=this.postCloneAction(o,t),o.set(t),o},t.postCloneAction=function(t){return t},t.kill=function(){return this.deregister()},t.makeName=function(t){return t&&t.substring&&!tt[`${this.lib}names`].includes(t)?this.name=t:this.name=Tr(),this},t.register=function(){if(!Vr(this.name))throw new Error(`core/base error - register() name not set: ${this}`);const t=tt[`${this.lib}names`],e=tt[this.lib];return this.isArtefact&&(zr(a,this.name),o[this.name]=this),this.isAsset&&(zr(c,this.name),l[this.name]=this),zr(t,this.name),e[this.name]=this,this},t.deregister=function(){if(!Vr(this.name))throw new Error(`core/base error - deregister() name not set: ${this}`);const t=tt[`${this.lib}names`],e=tt[this.lib];return this.isArtefact&&(jr(a,this.name),delete o[this.name]),this.isAsset&&(jr(c,this.name),delete l[this.name]),jr(t,this.name),delete e[this.name],this}}const Animation=function(t=Fr){return this.makeName(t.name),this.order=Vr(t.order)?t.order:this.defs.order,this.fn=t.fn||Or,this.onRun=t.onRun||Or,this.onHalt=t.onHalt||Or,this.onKill=t.onKill||Or,this.maxFrameRate=t.maxFrameRate||60,this.lastRun=0,this.chokedAnimation=!0,this.register(),t.delay||this.run(),this},la=Animation.prototype=Kr();la.type="Animation",la.lib=te,la.isArtefact=!1,la.isAsset=!1,aa(la);la.defs=Nr(la.defs,{order:1,maxFrameRate:60,fn:null,onRun:null,onHalt:null,onKill:null}),la.stringifyFunction=Or,la.processPacketOut=Or,la.finalizePacketOut=Or,la.saveAsPacket=function(){return`[${this.name}, ${this.type}, ${this.lib}, {}]`},la.clone=vr,la.run=function(){return this.onRun(),zo(this.name),setTimeout(()=>Lo(),20),this},la.isRunning=function(){return Vo(this.name)},la.halt=function(){return this.onHalt(),jo(this.name),this},la.kill=function(){return this.onKill(),jo(this.name),this.deregister(),!0};const ca=function(t){return!!t&&new Animation(t)};J.Animation=Animation;const ha="change",ua="touch",da=[],fa={x:0,y:0,scrollX:0,scrollY:0,w:0,h:0,type:Vi,prefersReducedMotion:!1,prefersDarkColorScheme:!1,prefersReduceTransparency:!1,prefersContrast:!1,prefersReduceData:!1,prefersInvertedColors:!1,prefersForcedColors:!1,displaySupportsP3Color:!1,canvasSupportsP3Color:!1,devicePixelRatio:0,rawTouches:[]},pa=window.matchMedia("(prefers-contrast: more)");pa.addEventListener(ha,()=>{const t=pa.matches;fa.prefersContrast!==t&&(fa.prefersContrast=t,co(!0))}),fa.prefersContrast=pa.matches;const ga=window.matchMedia("(prefers-reduced-motion: reduce)");ga.addEventListener(ha,()=>{const t=ga.matches;fa.prefersReducedMotion!==t&&(fa.prefersReducedMotion=t,fo(!0))}),fa.prefersReducedMotion=ga.matches;const ya=window.matchMedia("(prefers-color-scheme: dark)");ya.addEventListener(ha,()=>{const t=ya.matches;fa.prefersDarkColorScheme!==t&&(fa.prefersDarkColorScheme=t,yo(!0))}),fa.prefersDarkColorScheme=ya.matches;const ma=window.matchMedia("(prefers-reduced-transparency: reduce)");ma.addEventListener(ha,()=>{const t=ma.matches;fa.prefersReduceTransparency!==t&&(fa.prefersReduceTransparency=t,So(!0))}),fa.prefersReduceTransparency=ma.matches;const ba=window.matchMedia("(prefers-reduced-data: reduce)");ba.addEventListener(ha,()=>{const t=ba.matches;fa.prefersReduceData!==t&&(fa.prefersReduceData=t,wo(!0))}),fa.prefersReduceData=ba.matches;const Sa=window.matchMedia("(inverted-colors: inverted)");Sa.addEventListener(ha,()=>{const t=Sa.matches;fa.prefersInvertedColors!==t&&(fa.prefersInvertedColors=t,Fo(!0))}),fa.prefersInvertedColors=Sa.matches;const Ca=window.matchMedia("(forced-colors: active)");Ca.addEventListener(ha,()=>{const t=Ca.matches;fa.prefersForcedColors!==t&&(fa.prefersForcedColors=t,Oo(!0))}),fa.prefersForcedColors=Ca.matches;const Aa=window.matchMedia("(color-gamut: p3)");Aa.addEventListener(ha,()=>{const t=Aa.matches;fa.displaySupportsP3Color!==t&&(fa.displaySupportsP3Color=t)}),fa.displaySupportsP3Color=Aa.matches;fa.canvasSupportsP3Color=(()=>{const t=document.createElement("canvas");try{return t.getContext("2d",{colorSpace:Ke}).getContextAttributes().colorSpace===Ke}catch{console.log("checkCanvasSupportsDisplayP3 errored")}return!1})();const wa=()=>fa.devicePixelRatio;let ka=!1;const Da=()=>ka,Oa=t=>ka=t;let Pa=Or;const va=t=>Pa=t,Fa=()=>{const t=window.devicePixelRatio;fa.devicePixelRatio=t,Tt(h).forEach(t=>t.dirtyDimensions=!0),Tt(d).forEach(t=>t.dirtyDimensions=!0),Tt(y).forEach(t=>t.dirtyHost=!0),ka||Pa(),matchMedia(`(resolution: ${t}dppx)`).addEventListener(ha,Fa,{once:!0})};Fa();const xa=function(){const t=document.documentElement.clientWidth,e=document.documentElement.clientHeight;fa.w===t&&fa.h===e||(fa.w=t,fa.h=e,no(!0),oo(!0))},Ta=function(){const t=window.pageXOffset,e=window.pageYOffset;fa.scrollX===t&&fa.scrollY===e||(fa.x+=t-fa.scrollX,fa.y+=e-fa.scrollY,fa.scrollX=t,fa.scrollY=e,no(!0))},Ra=function(t){const e=Dt(t.pageX),i=Dt(t.pageY);fa.x===e&&fa.y===i||(fa.type=navigator.pointerEnabled?"pointer":Vi,fa.x=e,fa.y=i,no(!0))};let Ea=0,Ia=16;const Ha=function(){return Ia},La=function(t){ft(t)&&(Ia=t)},Ba=function(t,e=!0){if(fa.rawTouches.length=0,t.touches&&t.touches.length){fa.rawTouches.push(...t.touches);const e=t.touches[0],i=Dt(e.pageX),n=Dt(e.pageY);fa.x===i&&fa.y===n||(fa.type=ua,fa.x=i,fa.y=n)}else fa.type=ua,e&&(fa.x=0,fa.y=0);const i=mt();i>Ea+Ia&&(Ea=i,$a())},$a=function(){for(let t=0,e=da.length;t<e;t++)Ga(da[t])},Ga=function(t){const e=o[t];if(e){const{here:t,domElement:i}=e;if(t.prefersContrast=fa.prefersContrast,t.prefersReducedMotion=fa.prefersReducedMotion,t.prefersDarkColorScheme=fa.prefersDarkColorScheme,t.prefersReduceTransparency=fa.prefersReduceTransparency,t.prefersReduceData=fa.prefersReduceData,t.prefersInvertedColors=fa.prefersInvertedColors,t.prefersForcedColors=fa.prefersForcedColors,t.devicePixelRatio=fa.devicePixelRatio,lo()&&e.contrastActions(),uo()&&e.reducedMotionActions(),go()&&e.colorSchemeActions(),bo()&&e.reducedTransparencyActions(),Ao()&&e.reducedDataActions(),vo()&&e.invertedColorsActions(),Do()&&e.forcedColorsActions(),i){const n=i.getBoundingClientRect(),s=Dt(n.left+window.pageXOffset),r=Dt(n.top+window.pageYOffset),o=n.top,a=n.height,l=window.innerHeight;t.w=Dt(n.width),t.h=Dt(a),t.type=fa.type;const c=o/l,h=(o+a)/l,u=(c+h)/2;t.inViewportTop=c,t.inViewportBase=h,t.inViewportCenter=u,e.localMouseListener?(t.localListener=!0,t.active=!1,t.normX=!!t.originalWidth&&t.x/t.originalWidth,t.normY=!!t.originalHeight&&t.y/t.originalHeight,t.offsetX=s,t.offsetY=r,t.x>e.activePadding&&t.x<t.originalWidth-e.activePadding&&t.y>0+e.activePadding&&t.y<t.originalHeight-e.activePadding&&(t.active=!0)):(t.localListener=!1,t.active=!0,t.x=Dt(fa.x-s),t.y=Dt(fa.y-r),t.normX=!!t.w&&t.x/t.w,t.normY=!!t.h&&t.y/t.h,t.offsetX=s,t.offsetY=r,(t.normX<0||t.normX>1||t.normY<0||t.normY>1)&&(t.active=!1));const d=fa.rawTouches;if(t.touches||(t.touches=[]),d.length){t.touches.length=0;for(let e=0,i=d.length;e<i;e++){const i=d[e];t.touches.push([Dt(i.pageX-s),Dt(i.pageY-r)])}}if(e.type===ys&&e.updateBaseHere(t,e.fit),e.checkForResize&&!e.dirtyDimensions&&!e.dirtyDomDimensions){const[i,n]=e.currentDimensions;if(e.type===ys){const s=e.computedStyles,r=ht(t.w-parseFloat(s.borderLeftWidth)-parseFloat(s.borderRightWidth)-parseFloat(s.paddingLeft)-parseFloat(s.paddingRight)),o=ht(t.h-parseFloat(s.borderTopWidth)-parseFloat(s.borderBottomWidth)-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom));i===r&&n===o||e.set({dimensions:[r,o]})}else i===t.w&&n===t.h||e.set({dimensions:[t.w,t.h]})}}}},Ma=ca({name:"SC-core-listeners-tracker",order:0,delay:!0,fn:function(){const t=Jr(),e=io(),i=ro(),n=lo(),s=uo(),r=go(),o=bo(),a=Ao(),l=vo(),c=Do();(t&&e||s||n||r||o||a||l||c)&&$a(),t&&e&&no(!1),n&&co(!1),s&&fo(!1),r&&yo(!1),o&&So(!1),a&&wo(!1),l&&Fo(!1),c&&Oo(!1),i&&(oo(!1),Tt(y).forEach(t=>{fi.includes(t.type)&&t.recalculateFont(!0)}))}}),Xa=function(){Na(Un),Na($t),to(!0),no(!0),Ma.run()},Ya=function(){to(!1),no(!1),Ma.halt(),Na(Un)},Na=function(t){navigator.pointerEnabled||navigator.msPointerEnabled?(window[t](On,Ra,!1),window[t](Pn,Ra,!1),window[t](wn,Ra,!1),window[t](Dn,Ra,!1),window[t](kn,Ra,!1)):(window[t](qi,Ra,!1),window[t](Ki,Ra,!1),window[t](Wi,Ra,!1),window[t](_i,Ra,!1),window[t](Zi,Ra,!1),window[t](Js,Ba,{passive:!0}),window[t](tr,Ba,{passive:!0}),window[t](Qs,Ba,{passive:!0}),window[t](Ks,Ba,{passive:!0})),window[t]("scroll",Ta,{passive:!0}),window[t]("resize",xa,!1)},Ua=function(){const{fontfamilymetadata:t,fontfamilymetadatanames:e}=tt;e.forEach(e=>delete t[e]),e.length=0},za=t=>{const{canvasSupportsP3Color:e,displaySupportsP3Color:i}=fa;return t&&e&&i?Ke:ss},ja=["bottom","boxSizing","display","height","left","perspective","perspectiveOrigin","position","right","top","transform","transformOrigin","width","zIndex"],Va=[];let Wa=!1;const Za=function(t=mr){if(Wa||t){const e=Xo();let i,n,s,r,a,l,c,h,u,d,f,p,g,y,m;t&&t.substring?e.push(t):(Wa=!1,e.push(...Va),Va.length=0);const b=Da(),S=wa();for(i=0,n=e.length;i<n;i++)if(s=o[e[i]],s&&(r=s.domElement,r&&(s.dirtyClasses&&(s.dirtyClasses=!1,r.className.substring&&(r.className=s.classes)),a=r.style,a))){if(s.dirtyCss)for(s.dirtyCss=!1,p=s.css||Fr,g=pt(p),d=0,f=g.length;d<f;d++)y=g[d],m=p[y],ja.includes(y)||(a[y]=m);s.dirtyPerspective&&(s.dirtyPerspective=!1,l=s.perspective,a.perspectiveOrigin=`${l.x} ${l.y}`,a.perspective=`${l.z}px`),s.dirtyPosition&&(s.dirtyPosition=!1,a.position=s.position),s.dirtyDomDimensions&&(s.dirtyDomDimensions=!1,c=s.currentDimensions,h=c[0],u=c[1],s.type===ys?(b?(r.width=h,r.height=u):(s.ignoreCanvasCssDimensions||(a.width=`${h}px`,a.height=`${u}px`),r.width=h*S,r.height=u*S),s.renderOnResize&&s.render()):(s.isResponsive&&([h,u]=s.currentParentDimensions),a.width=`${h}px`,a.height=u?`${u}px`:le)),s.dirtyTransformOrigin&&(s.dirtyTransformOrigin=!1,a.transformOrigin=s.currentTransformOriginString),s.dirtyTransform&&(s.dirtyTransform=!1,a.transform=s.currentTransformString),s.dirtyVisibility&&(s.dirtyVisibility=!1,a.display=s.visibility?me:sn),s.dirtyStampOrder&&(s.dirtyStampOrder=!1,a.zIndex=s.stampOrder)}Yo(e)}},_a=(t=100)=>{setTimeout(()=>{m.forEach(t=>{const e=y[t];fi.includes(e.type)&&e.recalculateFont()})},t)},qa=[],Ka=[],Qa=t=>{zr(qa,t),Ho(!0)},Ja=t=>{jr(qa,t),Ho(!0)},tl=()=>(Io&&el(),Ka),el=function(){Ho(!1);const t=Xo();let e,i,n,s;for(n=0,s=qa.length;n<s;n++)e=o[qa[n]],e&&(i=ht(e.order)||0,t[i]||(t[i]=Xo()),t[i].push(e.name));for(Ka.length=0,n=0,s=t.length;n<s;n++)e=t[n],e&&(Ka.push(...e),Yo(e));Yo(t)},il=["lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit"],nl=["filter","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","imageSmoothingQuality"],sl=["shadowBlur","shadowOffsetX","shadowOffsetY"],rl=["fillStyle","shadowColor","strokeStyle"],State=function(){return this.set(this.defs),this.lineDash=[],this},ol=State.prototype=Kr();ol.type="State",aa(ol),ol.defs={fillStyle:fe,strokeStyle:fe,globalAlpha:1,globalCompositeOperation:is,lineWidth:1,lineCap:"butt",lineJoin:"miter",lineDash:null,lineDashOffset:0,miterLimit:10,shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,shadowColor:fe,font:Ue,direction:Bi,fontKerning:rn,textRendering:le,letterSpacing:xn,wordSpacing:xn,fontStretch:rn,fontVariantCaps:rn,filter:sn,imageSmoothingEnabled:!0,imageSmoothingQuality:Di,textAlign:Ei,textBaseline:qs},ol.processPacketOut=function(t,e,i){let n=!0;if(t===Ii)e.length||(n=!!i.includes(Ii));else i.includes(t)||e!==this.defs[t]||(n=!1);return n},ol.finalizePacketOut=function(t){const e=t.fillStyle,i=t.strokeStyle;return e&&!e.substring&&(t.fillStyle=e.name),i&&!i.substring&&(t.strokeStyle=i.name),t};const al=ol.getters,ll=ol.setters;al.canvasFont=function(){return this.font},ll.canvasFont=function(t){this.font=t},ol.getChanges=function(t,e){let i,n,s,r,o,a,l,c,h;const u=this.defs,d={},f=function(t,e){return typeof t[e]!==rr?t[e]:u[e]};for(t.substring&&(t=y[t]),s=0,r=nl.length;s<r;s++)i=nl[s],c=f(this,i),h=f(e,i),h!==c&&(d[i]=c);for(s=0,r=sl.length;s<r;s++)i=sl[s],c=f(this,i),h=f(e,i),t.scaleShadow?(n=(c||0)*(t.scale||1),n!==h&&(d[i]=n)):c!==h&&(d[i]=c);if(this.lineWidth||e.lineWidth)for(s=0,r=il.length;s<r;s++)if(i=il[s],c=f(this,i),h=f(e,i),i===Ii){if(c.length||h.length)if(c.length!==h.length)d.lineDash=c;else{for(l=!1,o=0,a=c.length;o<a;o++)if(c[o]!==h[o]){l=!0;break}l&&(d.lineDash=c)}}else"lineWidth"===i?t.scaleOutline?(n=(c||1)*(t.scale||1),n!==h&&(d.lineWidth=n)):c!==h&&(d.lineWidth=c):h!==c&&(d[i]=c);for(s=0,r=rl.length;s<r;s++)i=rl[s],h=f(e,i),c=f(this,i),c.substring&&h!==c?d[i]=c:c.type===bs?(c=c.getData(),h!==c&&(d[i]=c)):d[i]=c;if(fi.includes(t.type))for(s=0,r=cs.length;s<r;s++)i=cs[s],c=f(this,i),h=f(e,i),h!==c&&(d[i]=c);return d},ol.setStateFromEngine=function(t){let e;for(let i=0,n=as.length;i<n;i++)e=as[i],this[e]=t[e];return this.lineDash=Vr(t.lineDash)?t.lineDash:[],this.lineDashOffset=Zr(t.lineDashOffset,0),t.textAlign=Ei,this.textAlign=Ei,t.textBaseline=qs,this.textBaseline=qs,this};const cl=function(t){return!!t&&new State};J.State=State;var hl=function(){var t=4022871197;return function(e){if(e){e=e.toString();for(var i=0;i<e.length;i++){var n=.02519603282416938*(t+=e.charCodeAt(i));n-=t=n>>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}t=4022871197}},ul=function(t){return function(){var e,i,n=48,s=1,r=n,o=new Array(n),a=0,l=new hl;for(e=0;e<n;e++)o[e]=l(Math.random());var c=function(){++r>=n&&(r=0);var t=1768863*o[r]+2.3283064365386963e-10*s;return o[r]=t-(s=0|t)},h=function(t){return Math.floor(t*(c()+11102230246251565e-32*(2097152*c()|0)))};h.string=function(t){var e,i="";for(e=0;e<t;e++)i+=String.fromCharCode(33+h(94));return i};return h.cleanString=function(t){return t=(t=(t=t.replace(/(^\s*)|(\s*$)/gi,"")).replace(/[\x00-\x1F]/gi,"")).replace(/\n /,"\n")},h.hashString=function(t){for(t=h.cleanString(t),l(t),e=0;e<t.length;e++)for(a=t.charCodeAt(e),i=0;i<n;i++)o[i]-=l(a),o[i]<0&&(o[i]+=1)},h.seed=function(t){var e,i,n,s;void 0!==t&&null!=t||(t=Math.random()),"string"!=typeof t&&(e=t,i=function(t,e){return"function"==typeof e?e.toString():e},t=JSON.stringify(e,function(t,e){var i=[],n=[];return null==e&&(e=function(t,e){return i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]"}),function(s,r){if(i.length>0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?n.splice(o,1/0,s):n.push(s),~i.indexOf(r)&&(r=e.call(this,s,r))}else i.push(r);return null==t?r:t.call(this,s,r)}}(i,s),n)),h.initState(),h.hashString(t)},h.addEntropy=function(){var t=[];for(e=0;e<arguments.length;e++)t.push(arguments[e]);!function(){var t=Array.prototype.slice.call(arguments);for(e=0;e<t.length;e++)for(i=0;i<n;i++)o[i]-=l(t[e]),o[i]<0&&(o[i]+=1)}(a+++(new Date).getTime()+t.join("")+Math.random())},h.initState=function(){for(l(),e=0;e<n;e++)o[e]=l(" ");s=1,r=n},h.done=function(){l=null},void 0!==t&&h.seed(t),h.range=function(t){return h(t)},h.random=function(){return h(Number.MAX_VALUE-1)/Number.MAX_VALUE},h.floatBetween=function(t,e){return h.random()*(e-t)+t},h.intBetween=function(t,e){return Math.floor(h.random()*(e-t+1))+t},h}()};const dl=function(t){return new ul(t)},fl={},pl={};let gl=1e3;const yl=t=>{ft(t)&&t>=200&&t<=1e4&&(gl=t)},ml=t=>{ft(t)&&t>=200&&t<=1e4&&(gl=t)},bl=t=>!!fl[t]&&(pl[t]=mt(),!0),Sl=t=>fl[t]?(pl[t]=mt(),fl[t]):null,Cl=(t,e)=>{fl[t]=e,pl[t]=mt()},Al=function(t,e=[]){const i=mt();return fl[t]?(pl[t]=i,fl[t]):(fl[t]=e,pl[t]=i,fl[t])};let wl=200,kl=0;const Dl=t=>{ft(t)&&t>=10&&t<=5e3&&(wl=t)};ca({name:"SC-core-workstore-hygiene",order:998,fn:()=>(()=>{const t=mt();if(kl<t-wl){const e=pt(fl),i=t-gl;for(let t,n=0,s=e.length;n<s;n++)t=e[n],pl[t]<i&&(delete fl[t],delete pl[t]);kl=t}})()});const Ol=document.createElement(ke);Ol.width=1,Ol.height=1;const Pl=Ol.getContext(Ht,{willReadFrequently:!0});Pl.globalAlpha=1,Pl.globalCompositeOperation=is;const vl=function(){return this},Fl=vl.prototype=Kr();Fl.type="ColorEngine",Fl.getMetricLinearGrayscaleValue=function(t,e,i){return 255*(.2126*vc(t)+.7152*vc(e)+.0722*vc(i))+.5|0},Fl.getDisplayLinearGrayscaleValue=function(t,e,i){const n=vc(t),s=vc(e),r=vc(i);return Fc(.2126*n+.7152*s+.0722*r)},Fl.getBestGray=Fl.getDisplayLinearGrayscaleValue,Fl.getBT709GrayscaleValue=function(t,e,i){return.2126*t+.7152*e+.0722*i+.5|0},Fl.getGray=Fl.getBT709GrayscaleValue,Fl.getBT601GrayscaleValue=function(t,e,i){return.299*t+.587*e+.114*i+.5|0},Fl.getRGBGrayscaleValue=function(t,e,i){return(t+e+i)/3+.5|0};const xl=",",Tl=/\s*,\s*/,Rl=[0,0,0,0],El="hsl",Il=/^(?:hsl|hsla)\s*\(\s*([^)]+)\s*\)$/,Hl="hwb",Ll=/^hwb\s*\(\s*([^)]+)\s*\)$/,Bl="lab",$l=/^lab\s*\(\s*([^)]+)\s*\)$/,Gl="lch",Ml=/^lch\s*\(\s*([^)]+)\s*\)$/,Xl=/[a-z%]+$/,Yl="none",Nl="oklab",Ul="oklch",zl="rgb",jl=/^(?:rgb|rgba)\s*\(\s*([^)]+)\s*\)$/,Vl="/",Wl=/\s+/g,Zl=/\s+/,_l="string",ql=/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}(?:[0-9a-f]{2})?)$/,Kl=/%$/,Ql=180/Math.PI,Jl="xyz",tc=[],ec=()=>{if(tc.length){const t=tc.pop();return t.ok=!1,t.value=0,t}return{ok:!1,value:0}},ic=(...t)=>{for(const e of t)tc.push(e)},nc=t=>{if(!(t=t.trim()))return NaN;if(Kl.test(t)){const e=parseFloat(t.slice(0,-1));return ft(e)?Dt(255*Hr(e,0,100)/100):NaN}{const e=parseFloat(t);return ft(e)?Dt(Hr(e,0,255)):NaN}},sc=t=>{if(!(t=t.trim()))return NaN;if(Kl.test(t)){const e=parseFloat(t.slice(0,-1));return ft(e)?Hr(e/100,0,1):NaN}{const e=parseFloat(t);return ft(e)?Hr(e,0,1):NaN}},rc=t=>{if(!(t=t.trim().toLowerCase()))return NaN;if(t===Yl)return 0;const e=t.match(Xl),i=e?e[0]:mr,n=parseFloat(t);if(!ft(n))return NaN;let s;switch(i){case mr:case"deg":s=n;break;case"rad":s=n*Ql;break;case"grad":s=.9*n;break;case"turn":s=360*n;break;default:return NaN}return s=(s%360+360)%360,s},oc=t=>{const e=ec();if(!(t=t.trim().toLowerCase()))return e;if(t===Yl)return e.ok=!0,e;const i=Kl.test(t),n=parseFloat(i?t.slice(0,-1):t);if(!ft(n))return e;const s=Hr(n,0,100);return e.ok=!0,e.value=s,e},ac=t=>{const e=ec();if(!(t=t.trim().toLowerCase()))return e;if(t===Yl)return e.ok=!0,e;t.endsWith("%")&&(t=t.slice(0,-1));const i=parseFloat(t);return ft(i)?(e.ok=!0,e.value=i,e):e},lc=t=>{if(typeof t!==_l)return Rl;const e=t.trim().toLowerCase();if(e.includes(xl))return Rl;const i=e.match(/^oklch\s*\(\s*([^)]+)\s*\)$/);if(!i)return Rl;const n=i[1].trim().split(Vl);let s,r=1;if(1!==n.length&&2!==n.length)return Rl;if(s=n[0].trim().split(Zl).filter(Boolean),3!==s.length)return Rl;if(2===n.length){const t=n[1].trim();if(!t)return Rl;if(r=sc(t),!ft(r))return Rl}const o=s[0].endsWith("%"),a=o?oc(s[0]):ac(s[0]),l=(t=>{const e=ec();if(!(t=t.trim().toLowerCase()))return e;if(t===Yl)return e.ok=!0,e;const i=t.endsWith("%");i&&(t=t.slice(0,-1));const n=parseFloat(t);if(!ft(n))return e;const s=i?n/100*.4:n;return e.ok=!0,e.value=Hr(s,0,.4),e})(s[1]),c=rc(s[2]);if(!a.ok||!l.ok||!ft(c))return ic(a,l),Rl;const h=a.value*(o?.01:1),u=Hr(h,0,1),d=l.value;return ic(a,l),ft(u)&&ft(d)&&ft(c)?[u,d,c,r]:Rl},cc="rgb-and-ok-space-color-values-cache",hc=t=>{const e=t.trim(),i=(bl(cc)||Cl(cc,new Map),Sl(cc)),n=i.get(e);if(n)return n;const s=Pl.fillStyle;Pl.fillStyle="#010203";const r=Pl.fillStyle;Pl.fillStyle=e;if(Pl.fillStyle===r&&e!==r){const t=[...Rl];return i.set(e,t),Pl.fillStyle=s,t}Pl.clearRect(0,0,1,1),Pl.fillRect(0,0,1,1);const o=Pl.getImageData(0,0,1,1).data,a=[o[0],o[1],o[2],o[3]/255];return i.set(e,a),Pl.fillStyle=s,a},uc=Fl.getColorValuesFromString=function(t){if(typeof t!==_l)return[zl,0,0,0,0];const e=t.trim().toLowerCase();if(!e)return[zl,0,0,0,0];if(e.includes("color-mix(")||e.includes("color(from"))return[zl,0,0,0,0];const i=(t,e)=>[t,e[0],e[1],e[2],e[3]];if(e.includes("#")){const e=(t=>{if(typeof t!==_l)return Rl;const e=t.trim().toLowerCase().replace(Wl,mr);if(!ql.test(e))return Rl;let i=e.slice(1);3!==i.length&&4!==i.length||(i=i.split(mr).map(t=>t+t).join(mr));const n=parseInt(i.slice(0,2),16),s=parseInt(i.slice(2,4),16),r=parseInt(i.slice(4,6),16),o=8===i.length?parseInt(i.slice(6,8),16)/255:1;return ft(n)&&ft(s)&&ft(r)&&ft(o)?[n,s,r,o]:Rl})(t);return i(zl,e)}if(e.includes("oklch(")){const e=lc(t);return i(Ul,e)}if(e.includes("oklab(")){const e=(t=>{if(typeof t!==_l)return Rl;const e=t.trim().toLowerCase();if(e.includes(xl))return Rl;const i=e.match(/^oklab\s*\(\s*([^)]+)\s*\)$/);if(!i)return Rl;let n,s=1;const r=i[1].trim().split(Vl);if(1===r.length){if(n=r[0].trim().split(Zl).filter(Boolean),3!==n.length)return Rl}else{if(2!==r.length)return Rl;{const t=r[0].trim(),e=r[1].trim();if(n=t.split(Zl).filter(Boolean),3!==n.length||!e)return Rl;if(s=sc(e),!ft(s))return Rl}}const o=n[0].endsWith("%"),a=n[1].endsWith("%"),l=n[2].endsWith("%"),c=o?oc(n[0]):ac(n[0]),h=ac(n[1]),u=ac(n[2]);if(!c.ok||!h.ok||!u.ok)return ic(c,h,u),Rl;let d=c.value;o&&(d*=.01);let f=h.value;a&&(f*=.004);let p=u.value;l&&(p*=.004);const g=Hr(d,0,1),y=Hr(f,-.4,.4),m=Hr(p,-.4,.4);return ic(c,h,u),ft(g)&&ft(y)&&ft(m)?[g,y,m,s]:Rl})(t);return i(Nl,e)}if(e.includes("lch(")){const e=(t=>{if(typeof t!==_l)return Rl;const e=t.trim().toLowerCase();if(e.includes(xl))return Rl;const i=e.match(Ml);if(!i)return Rl;let n,s=1;const r=i[1].trim().split(Vl);if(1!==r.length&&2!==r.length)return Rl;if(n=r[0].trim().split(Zl).filter(Boolean),3!==n.length)return Rl;if(2===r.length){const t=r[1].trim();if(!t)return Rl;if(s=sc(t),!ft(s))return Rl}const o=oc(n[0]),a=ac(n[1]),l=rc(n[2]);if(!o.ok||!a.ok||!ft(l))return ic(o,a),Rl;const c=Hr(o.value,0,100),h=Hr(a.value,0,150),u=l;return ic(o,a),ft(c)&&ft(h)&&ft(u)?[c,h,u,s]:Rl})(t);return i(Gl,e)}if(e.includes("lab(")){const e=(t=>{if(typeof t!==_l)return Rl;const e=t.trim().toLowerCase();if(e.includes(xl))return Rl;const i=e.match($l);if(!i)return Rl;let n,s=1;const r=i[1].trim().split(Vl);if(1===r.length){if(n=r[0].trim().split(Zl).filter(Boolean),3!==n.length)return Rl}else{if(2!==r.length)return Rl;{const t=r[0].trim(),e=r[1].trim();if(n=t.split(Zl).filter(Boolean),3!==n.length||!e)return Rl;if(s=sc(e),!ft(s))return Rl}}const o=oc(n[0]),a=ac(n[1]),l=ac(n[2]);if(!o.ok||!a.ok||!l.ok)return ic(o,a,l),Rl;const c=Hr(o.value,0,100),h=Hr(a.value,-125,125),u=Hr(l.value,-125,125);return ic(o,a,l),ft(c)&&ft(h)&&ft(u)?[c,h,u,s]:Rl})(t);return i(Bl,e)}if(e.includes("rgb(")||e.includes("rgba(")){const e=(t=>{if(typeof t!==_l)return Rl;const e=t.trim().toLowerCase().match(jl);if(!e)return Rl;const i=e[1].trim();let n,s=1;if(i.includes(xl)){if(n=i.split(Tl),3!==n.length&&4!==n.length)return Rl;4===n.length&&(s=sc(n[3]))}else{const t=i.split(Vl);if(1===t.length){if(n=t[0].trim().split(Zl).filter(Boolean),3!==n.length)return Rl}else{if(2!==t.length)return Rl;{const e=t[0].trim(),i=t[1].trim();if(n=e.split(Zl).filter(Boolean),3!==n.length||!i)return Rl;s=sc(i)}}}const r=nc(n[0]),o=nc(n[1]),a=nc(n[2]);return ft(r)&&ft(o)&&ft(a)&&ft(s)?[r,o,a,s]:Rl})(t);return i(zl,e)}if(e.includes("hsl(")||e.includes("hsla(")){const e=(t=>{if(!t.substring)return Rl;const e=t.trim().toLowerCase().match(Il);if(!e)return Rl;const i=e[1].trim();let n,s=1;if(i.includes(xl)){if(n=i.split(Tl),3!==n.length&&4!==n.length)return Rl;if(4===n.length&&(s=sc(n[3]),!ft(s)))return Rl}else{const t=i.split(Vl);if(1===t.length){if(n=t[0].trim().split(Zl).filter(Boolean),3!==n.length)return Rl}else{if(2!==t.length)return Rl;{const e=t[0].trim(),i=t[1].trim();if(n=e.split(Zl).filter(Boolean),3!==n.length||!i)return Rl;if(s=sc(i),!ft(s))return Rl}}}const r=rc(n[0]),o=oc(n[1]),a=oc(n[2]);if(!o.ok||!a.ok||!ft(r))return ic(o,a),Rl;const l=o.value,c=a.value;return ic(o,a),[r,l,c,s]})(t);return i(El,e)}if(e.includes("hwb(")){const e=(t=>{if(typeof t!==_l)return Rl;const e=t.trim().toLowerCase();if(e.includes(xl))return Rl;const i=e.match(Ll);if(!i)return Rl;let n,s=1;const r=i[1].trim().split(Vl);if(1===r.length){if(n=r[0].trim().split(Zl).filter(Boolean),3!==n.length)return Rl}else{if(2!==r.length)return Rl;{const t=r[0].trim(),e=r[1].trim();if(n=t.split(Zl).filter(Boolean),3!==n.length||!e)return Rl;if(s=sc(e),!ft(s))return Rl}}const o=rc(n[0]),a=oc(n[1]),l=oc(n[2]);if(!ft(o)||!a.ok||!l.ok)return ic(a,l),Rl;const c=a.value,h=l.value;return ic(a,l),[o,c,h,s]})(t);return i(Hl,e)}if(e.includes("color(")){const e=hc(t);return i(zl,e)}const n=hc(t);return i(zl,n)};Fl.extractRGBfromColorString=function(t){const e=uc(t);if(e[0]===zl)return[e[1],e[2],e[3]];const i=Vc(e,zl);return[i[1],i[2],i[3]]},Fl.buildColorStringFromData=function(t){if(null==t||!dt(t)||5!==t.length)return ge;const[e,i,n,s,r]=t;if(typeof e!==_l||!ft(i)||!ft(n)||!ft(s))return ge;let o,a,l,c,h,u,d,f,p,g=ft(r)?r:1;switch(g=g>1?1:g<0?0:g,e){case zl:return o=Ir(Dt(Hr(i,0,255))),a=Ir(Dt(Hr(n,0,255))),l=Ir(Dt(Hr(s,0,255))),`rgb(${o} ${a} ${l} / ${g})`;case El:return c=kr(i),h=Hr(n,0,100),u=Hr(s,0,100),`hsl(${c} ${h}% ${u}% / ${g})`;case Hl:return c=kr(i),d=Hr(n,0,100),l=Hr(s,0,100),`hwb(${c} ${d}% ${l}% / ${g})`;case Bl:return u=Hr(i,0,100),f=Hr(n,-125,125),l=Hr(s,-125,125),`lab(${u}% ${f} ${l} / ${g})`;case Gl:return u=Hr(i,0,100),p=Hr(n,0,230),c=kr(s),`lch(${u}% ${p} ${c} / ${g})`;case Nl:return u=Hr(i,0,1),f=Hr(n,-.4,.4),l=Hr(s,-.4,.4),`oklab(${u} ${f} ${l} / ${g})`;case Ul:return u=Hr(i,0,1),p=Hr(n,0,.4),c=kr(s),`oklch(${u} ${p} ${c} / ${g})`;case Jl:{const[t,e,r]=Bc(i,n,s);return u=Hr(t,0,100),f=Hr(e,-125,125),l=Hr(r,-125,125),`lab(${u}% ${f} ${l} / ${g})`}default:return ge}},Fl.convertRGBtoHex=function(t,e,i){return"#"+[t=gt(0,Dt(yt(255,ft(t)?t:0))),e=gt(0,Dt(yt(255,ft(e)?e:0))),i=gt(0,Dt(yt(255,ft(i)?i:0)))].map(t=>t.toString(16).padStart(2,"0")).join(mr)};const dc=.4,fc=-.4,pc="rgb-and-ok-spaces-color-values-cache",gc=Fl.getRgbOkCache=function(){return bl(pc)||Cl(pc,{labColorLib:new Map,lchColorLib:new Map,rgbColorLib:new Map}),Sl(pc)};Fl.getOkValsForRgb=function(t,e,i,n){null==n&&(n=gc());const s=bc(t,e,i),r=n.rgbColorLib.get(s);if(void 0!==r)return r;const o=Xc(t,e,i),a=zc(o[0],o[1],o[2]),l=[o[0],o[1],o[2],a[1],a[2]];return n.rgbColorLib.set(s,l),n.labColorLib.set(yc(o[0],o[1],o[2]),[t,e,i]),n.lchColorLib.set(mc(a[0],a[1],a[2]),[t,e,i]),l},Fl.getRgbValsForOklch=function(t,e,i,n){null==n&&(n=gc());const s=mc(t,e,i),r=n.lchColorLib.get(s);if(void 0!==r)return r;const o=jc(t,e,i),a=Yc(o[0],o[1],o[2]);return n.lchColorLib.set(s,a),n.labColorLib.set(yc(o[0],o[1],o[2]),a),a},Fl.getRgbValsForOklab=function(t,e,i,n){null==n&&(n=gc());const s=yc(t,e,i),r=n.labColorLib.get(s);if(void 0!==r)return r;const o=Yc(t,e,i);n.labColorLib.set(s,o);const a=zc(t,e,i);return n.lchColorLib.set(mc(a[0],a[1],a[2]),o),o};const yc=function(t,e,i){const n=Sc(t);e<fc?e=fc:e>dc&&(e=dc),i<fc?i=fc:i>dc&&(i=dc);return 251001*n+501*ht(625*(e+.4))+ht(625*(i+.4))},mc=function(t,e,i){e<0?e=0:e>.8&&(e=.8);return 108540*Sc(t)+540*ht(250*e)+ht(1.5*i)},bc=function(t,e,i){return t<<16|e<<8|i},Sc=function(t){return t<0?t=0:t>1&&(t=1),ht(t<.4?250*t:t<.9?100+600*(t-.4):400+1e3*(t-.9))},Cc=216/24389,Ac=24389/27,wc=Math.cbrt,kc=null!=wc?wc:t=>At(t,1/3),Dc=[.3457/.3585,1,.2958/.3585],Oc=new Float32Array(256);for(let t,e=0;e<256;e++)t=e/255,Oc[e]=t<=.04045?t/12.92:At((t+.055)/1.055,2.4);const Pc=new Uint8ClampedArray(4097);for(let t,e,i=0;i<=4096;i++)t=i/4096,e=t<=.0031308?12.92*t:1.055*At(t,1/2.4)-.055,Pc[i]=255*e+.5|0;const vc=t=>Oc[255&t],Fc=t=>{let e=4096*t+.5|0;return e<0?e=0:e>4096&&(e=4096),Pc[e]},xc=function(t,e,i){const n=gt(t/=255,e/=255,i/=255),s=yt(t,e,i),r=(s+n)/2,o=n-s;let a=0,l=0;if(0!==o){switch(l=0===r||1===r?0:(n-r)/yt(r,1-r),n){case t:a=(e-i)/o+(e<i?6:0);break;case e:a=(i-t)/o+2;break;case i:a=(t-e)/o+4}a*=60}return[a,100*l,100*r]},Tc=function(t,e,i){t=kr(t),e/=100,i/=100;const n=function(n){const s=(n+t/30)%12,r=e*yt(i,1-i);return i-r*gt(-1,yt(s-3,9-s,1))};return[Ir(Dt(255*n(0))),Ir(Dt(255*n(8))),Ir(Dt(255*n(4)))]},Rc=function(t,e,i){const n=xc(t,e,i),s=yt(t/=255,e/=255,i/=255),r=1-gt(t,e,i);return[n[0],100*s,100*r]},Ec=function(t,e,i){if((e/=100)+(i/=100)>=1){const t=Ir(Dt(255*(e/(e+i))));return[t,t,t]}const n=Tc(t,100,50);for(let t=0;t<3;t++){let s=n[t]/255;s=s*(1-e-i)+e,n[t]=Ir(Dt(255*s))}return n},Ic=function(t,e,i){const n=vc(t),s=vc(e),r=vc(i);return[.4123907992659593*n+.357584339383878*s+.1804807884018343*r,.2126390058715104*n+.715168678767756*s+.0721923153607337*r,.0193308187155919*n+.1191947797946259*s+.9505321522496606*r]},Hc=function(t,e,i){const n=-.9692436362808798*t+1.8759675015077206*e+.04155505740717561*i,s=.05563007969699361*t+-.20397695888897657*e+1.0569715142428786*i;return[Fc(3.2409699419045213*t+-1.5373831775700935*e+-.4986107602930033*i),Fc(n),Fc(s)]},Lc=180/Math.PI,Bc=function(t,e,i){const n=(1.0479298208405488*t+.022946793341019088*e-.05019222954313557*i)/Dc[0],s=(.029627815688159344*t+.990434484573249*e-.01707382502938514*i)/Dc[1],r=(-.009243058152591178*t+.015055144896577895*e+.7518742899580008*i)/Dc[2],o=n>Cc?kc(n):(Ac*n+16)/116,a=s>Cc?kc(s):(Ac*s+16)/116;return[116*a-16,500*(o-a),200*(a