UNPKG

@zoom/videosdk

Version:
2 lines 308 kB
/*! For license information please see annoter.min.js.LICENSE.txt */ "use strict";(self.webpackChunkJsMediaSDK_Instance=self.webpackChunkJsMediaSDK_Instance||[]).push([[208],{1822:(t,e,s)=>{s.r(e),s.d(e,{AnnotationMgr:()=>Oa});var i=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,l=(t,e,s)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,c=(t,e)=>{for(var s in e||(e={}))a.call(e,s)&&l(t,s,e[s]);if(o)for(var s of o(e))h.call(e,s)&&l(t,s,e[s]);return t},d=(t,e)=>n(t,r(e)),u=(t,e)=>{var s={};for(var i in t)a.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&o)for(var i of o(t))e.indexOf(i)<0&&h.call(t,i)&&(s[i]=t[i]);return s},p=(t,e,s)=>l(t,"symbol"!=typeof e?e+"":e,s);const g=Symbol.for("@ts-pattern/matcher"),f=Symbol.for("@ts-pattern/isVariadic"),_="@ts-pattern/anonymous-select-key",O=t=>!(!t||"object"!=typeof t),m=t=>t&&!!t[g],v=(t,e,s)=>{if(m(t)){const i=t[g](),{matched:n,selections:r}=i.match(e);return n&&r&&Object.keys(r).forEach((t=>s(t,r[t]))),n}if(O(t)){if(!O(e))return!1;if(Array.isArray(t)){if(!Array.isArray(e))return!1;let i=[],n=[],r=[];for(const e of t.keys()){const s=t[e];m(s)&&s[f]?r.push(s):r.length?n.push(s):i.push(s)}if(r.length){if(r.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(e.length<i.length+n.length)return!1;const t=e.slice(0,i.length),o=0===n.length?[]:e.slice(-n.length),a=e.slice(i.length,0===n.length?1/0:-n.length);return i.every(((e,i)=>v(e,t[i],s)))&&n.every(((t,e)=>v(t,o[e],s)))&&(0===r.length||v(r[0],a,s))}return t.length===e.length&&t.every(((t,i)=>v(t,e[i],s)))}return Reflect.ownKeys(t).every((i=>{const n=t[i];return(i in e||m(r=n)&&"optional"===r[g]().matcherType)&&v(n,e[i],s);var r}))}return Object.is(e,t)},b=t=>{var e,s,i;return O(t)?m(t)?null!=(e=null==(s=(i=t[g]()).getSelectionKeys)?void 0:s.call(i))?e:[]:Array.isArray(t)?y(t,b):y(Object.values(t),b):[]},y=(t,e)=>t.reduce(((t,s)=>t.concat(e(s))),[]);function A(t){return Object.assign(t,{optional:()=>S(t),and:e=>x(t,e),or:e=>k(t,e),select:e=>void 0===e?C(t):C(e,t)})}function T(t){return Object.assign((e=t,Object.assign(e,{[Symbol.iterator](){let t=0;const s=[{value:Object.assign(e,{[f]:!0}),done:!1},{done:!0,value:void 0}];return{next:()=>{var e;return null!=(e=s[t++])?e:s.at(-1)}}}})),{optional:()=>T(S(t)),select:e=>T(void 0===e?C(t):C(e,t))});var e}function S(t){return A({[g]:()=>({match:e=>{let s={};const i=(t,e)=>{s[t]=e};return void 0===e?(b(t).forEach((t=>i(t,void 0))),{matched:!0,selections:s}):{matched:v(t,e,i),selections:s}},getSelectionKeys:()=>b(t),matcherType:"optional"})})}const w=(t,e)=>{for(const s of t)if(!e(s))return!1;return!0},I=(t,e)=>{for(const[s,i]of t.entries())if(!e(i,s))return!1;return!0};function x(...t){return A({[g]:()=>({match:e=>{let s={};const i=(t,e)=>{s[t]=e};return{matched:t.every((t=>v(t,e,i))),selections:s}},getSelectionKeys:()=>y(t,b),matcherType:"and"})})}function k(...t){return A({[g]:()=>({match:e=>{let s={};const i=(t,e)=>{s[t]=e};return y(t,b).forEach((t=>i(t,void 0))),{matched:t.some((t=>v(t,e,i))),selections:s}},getSelectionKeys:()=>y(t,b),matcherType:"or"})})}function E(t){return{[g]:()=>({match:e=>({matched:!!t(e)})})}}function C(...t){const e="string"==typeof t[0]?t[0]:void 0,s=2===t.length?t[1]:"string"==typeof t[0]?void 0:t[0];return A({[g]:()=>({match:t=>{let i={[null!=e?e:_]:t};return{matched:void 0===s||v(s,t,((t,e)=>{i[t]=e})),selections:i}},getSelectionKeys:()=>[null!=e?e:_].concat(void 0===s?[]:b(s))})})}function P(t){return"number"==typeof t}function N(t){return"string"==typeof t}function L(t){return"bigint"==typeof t}const R=A(E((function(t){return!0}))),j=R,D=t=>Object.assign(A(t),{startsWith:e=>{return D(x(t,(s=e,E((t=>N(t)&&t.startsWith(s))))));var s},endsWith:e=>{return D(x(t,(s=e,E((t=>N(t)&&t.endsWith(s))))));var s},minLength:e=>{return D(x(t,(s=e,E((t=>N(t)&&t.length>=s)))));var s},length:e=>{return D(x(t,(s=e,E((t=>N(t)&&t.length===s)))));var s},maxLength:e=>{return D(x(t,(s=e,E((t=>N(t)&&t.length<=s)))));var s},includes:e=>{return D(x(t,(s=e,E((t=>N(t)&&t.includes(s))))));var s},regex:e=>{return D(x(t,(s=e,E((t=>N(t)&&!!t.match(s))))));var s}}),F=D(E(N)),M=t=>Object.assign(A(t),{between:(e,s)=>{return M(x(t,(i=e,n=s,E((t=>P(t)&&i<=t&&n>=t)))));var i,n},lt:e=>{return M(x(t,(s=e,E((t=>P(t)&&t<s)))));var s},gt:e=>{return M(x(t,(s=e,E((t=>P(t)&&t>s)))));var s},lte:e=>{return M(x(t,(s=e,E((t=>P(t)&&t<=s)))));var s},gte:e=>{return M(x(t,(s=e,E((t=>P(t)&&t>=s)))));var s},int:()=>M(x(t,E((t=>P(t)&&Number.isInteger(t))))),finite:()=>M(x(t,E((t=>P(t)&&Number.isFinite(t))))),positive:()=>M(x(t,E((t=>P(t)&&t>0)))),negative:()=>M(x(t,E((t=>P(t)&&t<0))))}),B=M(E(P)),Y=t=>Object.assign(A(t),{between:(e,s)=>{return Y(x(t,(i=e,n=s,E((t=>L(t)&&i<=t&&n>=t)))));var i,n},lt:e=>{return Y(x(t,(s=e,E((t=>L(t)&&t<s)))));var s},gt:e=>{return Y(x(t,(s=e,E((t=>L(t)&&t>s)))));var s},lte:e=>{return Y(x(t,(s=e,E((t=>L(t)&&t<=s)))));var s},gte:e=>{return Y(x(t,(s=e,E((t=>L(t)&&t>=s)))));var s},positive:()=>Y(x(t,E((t=>L(t)&&t>0)))),negative:()=>Y(x(t,E((t=>L(t)&&t<0))))}),H=Y(E(L)),W=A(E((function(t){return"boolean"==typeof t}))),z=A(E((function(t){return"symbol"==typeof t}))),U=A(E((function(t){return null==t}))),X=A(E((function(t){return null!=t})));var G={__proto__:null,matcher:g,optional:S,array:function(...t){return T({[g]:()=>({match:e=>{if(!Array.isArray(e))return{matched:!1};if(0===t.length)return{matched:!0};const s=t[0];let i={};if(0===e.length)return b(s).forEach((t=>{i[t]=[]})),{matched:!0,selections:i};const n=(t,e)=>{i[t]=(i[t]||[]).concat([e])};return{matched:e.every((t=>v(s,t,n))),selections:i}},getSelectionKeys:()=>0===t.length?[]:b(t[0])})})},set:function(...t){return A({[g]:()=>({match:e=>{if(!(e instanceof Set))return{matched:!1};let s={};if(0===e.size)return{matched:!0,selections:s};if(0===t.length)return{matched:!0};const i=(t,e)=>{s[t]=(s[t]||[]).concat([e])},n=t[0];return{matched:w(e,(t=>v(n,t,i))),selections:s}},getSelectionKeys:()=>0===t.length?[]:b(t[0])})})},map:function(...t){return A({[g]:()=>({match:e=>{if(!(e instanceof Map))return{matched:!1};let s={};if(0===e.size)return{matched:!0,selections:s};const i=(t,e)=>{s[t]=(s[t]||[]).concat([e])};if(0===t.length)return{matched:!0};var n;if(1===t.length)throw new Error("`P.map` wasn't given enough arguments. Expected (key, value), received ".concat(null==(n=t[0])?void 0:n.toString()));const[r,o]=t;return{matched:I(e,((t,e)=>{const s=v(r,e,i),n=v(o,t,i);return s&&n})),selections:s}},getSelectionKeys:()=>0===t.length?[]:[...b(t[0]),...b(t[1])]})})},intersection:x,union:k,not:function(t){return A({[g]:()=>({match:e=>({matched:!v(t,e,(()=>{}))}),getSelectionKeys:()=>[],matcherType:"not"})})},when:E,select:C,any:R,_:j,string:F,number:B,bigint:H,boolean:W,symbol:z,nullish:U,nonNullable:X,instanceOf:function(t){return A(E(function(t){return e=>e instanceof t}(t)))},shape:function(t){return A(E(function(...t){if(1===t.length){const[e]=t;return t=>v(e,t,(()=>{}))}if(2===t.length){const[e,s]=t;return v(e,s,(()=>{}))}throw new Error("isMatching wasn't given the right number of arguments: expected 1 or 2, received ".concat(t.length,"."))}(t)))}};class V extends Error{constructor(t){let e;try{e=JSON.stringify(t)}catch(s){e=t}super("Pattern matching error: no pattern matches value ".concat(e)),this.input=void 0,this.input=t}}const q={matched:!1,value:void 0};function J(t){return new K(t,q)}class K{constructor(t,e){this.input=void 0,this.state=void 0,this.input=t,this.state=e}with(...t){if(this.state.matched)return this;const e=t[t.length-1],s=[t[0]];let i;3===t.length&&"function"==typeof t[1]?i=t[1]:t.length>2&&s.push(...t.slice(1,t.length-1));let n=!1,r={};const o=(t,e)=>{n=!0,r[t]=e},a=!s.some((t=>v(t,this.input,o)))||i&&!i(this.input)?q:{matched:!0,value:e(n?_ in r?r[_]:r:this.input,this.input)};return new K(this.input,a)}when(t,e){if(this.state.matched)return this;const s=!!t(this.input);return new K(this.input,s?{matched:!0,value:e(this.input,this.input)}:q)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new V(this.input)}run(){return this.exhaustive()}returnType(){return this}}var Z=(t=>(t[t.ANNO_TOOL_TYPE_NONE=0]="ANNO_TOOL_TYPE_NONE",t[t.ANNO_TOOL_TYPE_PEN=1]="ANNO_TOOL_TYPE_PEN",t[t.ANNO_TOOL_TYPE_HIGHLIGHTER=2]="ANNO_TOOL_TYPE_HIGHLIGHTER",t[t.ANNO_TOOL_TYPE_SPOTLIGHT=3]="ANNO_TOOL_TYPE_SPOTLIGHT",t[t.ANNO_TOOL_TYPE_ARROW=4]="ANNO_TOOL_TYPE_ARROW",t[t.ANNO_TOOL_TYPE_TEXTBOX=5]="ANNO_TOOL_TYPE_TEXTBOX",t[t.ANNO_TOOL_TYPE_PICTURE=6]="ANNO_TOOL_TYPE_PICTURE",t[t.ANNO_TOOL_TYPE_ERASER=7]="ANNO_TOOL_TYPE_ERASER",t[t.ANNO_TOOL_TYPE_BRUSH_ERASER=8]="ANNO_TOOL_TYPE_BRUSH_ERASER",t[t.ANNO_TOOL_TYPE_PICKER=9]="ANNO_TOOL_TYPE_PICKER",t[t.ANNO_TOOL_TYPE_SELECTOR=10]="ANNO_TOOL_TYPE_SELECTOR",t[t.ANNO_TOOL_TYPE_AUTO_LINE=11]="ANNO_TOOL_TYPE_AUTO_LINE",t[t.ANNO_TOOL_TYPE_AUTO_ARROW1=12]="ANNO_TOOL_TYPE_AUTO_ARROW1",t[t.ANNO_TOOL_TYPE_AUTO_ARROW2=13]="ANNO_TOOL_TYPE_AUTO_ARROW2",t[t.ANNO_TOOL_TYPE_AUTO_RECTANGLE=14]="ANNO_TOOL_TYPE_AUTO_RECTANGLE",t[t.ANNO_TOOL_TYPE_AUTO_RECTANGLE_SEMI_FILL=15]="ANNO_TOOL_TYPE_AUTO_RECTANGLE_SEMI_FILL",t[t.ANNO_TOOL_TYPE_AUTO_ROUNDEDRECTANGLE=16]="ANNO_TOOL_TYPE_AUTO_ROUNDEDRECTANGLE",t[t.ANNO_TOOL_TYPE_AUTO_ROUNDEDRECTANGLE_SEMI_FILL=17]="ANNO_TOOL_TYPE_AUTO_ROUNDEDRECTANGLE_SEMI_FILL",t[t.ANNO_TOOL_TYPE_AUTO_ELLIPSE=18]="ANNO_TOOL_TYPE_AUTO_ELLIPSE",t[t.ANNO_TOOL_TYPE_AUTO_ELLIPSE_SEMI_FILL=19]="ANNO_TOOL_TYPE_AUTO_ELLIPSE_SEMI_FILL",t[t.ANNO_TOOL_TYPE_AUTO_DOUBLE_ARROW=20]="ANNO_TOOL_TYPE_AUTO_DOUBLE_ARROW",t[t.ANNO_TOOL_TYPE_AUTO_RECTANGLE_FILL=21]="ANNO_TOOL_TYPE_AUTO_RECTANGLE_FILL",t[t.ANNO_TOOL_TYPE_AUTO_ROUNDEDRECTANGLE_FILL=22]="ANNO_TOOL_TYPE_AUTO_ROUNDEDRECTANGLE_FILL",t[t.ANNO_TOOL_TYPE_AUTO_ELLIPSE_FILL=23]="ANNO_TOOL_TYPE_AUTO_ELLIPSE_FILL",t[t.ANNO_TOOL_TYPE_AUTO_DIAMOND=24]="ANNO_TOOL_TYPE_AUTO_DIAMOND",t[t.ANNO_TOOL_TYPE_AUTO_STAMP_ARROW=25]="ANNO_TOOL_TYPE_AUTO_STAMP_ARROW",t[t.ANNO_TOOL_TYPE_AUTO_STAMP_CHECK=26]="ANNO_TOOL_TYPE_AUTO_STAMP_CHECK",t[t.ANNO_TOOL_TYPE_AUTO_STAMP_X=27]="ANNO_TOOL_TYPE_AUTO_STAMP_X",t[t.ANNO_TOOL_TYPE_MULTI_FLAT_PEN=28]="ANNO_TOOL_TYPE_MULTI_FLAT_PEN",t[t.ANNO_TOOL_TYPE_MULTI_FLAT_ERASER=29]="ANNO_TOOL_TYPE_MULTI_FLAT_ERASER",t[t.ANNO_TOOL_TYPE_MULTI_THICKNESS_PEN=30]="ANNO_TOOL_TYPE_MULTI_THICKNESS_PEN",t[t.ANNO_TOOL_TYPE_AUTO_STAMP_STAR=31]="ANNO_TOOL_TYPE_AUTO_STAMP_STAR",t[t.ANNO_TOOL_TYPE_AUTO_STAMP_HEART=32]="ANNO_TOOL_TYPE_AUTO_STAMP_HEART",t[t.ANNO_TOOL_TYPE_AUTO_STAMP_QM=33]="ANNO_TOOL_TYPE_AUTO_STAMP_QM",t[t.ANNO_TOOL_TYPE_MULTI_SHAPE_DETECTOR=34]="ANNO_TOOL_TYPE_MULTI_SHAPE_DETECTOR",t[t.ANNO_TOOL_TYPE_MULTI_TEXT_DETECTOR=35]="ANNO_TOOL_TYPE_MULTI_TEXT_DETECTOR",t[t.ANNO_TOOL_TYPE_FADE_PEN=36]="ANNO_TOOL_TYPE_FADE_PEN",t[t.ANNO_TOOL_TYPE_AUTO_DIAMOND_SEMI_FILL=37]="ANNO_TOOL_TYPE_AUTO_DIAMOND_SEMI_FILL",t[t.ANNO_TOOL_TYPE_AUTO_DIAMOND_FILL=38]="ANNO_TOOL_TYPE_AUTO_DIAMOND_FILL",t))(Z||{});const Q=[1,2,36],$=[11,12,20],tt=[14,15,21,24,37,38,18,19,23],et=[26,25,32,33,31,27];function st(t,e){var s=t.charCodeAt(e);if(isNaN(s))return"";if(s<55296||s>57343)return t.charAt(e);if(55296<=s&&s<=56319){if(t.length<=e+1)throw"High surrogate without following low surrogate";var i=t.charCodeAt(e+1);if(56320>i||i>57343)throw"High surrogate without following low surrogate";return t.charAt(e)+t.charAt(e+1)}if(0===e)throw"Low surrogate without preceding high surrogate";var n=t.charCodeAt(e-1);if(55296>n||n>56319)throw"Low surrogate without preceding high surrogate";return!1}const it={camelize:function(t){return t.replace(/-+(.)?/g,(function(t,e){return e?e.toUpperCase():""}))},capitalize:function(t,e){return t.charAt(0).toUpperCase()+(e?t.slice(1):t.slice(1).toLowerCase())},escapeXml:function(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},graphemeSplit:function(t){var e,s=0,i=[];for(s=0;s<t.length;s++)!1!==(e=st(t,s))&&i.push(e);return i}};var nt=(t=>(t.Group="Group",t.Image="Image",t.ActiveSelection="ActiveSelection",t.Gradient="Gradient",t))(nt||{});const rt=new class{constructor(){p(this,"shapeMap",new Map),p(this,"parserMap",new Map)}add(t,e){this.shapeMap.set(t,e)}has(t){return this.shapeMap.has(t)}get(t){return this.shapeMap.get(t)}getByObjType(t){const e=it.camelize(t.charAt(0).toUpperCase()+t.slice(1));return this.shapeMap.get(e)}addSVGParser(t,e){this.parserMap.set(t,e)}hasSVGParser(t){return this.parserMap.has(t)}getSVGParser(t){return this.parserMap.get(t)}};var ot=Array.prototype.slice;function at(t,e,s){if(t&&0!==t.length){var i=t.length-1,n=e?t[i][e]:t[i];if(e)for(;i--;)s(t[i][e],n)&&(n=t[i][e]);else for(;i--;)s(t[i],n)&&(n=t[i]);return n}}const ht={fill:function(t,e){for(var s=t.length;s--;)t[s]=e;return t},invoke:function(t,e){for(var s=ot.call(arguments,2),i=[],n=0,r=t.length;n<r;n++)i[n]=s.length?t[n][e].apply(t[n],s):t[n][e].call(t[n]);return i},min:function(t,e){return at(t,e,(function(t,e){return t<e}))},max:function(t,e){return at(t,e,(function(t,e){return t>=e}))}};function lt(t,e,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+6*(e-t)*s:s<.5?e:s<2/3?t+(e-t)*(2/3-s)*6:t}const ct=class t{constructor(t){p(this,"_source"),t?this._tryParsingColor(t):this.setSource([0,0,0,1])}static fromHsla(e){return t.fromHsl(e)}static fromHex(e){return t.fromSource(t.sourceFromHex(e))}_tryParsingColor(e){var s;e in t.colorNameMap&&(e=t.colorNameMap[e]),"transparent"===e&&(s=[255,255,255,0]),s||(s=t.sourceFromHex(e)),s||(s=t.sourceFromRgb(e)),s||(s=t.sourceFromHsl(e)),s||(s=[0,0,0,1]),s&&this.setSource(s)}_rgbToHsl(t,e,s){var i,n,r,o=ht.max([t/=255,e/=255,s/=255]),a=ht.min([t,e,s]);if(r=(o+a)/2,o===a)i=n=0;else{var h=o-a;switch(n=r>.5?h/(2-o-a):h/(o+a),o){case t:i=(e-s)/h+(e<s?6:0);break;case e:i=(s-t)/h+2;break;case s:i=(t-e)/h+4}i/=6}return[Math.round(360*i),Math.round(100*n),Math.round(100*r)]}getSource(){return this._source}setSource(t){this._source=t}toRgb(){var t=this.getSource();return"rgb("+t[0]+","+t[1]+","+t[2]+")"}toRgba(){var t=this.getSource();return"rgba("+t[0]+","+t[1]+","+t[2]+","+t[3]+")"}toHsl(){var t=this.getSource(),e=this._rgbToHsl(t[0],t[1],t[2]);return"hsl("+e[0]+","+e[1]+"%,"+e[2]+"%)"}toHsla(){var t=this.getSource(),e=this._rgbToHsl(t[0],t[1],t[2]);return"hsla("+e[0]+","+e[1]+"%,"+e[2]+"%,"+t[3]+")"}toHex(){var t,e,s,i=this.getSource();return t=1===(t=i[0].toString(16)).length?"0"+t:t,e=1===(e=i[1].toString(16)).length?"0"+e:e,s=1===(s=i[2].toString(16)).length?"0"+s:s,t.toUpperCase()+e.toUpperCase()+s.toUpperCase()}toHexa(){var t,e=this.getSource();return t=1===(t=(t=Math.round(255*e[3])).toString(16)).length?"0"+t:t,this.toHex()+t.toUpperCase()}getAlpha(){return this.getSource()[3]}setAlpha(t){var e=this.getSource();return e[3]=t,this.setSource(e),this}toGrayscale(){var t=this.getSource(),e=parseInt((.3*t[0]+.59*t[1]+.11*t[2]).toFixed(0),10),s=t[3];return this.setSource([e,e,e,s]),this}toBlackWhite(t){var e=this.getSource(),s=(.3*e[0]+.59*e[1]+.11*e[2]).toFixed(0),i=e[3];return t=t||127,s=Number(s)<Number(t)?0:255,this.setSource([s,s,s,i]),this}overlayWith(e){e instanceof t||(e=new t(e));var s,i=[],n=this.getAlpha(),r=this.getSource(),o=e.getSource();for(s=0;s<3;s++)i.push(Math.round(.5*r[s]+.5*o[s]));return i[3]=n,this.setSource(i),this}};p(ct,"reRGBa",/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i),p(ct,"reHSLa",/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i),p(ct,"reHex",/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i),p(ct,"colorNameMap",{aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"}),p(ct,"fromRgb",(function(t){return ct.fromSource(ct.sourceFromRgb(t))})),p(ct,"sourceFromRgb",(function(t){var e=t.match(ct.reRGBa);if(e){var s=parseInt(e[1],10)/(/%$/.test(e[1])?100:1)*(/%$/.test(e[1])?255:1),i=parseInt(e[2],10)/(/%$/.test(e[2])?100:1)*(/%$/.test(e[2])?255:1),n=parseInt(e[3],10)/(/%$/.test(e[3])?100:1)*(/%$/.test(e[3])?255:1);return[parseInt(s,10),parseInt(i,10),parseInt(n,10),e[4]?parseFloat(e[4]):1]}})),p(ct,"fromRgba",ct.fromRgb),p(ct,"fromHsl",(function(t){return ct.fromSource(ct.sourceFromHsl(t))})),p(ct,"sourceFromHsl",(function(t){var e=t.match(ct.reHSLa);if(e){var s,i,n,r=(parseFloat(e[1])%360+360)%360/360,o=parseFloat(e[2])/(/%$/.test(e[2])?100:1),a=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(0===o)s=i=n=a;else{var h=a<=.5?a*(o+1):a+o-a*o,l=2*a-h;s=lt(l,h,r+1/3),i=lt(l,h,r),n=lt(l,h,r-1/3)}return[Math.round(255*s),Math.round(255*i),Math.round(255*n),e[4]?parseFloat(e[4]):1]}})),p(ct,"sourceFromHex",(function(t){if(t.match(ct.reHex)){var e=t.slice(t.indexOf("#")+1),s=3===e.length||4===e.length,i=8===e.length||4===e.length,n=s?e.charAt(0)+e.charAt(0):e.substring(0,2),r=s?e.charAt(1)+e.charAt(1):e.substring(2,4),o=s?e.charAt(2)+e.charAt(2):e.substring(4,6),a=i?s?e.charAt(3)+e.charAt(3):e.substring(6,8):"FF";return[parseInt(n,16),parseInt(r,16),parseInt(o,16),parseFloat((parseInt(a,16)/255).toFixed(2))]}})),p(ct,"fromSource",(function(t){var e=new ct;return e.setSource(t),e}));let dt=ct;function ut(t,e){e.forEach((e=>{const s=e.prototype||e;Object.getOwnPropertyNames(s).forEach((e=>{Object.hasOwnProperty.call(t.prototype,e)||Object.defineProperty(t.prototype,e,Object.getOwnPropertyDescriptor(s,e)||Object.create(null))}))}))}class pt{constructor(t,e){p(this,"x"),p(this,"y"),p(this,"type","point"),this.x=t,this.y=e}static from(t){return new pt(t.x,t.y)}add(t){return new pt(this.x+t.x,this.y+t.y)}addEquals(t){return this.x+=t.x,this.y+=t.y,this}scalarAdd(t){return new pt(this.x+t,this.y+t)}scalarAddEquals(t){return this.x+=t,this.y+=t,this}subtract(t){return new pt(this.x-t.x,this.y-t.y)}subtractEquals(t){return this.x-=t.x,this.y-=t.y,this}scalarSubtract(t){return new pt(this.x-t,this.y-t)}scalarSubtractEquals(t){return this.x-=t,this.y-=t,this}multiply(t){return new pt(this.x*t,this.y*t)}multiplyEquals(t){return this.x*=t,this.y*=t,this}divide(t){return new pt(this.x/t,this.y/t)}divideEquals(t){return this.x/=t,this.y/=t,this}eq(t){return this.x===t.x&&this.y===t.y}lt(t){return this.x<t.x&&this.y<t.y}lte(t){return this.x<=t.x&&this.y<=t.y}gt(t){return this.x>t.x&&this.y>t.y}gte(t){return this.x>=t.x&&this.y>=t.y}lerp(t,e){return typeof e>"u"&&(e=.5),e=Math.max(Math.min(1,e),0),new pt(this.x+(t.x-this.x)*e,this.y+(t.y-this.y)*e)}distanceFrom(t){var e=this.x-t.x,s=this.y-t.y;return Math.sqrt(e*e+s*s)}midPointFrom(t){return this.lerp(t)}min(t){return new pt(Math.min(this.x,t.x),Math.min(this.y,t.y))}max(t){return new pt(Math.max(this.x,t.x),Math.max(this.y,t.y))}toString(){return this.x+","+this.y}setXY(t,e){return this.x=t,this.y=e,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setFromPoint(t){return this.x=t.x,this.y=t.y,this}swap(t){var e=this.x,s=this.y;this.x=t.x,this.y=t.y,t.x=e,t.y=s}clone(){return new pt(this.x,this.y)}}const gt={NUM_FRACTION_DIGITS:2},ft={DEFAULT_SVG_FONT_SIZE:2};var _t={exports:{}};const Ot=(null==_t.exports?{}:_t.exports).default||_t.exports,mt=Object.freeze(Object.defineProperty({__proto__:null,default:Ot},Symbol.toStringTag,{value:"Module"}));let vt,bt,yt;if(typeof document<"u"&&typeof window<"u")bt=document instanceof(typeof HTMLDocument<"u"?HTMLDocument:Document)?document:document.implementation.createHTMLDocument(""),vt=window;else{var At=new(Ot||mt).JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;bt=At.document,yt=(Ot||mt).implForWrapper,(Ot||mt).Canvas,vt=At}const Tt=typeof Buffer<"u"&&typeof window>"u";"ontouchstart"in vt||"ontouchstart"in bt||vt&&vt.navigator&&vt.navigator.maxTouchPoints;const St={version:"4.6.0",charWidthsCache:{},DPI:96,commaWsp:"(?:\\s+,?\\s*|,\\s*)",rePathCommand:/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,fontPaths:{},iMatrix:[1,0,0,1,0,0],boundsOfCurveCache:new class{constructor(t=100,e=1){p(this,"store",new Map),this.limit=t,this.cleanBulk=e}has(t){return this.store.has(t)}get(t){return this.store.get(t)}set(t,e){if(this.has(t))return;const s=this.store;if(s.size+1>this.limit){const t=s.keys();for(let e=0;e<this.cleanBulk;e++){const e=t.next();if(e.done)break;s.delete(e.value)}}s.set(t,e)}}(2e4,300),perfLimitSizeTotal:2097152,maxCacheSideLimit:4096,minCacheSideLimit:256,devicePixelRatio:vt.devicePixelRatio||vt.webkitDevicePixelRatio||vt.mozDevicePixelRatio||1,browserShadowBlurConstant:1,_measuringContext:void 0},wt={log:console.log,warn:console.warn,error:console.error};var It=Math.sqrt,xt=Math.atan2,kt=Math.pow,Et=Math.PI/180,Ct=Math.PI/2;const Pt={cos:function(t){if(0===t)return 1;switch(t<0&&(t=-t),t/Ct){case 1:case 3:return 0;case 2:return-1}return Math.cos(t)},sin:function(t){if(0===t)return 0;var e=1;switch(t<0&&(e=-1),t/Ct){case 1:return e;case 2:return 0;case 3:return-e}return Math.sin(t)},removeFromArray:function(t,e){var s=t.indexOf(e);return-1!==s&&t.splice(s,1),t},getRandomInt:function(t,e){return Math.floor(Math.random()*(e-t+1))+t},degreesToRadians:function(t){return t*Et},radiansToDegrees:function(t){return t/Et},rotatePoint:function(t,e,s){var i=new pt(t.x-e.x,t.y-e.y),n=Pt.rotateVector(i,s);return new pt(n.x,n.y).addEquals(e)},rotateVector:function(t,e){var s=Pt.sin(e),i=Pt.cos(e);return{x:t.x*i-t.y*s,y:t.x*s+t.y*i}},transformPoint:function(t,e,s){return s?new pt(e[0]*t.x+e[2]*t.y,e[1]*t.x+e[3]*t.y):new pt(e[0]*t.x+e[2]*t.y+e[4],e[1]*t.x+e[3]*t.y+e[5])},makeBoundingBoxFromPoints:function(t,e){if(e)for(var s=0;s<t.length;s++)t[s]=Pt.transformPoint(t[s],e);var i=[t[0].x,t[1].x,t[2].x,t[3].x],n=ht.min(i),r=ht.max(i)-n,o=[t[0].y,t[1].y,t[2].y,t[3].y],a=ht.min(o);return{left:n,top:a,width:r,height:ht.max(o)-a}},invertTransform:function(t){var e=1/(t[0]*t[3]-t[1]*t[2]),s=[e*t[3],-e*t[1],-e*t[2],e*t[0]],i=Pt.transformPoint({x:t[4],y:t[5]},s,!0);return s[4]=-i.x,s[5]=-i.y,s},toFixed:function(t,e){return parseFloat(Number(t).toFixed(e))},parseUnit:function(t,e){var s=/\D{0,2}$/.exec(t),i=parseFloat(t);switch(e||(e=ft.DEFAULT_SVG_FONT_SIZE),s[0]){case"mm":return i*St.DPI/25.4;case"cm":return i*St.DPI/2.54;case"in":return i*St.DPI;case"pt":return i*St.DPI/72;case"pc":return i*St.DPI/72*12;case"em":return i*e;default:return i}},falseFunction:function(){return!1},getSvgAttributes:function(t){var e=["instantiated_by_use","style","id","class"];switch(t){case"linearGradient":e=e.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":e=e.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":e=e.concat(["offset","stop-color","stop-opacity"])}return e},loadImage:function(t,e,s,i){if(t){var n=Pt.createImage(),r=function(){e&&e.call(s,n,!1),n=n.onload=n.onerror=null};n.onload=r,n.onerror=function(){wt.log("Error loading "+n.src),e&&e.call(s,null,!0),n=n.onload=n.onerror=null},0!==t.indexOf("data")&&null!=i&&(n.crossOrigin=i),"data:image/svg"===t.substring(0,14)&&(n.onload=null,Pt.loadImageInDom(n,r)),n.src=t}else e&&e.call(s,t)},loadImageInDom:function(t,e){var s=bt.createElement("div");s.style.width=s.style.height="1px",s.style.left=s.style.top="-100%",s.style.position="absolute",s.appendChild(t),bt.querySelector("body").appendChild(s),t.onload=function(){e(),s.parentNode.removeChild(s),s=null}},populateWithProperties:function(t,e,s){if(s&&"[object Array]"===Object.prototype.toString.call(s))for(var i=0,n=s.length;i<n;i++)s[i]in t&&(e[s[i]]=t[s[i]])},drawDashedLine:function(t,e,s,i,n,r){var o=i-e,a=n-s,h=It(o*o+a*a),l=xt(a,o),c=r.length,d=0,u=!0;for(t.save(),t.translate(e,s),t.moveTo(0,0),t.rotate(l),e=0;h>e;)(e+=r[d++%c])>h&&(e=h),t[u?"lineTo":"moveTo"](e,0),u=!u;t.restore()},createCanvasElement:function(){return bt.createElement("canvas")},copyCanvasElement:function(t){var e=Pt.createCanvasElement();return e.width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0),e},toDataURL:function(t,e,s){const i="pdf"===e||"svg"===e?"":"image/";return t.toDataURL(i+e,s)},createImage:function(){return bt.createElement("img")},multiplyTransformMatrices:function(t,e,s){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],s?0:t[0]*e[4]+t[2]*e[5]+t[4],s?0:t[1]*e[4]+t[3]*e[5]+t[5]]},qrDecompose:function(t){var e=xt(t[1],t[0]),s=kt(t[0],2)+kt(t[1],2),i=It(s),n=(t[0]*t[3]-t[2]*t[1])/i,r=xt(t[0]*t[2]+t[1]*t[3],s);return{angle:e/Et,scaleX:i,scaleY:n,skewX:r/Et,skewY:0,translateX:t[4],translateY:t[5]}},calcRotateMatrix:function(t){if(!t.angle)return St.iMatrix.concat();var e=Pt.degreesToRadians(t.angle),s=Pt.cos(e),i=Pt.sin(e);return[s,i,-i,s,0,0]},calcDimensionsMatrix:function(t){var e=typeof t.scaleX>"u"?1:t.scaleX,s=typeof t.scaleY>"u"?1:t.scaleY,i=[t.flipX?-e:e,0,0,t.flipY?-s:s,0,0],n=Pt.multiplyTransformMatrices,r=Pt.degreesToRadians;return t.skewX&&(i=n(i,[1,0,Math.tan(r(t.skewX)),1],!0)),t.skewY&&(i=n(i,[1,Math.tan(r(t.skewY)),0,1],!0)),i},composeMatrix:function(t){var e=[1,0,0,1,t.translateX||0,t.translateY||0],s=Pt.multiplyTransformMatrices;return t.angle&&(e=s(e,Pt.calcRotateMatrix(t))),(1!==t.scaleX||1!==t.scaleY||t.skewX||t.skewY||t.flipX||t.flipY)&&(e=s(e,Pt.calcDimensionsMatrix(t))),e},resetObjectTransform:function(t){t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},saveObjectTransform:function(t){return{scaleX:t.scaleX,scaleY:t.scaleY,skewX:t.skewX,skewY:t.skewY,angle:t.angle,left:t.left,flipX:t.flipX,flipY:t.flipY,top:t.top}},isTransparent:function(t,e,s,i){i>0&&(e>i?e-=i:e=0,s>i?s-=i:s=0);var n,r=!0,o=t.getImageData(e,s,2*i||1,2*i||1),a=o.data.length;for(n=3;n<a&&!1!=(r=o.data[n]<=0);n+=4);return o=null,r},parsePreserveAspectRatioAttribute:function(t){var e,s="meet",i=t.split(" ");return i&&i.length&&("meet"!==(s=i.pop())&&"slice"!==s?(e=s,s="meet"):i.length&&(e=i.pop())),{meetOrSlice:s,alignX:"none"!==e?e.slice(1,4):"none",alignY:"none"!==e?e.slice(5,8):"none"}},clearFabricFontCache:function(t){(t=(t||"").toLowerCase())?St.charWidthsCache[t]&&delete St.charWidthsCache[t]:St.charWidthsCache={}},limitDimsByArea:function(t,e){var s=Math.sqrt(e*t),i=Math.floor(e/s);return{x:Math.floor(s),y:i}},capValue:function(t,e,s){return Math.max(t,Math.min(e,s))},findScaleToFit:function(t,e){return Math.min(e.width/t.width,e.height/t.height)},findScaleToCover:function(t,e){return Math.max(e.width/t.width,e.height/t.height)},matrixToSVG:function(t){return"matrix("+t.map((function(t){return Pt.toFixed(t,gt.NUM_FRACTION_DIGITS)})).join(" ")+")"},removeTransformFromObject:function(t,e){var s=Pt.invertTransform(e),i=Pt.multiplyTransformMatrices(s,t.calcOwnMatrix());Pt.applyTransformToObject(t,i)},addTransformToObject:function(t,e){Pt.applyTransformToObject(t,Pt.multiplyTransformMatrices(e,t.calcOwnMatrix()))},applyTransformToObject:function(t,e){var s=Pt.qrDecompose(e),i=new pt(s.translateX,s.translateY);t.flipX=!1,t.flipY=!1,t.set("scaleX",s.scaleX),t.set("scaleY",s.scaleY),t.skewX=s.skewX,t.skewY=s.skewY,t.angle=s.angle,t.setPositionByOrigin(i,"center","center")},sizeAfterTransform:function(t,e,s){var i=t/2,n=e/2,r=[{x:-i,y:-n},{x:i,y:-n},{x:-i,y:n},{x:i,y:n}],o=Pt.calcDimensionsMatrix(s),a=Pt.makeBoundingBoxFromPoints(r,o);return{x:a.width,y:a.height}}};class Nt{constructor(t=""){p(this,"points"),p(this,"status"),this.status=t,this.points=[]}appendPoint(t){return this.points.push(t),this}appendPoints(t){return this.points=this.points.concat(t),this}static intersectLineLine(t,e,s,i){var n,r=(i.x-s.x)*(t.y-s.y)-(i.y-s.y)*(t.x-s.x),o=(e.x-t.x)*(t.y-s.y)-(e.y-t.y)*(t.x-s.x),a=(i.y-s.y)*(e.x-t.x)-(i.x-s.x)*(e.y-t.y);if(0!==a){var h=r/a,l=o/a;0<=h&&h<=1&&0<=l&&l<=1?(n=new Nt("Intersection")).appendPoint(new pt(t.x+h*(e.x-t.x),t.y+h*(e.y-t.y))):n=new Nt}else n=new Nt(0===r||0===o?"Coincident":"Parallel");return n}static intersectLinePolygon(t,e,s){var i,n,r,o,a=new Nt,h=s.length;for(o=0;o<h;o++)i=s[o],n=s[(o+1)%h],r=Nt.intersectLineLine(t,e,i,n),a.appendPoints(r.points);return a.points.length>0&&(a.status="Intersection"),a}static intersectPolygonPolygon(t,e){var s,i=new Nt,n=t.length;for(s=0;s<n;s++){var r=t[s],o=t[(s+1)%n],a=Nt.intersectLinePolygon(r,o,e);i.appendPoints(a.points)}return i.points.length>0&&(i.status="Intersection"),i}static intersectPolygonRectangle(t,e,s){var i=e.min(s),n=e.max(s),r=new pt(n.x,i.y),o=new pt(i.x,n.y),a=Nt.intersectLinePolygon(i,r,t),h=Nt.intersectLinePolygon(r,n,t),l=Nt.intersectLinePolygon(n,o,t),c=Nt.intersectLinePolygon(o,i,t),d=new Nt;return d.appendPoints(a.points),d.appendPoints(h.points),d.appendPoints(l.points),d.appendPoints(c.points),d.points.length>0&&(d.status="Intersection"),d}}const{degreesToRadians:Lt,transformPoint:Rt}=Pt,jt={left:-.5,top:-.5,center:0,bottom:.5,right:.5},Dt=t=>"string"==typeof t?jt[t]:t-.5,Ft=Pt.degreesToRadians,Mt=Pt.multiplyTransformMatrices,Bt=Pt.transformPoint;function Yt(t,e){if(!t||t.length!==e.length)return!1;for(let s=0;s<t.length;s++)if(t[s]!==e[s])return!1;return!0}const Ht=class{constructor(){p(this,"oCoords",null),p(this,"aCoords",null),p(this,"lineCoords",null),p(this,"ownMatrixCache",null),p(this,"matrixCache",null)}_getCoords(t,e){return e?t?this.calcACoords():this.calcLineCoords():((!this.aCoords||!this.lineCoords)&&this.setCoords(!0),t?this.aCoords:this.lineCoords)}getCoords(t,e){return s=this._getCoords(t,e),[new pt(s.tl.x,s.tl.y),new pt(s.tr.x,s.tr.y),new pt(s.br.x,s.br.y),new pt(s.bl.x,s.bl.y)];var s}forEachParent(t){const e=new Set;let s=this.group;for(;s&&!e.has(s);)e.add(s),t(s),s=s.group}getTotalScaleSimple(t,e){var s;let i=null!=(s=null!=e?e:this[t])?s:1;return this.forEachParent((e=>{var s;i*=null!=(s=e[t])?s:1})),i}intersectsWithRect(t,e,s,i){var n=this.getCoords(s,i);return"Intersection"===Nt.intersectPolygonRectangle(n,t,e).status}intersectsWithObject(t,e,s){return"Intersection"===Nt.intersectPolygonPolygon(this.getCoords(e,s),t.getCoords(e,s)).status||t.isContainedWithinObject(this,e,s)||this.isContainedWithinObject(t,e,s)}isContainedWithinObject(t,e,s){for(var i=this.getCoords(e,s),n=e?t.aCoords:t.lineCoords,r=0,o=t._getImageLines(n);r<4;r++)if(!t.containsPoint(i[r],o))return!1;return!0}isContainedWithinRect(t,e,s,i){var n=this.getBoundingRect(s,i);return n.left>=t.x&&n.left+n.width<=e.x&&n.top>=t.y&&n.top+n.height<=e.y}containsPoint(t,e,s,i){var n=this._getCoords(s,i),r=(e=e||this._getImageLines(n),this._findCrossPoints(t,e));return 0!==r&&r%2==1}isOnScreen(t){if(!this.canvas)return!1;var e=this.canvas.vptCoords.tl,s=this.canvas.vptCoords.br;return!(!this.getCoords(!0,t).some((function(t){return t.x<=s.x&&t.x>=e.x&&t.y<=s.y&&t.y>=e.y}))&&!this.intersectsWithRect(e,s,!0,t))||this._containsCenterOfCanvas(e,s,t)}isOnScreenAbs(){if(!this.canvas)return!1;const t=this.canvas.vptCoords.tl,e=this.canvas.vptCoords.br,s=Object.values(this.calcAbsCoords());return!(!s.some((function(s){return s.x<=e.x&&s.x>=t.x&&s.y<=e.y&&s.y>=t.y}))&&"Intersection"!==Nt.intersectPolygonRectangle(s,t,e).status)||this._containsCenterOfCanvas(t,e)}_containsCenterOfCanvas(t,e,s){var i={x:(t.x+e.x)/2,y:(t.y+e.y)/2};return!!this.containsPoint(i,null,!0,s)}isPartiallyOnScreen(t){if(!this.canvas)return!1;var e=this.canvas.vptCoords.tl,s=this.canvas.vptCoords.br;return!!this.intersectsWithRect(e,s,!0,t)||this.getCoords(!0,t).every((function(t){return(t.x>=s.x||t.x<=e.x)&&(t.y>=s.y||t.y<=e.y)}))&&this._containsCenterOfCanvas(e,s,t)}_getImageLines(t){return{topline:{o:t.tl,d:t.tr},rightline:{o:t.tr,d:t.br},bottomline:{o:t.br,d:t.bl},leftline:{o:t.bl,d:t.tl}}}_findCrossPoints(t,e){var s,i,n,r,o,a=0;for(var h in e)if(!((o=e[h]).o.y<t.y&&o.d.y<t.y||o.o.y>=t.y&&o.d.y>=t.y||(o.o.x===o.d.x&&o.o.x>=t.x?r=o.o.x:(s=(o.d.y-o.o.y)/(o.d.x-o.o.x),i=t.y-0*t.x,n=o.o.y-s*o.o.x,r=-(i-n)/(0-s)),r>=t.x&&(a+=1),2!==a)))break;return a}getBoundingRect(t,e){var s=this.getCoords(t,e);return Pt.makeBoundingBoxFromPoints(s)}getScaledWidth(){return this._getTransformedDimensions().x}getScaledHeight(){return this._getTransformedDimensions().y}_constrainScale(t){return Math.abs(t)<this.minScaleLimit?t<0?-this.minScaleLimit:this.minScaleLimit:0===t?1e-4:t}scale(t){return this._set("scaleX",t),this._set("scaleY",t),this.setCoords()}scaleToWidth(t,e){var s=this.getBoundingRect(e).width/this.getScaledWidth();return this.scale(t/this.width/s)}scaleToHeight(t,e){var s=this.getBoundingRect(e).height/this.getScaledHeight();return this.scale(t/this.height/s)}getTotalAngle(){return this.group?Pt.qrDecompose(this.calcTransformMatrix()).angle:this.angle}calcCoords(t){return t?this.calcACoords():this.calcOCoords()}calcLineCoords(){var t=this.getViewportTransform(),e=this.padding,s=Ft(this.angle),i=Pt.cos(s)*e,n=Pt.sin(s)*e,r=i+n,o=i-n,a=this.calcACoords(),h={tl:Bt(a.tl,t),tr:Bt(a.tr,t),bl:Bt(a.bl,t),br:Bt(a.br,t)};return e&&(h.tl.x-=o,h.tl.y-=r,h.tr.x+=r,h.tr.y-=o,h.bl.x-=r,h.bl.y+=o,h.br.x+=o,h.br.y+=r),h}calcCanvasLineCoords(){const t=this.group?Pt.multiplyTransformMatrices(this.getViewportTransform(),this.group.calcTransformMatrix()):this.getViewportTransform(),e=this.padding,s=Pt.degreesToRadians(this.angle),i=Pt.cos(s)*e,n=Pt.sin(s)*e,r=i+n,o=i-n,a=this.calcACoords(),h={tl:Pt.transformPoint(a.tl,t),tr:Pt.transformPoint(a.tr,t),bl:Pt.transformPoint(a.bl,t),br:Pt.transformPoint(a.br,t)};return e&&(h.tl.x-=o,h.tl.y-=r,h.tr.x+=r,h.tr.y-=o,h.bl.x-=r,h.bl.y+=o,h.br.x+=o,h.br.y+=r),h}calcOCoords(){var t=this._calcRotateMatrix(),e=this._calcTranslateMatrix(),s=this.getViewportTransform(),i=Mt(s,e),n=Mt(i,t),r=(n=Mt(n,[1/s[0],0,0,1/s[3],0,0]),this._calculateCurrentDimensions()),o={};return this.forEachControl((function(t,e,s){o[e]=t.positionHandler(r,n,s)})),o}calcACoords(){var t=this._calcRotateMatrix(),e=this._calcTranslateMatrix(),s=Mt(e,t),i=this._getTransformedDimensions(),n=i.x/2,r=i.y/2;return{tl:Bt({x:-n,y:-r},s),tr:Bt({x:n,y:-r},s),bl:Bt({x:-n,y:r},s),br:Bt({x:n,y:r},s)}}calcAbsCoords(){var t;const e=this.calcACoords(),s=null==(t=this.group)?void 0:t.calcTransformMatrix();let i=[e.tl,e.tr,e.bl,e.br];return i=s?i.map((t=>Pt.transformPoint(t,s))):i,{tl:i[0],tr:i[1],bl:i[2],br:i[3]}}setCoords(t){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),t||(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords()),this}_calcRotateMatrix(){return Pt.calcRotateMatrix(this)}_calcTranslateMatrix(){var t=this.getCenterPoint();return[1,0,0,1,t.x,t.y]}transformMatrixKey(t){let e=[];return!t&&this.group&&(e=this.group.transformMatrixKey(t)),e.push(this.top,this.left,this.scaleX,this.scaleY,this.skewX,this.skewY,this.angle,Dt(this.originX),Dt(this.originY),this.width,this.height,this.strokeWidth,+this.flipX,+this.flipY),e}calcTransformMatrix(t){var e=this.calcOwnMatrix();if(t||!this.group)return e;var s=this.transformMatrixKey(t),i=this.matrixCache||(this.matrixCache={});return Yt(i.key,s)?i.value:(this.group&&(e=Mt(this.group.calcTransformMatrix(!1),e)),i.key=s,i.value=e,e)}calcOwnMatrix(){var t=this.transformMatrixKey(!0),e=this.ownMatrixCache||(this.ownMatrixCache={});if(Yt(e.key,t))return e.value;var s=this._calcTranslateMatrix(),i={angle:this.angle,translateX:s[4],translateY:s[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return e.key=t,e.value=Pt.composeMatrix(i),e.value}_calcDimensionsTransformMatrix(t,e,s){return Pt.calcDimensionsMatrix({skewX:t,skewY:e,scaleX:this.scaleX*(s&&this.flipX?-1:1),scaleY:this.scaleY*(s&&this.flipY?-1:1)})}_getNonTransformedDimensions(){var t=this.strokeWidth;return{x:this.width+t,y:this.height+t}}_getTransformedDimensions(t,e){typeof t>"u"&&(t=this.skewX),typeof e>"u"&&(e=this.skewY);var s,i,n,r=0===t&&0===e;if(this.strokeUniform?(i=this.width,n=this.height):(i=(s=this._getNonTransformedDimensions()).x,n=s.y),r)return this._finalizeDimensions(i*this.scaleX,n*this.scaleY);var o=Pt.sizeAfterTransform(i,n,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:t,skewY:e});return this._finalizeDimensions(o.x,o.y)}_finalizeDimensions(t,e){return this.strokeUniform?{x:t+this.strokeWidth,y:e+this.strokeWidth}:{x:t,y:e}}_calculateCurrentDimensions(){var t=this.getViewportTransform(),e=this._getTransformedDimensions();return Bt(e,t,!0).scalarAdd(2*this.padding)}};Ht.prototype.oCoords=null,Ht.prototype.aCoords=null,Ht.prototype.lineCoords=null,Ht.prototype.ownMatrixCache=null,Ht.prototype.matrixCache=null,Ht.prototype.controls={};let Wt=Ht;function zt(t,e,s){if(s)if(!Tt&&e instanceof Element)t=e;else if(e instanceof Array){t=[];for(var i=0,n=e.length;i<n;i++)t[i]=zt({},e[i],s)}else if(e&&"object"==typeof e)for(var r in e)"canvas"===r||"group"===r?t[r]=null:e.hasOwnProperty(r)&&(t[r]=zt({},e[r],s));else t=e;else for(var r in e)t[r]=e[r];return t}const Ut={extend:zt,clone:function(t,e){return zt({},t,e)}};var Xt=Ut.extend,Gt="stateProperties";function Vt(t,e,s){var i={};s.forEach((function(e){i[e]=t[e]})),Xt(t[e],i,!0)}function qt(t,e,s){if(t===e)return!0;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var i=0,n=t.length;i<n;i++)if(!qt(t[i],e[i]))return!1;return!0}if(t&&"object"==typeof t){var r,o=Object.keys(t);if(!e||"object"!=typeof e||!s&&o.length!==Object.keys(e).length)return!1;for(i=0,n=o.length;i<n;i++)if("canvas"!==(r=o[i])&&"group"!==r&&!qt(t[r],e[r]))return!1;return!0}}class Jt{_setOptions(t){for(const e in t)this.set(e,t[e])}_setObject(t){for(const e in t)this._set(e,t[e])}set(t,e){return"object"==typeof t?this._setObject(t):this._set(t,e),this}_set(t,e){this[t]=e}toggle(t){const e=this.get(t);return"boolean"==typeof e&&this.set(t,!e),this}get(t){return this[t]}}function Kt(t,e){if(!this.__eventListeners[t])return;const s=this.__eventListeners[t];if(s)if(e){const t=s.indexOf(e);t>-1&&s.splice(t,1)}else s.length=0}function Zt(t,e){var s=function(){e.apply(this,arguments),this.off(t,s)}.bind(this);this.on(t,s)}class Qt{constructor(){p(this,"__eventListeners")}once(t,e){if(1===arguments.length)for(var s in t)Zt.call(this,s,t[s]);else Zt.call(this,t,e);return this}on(t,e){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var s in t)this.on(s,t[s]);else this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(e);return this}off(t,e){if(!this.__eventListeners)return this;if(0===arguments.length)for(t in this.__eventListeners)Kt.call(this,t);else if(1===arguments.length&&"object"==typeof arguments[0])for(var s in t)Kt.call(this,s,t[s]);else Kt.call(this,t,e);return this}fire(t,e){if(!this.__eventListeners)return this;var s=this.__eventListeners[t];if(!s)return this;for(var i=0,n=s.length;i<n;i++)s[i]&&s[i].call(this,e||{});return this}}function $t(t,e){if(e){if(e.toLive)return t+": url(#SVGID_"+e.id+"); ";var s=new dt(e),i=t+": "+s.toRgb()+"; ",n=s.getAlpha();return 1!==n&&(i+=t+"-opacity: "+n.toString()+"; "),i}return t+": none; "}var te=Pt.toFixed;function ee(){return!1}function se(t,e,s,i){return-s*Math.cos(t/i*(Math.PI/2))+s+e}function ie(t){var e=!1;return ae((function(s){t||(t={});var i,n=s||+new Date,r=t.duration||500,o=n+r,a=t.onChange||ee,h=t.abort||ee,l=t.onComplete||ee,c=t.easing||se,d="startValue"in t?t.startValue:0,u="endValue"in t?t.endValue:100,p=t.byValue||u-d;t.onStart&&t.onStart(),function t(s){var g=(i=s||+new Date)>o?r:i-n,f=g/r,_=c(g,d,p,r),O=Math.abs((_-d)/p);if(!e){if(h(_,O,f))return void l(u,1,1);if(i>o)return a(u,1,1),void l(u,1,1);a(_,O,f),ae(t)}}(n)})),function(){e=!0}}const ne=vt,re=ne.requestAnimationFrame||ne.webkitRequestAnimationFrame||ne.mozRequestAnimationFrame||ne.oRequestAnimationFrame||ne.msRequestAnimationFrame||function(t){return ne.setTimeout(t,1e3/60)},oe=ne.cancelAnimationFrame||ne.clearTimeout;function ae(t){return re(t)}function he(t){return oe(t)}class le{constructor(){p(this,"_onObjectAdded"),p(this,"_onObjectRemoved"),p(this,"renderOnAddRemove"),p(this,"_objects",[])}add(...t){if(this._objects.push(...t),this._onObjectAdded)for(var e=0,s=arguments.length;e<s;e++)this._onObjectAdded(arguments[e]);return this.renderOnAddRemove&&this._onCollectionChanged(),this}_onCollectionChanged(){}insertAt(t,e,s){var i=this._objects;return s?i[e]=t:i.splice(e,0,t),this._onObjectAdded&&this._onObjectAdded(t),this.renderOnAddRemove&&this._onCollectionChanged(),this}remove(...t){for(var e,s=this._objects,i=!1,n=0,r=t.length;n<r;n++)-1!==(e=s.indexOf(t[n]))&&(i=!0,s.splice(e,1),this._onObjectRemoved&&this._onObjectRemoved(t[n]));return this.renderOnAddRemove&&i&&this._onCollectionChanged(),this}forEachObject(t,e){for(var s=this.getObjects(),i=0,n=s.length;i<n;i++)t.call(e,s[i],i,s);return this}getObjects(t){return typeof t>"u"?this._objects.concat():this._objects.filter((function(e){return e.type===t}))}item(t){return this._objects[t]}isEmpty(){return 0===this._objects.length}size(){return this._objects.length}contains(t,e){return this._objects.indexOf(t)>-1||!!e&&this._objects.some((function(e){return"function"==typeof e.contains&&e.contains(t,!0)}))}complexity(){return this._objects.reduce((function(t,e){return t+(e.complexity?e.complexity():0)}),0)}}function ce(t,e){var s=t.style;if(!s)return t;if("string"==typeof e)return t.style.cssText+=";"+e,e.indexOf("opacity")>-1?fe(t,e.match(/opacity:\s*(\d?\.?\d*)/)[1]):t;for(var i in e)"opacity"===i?fe(t,e[i]):s["float"===i||"cssFloat"===i?typeof s.styleFloat>"u"?"cssFloat":"styleFloat":i]=e[i];return t}const de=bt.createElement("div"),ue="string"==typeof de.style.opacity,pe="string"==typeof de.style.filter,ge=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/;let fe=function(t){return t};ue?fe=function(t,e){return t.style.opacity=e,t}:pe&&(fe=function(t,e){var s=t.style;return t.currentStyle&&!t.currentStyle.hasLayout&&(s.zoom=1),ge.test(s.filter)?(e=e>=.9999?"":"alpha(opacity="+100*e+")",s.filter=s.filter.replace(ge,e)):s.filter+=" alpha(opacity="+100*e+")",t});const _e=Array.prototype.slice,Oe=bt;var me,ve,be=function(t){return _e.call(t,0)};try{me=be(Oe.childNodes)instanceof Array}catch(Ps){}function ye(t,e){var s=Oe.createElement(t);for(var i in e)"class"===i?s.className=e[i]:"for"===i?s.htmlFor=e[i]:s.setAttribute(i,e[i]);return s}function Ae(t){for(var e=0,s=0,i=Oe.documentElement,n=Oe.body||{scrollLeft:0,scrollTop:0};t&&(t.parentNode||t.host)&&((t=t.parentNode||t.host)===Oe?(e=n.scrollLeft||i.scrollLeft||0,s=n.scrollTop||i.scrollTop||0):(e+=t.scrollLeft||0,s+=t.scrollTop||0),1!==t.nodeType||"fixed"!==t.style.position););return{left:e,top:s}}me||(be=function(t){for(var e=new Array(t.length),s=t.length;s--;)e[s]=t[s];return e}),ve=Oe.defaultView&&Oe.defaultView.getComputedStyle?function(t,e){var s=Oe.defaultView.getComputedStyle(t,null);return s?s[e]:void 0}:function(t,e){var s=t.style[e];return!s&&t.currentStyle&&(s=t.currentStyle[e]),s};var Te=bt.documentElement.style,Se="userSelect"in Te?"userSelect":"MozUserSelect"in Te?"MozUserSelect":"WebkitUserSelect"in Te?"WebkitUserSelect":"KhtmlUserSelect"in Te?"KhtmlUserSelect":"";const we={setImageSmoothing:function(t,e){t.imageSmoothingEnabled=t.imageSmoothingEnabled||t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled||t.oImageSmoothingEnabled,t.imageSmoothingEnabled=e},getById:function(t){return"string"==typeof t?Oe.getElementById(t):t},toArray:be,addClass:function(t,e){t&&-1===(" "+t.className+" ").indexOf(" "+e+" ")&&(t.className+=(t.className?" ":"")+e)},makeElement:ye,wrapElement:function(t,e,s){return"string"==typeof e&&(e=ye(e,s)),t.parentNode&&t.parentNode.replaceChild(e,t),e.appendChild(t),e},getScrollLeftTop:Ae,getElementOffset:function(t){var e,s,i=t&&t.ownerDocument,n={left:0,top:0},r={left:0,top:0},o={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!i)return r;for(var a in o)r[o[a]]+=parseInt(ve(t,a),10)||0;return e=i.documentElement,typeof t.getBoundingClientRect<"u"&&(n=t.getBoundingClientRect()),s=Ae(t),{left:n.left+s.left-(e.clientLeft||0)+r.left,top:n.top+s.top-(e.clientTop||0)+r.top}},getNodeCanvas:function(t){var e=yt(t);return e._canvas||e._image},cleanUpJsdomNode:function(t){if(Tt){var e=yt(t);e&&(e._canvas&&(e._canvas.width=0,e._canvas.height=0),e._image&&(e._image.width=0,e._image.height=0),e._canvas=null,e._image=null,e._currentSrc=null,e._attributes=null,e._classList=null)}},makeElementUnselectable:function(t){return typeof t.onselectstart<"u"&&(t.onselectstart=Pt.falseFunction),Se?t.style[Se]="none":"string"==typeof t.unselectable&&(t.unselectable="on"),t},makeElementSelectable:function(t){return typeof t.onselectstart<"u"&&(t.onselectstart=null),Se?t.style[Se]="":"string"==typeof t.unselectable&&(t.unselectable=""),t},setStyle:ce},Ie=Ut.extend,xe=we.getElementOffset,ke=Pt.removeFromArray,Ee=Pt.toFixed,Ce=Pt.transformPoint,Pe=Pt.invertTransform,Ne=we.getNodeCanvas,Le=Pt.createCanvasElement,Re=new Error("Could not initialize `canvas` element"),je=new class{next(t){return ae(t)}cancel(t){return he(t)}},De=new class{constructor(t=1e3){p(this,"queue",new Map),p(this,"tid",0),p(this,"timer",0),p(this,"started",!1),p(this,"flush",(()=>{if(!this.queue.size)return void this.clearTimer();const t=[...this.queue.values()],e=t.length;this.queue.clear();let s=0;for(;s<e;){const e=t[s];s++;try{e()}catch(t){console.error(t)}}})),this.rate=t}clearTimer(){clearInterval(this.timer),this.timer=0}next(t){if(!this.started)return this.started=!0,setTimeout(t,0),0;const e=++this.tid;return this.queue.set(e,t),this.timer||(this.timer=setInterval(this.flush,this.rate)),e}cancel(t){this.queue.delete(t),this.queue.size||this.clearTimer()}}(1e3/60);class Fe{constructor(t,e){p(this,"isRendering",0),p(this,"ticker",je),p(this,"backgroundColor",""),p(this,"backgroundImage",null),p(this,"overlayColor",""),p(this,"overlayImage",null),p(this,"includeDefaultValues",!0),p(this,"stateful",!1),p(this,"renderOnAddRemove",!0),p(this,"controlsAboveOverlay",!1),p(this,"allowTouchScrolling",!1),p(this,"imageSmoothingEnabled",!0),p(this,"viewportTransform",St.iMatrix.concat()),p(this,"backgroundVpt",!0),p(this,"overlayVpt",!0),p(this,"enableRetinaScaling",!0),p(this,"vptCoords",{}),p(this,"skipOffscreen",!0),p(this,"clipPath"),p(this,"svgViewportTransformation",!0),e||(e={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(t,e)}changeTickerMode(t){this.stopLastRender(),this.ticker="raf"===t?je:De}stopLastRender(){this.isRendering&&(this.ticker.cancel(this.isRendering),this.isRendering=0)}_initStatic(t,e){var s=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(t),this._initOptions(e),this.interactive||this._initRetinaScaling(),e.overlayImage&&this.setOverlayImage(e.overlayImage,s),e.backgroundImage&&this.setBackgroundImage(e.backgroundImage,s),e.backgroundColor&&this.setBackgroundColor(e.backgroundColor,s),e.overlayColor&&this.setOverlayColor(e.overlayColor,s),this.calcOffset()}_isRetinaScaling(){return 1!==St.devicePixelRatio&&this.enableRetinaScaling}getRetinaScaling(){return this._isRetinaScaling()?St.devicePixelRatio:1}_initRetinaScaling(){if(this._isRetinaScaling()){var t=St.devicePixelRatio;this.__initRetinaScalin