@vue-skuilder/courseware 0.1.33 → 0.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CourseWare-BTFRjgBR.js +305 -0
- package/dist/CourseWare-BTFRjgBR.js.map +1 -0
- package/dist/CourseWare-DSeyTAtH.cjs +2 -0
- package/dist/CourseWare-DSeyTAtH.cjs.map +1 -0
- package/dist/assets/CourseWare.css +1 -0
- package/dist/assets/chess.css +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/assets/math.css +1 -0
- package/dist/assets/piano.css +1 -0
- package/dist/assets/sightsing.css +1 -0
- package/dist/assets/typing.css +1 -0
- package/dist/backend.cjs.js +1 -1
- package/dist/backend.cjs.js.map +1 -1
- package/dist/backend.mjs +4 -3
- package/dist/backend.mjs.map +1 -1
- package/dist/chess/components/ChessBoard.vue.d.ts.map +1 -1
- package/dist/chess/composables/useChessgroundBounds.d.ts +24 -0
- package/dist/chess/composables/useChessgroundBounds.d.ts.map +1 -0
- package/dist/chess/questions/puzzle/puzzle.vue.d.ts.map +1 -1
- package/dist/chess-BbHATAzk.js +2949 -0
- package/dist/chess-BbHATAzk.js.map +1 -0
- package/dist/chess-BsgVZARV.cjs +7 -0
- package/dist/chess-BsgVZARV.cjs.map +1 -0
- package/dist/chess-C_2RQEuq.cjs +1 -0
- package/dist/chess-X1bmWmh3.js +3 -0
- package/dist/french-Bxet7hJm.cjs +2 -0
- package/dist/french-Bxet7hJm.cjs.map +1 -0
- package/dist/french-Dk7YG8Td.js +140 -0
- package/dist/french-Dk7YG8Td.js.map +1 -0
- package/dist/french-evUMlbbq.js +3 -0
- package/dist/french-x9P8RRn8.cjs +1 -0
- package/dist/index.cjs.js +2 -170
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +172 -62021
- package/dist/index.mjs.map +1 -1
- package/dist/math-B1oDAkOy.cjs +34 -0
- package/dist/math-B1oDAkOy.cjs.map +1 -0
- package/dist/math-B4HbgYf6.js +13391 -0
- package/dist/math-B4HbgYf6.js.map +1 -0
- package/dist/math-BWlIa6-l.cjs +1 -0
- package/dist/math-DYni7rRl.js +3 -0
- package/dist/piano-BN5Btq91.js +3 -0
- package/dist/piano-Btvkzjfz.cjs +1 -0
- package/dist/piano-CefQUc72.cjs +2 -0
- package/dist/piano-CefQUc72.cjs.map +1 -0
- package/dist/piano-DF1g6yaX.js +3603 -0
- package/dist/piano-DF1g6yaX.js.map +1 -0
- package/dist/pitch-C-lh9ezH.cjs +2 -0
- package/dist/pitch-C-lh9ezH.cjs.map +1 -0
- package/dist/pitch-CgGJFkZ1.js +106 -0
- package/dist/pitch-CgGJFkZ1.js.map +1 -0
- package/dist/pitch-Dn0iNqiS.js +3 -0
- package/dist/pitch-DsopN5IR.cjs +1 -0
- package/dist/{shapes-nszfsx3o.js → shapes-BQUVJdp5.js} +3 -21
- package/dist/shapes-BQUVJdp5.js.map +1 -0
- package/dist/shapes-C_-mvrCc.cjs +2 -0
- package/dist/shapes-C_-mvrCc.cjs.map +1 -0
- package/dist/shapes-DRq8J94A.cjs +2 -0
- package/dist/shapes-DRq8J94A.cjs.map +1 -0
- package/dist/shapes-ICeg46lr.js +25 -0
- package/dist/shapes-ICeg46lr.js.map +1 -0
- package/dist/sightsing-BFQ7HRig.js +41061 -0
- package/dist/sightsing-BFQ7HRig.js.map +1 -0
- package/dist/sightsing-CJX3k0Fd.js +3 -0
- package/dist/sightsing-Cr_SJ5Vc.cjs +133 -0
- package/dist/sightsing-Cr_SJ5Vc.cjs.map +1 -0
- package/dist/sightsing-CtagQ0FJ.cjs +1 -0
- package/dist/typing-BevtfWlp.js +184 -0
- package/dist/typing-BevtfWlp.js.map +1 -0
- package/dist/typing-CBPjtwrg.cjs +1 -0
- package/dist/typing-CK-glKhm.cjs +2 -0
- package/dist/typing-CK-glKhm.cjs.map +1 -0
- package/dist/typing-k-ojjO7G.js +3 -0
- package/dist/word-work-BOnRlZgd.js +108 -0
- package/dist/word-work-BOnRlZgd.js.map +1 -0
- package/dist/word-work-C5MTSapy.cjs +1 -0
- package/dist/word-work-Dd6tIKrt.js +3 -0
- package/dist/word-work-fNbCLNuN.cjs +2 -0
- package/dist/word-work-fNbCLNuN.cjs.map +1 -0
- package/package.json +6 -5
- package/dist/shapes-DJ-ujuDr.cjs +0 -2
- package/dist/shapes-DJ-ujuDr.cjs.map +0 -1
- package/dist/shapes-nszfsx3o.js.map +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const e=require(`./shapes-C_-mvrCc.cjs`),t=require(`./CourseWare-DSeyTAtH.cjs`),n=require(`./shapes-DRq8J94A.cjs`);let r=require(`vue`),i=require(`@vue-skuilder/common-ui`),a=require(`@vue-skuilder/common`);var o=(0,r.defineComponent)({name:`AdditionHorizontal`,components:{UserInputNumber:i.UserInputNumber},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){let n=(0,i.useViewable)(e,t,`AdditionHorizontal`),a=(0,i.useQuestionView)(n),o=(0,r.ref)(``);a.question.value=new m(e.data);let s=(0,r.computed)(()=>a.question.value),submit=()=>{if(s.value){let e=s.value.isCorrect(parseInt(o.value,10));alert(e)}};return{...n,...a,answer:o,question:s,submit}}}),s={"data-viewable":`AdditionHorizontal`};function _sfc_render$9(e,t,n,i,a,o){let c=(0,r.resolveComponent)(`UserInputNumber`);return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,s,[e.question?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[(0,r.createTextVNode)((0,r.toDisplayString)(e.question.a)+` + `+(0,r.toDisplayString)(e.question.b)+` = `,1),(0,r.createVNode)(c,{modelValue:e.answer,"onUpdate:modelValue":t[0]||=t=>e.answer=t},null,8,[`modelValue`])],64)):(0,r.createCommentVNode)(``,!0)])}e.r(_sfc_render$9,`_sfc_render`);var c=t.r(o,[[`render`,_sfc_render$9]]),l=(0,r.defineComponent)({name:`VerbalAddition`,components:{UserInputNumber:i.UserInputNumber},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){let n=(0,i.useViewable)(e,t,`VerbalAddition`),a=(0,i.useQuestionView)(n),o=(0,r.ref)(``);a.question.value=new m(e.data);let s=(0,r.computed)(()=>a.question.value),submit=()=>{if(s.value){let e=s.value.isCorrect(parseInt(o.value,10));alert(e)}};return{...n,...a,answer:o,question:s,submit}}}),u={"data-viewable":`VerbalAddition`};function _sfc_render$8(e,t,n,i,a,o){let s=(0,r.resolveComponent)(`UserInputNumber`);return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,u,[e.question?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[(0,r.createTextVNode)((0,r.toDisplayString)(e.question.a)+` plus `+(0,r.toDisplayString)(e.question.b)+` is `,1),(0,r.createVNode)(s,{modelValue:e.answer,"onUpdate:modelValue":t[0]||=t=>e.answer=t},null,8,[`modelValue`])],64)):(0,r.createCommentVNode)(``,!0)])}e.r(_sfc_render$8,`_sfc_render`);var d=t.r(l,[[`render`,_sfc_render$8]]),p=e.r(function(){let e=[];for(let t=0;t<10;t++)for(let n=0;n<10;n++)e.push({a:t,b:n});return e},`data`),m=class SingleDigitAdditionQuestion extends i.Question{static dataShapes=[n.n];static views=[c,d];a;b;static seedData=p();static acceptsUserData=!1;constructor(e){super(e),this.a=e[0].a,this.b=e[0].b}isCorrect(e){return 1*this.a+this.b===e}dataShapes(){return SingleDigitAdditionQuestion.dataShapes}views(){return SingleDigitAdditionQuestion.views}},h=(0,r.defineComponent)({name:`DivisionHorizontal`,components:{UserInputNumber:i.UserInputNumber},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){let n=(0,i.useViewable)(e,t,`DivisionHorizontal`),a=(0,i.useQuestionView)(n),o=(0,r.ref)(``);a.question.value=new y(e.data);let s=(0,r.computed)(()=>a.question.value),submit=()=>{if(s.value){let e=s.value.isCorrect(parseInt(o.value,10));alert(e)}};return{...n,...a,answer:o,question:s,submit}}}),g={"data-viewable":`DivisionHorizontal`};function _sfc_render$7(e,t,n,i,a,o){let s=(0,r.resolveComponent)(`UserInputNumber`);return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,g,[e.question?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[(0,r.createTextVNode)((0,r.toDisplayString)(e.question.a*e.question.b)+` ÷ `+(0,r.toDisplayString)(e.question.b)+` = `,1),(0,r.createVNode)(s,{modelValue:e.answer,"onUpdate:modelValue":t[0]||=t=>e.answer=t},null,8,[`modelValue`])],64)):(0,r.createCommentVNode)(``,!0)])}e.r(_sfc_render$7,`_sfc_render`);var _=t.r(h,[[`render`,_sfc_render$7]]),v=[{name:`a`,type:a.FieldType.INT},{name:`b`,type:a.FieldType.INT,validator:{instructions:`An integer between 1 and 10, inclusive.`,test:e=>{let t=parseInt(e,10);return 0<t&&t<11?{status:a.Status.ok,msg:``}:t===0?{status:a.Status.error,msg:`Thou shalt not divide by zero.`}:{status:a.Status.error,msg:`Single digit division problem divisors must be between 1 and 10, inclusive.`}}}}],y=class SingleDigitDivisionQuestion extends i.Question{static dataShapes=[{name:a.DataShapeName.MATH_SingleDigitDivision,fields:v}];static views=[_];a;b;constructor(e){super(e),this.a=e[0].a,this.b=e[0].b}isCorrect(e){return this.a*this.b===e}dataShapes(){return SingleDigitDivisionQuestion.dataShapes}views(){return SingleDigitDivisionQuestion.views}},b=(0,r.defineComponent)({name:`MultiplicationHorizontal`,components:{UserInputNumber:i.UserInputNumber},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){let n=(0,i.useViewable)(e,t,`MultiplicationHorizontal`),a=(0,i.useQuestionView)(n),o=(0,r.ref)(``);a.question.value=new O(e.data);let s=(0,r.computed)(()=>a.question.value),submit=()=>{if(s.value){let e=s.value.isCorrect(parseInt(o.value,10));alert(e)}};return{...n,...a,answer:o,question:s,submit}}}),x={"data-viewable":`MultiplicationHorizontal`};function _sfc_render$6(e,t,n,i,a,o){let s=(0,r.resolveComponent)(`UserInputNumber`);return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,x,[e.question?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[(0,r.createTextVNode)((0,r.toDisplayString)(e.question.a)+` × `+(0,r.toDisplayString)(e.question.b)+` = `,1),(0,r.createVNode)(s,{modelValue:e.answer,"onUpdate:modelValue":t[0]||=t=>e.answer=t},null,8,[`modelValue`])],64)):(0,r.createCommentVNode)(``,!0)])}e.r(_sfc_render$6,`_sfc_render`);var S=t.r(b,[[`render`,_sfc_render$6]]),C=(0,r.defineComponent)({name:`VerbalMultiplication`,components:{UserInputNumber:i.UserInputNumber},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){let n=(0,i.useViewable)(e,t,`VerbalMultiplication`),a=(0,i.useQuestionView)(n),o=(0,r.ref)(``);a.question.value=new O(e.data);let s=(0,r.computed)(()=>a.question.value),submit=()=>{if(s.value){let e=s.value.isCorrect(parseInt(o.value,10));alert(e)}};return{...n,...a,answer:o,question:s,submit}}}),w={"data-viewable":`VerbalMultiplication`};function _sfc_render$5(e,t,n,i,a,o){let s=(0,r.resolveComponent)(`UserInputNumber`);return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,w,[e.question?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[(0,r.createTextVNode)((0,r.toDisplayString)(e.question.a)+` times `+(0,r.toDisplayString)(e.question.b)+` is `,1),(0,r.createVNode)(s,{modelValue:e.answer,"onUpdate:modelValue":t[0]||=t=>e.answer=t},null,8,[`modelValue`])],64)):(0,r.createCommentVNode)(``,!0)])}e.r(_sfc_render$5,`_sfc_render`);var T=t.r(C,[[`render`,_sfc_render$5]]),E={instructions:`An integer between 0 and 10, inclusive.`,test:e=>{let t=parseInt(e,10);return 0<=t&&t<=10?{status:a.Status.ok,msg:``}:{status:a.Status.error,msg:`Single digit multiplication problem inputs must be between 0 and 10, inclusive.`}}},D=[{name:`a`,type:a.FieldType.INT,validator:E},{name:`b`,type:a.FieldType.INT,validator:E}],O=class SingleDigitMultiplicationQuestion extends i.Question{static dataShapes=[{name:a.DataShapeName.MATH_SingleDigitMultiplication,fields:D}];static views=[T,S];a;b;constructor(e){super(e),this.a=e[0].a,this.b=e[0].b}isCorrect(e){return this.a*this.b===e}dataShapes(){return SingleDigitMultiplicationQuestion.dataShapes}views(){return SingleDigitMultiplicationQuestion.views}},k=(0,r.defineComponent)({name:`TrueFalse`,components:{TFSelect:i.TFSelect},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){let n=(0,i.useQuestionView)((0,i.useViewable)(e,t,`TrueFalse`));n.question.value=new M(e.data);let a=(0,r.computed)(()=>new M(e.data)),submit=e=>{alert(a.value.isCorrect(e===0))};return{question:a,submit}}}),A={"data-viewable":`TrueFalse`};function _sfc_render$4(e,t,n,i,a,o){let s=(0,r.resolveComponent)(`TFSelect`);return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,A,[(0,r.createTextVNode)((0,r.toDisplayString)(e.question.a)+` = `+(0,r.toDisplayString)(e.question.b)+` `,1),(0,r.createVNode)(s,{submit:e.submit},null,8,[`submit`])])}e.r(_sfc_render$4,`_sfc_render`);var j=t.r(k,[[`render`,_sfc_render$4]]),M=class EqualityTest extends i.Question{static dataShapes=[n.t];static views=[j];a;b;constructor(e){super(e),this.a=e[0].a,this.b=e[0].b}isCorrect(e){return this.a===this.b===e}dataShapes(){return EqualityTest.dataShapes}views(){return EqualityTest.views}},N=(0,r.defineComponent)({name:`SolveView`,components:{UserInputNumber:i.UserInputNumber},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:n}){let a=(0,i.useViewable)(e,n,`Solve`),o=(0,i.useQuestionView)(a),s=(0,r.ref)(``),c=[`a`,`b`,`d`,`A`,`z`,`B`,`d`,`y`],l=(0,r.ref)(c[t.o(0,c.length)]);o.question.value=new re(e.data);let u=(0,r.computed)(()=>o.question.value),submit=()=>{if(u.value){let e=u.value.isCorrect(parseInt(s.value,10));alert(e)}};return{...a,...o,answer:s,question:u,variable:l,submit}}}),P={"data-viewable":`Solve`},F={key:0},I={key:1},L={key:2},ee={key:3},te={key:4};function _sfc_render$3(e,t,n,i,a,o){let s=(0,r.resolveComponent)(`UserInputNumber`);return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,P,[e.question?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[t[1]||=(0,r.createElementVNode)(`h4`,null,`Solve the Equation`,-1),t[2]||=(0,r.createElementVNode)(`br`,null,null,-1),t[3]||=(0,r.createElementVNode)(`br`,null,null,-1),e.question.operation.valueOf()===`ADDITION`?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,F,(0,r.toDisplayString)(e.variable)+` - `+(0,r.toDisplayString)(e.question.a)+` = `+(0,r.toDisplayString)(e.question.b),1)):e.question.operation.valueOf()===`SUBTRACTION`?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,I,(0,r.toDisplayString)(e.variable)+` + `+(0,r.toDisplayString)(e.question.a)+` = `+(0,r.toDisplayString)(e.question.b),1)):e.question.operation.valueOf()===`MULTIPLICATION`?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,L,(0,r.toDisplayString)(e.variable)+` ÷ `+(0,r.toDisplayString)(e.question.a)+` = `+(0,r.toDisplayString)(e.question.b),1)):e.question.operation.valueOf()===`DIVISION`?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,ee,(0,r.toDisplayString)(e.variable)+` * `+(0,r.toDisplayString)(e.question.a)+` = `+(0,r.toDisplayString)(e.question.b*e.question.a),1)):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,te,`No operation!? (This should never show)`)),t[4]||=(0,r.createElementVNode)(`br`,null,null,-1),t[5]||=(0,r.createElementVNode)(`br`,null,null,-1),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(e.variable)+` = `,1),(0,r.createVNode)(s,{modelValue:e.answer,"onUpdate:modelValue":t[0]||=t=>e.answer=t},null,8,[`modelValue`])],64)):(0,r.createCommentVNode)(``,!0)])}e.r(_sfc_render$3,`_sfc_render`);var R=t.r(N,[[`render`,_sfc_render$3]]),ne={instructions:`An integer between 0 and 10, inclusive.`,test:e=>{let t=parseInt(e,10);return 0<=t&&t<=100?{status:a.Status.ok,msg:``}:{status:a.Status.error,msg:`Single-step equation problem inputs must be between 0 and 100, inclusive.`}}},z=[{name:`a`,type:a.FieldType.INT,validator:ne},{name:`b`,type:a.FieldType.INT,validator:ne},{name:`operation`,type:a.FieldType.STRING,validator:{test:e=>e===B.ADDITION||e===B.SUBTRACTION||e===B.MULTIPLICATION||e===B.DIVISION?{status:a.Status.ok,msg:``}:{status:a.Status.error,msg:`Operation must be ADDITION, SUBTRACTION, MULTIPLICATION, or DIVISION`}}}],B=function(e){return e.ADDITION=`ADDITION`,e.SUBTRACTION=`SUBTRACTION`,e.MULTIPLICATION=`MULTIPLICATION`,e.DIVISION=`DIVISION`,e}(B||{}),re=class OneStepEquation extends i.Question{static dataShapes=[{name:a.DataShapeName.MATH_OneStepEquation,fields:z}];static views=[R];a;b;operation;constructor(e){super(e),this.a=e[0].a,this.b=e[0].b,this.operation=e[0].operation}answer(){let e=0;return this.operation===B.ADDITION?e=this.a+this.b:this.operation===B.SUBTRACTION?e=this.b-this.a:this.operation===B.MULTIPLICATION?e=this.a*this.b:this.operation===B.DIVISION&&(e=this.b),(0,a.log)(`The answer is ${e}
|
|
2
|
+
The operation is ${this.operation.valueOf()}
|
|
3
|
+
this.a = ${this.a}
|
|
4
|
+
this.b = ${this.b}
|
|
5
|
+
`),e}isCorrect(e){return e===this.answer()}dataShapes(){return OneStepEquation.dataShapes}views(){return OneStepEquation.views}},ie=(0,r.defineComponent)({name:`AngleCategorizeV`,components:{RadioMultipleChoice:i.RadioMultipleChoice},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:n}){let a=(0,i.useViewable)(e,n,`AngleCategorizeV`),o=(0,i.useQuestionView)(a),s=(0,r.ref)(null);o.question.value=new oe(e.data);let c=(0,r.computed)(()=>o.question.value),l=(0,r.computed)(()=>{if(!c.value)return 0;let e=c.value.angleCategory;if(e===G.ACUTE)return t.o(10,83);if(e===G.RIGHT)return 90;if(e===G.OBTUSE)return t.o(97,173);if(e===G.STRAIGHT)return 180;if(e===G.REFLEX)return t.o(190,350);throw Error(`Unknown Angle type on AngleCategorize question`)});return(0,r.onMounted)(()=>{if(!s.value)return;let e=s.value.width,n=s.value.height,r=s.value.getContext(`2d`);if(!r)return;let i=t.o(0,360),a=i+l.value;r.moveTo(e/2,n/2);let o=e/2+e*Math.cos(i/360*2*Math.PI),c=n/2+e*Math.sin(i/360*2*Math.PI);r.lineTo(o,c),r.stroke(),r.moveTo(e/2,n/2);let u=e/2+e*Math.cos(a/360*2*Math.PI),d=n/2+e*Math.sin(a/360*2*Math.PI);r.lineTo(u,d),r.stroke(),r.moveTo(e/2,n/2),r.beginPath(),r.arc(e/2,n/2,25,i/360*2*Math.PI,a/360*2*Math.PI),r.stroke()}),{...a,...o,canvasRef:s,question:c}}}),V={"data-viewable":`AngleCategorizeV`},H={ref:`canvasRef`,width:`300`,height:`300`};function _sfc_render$2(e,t,n,i,a,o){let s=(0,r.resolveComponent)(`radio-multiple-choice`);return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,V,[e.question?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[t[0]||=(0,r.createElementVNode)(`h2`,null,`What kind of angle is this?`,-1),(0,r.createElementVNode)(`canvas`,H,null,512),(0,r.createVNode)(s,{"choice-list":e.question.answers},null,8,[`choice-list`])],64)):(0,r.createCommentVNode)(``,!0)])}e.r(_sfc_render$2,`_sfc_render`);var U=t.r(ie,[[`render`,_sfc_render$2],[`__scopeId`,`data-v-57f16e4a`]]),W={instructions:`Must be "ACUTE", "RIGHT", "OBTUSE", "STRAIGHT", or "REFLEX".`,test:e=>e===G.ACUTE||e===G.OBTUSE||e===G.REFLEX||e===G.RIGHT||e===G.STRAIGHT?{status:a.Status.ok,msg:``}:{status:a.Status.error,msg:`Must be "ACUTE", "RIGHT", "OBTUSE", "STRAIGHT", or "REFLEX".`}},G=function(e){return e.ACUTE=`ACUTE`,e.RIGHT=`RIGHT`,e.OBTUSE=`OBTUSE`,e.STRAIGHT=`STRAIGHT`,e.REFLEX=`REFLEX`,e}({}),ae=[{name:`Category`,type:a.FieldType.STRING,validator:W}],oe=class AngleCategorize extends i.Question{static dataShapes=[{name:a.DataShapeName.MATH_AngleCategorize,fields:ae}];static views=[U];angleCategory;answers;constructor(e){super(e),this.angleCategory=e[0].Category,this.answers=t.s([G.ACUTE,G.OBTUSE,G.REFLEX,G.RIGHT,G.STRAIGHT])}isCorrect(e){return this.angleCategory.valueOf()===e.choiceList[e.selection]}dataShapes(){return AngleCategorize.dataShapes}views(){return AngleCategorize.views}},K=e.n(((e,t)=>{t.exports={}})),se=e.n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.acorn={}))})(e,(function(e){"use strict";var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],r=`·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`,i=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ꟑꟑꟓꟕ-ꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,a={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},o=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,s={5:o,"5module":o+` export import`,6:o+` const class extends export import super`},c=/^in(stanceof)?$/,l=RegExp(`[`+i+`]`),u=RegExp(`[`+i+r+`]`);function isInAstralSet(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function isIdentifierStart(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&l.test(String.fromCharCode(e)):t===!1?!1:isInAstralSet(e,n)}function isIdentifierChar(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&u.test(String.fromCharCode(e)):r===!1?!1:isInAstralSet(e,n)||isInAstralSet(e,t)}var d=function TokenType(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function binop(e,t){return new d(e,{beforeExpr:!0,binop:t})}var p={beforeExpr:!0},m={startsExpr:!0},h={};function kw(e,t){return t===void 0&&(t={}),t.keyword=e,h[e]=new d(e,t)}var g={num:new d(`num`,m),regexp:new d(`regexp`,m),string:new d(`string`,m),name:new d(`name`,m),privateId:new d(`privateId`,m),eof:new d(`eof`),bracketL:new d(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new d(`]`),braceL:new d(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new d(`}`),parenL:new d(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new d(`)`),comma:new d(`,`,p),semi:new d(`;`,p),colon:new d(`:`,p),dot:new d(`.`),question:new d(`?`,p),questionDot:new d(`?.`),arrow:new d(`=>`,p),template:new d(`template`),invalidTemplate:new d(`invalidTemplate`),ellipsis:new d(`...`,p),backQuote:new d("`",m),dollarBraceL:new d("${",{beforeExpr:!0,startsExpr:!0}),eq:new d(`=`,{beforeExpr:!0,isAssign:!0}),assign:new d(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new d(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new d(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:binop(`||`,1),logicalAND:binop(`&&`,2),bitwiseOR:binop(`|`,3),bitwiseXOR:binop(`^`,4),bitwiseAND:binop(`&`,5),equality:binop(`==/!=/===/!==`,6),relational:binop(`</>/<=/>=`,7),bitShift:binop(`<</>>/>>>`,8),plusMin:new d(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:binop(`%`,10),star:binop(`*`,10),slash:binop(`/`,10),starstar:new d(`**`,{beforeExpr:!0}),coalesce:binop(`??`,1),_break:kw(`break`),_case:kw(`case`,p),_catch:kw(`catch`),_continue:kw(`continue`),_debugger:kw(`debugger`),_default:kw(`default`,p),_do:kw(`do`,{isLoop:!0,beforeExpr:!0}),_else:kw(`else`,p),_finally:kw(`finally`),_for:kw(`for`,{isLoop:!0}),_function:kw(`function`,m),_if:kw(`if`),_return:kw(`return`,p),_switch:kw(`switch`),_throw:kw(`throw`,p),_try:kw(`try`),_var:kw(`var`),_const:kw(`const`),_while:kw(`while`,{isLoop:!0}),_with:kw(`with`),_new:kw(`new`,{beforeExpr:!0,startsExpr:!0}),_this:kw(`this`,m),_super:kw(`super`,m),_class:kw(`class`,m),_extends:kw(`extends`,p),_export:kw(`export`),_import:kw(`import`,m),_null:kw(`null`,m),_true:kw(`true`,m),_false:kw(`false`,m),_in:kw(`in`,{beforeExpr:!0,binop:7}),_instanceof:kw(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:kw(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kw(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kw(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},_=/\r\n?|\n|\u2028|\u2029/,v=new RegExp(_.source,`g`);function isNewLine(e){return e===10||e===13||e===8232||e===8233}function nextLineBreak(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(isNewLine(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var y=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,b=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,x=Object.prototype,S=x.hasOwnProperty,C=x.toString,w=Object.hasOwn||(function(e,t){return S.call(e,t)}),T=Array.isArray||(function(e){return C.call(e)===`[object Array]`}),E=Object.create(null);function wordsRegexp(e){return E[e]||(E[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var D=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,O=function Position(e,t){this.line=e,this.column=t};O.prototype.offset=function offset(e){return new O(this.line,this.column+e)};var k=function SourceLocation(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function getLineInfo(e,t){for(var n=1,r=0;;){var i=nextLineBreak(e,r,t);if(i<0)return new O(n,t-r);++n,r=i}}var A={ecmaVersion:null,sourceType:`script`,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},j=!1;function getOptions(e){var t={};for(var n in A)t[n]=e&&w(e,n)?e[n]:A[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!j&&typeof console==`object`&&console.warn&&(j=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
6
|
+
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),T(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}return T(t.onComment)&&(t.onComment=pushComment(t,t.onComment)),t}function pushComment(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new k(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var M=1,N=2,P=4,F=8,I=16,L=32,ee=64,te=128,R=256,ne=M|N|R;function functionFlags(e,t){return N|(e?P:0)|(t?F:0)}var z=0,B=1,re=2,ie=3,V=4,H=5,U=function Parser(e,t,n){this.options=e=getOptions(e),this.sourceFile=e.sourceFile,this.keywords=wordsRegexp(s[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=a[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=wordsRegexp(r);var i=(r?r+` `:``)+a.strict;this.reservedWordsStrict=wordsRegexp(i),this.reservedWordsStrictBind=wordsRegexp(i+` `+a.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(`
|
|
7
|
+
`,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(_).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=g.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(M),this.regexpState=null,this.privateNameStack=[]},W={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};U.prototype.parse=function parse(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},W.inFunction.get=function(){return(this.currentVarScope().flags&N)>0},W.inGenerator.get=function(){return(this.currentVarScope().flags&F)>0&&!this.currentVarScope().inClassFieldInit},W.inAsync.get=function(){return(this.currentVarScope().flags&P)>0&&!this.currentVarScope().inClassFieldInit},W.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&R)return!1;if(t.flags&N)return(t.flags&P)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},W.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,n=e.inClassFieldInit;return(t&ee)>0||n||this.options.allowSuperOutsideMethod},W.allowDirectSuper.get=function(){return(this.currentThisScope().flags&te)>0},W.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},W.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,n=e.inClassFieldInit;return(t&(N|R))>0||n},W.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&R)>0},U.extend=function extend(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},U.parse=function parse(e,t){return new this(t,e).parse()},U.parseExpressionAt=function parseExpressionAt(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},U.tokenizer=function tokenizer(e,t){return new this(t,e)},Object.defineProperties(U.prototype,W);var G=U.prototype,ae=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;G.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){b.lastIndex=e,e+=b.exec(this.input)[0].length;var t=ae.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){b.lastIndex=e+t[0].length;var n=b.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||_.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`)}e+=t[0].length,b.lastIndex=e,e+=b.exec(this.input)[0].length,this.input[e]===`;`&&e++}},G.eat=function(e){return this.type===e?(this.next(),!0):!1},G.isContextual=function(e){return this.type===g.name&&this.value===e&&!this.containsEsc},G.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},G.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},G.canInsertSemicolon=function(){return this.type===g.eof||this.type===g.braceR||_.test(this.input.slice(this.lastTokEnd,this.start))},G.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},G.semicolon=function(){!this.eat(g.semi)&&!this.insertSemicolon()&&this.unexpected()},G.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},G.expect=function(e){this.eat(e)||this.unexpected()},G.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var oe=function DestructuringErrors(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};G.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},G.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},G.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},G.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var K=U.prototype;K.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==g.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,`Program`)};var se={kind:`loop`},ce={kind:`switch`};K.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;b.lastIndex=this.pos;var t=b.exec(this.input),n=this.pos+t[0].length,r=this.input.charCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(isIdentifierStart(r,!0)){for(var i=n+1;isIdentifierChar(r=this.input.charCodeAt(i),!0);)++i;if(r===92||r>55295&&r<56320)return!0;var a=this.input.slice(n,i);if(!c.test(a))return!0}return!1},K.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;b.lastIndex=this.pos;var e=b.exec(this.input),t=this.pos+e[0].length,n;return!_.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(isIdentifierChar(n=this.input.charCodeAt(t+8))||n>55295&&n<56320))},K.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=g._var,a=`let`),r){case g._break:case g._continue:return this.parseBreakContinueStatement(i,r.keyword);case g._debugger:return this.parseDebuggerStatement(i);case g._do:return this.parseDoStatement(i);case g._for:return this.parseForStatement(i);case g._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case g._class:return e&&this.unexpected(),this.parseClass(i,!0);case g._if:return this.parseIfStatement(i);case g._return:return this.parseReturnStatement(i);case g._switch:return this.parseSwitchStatement(i);case g._throw:return this.parseThrowStatement(i);case g._try:return this.parseTryStatement(i);case g._const:case g._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case g._while:return this.parseWhileStatement(i);case g._with:return this.parseWithStatement(i);case g.braceL:return this.parseBlock(!0,i);case g.semi:return this.parseEmptyStatement(i);case g._export:case g._import:if(this.options.ecmaVersion>10&&r===g._import){b.lastIndex=this.pos;var o=b.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===g._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.value,u=this.parseExpression();return r===g.name&&u.type===`Identifier`&&this.eat(g.colon)?this.parseLabeledStatement(i,l,u,e):this.parseExpressionStatement(i,u)}},K.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(g.semi)||this.insertSemicolon()?e.label=null:this.type===g.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},K.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},K.parseDoStatement=function(e){return this.next(),this.labels.push(se),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(g._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(g.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},K.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(se),this.enterScope(0),this.expect(g.parenL),this.type===g.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===g._var||this.type===g._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),(this.type===g._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===g._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var a=this.isContextual(`let`),o=!1,s=this.containsEsc,c=new oe,l=this.start,u=t>-1?this.parseExprSubscripts(c,`await`):this.parseExpression(!0,c);return this.type===g._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===g._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(u.start===l&&!s&&u.type===`Identifier`&&u.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(u.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(u,!1,c),this.checkLValPattern(u),this.parseForIn(e,u)):(this.checkExpressionErrors(c,!0),t>-1&&this.unexpected(t),this.parseFor(e,u))},K.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,ue|(n?0:de),!1,t)},K.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(g._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},K.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,`'return' outside of function`),this.next(),this.eat(g.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},K.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(g.braceL),this.labels.push(ce),this.enterScope(0);for(var t,n=!1;this.type!==g.braceR;)if(this.type===g._case||this.type===g._default){var r=this.type===g._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(g.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},K.parseThrowStatement=function(e){return this.next(),_.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var le=[];K.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?L:0),this.checkLValPattern(e,t?V:re),this.expect(g.parenR),e},K.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===g._catch){var t=this.startNode();this.next(),this.eat(g.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(g._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},K.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},K.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(se),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},K.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},K.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},K.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===g._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},K.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},K.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(g.braceL),e&&this.enterScope(0);this.type!==g.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},K.parseFor=function(e,t){return e.init=t,this.expect(g.semi),e.test=this.type===g.semi?null:this.parseExpression(),this.expect(g.semi),e.update=this.type===g.parenR?null:this.parseExpression(),this.expect(g.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},K.parseForIn=function(e,t){var n=this.type===g._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(g.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},K.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(g.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===g._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&i.id.type!==`Identifier`&&!(t&&(this.type===g._in||this.isContextual(`of`)))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(g.comma))break}return e},K.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?B:re,!1)};var ue=1,de=2,fe=4;K.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===g.star&&t&de&&this.unexpected(),e.generator=this.eat(g.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&ue&&(e.id=t&fe&&this.type!==g.name?null:this.parseIdent(),e.id&&!(t&de)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?B:re:ie));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags(e.async,e.generator)),t&ue||(e.id=this.type===g.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&ue?`FunctionDeclaration`:`FunctionExpression`)},K.parseFunctionParams=function(e){this.expect(g.parenL),e.params=this.parseBindingList(g.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},K.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(g.braceL);this.type!==g.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&isPrivateNameConflicted(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},K.parseClassElement=function(e){if(this.eat(g.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(g.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===g.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===g.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(g.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===g.parenL||o!==`method`||i||a){var l=!n.static&&checkKeyName(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},K.isClassElementNameStart=function(){return this.type===g.name||this.type===g.privateId||this.type===g.num||this.type===g.string||this.type===g.bracketL||this.type.keyword},K.parseClassElementName=function(e){this.type===g.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},K.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&checkKeyName(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},K.parseClassField=function(e){if(checkKeyName(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&checkKeyName(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(g.eq)){var t=this.currentThisScope(),n=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=n}else e.value=null;return this.semicolon(),this.finishNode(e,`PropertyDefinition`)},K.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(R|ee);this.type!==g.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},K.parseClassId=function(e,t){this.type===g.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,re,!1)):(t===!0&&this.unexpected(),e.id=null)},K.parseClassSuper=function(e){e.superClass=this.eat(g._extends)?this.parseExprSubscripts(null,!1):null},K.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},K.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];w(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function isPrivateNameConflicted(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function checkKeyName(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}K.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==g.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},K.parseExport=function(e,t){if(this.next(),this.eat(g.star))return this.parseExportAllDeclaration(e,t);if(this.eat(g._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==g.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},K.parseExportDeclaration=function(e){return this.parseStatement(null)},K.parseExportDefaultDeclaration=function(){var e;if(this.type===g._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,ue|fe,!1,e)}else if(this.type===g._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}else{var r=this.parseMaybeAssign();return this.semicolon(),r}},K.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),w(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},K.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},K.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},K.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},K.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},K.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(g.braceL);!this.eat(g.braceR);){if(n)n=!1;else if(this.expect(g.comma),this.afterTrailingComma(g.braceR))break;t.push(this.parseExportSpecifier(e))}return t},K.parseImport=function(e){return this.next(),this.type===g.string?(e.specifiers=le,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===g.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},K.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,re),this.finishNode(e,`ImportSpecifier`)},K.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,re),this.finishNode(e,`ImportDefaultSpecifier`)},K.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,re),this.finishNode(e,`ImportNamespaceSpecifier`)},K.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===g.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(g.comma)))return e;if(this.type===g.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(g.braceL);!this.eat(g.braceR);){if(t)t=!1;else if(this.expect(g.comma),this.afterTrailingComma(g.braceR))break;e.push(this.parseImportSpecifier())}return e},K.parseWithClause=function(){var e=[];if(!this.eat(g._with))return e;this.expect(g.braceL);for(var t={},n=!0;!this.eat(g.braceR);){if(n)n=!1;else if(this.expect(g.comma),this.afterTrailingComma(g.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;w(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},K.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===g.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(g.colon),this.type!==g.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},K.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===g.string){var e=this.parseLiteral(this.value);return D.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},K.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},K.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var q=U.prototype;q.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},q.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},q.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},q.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==g.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},q.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case g.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(g.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case g.braceL:return this.parseObj(!0)}return this.parseIdent()},q.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(g.comma),t&&this.type===g.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===g.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===g.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},q.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},q.parseBindingListItem=function(e){return e},q.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(g.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},q.checkLValSimple=function(e,t,n){t===void 0&&(t=z);var r=t!==z;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===re&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(w(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==H&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},q.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=z),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},q.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=z),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var J=function TokContext(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},Y={b_stat:new J(`{`,!1),b_expr:new J(`{`,!0),b_tmpl:new J("${",!1),p_stat:new J(`(`,!1),p_expr:new J(`(`,!0),q_tmpl:new J("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new J(`function`,!1),f_expr:new J(`function`,!0),f_expr_gen:new J(`function`,!0,!1,null,!0),f_gen:new J(`function`,!1,!1,null,!0)},X=U.prototype;X.initialContext=function(){return[Y.b_stat]},X.curContext=function(){return this.context[this.context.length-1]},X.braceIsBlock=function(e){var t=this.curContext();return t===Y.f_expr||t===Y.f_stat?!0:e===g.colon&&(t===Y.b_stat||t===Y.b_expr)?!t.isExpr:e===g._return||e===g.name&&this.exprAllowed?_.test(this.input.slice(this.lastTokEnd,this.start)):e===g._else||e===g.semi||e===g.eof||e===g.parenR||e===g.arrow?!0:e===g.braceL?t===Y.b_stat:e===g._var||e===g._const||e===g.name?!1:!this.exprAllowed},X.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},X.updateContext=function(e){var t,n=this.type;n.keyword&&e===g.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},X.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},g.parenR.updateContext=g.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===Y.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},g.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?Y.b_stat:Y.b_expr),this.exprAllowed=!0},g.dollarBraceL.updateContext=function(){this.context.push(Y.b_tmpl),this.exprAllowed=!0},g.parenL.updateContext=function(e){var t=e===g._if||e===g._for||e===g._with||e===g._while;this.context.push(t?Y.p_stat:Y.p_expr),this.exprAllowed=!0},g.incDec.updateContext=function(){},g._function.updateContext=g._class.updateContext=function(e){e.beforeExpr&&e!==g._else&&!(e===g.semi&&this.curContext()!==Y.p_stat)&&!(e===g._return&&_.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===g.colon||e===g.braceL)&&this.curContext()===Y.b_stat)?this.context.push(Y.f_expr):this.context.push(Y.f_stat),this.exprAllowed=!1},g.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},g.backQuote.updateContext=function(){this.curContext()===Y.q_tmpl?this.context.pop():this.context.push(Y.q_tmpl),this.exprAllowed=!1},g.star.updateContext=function(e){if(e===g._function){var t=this.context.length-1;this.context[t]===Y.f_expr?this.context[t]=Y.f_expr_gen:this.context[t]=Y.f_gen}this.exprAllowed=!0},g.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==g.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var Z=U.prototype;Z.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);return}i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}},Z.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===g.comma){var a=this.startNodeAt(n,r);for(a.expressions=[i];this.eat(g.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,`SequenceExpression`)}return i},Z.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new oe,r=!0);var s=this.start,c=this.startLoc;(this.type===g.parenL||this.type===g.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===g.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===g.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}else r&&this.checkExpressionErrors(t,!0);return i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},Z.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(g.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(g.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},Z.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},Z.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==g._in)&&a>r){var o=this.type===g.logicalOR||this.type===g.logicalAND,s=this.type===g.coalesce;s&&(a=g.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),p=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===g.coalesce||s&&(this.type===g.logicalOR||this.type===g.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(p,t,n,r,i)}return e},Z.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},Z.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===g.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&isLocalVariableAccess(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&isPrivateFieldAccess(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===g.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==g._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&this.eat(g.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1);else return o};function isLocalVariableAccess(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&isLocalVariableAccess(e.expression)}function isPrivateFieldAccess(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&isPrivateFieldAccess(e.expression)||e.type===`ParenthesizedExpression`&&isPrivateFieldAccess(e.expression)}Z.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if(i.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return i;var a=this.parseSubscripts(i,n,r,!1,t);return e&&a.type===`MemberExpression`&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a},Z.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s===e||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s}},Z.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(g.arrow)},Z.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},Z.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(g.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(g.bracketL);if(l||c&&this.type!==g.parenL&&this.type!==g.backQuote||this.eat(g.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(g.bracketR)):this.type===g.privateId&&e.type!==`Super`?u.property=this.parsePrivateIdent():u.property=this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(g.parenL)){var d=new oe,p=this.yieldPos,m=this.awaitPos,h=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var _=this.parseExprList(g.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=p,this.awaitPos=m,this.awaitIdentPos=h,this.parseSubscriptAsyncArrow(t,n,_,o);this.checkExpressionErrors(d,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=m||this.awaitPos,this.awaitIdentPos=h||this.awaitIdentPos;var v=this.startNodeAt(t,n);v.callee=e,v.arguments=_,s&&(v.optional=c),e=this.finishNode(v,`CallExpression`)}else if(this.type===g.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var y=this.startNodeAt(t,n);y.tag=e,y.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(y,`TaggedTemplateExpression`)}return e},Z.parseExprAtom=function(e,t,n){this.type===g.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case g._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===g.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==g.dot&&this.type!==g.bracketL&&this.type!==g.parenL&&this.unexpected(),this.finishNode(r,`Super`);case g._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case g.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(g._function))return this.overrideContext(Y.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(g.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===g.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(g.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case g.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case g.num:case g.string:return this.parseLiteral(this.value);case g._null:case g._true:case g._false:return r=this.startNode(),r.value=this.type===g._null?null:this.type===g._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case g.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case g.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(g.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case g.braceL:return this.overrideContext(Y.b_expr),this.parseObj(!1,e);case g._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case g._class:return this.parseClass(this.startNode(),!1);case g._new:return this.parseNew();case g.backQuote:return this.parseTemplate();case g._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},Z.parseExprAtomDefault=function(){this.unexpected()},Z.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===g.parenL&&!e)return this.parseDynamicImport(t);if(this.type===g.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}else this.unexpected()},Z.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(g.parenR)?e.options=null:(this.expect(g.comma),this.afterTrailingComma(g.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(g.parenR)||(this.expect(g.comma),this.afterTrailingComma(g.parenR)||this.unexpected())));else if(!this.eat(g.parenR)){var t=this.start;this.eat(g.comma)&&this.eat(g.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},Z.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},Z.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,``)),this.next(),this.finishNode(t,`Literal`)},Z.parseParenExpression=function(){this.expect(g.parenL);var e=this.parseExpression();return this.expect(g.parenR),e},Z.shouldParseArrow=function(e){return!this.canInsertSemicolon()},Z.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new oe,p=this.yieldPos,m=this.awaitPos,h;for(this.yieldPos=0,this.awaitPos=0;this.type!==g.parenR;)if(l?l=!1:this.expect(g.comma),a&&this.afterTrailingComma(g.parenR,!0)){u=!0;break}else if(this.type===g.ellipsis){h=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===g.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}else c.push(this.parseMaybeAssign(!1,d,this.parseParenItem));var _=this.lastTokEnd,v=this.lastTokEndLoc;if(this.expect(g.parenR),e&&this.shouldParseArrow(c)&&this.eat(g.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=m,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),h&&this.unexpected(h),this.checkExpressionErrors(d,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=m||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,_,v)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var y=this.startNodeAt(n,r);return y.expression=i,this.finishNode(y,`ParenthesizedExpression`)}else return i},Z.parseParenItem=function(e){return e},Z.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var pe=[];Z.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===g.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),this.eat(g.parenL)?e.arguments=this.parseExprList(g.parenR,this.options.ecmaVersion>=8,!1):e.arguments=pe,this.finishNode(e,`NewExpression`)},Z.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===g.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
|
|
8
|
+
`),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
9
|
+
`),cooked:this.value},this.next(),n.tail=this.type===g.backQuote,this.finishNode(n,`TemplateElement`)},Z.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===g.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(g.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(g.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},Z.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===g.name||this.type===g.num||this.type===g.string||this.type===g.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===g.star)&&!_.test(this.input.slice(this.lastTokEnd,this.start))},Z.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(g.braceR);){if(r)r=!1;else if(this.expect(g.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(g.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},Z.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(g.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===g.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===g.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(g.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(g.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},Z.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var t=e.kind===`get`?0:1;if(e.value.params.length!==t){var n=e.value.start;e.kind===`get`?this.raiseRecoverable(n,`getter should have no params`):this.raiseRecoverable(n,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},Z.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===g.colon&&this.unexpected(),this.eat(g.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===g.parenL?(t&&this.unexpected(),e.kind=`init`,e.method=!0,e.value=this.parseMethod(n,r)):!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==g.comma&&this.type!==g.braceR&&this.type!==g.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),e.kind=`init`,t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===g.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()},Z.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(g.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(g.bracketR),e.key;e.computed=!1}return e.key=this.type===g.num||this.type===g.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},Z.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Z.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags(t,r.generator)|ee|(n?te:0)),this.expect(g.parenL),r.params=this.parseBindingList(g.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},Z.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(functionFlags(n,!1)|I),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},Z.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==g.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,H),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},Z.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},Z.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,B,t?null:n)}},Z.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(g.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===g.comma?o=null:this.type===g.ellipsis?(o=this.parseSpread(r),r&&this.type===g.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},Z.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),this.currentThisScope().inClassFieldInit&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},Z.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},Z.parseIdentNode=function(){var e=this.startNode();return this.type===g.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name===`class`||e.name===`function`)&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=g.name):this.unexpected(),e},Z.parsePrivateIdent=function(){var e=this.startNode();return this.type===g.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},Z.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===g.semi||this.canInsertSemicolon()||this.type!==g.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(g.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},Z.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var me=U.prototype;me.raise=function(e,t){var n=getLineInfo(this.input,e);t+=` (`+n.line+`:`+n.column+`)`;var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},me.raiseRecoverable=me.raise,me.curPosition=function(){if(this.options.locations)return new O(this.curLine,this.pos-this.lineStart)};var he=U.prototype,ge=function Scope(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};he.enterScope=function(e){this.scopeStack.push(new ge(e))},he.exitScope=function(){this.scopeStack.pop()},he.treatFunctionsAsVarInScope=function(e){return e.flags&N||!this.inModule&&e.flags&M},he.declareName=function(e,t,n){var r=!1;if(t===re){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&M&&delete this.undefinedExports[e]}else if(t===V)this.currentScope().lexical.push(e);else if(t===ie){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&L&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&M&&delete this.undefinedExports[e],s.flags&ne)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},he.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},he.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},he.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&ne)return t}},he.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&ne&&!(t.flags&I))return t}};var _e=function Node(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new k(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},ve=U.prototype;ve.startNode=function(){return new _e(this,this.start,this.startLoc)},ve.startNodeAt=function(e,t){return new _e(this,e,t)};function finishNodeAt(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}ve.finishNode=function(e,t){return finishNodeAt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},ve.finishNodeAt=function(e,t,n,r){return finishNodeAt.call(this,e,t,n,r)},ve.copyNode=function(e){var t=new _e(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var ye=`Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz`,be=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,xe=be+` Extended_Pictographic`,Se=xe,Ce=Se+` EBase EComp EMod EPres ExtPict`,we=Ce,Te=we,Ee={9:be,10:xe,11:Se,12:Ce,13:we,14:Te},De=`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`,Oe={9:``,10:``,11:``,12:``,13:``,14:De},ke=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,Ae=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,je=Ae+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,Me=je+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,Ne=Me+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,Pe=Ne+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,Fe=Pe+` `+ye,Ie={9:Ae,10:je,11:Me,12:Ne,13:Pe,14:Fe},Le={};function buildUnicodeData(e){var t=Le[e]={binary:wordsRegexp(Ee[e]+` `+ke),binaryOfStrings:wordsRegexp(Oe[e]),nonBinary:{General_Category:wordsRegexp(ke),Script:wordsRegexp(Ie[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var Re=0,ze=[9,10,11,12,13,14];Re<ze.length;Re+=1){var Be=ze[Re];buildUnicodeData(Be)}var Q=U.prototype,Ve=function BranchID(e,t){this.parent=e,this.base=t||this};Ve.prototype.separatedFrom=function separatedFrom(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},Ve.prototype.sibling=function sibling(){return new Ve(this.parent,this.base)};var He=function RegExpValidationState(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=Le[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};He.prototype.reset=function reset(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},He.prototype.raise=function raise(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},He.prototype.at=function at(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},He.prototype.nextIndex=function nextIndex(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},He.prototype.current=function current(e){return e===void 0&&(e=!1),this.at(this.pos,e)},He.prototype.lookahead=function lookahead(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},He.prototype.advance=function advance(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},He.prototype.eat=function eat(e,t){return t===void 0&&(t=!1),this.current(t)===e?(this.advance(t),!0):!1},He.prototype.eatChars=function eatChars(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},Q.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)};function hasProp(e){for(var t in e)return!0;return!1}Q.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&hasProp(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},Q.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},Q.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Ve(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},Q.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Q.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},Q.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},Q.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},Q.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Q.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},Q.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Q.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Q.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);!n&&!o&&e.current()===58&&e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},Q.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},Q.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&isRegularExpressionModifier(n);)t+=codePointToString(n),e.advance();return t};function isRegularExpressionModifier(e){return e===105||e===109||e===115}Q.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Q.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},Q.regexp_eatSyntaxCharacter=function(e){var t=e.current();return isSyntaxCharacter(t)?(e.lastIntValue=t,e.advance(),!0):!1};function isSyntaxCharacter(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}Q.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!isSyntaxCharacter(n);)e.advance();return e.pos!==t},Q.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1},Q.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n)if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`);t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},Q.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},Q.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=codePointToString(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=codePointToString(e.lastIntValue);return!0}return!1},Q.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),isRegExpIdentifierStart(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function isRegExpIdentifierStart(e){return isIdentifierStart(e,!0)||e===36||e===95}Q.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),isRegExpIdentifierPart(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function isRegExpIdentifierPart(e){return isIdentifierChar(e,!0)||e===36||e===95||e===8204||e===8205}Q.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},Q.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},Q.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},Q.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Q.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Q.regexp_eatZero=function(e){return e.current()===48&&!isDecimalDigit(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1},Q.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1},Q.regexp_eatControlLetter=function(e){var t=e.current();return isControlLetter(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function isControlLetter(e){return e>=65&&e<=90||e>=97&&e<=122}Q.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&isValidUnicode(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function isValidUnicode(e){return e>=0&&e<=1114111}Q.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1},Q.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var Ue=0,We=1,Ge=2;Q.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(isCharacterClassEscape(t))return e.lastIntValue=-1,e.advance(),We;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===Ge&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return Ue};function isCharacterClassEscape(e){return e===100||e===68||e===115||e===83||e===119||e===87}Q.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),We}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return Ue},Q.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){w(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},Q.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return We;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return Ge;e.raise(`Invalid property name`)},Q.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;isUnicodePropertyNameCharacter(t=e.current());)e.lastStringValue+=codePointToString(t),e.advance();return e.lastStringValue!==``};function isUnicodePropertyNameCharacter(e){return isControlLetter(e)||e===95}Q.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;isUnicodePropertyValueCharacter(t=e.current());)e.lastStringValue+=codePointToString(t),e.advance();return e.lastStringValue!==``};function isUnicodePropertyValueCharacter(e){return isUnicodePropertyNameCharacter(e)||isDecimalDigit(e)}Q.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Q.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===Ge&&e.raise(`Negated character class may contain strings`),!0}return!1},Q.regexp_classContents=function(e){return e.current()===93?We:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),We)},Q.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},Q.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||isOctalDigit(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r===93?!1:(e.lastIntValue=r,e.advance(),!0)},Q.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Q.regexp_classSetExpression=function(e){var t=We,n;if(!this.regexp_eatClassSetRange(e))if(n=this.regexp_eatClassSetOperand(e)){n===Ge&&(t=Ge);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))){n!==Ge&&(t=We);continue}e.raise(`Invalid character in character class`)}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return t}else e.raise(`Invalid character in character class`);for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===Ge&&(t=Ge)}},Q.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},Q.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?We:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},Q.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===Ge&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},Q.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},Q.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===Ge&&(t=Ge);return t},Q.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?We:Ge},Q.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&isClassSetReservedDoublePunctuatorCharacter(n)||isClassSetSyntaxCharacter(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function isClassSetReservedDoublePunctuatorCharacter(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function isClassSetSyntaxCharacter(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}Q.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return isClassSetReservedPunctuator(t)?(e.lastIntValue=t,e.advance(),!0):!1};function isClassSetReservedPunctuator(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}Q.regexp_eatClassControlLetter=function(e){var t=e.current();return isDecimalDigit(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},Q.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},Q.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;isDecimalDigit(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function isDecimalDigit(e){return e>=48&&e<=57}Q.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;isHexDigit(n=e.current());)e.lastIntValue=16*e.lastIntValue+hexToInt(n),e.advance();return e.pos!==t};function isHexDigit(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function hexToInt(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}Q.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+n*8+e.lastIntValue:e.lastIntValue=t*8+n}else e.lastIntValue=t;return!0}return!1},Q.regexp_eatOctalDigit=function(e){var t=e.current();return isOctalDigit(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function isOctalDigit(e){return e>=48&&e<=55}Q.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!isHexDigit(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+hexToInt(i),e.advance()}return!0};var Ke=function Token(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new k(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},$=U.prototype;$.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new Ke(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},$.getToken=function(){return this.next(),new Ke(this)},typeof Symbol<`u`&&($[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===g.eof,value:t}}}}),$.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(g.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},$.readToken=function(e){return isIdentifierStart(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},$.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},$.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=nextLineBreak(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},$.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!isNewLine(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},$.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&y.test(String.fromCharCode(e)))++this.pos;else break loop}}},$.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},$.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(g.ellipsis)):(++this.pos,this.finishToken(g.dot))},$.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(g.assign,2):this.finishOp(g.slash,1)},$.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?g.star:g.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=g.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(g.assign,n+1):this.finishOp(r,n)},$.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(g.assign,3):this.finishOp(e===124?g.logicalOR:g.logicalAND,2):t===61?this.finishOp(g.assign,2):this.finishOp(e===124?g.bitwiseOR:g.bitwiseAND,1)},$.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(g.assign,2):this.finishOp(g.bitwiseXOR,1)},$.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||_.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(g.incDec,2):t===61?this.finishOp(g.assign,2):this.finishOp(g.plusMin,1)},$.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(g.assign,n+1):this.finishOp(g.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(g.relational,n))},$.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(g.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(g.arrow)):this.finishOp(e===61?g.eq:g.prefix,1)},$.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(g.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(g.assign,3):this.finishOp(g.coalesce,2)}return this.finishOp(g.question,1)},$.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),isIdentifierStart(t,!0)||t===92))return this.finishToken(g.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+codePointToString(t)+`'`)},$.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(g.parenL);case 41:return++this.pos,this.finishToken(g.parenR);case 59:return++this.pos,this.finishToken(g.semi);case 44:return++this.pos,this.finishToken(g.comma);case 91:return++this.pos,this.finishToken(g.bracketL);case 93:return++this.pos,this.finishToken(g.bracketR);case 123:return++this.pos,this.finishToken(g.braceL);case 125:return++this.pos,this.finishToken(g.braceR);case 58:return++this.pos,this.finishToken(g.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(g.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(g.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+codePointToString(e)+`'`)},$.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},$.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(_.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new He(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(g.regexp,{pattern:i,flags:o,value:c})},$.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95){i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;continue}if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function stringToNumber(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function stringToBigInt(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}$.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=stringToBigInt(this.input.slice(t,this.pos)),++this.pos):isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(g.num,n)},$.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=stringToBigInt(this.input.slice(t,this.pos));return++this.pos,isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(g.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!n&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=stringToNumber(this.input.slice(t,this.pos),n);return this.finishToken(g.num,a)},$.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},$.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(isNewLine(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(g.string,t)};var qe={};$.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===qe)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},$.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw qe;this.raise(e,t)},$.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===g.template||this.type===g.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(g.dollarBraceL)):(++this.pos,this.finishToken(g.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(g.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(isNewLine(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
10
|
+
`;break;default:e+=String.fromCharCode(n);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else ++this.pos}},$.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(g.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
|
|
11
|
+
`&&++this.pos;case`
|
|
12
|
+
`:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,`Unterminated template`)},$.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
|
|
13
|
+
`;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return isNewLine(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},$.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},$.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(isIdentifierChar(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?isIdentifierStart:isIdentifierChar)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=codePointToString(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},$.readWord=function(){var e=this.readWord1(),t=g.name;return this.keywords.test(e)&&(t=h[e]),this.finishToken(t,e)};var Je=`8.14.0`;U.acorn={Parser:U,version:Je,defaultOptions:A,Position:O,SourceLocation:k,getLineInfo,Node:_e,TokenType:d,tokTypes:g,keywordTypes:h,TokContext:J,tokContexts:Y,isIdentifierChar,isIdentifierStart,Token:Ke,isNewLine,lineBreak:_,lineBreakG:v,nonASCIIwhitespace:y};function parse(e,t){return U.parse(e,t)}function parseExpressionAt(e,t,n){return U.parseExpressionAt(e,t,n)}function tokenizer(e,t){return U.tokenizer(e,t)}e.Node=_e,e.Parser=U,e.Position=O,e.SourceLocation=k,e.TokContext=J,e.Token=Ke,e.TokenType=d,e.defaultOptions=A,e.getLineInfo=getLineInfo,e.isIdentifierChar=isIdentifierChar,e.isIdentifierStart=isIdentifierStart,e.isNewLine=isNewLine,e.keywordTypes=h,e.lineBreak=_,e.lineBreakG=v,e.nonASCIIwhitespace=y,e.parse=parse,e.parseExpressionAt=parseExpressionAt,e.tokContexts=Y,e.tokTypes=g,e.tokenizer=tokenizer,e.version=Je}))})),ce=e.n(((e,t)=>{(function(e,n){e||=K();var r=e.window,i=e.document,a=new function(){var e=/^(statics|enumerable|beans|preserve)$/,t=[],r=t.slice,i=Object.create,a=Object.getOwnPropertyDescriptor,o=Object.defineProperty,s=t.forEach||function(e,t){for(var n=0,r=this.length;n<r;n++)e.call(t,this[n],n,this)},forIn=function(e,t){for(var n in this)this.hasOwnProperty(n)&&e.call(t,this[n],n,this)},c=Object.assign||function(e){for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}return e},each=function(e,t,n){if(e){var r=a(e,`length`);(r&&typeof r.value==`number`?s:forIn).call(e,t,n||=e)}return n};function inject(t,n,r,i,s){var c={};function field(e,l){l||=(l=a(n,e))&&(l.get?l:l.value),typeof l==`string`&&l[0]===`#`&&(l=t[l.substring(1)]||l);var u=typeof l==`function`,d=l,p=s||u&&!l.base?l&&l.get?e in t:t[e]:null,m;(!s||!p)&&(u&&p&&(l.base=p),u&&i!==!1&&(m=e.match(/^([gs]et|is)(([A-Z])(.*))$/))&&(c[m[3].toLowerCase()+m[4]]=m[2]),(!d||u||!d.get||typeof d.get!=`function`||!Base.isPlainObject(d))&&(d={value:d,writable:!0}),(a(t,e)||{configurable:!0}).configurable&&(d.configurable=!0,d.enumerable=r??!m),o(t,e,d))}if(n){for(var l in n)n.hasOwnProperty(l)&&!e.test(l)&&field(l);for(var l in c){var u=c[l],d=t[`set`+u],p=t[`get`+u]||d&&t[`is`+u];p&&(i===!0||p.length===0)&&field(l,{get:p,set:d})}}return t}function Base(){for(var e=0,t=arguments.length;e<t;e++){var n=arguments[e];n&&c(this,n)}return this}return inject(Base,{inject:function(e){if(e){var t=e.statics===!0?e:e.statics,n=e.beans,r=e.preserve;t!==e&&inject(this.prototype,e,e.enumerable,n,r),inject(this,t,null,n,r)}for(var i=1,a=arguments.length;i<a;i++)this.inject(arguments[i]);return this},extend:function(){for(var e=this,ctor,t,n=0,r,a=arguments.length;n<a&&!(ctor&&t);n++)r=arguments[n],ctor||=r.initialize,t||=r.prototype;return ctor||=function(){e.apply(this,arguments)},t=ctor.prototype=t||i(this.prototype),o(t,`constructor`,{value:ctor,writable:!0,configurable:!0}),inject(ctor,this),arguments.length&&this.inject.apply(ctor,arguments),ctor.base=e,ctor}}).inject({enumerable:!1,initialize:Base,set:Base,inject:function(){for(var e=0,t=arguments.length;e<t;e++){var n=arguments[e];n&&inject(this,n,n.enumerable,n.beans,n.preserve)}return this},extend:function(){var e=i(this);return e.inject.apply(e,arguments)},each:function(e,t){return each(this,e,t)},clone:function(){return new this.constructor(this)},statics:{set:c,each,create:i,define:o,describe:a,clone:function(e){return c(new e.constructor,e)},isPlainObject:function(e){var t=e!=null&&e.constructor;return t&&(t===Object||t===Base||t.name===`Object`)},pick:function(e,t){return e===n?t:e},slice:function(e,t,n){return r.call(e,t,n)}}})};t!==void 0&&(t.exports=a),a.inject({enumerable:!1,toString:function(){return this._id==null?`{ `+a.each(this,function(e,t){if(!/^_/.test(t)){var n=typeof e;this.push(t+`: `+(n===`number`?u.instance.number(e):n===`string`?`'`+e+`'`:e))}},[]).join(`, `)+` }`:(this._class||`Object`)+(this._name?` '`+this._name+`'`:` @`+this._id)},getClassName:function(){return this._class||``},importJSON:function(e){return a.importJSON(e,this)},exportJSON:function(e){return a.exportJSON(this,e)},toJSON:function(){return a.serialize(this)},set:function(e,t){return e&&a.filter(this,e,t,this._prioritize),this}},{beans:!1,statics:{exports:{},extend:function extend(){var e=extend.base.apply(this,arguments),t=e.prototype._class;return t&&!a.exports[t]&&(a.exports[t]=e),e},equals:function(e,t){if(e===t)return!0;if(e&&e.equals)return e.equals(t);if(t&&t.equals)return t.equals(e);if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){var n=e.length;if(n!==t.length)return!1;for(;n--;)if(!a.equals(e[n],t[n]))return!1}else{var r=Object.keys(e),n=r.length;if(n!==Object.keys(t).length)return!1;for(;n--;){var i=r[n];if(!(t.hasOwnProperty(i)&&a.equals(e[i],t[i])))return!1}}return!0}return!1},read:function(e,t,r,i){if(this===a){var o=this.peek(e,t);return e.__index++,o}var s=this.prototype,c=s._readIndex,l=t||c&&e.__index||0,u=e.length,d=e[l];if(i||=u-l,d instanceof this||r&&r.readNull&&d==null&&i<=1)return c&&(e.__index=l+1),d&&r&&r.clone?d.clone():d;if(d=a.create(s),c&&(d.__read=!0),d=d.initialize.apply(d,l>0||l+i<u?a.slice(e,l,l+i):e)||d,c){e.__index=l+d.__read;var p=d.__filtered;p&&(e.__filtered=p,d.__filtered=n),d.__read=n}return d},peek:function(e,t){return e[e.__index=t||e.__index||0]},remain:function(e){return e.length-(e.__index||0)},readList:function(e,t,n,r){for(var i=[],a,o=t||0,s=r?o+r:e.length,c=o;c<s;c++)i.push(Array.isArray(a=e[c])?this.read(a,0,n):this.read(e,c,n,1));return i},readNamed:function(e,t,r,i,o){var s=this.getNamed(e,t),c=s!==n;if(c){var l=e.__filtered;if(!l){var u=this.getSource(e);l=e.__filtered=a.create(u),l.__unfiltered=u}l[t]=n}return this.read(c?[s]:e,r,i,o)},readSupported:function(e,t){var r=this.getSource(e),i=this,a=!1;return r&&Object.keys(r).forEach(function(r){if(r in t){var o=i.readNamed(e,r);o!==n&&(t[r]=o),a=!0}}),a},getSource:function(e){var t=e.__source;if(t===n){var r=e.length===1&&e[0];t=e.__source=r&&a.isPlainObject(r)?r:null}return t},getNamed:function(e,t){var n=this.getSource(e);if(n)return t?n[t]:e.__filtered||n},hasNamed:function(e,t){return!!this.getNamed(e,t)},filter:function(e,t,r,i){var a;function handleKey(i){if(!(r&&i in r)&&!(a&&i in a)){var o=t[i];o!==n&&(e[i]=o)}}if(i){for(var o={},s=0,c,l=i.length;s<l;s++)(c=i[s])in t&&(handleKey(c),o[c]=!0);a=o}return Object.keys(t.__unfiltered||t).forEach(handleKey),e},isPlainValue:function(e,t){return a.isPlainObject(e)||Array.isArray(e)||t&&typeof e==`string`},serialize:function(e,t,n,r){t||={};var i=!r,o;if(i&&(t.formatter=new u(t.precision),r={length:0,definitions:{},references:{},add:function(e,t){var n=`#`+e._id,r=this.references[n];if(!r){this.length++;var i=t.call(e),a=e._class;a&&i[0]!==a&&i.unshift(a),this.definitions[n]=i,r=this.references[n]=[n]}return r}}),e&&e._serialize){o=e._serialize(t,r);var s=e._class;s&&!e._compactSerialize&&(i||!n)&&o[0]!==s&&o.unshift(s)}else if(Array.isArray(e)){o=[];for(var c=0,l=e.length;c<l;c++)o[c]=a.serialize(e[c],t,n,r)}else if(a.isPlainObject(e)){o={};for(var d=Object.keys(e),c=0,l=d.length;c<l;c++){var p=d[c];o[p]=a.serialize(e[p],t,n,r)}}else o=typeof e==`number`?t.formatter.number(e,t.precision):e;return i&&r.length>0?[[`dictionary`,r.definitions],o]:o},deserialize:function(e,t,n,r,i){var o=e,s=!n,c=s&&e&&e.length&&e[0][0]===`dictionary`;if(n||={},Array.isArray(e)){var l=e[0],u=l===`dictionary`;if(e.length==1&&/^#/.test(l))return n.dictionary[l];l=a.exports[l],o=[];for(var d=l?1:0,p=e.length;d<p;d++)o.push(a.deserialize(e[d],t,n,u,c));if(l){var m=o;o=t?t(l,m,s||i):new l(m)}}else if(a.isPlainObject(e))for(var h in o={},r&&(n.dictionary=o),e)o[h]=a.deserialize(e[h],t,n);return c?o[1]:o},exportJSON:function(e,t){var n=a.serialize(e,t);return t&&t.asString==0?n:JSON.stringify(n)},importJSON:function(e,t){return a.deserialize(typeof e==`string`?JSON.parse(e):e,function(e,n,r){var i=r&&t&&t.constructor===e,o=i?t:a.create(e.prototype);if(n.length===1&&o instanceof C&&(i||!(o instanceof T))){var s=n[0];a.isPlainObject(s)&&(s.insert=!1,i&&(n=n.concat([C.INSERT])))}return(i?o.set:e).apply(o,n),i&&(t=null),o})},push:function(e,t){var n=t.length;if(n<4096)e.push.apply(e,t);else{var r=e.length;e.length+=n;for(var i=0;i<n;i++)e[r+i]=t[i]}return e},splice:function(e,t,r,i){var o=t&&t.length,s=r===n;r=s?e.length:r,r>e.length&&(r=e.length);for(var c=0;c<o;c++)t[c]._index=r+c;if(s)return a.push(e,t),[];var l=[r,i];t&&a.push(l,t);for(var u=e.splice.apply(e,l),c=0,d=u.length;c<d;c++)u[c]._index=n;for(var c=r+o,d=e.length;c<d;c++)e[c]._index=c;return u},capitalize:function(e){return e.replace(/\b[a-z]/g,function(e){return e.toUpperCase()})},camelize:function(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})},hyphenate:function(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}}});var o={on:function(e,t){if(typeof e!=`string`)a.each(e,function(e,t){this.on(t,e)},this);else{var n=this._eventTypes,r=n&&n[e],i=this._callbacks=this._callbacks||{};i=i[e]=i[e]||[],i.indexOf(t)===-1&&(i.push(t),r&&r.install&&i.length===1&&r.install.call(this,e))}return this},off:function(e,t){if(typeof e!=`string`){a.each(e,function(e,t){this.off(t,e)},this);return}var n=this._eventTypes,r=n&&n[e],i=this._callbacks&&this._callbacks[e],o;return i&&(!t||(o=i.indexOf(t))!==-1&&i.length===1?(r&&r.uninstall&&r.uninstall.call(this,e),delete this._callbacks[e]):o!==-1&&i.splice(o,1)),this},once:function(e,t){return this.on(e,function handler(){t.apply(this,arguments),this.off(e,handler)})},emit:function(e,t){var n=this._callbacks&&this._callbacks[e];if(!n)return!1;var r=a.slice(arguments,1),i=t&&t.target&&!t.currentTarget;n=n.slice(),i&&(t.currentTarget=this);for(var o=0,s=n.length;o<s;o++)if(n[o].apply(this,r)==0){t&&t.stop&&t.stop();break}return i&&delete t.currentTarget,!0},responds:function(e){return!!(this._callbacks&&this._callbacks[e])},attach:`#on`,detach:`#off`,fire:`#emit`,_installEvents:function(e){var t=this._eventTypes,n=this._callbacks,r=e?`install`:`uninstall`;if(t){for(var i in n)if(n[i].length>0){var a=t[i],o=a&&a[r];o&&o.call(this,i)}}},statics:{inject:function inject(e){var t=e._events;if(t){var n={};a.each(t,function(t,r){var i=typeof t==`string`,o=i?t:r,s=a.capitalize(o),c=o.substring(2).toLowerCase();n[c]=i?{}:t,o=`_`+o,e[`get`+s]=function(){return this[o]},e[`set`+s]=function(e){var t=this[o];t&&this.off(c,t),e&&this.on(c,e),this[o]=e}}),e._eventTypes=n}return inject.base.apply(this,arguments)}}},s=a.extend({_class:`PaperScope`,initialize:function PaperScope(){Z=this,this.settings=new a({applyMatrix:!0,insertItems:!0,handleSize:4,hitTolerance:0}),this.project=null,this.projects=[],this.tools=[],this._id=PaperScope._id++,PaperScope._scopes[this._id]=this;var t=PaperScope.prototype;if(!this.support){var n=q.getContext(1,1)||{};t.support={nativeDash:`setLineDash`in n||`mozDash`in n,nativeBlendModes:J.nativeModes},q.release(n)}if(!this.agent){var r=e.navigator.userAgent.toLowerCase(),i=(/(darwin|win|mac|linux|freebsd|sunos)/.exec(r)||[])[0],o=i===`darwin`?`mac`:i,s=t.agent=t.browser={platform:o};o&&(s[o]=!0),r.replace(/(opera|chrome|safari|webkit|firefox|msie|trident|atom|node|jsdom)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:v?([.\d]+))?/g,function(e,t,n,r,i){if(!s.chrome){var a=t===`opera`?r:/^(node|trident)$/.test(t)?i:n;s.version=a,s.versionNumber=parseFloat(a),t={trident:`msie`,jsdom:`node`}[t]||t,s.name=t,s[t]=!0}}),s.chrome&&delete s.webkit,s.atom&&delete s.chrome}},version:`0.12.18`,getView:function(){var e=this.project;return e&&e._view},getPaper:function(){return this},execute:function(e,t){var n=Z.PaperScript.execute(e,this,t);return U.updateFocus(),n},install:function(e){var t=this;for(var n in a.each([`project`,`view`,`tool`],function(n){a.define(e,n,{configurable:!0,get:function(){return t[n]}})}),this)!/^_/.test(n)&&this[n]&&(e[n]=this[n])},setup:function(e){return Z=this,this.project=new S(e),this},createCanvas:function(e,t){return q.getCanvas(e,t)},activate:function(){Z=this},clear:function(){for(var e=this.projects,t=this.tools,n=e.length-1;n>=0;n--)e[n].remove();for(var n=t.length-1;n>=0;n--)t[n].remove()},remove:function(){this.clear(),delete s._scopes[this._id]},statics:new function(){function handleAttribute(e){return e+=`Attribute`,function(t,n){return t[e](n)||t[e](`data-paper-`+n)}}return{_scopes:{},_id:0,get:function(e){return this._scopes[e]||null},getAttribute:handleAttribute(`get`),hasAttribute:handleAttribute(`has`)}}}),c=a.extend(o,{initialize:function(e){this._scope=Z,this._index=this._scope[this._list].push(this)-1,(e||!this._scope[this._reference])&&this.activate()},activate:function(){if(!this._scope)return!1;var e=this._scope[this._reference];return e&&e!==this&&e.emit(`deactivate`),this._scope[this._reference]=this,this.emit(`activate`,e),!0},isActive:function(){return this._scope[this._reference]===this},remove:function(){return this._index==null?!1:(a.splice(this._scope[this._list],null,this._index,1),this._scope[this._reference]==this&&(this._scope[this._reference]=null),this._scope=null,!0)},getView:function(){return this._scope.getView()}}),l={findItemBoundsCollisions:function(e,t,n){function getBounds(e){for(var t=Array(e.length),n=0;n<e.length;n++){var r=e[n].getBounds();t[n]=[r.left,r.top,r.right,r.bottom]}return t}var r=getBounds(e),i=!t||t===e?r:getBounds(t);return this.findBoundsCollisions(r,i,n||0)},findCurveBoundsCollisions:function(e,t,n,r){function getBounds(e){for(var t=Math.min,n=Math.max,r=Array(e.length),i=0;i<e.length;i++){var a=e[i];r[i]=[t(a[0],a[2],a[4],a[6]),t(a[1],a[3],a[5],a[7]),n(a[0],a[2],a[4],a[6]),n(a[1],a[3],a[5],a[7])]}return r}var i=getBounds(e),a=!t||t===e?i:getBounds(t);if(r){for(var o=this.findBoundsCollisions(i,a,n||0,!1,!0),s=this.findBoundsCollisions(i,a,n||0,!0,!0),c=[],l=0,u=o.length;l<u;l++)c[l]={hor:o[l],ver:s[l]};return c}return this.findBoundsCollisions(i,a,n||0)},findBoundsCollisions:function(e,t,n,r,i){var a=!t||e===t,o=a?e:e.concat(t),s=e.length,c=o.length;function binarySearch(e,t,n){for(var r=0,i=e.length;r<i;){var a=i+r>>>1;o[e[a]][t]<n?r=a+1:i=a}return r-1}for(var l=r?1:0,u=l+2,d=r?0:1,p=d+2,m=Array(c),h=0;h<c;h++)m[h]=h;m.sort(function(e,t){return o[e][l]-o[t][l]});for(var g=[],_=Array(s),h=0;h<c;h++){var v=m[h],y=o[v],b=a?v:v-s,x=v<s,S=a||!x,C=x?[]:null;if(g.length){var w=binarySearch(g,u,y[l]-n)+1;if(g.splice(0,w),a&&i){C=C.concat(g);for(var T=0;T<g.length;T++){var E=g[T];_[E].push(b)}}else for(var D=y[p],O=y[d],T=0;T<g.length;T++){var E=g[T],k=o[E],A=E<s,j=a||E>=s;(i||(x&&j||S&&A)&&D>=k[d]-n&&O<=k[p]+n)&&(x&&j&&C.push(a?E:E-s),S&&A&&_[E].push(b))}}if(x&&(e===t&&C.push(v),_[v]=C),g.length){var M=y[u],N=binarySearch(g,u,M);g.splice(N+1,0,v)}else g.push(v)}for(var h=0;h<_.length;h++){var P=_[h];P&&P.sort(function(e,t){return e-t})}return _}},u=a.extend({initialize:function(e){this.precision=a.pick(e,5),this.multiplier=10**this.precision},number:function(e){return this.precision<16?Math.round(e*this.multiplier)/this.multiplier:e},pair:function(e,t,n){return this.number(e)+(n||`,`)+this.number(t)},point:function(e,t){return this.number(e.x)+(t||`,`)+this.number(e.y)},size:function(e,t){return this.number(e.width)+(t||`,`)+this.number(e.height)},rectangle:function(e,t){return this.point(e,t)+(t||`,`)+this.size(e,t)}});u.instance=new u;var d=new function(){var e=[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],t=[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]],n=Math.abs,r=Math.sqrt,i=Math.pow,a=Math.log2||function(e){return Math.log(e)*Math.LOG2E},o=1e-12,s=112e-18;function clamp(e,t,n){return e<t?t:e>n?n:e}function getDiscriminant(e,t,r){function split(e){var t=e*134217729,n=e-t+t;return[n,e-n]}var i=t*t-e*r,a=t*t+e*r;if(n(i)*3<a){var o=split(e),s=split(t),c=split(r),l=t*t,u=s[0]*s[0]-l+2*s[0]*s[1]+s[1]*s[1],d=e*r,p=o[0]*c[0]-d+o[0]*c[1]+o[1]*c[0]+o[1]*c[1];i=l-d+(u-p)}return i}function getNormalizationFactor(){var e=Math.max.apply(Math,arguments);return e&&(e<1e-8||e>1e8)?i(2,-Math.round(a(e))):0}return{EPSILON:o,MACHINE_EPSILON:s,CURVETIME_EPSILON:1e-8,GEOMETRIC_EPSILON:1e-7,TRIGONOMETRIC_EPSILON:1e-8,ANGULAR_EPSILON:1e-5,KAPPA:4*(r(2)-1)/3,isZero:function(e){return e>=-o&&e<=o},isMachineZero:function(e){return e>=-s&&e<=s},clamp,integrate:function(n,r,i,a){for(var o=e[a-2],s=t[a-2],c=(i-r)*.5,l=c+r,u=0,d=a+1>>1,p=a&1?s[u++]*n(l):0;u<d;){var m=c*o[u];p+=s[u++]*(n(l+m)+n(l-m))}return c*p},findRoot:function(e,t,r,i,a,o,s){for(var c=0;c<o;c++){var l=e(r),u=l/t(r),d=r-u;if(n(u)<s){r=d;break}l>0?(a=r,r=d<=i?(i+a)*.5:d):(i=r,r=d>=a?(i+a)*.5:d)}return clamp(r,i,a)},solveQuadratic:function(e,t,i,a,c,l){var u,d=1/0;if(n(e)<o){if(n(t)<o)return n(i)<o?-1:0;u=-i/t}else{t*=-.5;var p=getDiscriminant(e,t,i);if(p&&n(p)<s){var m=getNormalizationFactor(n(e),n(t),n(i));m&&(e*=m,t*=m,i*=m,p=getDiscriminant(e,t,i))}if(p>=-s){var h=p<0?0:r(p),g=t+(t<0?-h:h);g===0?(u=i/e,d=-u):(u=g/e,d=i/g)}}var _=0,v=c==null,y=c-o,b=l+o;return isFinite(u)&&(v||u>y&&u<b)&&(a[_++]=v?u:clamp(u,c,l)),d!==u&&isFinite(d)&&(v||d>y&&d<b)&&(a[_++]=v?d:clamp(d,c,l)),_},solveCubic:function(e,t,a,c,l,u,p){var m=getNormalizationFactor(n(e),n(t),n(a),n(c)),h,g,_,v,y;m&&(e*=m,t*=m,a*=m,c*=m);function evaluate(n){h=n;var r=e*h;g=r+t,_=g*h+a,v=(r+g)*h+_,y=_*h+c}if(n(e)<o)e=t,g=a,_=c,h=1/0;else if(n(c)<o)g=t,_=a,h=0;else{evaluate(-(t/e)/3);var b=y/e,x=i(n(b),1/3),S=b<0?-1:1,C=-v/e,w=C>0?1.324717957244746*Math.max(x,r(C)):x,T=h-S*w;if(T!==h){do evaluate(T),T=v===0?h:h-y/v/(1+s);while(S*T>S*h);n(e)*h*h>n(c/h)&&(_=-c/h,g=(_-a)/h)}}var E=d.solveQuadratic(e,g,_,l,u,p),D=u==null;return isFinite(h)&&(E===0||E>0&&h!==l[0]&&h!==l[1])&&(D||h>u-o&&h<p+o)&&(l[E++]=D?h:clamp(h,u,p)),E}}},p={_id:1,_pools:{},get:function(e){if(e){var t=this._pools[e];return t||=this._pools[e]={_id:1},t._id++}else return this._id++}},m=a.extend({_class:`Point`,_readIndex:!0,initialize:function Point(e,t){var n=typeof e,r=this.__read,i=0;if(n===`number`){var a=typeof t==`number`;this._set(e,a?t:e),r&&(i=a?2:1)}else if(n===`undefined`||e===null)this._set(0,0),r&&(i=e===null?1:0);else{var o=n===`string`?e.split(/[\s,]+/)||[]:e;i=1,Array.isArray(o)?this._set(+o[0],+(o.length>1?o[1]:o[0])):`x`in o?this._set(o.x||0,o.y||0):`width`in o?this._set(o.width||0,o.height||0):`angle`in o?(this._set(o.length||0,0),this.setAngle(o.angle||0)):(this._set(0,0),i=0)}return r&&(this.__read=i),this},set:`#initialize`,_set:function(e,t){return this.x=e,this.y=t,this},equals:function(e){return this===e||e&&(this.x===e.x&&this.y===e.y||Array.isArray(e)&&this.x===e[0]&&this.y===e[1])||!1},clone:function(){return new m(this.x,this.y)},toString:function(){var e=u.instance;return`{ x: `+e.number(this.x)+`, y: `+e.number(this.y)+` }`},_serialize:function(e){var t=e.formatter;return[t.number(this.x),t.number(this.y)]},getLength:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},setLength:function(e){if(this.isZero()){var t=this._angle||0;this._set(Math.cos(t)*e,Math.sin(t)*e)}else{var n=e/this.getLength();d.isZero(n)&&this.getAngle(),this._set(this.x*n,this.y*n)}},getAngle:function(){return this.getAngleInRadians.apply(this,arguments)*180/Math.PI},setAngle:function(e){this.setAngleInRadians.call(this,e*Math.PI/180)},getAngleInDegrees:`#getAngle`,setAngleInDegrees:`#setAngle`,getAngleInRadians:function(){if(arguments.length){var e=m.read(arguments),t=this.getLength()*e.getLength();if(d.isZero(t))return NaN;var n=this.dot(e)/t;return Math.acos(n<-1?-1:n>1?1:n)}else return this.isZero()?this._angle||0:this._angle=Math.atan2(this.y,this.x)},setAngleInRadians:function(e){if(this._angle=e,!this.isZero()){var t=this.getLength();this._set(Math.cos(e)*t,Math.sin(e)*t)}},getQuadrant:function(){return this.x>=0?this.y>=0?1:4:this.y>=0?2:3}},{beans:!1,getDirectedAngle:function(){var e=m.read(arguments);return Math.atan2(this.cross(e),this.dot(e))*180/Math.PI},getDistance:function(){var e=arguments,t=m.read(e),n=t.x-this.x,r=t.y-this.y,i=n*n+r*r;return a.read(e)?i:Math.sqrt(i)},normalize:function(e){e===n&&(e=1);var t=this.getLength(),r=t===0?0:e/t,i=new m(this.x*r,this.y*r);return r>=0&&(i._angle=this._angle),i},rotate:function(e,t){if(e===0)return this.clone();e=e*Math.PI/180;var n=t?this.subtract(t):this,r=Math.sin(e),i=Math.cos(e);return n=new m(n.x*i-n.y*r,n.x*r+n.y*i),t?n.add(t):n},transform:function(e){return e?e._transformPoint(this):this},add:function(){var e=m.read(arguments);return new m(this.x+e.x,this.y+e.y)},subtract:function(){var e=m.read(arguments);return new m(this.x-e.x,this.y-e.y)},multiply:function(){var e=m.read(arguments);return new m(this.x*e.x,this.y*e.y)},divide:function(){var e=m.read(arguments);return new m(this.x/e.x,this.y/e.y)},modulo:function(){var e=m.read(arguments);return new m(this.x%e.x,this.y%e.y)},negate:function(){return new m(-this.x,-this.y)},isInside:function(){return v.read(arguments).contains(this)},isClose:function(){var e=arguments,t=m.read(e),n=a.read(e);return this.getDistance(t)<=n},isCollinear:function(){var e=m.read(arguments);return m.isCollinear(this.x,this.y,e.x,e.y)},isColinear:`#isCollinear`,isOrthogonal:function(){var e=m.read(arguments);return m.isOrthogonal(this.x,this.y,e.x,e.y)},isZero:function(){var e=d.isZero;return e(this.x)&&e(this.y)},isNaN:function(){return isNaN(this.x)||isNaN(this.y)},isInQuadrant:function(e){return this.x*(e>1&&e<4?-1:1)>=0&&this.y*(e>2?-1:1)>=0},dot:function(){var e=m.read(arguments);return this.x*e.x+this.y*e.y},cross:function(){var e=m.read(arguments);return this.x*e.y-this.y*e.x},project:function(){var e=m.read(arguments),t=e.isZero()?0:this.dot(e)/e.dot(e);return new m(e.x*t,e.y*t)},statics:{min:function(){var e=arguments,t=m.read(e),n=m.read(e);return new m(Math.min(t.x,n.x),Math.min(t.y,n.y))},max:function(){var e=arguments,t=m.read(e),n=m.read(e);return new m(Math.max(t.x,n.x),Math.max(t.y,n.y))},random:function(){return new m(Math.random(),Math.random())},isCollinear:function(e,t,n,r){return Math.abs(e*r-t*n)<=Math.sqrt((e*e+t*t)*(n*n+r*r))*1e-8},isOrthogonal:function(e,t,n,r){return Math.abs(e*n+t*r)<=Math.sqrt((e*e+t*t)*(n*n+r*r))*1e-8}}},a.each([`round`,`ceil`,`floor`,`abs`],function(e){var t=Math[e];this[e]=function(){return new m(t(this.x),t(this.y))}},{})),h=m.extend({initialize:function Point(e,t,n,r){this._x=e,this._y=t,this._owner=n,this._setter=r},_set:function(e,t,n){return this._x=e,this._y=t,n||this._owner[this._setter](this),this},getX:function(){return this._x},setX:function(e){this._x=e,this._owner[this._setter](this)},getY:function(){return this._y},setY:function(e){this._y=e,this._owner[this._setter](this)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(e){this._owner._changeSelection(this._getSelection(),e)},_getSelection:function(){return this._setter===`setPosition`?4:0}}),g=a.extend({_class:`Size`,_readIndex:!0,initialize:function Size(e,t){var n=typeof e,r=this.__read,i=0;if(n===`number`){var a=typeof t==`number`;this._set(e,a?t:e),r&&(i=a?2:1)}else if(n===`undefined`||e===null)this._set(0,0),r&&(i=e===null?1:0);else{var o=n===`string`?e.split(/[\s,]+/)||[]:e;i=1,Array.isArray(o)?this._set(+o[0],+(o.length>1?o[1]:o[0])):`width`in o?this._set(o.width||0,o.height||0):`x`in o?this._set(o.x||0,o.y||0):(this._set(0,0),i=0)}return r&&(this.__read=i),this},set:`#initialize`,_set:function(e,t){return this.width=e,this.height=t,this},equals:function(e){return e===this||e&&(this.width===e.width&&this.height===e.height||Array.isArray(e)&&this.width===e[0]&&this.height===e[1])||!1},clone:function(){return new g(this.width,this.height)},toString:function(){var e=u.instance;return`{ width: `+e.number(this.width)+`, height: `+e.number(this.height)+` }`},_serialize:function(e){var t=e.formatter;return[t.number(this.width),t.number(this.height)]},add:function(){var e=g.read(arguments);return new g(this.width+e.width,this.height+e.height)},subtract:function(){var e=g.read(arguments);return new g(this.width-e.width,this.height-e.height)},multiply:function(){var e=g.read(arguments);return new g(this.width*e.width,this.height*e.height)},divide:function(){var e=g.read(arguments);return new g(this.width/e.width,this.height/e.height)},modulo:function(){var e=g.read(arguments);return new g(this.width%e.width,this.height%e.height)},negate:function(){return new g(-this.width,-this.height)},isZero:function(){var e=d.isZero;return e(this.width)&&e(this.height)},isNaN:function(){return isNaN(this.width)||isNaN(this.height)},statics:{min:function(e,t){return new g(Math.min(e.width,t.width),Math.min(e.height,t.height))},max:function(e,t){return new g(Math.max(e.width,t.width),Math.max(e.height,t.height))},random:function(){return new g(Math.random(),Math.random())}}},a.each([`round`,`ceil`,`floor`,`abs`],function(e){var t=Math[e];this[e]=function(){return new g(t(this.width),t(this.height))}},{})),_=g.extend({initialize:function Size(e,t,n,r){this._width=e,this._height=t,this._owner=n,this._setter=r},_set:function(e,t,n){return this._width=e,this._height=t,n||this._owner[this._setter](this),this},getWidth:function(){return this._width},setWidth:function(e){this._width=e,this._owner[this._setter](this)},getHeight:function(){return this._height},setHeight:function(e){this._height=e,this._owner[this._setter](this)}}),v=a.extend({_class:`Rectangle`,_readIndex:!0,beans:!0,initialize:function Rectangle(e,t,r,i){var o=arguments,s=typeof e,c;if(s===`number`?(this._set(e,t,r,i),c=4):s===`undefined`||e===null?(this._set(0,0,0,0),c=e===null?1:0):o.length===1&&(Array.isArray(e)?(this._set.apply(this,e),c=1):e.x!==n||e.width!==n?(this._set(e.x||0,e.y||0,e.width||0,e.height||0),c=1):e.from===n&&e.to===n&&(this._set(0,0,0,0),a.readSupported(o,this)&&(c=1))),c===n){var l=m.readNamed(o,`from`),u=a.peek(o),d=l.x,p=l.y,h,_;if(u&&u.x!==n||a.hasNamed(o,`to`)){var v=m.readNamed(o,`to`);h=v.x-d,_=v.y-p,h<0&&(d=v.x,h=-h),_<0&&(p=v.y,_=-_)}else{var y=g.read(o);h=y.width,_=y.height}this._set(d,p,h,_),c=o.__index}var b=o.__filtered;return b&&(this.__filtered=b),this.__read&&=c,this},set:`#initialize`,_set:function(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this},clone:function(){return new v(this.x,this.y,this.width,this.height)},equals:function(e){var t=a.isPlainValue(e)?v.read(arguments):e;return t===this||t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height||!1},toString:function(){var e=u.instance;return`{ x: `+e.number(this.x)+`, y: `+e.number(this.y)+`, width: `+e.number(this.width)+`, height: `+e.number(this.height)+` }`},_serialize:function(e){var t=e.formatter;return[t.number(this.x),t.number(this.y),t.number(this.width),t.number(this.height)]},getPoint:function(e){return new(e?m:h)(this.x,this.y,this,`setPoint`)},setPoint:function(){var e=m.read(arguments);this.x=e.x,this.y=e.y},getSize:function(e){return new(e?g:_)(this.width,this.height,this,`setSize`)},_fw:1,_fh:1,setSize:function(){var e=g.read(arguments),t=this._sx,n=this._sy,r=e.width,i=e.height;t&&(this.x+=(this.width-r)*t),n&&(this.y+=(this.height-i)*n),this.width=r,this.height=i,this._fw=this._fh=1},getLeft:function(){return this.x},setLeft:function(e){if(!this._fw){var t=e-this.x;this.width-=this._sx===.5?t*2:t}this.x=e,this._sx=this._fw=0},getTop:function(){return this.y},setTop:function(e){if(!this._fh){var t=e-this.y;this.height-=this._sy===.5?t*2:t}this.y=e,this._sy=this._fh=0},getRight:function(){return this.x+this.width},setRight:function(e){if(!this._fw){var t=e-this.x;this.width=this._sx===.5?t*2:t}this.x=e-this.width,this._sx=1,this._fw=0},getBottom:function(){return this.y+this.height},setBottom:function(e){if(!this._fh){var t=e-this.y;this.height=this._sy===.5?t*2:t}this.y=e-this.height,this._sy=1,this._fh=0},getCenterX:function(){return this.x+this.width/2},setCenterX:function(e){this._fw||this._sx===.5?this.x=e-this.width/2:(this._sx&&(this.x+=(e-this.x)*2*this._sx),this.width=(e-this.x)*2),this._sx=.5,this._fw=0},getCenterY:function(){return this.y+this.height/2},setCenterY:function(e){this._fh||this._sy===.5?this.y=e-this.height/2:(this._sy&&(this.y+=(e-this.y)*2*this._sy),this.height=(e-this.y)*2),this._sy=.5,this._fh=0},getCenter:function(e){return new(e?m:h)(this.getCenterX(),this.getCenterY(),this,`setCenter`)},setCenter:function(){var e=m.read(arguments);return this.setCenterX(e.x),this.setCenterY(e.y),this},getArea:function(){return this.width*this.height},isEmpty:function(){return this.width===0||this.height===0},contains:function(e){return e&&e.width!==n||(Array.isArray(e)?e:arguments).length===4?this._containsRectangle(v.read(arguments)):this._containsPoint(m.read(arguments))},_containsPoint:function(e){var t=e.x,n=e.y;return t>=this.x&&n>=this.y&&t<=this.x+this.width&&n<=this.y+this.height},_containsRectangle:function(e){var t=e.x,n=e.y;return t>=this.x&&n>=this.y&&t+e.width<=this.x+this.width&&n+e.height<=this.y+this.height},intersects:function(){var e=v.read(arguments),t=a.read(arguments)||0;return e.x+e.width>this.x-t&&e.y+e.height>this.y-t&&e.x<this.x+this.width+t&&e.y<this.y+this.height+t},intersect:function(){var e=v.read(arguments),t=Math.max(this.x,e.x),n=Math.max(this.y,e.y),r=Math.min(this.x+this.width,e.x+e.width),i=Math.min(this.y+this.height,e.y+e.height);return new v(t,n,r-t,i-n)},unite:function(){var e=v.read(arguments),t=Math.min(this.x,e.x),n=Math.min(this.y,e.y),r=Math.max(this.x+this.width,e.x+e.width),i=Math.max(this.y+this.height,e.y+e.height);return new v(t,n,r-t,i-n)},include:function(){var e=m.read(arguments),t=Math.min(this.x,e.x),n=Math.min(this.y,e.y),r=Math.max(this.x+this.width,e.x),i=Math.max(this.y+this.height,e.y);return new v(t,n,r-t,i-n)},expand:function(){var e=g.read(arguments),t=e.width,n=e.height;return new v(this.x-t/2,this.y-n/2,this.width+t,this.height+n)},scale:function(e,t){return this.expand(this.width*e-this.width,this.height*(t===n?e:t)-this.height)}},a.each([[`Top`,`Left`],[`Top`,`Right`],[`Bottom`,`Left`],[`Bottom`,`Right`],[`Left`,`Center`],[`Top`,`Center`],[`Right`,`Center`],[`Bottom`,`Center`]],function(e,t){var n=e.join(``),r=/^[RL]/.test(n);t>=4&&(e[1]+=r?`Y`:`X`);var i=e[r?0:1],a=e[r?1:0],o=`get`+i,s=`get`+a,c=`set`+i,l=`set`+a,u=`get`+n,d=`set`+n;this[u]=function(e){return new(e?m:h)(this[o](),this[s](),this,d)},this[d]=function(){var e=m.read(arguments);this[c](e.x),this[l](e.y)}},{beans:!0})),y=v.extend({initialize:function Rectangle(e,t,n,r,i,a){this._set(e,t,n,r,!0),this._owner=i,this._setter=a},_set:function(e,t,n,r,i){return this._x=e,this._y=t,this._width=n,this._height=r,i||this._owner[this._setter](this),this}},new function(){var e=v.prototype;return a.each([`x`,`y`,`width`,`height`],function(e){var t=a.capitalize(e),n=`_`+e;this[`get`+t]=function(){return this[n]},this[`set`+t]=function(e){this[n]=e,this._dontNotify||this._owner[this._setter](this)}},a.each([`Point`,`Size`,`Center`,`Left`,`Top`,`Right`,`Bottom`,`CenterX`,`CenterY`,`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`,`LeftCenter`,`TopCenter`,`RightCenter`,`BottomCenter`],function(t){var n=`set`+t;this[n]=function(){this._dontNotify=!0,e[n].apply(this,arguments),this._dontNotify=!1,this._owner[this._setter](this)}},{isSelected:function(){return!!(this._owner._selection&2)},setSelected:function(e){var t=this._owner;t._changeSelection&&t._changeSelection(2,e)}}))}),b=a.extend({_class:`Matrix`,initialize:function Matrix(e,t){var n=arguments,r=n.length,i=!0;if(r>=6?this._set.apply(this,n):r===1||r===2?e instanceof Matrix?this._set(e._a,e._b,e._c,e._d,e._tx,e._ty,t):Array.isArray(e)?this._set.apply(this,t?e.concat([t]):e):i=!1:r?i=!1:this.reset(),!i)throw Error(`Unsupported matrix parameters`);return this},set:`#initialize`,_set:function(e,t,n,r,i,a,o){return this._a=e,this._b=t,this._c=n,this._d=r,this._tx=i,this._ty=a,o||this._changed(),this},_serialize:function(e,t){return a.serialize(this.getValues(),e,!0,t)},_changed:function(){var e=this._owner;e&&(e._applyMatrix?e.transform(null,!0):e._changed(25))},clone:function(){return new b(this._a,this._b,this._c,this._d,this._tx,this._ty)},equals:function(e){return e===this||e&&this._a===e._a&&this._b===e._b&&this._c===e._c&&this._d===e._d&&this._tx===e._tx&&this._ty===e._ty},toString:function(){var e=u.instance;return`[[`+[e.number(this._a),e.number(this._c),e.number(this._tx)].join(`, `)+`], [`+[e.number(this._b),e.number(this._d),e.number(this._ty)].join(`, `)+`]]`},reset:function(e){return this._a=this._d=1,this._b=this._c=this._tx=this._ty=0,e||this._changed(),this},apply:function(e,t){var n=this._owner;return n?(n.transform(null,a.pick(e,!0),t),this.isIdentity()):!1},translate:function(){var e=m.read(arguments),t=e.x,n=e.y;return this._tx+=t*this._a+n*this._c,this._ty+=t*this._b+n*this._d,this._changed(),this},scale:function(){var e=arguments,t=m.read(e),n=m.read(e,0,{readNull:!0});return n&&this.translate(n),this._a*=t.x,this._b*=t.x,this._c*=t.y,this._d*=t.y,n&&this.translate(n.negate()),this._changed(),this},rotate:function(e){e*=Math.PI/180;var t=m.read(arguments,1),n=t.x,r=t.y,i=Math.cos(e),a=Math.sin(e),o=n-n*i+r*a,s=r-n*a-r*i,c=this._a,l=this._b,u=this._c,d=this._d;return this._a=i*c+a*u,this._b=i*l+a*d,this._c=-a*c+i*u,this._d=-a*l+i*d,this._tx+=o*c+s*u,this._ty+=o*l+s*d,this._changed(),this},shear:function(){var e=arguments,t=m.read(e),n=m.read(e,0,{readNull:!0});n&&this.translate(n);var r=this._a,i=this._b;return this._a+=t.y*this._c,this._b+=t.y*this._d,this._c+=t.x*r,this._d+=t.x*i,n&&this.translate(n.negate()),this._changed(),this},skew:function(){var e=arguments,t=m.read(e),n=m.read(e,0,{readNull:!0}),r=Math.PI/180,i=new m(Math.tan(t.x*r),Math.tan(t.y*r));return this.shear(i,n)},append:function(e,t){if(e){var n=this._a,r=this._b,i=this._c,a=this._d,o=e._a,s=e._c,c=e._b,l=e._d,u=e._tx,d=e._ty;this._a=o*n+c*i,this._c=s*n+l*i,this._b=o*r+c*a,this._d=s*r+l*a,this._tx+=u*n+d*i,this._ty+=u*r+d*a,t||this._changed()}return this},prepend:function(e,t){if(e){var n=this._a,r=this._b,i=this._c,a=this._d,o=this._tx,s=this._ty,c=e._a,l=e._c,u=e._b,d=e._d,p=e._tx,m=e._ty;this._a=c*n+l*r,this._c=c*i+l*a,this._b=u*n+d*r,this._d=u*i+d*a,this._tx=c*o+l*s+p,this._ty=u*o+d*s+m,t||this._changed()}return this},appended:function(e){return this.clone().append(e)},prepended:function(e){return this.clone().prepend(e)},invert:function(){var e=this._a,t=this._b,n=this._c,r=this._d,i=this._tx,a=this._ty,o=e*r-t*n,s=null;return o&&!isNaN(o)&&isFinite(i)&&isFinite(a)&&(this._a=r/o,this._b=-t/o,this._c=-n/o,this._d=e/o,this._tx=(n*a-r*i)/o,this._ty=(t*i-e*a)/o,s=this),s},inverted:function(){return this.clone().invert()},concatenate:`#append`,preConcatenate:`#prepend`,chain:`#appended`,_shiftless:function(){return new b(this._a,this._b,this._c,this._d,0,0)},_orNullIfIdentity:function(){return this.isIdentity()?null:this},isIdentity:function(){return this._a===1&&this._b===0&&this._c===0&&this._d===1&&this._tx===0&&this._ty===0},isInvertible:function(){var e=this._a*this._d-this._c*this._b;return e&&!isNaN(e)&&isFinite(this._tx)&&isFinite(this._ty)},isSingular:function(){return!this.isInvertible()},transform:function(e,t,n){return arguments.length<3?this._transformPoint(m.read(arguments)):this._transformCoordinates(e,t,n)},_transformPoint:function(e,t,n){var r=e.x,i=e.y;return t||=new m,t._set(r*this._a+i*this._c+this._tx,r*this._b+i*this._d+this._ty,n)},_transformCoordinates:function(e,t,n){for(var r=0,i=2*n;r<i;r+=2){var a=e[r],o=e[r+1];t[r]=a*this._a+o*this._c+this._tx,t[r+1]=a*this._b+o*this._d+this._ty}return t},_transformCorners:function(e){var t=e.x,n=e.y,r=t+e.width,i=n+e.height,a=[t,n,r,n,r,i,t,i];return this._transformCoordinates(a,a,4)},_transformBounds:function(e,t,n){for(var r=this._transformCorners(e),i=r.slice(0,2),a=i.slice(),o=2;o<8;o++){var s=r[o],c=o&1;s<i[c]?i[c]=s:s>a[c]&&(a[c]=s)}return t||=new v,t._set(i[0],i[1],a[0]-i[0],a[1]-i[1],n)},inverseTransform:function(){return this._inverseTransform(m.read(arguments))},_inverseTransform:function(e,t,n){var r=this._a,i=this._b,a=this._c,o=this._d,s=this._tx,c=this._ty,l=r*o-i*a,u=null;if(l&&!isNaN(l)&&isFinite(s)&&isFinite(c)){var d=e.x-this._tx,p=e.y-this._ty;t||=new m,u=t._set((d*o-p*a)/l,(p*r-d*i)/l,n)}return u},decompose:function(){var e=this._a,t=this._b,n=this._c,r=this._d,i=e*r-t*n,a=Math.sqrt,o=Math.atan2,s=180/Math.PI,c,l,u;if(e!==0||t!==0){var d=a(e*e+t*t);c=Math.acos(e/d)*(t>0?1:-1),l=[d,i/d],u=[o(e*n+t*r,d*d),0]}else if(n!==0||r!==0){var p=a(n*n+r*r);c=Math.asin(n/p)*(r>0?1:-1),l=[i/p,p],u=[0,o(e*n+t*r,p*p)]}else c=0,u=l=[0,0];return{translation:this.getTranslation(),rotation:c*s,scaling:new m(l),skewing:new m(u[0]*s,u[1]*s)}},getValues:function(){return[this._a,this._b,this._c,this._d,this._tx,this._ty]},getTranslation:function(){return new m(this._tx,this._ty)},getScaling:function(){return this.decompose().scaling},getRotation:function(){return this.decompose().rotation},applyToContext:function(e){this.isIdentity()||e.transform(this._a,this._b,this._c,this._d,this._tx,this._ty)}},a.each([`a`,`b`,`c`,`d`,`tx`,`ty`],function(e){var t=a.capitalize(e),n=`_`+e;this[`get`+t]=function(){return this[n]},this[`set`+t]=function(e){this[n]=e,this._changed()}},{})),x=a.extend({_class:`Line`,initialize:function Line(e,t,n,r,i){var a=!1;arguments.length>=4?(this._px=e,this._py=t,this._vx=n,this._vy=r,a=i):(this._px=e.x,this._py=e.y,this._vx=t.x,this._vy=t.y,a=n),a||(this._vx-=this._px,this._vy-=this._py)},getPoint:function(){return new m(this._px,this._py)},getVector:function(){return new m(this._vx,this._vy)},getLength:function(){return this.getVector().getLength()},intersect:function(e,t){return x.intersect(this._px,this._py,this._vx,this._vy,e._px,e._py,e._vx,e._vy,!0,t)},getSide:function(e,t){return x.getSide(this._px,this._py,this._vx,this._vy,e.x,e.y,!0,t)},getDistance:function(e){return Math.abs(this.getSignedDistance(e))},getSignedDistance:function(e){return x.getSignedDistance(this._px,this._py,this._vx,this._vy,e.x,e.y,!0)},isCollinear:function(e){return m.isCollinear(this._vx,this._vy,e._vx,e._vy)},isOrthogonal:function(e){return m.isOrthogonal(this._vx,this._vy,e._vx,e._vy)},statics:{intersect:function(e,t,n,r,i,a,o,s,c,l){c||(n-=e,r-=t,o-=i,s-=a);var u=n*s-r*o;if(!d.isMachineZero(u)){var p=e-i,h=t-a,g=(o*h-s*p)/u,_=(n*h-r*p)/u,v=1e-12,y=-v,b=1+v;if(l||y<g&&g<b&&y<_&&_<b)return l||(g=g<=0?0:g>=1?1:g),new m(e+g*n,t+g*r)}},getSide:function(e,t,n,r,i,a,o,s){o||(n-=e,r-=t);var c=i-e,l=a-t,u=c*r-l*n;return!s&&d.isMachineZero(u)&&(u=(c*n+c*n)/(n*n+r*r),u>=0&&u<=1&&(u=0)),u<0?-1:u>0?1:0},getSignedDistance:function(e,t,n,r,i,a,o){return o||(n-=e,r-=t),n===0?r>0?i-e:e-i:r===0?n<0?a-t:t-a:((i-e)*r-(a-t)*n)/(r>n?r*Math.sqrt(1+n*n/(r*r)):n*Math.sqrt(1+r*r/(n*n)))},getDistance:function(e,t,n,r,i,a,o){return Math.abs(x.getSignedDistance(e,t,n,r,i,a,o))}}}),S=c.extend({_class:`Project`,_list:`projects`,_reference:`project`,_compactSerialize:!0,initialize:function Project(e){c.call(this,!0),this._children=[],this._namedChildren={},this._activeLayer=null,this._currentStyle=new ie(null,null,this),this._view=U.create(this,e||q.getCanvas(1,1)),this._selectionItems={},this._selectionCount=0,this._updateVersion=0},_serialize:function(e,t){return a.serialize(this._children,e,!0,t)},_changed:function(e,t){if(e&1){var n=this._view;n&&(n._needsUpdate=!0,!n._requested&&n._autoUpdate&&n.requestUpdate())}var r=this._changes;if(r&&t){var i=this._changesById,a=t._id,o=i[a];o?o.flags|=e:r.push(i[a]={item:t,flags:e})}},clear:function(){for(var e=this._children,t=e.length-1;t>=0;t--)e[t].remove()},isEmpty:function(){return!this._children.length},remove:function remove(){return remove.base.call(this)?(this._view&&this._view.remove(),!0):!1},getView:function(){return this._view},getCurrentStyle:function(){return this._currentStyle},setCurrentStyle:function(e){this._currentStyle.set(e)},getIndex:function(){return this._index},getOptions:function(){return this._scope.settings},getLayers:function(){return this._children},getActiveLayer:function(){return this._activeLayer||new T({project:this,insert:!0})},getSymbolDefinitions:function(){var e=[],t={};return this.getItems({class:O,match:function(n){var r=n._definition,i=r._id;return t[i]||(t[i]=!0,e.push(r)),!1}}),e},getSymbols:`getSymbolDefinitions`,getSelectedItems:function(){var e=this._selectionItems,t=[];for(var n in e){var r=e[n],i=r._selection;i&1&&r.isInserted()?t.push(r):i||this._updateSelection(r)}return t},_updateSelection:function(e){var t=e._id,n=this._selectionItems;e._selection?n[t]!==e&&(this._selectionCount++,n[t]=e):n[t]===e&&(this._selectionCount--,delete n[t])},selectAll:function(){for(var e=this._children,t=0,n=e.length;t<n;t++)e[t].setFullySelected(!0)},deselectAll:function(){var e=this._selectionItems;for(var t in e)e[t].setFullySelected(!1)},addLayer:function(e){return this.insertLayer(n,e)},insertLayer:function(e,t){if(t instanceof T){t._remove(!1,!0),a.splice(this._children,[t],e,0),t._setProject(this,!0);var n=t._name;n&&t.setName(n),this._changes&&t._changed(5),this._activeLayer||=t}else t=null;return t},_insertItem:function(e,t,r){return t=this.insertLayer(e,t)||(this._activeLayer||this._insertItem(n,new T(C.NO_INSERT),!0)).insertChild(e,t),r&&t.activate&&t.activate(),t},getItems:function(e){return C._getItems(this,e)},getItem:function(e){return C._getItems(this,e,null,null,!0)[0]||null},importJSON:function(e){this.activate();var t=this._activeLayer;return a.importJSON(e,t&&t.isEmpty()&&t)},removeOn:function(e){var t=this._removeSets;if(t){e===`mouseup`&&(t.mousedrag=null);var n=t[e];if(n){for(var r in n){var i=n[r];for(var a in t){var o=t[a];o&&o!=n&&delete o[i._id]}i.remove()}t[e]=null}}},draw:function(e,t,n){this._updateVersion++,e.save(),t.applyToContext(e);for(var r=this._children,i=new a({offset:new m(0,0),pixelRatio:n,viewMatrix:t.isIdentity()?null:t,matrices:[new b],updateMatrix:!0}),o=0,s=r.length;o<s;o++)r[o].draw(e,i);if(e.restore(),this._selectionCount>0){e.save(),e.strokeWidth=1;var c=this._selectionItems,l=this._scope.settings.handleSize,u=this._updateVersion;for(var d in c)c[d]._drawSelection(e,t,l,c,u);e.restore()}}}),C=a.extend(o,{statics:{extend:function extend(e){return e._serializeFields&&=a.set({},this.prototype._serializeFields,e._serializeFields),extend.base.apply(this,arguments)},INSERT:{insert:!0},NO_INSERT:{insert:!1}},_class:`Item`,_name:null,_applyMatrix:!0,_canApplyMatrix:!0,_canScaleStroke:!1,_pivot:null,_visible:!0,_blendMode:`normal`,_opacity:1,_locked:!1,_guide:!1,_clipMask:!1,_selection:0,_selectBounds:!0,_selectChildren:!1,_serializeFields:{name:null,applyMatrix:null,matrix:new b,pivot:null,visible:!0,blendMode:`normal`,opacity:1,locked:!1,guide:!1,clipMask:!1,selected:!1,data:{}},_prioritize:[`applyMatrix`]},new function(){var e=[`onMouseDown`,`onMouseUp`,`onMouseDrag`,`onClick`,`onDoubleClick`,`onMouseMove`,`onMouseEnter`,`onMouseLeave`];return a.each(e,function(e){this._events[e]={install:function(e){this.getView()._countItemEvent(e,1)},uninstall:function(e){this.getView()._countItemEvent(e,-1)}}},{_events:{onFrame:{install:function(){this.getView()._animateItem(this,!0)},uninstall:function(){this.getView()._animateItem(this,!1)}},onLoad:{},onError:{}},statics:{_itemHandlers:e}})},{initialize:function Item(){},_initialize:function(e,t){var r=e&&a.isPlainObject(e),i=r&&e.internal===!0,o=this._matrix=new b,s=r&&e.project||Z.project,c=Z.settings;return this._id=i?null:p.get(),this._parent=this._index=null,this._applyMatrix=this._canApplyMatrix&&c.applyMatrix,t&&o.translate(t),o._owner=this,this._style=new ie(s._currentStyle,this,s),i||r&&e.insert==0||!c.insertItems&&!(r&&e.insert==1)?this._setProject(s):(r&&e.parent||s)._insertItem(n,this,!0),r&&e!==C.NO_INSERT&&e!==C.INSERT&&this.set(e,{internal:!0,insert:!0,project:!0,parent:!0}),r},_serialize:function(e,t){var n={},r=this;function serialize(i){for(var o in i){var s=r[o];a.equals(s,o===`leading`?i.fontSize*1.2:i[o])||(n[o]=a.serialize(s,e,o!==`data`,t))}}return serialize(this._serializeFields),this instanceof w||serialize(this._style._defaults),[this._class,n]},_changed:function(e){var t=this._symbol,r=this._parent||t,i=this._project;e&8&&(this._bounds=this._position=this._decomposed=n),e&16&&(this._globalMatrix=n),r&&e&72&&C._clearBoundsCache(r),e&2&&C._clearBoundsCache(this),i&&i._changed(e,this),t&&t._changed(e)},getId:function(){return this._id},getName:function(){return this._name},setName:function(e){if(this._name&&this._removeNamed(),e===+e+``)throw Error(`Names consisting only of numbers are not supported.`);var t=this._getOwner();if(e&&t){var r=t._children,i=t._namedChildren;(i[e]=i[e]||[]).push(this),e in r||(r[e]=this)}this._name=e||n,this._changed(256)},getStyle:function(){return this._style},setStyle:function(e){this.getStyle().set(e)}},a.each([`locked`,`visible`,`blendMode`,`opacity`,`guide`],function(e){var t=a.capitalize(e),n=`_`+e,r={locked:256,visible:265};this[`get`+t]=function(){return this[n]},this[`set`+t]=function(t){t!=this[n]&&(this[n]=t,this._changed(r[e]||257))}},{}),{beans:!0,getSelection:function(){return this._selection},setSelection:function(e){if(e!==this._selection){this._selection=e;var t=this._project;t&&(t._updateSelection(this),this._changed(257))}},_changeSelection:function(e,t){var n=this._selection;this.setSelection(t?n|e:n&~e)},isSelected:function(){if(this._selectChildren){for(var e=this._children,t=0,n=e.length;t<n;t++)if(e[t].isSelected())return!0}return!!(this._selection&1)},setSelected:function(e){if(this._selectChildren)for(var t=this._children,n=0,r=t.length;n<r;n++)t[n].setSelected(e);this._changeSelection(1,e)},isFullySelected:function(){var e=this._children,t=!!(this._selection&1);if(e&&t){for(var n=0,r=e.length;n<r;n++)if(!e[n].isFullySelected())return!1;return!0}return t},setFullySelected:function(e){var t=this._children;if(t)for(var n=0,r=t.length;n<r;n++)t[n].setFullySelected(e);this._changeSelection(1,e)},isClipMask:function(){return this._clipMask},setClipMask:function(e){this._clipMask!=(e=!!e)&&(this._clipMask=e,e&&(this.setFillColor(null),this.setStrokeColor(null)),this._changed(257),this._parent&&this._parent._changed(2048))},getData:function(){return this._data||={},this._data},setData:function(e){this._data=e},getPosition:function(e){var t=e?m:h,n=this._position||=this._getPositionFromBounds();return new t(n.x,n.y,this,`setPosition`)},setPosition:function(){this.translate(m.read(arguments).subtract(this.getPosition(!0)))},_getPositionFromBounds:function(e){return this._pivot?this._matrix._transformPoint(this._pivot):(e||this.getBounds()).getCenter(!0)},getPivot:function(){var e=this._pivot;return e?new h(e.x,e.y,this,`setPivot`):null},setPivot:function(){this._pivot=m.read(arguments,0,{clone:!0,readNull:!0}),this._position=n}},a.each({getStrokeBounds:{stroke:!0},getHandleBounds:{handle:!0},getInternalBounds:{internal:!0}},function(e,t){this[t]=function(t){return this.getBounds(t,e)}},{beans:!0,getBounds:function(e,t){var n=t||e instanceof b,r=a.set({},n?t:e,this._boundsOptions);(!r.stroke||this.getStrokeScaling())&&(r.cacheItem=this);var i=this._getCachedBounds(n&&e,r).rect;return arguments.length?i:new y(i.x,i.y,i.width,i.height,this,`setBounds`)},setBounds:function(){var e=v.read(arguments),t=this.getBounds(),n=this._matrix,r=new b,i=e.getCenter();r.translate(i),(e.width!=t.width||e.height!=t.height)&&(n.isInvertible()||(n.set(n._backup||new b().translate(n.getTranslation())),t=this.getBounds()),r.scale(t.width===0?0:e.width/t.width,t.height===0?0:e.height/t.height)),i=t.getCenter(),r.translate(-i.x,-i.y),this.transform(r)},_getBounds:function(e,t){var n=this._children;return!n||!n.length?new v:(C._updateBoundsCache(this,t.cacheItem),C._getBounds(n,e,t))},_getBoundsCacheKey:function(e,t){return[e.stroke?1:0,e.handle?1:0,t?1:0].join(``)},_getCachedBounds:function(e,t,n){e&&=e._orNullIfIdentity();var r=t.internal&&!n,i=t.cacheItem,a=r?null:this._matrix._orNullIfIdentity(),o=i&&(!e||e.equals(a))&&this._getBoundsCacheKey(t,r),s=this._bounds;if(C._updateBoundsCache(this._parent||this._symbol,i),o&&s&&o in s){var c=s[o];return{rect:c.rect.clone(),nonscaling:c.nonscaling}}var l=this._getBounds(e||a,t),u=l.rect||l,d=this._style,p=l.nonscaling||d.hasStroke()&&!d.getStrokeScaling();if(o){s||(this._bounds=s={});var c=s[o]={rect:u.clone(),nonscaling:p,internal:r}}return{rect:u,nonscaling:p}},_getStrokeMatrix:function(e,t){var n=this.getStrokeScaling()?null:t&&t.internal?this:this._parent||this._symbol&&this._symbol._item,r=n?n.getViewMatrix().invert():e;return r&&r._shiftless()},statics:{_updateBoundsCache:function(e,t){if(e&&t){var n=t._id,r=e._boundsCache=e._boundsCache||{ids:{},list:[]};r.ids[n]||(r.list.push(t),r.ids[n]=t)}},_clearBoundsCache:function(e){var t=e._boundsCache;if(t){e._bounds=e._position=e._boundsCache=n;for(var r=0,i=t.list,a=i.length;r<a;r++){var o=i[r];o!==e&&(o._bounds=o._position=n,o._boundsCache&&C._clearBoundsCache(o))}}},_getBounds:function(e,t,n){var r=1/0,i=-r,a=r,o=i,s=!1;n||={};for(var c=0,l=e.length;c<l;c++){var u=e[c];if(u._visible&&!u.isEmpty(!0)){var d=u._getCachedBounds(t&&t.appended(u._matrix),n,!0),p=d.rect;r=Math.min(p.x,r),a=Math.min(p.y,a),i=Math.max(p.x+p.width,i),o=Math.max(p.y+p.height,o),d.nonscaling&&(s=!0)}}return{rect:isFinite(r)?new v(r,a,i-r,o-a):new v,nonscaling:s}}}}),{beans:!0,_decompose:function(){return this._applyMatrix?null:this._decomposed||=this._matrix.decompose()},getRotation:function(){var e=this._decompose();return e?e.rotation:0},setRotation:function(e){var t=this.getRotation();if(t!=null&&e!=null){var n=this._decomposed;this.rotate(e-t),n&&(n.rotation=e,this._decomposed=n)}},getScaling:function(){var e=this._decompose(),t=e&&e.scaling;return new h(t?t.x:1,t?t.y:1,this,`setScaling`)},setScaling:function(){var e=this.getScaling(),t=m.read(arguments,0,{clone:!0,readNull:!0});if(e&&t&&!e.equals(t)){var n=this.getRotation(),r=this._decomposed,i=new b,a=d.isZero;if(a(e.x)||a(e.y))i.translate(r.translation),n&&i.rotate(n),i.scale(t.x,t.y),this._matrix.set(i);else{var o=this.getPosition(!0);i.translate(o),n&&i.rotate(n),i.scale(t.x/e.x,t.y/e.y),n&&i.rotate(-n),i.translate(o.negate()),this.transform(i)}r&&(r.scaling=t,this._decomposed=r)}},getMatrix:function(){return this._matrix},setMatrix:function(){var e=this._matrix;e.set.apply(e,arguments)},getGlobalMatrix:function(e){var t=this._globalMatrix;if(t)for(var n=this._parent,r=[];n;){if(!n._globalMatrix){t=null;for(var i=0,a=r.length;i<a;i++)r[i]._globalMatrix=null;break}r.push(n),n=n._parent}if(!t){t=this._globalMatrix=this._matrix.clone();var n=this._parent;n&&t.prepend(n.getGlobalMatrix(!0))}return e?t:t.clone()},getViewMatrix:function(){return this.getGlobalMatrix().prepend(this.getView()._matrix)},getApplyMatrix:function(){return this._applyMatrix},setApplyMatrix:function(e){(this._applyMatrix=this._canApplyMatrix&&!!e)&&this.transform(null,!0)},getTransformContent:`#getApplyMatrix`,setTransformContent:`#setApplyMatrix`},{getProject:function(){return this._project},_setProject:function(e,t){if(this._project!==e){this._project&&this._installEvents(!1),this._project=e;for(var n=this._children,r=0,i=n&&n.length;r<i;r++)n[r]._setProject(e);t=!0}t&&this._installEvents(!0)},getView:function(){return this._project._view},_installEvents:function _installEvents(e){_installEvents.base.call(this,e);for(var t=this._children,n=0,r=t&&t.length;n<r;n++)t[n]._installEvents(e)},getLayer:function(){for(var e=this;e=e._parent;)if(e instanceof T)return e;return null},getParent:function(){return this._parent},setParent:function(e){return e.addChild(this)},_getOwner:`#getParent`,getChildren:function(){return this._children},setChildren:function(e){this.removeChildren(),this.addChildren(e)},getFirstChild:function(){return this._children&&this._children[0]||null},getLastChild:function(){return this._children&&this._children[this._children.length-1]||null},getNextSibling:function(){var e=this._getOwner();return e&&e._children[this._index+1]||null},getPreviousSibling:function(){var e=this._getOwner();return e&&e._children[this._index-1]||null},getIndex:function(){return this._index},setIndex:function(e){var t=this._parent,r=t&&t._children;r&&t.insertChildren(e in r?e:n,[this])},equals:function(e){return e===this||e&&this._class===e._class&&this._style.equals(e._style)&&this._matrix.equals(e._matrix)&&this._locked===e._locked&&this._visible===e._visible&&this._blendMode===e._blendMode&&this._opacity===e._opacity&&this._clipMask===e._clipMask&&this._guide===e._guide&&this._equals(e)||!1},_equals:function(e){return a.equals(this._children,e._children)},clone:function(e){var t=new this.constructor(C.NO_INSERT),r=this._children,i=a.pick(e?e.insert:n,e===n||e===!0),o=a.pick(e?e.deep:n,!0);r&&t.copyAttributes(this),(!r||o)&&t.copyContent(this),r||t.copyAttributes(this),i&&t.insertAbove(this);var s=this._name,c=this._parent;if(s&&c){for(var r=c._children,l=s,u=1;r[s];)s=l+` `+ u++;s!==l&&t.setName(s)}return t},copyContent:function(e){for(var t=e._children,n=0,r=t&&t.length;n<r;n++)this.addChild(t[n].clone(!1),!0)},copyAttributes:function(e,t){this.setStyle(e._style);for(var n=[`_locked`,`_visible`,`_blendMode`,`_opacity`,`_clipMask`,`_guide`],r=0,i=n.length;r<i;r++){var o=n[r];e.hasOwnProperty(o)&&(this[o]=e[o])}t||this._matrix.set(e._matrix,!0),this.setApplyMatrix(e._applyMatrix),this.setPivot(e._pivot),this.setSelection(e._selection);var s=e._data,c=e._name;this._data=s?a.clone(s):null,c&&this.setName(c)},rasterize:function(e,t){var r,i,o;a.isPlainObject(e)?(r=e.resolution,i=e.insert,o=e.raster):(r=e,i=t),o||=new D(C.NO_INSERT);var s=this.getStrokeBounds(),c=(r||this.getView().getResolution())/72,l=s.getTopLeft().floor(),u=new g(s.getBottomRight().ceil().subtract(l)),d=u.multiply(c);if(o.setSize(d,!0),!d.isZero()){var p=o.getContext(!0),m=new b().scale(c).translate(l.negate());p.save(),m.applyToContext(p),this.draw(p,new a({matrices:[m]})),p.restore()}return o._matrix.set(new b().translate(l.add(u.divide(2))).scale(1/c)),(i===n||i)&&o.insertAbove(this),o},contains:function(){var e=this._matrix;return e.isInvertible()&&!!this._contains(e._inverseTransform(m.read(arguments)))},_contains:function(e){var t=this._children;if(t){for(var n=t.length-1;n>=0;n--)if(t[n].contains(e))return!0;return!1}return e.isInside(this.getInternalBounds())},isInside:function(){return v.read(arguments).contains(this.getBounds())},_asPathItem:function(){return new I.Rectangle({rectangle:this.getInternalBounds(),matrix:this._matrix,insert:!1})},intersects:function(e,t){return e instanceof C?this._asPathItem().getIntersections(e._asPathItem(),null,t,!0).length>0:!1}},new function(){function hitTest(){var e=arguments;return this._hitTest(m.read(e),A.getOptions(e))}function hitTestAll(){var e=arguments,t=m.read(e),n=A.getOptions(e),r=[];return this._hitTest(t,new a({all:r},n)),r}function hitTestChildren(e,t,n,r){var i=this._children;if(i)for(var a=i.length-1;a>=0;a--){var o=i[a],s=o!==r&&o._hitTest(e,t,n);if(s&&!t.all)return s}return null}return S.inject({hitTest,hitTestAll,_hitTest:hitTestChildren}),{hitTest,hitTestAll,_hitTestChildren:hitTestChildren}},{_hitTest:function(e,t,n){if(this._locked||!this._visible||this._guide&&!t.guides||this.isEmpty())return null;var r=this._matrix,i=n?n.appended(r):this.getGlobalMatrix().prepend(this.getView()._matrix),o=Math.max(t.tolerance,1e-12),s=t._tolerancePadding=new g(I._getStrokePadding(o,r._shiftless().invert()));if(e=r._inverseTransform(e),!e||!this._children&&!this.getBounds({internal:!0,stroke:!0,handle:!0}).expand(s.multiply(2))._containsPoint(e))return null;var c=!(t.guides&&!this._guide||t.selected&&!this.isSelected()||t.type&&t.type!==a.hyphenate(this._class)||t.class&&!(this instanceof t.class)),l=t.match,u=this,d,p;function filter(e){return e&&l&&!l(e)&&(e=null),e&&t.all&&t.all.push(e),e}function checkPoint(t,n){var r=n?d[`get`+n]():u.getPosition();if(e.subtract(r).divide(s).length<=1)return new A(t,u,{name:n?a.hyphenate(n):t,point:r})}var m=t.position,h=t.center,_=t.bounds;if(c&&this._parent&&(m||h||_)){if((h||_)&&(d=this.getInternalBounds()),p=m&&checkPoint(`position`)||h&&checkPoint(`center`,`Center`),!p&&_)for(var v=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`,`LeftCenter`,`TopCenter`,`RightCenter`,`BottomCenter`],y=0;y<8&&!p;y++)p=checkPoint(`bounds`,v[y]);p=filter(p)}return p||=this._hitTestChildren(e,t,i)||c&&filter(this._hitTestSelf(e,t,i,this.getStrokeScaling()?null:i._shiftless().invert()))||null,p&&p.point&&(p.point=r.transform(p.point)),p},_hitTestSelf:function(e,t){if(t.fill&&this.hasFill()&&this._contains(e))return new A(`fill`,this)},matches:function(e,t){function matchObject(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n],i=t[n];if(a.isPlainObject(r)&&a.isPlainObject(i)){if(!matchObject(r,i))return!1}else if(!a.equals(r,i))return!1}return!0}var n=typeof e;if(n===`object`){for(var r in e)if(e.hasOwnProperty(r)&&!this.matches(r,e[r]))return!1;return!0}else if(n===`function`)return e(this);else if(e===`match`)return t(this);else{var i=/^(empty|editable)$/.test(e)?this[`is`+a.capitalize(e)]():e===`type`?a.hyphenate(this._class):this[e];if(e===`class`){if(typeof t==`function`)return this instanceof t;i=this._class}if(typeof t==`function`)return!!t(i);if(t){if(t.test)return t.test(i);if(a.isPlainObject(t))return matchObject(t,i)}return a.equals(i,t)}},getItems:function(e){return C._getItems(this,e,this._matrix)},getItem:function(e){return C._getItems(this,e,this._matrix,null,!0)[0]||null},statics:{_getItems:function _getItems(e,t,n,r,i){if(!r){var o=typeof t==`object`&&t,s=o&&o.overlapping,c=o&&o.inside,l=s||c,u=l&&v.read([l]);r={items:[],recursive:o&&o.recursive!==!1,inside:!!c,overlapping:!!s,rect:u,path:s&&new I.Rectangle({rectangle:u,insert:!1})},o&&(t=a.filter({},t,{recursive:!0,inside:!0,overlapping:!0}))}var d=e._children,p=r.items,u=r.rect;n=u&&(n||new b);for(var m=0,h=d&&d.length;m<h;m++){var g=d[m],_=n&&n.appended(g._matrix),y=!0;if(u){var l=g.getBounds(_);if(!u.intersects(l))continue;u.contains(l)||r.overlapping&&(l.contains(u)||r.path.intersects(g,_))||(y=!1)}if(y&&g.matches(t)&&(p.push(g),i)||(r.recursive!==!1&&_getItems(g,t,_,r,i),i&&p.length>0))break}return p}}},{importJSON:function(e){var t=a.importJSON(e,this);return t===this?t:this.addChild(t)},addChild:function(e){return this.insertChild(n,e)},insertChild:function(e,t){var n=t?this.insertChildren(e,[t]):null;return n&&n[0]},addChildren:function(e){return this.insertChildren(this._children.length,e)},insertChildren:function(e,t){var n=this._children;if(n&&t&&t.length>0){t=a.slice(t);for(var r={},i=t.length-1;i>=0;i--){var o=t[i],s=o&&o._id;!o||r[s]?t.splice(i,1):(o._remove(!1,!0),r[s]=!0)}a.splice(n,t,e,0);for(var c=this._project,l=c._changes,i=0,u=t.length;i<u;i++){var o=t[i],d=o._name;o._parent=this,o._setProject(c,!0),d&&o.setName(d),l&&o._changed(5)}this._changed(11)}else t=null;return t},_insertItem:`#insertChild`,_insertAt:function(e,t){var n=e&&e._getOwner(),r=e!==this&&n?this:null;return r&&(r._remove(!1,!0),n._insertItem(e._index+t,r)),r},insertAbove:function(e){return this._insertAt(e,1)},insertBelow:function(e){return this._insertAt(e,0)},sendToBack:function(){var e=this._getOwner();return e?e._insertItem(0,this):null},bringToFront:function(){var e=this._getOwner();return e?e._insertItem(n,this):null},appendTop:`#addChild`,appendBottom:function(e){return this.insertChild(0,e)},moveAbove:`#insertAbove`,moveBelow:`#insertBelow`,addTo:function(e){return e._insertItem(n,this)},copyTo:function(e){return this.clone(!1).addTo(e)},reduce:function(e){var t=this._children;if(t&&t.length===1){var n=t[0].reduce(e);return this._parent?(n.insertAbove(this),this.remove()):n.remove(),n}return this},_removeNamed:function(){var e=this._getOwner();if(e){var t=e._children,n=e._namedChildren,r=this._name,i=n[r],a=i?i.indexOf(this):-1;a!==-1&&(t[r]==this&&delete t[r],i.splice(a,1),i.length?t[r]=i[0]:delete n[r])}},_remove:function(e,t){var n=this._getOwner(),r=this._project,i=this._index;return this._style&&this._style._dispose(),n?(this._name&&this._removeNamed(),i!=null&&(r._activeLayer===this&&(r._activeLayer=this.getNextSibling()||this.getPreviousSibling()),a.splice(n._children,null,i,1)),this._installEvents(!1),e&&r._changes&&this._changed(5),t&&n._changed(11,this),this._parent=null,!0):!1},remove:function(){return this._remove(!0,!0)},replaceWith:function(e){var t=e&&e.insertBelow(this);return t&&this.remove(),t},removeChildren:function(e,t){if(!this._children)return null;e||=0,t=a.pick(t,this._children.length);for(var n=a.splice(this._children,null,e,t-e),r=n.length-1;r>=0;r--)n[r]._remove(!0,!1);return n.length>0&&this._changed(11),n},clear:`#removeChildren`,reverseChildren:function(){if(this._children){this._children.reverse();for(var e=0,t=this._children.length;e<t;e++)this._children[e]._index=e;this._changed(11)}},isEmpty:function(e){var t=this._children,n=t?t.length:0;if(e){for(var r=0;r<n;r++)if(!t[r].isEmpty(e))return!1;return!0}return!n},isEditable:function(){for(var e=this;e;){if(!e._visible||e._locked)return!1;e=e._parent}return!0},hasFill:function(){return this.getStyle().hasFill()},hasStroke:function(){return this.getStyle().hasStroke()},hasShadow:function(){return this.getStyle().hasShadow()},_getOrder:function(e){function getList(e){var t=[];do t.unshift(e);while(e=e._parent);return t}for(var t=getList(this),n=getList(e),r=0,i=Math.min(t.length,n.length);r<i;r++)if(t[r]!=n[r])return t[r]._index<n[r]._index?1:-1;return 0},hasChildren:function(){return this._children&&this._children.length>0},isInserted:function(){return this._parent?this._parent.isInserted():!1},isAbove:function(e){return this._getOrder(e)===-1},isBelow:function(e){return this._getOrder(e)===1},isParent:function(e){return this._parent===e},isChild:function(e){return e&&e._parent===this},isDescendant:function(e){for(var t=this;t=t._parent;)if(t===e)return!0;return!1},isAncestor:function(e){return e?e.isDescendant(this):!1},isSibling:function(e){return this._parent===e._parent},isGroupedWith:function(e){for(var t=this._parent;t;){if(t._parent&&/^(Group|Layer|CompoundPath)$/.test(t._class)&&e.isDescendant(t))return!0;t=t._parent}return!1}},a.each([`rotate`,`scale`,`shear`,`skew`],function(e){var t=e===`rotate`;this[e]=function(){var n=arguments,r=(t?a:m).read(n),i=m.read(n,0,{readNull:!0});return this.transform(new b()[e](r,i||this.getPosition(!0)))}},{translate:function(){var e=new b;return this.transform(e.translate.apply(e,arguments))},transform:function(e,t,n){var r=this._matrix,i=e&&!e.isIdentity(),a=n&&this._canApplyMatrix||this._applyMatrix&&(i||!r.isIdentity()||t&&this._children);if(!i&&!a)return this;if(i){!e.isInvertible()&&r.isInvertible()&&(r._backup=r.getValues()),r.prepend(e,!0);var o=this._style,s=o.getFillColor(!0),c=o.getStrokeColor(!0);s&&s.transform(e),c&&c.transform(e)}if(a&&=this._transformContent(r,t,n)){var l=this._pivot;l&&r._transformPoint(l,l,!0),r.reset(!0),n&&this._canApplyMatrix&&(this._applyMatrix=!0)}var u=this._bounds,d=this._position;(i||a)&&this._changed(25);var p=i&&u&&e.decompose();if(p&&p.skewing.isZero()&&p.rotation%90==0){for(var m in u){var h=u[m];if(h.nonscaling)delete u[m];else if(a||!h.internal){var g=h.rect;e._transformBounds(g,g)}}this._bounds=u;var _=u[this._getBoundsCacheKey(this._boundsOptions||{})];_&&(this._position=this._getPositionFromBounds(_.rect))}else i&&d&&this._pivot&&(this._position=e._transformPoint(d,d));return this},_transformContent:function(e,t,n){var r=this._children;if(r){for(var i=0,a=r.length;i<a;i++)r[i].transform(e,t,n);return!0}},globalToLocal:function(){return this.getGlobalMatrix(!0)._inverseTransform(m.read(arguments))},localToGlobal:function(){return this.getGlobalMatrix(!0)._transformPoint(m.read(arguments))},parentToLocal:function(){return this._matrix._inverseTransform(m.read(arguments))},localToParent:function(){return this._matrix._transformPoint(m.read(arguments))},fitBounds:function(e,t){e=v.read(arguments);var n=this.getBounds(),r=n.height/n.width,i=e.height/e.width,a=(t?r>i:r<i)?e.width/n.width:e.height/n.height,o=new v(new m,new g(n.width*a,n.height*a));o.setCenter(e.getCenter()),this.setBounds(o)}}),{_setStyles:function(e,t,n){var r=this._style,i=this._matrix;if(r.hasFill()&&(e.fillStyle=r.getFillColor().toCanvasStyle(e,i)),r.hasStroke()){e.strokeStyle=r.getStrokeColor().toCanvasStyle(e,i),e.lineWidth=r.getStrokeWidth();var a=r.getStrokeJoin(),o=r.getStrokeCap(),s=r.getMiterLimit();if(a&&(e.lineJoin=a),o&&(e.lineCap=o),s&&(e.miterLimit=s),Z.support.nativeDash){var c=r.getDashArray(),l=r.getDashOffset();c&&c.length&&(`setLineDash`in e?(e.setLineDash(c),e.lineDashOffset=l):(e.mozDash=c,e.mozDashOffset=l))}}if(r.hasShadow()){var u=t.pixelRatio||1,d=n._shiftless().prepend(new b().scale(u,u)),p=d.transform(new m(r.getShadowBlur(),0)),h=d.transform(this.getShadowOffset());e.shadowColor=r.getShadowColor().toCanvasStyle(e),e.shadowBlur=p.getLength(),e.shadowOffsetX=h.x,e.shadowOffsetY=h.y}},draw:function(e,t,n){if(this._updateVersion=this._project._updateVersion,!(!this._visible||this._opacity===0)){var r=t.matrices,i=t.viewMatrix,a=this._matrix,o=r[r.length-1].appended(a);if(o.isInvertible()){i=i?i.appended(o):o,r.push(o),t.updateMatrix&&(this._globalMatrix=o);var s=this._blendMode,c=d.clamp(this._opacity,0,1),l=s===`normal`,u=J.nativeModes[s],p=l&&c===1||t.dontStart||t.clip||(u||l&&c<1)&&this._canComposite(),m=t.pixelRatio||1,h,g,_;if(!p){var v=this.getStrokeBounds(i);if(!v.width||!v.height){r.pop();return}_=t.offset,g=t.offset=v.getTopLeft().floor(),h=e,e=q.getContext(v.getSize().ceil().add(1).multiply(m)),m!==1&&e.scale(m,m)}e.save();var y=n?n.appended(a):this._canScaleStroke&&!this.getStrokeScaling(!0)&&i,b=!p&&t.clipItem,x=!y||b;if(p?(e.globalAlpha=c,u&&(e.globalCompositeOperation=s)):x&&e.translate(-g.x,-g.y),x&&(p?a:i).applyToContext(e),b&&t.clipItem.draw(e,t.extend({clip:!0})),y){e.setTransform(m,0,0,m,0,0);var S=t.offset;S&&e.translate(-S.x,-S.y)}this._draw(e,t,i,y),e.restore(),r.pop(),t.clip&&!t.dontFinish&&e.clip(this.getFillRule()),p||(J.process(s,e,h,c,g.subtract(_).multiply(m)),q.release(e),t.offset=_)}}},_isUpdated:function(e){var t=this._parent;if(t instanceof L)return t._isUpdated(e);var n=this._updateVersion===e;return!n&&t&&t._visible&&t._isUpdated(e)&&(this._updateVersion=e,n=!0),n},_drawSelection:function(e,t,n,r,i){var a=this._selection,o=a&1,s=a&2||o&&this._selectBounds,c=a&4;if(this._drawSelected||(o=!1),(o||s||c)&&this._isUpdated(i)){var l,u=this.getSelectedColor(!0)||(l=this.getLayer())&&l.getSelectedColor(!0),d=t.appended(this.getGlobalMatrix(!0)),p=n/2;if(e.strokeStyle=e.fillStyle=u?u.toCanvasStyle(e):`#009dec`,o&&this._drawSelected(e,d,r),c){var m=this.getPosition(!0),h=this._parent,g=h?h.localToGlobal(m):m,_=g.x,v=g.y;e.beginPath(),e.arc(_,v,p,0,Math.PI*2,!0),e.stroke();for(var y=[[0,-1],[1,0],[0,1],[-1,0]],b=p,x=n+1,S=0;S<4;S++){var C=y[S],w=C[0],T=C[1];e.moveTo(_+w*b,v+T*b),e.lineTo(_+w*x,v+T*x),e.stroke()}}if(s){var E=d._transformCorners(this.getInternalBounds());e.beginPath();for(var S=0;S<8;S++)e[S?`lineTo`:`moveTo`](E[S],E[++S]);e.closePath(),e.stroke();for(var S=0;S<8;S++)e.fillRect(E[S]-p,E[++S]-p,n,n)}}},_canComposite:function(){return!1}},a.each([`down`,`drag`,`up`,`move`],function(e){this[`removeOn`+a.capitalize(e)]=function(){var t={};return t[e]=!0,this.removeOn(t)}},{removeOn:function(e){for(var t in e)if(e[t]){var n=`mouse`+t,r=this._project,i=r._removeSets=r._removeSets||{};i[n]=i[n]||{},i[n][this._id]=this}return this}}),{tween:function(e,t,n){n||(n=t,t=e,e=null,n||(n=t,t=null));var r=n&&n.easing,i=n&&n.start,a=n!=null&&(typeof n==`number`?n:n.duration),o=new de(this,e,t,a,r,i);function onFrame(e){o._handleFrame(e.time*1e3),o.running||this.off(`frame`,onFrame)}return a&&this.on(`frame`,onFrame),o},tweenTo:function(e,t){return this.tween(null,e,t)},tweenFrom:function(e,t){return this.tween(e,null,t)}}),w=C.extend({_class:`Group`,_selectBounds:!1,_selectChildren:!0,_serializeFields:{children:[]},initialize:function Group(e){this._children=[],this._namedChildren={},this._initialize(e)||this.addChildren(Array.isArray(e)?e:arguments)},_changed:function _changed(e){_changed.base.call(this,e),e&2050&&(this._clipItem=n)},_getClipItem:function(){var e=this._clipItem;if(e===n){e=null;for(var t=this._children,r=0,i=t.length;r<i;r++)if(t[r]._clipMask){e=t[r];break}this._clipItem=e}return e},isClipped:function(){return!!this._getClipItem()},setClipped:function(e){var t=this.getFirstChild();t&&t.setClipMask(e)},_getBounds:function _getBounds(e,t){var n=this._getClipItem();return n?n._getCachedBounds(n._matrix.prepended(e),a.set({},t,{stroke:!1})):_getBounds.base.call(this,e,t)},_hitTestChildren:function _hitTestChildren(e,t,n){var r=this._getClipItem();return(!r||r.contains(e))&&_hitTestChildren.base.call(this,e,t,n,r)},_draw:function(e,t){var n=t.clip,r=!n&&this._getClipItem();t=t.extend({clipItem:r,clip:!1}),n?(e.beginPath(),t.dontStart=t.dontFinish=!0):r&&r.draw(e,t.extend({clip:!0}));for(var i=this._children,a=0,o=i.length;a<o;a++){var s=i[a];s!==r&&s.draw(e,t)}}}),T=w.extend({_class:`Layer`,initialize:function Layer(){w.apply(this,arguments)},_getOwner:function(){return this._parent||this._index!=null&&this._project},isInserted:function isInserted(){return this._parent?isInserted.base.call(this):this._index!=null},activate:function(){this._project._activeLayer=this},_hitTestSelf:function(){}}),E=C.extend({_class:`Shape`,_applyMatrix:!1,_canApplyMatrix:!1,_canScaleStroke:!0,_serializeFields:{type:null,size:null,radius:null},initialize:function Shape(e,t){this._initialize(e,t)},_equals:function(e){return this._type===e._type&&this._size.equals(e._size)&&a.equals(this._radius,e._radius)},copyContent:function(e){this.setType(e._type),this.setSize(e._size),this.setRadius(e._radius)},getType:function(){return this._type},setType:function(e){this._type=e},getShape:`#getType`,setShape:`#setType`,getSize:function(){var e=this._size;return new _(e.width,e.height,this,`setSize`)},setSize:function(){var e=g.read(arguments);if(!this._size)this._size=e.clone();else if(!this._size.equals(e)){var t=this._type,n=e.width,r=e.height;t===`rectangle`?this._radius.set(g.min(this._radius,e.divide(2).abs())):t===`circle`?(n=r=(n+r)/2,this._radius=n/2):t===`ellipse`&&this._radius._set(n/2,r/2),this._size._set(n,r),this._changed(9)}},getRadius:function(){var e=this._radius;return this._type===`circle`?e:new _(e.width,e.height,this,`setRadius`)},setRadius:function(e){var t=this._type;if(t===`circle`){if(e===this._radius)return;var n=e*2;this._radius=e,this._size._set(n,n)}else if(e=g.read(arguments),!this._radius)this._radius=e.clone();else{if(this._radius.equals(e))return;if(this._radius.set(e),t===`rectangle`){var n=g.max(this._size,e.multiply(2));this._size.set(n)}else t===`ellipse`&&this._size._set(e.width*2,e.height*2)}this._changed(9)},isEmpty:function(){return!1},toPath:function(e){var t=new I[a.capitalize(this._type)]({center:new m,size:this._size,radius:this._radius,insert:!1});return t.copyAttributes(this),Z.settings.applyMatrix&&t.setApplyMatrix(!0),(e===n||e)&&t.insertAbove(this),t},toShape:`#clone`,_asPathItem:function(){return this.toPath(!1)},_draw:function(e,t,n,r){var i=this._style,a=i.hasFill(),o=i.hasStroke(),s=t.dontFinish||t.clip,c=!r;if(a||o||s){var l=this._type,u=this._radius,d=l===`circle`;if(t.dontStart||e.beginPath(),c&&d)e.arc(0,0,u,0,Math.PI*2,!0);else{var p=d?u:u.width,m=d?u:u.height,h=this._size,g=h.width,_=h.height;if(c&&l===`rectangle`&&p===0&&m===0)e.rect(-g/2,-_/2,g,_);else{var v=g/2,y=_/2,b=.44771525016920644,x=p*b,S=m*b,C=[-v,-y+m,-v,-y+S,-v+x,-y,-v+p,-y,v-p,-y,v-x,-y,v,-y+S,v,-y+m,v,y-m,v,y-S,v-x,y,v-p,y,-v+p,y,-v+x,y,-v,y-S,-v,y-m];r&&r.transform(C,C,32),e.moveTo(C[0],C[1]),e.bezierCurveTo(C[2],C[3],C[4],C[5],C[6],C[7]),v!==p&&e.lineTo(C[8],C[9]),e.bezierCurveTo(C[10],C[11],C[12],C[13],C[14],C[15]),y!==m&&e.lineTo(C[16],C[17]),e.bezierCurveTo(C[18],C[19],C[20],C[21],C[22],C[23]),v!==p&&e.lineTo(C[24],C[25]),e.bezierCurveTo(C[26],C[27],C[28],C[29],C[30],C[31])}}e.closePath()}!s&&(a||o)&&(this._setStyles(e,t,n),a&&(e.fill(i.getFillRule()),e.shadowColor=`rgba(0,0,0,0)`),o&&e.stroke())},_canComposite:function(){return!(this.hasFill()&&this.hasStroke())},_getBounds:function(e,t){var n=new v(this._size).setCenter(0,0),r=this._style,i=t.stroke&&r.hasStroke()&&r.getStrokeWidth();return e&&(n=e._transformBounds(n)),i?n.expand(I._getStrokePadding(i,this._getStrokeMatrix(e,t))):n}},new function(){function getCornerCenter(e,t,n){var r=e._radius;if(!r.isZero())for(var i=e._size.divide(2),a=1;a<=4;a++){var o=new m(a>1&&a<4?-1:1,a>2?-1:1),s=o.multiply(i),c=s.subtract(o.multiply(r));if(new v(n?s.add(o.multiply(n)):s,c).contains(t))return{point:c,quadrant:a}}}function isOnEllipseStroke(e,t,n,r){var i=e.divide(t);return(!r||i.isInQuadrant(r))&&i.subtract(i.normalize()).multiply(t).divide(n).length<=1}return{_contains:function _contains(e){if(this._type===`rectangle`){var t=getCornerCenter(this,e);return t?e.subtract(t.point).divide(this._radius).getLength()<=1:_contains.base.call(this,e)}else return e.divide(this.size).getLength()<=.5},_hitTestSelf:function _hitTestSelf(e,t,n,r){var i=!1,a=this._style,o=t.stroke&&a.hasStroke(),s=t.fill&&a.hasFill();if(o||s){var c=this._type,l=this._radius,u=o?a.getStrokeWidth()/2:0,d=t._tolerancePadding.add(I._getStrokePadding(u,!a.getStrokeScaling()&&r));if(c===`rectangle`){var p=d.multiply(2),m=getCornerCenter(this,e,p);if(m)i=isOnEllipseStroke(e.subtract(m.point),l,d,m.quadrant);else{var h=new v(this._size).setCenter(0,0),g=h.expand(p),_=h.expand(p.negate());i=g._containsPoint(e)&&!_._containsPoint(e)}}else i=isOnEllipseStroke(e,l,d)}return i?new A(o?`stroke`:`fill`,this):_hitTestSelf.base.apply(this,arguments)}}},{statics:new function(){function createShape(e,t,n,r,i){var o=a.create(E.prototype);return o._type=e,o._size=n,o._radius=r,o._initialize(a.getNamed(i),t),o}return{Circle:function(){var e=arguments,t=m.readNamed(e,`center`),n=a.readNamed(e,`radius`);return createShape(`circle`,t,new g(n*2),n,e)},Rectangle:function(){var e=arguments,t=v.readNamed(e,`rectangle`),n=g.min(g.readNamed(e,`radius`),t.getSize(!0).divide(2));return createShape(`rectangle`,t.getCenter(!0),t.getSize(!0),n,e)},Ellipse:function(){var e=arguments,t=E._readEllipse(e),n=t.radius;return createShape(`ellipse`,t.center,n.multiply(2),n,e)},_readEllipse:function(e){var t,n;if(a.hasNamed(e,`radius`))t=m.readNamed(e,`center`),n=g.readNamed(e,`radius`);else{var r=v.readNamed(e,`rectangle`);t=r.getCenter(!0),n=r.getSize(!0).divide(2)}return{center:t,radius:n}}}}}),D=C.extend({_class:`Raster`,_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!1,handle:!1},_serializeFields:{crossOrigin:null,source:null},_prioritize:[`crossOrigin`],_smoothing:`low`,beans:!0,initialize:function Raster(e,t){if(!this._initialize(e,t!==n&&m.read(arguments))){var r,a=typeof e,o=a===`string`?i.getElementById(e):a===`object`?e:null;if(o&&o!==C.NO_INSERT){if(o.getContext||o.naturalHeight!=null)r=o;else if(o){var s=g.read(arguments);s.isZero()||(r=q.getCanvas(s))}}r?this.setImage(r):this.setSource(e)}this._size||(this._size=new g,this._loaded=!1)},_equals:function(e){return this.getSource()===e.getSource()},copyContent:function(e){var t=e._image,n=e._canvas;if(t)this._setImage(t);else if(n){var r=q.getCanvas(e._size);r.getContext(`2d`).drawImage(n,0,0),this._setImage(r)}this._crossOrigin=e._crossOrigin},getSize:function(){var e=this._size;return new _(e?e.width:0,e?e.height:0,this,`setSize`)},setSize:function(e,t){var n=g.read(arguments);if(n.equals(this._size))t&&this.clear();else if(n.width>0&&n.height>0){var r=!t&&this.getElement();this._setImage(q.getCanvas(n)),r&&this.getContext(!0).drawImage(r,0,0,n.width,n.height)}else this._canvas&&q.release(this._canvas),this._size=n.clone()},getWidth:function(){return this._size?this._size.width:0},setWidth:function(e){this.setSize(e,this.getHeight())},getHeight:function(){return this._size?this._size.height:0},setHeight:function(e){this.setSize(this.getWidth(),e)},getLoaded:function(){return this._loaded},isEmpty:function(){var e=this._size;return!e||e.width===0&&e.height===0},getResolution:function(){var e=this._matrix,t=new m(0,0).transform(e),n=new m(1,0).transform(e).subtract(t),r=new m(0,1).transform(e).subtract(t);return new g(72/n.getLength(),72/r.getLength())},getPpi:`#getResolution`,getImage:function(){return this._image},setImage:function(e){var t=this;function emit(e){var n=t.getView(),r=e&&e.type||`load`;n&&t.responds(r)&&(Z=n._scope,t.emit(r,new G(e)))}this._setImage(e),this._loaded?setTimeout(emit,0):e&&H.add(e,{load:function(n){t._setImage(e),emit(n)},error:emit})},_setImage:function(e){this._canvas&&q.release(this._canvas),e&&e.getContext?(this._image=null,this._canvas=e,this._loaded=!0):(this._image=e,this._canvas=null,this._loaded=!!(e&&e.src&&e.complete)),this._size=new g(e?e.naturalWidth||e.width:0,e?e.naturalHeight||e.height:0),this._context=null,this._changed(1033)},getCanvas:function(){if(!this._canvas){var e=q.getContext(this._size);try{this._image&&e.drawImage(this._image,0,0),this._canvas=e.canvas}catch{q.release(e)}}return this._canvas},setCanvas:`#setImage`,getContext:function(e){return this._context||=this.getCanvas().getContext(`2d`),e&&(this._image=null,this._changed(1025)),this._context},setContext:function(e){this._context=e},getSource:function(){var e=this._image;return e&&e.src||this.toDataURL()},setSource:function(t){var n=new e.Image,r=this._crossOrigin;r&&(n.crossOrigin=r),t&&(n.src=t),this.setImage(n)},getCrossOrigin:function(){var e=this._image;return e&&e.crossOrigin||this._crossOrigin||``},setCrossOrigin:function(e){this._crossOrigin=e;var t=this._image;t&&(t.crossOrigin=e)},getSmoothing:function(){return this._smoothing},setSmoothing:function(e){this._smoothing=typeof e==`string`?e:e?`low`:`off`,this._changed(257)},getElement:function(){return this._canvas||this._loaded&&this._image}},{beans:!1,getSubCanvas:function(){var e=v.read(arguments),t=q.getContext(e.getSize());return t.drawImage(this.getCanvas(),e.x,e.y,e.width,e.height,0,0,e.width,e.height),t.canvas},getSubRaster:function(){var e=v.read(arguments),t=new D(C.NO_INSERT);return t._setImage(this.getSubCanvas(e)),t.translate(e.getCenter().subtract(this.getSize().divide(2))),t._matrix.prepend(this._matrix),t.insertAbove(this),t},toDataURL:function(){var e=this._image,t=e&&e.src;if(/^data:/.test(t))return t;var n=this.getCanvas();return n?n.toDataURL.apply(n,arguments):null},drawImage:function(e){var t=m.read(arguments,1);this.getContext(!0).drawImage(e,t.x,t.y)},getAverageColor:function(e){var t,n;if(e?e instanceof F?(n=e,t=e.getBounds()):typeof e==`object`&&(`width`in e?t=new v(e):`x`in e&&(t=new v(e.x-.5,e.y-.5,1,1))):t=this.getBounds(),!t)return null;var r=32,i=Math.min(t.width,r),o=Math.min(t.height,r),s=D._sampleContext;s?s.clearRect(0,0,r+1,r+1):s=D._sampleContext=q.getContext(new g(r)),s.save();var c=new b().scale(i/t.width,o/t.height).translate(-t.x,-t.y);c.applyToContext(s),n&&n.draw(s,new a({clip:!0,matrices:[c]})),this._matrix.applyToContext(s);var l=this.getElement(),u=this._size;l&&s.drawImage(l,-u.width/2,-u.height/2),s.restore();for(var d=s.getImageData(.5,.5,Math.ceil(i),Math.ceil(o)).data,p=[0,0,0],m=0,h=0,_=d.length;h<_;h+=4){var y=d[h+3];m+=y,y/=255,p[0]+=d[h]*y,p[1]+=d[h+1]*y,p[2]+=d[h+2]*y}for(var h=0;h<3;h++)p[h]/=m;return m?z.read(p):null},getPixel:function(){var e=m.read(arguments),t=this.getContext().getImageData(e.x,e.y,1,1).data;return new z(`rgb`,[t[0]/255,t[1]/255,t[2]/255],t[3]/255)},setPixel:function(){var e=arguments,t=m.read(e),n=z.read(e),r=n._convert(`rgb`),i=n._alpha,a=this.getContext(!0),o=a.createImageData(1,1),s=o.data;s[0]=r[0]*255,s[1]=r[1]*255,s[2]=r[2]*255,s[3]=i==null?255:i*255,a.putImageData(o,t.x,t.y)},clear:function(){var e=this._size;this.getContext(!0).clearRect(0,0,e.width+1,e.height+1)},createImageData:function(){var e=g.read(arguments);return this.getContext().createImageData(e.width,e.height)},getImageData:function(){var e=v.read(arguments);return e.isEmpty()&&(e=new v(this._size)),this.getContext().getImageData(e.x,e.y,e.width,e.height)},putImageData:function(e){var t=m.read(arguments,1);this.getContext(!0).putImageData(e,t.x,t.y)},setImageData:function(e){this.setSize(e),this.getContext(!0).putImageData(e,0,0)},_getBounds:function(e,t){var n=new v(this._size).setCenter(0,0);return e?e._transformBounds(n):n},_hitTestSelf:function(e){if(this._contains(e)){var t=this;return new A(`pixel`,t,{offset:e.add(t._size.divide(2)).round(),color:{get:function(){return t.getPixel(this.offset)}}})}},_draw:function(e,t,n){var r=this.getElement();if(r&&r.width>0&&r.height>0){e.globalAlpha=d.clamp(this._opacity,0,1),this._setStyles(e,t,n);var i=this._smoothing,a=i===`off`;V.setPrefixed(e,a?`imageSmoothingEnabled`:`imageSmoothingQuality`,a?!1:i),e.drawImage(r,-this._size.width/2,-this._size.height/2)}},_canComposite:function(){return!0}}),O=C.extend({_class:`SymbolItem`,_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!0},_serializeFields:{symbol:null},initialize:function SymbolItem(e,t){this._initialize(e,t!==n&&m.read(arguments,1))||this.setDefinition(e instanceof k?e:new k(e))},_equals:function(e){return this._definition===e._definition},copyContent:function(e){this.setDefinition(e._definition)},getDefinition:function(){return this._definition},setDefinition:function(e){this._definition=e,this._changed(9)},getSymbol:`#getDefinition`,setSymbol:`#setDefinition`,isEmpty:function(){return this._definition._item.isEmpty()},_getBounds:function(e,t){var n=this._definition._item;return n._getCachedBounds(n._matrix.prepended(e),t)},_hitTestSelf:function(e,t,n){var r=t.extend({all:!1}),i=this._definition._item._hitTest(e,r,n);return i&&(i.item=this),i},_draw:function(e,t){this._definition._item.draw(e,t)}}),k=a.extend({_class:`SymbolDefinition`,initialize:function SymbolDefinition(e,t){this._id=p.get(),this.project=Z.project,e&&this.setItem(e,t)},_serialize:function(e,t){return t.add(this,function(){return a.serialize([this._class,this._item],e,!1,t)})},_changed:function(e){e&8&&C._clearBoundsCache(this),e&1&&this.project._changed(e)},getItem:function(){return this._item},setItem:function(e,t){e._symbol&&(e=e.clone()),this._item&&(this._item._symbol=null),this._item=e,e.remove(),e.setSelected(!1),t||e.setPosition(new m),e._symbol=this,this._changed(9)},getDefinition:`#getItem`,setDefinition:`#setItem`,place:function(e){return new O(this,e)},clone:function(){return new k(this._item.clone(!1))},equals:function(e){return e===this||e&&this._item.equals(e._item)||!1}}),A=a.extend({_class:`HitResult`,initialize:function HitResult(e,t,n){this.type=e,this.item=t,n&&this.inject(n)},statics:{getOptions:function(e){var t=e&&a.read(e);return new a({type:null,tolerance:Z.settings.hitTolerance,fill:!t,stroke:!t,segments:!t,handles:!1,ends:!1,position:!1,center:!1,bounds:!1,guides:!1,selected:!1},t)}}}),j=a.extend({_class:`Segment`,beans:!0,_selection:0,initialize:function Segment(e,t,r,i,a,o){var s=arguments.length,c,l,u,d;s>0&&(e==null||typeof e==`object`?s===1&&e&&`point`in e?(c=e.point,l=e.handleIn,u=e.handleOut,d=e.selection):(c=e,l=t,u=r,d=i):(c=[e,t],l=r===n?null:[r,i],u=a===n?null:[a,o])),new M(c,this,`_point`),new M(l,this,`_handleIn`),new M(u,this,`_handleOut`),d&&this.setSelection(d)},_serialize:function(e,t){var n=this._point,r=this._selection,i=r||this.hasHandles()?[n,this._handleIn,this._handleOut]:n;return r&&i.push(r),a.serialize(i,e,!0,t)},_changed:function(e){var t=this._path;if(t){var n=t._curves,r=this._index,i;n&&((!e||e===this._point||e===this._handleIn)&&(i=r>0?n[r-1]:t._closed?n[n.length-1]:null)&&i._changed(),(!e||e===this._point||e===this._handleOut)&&(i=n[r])&&i._changed()),t._changed(41)}},getPoint:function(){return this._point},setPoint:function(){this._point.set(m.read(arguments))},getHandleIn:function(){return this._handleIn},setHandleIn:function(){this._handleIn.set(m.read(arguments))},getHandleOut:function(){return this._handleOut},setHandleOut:function(){this._handleOut.set(m.read(arguments))},hasHandles:function(){return!this._handleIn.isZero()||!this._handleOut.isZero()},isSmooth:function(){var e=this._handleIn,t=this._handleOut;return!e.isZero()&&!t.isZero()&&e.isCollinear(t)},clearHandles:function(){this._handleIn._set(0,0),this._handleOut._set(0,0)},getSelection:function(){return this._selection},setSelection:function(e){var t=this._selection,n=this._path;this._selection=e||=0,n&&e!==t&&(n._updateSelection(this,t,e),n._changed(257))},_changeSelection:function(e,t){var n=this._selection;this.setSelection(t?n|e:n&~e)},isSelected:function(){return!!(this._selection&7)},setSelected:function(e){this._changeSelection(7,e)},getIndex:function(){return this._index===n?null:this._index},getPath:function(){return this._path||null},getCurve:function(){var e=this._path,t=this._index;return e?(t>0&&!e._closed&&t===e._segments.length-1&&t--,e.getCurves()[t]||null):null},getLocation:function(){var e=this.getCurve();return e?new P(e,this===e._segment1?0:1):null},getNext:function(){var e=this._path&&this._path._segments;return e&&(e[this._index+1]||this._path._closed&&e[0])||null},smooth:function(e,t,r){var i=e||{},a=i.type,o=i.factor,s=this.getPrevious(),c=this.getNext(),l=(s||this)._point,u=this._point,d=(c||this)._point,p=l.getDistance(u),h=u.getDistance(d);if(!a||a===`catmull-rom`){var g=o===n?.5:o,_=p**+g,v=_*_,y=h**+g,b=y*y;if(!t&&s){var x=2*b+3*y*_+v,S=3*y*(y+_);this.setHandleIn(S===0?new m:new m((b*l._x+x*u._x-v*d._x)/S-u._x,(b*l._y+x*u._y-v*d._y)/S-u._y))}if(!r&&c){var x=2*v+3*_*y+b,S=3*_*(_+y);this.setHandleOut(S===0?new m:new m((v*d._x+x*u._x-b*l._x)/S-u._x,(v*d._y+x*u._y-b*l._y)/S-u._y))}}else if(a===`geometric`){if(s&&c){var C=l.subtract(d),w=o===n?.4:o,T=w*p/(p+h);t||this.setHandleIn(C.multiply(T)),r||this.setHandleOut(C.multiply(T-w))}}else throw Error(`Smoothing method '`+a+`' not supported.`)},getPrevious:function(){var e=this._path&&this._path._segments;return e&&(e[this._index-1]||this._path._closed&&e[e.length-1])||null},isFirst:function(){return!this._index},isLast:function(){var e=this._path;return e&&this._index===e._segments.length-1||!1},reverse:function(){var e=this._handleIn,t=this._handleOut,n=e.clone();e.set(t),t.set(n)},reversed:function(){return new j(this._point,this._handleOut,this._handleIn)},remove:function(){return this._path?!!this._path.removeSegment(this._index):!1},clone:function(){return new j(this._point,this._handleIn,this._handleOut)},equals:function(e){return e===this||e&&this._class===e._class&&this._point.equals(e._point)&&this._handleIn.equals(e._handleIn)&&this._handleOut.equals(e._handleOut)||!1},toString:function(){var e=[`point: `+this._point];return this._handleIn.isZero()||e.push(`handleIn: `+this._handleIn),this._handleOut.isZero()||e.push(`handleOut: `+this._handleOut),`{ `+e.join(`, `)+` }`},transform:function(e){this._transformCoordinates(e,[,,,,,,],!0),this._changed()},interpolate:function(e,t,n){var r=1-n,i=n,a=e._point,o=t._point,s=e._handleIn,c=t._handleIn,l=t._handleOut,u=e._handleOut;this._point._set(r*a._x+i*o._x,r*a._y+i*o._y,!0),this._handleIn._set(r*s._x+i*c._x,r*s._y+i*c._y,!0),this._handleOut._set(r*u._x+i*l._x,r*u._y+i*l._y,!0),this._changed()},_transformCoordinates:function(e,t,n){var r=this._point,i=!n||!this._handleIn.isZero()?this._handleIn:null,a=!n||!this._handleOut.isZero()?this._handleOut:null,o=r._x,s=r._y,c=2;return t[0]=o,t[1]=s,i&&(t[c++]=i._x+o,t[c++]=i._y+s),a&&(t[c++]=a._x+o,t[c++]=a._y+s),e&&(e._transformCoordinates(t,t,c/2),o=t[0],s=t[1],n?(r._x=o,r._y=s,c=2,i&&(i._x=t[c++]-o,i._y=t[c++]-s),a&&(a._x=t[c++]-o,a._y=t[c++]-s)):(i||(t[c++]=o,t[c++]=s),a||(t[c++]=o,t[c++]=s))),t}}),M=m.extend({initialize:function SegmentPoint(e,t,r){var i,a,o;if(!e)i=a=0;else if((i=e[0])!==n)a=e[1];else{var s=e;(i=s.x)===n&&(s=m.read(arguments),i=s.x),a=s.y,o=s.selected}this._x=i,this._y=a,this._owner=t,t[r]=this,o&&this.setSelected(!0)},_set:function(e,t){return this._x=e,this._y=t,this._owner._changed(this),this},getX:function(){return this._x},setX:function(e){this._x=e,this._owner._changed(this)},getY:function(){return this._y},setY:function(e){this._y=e,this._owner._changed(this)},isZero:function(){var e=d.isZero;return e(this._x)&&e(this._y)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(e){this._owner._changeSelection(this._getSelection(),e)},_getSelection:function(){var e=this._owner;return this===e._point?1:this===e._handleIn?2:this===e._handleOut?4:0}}),N=a.extend({_class:`Curve`,beans:!0,initialize:function Curve(e,t,n,r,i,a,o,s){var c=arguments.length,l,u,d,p,m,h;c===3?(this._path=e,l=t,u=n):c?c===1?`segment1`in e?(l=new j(e.segment1),u=new j(e.segment2)):`point1`in e?(d=e.point1,m=e.handle1,h=e.handle2,p=e.point2):Array.isArray(e)&&(d=[e[0],e[1]],p=[e[6],e[7]],m=[e[2]-e[0],e[3]-e[1]],h=[e[4]-e[6],e[5]-e[7]]):c===2?(l=new j(e),u=new j(t)):c===4?(d=e,m=t,h=n,p=r):c===8&&(d=[e,t],p=[o,s],m=[n-e,r-t],h=[i-o,a-s]):(l=new j,u=new j),this._segment1=l||new j(d,null,m),this._segment2=u||new j(p,h,null)},_serialize:function(e,t){return a.serialize(this.hasHandles()?[this.getPoint1(),this.getHandle1(),this.getHandle2(),this.getPoint2()]:[this.getPoint1(),this.getPoint2()],e,!0,t)},_changed:function(){this._length=this._bounds=n},clone:function(){return new N(this._segment1,this._segment2)},toString:function(){var e=[`point1: `+this._segment1._point];return this._segment1._handleOut.isZero()||e.push(`handle1: `+this._segment1._handleOut),this._segment2._handleIn.isZero()||e.push(`handle2: `+this._segment2._handleIn),e.push(`point2: `+this._segment2._point),`{ `+e.join(`, `)+` }`},classify:function(){return N.classify(this.getValues())},remove:function(){var e=!1;if(this._path){var t=this._segment2,n=t._handleOut;e=t.remove(),e&&this._segment1._handleOut.set(n)}return e},getPoint1:function(){return this._segment1._point},setPoint1:function(){this._segment1._point.set(m.read(arguments))},getPoint2:function(){return this._segment2._point},setPoint2:function(){this._segment2._point.set(m.read(arguments))},getHandle1:function(){return this._segment1._handleOut},setHandle1:function(){this._segment1._handleOut.set(m.read(arguments))},getHandle2:function(){return this._segment2._handleIn},setHandle2:function(){this._segment2._handleIn.set(m.read(arguments))},getSegment1:function(){return this._segment1},getSegment2:function(){return this._segment2},getPath:function(){return this._path},getIndex:function(){return this._segment1._index},getNext:function(){var e=this._path&&this._path._curves;return e&&(e[this._segment1._index+1]||this._path._closed&&e[0])||null},getPrevious:function(){var e=this._path&&this._path._curves;return e&&(e[this._segment1._index-1]||this._path._closed&&e[e.length-1])||null},isFirst:function(){return!this._segment1._index},isLast:function(){var e=this._path;return e&&this._segment1._index===e._curves.length-1||!1},isSelected:function(){return this.getPoint1().isSelected()&&this.getHandle1().isSelected()&&this.getHandle2().isSelected()&&this.getPoint2().isSelected()},setSelected:function(e){this.getPoint1().setSelected(e),this.getHandle1().setSelected(e),this.getHandle2().setSelected(e),this.getPoint2().setSelected(e)},getValues:function(e){return N.getValues(this._segment1,this._segment2,e)},getPoints:function(){for(var e=this.getValues(),t=[],n=0;n<8;n+=2)t.push(new m(e[n],e[n+1]));return t}},{getLength:function(){return this._length??=N.getLength(this.getValues(),0,1),this._length},getArea:function(){return N.getArea(this.getValues())},getLine:function(){return new x(this._segment1._point,this._segment2._point)},getPart:function(e,t){return new N(N.getPart(this.getValues(),e,t))},getPartLength:function(e,t){return N.getLength(this.getValues(),e,t)},divideAt:function(e){return this.divideAtTime(e&&e.curve===this?e.time:this.getTimeAt(e))},divideAtTime:function(e,t){var n=1e-8,r=1-n,i=null;if(e>=n&&e<=r){var a=N.subdivide(this.getValues(),e),o=a[0],s=a[1],c=t||this.hasHandles(),l=this._segment1,u=this._segment2,d=this._path;c&&(l._handleOut._set(o[2]-o[0],o[3]-o[1]),u._handleIn._set(s[4]-s[6],s[5]-s[7]));var p=o[6],h=o[7],g=new j(new m(p,h),c&&new m(o[4]-p,o[5]-h),c&&new m(s[2]-p,s[3]-h));d?(d.insert(l._index+1,g),i=this.getNext()):(this._segment2=g,this._changed(),i=new N(g,u))}return i},splitAt:function(e){var t=this._path;return t?t.splitAt(e):null},splitAtTime:function(e){return this.splitAt(this.getLocationAtTime(e))},divide:function(e,t){return this.divideAtTime(e===n?.5:t?e:this.getTimeAt(e))},split:function(e,t){return this.splitAtTime(e===n?.5:t?e:this.getTimeAt(e))},reversed:function(){return new N(this._segment2.reversed(),this._segment1.reversed())},clearHandles:function(){this._segment1._handleOut._set(0,0),this._segment2._handleIn._set(0,0)},statics:{getValues:function(e,t,n,r){var i=e._point,a=e._handleOut,o=t._handleIn,s=t._point,c=i.x,l=i.y,u=s.x,d=s.y,p=r?[c,l,c,l,u,d,u,d]:[c,l,c+a._x,l+a._y,u+o._x,d+o._y,u,d];return n&&n._transformCoordinates(p,p,4),p},subdivide:function(e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7];t===n&&(t=.5);var d=1-t,p=d*r+t*a,m=d*i+t*o,h=d*a+t*s,g=d*o+t*c,_=d*s+t*l,v=d*c+t*u,y=d*p+t*h,b=d*m+t*g,x=d*h+t*_,S=d*g+t*v,C=d*y+t*x,w=d*b+t*S;return[[r,i,p,m,y,b,C,w],[C,w,x,S,_,v,l,u]]},getMonoCurves:function(e,t){var n=[],r=t?0:1,i=e[r+0],a=e[r+2],o=e[r+4],s=e[r+6];if(i>=a==a>=o&&a>=o==o>=s||N.isStraight(e))n.push(e);else{var c=3*(a-o)-i+s,l=2*(i+o)-4*a,u=a-i,p=1e-8,m=1-p,h=[],g=d.solveQuadratic(c,l,u,h,p,m);if(!g)n.push(e);else{h.sort();var _=h[0],v=N.subdivide(e,_);n.push(v[0]),g>1&&(_=(h[1]-_)/(1-_),v=N.subdivide(v[1],_),n.push(v[0])),n.push(v[1])}}return n},solveCubic:function(e,t,n,r,i,a){var o=e[t],s=e[t+2],c=e[t+4],l=e[t+6],u=0;if(!(o<n&&l<n&&s<n&&c<n||o>n&&l>n&&s>n&&c>n)){var p=3*(s-o),m=3*(c-s)-p,h=l-o-p-m;u=d.solveCubic(h,m,p,o-n,r,i,a)}return u},getTimeOf:function(e,t){var n=new m(e[0],e[1]),r=new m(e[6],e[7]),i=1e-12,a=1e-7;if((t.isClose(n,i)?0:t.isClose(r,i)?1:null)===null)for(var o=[t.x,t.y],s=[],c=0;c<2;c++)for(var l=N.solveCubic(e,c,o[c],s,0,1),u=0;u<l;u++){var d=s[u];if(t.isClose(N.getPoint(e,d),a))return d}return t.isClose(n,a)?0:t.isClose(r,a)?1:null},getNearestTime:function(e,t){if(N.isStraight(e)){var n=e[0],r=e[1],i=e[6],a=e[7],o=i-n,s=a-r,c=o*o+s*s;if(c===0)return 0;var l=((t.x-n)*o+(t.y-r)*s)/c;return l<1e-12?0:l>.999999999999?1:N.getTimeOf(e,new m(n+l*o,r+l*s))}var u=100,d=1/0,p=0;function refine(n){if(n>=0&&n<=1){var r=t.getDistance(N.getPoint(e,n),!0);if(r<d)return d=r,p=n,!0}}for(var h=0;h<=u;h++)refine(h/u);for(var g=1/(u*2);g>1e-8;)!refine(p-g)&&!refine(p+g)&&(g/=2);return p},getPart:function(e,t,n){var r=t>n;if(r){var i=t;t=n,n=i}return t>0&&(e=N.subdivide(e,t)[1]),n<1&&(e=N.subdivide(e,(n-t)/(1-t))[0]),r?[e[6],e[7],e[4],e[5],e[2],e[3],e[0],e[1]]:e},isFlatEnough:function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=3*i-2*n-c,d=3*a-2*r-l,p=3*o-2*c-n,m=3*s-2*l-r;return Math.max(u*u,p*p)+Math.max(d*d,m*m)<=16*t*t},getArea:function(e){var t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7];return 3*((c-n)*(r+a)-(s-t)*(i+o)+i*(t-a)-r*(n-o)+c*(a+t/3)-s*(o+n/3))/20},getBounds:function(e){for(var t=e.slice(0,2),n=t.slice(),r=[0,0],i=0;i<2;i++)N._addBounds(e[i],e[i+2],e[i+4],e[i+6],i,0,t,n,r);return new v(t[0],t[1],n[0]-t[0],n[1]-t[1])},_addBounds:function(e,t,n,r,i,a,o,s,c){function add(e,t){var n=e-t,r=e+t;n<o[i]&&(o[i]=n),r>s[i]&&(s[i]=r)}a/=2;var l=o[i]+a,u=s[i]-a;if(e<l||t<l||n<l||r<l||e>u||t>u||n>u||r>u)if(t<e!=t<r&&n<e!=n<r)add(e,0),add(r,0);else{var p=3*(t-n)-e+r,m=2*(e+n)-4*t,h=t-e,g=d.solveQuadratic(p,m,h,c),_=1e-8,v=1-_;add(r,0);for(var y=0;y<g;y++){var b=c[y],x=1-b;_<=b&&b<=v&&add(x*x*x*e+3*x*x*b*t+3*x*b*b*n+b*b*b*r,a)}}}}},a.each([`getBounds`,`getStrokeBounds`,`getHandleBounds`],function(e){this[e]=function(){this._bounds||={};var t=this._bounds[e];return t||=this._bounds[e]=I[e]([this._segment1,this._segment2],!1,this._path),t.clone()}},{}),a.each({isStraight:function(e,t,n,r){if(t.isZero()&&n.isZero())return!0;var i=r.subtract(e);if(i.isZero())return!1;if(i.isCollinear(t)&&i.isCollinear(n)){var a=new x(e,r),o=1e-7;if(a.getDistance(e.add(t))<o&&a.getDistance(r.add(n))<o){var s=i.dot(i),c=i.dot(t)/s,l=i.dot(n)/s;return c>=0&&c<=1&&l<=0&&l>=-1}}return!1},isLinear:function(e,t,n,r){var i=r.subtract(e).divide(3);return t.equals(i)&&n.negate().equals(i)}},function(e,t){this[t]=function(t){var n=this._segment1,r=this._segment2;return e(n._point,n._handleOut,r._handleIn,r._point,t)},this.statics[t]=function(t,n){var r=t[0],i=t[1],a=t[6],o=t[7];return e(new m(r,i),new m(t[2]-r,t[3]-i),new m(t[4]-a,t[5]-o),new m(a,o),n)}},{statics:{},hasHandles:function(){return!this._segment1._handleOut.isZero()||!this._segment2._handleIn.isZero()},hasLength:function(e){return(!this.getPoint1().equals(this.getPoint2())||this.hasHandles())&&this.getLength()>(e||0)},isCollinear:function(e){return e&&this.isStraight()&&e.isStraight()&&this.getLine().isCollinear(e.getLine())},isHorizontal:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).y)<1e-8},isVertical:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).x)<1e-8}}),{beans:!1,getLocationAt:function(e,t){return this.getLocationAtTime(t?e:this.getTimeAt(e))},getLocationAtTime:function(e){return e!=null&&e>=0&&e<=1?new P(this,e):null},getTimeAt:function(e,t){return N.getTimeAt(this.getValues(),e,t)},getParameterAt:`#getTimeAt`,getTimesWithTangent:function(){var e=m.read(arguments);return e.isZero()?[]:N.getTimesWithTangent(this.getValues(),e)},getOffsetAtTime:function(e){return this.getPartLength(0,e)},getLocationOf:function(){return this.getLocationAtTime(this.getTimeOf(m.read(arguments)))},getOffsetOf:function(){var e=this.getLocationOf.apply(this,arguments);return e?e.getOffset():null},getTimeOf:function(){return N.getTimeOf(this.getValues(),m.read(arguments))},getParameterOf:`#getTimeOf`,getNearestLocation:function(){var e=m.read(arguments),t=this.getValues(),n=N.getNearestTime(t,e),r=N.getPoint(t,n);return new P(this,n,r,null,e.getDistance(r))},getNearestPoint:function(){var e=this.getNearestLocation.apply(this,arguments);return e&&e.getPoint()}},new function(){var e=[`getPoint`,`getTangent`,`getNormal`,`getWeightedTangent`,`getWeightedNormal`,`getCurvature`];return a.each(e,function(e){this[e+`At`]=function(t,n){var r=this.getValues();return N[e](r,n?t:N.getTimeAt(r,t))},this[e+`AtTime`]=function(t){return N[e](this.getValues(),t)}},{statics:{_evaluateMethods:e}})},new function(){function getLengthIntegrand(e){var t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=9*(r-a)+3*(s-t),u=6*(t+a)-12*r,d=3*(r-t),p=9*(i-o)+3*(c-n),m=6*(n+o)-12*i,h=3*(i-n);return function(e){var t=(l*e+u)*e+d,n=(p*e+m)*e+h;return Math.sqrt(t*t+n*n)}}function getIterations(e,t){return Math.max(2,Math.min(16,Math.ceil(Math.abs(t-e)*32)))}function evaluate(e,t,n,r){if(t==null||t<0||t>1)return null;var i=e[0],a=e[1],o=e[2],s=e[3],c=e[4],l=e[5],u=e[6],p=e[7],h=d.isZero;h(o-i)&&h(s-a)&&(o=i,s=a),h(c-u)&&h(l-p)&&(c=u,l=p);var g=3*(o-i),_=3*(c-o)-g,v=u-i-g-_,y=3*(s-a),b=3*(l-s)-y,x=p-a-y-b,S,C;if(n===0)S=t===0?i:t===1?u:((v*t+_)*t+g)*t+i,C=t===0?a:t===1?p:((x*t+b)*t+y)*t+a;else{var w=1e-8,T=1-w;if(t<w?(S=g,C=y):t>T?(S=3*(u-c),C=3*(p-l)):(S=(3*v*t+2*_)*t+g,C=(3*x*t+2*b)*t+y),r){S===0&&C===0&&(t<w||t>T)&&(S=c-o,C=l-s);var E=Math.sqrt(S*S+C*C);E&&(S/=E,C/=E)}if(n===3){var c=6*v*t+2*_,l=6*x*t+2*b,D=(S*S+C*C)**(3/2);S=D===0?0:(S*l-C*c)/D,C=0}}return n===2?new m(C,-S):new m(S,C)}return{statics:{classify:function(e){var t=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=t*(l-s)+r*(o-c)+c*s-l*o,p=i*(r-l)+a*(c-t)+t*l-r*c,m=3*(o*(a-r)+s*(t-i)+i*r-a*t),h=m-p,g=h-p+u,_=Math.sqrt(g*g+h*h+m*m),v=_===0?0:1/_,y=d.isZero,b=`serpentine`;g*=v,h*=v,m*=v;function type(e,t,r){var i=t!==n,a=i&&t>0&&t<1,o=i&&r>0&&r<1;return i&&(!(a||o)||e===`loop`&&!(a&&o))&&(e=`arch`,a=o=!1),{type:e,roots:a||o?a&&o?t<r?[t,r]:[r,t]:[a?t:r]:null}}if(y(g))return y(h)?type(y(m)?`line`:`quadratic`):type(b,m/(3*h));var x=3*h*h-4*g*m;if(y(x))return type(`cusp`,h/(2*g));var S=x>0?Math.sqrt(x/3):Math.sqrt(-x),C=2*g;return type(x>0?b:`loop`,(h+S)/C,(h-S)/C)},getLength:function(e,t,r,i){if(t===n&&(t=0),r===n&&(r=1),N.isStraight(e)){var a=e;r<1&&(a=N.subdivide(a,r)[0],t/=r),t>0&&(a=N.subdivide(a,t)[1]);var o=a[6]-a[0],s=a[7]-a[1];return Math.sqrt(o*o+s*s)}return d.integrate(i||getLengthIntegrand(e),t,r,getIterations(t,r))},getTimeAt:function(e,t,r){if(r===n&&(r=t<0?1:0),t===0)return r;var i=Math.abs,a=1e-12,o=t>0,s=o?r:0,c=o?1:r,l=getLengthIntegrand(e),u=N.getLength(e,s,c,l),p=i(t)-u;if(i(p)<a)return o?c:s;if(p>a)return null;var m=t/u,h=0;function f(e){return h+=d.integrate(l,r,e,getIterations(r,e)),r=e,h-t}return d.findRoot(f,l,r+m,s,c,32,1e-12)},getPoint:function(e,t){return evaluate(e,t,0,!1)},getTangent:function(e,t){return evaluate(e,t,1,!0)},getWeightedTangent:function(e,t){return evaluate(e,t,1,!1)},getNormal:function(e,t){return evaluate(e,t,2,!0)},getWeightedNormal:function(e,t){return evaluate(e,t,2,!1)},getCurvature:function(e,t){return evaluate(e,t,3,!1).x},getPeaks:function(e){var t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=-t+3*r-3*a+s,u=3*t-6*r+3*a,p=-3*t+3*r,m=-n+3*i-3*o+c,h=3*n-6*i+3*o,g=-3*n+3*i,_=1e-8,v=1-_,y=[];return d.solveCubic(9*(l*l+m*m),9*(l*u+h*m),2*(u*u+h*h)+3*(p*l+g*m),p*u+h*g,y,_,v),y.sort()}}}},new function(){function addLocation(e,t,n,r,i,a,o){var s=!o&&n.getPrevious()===i,c=!o&&n!==i&&n.getNext()===i,l=1e-8,u=1-l;if(r!==null&&r>=(s?l:0)&&r<=(c?u:1)&&a!==null&&a>=(c?l:0)&&a<=(s?u:1)){var d=new P(n,r,null,o),p=new P(i,a,null,o);d._intersection=p,p._intersection=d,(!t||t(d))&&P.insert(e,d,!0)}}function addCurveIntersections(e,t,n,r,i,a,o,s,c,l,u,d,p){if(++c>=4096||++s>=40)return c;var m=1e-9,h=t[0],g=t[1],_=t[6],v=t[7],y=x.getSignedDistance,b=y(h,g,_,v,t[2],t[3]),S=y(h,g,_,v,t[4],t[5]),C=b*S>0?3/4:4/9,w=C*Math.min(0,b,S),T=C*Math.max(0,b,S),E=y(h,g,_,v,e[0],e[1]),D=y(h,g,_,v,e[2],e[3]),O=y(h,g,_,v,e[4],e[5]),k=y(h,g,_,v,e[6],e[7]),A=getConvexHull(E,D,O,k),j=A[0],M=A[1],P,F;if(b===0&&S===0&&E===0&&D===0&&O===0&&k===0||(P=clipConvexHull(j,M,w,T))==null||(F=clipConvexHull(j.reverse(),M.reverse(),w,T))==null)return c;var I=l+(u-l)*P,L=l+(u-l)*F;if(Math.max(p-d,L-I)<m){var ee=(I+L)/2,te=(d+p)/2;addLocation(i,a,o?r:n,o?te:ee,o?n:r,o?ee:te)}else{e=N.getPart(e,P,F);var R=p-d;if(F-P>.8)if(L-I>R){var ne=N.subdivide(e,.5),ee=(I+L)/2;c=addCurveIntersections(t,ne[0],r,n,i,a,!o,s,c,d,p,I,ee),c=addCurveIntersections(t,ne[1],r,n,i,a,!o,s,c,d,p,ee,L)}else{var ne=N.subdivide(t,.5),te=(d+p)/2;c=addCurveIntersections(ne[0],e,r,n,i,a,!o,s,c,d,te,I,L),c=addCurveIntersections(ne[1],e,r,n,i,a,!o,s,c,te,p,I,L)}else c=R===0||R>=m?addCurveIntersections(t,e,r,n,i,a,!o,s,c,d,p,I,L):addCurveIntersections(e,t,n,r,i,a,o,s,c,I,L,d,p)}return c}function getConvexHull(e,t,n,r){var i=[0,e],a=[1/3,t],o=[2/3,n],s=[1,r],c=t-(2*e+r)/3,l=n-(e+2*r)/3,u;if(c*l<0)u=[[i,a,s],[i,o,s]];else{var d=c/l;u=[d>=2?[i,a,s]:d<=.5?[i,o,s]:[i,a,o,s],[i,s]]}return(c||l)<0?u.reverse():u}function clipConvexHull(e,t,n,r){return e[0][1]<n?clipConvexHullPart(e,!0,n):t[0][1]>r?clipConvexHullPart(t,!1,r):e[0][0]}function clipConvexHullPart(e,t,n){for(var r=e[0][0],i=e[0][1],a=1,o=e.length;a<o;a++){var s=e[a][0],c=e[a][1];if(t?c>=n:c<=n)return c===n?s:r+(n-i)*(s-r)/(c-i);r=s,i=c}return null}function getCurveLineIntersections(e,t,n,r,i){var a=d.isZero;if(a(r)&&a(i)){var o=N.getTimeOf(e,new m(t,n));return o===null?[]:[o]}for(var s=Math.atan2(-i,r),c=Math.sin(s),l=Math.cos(s),u=[],p=[],h=0;h<8;h+=2){var g=e[h]-t,_=e[h+1]-n;u.push(g*l-_*c,g*c+_*l)}return N.solveCubic(u,1,0,p,0,1),p}function addCurveLineIntersections(e,t,n,r,i,a,o){for(var s=t[0],c=t[1],l=t[6],u=t[7],d=getCurveLineIntersections(e,s,c,l-s,u-c),p=0,m=d.length;p<m;p++){var h=d[p],g=N.getPoint(e,h),_=N.getTimeOf(t,g);_!==null&&addLocation(i,a,o?r:n,o?_:h,o?n:r,o?h:_)}}function addLineIntersection(e,t,n,r,i,a){var o=x.intersect(e[0],e[1],e[6],e[7],t[0],t[1],t[6],t[7]);o&&addLocation(i,a,n,N.getTimeOf(e,o),r,N.getTimeOf(t,o))}function getCurveIntersections(e,t,n,r,i,a){var o=1e-12,s=Math.min,c=Math.max;if(c(e[0],e[2],e[4],e[6])+o>s(t[0],t[2],t[4],t[6])&&s(e[0],e[2],e[4],e[6])-o<c(t[0],t[2],t[4],t[6])&&c(e[1],e[3],e[5],e[7])+o>s(t[1],t[3],t[5],t[7])&&s(e[1],e[3],e[5],e[7])-o<c(t[1],t[3],t[5],t[7])){var l=getOverlaps(e,t);if(l)for(var u=0;u<2;u++){var d=l[u];addLocation(i,a,n,d[0],r,d[1],!0)}else{var p=N.isStraight(e),h=N.isStraight(t),g=p&&h,_=p&&!h,v=i.length;if((g?addLineIntersection:p||h?addCurveLineIntersections:addCurveIntersections)(_?t:e,_?e:t,_?r:n,_?n:r,i,a,_,0,0,0,1,0,1),!g||i.length===v)for(var u=0;u<4;u++){var y=u>>1,b=u&1,x=y*6,S=b*6,C=new m(e[x],e[x+1]),w=new m(t[S],t[S+1]);C.isClose(w,o)&&addLocation(i,a,n,y,r,b)}}}return i}function getSelfIntersection(e,t,n,r){var i=N.classify(e);if(i.type===`loop`){var a=i.roots;addLocation(n,r,t,a[0],t,a[1])}return n}function getIntersections(e,t,n,r,i,a){var o=1e-7,s=!t;s&&(t=e);for(var c=e.length,u=t.length,d=Array(c),p=s?d:Array(u),m=[],h=0;h<c;h++)d[h]=e[h].getValues(r);if(!s)for(var h=0;h<u;h++)p[h]=t[h].getValues(i);for(var g=l.findCurveBoundsCollisions(d,p,o),_=0;_<c;_++){var v=e[_],y=d[_];s&&getSelfIntersection(y,v,m,n);var b=g[_];if(b)for(var x=0;x<b.length;x++){if(a&&m.length)return m;var S=b[x];if(!s||S>_){var C=t[S],w=p[S];getCurveIntersections(y,w,v,C,m,n)}}}return m}function getOverlaps(e,t){function getSquaredLineLength(e){var t=e[6]-e[0],n=e[7]-e[1];return t*t+n*n}var n=Math.abs,r=x.getDistance,i=1e-8,a=1e-7,o=N.isStraight(e),s=N.isStraight(t),c=o&&s,l=getSquaredLineLength(e)<getSquaredLineLength(t),u=l?t:e,d=l?e:t,p=u[0],h=u[1],g=u[6]-p,_=u[7]-h;if(r(p,h,g,_,d[0],d[1],!0)<a&&r(p,h,g,_,d[6],d[7],!0)<a)!c&&r(p,h,g,_,u[2],u[3],!0)<a&&r(p,h,g,_,u[4],u[5],!0)<a&&r(p,h,g,_,d[2],d[3],!0)<a&&r(p,h,g,_,d[4],d[5],!0)<a&&(o=s=c=!0);else if(c)return null;if(o^s)return null;for(var v=[e,t],y=[],b=0;b<4&&y.length<2;b++){var S=b&1,C=S^1,w=b>>1,T=N.getTimeOf(v[S],new m(v[C][w?6:0],v[C][w?7:1]));if(T!=null){var E=S?[w,T]:[T,w];(!y.length||n(E[0]-y[0][0])>i&&n(E[1]-y[0][1])>i)&&y.push(E)}if(b>2&&!y.length)break}if(y.length!==2)y=null;else if(!c){var D=N.getPart(e,y[0][0],y[1][0]),O=N.getPart(t,y[0][1],y[1][1]);(n(O[2]-D[2])>a||n(O[3]-D[3])>a||n(O[4]-D[4])>a||n(O[5]-D[5])>a)&&(y=null)}return y}function getTimesWithTangent(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=t.normalize(),p=u.x,m=u.y,h=3*c-9*o+9*i-3*n,g=3*l-9*s+9*a-3*r,_=6*o-12*i+6*n,v=6*s-12*a+6*r,y=3*i-3*n,b=3*a-3*r,x=2*h*m-2*g*p,S=[];if(Math.abs(x)<d.CURVETIME_EPSILON){var C=h*b-g*y,x=h*v-g*_;if(x!=0){var w=-C/x;w>=0&&w<=1&&S.push(w)}}else{var T=(_*_-4*h*y)*m*m+(-2*_*v+4*g*y+4*h*b)*p*m+(v*v-4*g*b)*p*p,E=_*m-v*p;if(T>=0&&x!=0){var D=Math.sqrt(T),O=-(E+D)/x,k=(-E+D)/x;O>=0&&O<=1&&S.push(O),k>=0&&k<=1&&S.push(k)}}return S}return{getIntersections:function(e){var t=this.getValues(),n=e&&e!==this&&e.getValues();return n?getCurveIntersections(t,n,this,e,[]):getSelfIntersection(t,this,[])},statics:{getOverlaps,getIntersections,getCurveLineIntersections,getTimesWithTangent}}}),P=a.extend({_class:`CurveLocation`,initialize:function CurveLocation(e,t,n,r,i){if(t>=.99999999){var a=e.getNext();a&&(t=0,e=a)}this._setCurve(e),this._time=t,this._point=n||e.getPointAtTime(t),this._overlap=r,this._distance=i,this._intersection=this._next=this._previous=null},_setPath:function(e){this._path=e,this._version=e?e._version:0},_setCurve:function(e){this._setPath(e._path),this._curve=e,this._segment=null,this._segment1=e._segment1,this._segment2=e._segment2},_setSegment:function(e){var t=e.getCurve();t?this._setCurve(t):(this._setPath(e._path),this._segment1=e,this._segment2=null),this._segment=e,this._time=e===this._segment1?0:1,this._point=e._point.clone()},getSegment:function(){var e=this._segment;if(!e){var t=this.getCurve(),n=this.getTime();n===0?e=t._segment1:n===1?e=t._segment2:n!=null&&(e=t.getPartLength(0,n)<t.getPartLength(n,1)?t._segment1:t._segment2),this._segment=e}return e},getCurve:function(){var e=this._path,t=this;e&&e._version!==this._version&&(this._time=this._offset=this._curveOffset=this._curve=null);function trySegment(e){var n=e&&e.getCurve();if(n&&(t._time=n.getTimeOf(t._point))!=null)return t._setCurve(n),n}return this._curve||trySegment(this._segment)||trySegment(this._segment1)||trySegment(this._segment2.getPrevious())},getPath:function(){var e=this.getCurve();return e&&e._path},getIndex:function(){var e=this.getCurve();return e&&e.getIndex()},getTime:function(){var e=this.getCurve(),t=this._time;return e&&t==null?this._time=e.getTimeOf(this._point):t},getParameter:`#getTime`,getPoint:function(){return this._point},getOffset:function(){var e=this._offset;if(e==null){e=0;var t=this.getPath(),n=this.getIndex();if(t&&n!=null)for(var r=t.getCurves(),i=0;i<n;i++)e+=r[i].getLength();this._offset=e+=this.getCurveOffset()}return e},getCurveOffset:function(){var e=this._curveOffset;if(e==null){var t=this.getCurve(),n=this.getTime();this._curveOffset=e=n!=null&&t&&t.getPartLength(0,n)}return e},getIntersection:function(){return this._intersection},getDistance:function(){return this._distance},divide:function(){var e=this.getCurve(),t=e&&e.divideAtTime(this.getTime());return t&&this._setSegment(t._segment1),t},split:function(){var e=this.getCurve(),t=e._path,n=e&&e.splitAtTime(this.getTime());return n&&this._setSegment(t.getLastSegment()),n},equals:function(e,t){var n=this===e;if(!n&&e instanceof P){var r=this.getCurve(),i=e.getCurve(),a=r._path;if(a===i._path){var o=Math.abs,s=1e-7,c=o(this.getOffset()-e.getOffset()),l=!t&&this._intersection,u=!t&&e._intersection;n=(c<s||a&&o(a.getLength()-c)<s)&&(!l&&!u||l&&u&&l.equals(u,!0))}}return n},toString:function(){var e=[],t=this.getPoint(),n=u.instance;t&&e.push(`point: `+t);var r=this.getIndex();r!=null&&e.push(`index: `+r);var i=this.getTime();return i!=null&&e.push(`time: `+n.number(i)),this._distance!=null&&e.push(`distance: `+n.number(this._distance)),`{ `+e.join(`, `)+` }`},isTouching:function(){var e=this._intersection;if(e&&this.getTangent().isCollinear(e.getTangent())){var t=this.getCurve(),n=e.getCurve();return!(t.isStraight()&&n.isStraight()&&t.getLine().intersect(n.getLine()))}return!1},isCrossing:function(){var e=this._intersection;if(!e)return!1;var t=this.getTime(),n=e.getTime(),r=1e-8,i=1-r,a=t>=r&&t<=i,o=n>=r&&n<=i;if(a&&o)return!this.isTouching();var s=this.getCurve(),c=s&&t<r?s.getPrevious():s,l=e.getCurve(),u=l&&n<r?l.getPrevious():l;if(t>i&&(s=s.getNext()),n>i&&(l=l.getNext()),!c||!s||!u||!l)return!1;var d=[];function addOffsets(e,t){var n=e.getValues(),r=N.classify(n).roots||N.getPeaks(n),i=r.length,a=N.getLength(n,t&&i?r[i-1]:0,!t&&i?r[0]:1);d.push(i?a:a/32)}function isInRange(e,t,n){return t<n?e>t&&e<n:e>t||e<n}a||(addOffsets(c,!0),addOffsets(s,!1)),o||(addOffsets(u,!0),addOffsets(l,!1));var p=this.getPoint(),m=Math.min.apply(Math,d),h=a?s.getTangentAtTime(t):s.getPointAt(m).subtract(p),g=a?h.negate():c.getPointAt(-m).subtract(p),_=o?l.getTangentAtTime(n):l.getPointAt(m).subtract(p),v=o?_.negate():u.getPointAt(-m).subtract(p),y=g.getAngle(),b=h.getAngle(),x=v.getAngle(),S=_.getAngle();return!!(a?isInRange(y,x,S)^isInRange(b,x,S)&&isInRange(y,S,x)^isInRange(b,S,x):isInRange(x,y,b)^isInRange(S,y,b)&&isInRange(x,b,y)^isInRange(S,b,y))},hasOverlap:function(){return!!this._overlap}},a.each(N._evaluateMethods,function(e){var t=e+`At`;this[e]=function(){var e=this.getCurve(),n=this.getTime();return n!=null&&e&&e[t](n,!0)}},{preserve:!0}),new function(){function insert(e,t,n){var r=e.length,i=0,a=r-1;function search(n,i){for(var a=n+i;a>=-1&&a<=r;a+=i){var o=e[(a%r+r)%r];if(!t.getPoint().isClose(o.getPoint(),1e-7))break;if(t.equals(o))return o}return null}for(;i<=a;){var o=i+a>>>1,s=e[o],c;if(n&&(c=t.equals(s)?s:search(o,-1)||search(o,1)))return t._overlap&&(c._overlap=c._intersection._overlap=!0),c;var l=t.getPath(),u=s.getPath();(l===u?t.getIndex()+t.getTime()-(s.getIndex()+s.getTime()):l._id-u._id)<0?a=o-1:i=o+1}return e.splice(i,0,t),t}return{statics:{insert,expand:function(e){for(var t=e.slice(),n=e.length-1;n>=0;n--)insert(t,e[n]._intersection,!1);return t}}}}),F=C.extend({_class:`PathItem`,_selectBounds:!1,_canScaleStroke:!0,beans:!0,initialize:function PathItem(){},statics:{create:function(e){var t,n,r;if(a.isPlainObject(e)?(n=e.segments,t=e.pathData):Array.isArray(e)?n=e:typeof e==`string`&&(t=e),n){var i=n[0];r=i&&Array.isArray(i[0])}else t&&(r=(t.match(/m/gi)||[]).length>1||/z\s*\S+/i.test(t));return new(r?L:I)(e)}},_asPathItem:function(){return this},isClockwise:function(){return this.getArea()>=0},setClockwise:function(e){this.isClockwise()!=(e=!!e)&&this.reverse()},setPathData:function(e){var t=e&&e.match(/[mlhvcsqtaz][^mlhvcsqtaz]*/gi),n,r=!1,i,a,o=new m,s=new m;function getCoord(e,t){var i=+n[e];return r&&(i+=o[t]),i}function getPoint(e){return new m(getCoord(e,`x`),getCoord(e+1,`y`))}this.clear();for(var c=0,l=t&&t.length;c<l;c++){var u=t[c],d=u[0],p=d.toLowerCase();n=u.match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g);var h=n&&n.length;switch(r=d===p,i===`z`&&!/[mz]/.test(p)&&this.moveTo(o),p){case`m`:case`l`:for(var _=p===`m`,v=0;v<h;v+=2)this[_?`moveTo`:`lineTo`](o=getPoint(v)),_&&=(s=o,!1);a=o;break;case`h`:case`v`:var y=p===`h`?`x`:`y`;o=o.clone();for(var v=0;v<h;v++)o[y]=getCoord(v,y),this.lineTo(o);a=o;break;case`c`:for(var v=0;v<h;v+=6)this.cubicCurveTo(getPoint(v),a=getPoint(v+2),o=getPoint(v+4));break;case`s`:for(var v=0;v<h;v+=4)this.cubicCurveTo(/[cs]/.test(i)?o.multiply(2).subtract(a):o,a=getPoint(v),o=getPoint(v+2)),i=p;break;case`q`:for(var v=0;v<h;v+=4)this.quadraticCurveTo(a=getPoint(v),o=getPoint(v+2));break;case`t`:for(var v=0;v<h;v+=2)this.quadraticCurveTo(a=/[qt]/.test(i)?o.multiply(2).subtract(a):o,o=getPoint(v)),i=p;break;case`a`:for(var v=0;v<h;v+=7)this.arcTo(o=getPoint(v+5),new g(+n[v],+n[v+1]),+n[v+2],+n[v+4],+n[v+3]);break;case`z`:this.closePath(1e-12),o=s;break}i=p}},_canComposite:function(){return!(this.hasFill()&&this.hasStroke())},_contains:function(e){var t=e.isInside(this.getBounds({internal:!0,handle:!0}))?this._getWinding(e):{};return t.onPath||!!(this.getFillRule()===`evenodd`?t.windingL&1||t.windingR&1:t.winding)},getIntersections:function(e,t,n,r){var i=this===e||!e,a=this._matrix._orNullIfIdentity(),o=i?a:(n||e._matrix)._orNullIfIdentity();return i||this.getBounds(a).intersects(e.getBounds(o),1e-12)?N.getIntersections(this.getCurves(),!i&&e.getCurves(),t,a,o,r):[]},getCrossings:function(e){return this.getIntersections(e,function(e){return e.isCrossing()})},getNearestLocation:function(){for(var e=m.read(arguments),t=this.getCurves(),n=1/0,r=null,i=0,a=t.length;i<a;i++){var o=t[i].getNearestLocation(e);o._distance<n&&(n=o._distance,r=o)}return r},getNearestPoint:function(){var e=this.getNearestLocation.apply(this,arguments);return e&&e.getPoint()},interpolate:function(e,t,n){var r=!this._children,i=r?`_segments`:`_children`,a=e[i],o=t[i],s=this[i];if(!a||!o||a.length!==o.length)throw Error(`Invalid operands in interpolate() call: `+e+`, `+t);var c=s.length,l=o.length;if(c<l)for(var u=r?j:I,d=c;d<l;d++)this.add(new u);else c>l&&this[r?`removeSegments`:`removeChildren`](l,c);for(var d=0;d<l;d++)s[d].interpolate(a[d],o[d],n);r&&(this.setClosed(e._closed),this._changed(9))},compare:function(e){var t=!1;if(e){var n=this._children||[this],r=e._children?e._children.slice():[e],i=n.length,a=r.length,o=[],s=0;t=!0;for(var c=l.findItemBoundsCollisions(n,r,d.GEOMETRIC_EPSILON),u=i-1;u>=0&&t;u--){var p=n[u];t=!1;var m=c[u];if(m)for(var h=m.length-1;h>=0&&!t;h--)p.compare(r[m[h]])&&(o[m[h]]||(o[m[h]]=!0,s++),t=!0)}t&&=s===a}return t}}),I=F.extend({_class:`Path`,_serializeFields:{segments:[],closed:!1},initialize:function Path(e){this._closed=!1,this._segments=[],this._version=0;var t=arguments,r=Array.isArray(e)?typeof e[0]==`object`?e:t:e&&e.size===n&&(e.x!==n||e.point!==n)?t:null;r&&r.length>0?this.setSegments(r):(this._curves=n,this._segmentSelection=0,!r&&typeof e==`string`&&(this.setPathData(e),e=null)),this._initialize(!r&&e)},_equals:function(e){return this._closed===e._closed&&a.equals(this._segments,e._segments)},copyContent:function(e){this.setSegments(e._segments),this._closed=e._closed},_changed:function _changed(e){if(_changed.base.call(this,e),e&8){if(this._length=this._area=n,e&32)this._version++;else if(this._curves)for(var t=0,r=this._curves.length;t<r;t++)this._curves[t]._changed()}else e&64&&(this._bounds=n)},getStyle:function(){var e=this._parent;return(e instanceof L?e:this)._style},getSegments:function(){return this._segments},setSegments:function(e){var t=this.isFullySelected(),r=e&&e.length;if(this._segments.length=0,this._segmentSelection=0,this._curves=n,r){var i=e[r-1];typeof i==`boolean`&&(this.setClosed(i),r--),this._add(j.readList(e,0,{},r))}t&&this.setFullySelected(!0)},getFirstSegment:function(){return this._segments[0]},getLastSegment:function(){return this._segments[this._segments.length-1]},getCurves:function(){var e=this._curves,t=this._segments;if(!e){var n=this._countCurves();e=this._curves=Array(n);for(var r=0;r<n;r++)e[r]=new N(this,t[r],t[r+1]||t[0])}return e},getFirstCurve:function(){return this.getCurves()[0]},getLastCurve:function(){var e=this.getCurves();return e[e.length-1]},isClosed:function(){return this._closed},setClosed:function(e){if(this._closed!=(e=!!e)){if(this._closed=e,this._curves){var t=this._curves.length=this._countCurves();e&&(this._curves[t-1]=new N(this,this._segments[t-1],this._segments[0]))}this._changed(41)}}},{beans:!0,getPathData:function(e,t){var n=this._segments,r=n.length,i=new u(t),a=[,,,,,,],o=!0,s,c,l,d,p,m,h,g,_=[];function addSegment(t,n){if(t._transformCoordinates(e,a),s=a[0],c=a[1],o)_.push(`M`+i.pair(s,c)),o=!1;else if(p=a[2],m=a[3],p===s&&m===c&&h===l&&g===d){if(!n){var r=s-l,u=c-d;_.push(r===0?`v`+i.number(u):u===0?`h`+i.number(r):`l`+i.pair(r,u))}}else _.push(`c`+i.pair(h-l,g-d)+` `+i.pair(p-l,m-d)+` `+i.pair(s-l,c-d));l=s,d=c,h=a[4],g=a[5]}if(!r)return``;for(var v=0;v<r;v++)addSegment(n[v]);return this._closed&&r>0&&(addSegment(n[0],!0),_.push(`z`)),_.join(``)},isEmpty:function(){return!this._segments.length},_transformContent:function(e){for(var t=this._segments,n=[,,,,,,],r=0,i=t.length;r<i;r++)t[r]._transformCoordinates(e,n,!0);return!0},_add:function(e,t){for(var n=this._segments,r=this._curves,i=e.length,o=t==null,t=o?n.length:t,s=0;s<i;s++){var c=e[s];c._path&&(c=e[s]=c.clone()),c._path=this,c._index=t+s,c._selection&&this._updateSelection(c,0,c._selection)}if(o)a.push(n,e);else{n.splice.apply(n,[t,0].concat(e));for(var s=t+i,l=n.length;s<l;s++)n[s]._index=s}if(r){var u=this._countCurves(),d=t>0&&t+i-1===u?t-1:t,p=d,m=Math.min(d+i,u);e._curves&&(r.splice.apply(r,[d,0].concat(e._curves)),p+=e._curves.length);for(var s=p;s<m;s++)r.splice(s,0,new N(this,null,null));this._adjustCurves(d,m)}return this._changed(41),e},_adjustCurves:function(e,t){for(var n=this._segments,r=this._curves,i,a=e;a<t;a++)i=r[a],i._path=this,i._segment1=n[a],i._segment2=n[a+1]||n[0],i._changed();(i=r[this._closed&&!e?n.length-1:e-1])&&(i._segment2=n[e]||n[0],i._changed()),(i=r[t])&&(i._segment1=n[t],i._changed())},_countCurves:function(){var e=this._segments.length;return!this._closed&&e>0?e-1:e},add:function(e){var t=arguments;return t.length>1&&typeof e!=`number`?this._add(j.readList(t)):this._add([j.read(t)])[0]},insert:function(e,t){var n=arguments;return n.length>2&&typeof t!=`number`?this._add(j.readList(n,1),e):this._add([j.read(n,1)],e)[0]},addSegment:function(){return this._add([j.read(arguments)])[0]},insertSegment:function(e){return this._add([j.read(arguments,1)],e)[0]},addSegments:function(e){return this._add(j.readList(e))},insertSegments:function(e,t){return this._add(j.readList(t),e)},removeSegment:function(e){return this.removeSegments(e,e+1)[0]||null},removeSegments:function(e,t,n){e||=0,t=a.pick(t,this._segments.length);var r=this._segments,i=this._curves,o=r.length,s=r.splice(e,t-e),c=s.length;if(!c)return s;for(var l=0;l<c;l++){var u=s[l];u._selection&&this._updateSelection(u,u._selection,0),u._index=u._path=null}for(var l=e,d=r.length;l<d;l++)r[l]._index=l;if(i){for(var p=e>0&&t===o+(this._closed?1:0)?e-1:e,i=i.splice(p,c),l=i.length-1;l>=0;l--)i[l]._path=null;n&&(s._curves=i.slice(1)),this._adjustCurves(p,p)}return this._changed(41),s},clear:`#removeSegments`,hasHandles:function(){for(var e=this._segments,t=0,n=e.length;t<n;t++)if(e[t].hasHandles())return!0;return!1},clearHandles:function(){for(var e=this._segments,t=0,n=e.length;t<n;t++)e[t].clearHandles()},getLength:function(){if(this._length==null){for(var e=this.getCurves(),t=0,n=0,r=e.length;n<r;n++)t+=e[n].getLength();this._length=t}return this._length},getArea:function(){var e=this._area;if(e==null){var t=this._segments,n=this._closed;e=0;for(var r=0,i=t.length;r<i;r++){var a=r+1===i;e+=N.getArea(N.getValues(t[r],t[a?0:r+1],null,a&&!n))}this._area=e}return e},isFullySelected:function(){var e=this._segments.length;return this.isSelected()&&e>0&&this._segmentSelection===e*7},setFullySelected:function(e){e&&this._selectSegments(!0),this.setSelected(e)},setSelection:function setSelection(e){e&1||this._selectSegments(!1),setSelection.base.call(this,e)},_selectSegments:function(e){var t=this._segments,n=t.length,r=e?7:0;this._segmentSelection=r*n;for(var i=0;i<n;i++)t[i]._selection=r},_updateSelection:function(e,t,n){e._selection=n,(this._segmentSelection+=n-t)>0&&this.setSelected(!0)},divideAt:function(e){var t=this.getLocationAt(e),n;return t&&(n=t.getCurve().divideAt(t.getCurveOffset()))?n._segment1:null},splitAt:function(e){var t=this.getLocationAt(e),n=t&&t.index,r=t&&t.time,i=1e-8,a=1-i;r>a&&(n++,r=0);var o=this.getCurves();if(n>=0&&n<o.length){r>=i&&o[n++].divideAtTime(r);var s=this.removeSegments(n,this._segments.length,!0),c;return this._closed?(this.setClosed(!1),c=this):(c=new I(C.NO_INSERT),c.insertAbove(this),c.copyAttributes(this)),c._add(s,0),this.addSegment(s[0]),c}return null},split:function(e,t){var r,i=t===n?e:(r=this.getCurves()[e])&&r.getLocationAtTime(t);return i==null?null:this.splitAt(i)},join:function(e,t){var n=t||0;if(e&&e!==this){var r=e._segments,i=this.getLastSegment(),a=e.getLastSegment();if(!a)return this;i&&i._point.isClose(a._point,n)&&e.reverse();var o=e.getFirstSegment();if(i&&i._point.isClose(o._point,n))i.setHandleOut(o._handleOut),this._add(r.slice(1));else{var s=this.getFirstSegment();s&&s._point.isClose(o._point,n)&&e.reverse(),a=e.getLastSegment(),s&&s._point.isClose(a._point,n)?(s.setHandleIn(a._handleIn),this._add(r.slice(0,r.length-1),0)):this._add(r.slice())}e._closed&&this._add([r[0]]),e.remove()}var c=this.getFirstSegment(),l=this.getLastSegment();return c!==l&&c._point.isClose(l._point,n)&&(c.setHandleIn(l._handleIn),l.remove(),this.setClosed(!0)),this},reduce:function(e){for(var t=this.getCurves(),n=e&&e.simplify,r=n?1e-7:0,i=t.length-1;i>=0;i--){var a=t[i];!a.hasHandles()&&(!a.hasLength(r)||n&&a.isCollinear(a.getNext()))&&a.remove()}return this},reverse:function(){this._segments.reverse();for(var e=0,t=this._segments.length;e<t;e++){var n=this._segments[e],r=n._handleIn;n._handleIn=n._handleOut,n._handleOut=r,n._index=e}this._curves=null,this._changed(9)},flatten:function(e){for(var t=new ee(this,e||.25,256,!0).parts,n=t.length,r=[],i=0;i<n;i++)r.push(new j(t[i].curve.slice(0,2)));!this._closed&&n>0&&r.push(new j(t[n-1].curve.slice(6))),this.setSegments(r)},simplify:function(e){var t=new te(this).fit(e||2.5);return t&&this.setSegments(t),!!t},smooth:function(e){var t=this,r=e||{},i=r.type||`asymmetric`,a=this._segments,o=a.length,s=this._closed;function getIndex(e,n){var r=e&&e.index;if(r!=null){var i=e.path;if(i&&i!==t)throw Error(e._class+` `+r+` of `+i+` is not part of `+t);n&&e instanceof N&&r++}else r=typeof e==`number`?e:n;return Math.min(r<0&&s?r%o:r<0?r+o:r,o-1)}var c=s&&r.from===n&&r.to===n,l=getIndex(r.from,0),u=getIndex(r.to,o-1);if(l>u)if(s)l-=o;else{var d=l;l=u,u=d}if(/^(?:asymmetric|continuous)$/.test(i)){var p=i===`asymmetric`,m=Math.min,h=u-l+1,g=h-1,_=c?m(h,4):1,v=_,y=_,b=[];if(s||(v=m(1,l),y=m(1,o-u-1)),g+=v+y,g<=1)return;for(var x=0,S=l-v;x<=g;x++,S++)b[x]=a[(S<0?S+o:S)%o]._point;for(var C=b[0]._x+2*b[1]._x,w=b[0]._y+2*b[1]._y,T=2,E=g-1,D=[C],O=[w],k=[T],A=[],j=[],x=1;x<g;x++){var M=x<E,P=M||p?1:2,F=M?4:p?2:7,I=M?4:p?3:8,L=M?2:p?0:1,ee=P/T;T=k[x]=F-ee,C=D[x]=I*b[x]._x+L*b[x+1]._x-ee*C,w=O[x]=I*b[x]._y+L*b[x+1]._y-ee*w}A[E]=D[E]/k[E],j[E]=O[E]/k[E];for(var x=g-2;x>=0;x--)A[x]=(D[x]-A[x+1])/k[x],j[x]=(O[x]-j[x+1])/k[x];A[g]=(3*b[g]._x-A[E])/2,j[g]=(3*b[g]._y-j[E])/2;for(var x=v,te=g-y,S=l;x<=te;x++,S++){var R=a[S<0?S+o:S],ne=R._point,z=A[x]-ne._x,B=j[x]-ne._y;(c||x<te)&&R.setHandleOut(z,B),(c||x>v)&&R.setHandleIn(-z,-B)}}else for(var x=l;x<=u;x++)a[x<0?x+o:x].smooth(r,!c&&x===l,!c&&x===u)},toShape:function(e){if(!this._closed)return null;var t=this._segments,r,i,a,o;function isCollinear(e,n){var r=t[e],i=r.getNext(),a=t[n],o=a.getNext();return r._handleOut.isZero()&&i._handleIn.isZero()&&a._handleOut.isZero()&&o._handleIn.isZero()&&i._point.subtract(r._point).isCollinear(o._point.subtract(a._point))}function isOrthogonal(e){var n=t[e],r=n.getPrevious(),i=n.getNext();return r._handleOut.isZero()&&n._handleIn.isZero()&&n._handleOut.isZero()&&i._handleIn.isZero()&&n._point.subtract(r._point).isOrthogonal(i._point.subtract(n._point))}function isArc(e){var n=t[e],r=n.getNext(),i=n._handleOut,a=r._handleIn,o=.5522847498307936;if(i.isOrthogonal(a)){var s=n._point,c=r._point,l=new x(s,i,!0).intersect(new x(c,a,!0),!0);return l&&d.isZero(i.getLength()/l.subtract(s).getLength()-o)&&d.isZero(a.getLength()/l.subtract(c).getLength()-o)}return!1}function getDistance(e,n){return t[e]._point.getDistance(t[n]._point)}if(!this.hasHandles()&&t.length===4&&isCollinear(0,2)&&isCollinear(1,3)&&isOrthogonal(1)?(r=E.Rectangle,i=new g(getDistance(0,3),getDistance(0,1)),o=t[1]._point.add(t[2]._point).divide(2)):t.length===8&&isArc(0)&&isArc(2)&&isArc(4)&&isArc(6)&&isCollinear(1,5)&&isCollinear(3,7)?(r=E.Rectangle,i=new g(getDistance(1,6),getDistance(0,3)),a=i.subtract(new g(getDistance(0,7),getDistance(1,2))).divide(2),o=t[3]._point.add(t[4]._point).divide(2)):t.length===4&&isArc(0)&&isArc(1)&&isArc(2)&&isArc(3)&&(d.isZero(getDistance(0,2)-getDistance(1,3))?(r=E.Circle,a=getDistance(0,2)/2):(r=E.Ellipse,a=new g(getDistance(2,0)/2,getDistance(3,1)/2)),o=t[1]._point),r){var s=this.getPosition(!0),c=new r({center:s,size:i,radius:a,insert:!1});return c.copyAttributes(this,!0),c._matrix.prepend(this._matrix),c.rotate(o.subtract(s).getAngle()+90),(e===n||e)&&c.insertAbove(this),c}return null},toPath:`#clone`,compare:function compare(e){if(!e||e instanceof L)return compare.base.call(this,e);var t=this.getCurves(),n=e.getCurves(),r=t.length,i=n.length;if(!r||!i)return r==i;for(var a=t[0].getValues(),o=[],s=0,c,l=0,u,d=0;d<i;d++){var p=n[d].getValues();o.push(p);var m=N.getOverlaps(a,p);if(m){c=!d&&m[0][0]>0?i-1:d,u=m[0][1];break}}for(var h=Math.abs,g=1e-8,p=o[c],_;a&&p;){var m=N.getOverlaps(a,p);if(m){var v=m[0][0];if(h(v-l)<g){l=m[1][0],l===1&&(a=++s<r?t[s].getValues():null,l=0);var y=m[0][1];if(h(y-u)<g){if(_||=[c,y],u=m[1][1],u===1&&(++c>=i&&(c=0),p=o[c]||n[c].getValues(),u=0),!a)return _[0]===c&&_[1]===u;continue}}}break}return!1},_hitTestSelf:function(e,t,n,r){var i=this,a=this.getStyle(),o=this._segments,s=o.length,c=this._closed,l=t._tolerancePadding,u=l,d,p,m,h,g,_,v=t.stroke&&a.hasStroke(),y=t.fill&&a.hasFill(),b=t.curves,x=v?a.getStrokeWidth()/2:y&&t.tolerance>0||b?0:null;x!==null&&(x>0?(d=a.getStrokeJoin(),p=a.getStrokeCap(),m=a.getMiterLimit(),u=u.add(I._getStrokePadding(x,r))):d=p=`round`);function isCloseEnough(t,n){return e.subtract(t).divide(n).length<=1}function checkSegmentPoint(e,n,r){if(!t.selected||n.isSelected()){var a=e._point;if(n!==a&&(n=n.add(a)),isCloseEnough(n,u))return new A(r,i,{segment:e,point:n})}}function checkSegmentPoints(e,n){return(n||t.segments)&&checkSegmentPoint(e,e._point,`segment`)||!n&&t.handles&&(checkSegmentPoint(e,e._handleIn,`handle-in`)||checkSegmentPoint(e,e._handleOut,`handle-out`))}function addToArea(e){h.add(e)}function checkSegmentStroke(t){var n=c||t._index>0&&t._index<s-1;if((n?d:p)===`round`)return isCloseEnough(t._point,u);if(h=new I({internal:!0,closed:!0}),n?t.isSmooth()||I._addBevelJoin(t,d,x,m,null,r,addToArea,!0):p===`square`&&I._addSquareCap(t,p,x,null,r,addToArea,!0),!h.isEmpty()){var i;return h.contains(e)||(i=h.getNearestLocation(e))&&isCloseEnough(i.getPoint(),l)}}if(t.ends&&!t.segments&&!c){if(_=checkSegmentPoints(o[0],!0)||checkSegmentPoints(o[s-1],!0))return _}else if(t.segments||t.handles){for(var S=0;S<s;S++)if(_=checkSegmentPoints(o[S]))return _}if(x!==null){if(g=this.getNearestLocation(e),g){var C=g.getTime();C===0||C===1&&s>1?checkSegmentStroke(g.getSegment())||(g=null):isCloseEnough(g.getPoint(),u)||(g=null)}if(!g&&d===`miter`&&s>1)for(var S=0;S<s;S++){var w=o[S];if(e.getDistance(w._point)<=m*x&&checkSegmentStroke(w)){g=w.getLocation();break}}}return!g&&y&&this._contains(e)||g&&!v&&!b?new A(`fill`,this):g?new A(v?`stroke`:`curve`,this,{location:g,point:g.getPoint()}):null}},a.each(N._evaluateMethods,function(e){this[e+`At`]=function(t){var n=this.getLocationAt(t);return n&&n[e]()}},{beans:!1,getLocationOf:function(){for(var e=m.read(arguments),t=this.getCurves(),n=0,r=t.length;n<r;n++){var i=t[n].getLocationOf(e);if(i)return i}return null},getOffsetOf:function(){var e=this.getLocationOf.apply(this,arguments);return e?e.getOffset():null},getLocationAt:function(e){if(typeof e==`number`){for(var t=this.getCurves(),n=0,r=0,i=t.length;r<i;r++){var a=n,o=t[r];if(n+=o.getLength(),n>e)return o.getLocationAt(e-a)}if(t.length>0&&e<=this.getLength())return new P(t[t.length-1],1)}else if(e&&e.getPath&&e.getPath()===this)return e;return null},getOffsetsWithTangent:function(){var e=m.read(arguments);if(e.isZero())return[];for(var t=[],n=0,r=this.getCurves(),i=0,a=r.length;i<a;i++){for(var o=r[i],s=o.getTimesWithTangent(e),c=0,l=s.length;c<l;c++){var u=n+o.getOffsetAtTime(s[c]);t.indexOf(u)<0&&t.push(u)}n+=o.length}return t}}),new function(){function drawHandles(e,t,n,r){if(r<=0)return;var i=r/2,a=r-2,o=i-1,s=[,,,,,,],c,l;function drawHandle(t){var n=s[t],r=s[t+1];(c!=n||l!=r)&&(e.beginPath(),e.moveTo(c,l),e.lineTo(n,r),e.stroke(),e.beginPath(),e.arc(n,r,i,0,Math.PI*2,!0),e.fill())}for(var u=0,d=t.length;u<d;u++){var p=t[u],m=p._selection;if(p._transformCoordinates(n,s),c=s[0],l=s[1],m&2&&drawHandle(2),m&4&&drawHandle(4),e.fillRect(c-i,l-i,r,r),a>0&&!(m&1)){var h=e.fillStyle;e.fillStyle=`#ffffff`,e.fillRect(c-o,l-o,a,a),e.fillStyle=h}}}function drawSegments(e,t,n){var r=t._segments,i=r.length,a=[,,,,,,],o=!0,s,c,l,u,d,p,m,h;function drawSegment(t){if(n)t._transformCoordinates(n,a),s=a[0],c=a[1];else{var r=t._point;s=r._x,c=r._y}if(o)e.moveTo(s,c),o=!1;else{if(n)d=a[2],p=a[3];else{var i=t._handleIn;d=s+i._x,p=c+i._y}d===s&&p===c&&m===l&&h===u?e.lineTo(s,c):e.bezierCurveTo(m,h,d,p,s,c)}if(l=s,u=c,n)m=a[4],h=a[5];else{var i=t._handleOut;m=l+i._x,h=u+i._y}}for(var g=0;g<i;g++)drawSegment(r[g]);t._closed&&i>0&&drawSegment(r[0])}return{_draw:function(e,t,n,r){var i=t.dontStart,a=t.dontFinish||t.clip,o=this.getStyle(),s=o.hasFill(),c=o.hasStroke(),l=o.getDashArray(),u=!Z.support.nativeDash&&c&&l&&l.length;i||e.beginPath(),(s||c&&!u||a)&&(drawSegments(e,this,r),this._closed&&e.closePath());function getOffset(e){return l[(e%u+u)%u]}if(!a&&(s||c)&&(this._setStyles(e,t,n),s&&(e.fill(o.getFillRule()),e.shadowColor=`rgba(0,0,0,0)`),c)){if(u){i||e.beginPath();for(var d=new ee(this,.25,32,!1,r),p=d.length,m=-o.getDashOffset(),h,g=0;m>0;)m-=getOffset(g--)+getOffset(g--);for(;m<p;)h=m+getOffset(g++),(m>0||h>0)&&d.drawPart(e,Math.max(m,0),Math.max(h,0)),m=h+getOffset(g++)}e.stroke()}},_drawSelected:function(e,t){e.beginPath(),drawSegments(e,this,t),e.stroke(),drawHandles(e,this._segments,t,Z.settings.handleSize)}}},new function(){function getCurrentSegment(e){var t=e._segments;if(!t.length)throw Error(`Use a moveTo() command first`);return t[t.length-1]}return{moveTo:function(){var e=this._segments;e.length===1&&this.removeSegment(0),e.length||this._add([new j(m.read(arguments))])},moveBy:function(){throw Error(`moveBy() is unsupported on Path items.`)},lineTo:function(){this._add([new j(m.read(arguments))])},cubicCurveTo:function(){var e=arguments,t=m.read(e),n=m.read(e),r=m.read(e),i=getCurrentSegment(this);i.setHandleOut(t.subtract(i._point)),this._add([new j(r,n.subtract(r))])},quadraticCurveTo:function(){var e=arguments,t=m.read(e),n=m.read(e),r=getCurrentSegment(this)._point;this.cubicCurveTo(t.add(r.subtract(t).multiply(1/3)),t.add(n.subtract(t).multiply(1/3)),n)},curveTo:function(){var e=arguments,t=m.read(e),n=m.read(e),r=a.pick(a.read(e),.5),i=1-r,o=getCurrentSegment(this)._point,s=t.subtract(o.multiply(i*i)).subtract(n.multiply(r*r)).divide(2*r*i);if(s.isNaN())throw Error(`Cannot put a curve through points with parameter = `+r);this.quadraticCurveTo(s,n)},arcTo:function(){var e=arguments,t=Math.abs,n=Math.sqrt,r=getCurrentSegment(this),i=r._point,o=m.read(e),s,c=a.peek(e),l=a.pick(c,!0),u,p,h,_;if(typeof l==`boolean`)var v=i.add(o).divide(2),s=v.add(v.subtract(i).rotate(l?-90:90));else if(a.remain(e)<=2)s=o,o=m.read(e);else if(!i.equals(o)){var y=g.read(e),S=d.isZero;if(S(y.width)||S(y.height))return this.lineTo(o);var C=a.read(e),l=!!a.read(e),w=!!a.read(e),v=i.add(o).divide(2),T=i.subtract(v).rotate(-C),E=T.x,D=T.y,O=t(y.width),k=t(y.height),A=O*O,M=k*k,N=E*E,P=D*D,F=n(N/A+P/M);if(F>1&&(O*=F,k*=F,A=O*O,M=k*k),F=(A*M-A*P-M*N)/(A*P+M*N),t(F)<1e-12&&(F=0),F<0)throw Error(`Cannot create an arc with the given arguments`);u=new m(O*D/k,-k*E/O).multiply((w===l?-1:1)*n(F)).rotate(C).add(v),_=new b().translate(u).rotate(C).scale(O,k),h=_._inverseTransform(i),p=h.getDirectedAngle(_._inverseTransform(o)),!l&&p>0?p-=360:l&&p<0&&(p+=360)}if(s){var I=new x(i.add(s).divide(2),s.subtract(i).rotate(90),!0),L=new x(s.add(o).divide(2),o.subtract(s).rotate(90),!0),ee=new x(i,o),te=ee.getSide(s);if(u=I.intersect(L,!0),!u){if(!te)return this.lineTo(o);throw Error(`Cannot create an arc with the given arguments`)}h=i.subtract(u),p=h.getDirectedAngle(o.subtract(u));var R=ee.getSide(u,!0);R===0?p=te*t(p):te===R&&(p+=p<0?360:-360)}if(p){for(var ne=1e-5,z=t(p),B=z>=360?4:Math.ceil((z-ne)/90),re=p/B,ie=re*Math.PI/360,V=4/3*Math.sin(ie)/(1+Math.cos(ie)),H=[],U=0;U<=B;U++){var T=o,W=null;if(U<B&&(W=h.rotate(90).multiply(V),_?(T=_._transformPoint(h),W=_._transformPoint(h.add(W)).subtract(T)):T=u.add(h)),!U)r.setHandleOut(W);else{var G=h.rotate(-90).multiply(V);_&&(G=_._transformPoint(h.add(G)).subtract(T)),H.push(new j(T,G,W))}h=h.rotate(re)}this._add(H)}},lineBy:function(){var e=m.read(arguments),t=getCurrentSegment(this)._point;this.lineTo(t.add(e))},curveBy:function(){var e=arguments,t=m.read(e),n=m.read(e),r=a.read(e),i=getCurrentSegment(this)._point;this.curveTo(i.add(t),i.add(n),r)},cubicCurveBy:function(){var e=arguments,t=m.read(e),n=m.read(e),r=m.read(e),i=getCurrentSegment(this)._point;this.cubicCurveTo(i.add(t),i.add(n),i.add(r))},quadraticCurveBy:function(){var e=arguments,t=m.read(e),n=m.read(e),r=getCurrentSegment(this)._point;this.quadraticCurveTo(r.add(t),r.add(n))},arcBy:function(){var e=arguments,t=getCurrentSegment(this)._point,n=t.add(m.read(e)),r=a.pick(a.peek(e),!0);typeof r==`boolean`?this.arcTo(n,r):this.arcTo(n,t.add(m.read(e)))},closePath:function(e){this.setClosed(!0),this.join(this,e)}}},{_getBounds:function(e,t){return I[t.handle?`getHandleBounds`:t.stroke?`getStrokeBounds`:`getBounds`](this._segments,this._closed,this,e,t)},statics:{getBounds:function(e,t,n,r,i,a){var o=e[0];if(!o)return new v;var s=[,,,,,,],c=o._transformCoordinates(r,[,,,,,,]),l=c.slice(0,2),u=l.slice(),d=[,,];function processSegment(e){e._transformCoordinates(r,s);for(var t=0;t<2;t++)N._addBounds(c[t],c[t+4],s[t+2],s[t],t,a?a[t]:0,l,u,d);var n=c;c=s,s=n}for(var p=1,m=e.length;p<m;p++)processSegment(e[p]);return t&&processSegment(o),new v(l[0],l[1],u[0]-l[0],u[1]-l[1])},getStrokeBounds:function(e,t,n,r,i){var a=n.getStyle(),o=a.hasStroke(),s=a.getStrokeWidth(),c=o&&n._getStrokeMatrix(r,i),l=o&&I._getStrokePadding(s,c),u=I.getBounds(e,t,n,r,i,l);if(!o)return u;var d=s/2,p=a.getStrokeJoin(),m=a.getStrokeCap(),h=a.getMiterLimit(),_=new v(new g(l));function addPoint(e){u=u.include(e)}function addRound(e){u=u.unite(_.setCenter(e._point.transform(r)))}function addJoin(e,t){t===`round`||e.isSmooth()?addRound(e):I._addBevelJoin(e,t,d,h,r,c,addPoint)}function addCap(e,t){t===`round`?addRound(e):I._addSquareCap(e,t,d,r,c,addPoint)}var y=e.length-(t?0:1);if(y>0){for(var b=1;b<y;b++)addJoin(e[b],p);t?addJoin(e[0],p):(addCap(e[0],m),addCap(e[e.length-1],m))}return u},_getStrokePadding:function(e,t){if(!t)return[e,e];var n=new m(e,0).transform(t),r=new m(0,e).transform(t),i=n.getAngleInRadians(),a=n.getLength(),o=r.getLength(),s=Math.sin(i),c=Math.cos(i),l=Math.tan(i),u=Math.atan2(o*l,a),d=Math.atan2(o,l*a);return[Math.abs(a*Math.cos(u)*c+o*Math.sin(u)*s),Math.abs(o*Math.sin(d)*c+a*Math.cos(d)*s)]},_addBevelJoin:function(e,t,n,r,i,a,o,s){var c=e.getCurve(),l=c.getPrevious(),u=c.getPoint1().transform(i),d=l.getNormalAtTime(1).multiply(n).transform(a),p=c.getNormalAtTime(0).multiply(n).transform(a),h=d.getDirectedAngle(p);if((h<0||h>=180)&&(d=d.negate(),p=p.negate()),s&&o(u),o(u.add(d)),t===`miter`){var g=new x(u.add(d),new m(-d.y,d.x),!0).intersect(new x(u.add(p),new m(-p.y,p.x),!0),!0);g&&u.getDistance(g)<=r*n&&o(g)}o(u.add(p))},_addSquareCap:function(e,t,n,r,i,a,o){var s=e._point.transform(r),c=e.getLocation(),l=c.getNormal().multiply(c.getTime()===0?n:-n).transform(i);t===`square`&&(o&&(a(s.subtract(l)),a(s.add(l))),s=s.add(l.rotate(-90))),a(s.add(l)),a(s.subtract(l))},getHandleBounds:function(e,t,n,r,i){var a=n.getStyle(),o=i.stroke&&a.hasStroke(),s,c;if(o){var l=n._getStrokeMatrix(r,i),u=a.getStrokeWidth()/2,d=u;a.getStrokeJoin()===`miter`&&(d=u*a.getMiterLimit()),a.getStrokeCap()===`square`&&(d=Math.max(d,u*Math.SQRT2)),s=I._getStrokePadding(u,l),c=I._getStrokePadding(d,l)}for(var p=[,,,,,,],m=1/0,h=-m,g=m,_=h,y=0,b=e.length;y<b;y++){e[y]._transformCoordinates(r,p);for(var x=0;x<6;x+=2){var S=x?s:c,C=S?S[0]:0,w=S?S[1]:0,T=p[x],E=p[x+1],D=T-C,O=T+C,k=E-w,A=E+w;D<m&&(m=D),O>h&&(h=O),k<g&&(g=k),A>_&&(_=A)}}return new v(m,g,h-m,_-g)}}});I.inject({statics:new function(){var e=.5522847498307936,t=[new j([-1,0],[0,e],[0,-e]),new j([0,-1],[-e,0],[e,0]),new j([1,0],[0,-e],[0,e]),new j([0,1],[e,0],[-e,0])];function createPath(e,t,n){var r=a.getNamed(n),i=new I(r&&(r.insert==1?C.INSERT:r.insert==0?C.NO_INSERT:null));return i._add(e),i._closed=t,i.set(r,C.INSERT)}function createEllipse(e,n,r){for(var i=[,,,,],a=0;a<4;a++){var o=t[a];i[a]=new j(o._point.multiply(n).add(e),o._handleIn.multiply(n),o._handleOut.multiply(n))}return createPath(i,!0,r)}return{Line:function(){var e=arguments;return createPath([new j(m.readNamed(e,`from`)),new j(m.readNamed(e,`to`))],!1,e)},Circle:function(){var e=arguments;return createEllipse(m.readNamed(e,`center`),new g(a.readNamed(e,`radius`)),e)},Rectangle:function(){var t=arguments,n=v.readNamed(t,`rectangle`),r=g.readNamed(t,`radius`,0,{readNull:!0}),i=n.getBottomLeft(!0),a=n.getTopLeft(!0),o=n.getTopRight(!0),s=n.getBottomRight(!0),c;if(!r||r.isZero())c=[new j(i),new j(a),new j(o),new j(s)];else{r=g.min(r,n.getSize(!0).divide(2));var l=r.width,u=r.height,d=l*e,p=u*e;c=[new j(i.add(l,0),null,[-d,0]),new j(i.subtract(0,u),[0,p]),new j(a.add(0,u),null,[0,-p]),new j(a.add(l,0),[-d,0],null),new j(o.subtract(l,0),null,[d,0]),new j(o.add(0,u),[0,-p],null),new j(s.subtract(0,u),null,[0,p]),new j(s.subtract(l,0),[d,0])]}return createPath(c,!0,t)},RoundRectangle:`#Rectangle`,Ellipse:function(){var e=arguments,t=E._readEllipse(e);return createEllipse(t.center,t.radius,e)},Oval:`#Ellipse`,Arc:function(){var e=arguments,t=m.readNamed(e,`from`),n=m.readNamed(e,`through`),r=m.readNamed(e,`to`),i=a.getNamed(e),o=new I(i&&i.insert==0&&C.NO_INSERT);return o.moveTo(t),o.arcTo(n,r),o.set(i)},RegularPolygon:function(){for(var e=arguments,t=m.readNamed(e,`center`),n=a.readNamed(e,`sides`),r=a.readNamed(e,`radius`),i=360/n,o=n%3==0,s=new m(0,o?-r:r),c=o?-1:.5,l=Array(n),u=0;u<n;u++)l[u]=new j(t.add(s.rotate((u+c)*i)));return createPath(l,!0,e)},Star:function(){for(var e=arguments,t=m.readNamed(e,`center`),n=a.readNamed(e,`points`)*2,r=a.readNamed(e,`radius1`),i=a.readNamed(e,`radius2`),o=360/n,s=new m(0,-1),c=Array(n),l=0;l<n;l++)c[l]=new j(t.add(s.rotate(o*l).multiply(l%2?i:r)));return createPath(c,!0,e)}}}});var L=F.extend({_class:`CompoundPath`,_serializeFields:{children:[]},beans:!0,initialize:function CompoundPath(e){this._children=[],this._namedChildren={},this._initialize(e)||(typeof e==`string`?this.setPathData(e):this.addChildren(Array.isArray(e)?e:arguments))},insertChildren:function insertChildren(e,t){var n=t,r=n[0];r&&typeof r[0]==`number`&&(n=[n]);for(var i=t.length-1;i>=0;i--){var o=n[i];n===t&&!(o instanceof I)&&(n=a.slice(n)),Array.isArray(o)?n[i]=new I({segments:o,insert:!1}):o instanceof L&&(n.splice.apply(n,[i,1].concat(o.removeChildren())),o.remove())}return insertChildren.base.call(this,e,n)},reduce:function reduce(e){for(var t=this._children,n=t.length-1;n>=0;n--){var r=t[n].reduce(e);r.isEmpty()&&r.remove()}if(!t.length){var r=new I(C.NO_INSERT);return r.copyAttributes(this),r.insertAbove(this),this.remove(),r}return reduce.base.call(this)},isClosed:function(){for(var e=this._children,t=0,n=e.length;t<n;t++)if(!e[t]._closed)return!1;return!0},setClosed:function(e){for(var t=this._children,n=0,r=t.length;n<r;n++)t[n].setClosed(e)},getFirstSegment:function(){var e=this.getFirstChild();return e&&e.getFirstSegment()},getLastSegment:function(){var e=this.getLastChild();return e&&e.getLastSegment()},getCurves:function(){for(var e=this._children,t=[],n=0,r=e.length;n<r;n++)a.push(t,e[n].getCurves());return t},getFirstCurve:function(){var e=this.getFirstChild();return e&&e.getFirstCurve()},getLastCurve:function(){var e=this.getLastChild();return e&&e.getLastCurve()},getArea:function(){for(var e=this._children,t=0,n=0,r=e.length;n<r;n++)t+=e[n].getArea();return t},getLength:function(){for(var e=this._children,t=0,n=0,r=e.length;n<r;n++)t+=e[n].getLength();return t},getPathData:function(e,t){for(var n=this._children,r=[],i=0,a=n.length;i<a;i++){var o=n[i],s=o._matrix;r.push(o.getPathData(e&&!s.isIdentity()?e.appended(s):e,t))}return r.join(``)},_hitTestChildren:function _hitTestChildren(e,t,n){return _hitTestChildren.base.call(this,e,t.class===I||t.type===`path`?t:a.set({},t,{fill:!1}),n)},_draw:function(e,t,n,r){var i=this._children;if(i.length){t=t.extend({dontStart:!0,dontFinish:!0}),e.beginPath();for(var a=0,o=i.length;a<o;a++)i[a].draw(e,t,r);if(!t.clip){this._setStyles(e,t,n);var s=this._style;s.hasFill()&&(e.fill(s.getFillRule()),e.shadowColor=`rgba(0,0,0,0)`),s.hasStroke()&&e.stroke()}}},_drawSelected:function(e,t,n){for(var r=this._children,i=0,a=r.length;i<a;i++){var o=r[i],s=o._matrix;n[o._id]||o._drawSelected(e,s.isIdentity()?t:t.appended(s))}}},new function(){function getCurrentPath(e,t){var n=e._children;if(t&&!n.length)throw Error(`Use a moveTo() command first`);return n[n.length-1]}return a.each([`lineTo`,`cubicCurveTo`,`quadraticCurveTo`,`curveTo`,`arcTo`,`lineBy`,`cubicCurveBy`,`quadraticCurveBy`,`curveBy`,`arcBy`],function(e){this[e]=function(){var t=getCurrentPath(this,!0);t[e].apply(t,arguments)}},{moveTo:function(){var e=getCurrentPath(this),t=e&&e.isEmpty()?e:new I(C.NO_INSERT);t!==e&&this.addChild(t),t.moveTo.apply(t,arguments)},moveBy:function(){var e=getCurrentPath(this,!0),t=e&&e.getLastSegment(),n=m.read(arguments);this.moveTo(t?n.add(t._point):n)},closePath:function(e){getCurrentPath(this,!0).closePath(e)}})},a.each([`reverse`,`flatten`,`simplify`,`smooth`],function(e){this[e]=function(t){for(var n=this._children,r,i=0,a=n.length;i<a;i++)r=n[i][e](t)||r;return r}},{}));F.inject(new function(){var e=Math.min,t=Math.max,r=Math.abs,i={unite:{1:!0,2:!0},intersect:{2:!0},subtract:{1:!0},exclude:{1:!0,"-1":!0}};function getPaths(e){return e._children||[e]}function preparePath(e,t){var n=e.clone(!1).reduce({simplify:!0}).transform(null,!0,!0);if(t){for(var r=getPaths(n),i=0,a=r.length;i<a;i++){var e=r[i];!e._closed&&!e.isEmpty()&&(e.closePath(1e-12),e.getFirstSegment().setHandleIn(0,0),e.getLastSegment().setHandleOut(0,0))}n=n.resolveCrossings().reorient(n.getFillRule()===`nonzero`,!0)}return n}function createResult(e,t,n,r,i){var a=new L(C.NO_INSERT);return a.addChildren(e,!0),a=a.reduce({simplify:t}),i&&i.insert==0||a.insertAbove(r&&n.isSibling(r)&&n.getIndex()<r.getIndex()?r:n),a.copyAttributes(n,!0),a}function filterIntersection(e){return e.hasOverlap()||e.isCrossing()}function traceBoolean(e,t,n,r){if(r&&(r.trace==0||r.stroke)&&/^(subtract|intersect)$/.test(n))return splitBoolean(e,t,n);var o=preparePath(e,!0),s=t&&e!==t&&preparePath(t,!0),c=i[n];c[n]=!0,s&&(c.subtract||c.exclude)^(s.isClockwise()^o.isClockwise())&&s.reverse();var u=divideLocations(P.expand(o.getIntersections(s,filterIntersection))),d=getPaths(o),p=s&&getPaths(s),m=[],h=[],g;function collectPaths(e){for(var t=0,n=e.length;t<n;t++){var r=e[t];a.push(m,r._segments),a.push(h,r.getCurves()),r._overlapsOnly=!0}}function getCurves(e){for(var t=[],n=0,r=e&&e.length;n<r;n++)t.push(h[e[n]]);return t}if(u.length){collectPaths(d),p&&collectPaths(p);for(var _=Array(h.length),v=0,y=h.length;v<y;v++)_[v]=h[v].getValues();for(var b=l.findCurveBoundsCollisions(_,_,0,!0),x={},v=0;v<h.length;v++){var S=h[v],C=S._path._id,w=x[C]=x[C]||{};w[S.getIndex()]={hor:getCurves(b[v].hor),ver:getCurves(b[v].ver)}}for(var v=0,y=u.length;v<y;v++)propagateWinding(u[v]._segment,o,s,x,c);for(var v=0,y=m.length;v<y;v++){var T=m[v],E=T._intersection;T._winding||propagateWinding(T,o,s,x,c),E&&E._overlap||(T._path._overlapsOnly=!1)}g=tracePaths(m,c)}else g=reorientPaths(p?d.concat(p):d.slice(),function(e){return!!c[e]});return createResult(g,!0,e,t,r)}function splitBoolean(e,t,n){var r=preparePath(e),i=preparePath(t),a=r.getIntersections(i,filterIntersection),o=n===`subtract`,s=n===`divide`,c={},l=[];function addPath(e){if(!c[e._id]&&(s||i.contains(e.getPointAt(e.getLength()/2))^o))return l.unshift(e),c[e._id]=!0}for(var u=a.length-1;u>=0;u--){var d=a[u].split();d&&(addPath(d)&&d.getFirstSegment().setHandleIn(0,0),r.getLastSegment().setHandleOut(0,0))}return addPath(r),createResult(l,!1,e,t)}function linkIntersections(e,t){for(var n=e;n;){if(n===t)return;n=n._previous}for(;e._next&&e._next!==t;)e=e._next;if(!e._next){for(;t._previous;)t=t._previous;e._next=t,t._previous=e}}function clearCurveHandles(e){for(var t=e.length-1;t>=0;t--)e[t].clearHandles()}function reorientPaths(e,t,n){var i=e&&e.length;if(i){var o=a.each(e,function(e,t){this[e._id]={container:null,winding:e.isClockwise()?1:-1,index:t}},{}),s=e.slice().sort(function(e,t){return r(t.getArea())-r(e.getArea())}),c=s[0],u=l.findItemBoundsCollisions(s,null,d.GEOMETRIC_EPSILON);n??=c.isClockwise();for(var p=0;p<i;p++){var m=s[p],h=o[m._id],g=0,_=u[p];if(_){for(var v=null,y=_.length-1;y>=0;y--)if(_[y]<p){v||=m.getInteriorPoint();var b=s[_[y]];if(b.contains(v)){var x=o[b._id];g=x.winding,h.winding+=g,h.container=x.exclude?x.container:b;break}}}if(t(h.winding)===t(g))h.exclude=!0,e[h.index]=null;else{var S=h.container;m.setClockwise(S?!S.isClockwise():n)}}}return e}function divideLocations(e,t,n){var r=t&&[],i=1e-8,a=1-i,o=!1,s=n||[],c=n&&{},l,u,d;function getId(e){return e._path._id+`.`+e._segment1._index}for(var p=(n&&n.length)-1;p>=0;p--){var m=n[p];m._path&&(c[getId(m)]=!0)}for(var p=e.length-1;p>=0;p--){var h=e[p],g=h._time,_=g,v=t&&!t(h),m=h._curve,y;if(m&&(m===u?d>=i&&(g/=d):(o=!m.hasHandles()||c&&c[getId(m)],l=[],d=null,u=m)),v){l&&l.push(h);continue}else t&&r.unshift(h);if(d=_,g<i)y=m._segment1;else if(g>a)y=m._segment2;else{var b=m.divideAtTime(g,!0);o&&s.push(m,b),y=b._segment1;for(var x=l.length-1;x>=0;x--){var S=l[x];S._time=(S._time-g)/(1-g)}}h._setSegment(y);var C=y._intersection,w=h._intersection;if(C){linkIntersections(C,w);for(var T=C;T;)linkIntersections(T._intersection,C),T=T._next}else y._intersection=w}return n||clearCurveHandles(s),r||e}function getWinding(n,i,a,o,s){var c=Array.isArray(i)?i:i[a?`hor`:`ver`],l=a?1:0,u=l^1,d=[n.x,n.y],p=d[l],m=d[u],h=1e-9,g=1e-6,_=p-h,v=p+h,y=0,b=0,x=0,S=0,C=!1,w=!1,T=1,E=[],D,O;function addWinding(r){var c=r[u+0],d=r[u+6];if(!(m<e(c,d)||m>t(c,d))){var h=r[l+0],y=r[l+2],b=r[l+4],w=r[l+6];if(c===d){(h<v&&w>_||w<v&&h>_)&&(C=!0);return}var O=m===c?0:m===d||_>t(h,y,b,w)||v<e(h,y,b,w)?1:N.solveCubic(r,u,m,E,0,1)>0?E[0]:1,k=O===0?h:O===1?w:N.getPoint(r,O)[a?`y`:`x`],A=c>d?1:-1,j=D[u]>D[u+6]?1:-1,M=D[l+6];return m===c?(A===j?h!=M&&(M<v&&k>v?(S+=A,C=!0):M>_&&k<_&&(x+=A,C=!0)):h<_?x+=A:h>v&&(S+=A),T/=4):(k<_?x+=A:k>v?S+=A:C=!0,k>p-g&&k<p+g&&(T/=2)),D=r,!s&&k>_&&k<v&&N.getTangent(r,O)[a?`x`:`y`]===0&&getWinding(n,i,!a,o,!0)}}function handleCurve(n){var r=n[u+0],i=n[u+2],o=n[u+4],s=n[u+6];if(m<=t(r,i,o,s)&&m>=e(r,i,o,s)){for(var c=n[l+0],d=n[l+2],p=n[l+4],h=n[l+6],g=_>t(c,d,p,h)||v<e(c,d,p,h)?[n]:N.getMonoCurves(n,a),y,b=0,x=g.length;b<x;b++)if(y=addWinding(g[b]))return y}}for(var k=0,A=c.length;k<A;k++){var j=c[k],M=j._path,P=j.getValues(),F;if((!k||c[k-1]._path!==M)&&(D=null,M._closed||(O=N.getValues(M.getLastCurve().getSegment2(),j.getSegment1(),null,!o),O[u]!==O[u+6]&&(D=O)),!D)){D=P;for(var I=M.getLastCurve();I&&I!==j;){var L=I.getValues();if(L[u]!==L[u+6]){D=L;break}I=I.getPrevious()}}if(F=handleCurve(P))return F;if(k+1===A||c[k+1]._path!==M){if(O&&(F=handleCurve(O)))return F;C&&!x&&!S&&(x=S=M.isClockwise(o)^a?1:-1),y+=x,b+=S,x=S=0,C&&=(w=!0,!1),O=null}}return y=r(y),b=r(b),{winding:t(y,b),windingL:y,windingR:b,quality:T,onPath:w}}function propagateWinding(e,t,n,i,a){var o=[],s=e,c=0,l;do{var u=e.getCurve();if(u){var p=u.getLength();o.push({segment:e,curve:u,length:p}),c+=p}e=e.getNext()}while(e&&!e._intersection&&e!==s);for(var m=[.5,.25,.75],l={winding:0,quality:-1},h=.001,g=1-h,_=0;_<m.length&&l.quality<.5;_++)for(var p=c*m[_],v=0,y=o.length;v<y;v++){var b=o[v],x=b.length;if(p<=x){var u=b.curve,S=u._path,C=S._parent,w=C instanceof L?C:S,T=d.clamp(u.getTimeAt(p),h,g),E=u.getPointAtTime(T),D=r(u.getTangentAtTime(T).y)<Math.SQRT1_2,O=null;if(a.subtract&&n){var k=(w===t?n:t)._getWinding(E,D,!0);if(w===t&&k.winding||w===n&&!k.winding){if(k.quality<1)continue;O={winding:0,quality:1}}}O||=getWinding(E,i[S._id][u.getIndex()],D,!0),O.quality>l.quality&&(l=O);break}p-=x}for(var v=o.length-1;v>=0;v--)o[v].segment._winding=l}function tracePaths(e,t){var n=[],r;function isValid(e){var n;return!!(e&&!e._visited&&(!t||t[(n=e._winding||{}).winding]&&!(t.unite&&n.winding===2&&n.windingL&&n.windingR)))}function isStart(e){if(e){for(var t=0,n=r.length;t<n;t++)if(e===r[t])return!0}return!1}function visitPath(e){for(var t=e._segments,n=0,r=t.length;n<r;n++)t[n]._visited=!0}function getCrossingSegments(e,t){var n=e._intersection,i=n,a=[];t&&(r=[e]);function collect(n,i){for(;n&&n!==i;){var o=n._segment,s=o&&o._path;if(s){var c=o.getNext()||s.getFirstSegment(),l=c._intersection;o!==e&&(isStart(o)||isStart(c)||c&&isValid(o)&&(isValid(c)||l&&isValid(l._segment)))&&a.push(o),t&&r.push(o)}n=n._next}}if(n){for(collect(n);n&&n._previous;)n=n._previous;collect(n,i)}return a}e.sort(function(e,t){var n=e._intersection,r=t._intersection,i=!!(n&&n._overlap),a=!!(r&&r._overlap),o=e._path,s=t._path;return i^a?i?1:-1:!n^!r?n?1:-1:o===s?e._index-t._index:o._id-s._id});for(var i=0,a=e.length;i<a;i++){var o=e[i],s=isValid(o),c=null,l=!1,u=!0,d=[],p,m,h;if(s&&o._path._overlapsOnly){var g=o._path,_=o._intersection._segment._path;g.compare(_)&&(g.getArea()&&n.push(g.clone(!1)),visitPath(g),visitPath(_),s=!1)}for(;s;){var v=!c,y=getCrossingSegments(o,v),b=y.shift(),l=!v&&(isStart(o)||isStart(b)),x=!l&&b;if(v&&(c=new I(C.NO_INSERT),p=null),l){(o.isFirst()||o.isLast())&&(u=o._path._closed),o._visited=!0;break}if(x&&p&&(d.push(p),p=null),p||=(x&&y.push(o),{start:c._segments.length,crossings:y,visited:m=[],handleIn:h}),x&&(o=b),!isValid(o)){c.removeSegments(p.start);for(var S=0,w=m.length;S<w;S++)m[S]._visited=!1;m.length=0;do o=p&&p.crossings.shift(),(!o||!o._path)&&(o=null,p=d.pop(),p&&(m=p.visited,h=p.handleIn));while(p&&!isValid(o));if(!o)break}var T=o.getNext();c.add(new j(o._point,h,T&&o._handleOut)),o._visited=!0,m.push(o),o=T||o._path.getFirstSegment(),h=T&&T._handleIn}l&&(u&&(c.getFirstSegment().setHandleIn(h),c.setClosed(u)),c.getArea()!==0&&n.push(c))}return n}return{_getWinding:function(e,t,n){return getWinding(e,this.getCurves(),t,n)},unite:function(e,t){return traceBoolean(this,e,`unite`,t)},intersect:function(e,t){return traceBoolean(this,e,`intersect`,t)},subtract:function(e,t){return traceBoolean(this,e,`subtract`,t)},exclude:function(e,t){return traceBoolean(this,e,`exclude`,t)},divide:function(e,t){return t&&(t.trace==0||t.stroke)?splitBoolean(this,e,`divide`):createResult([this.subtract(e,t),this.intersect(e,t)],!0,this,e,t)},resolveCrossings:function(){var e=this._children,t=e||[this];function hasOverlap(e,t){var n=e&&e._intersection;return n&&n._overlap&&n._path===t}var n=!1,r=!1,i=this.getIntersections(null,function(e){return e.hasOverlap()&&(n=!0)||e.isCrossing()&&(r=!0)}),o=n&&r&&[];if(i=P.expand(i),n)for(var s=divideLocations(i,function(e){return e.hasOverlap()},o),c=s.length-1;c>=0;c--){var l=s[c],u=l._path,d=l._segment,p=d.getPrevious(),m=d.getNext();hasOverlap(p,u)&&hasOverlap(m,u)&&(d.remove(),p._handleOut._set(0,0),m._handleIn._set(0,0),p!==d&&!p.getCurve().hasLength()&&(m._handleIn.set(p._handleIn),p.remove()))}r&&(divideLocations(i,n&&function(e){var t=e.getCurve(),n=e.getSegment(),r=e._intersection,i=r._curve,a=r._segment;if(t&&i&&t._path&&i._path)return!0;n&&(n._intersection=null),a&&(a._intersection=null)},o),o&&clearCurveHandles(o),t=tracePaths(a.each(t,function(e){a.push(this,e._segments)},[])));var h=t.length,g;return h>1&&e?(t!==e&&this.setChildren(t),g=this):h===1&&!e&&(t[0]!==this&&this.setSegments(t[0].removeSegments()),g=this),g||(g=new L(C.NO_INSERT),g.addChildren(t),g=g.reduce(),g.copyAttributes(this),this.replaceWith(g)),g},reorient:function(e,t){var r=this._children;return r&&r.length?this.setChildren(reorientPaths(this.removeChildren(),function(t){return!!(e?t:t&1)},t)):t!==n&&this.setClockwise(t),this},getInteriorPoint:function(){var n=this.getBounds().getCenter(!0);if(!this.contains(n)){for(var r=this.getCurves(),i=n.y,a=[],o=[],s=0,c=r.length;s<c;s++){var l=r[s].getValues(),u=l[1],d=l[3],p=l[5],m=l[7];if(i>=e(u,d,p,m)&&i<=t(u,d,p,m))for(var h=N.getMonoCurves(l),g=0,_=h.length;g<_;g++){var v=h[g],y=v[1],b=v[7];if(y!==b&&(i>=y&&i<=b||i>=b&&i<=y)){var x=i===y?v[0]:i===b?v[6]:N.solveCubic(v,1,i,o,0,1)===1?N.getPoint(v,o[0]).x:(v[0]+v[6])/2;a.push(x)}}}a.length>1&&(a.sort(function(e,t){return e-t}),n.x=(a[0]+a[1])/2)}return n}}});var ee=a.extend({_class:`PathFlattener`,initialize:function(e,t,n,r,i){var a=[],o=[],s=0,c=1/(n||32),l=e._segments,u=l[0],d;function addCurve(e,t){var n=N.getValues(e,t,i);a.push(n),computeParts(n,e._index,0,1)}function computeParts(e,n,i,a){if(a-i>c&&!(r&&N.isStraight(e))&&!N.isFlatEnough(e,t||.25)){var l=N.subdivide(e,.5),u=(i+a)/2;computeParts(l[0],n,i,u),computeParts(l[1],n,u,a)}else{var d=e[6]-e[0],p=e[7]-e[1],m=Math.sqrt(d*d+p*p);m>0&&(s+=m,o.push({offset:s,curve:e,index:n,time:a}))}}for(var p=1,m=l.length;p<m;p++)d=l[p],addCurve(u,d),u=d;e._closed&&addCurve(d||u,l[0]),this.curves=a,this.parts=o,this.length=s,this.index=0},_get:function(e){for(var t=this.parts,n=t.length,r,i=this.index;r=i,!(!i||t[--i].offset<e););for(;r<n;r++){var a=t[r];if(a.offset>=e){this.index=r;var o=t[r-1],s=o&&o.index===a.index?o.time:0,c=o?o.offset:0;return{index:a.index,time:s+(a.time-s)*(e-c)/(a.offset-c)}}}return{index:t[n-1].index,time:1}},drawPart:function(e,t,n){for(var r=this._get(t),i=this._get(n),a=r.index,o=i.index;a<=o;a++){var s=N.getPart(this.curves[a],a===r.index?r.time:0,a===i.index?i.time:1);a===r.index&&e.moveTo(s[0],s[1]),e.bezierCurveTo.apply(e,s.slice(2))}}},a.each(N._evaluateMethods,function(e){this[e+`At`]=function(t){var n=this._get(t);return N[e](this.curves[n.index],n.time)}},{})),te=a.extend({initialize:function(e){for(var t=this.points=[],n=e._segments,r=e._closed,i=0,a,o=n.length;i<o;i++){var s=n[i].point;(!a||!a.equals(s))&&t.push(a=s.clone())}r&&(t.unshift(t[t.length-1]),t.push(t[1])),this.closed=r},fit:function(e){var t=this.points,n=t.length,r=null;return n>0&&(r=[new j(t[0])],n>1&&(this.fitCubic(r,e,0,n-1,t[1].subtract(t[0]),t[n-2].subtract(t[n-1])),this.closed&&(r.shift(),r.pop()))),r},fitCubic:function(e,t,n,r,i,a){var o=this.points;if(r-n===1){var s=o[n],c=o[r],l=s.getDistance(c)/3;this.addCurve(e,[s,s.add(i.normalize(l)),c.add(a.normalize(l)),c]);return}for(var u=this.chordLengthParameterize(n,r),d=Math.max(t,t*t),p,m=!0,h=0;h<=4;h++){var g=this.generateBezier(n,r,u,i,a),_=this.findMaxError(n,r,g,u);if(_.error<t&&m){this.addCurve(e,g);return}if(p=_.index,_.error>=d)break;m=this.reparameterize(n,r,u,g),d=_.error}var v=o[p-1].subtract(o[p+1]);this.fitCubic(e,t,n,p,i,v),this.fitCubic(e,t,p,r,v.negate(),a)},addCurve:function(e,t){e[e.length-1].setHandleOut(t[1].subtract(t[0])),e.push(new j(t[3],t[2].subtract(t[3])))},generateBezier:function(e,t,n,r,i){for(var a=1e-12,o=Math.abs,s=this.points,c=s[e],l=s[t],u=[[0,0],[0,0]],d=[0,0],p=0,m=t-e+1;p<m;p++){var h=n[p],g=1-h,_=3*h*g,v=g*g*g,y=_*g,b=_*h,x=h*h*h,S=r.normalize(y),C=i.normalize(b),w=s[e+p].subtract(c.multiply(v+y)).subtract(l.multiply(b+x));u[0][0]+=S.dot(S),u[0][1]+=S.dot(C),u[1][0]=u[0][1],u[1][1]+=C.dot(C),d[0]+=S.dot(w),d[1]+=C.dot(w)}var T=u[0][0]*u[1][1]-u[1][0]*u[0][1],E,D;if(o(T)>a){var O=u[0][0]*d[1]-u[1][0]*d[0];E=(d[0]*u[1][1]-d[1]*u[0][1])/T,D=O/T}else{var k=u[0][0]+u[0][1],A=u[1][0]+u[1][1];E=D=o(k)>a?d[0]/k:o(A)>a?d[1]/A:0}var j=l.getDistance(c),M=a*j,N,P;if(E<M||D<M)E=D=j/3;else{var F=l.subtract(c);N=r.normalize(E),P=i.normalize(D),N.dot(F)-P.dot(F)>j*j&&(E=D=j/3,N=P=null)}return[c,c.add(N||r.normalize(E)),l.add(P||i.normalize(D)),l]},reparameterize:function(e,t,n,r){for(var i=e;i<=t;i++)n[i-e]=this.findRoot(r,this.points[i],n[i-e]);for(var i=1,a=n.length;i<a;i++)if(n[i]<=n[i-1])return!1;return!0},findRoot:function(e,t,n){for(var r=[],i=[],a=0;a<=2;a++)r[a]=e[a+1].subtract(e[a]).multiply(3);for(var a=0;a<=1;a++)i[a]=r[a+1].subtract(r[a]).multiply(2);var o=this.evaluate(3,e,n),s=this.evaluate(2,r,n),c=this.evaluate(1,i,n),l=o.subtract(t),u=s.dot(s)+l.dot(c);return d.isMachineZero(u)?n:n-l.dot(s)/u},evaluate:function(e,t,n){for(var r=t.slice(),i=1;i<=e;i++)for(var a=0;a<=e-i;a++)r[a]=r[a].multiply(1-n).add(r[a+1].multiply(n));return r[0]},chordLengthParameterize:function(e,t){for(var n=[0],r=e+1;r<=t;r++)n[r-e]=n[r-e-1]+this.points[r].getDistance(this.points[r-1]);for(var r=1,i=t-e;r<=i;r++)n[r]/=n[i];return n},findMaxError:function(e,t,n,r){for(var i=Math.floor((t-e+1)/2),a=0,o=e+1;o<t;o++){var s=this.evaluate(3,n,r[o-e]).subtract(this.points[o]),c=s.x*s.x+s.y*s.y;c>=a&&(a=c,i=o)}return{error:a,index:i}}}),R=C.extend({_class:`TextItem`,_applyMatrix:!1,_canApplyMatrix:!1,_serializeFields:{content:null},_boundsOptions:{stroke:!1,handle:!1},initialize:function TextItem(e){this._content=``,this._lines=[];var t=e&&a.isPlainObject(e)&&e.x===n&&e.y===n;this._initialize(t&&e,!t&&m.read(arguments))},_equals:function(e){return this._content===e._content},copyContent:function(e){this.setContent(e._content)},getContent:function(){return this._content},setContent:function(e){this._content=``+e,this._lines=this._content.split(/\r\n|\n|\r/gm),this._changed(521)},isEmpty:function(){return!this._content},getCharacterStyle:`#getStyle`,setCharacterStyle:`#setStyle`,getParagraphStyle:`#getStyle`,setParagraphStyle:`#setStyle`}),ne=R.extend({_class:`PointText`,initialize:function PointText(){R.apply(this,arguments)},getPoint:function(){var e=this._matrix.getTranslation();return new h(e.x,e.y,this,`setPoint`)},setPoint:function(){var e=m.read(arguments);this.translate(e.subtract(this._matrix.getTranslation()))},_draw:function(e,t,n){if(this._content){this._setStyles(e,t,n);var r=this._lines,i=this._style,a=i.hasFill(),o=i.hasStroke(),s=i.getLeading(),c=e.shadowColor;e.font=i.getFontStyle(),e.textAlign=i.getJustification();for(var l=0,u=r.length;l<u;l++){e.shadowColor=c;var d=r[l];a&&(e.fillText(d,0,0),e.shadowColor=`rgba(0,0,0,0)`),o&&e.strokeText(d,0,0),e.translate(0,s)}}},_getBounds:function(e,t){var n=this._style,r=this._lines,i=r.length,a=n.getJustification(),o=n.getLeading(),s=this.getView().getTextWidth(n.getFontStyle(),r),c=0;a!==`left`&&(c-=s/(a===`center`?2:1));var l=new v(c,i?-.75*o:0,s,i*o);return e?e._transformBounds(l,l):l}}),z=a.extend(new function(){var e={gray:[`gray`],rgb:[`red`,`green`,`blue`],hsb:[`hue`,`saturation`,`brightness`],hsl:[`hue`,`saturation`,`lightness`],gradient:[`gradient`,`origin`,`destination`,`highlight`]},t={},n={transparent:[0,0,0,0]},i;function fromCSS(e){var t=e.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})([\da-f]{2})?$/i)||e.match(/^#([\da-f])([\da-f])([\da-f])([\da-f])?$/i),a=`rgb`,o;if(t){var s=t[4]?4:3;o=Array(s);for(var c=0;c<s;c++){var l=t[c+1];o[c]=parseInt(l.length==1?l+l:l,16)/255}}else if(t=e.match(/^(rgb|hsl)a?\((.*)\)$/)){a=t[1],o=t[2].trim().split(/[,\s]+/g);for(var u=a===`hsl`,c=0,d=Math.min(o.length,4);c<d;c++){var p=o[c],l=parseFloat(p);if(u)if(c===0){var m=p.match(/([a-z]*)$/)[1];l*={turn:360,rad:180/Math.PI,grad:.9}[m]||1}else c<3&&(l/=100);else c<3&&(l/=/%$/.test(p)?100:255);o[c]=l}}else{var h=n[e];if(!h)if(r){i||(i=q.getContext(1,1,{willReadFrequently:!0}),i.globalCompositeOperation=`copy`),i.fillStyle=`rgba(0,0,0,0)`,i.fillStyle=e,i.fillRect(0,0,1,1);var g=i.getImageData(0,0,1,1).data;h=n[e]=[g[0]/255,g[1]/255,g[2]/255]}else h=[0,0,0];o=h.slice()}return[a,o]}var o=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]],s={"rgb-hsb":function(e,t,n){var r=Math.max(e,t,n),i=r-Math.min(e,t,n);return[i===0?0:(r==e?(t-n)/i+(t<n?6:0):r==t?(n-e)/i+2:(e-t)/i+4)*60,r===0?0:i/r,r]},"hsb-rgb":function(e,t,n){e=(e/60%6+6)%6;var r=Math.floor(e),i=e-r,r=o[r],a=[n,n*(1-t),n*(1-t*i),n*(1-t*(1-i))];return[a[r[0]],a[r[1]],a[r[2]]]},"rgb-hsl":function(e,t,n){var r=Math.max(e,t,n),i=Math.min(e,t,n),a=r-i,o=a===0,s=o?0:(r==e?(t-n)/a+(t<n?6:0):r==t?(n-e)/a+2:(e-t)/a+4)*60,c=(r+i)/2;return[s,o?0:c<.5?a/(r+i):a/(2-r-i),c]},"hsl-rgb":function(e,t,n){if(e=(e/360%1+1)%1,t===0)return[n,n,n];for(var r=[e+1/3,e,e-1/3],i=n<.5?n*(1+t):n+t-n*t,a=2*n-i,o=[],s=0;s<3;s++){var c=r[s];c<0&&(c+=1),c>1&&--c,o[s]=6*c<1?a+(i-a)*6*c:2*c<1?i:3*c<2?a+(i-a)*(2/3-c)*6:a}return o},"rgb-gray":function(e,t,n){return[e*.2989+t*.587+n*.114]},"gray-rgb":function(e){return[e,e,e]},"gray-hsb":function(e){return[0,0,e]},"gray-hsl":function(e){return[0,0,e]},"gradient-rgb":function(){return[]},"rgb-gradient":function(){return[]}};return a.each(e,function(n,r){t[r]=[],a.each(n,function(n,i){var o=a.capitalize(n),s=/^(hue|saturation)$/.test(n),c=t[r][i]=r===`gradient`?n===`gradient`?function(e){var t=this._components[0];return e=B.read(Array.isArray(e)?e:arguments,0,{readNull:!0}),t!==e&&(t&&t._removeOwner(this),e&&e._addOwner(this)),e}:function(){return m.read(arguments,0,{readNull:n===`highlight`,clone:!0})}:function(e){return e==null||isNaN(e)?0:+e};this[`get`+o]=function(){return this._type===r||s&&/^hs[bl]$/.test(this._type)?this._components[i]:this._convert(r)[i]},this[`set`+o]=function(t){this._type!==r&&!(s&&/^hs[bl]$/.test(this._type))&&(this._components=this._convert(r),this._properties=e[r],this._type=r),this._components[i]=c.call(this,t),this._changed()}},this)},{_class:`Color`,_readIndex:!0,initialize:function Color(n){var r=arguments,i=this.__read,o=0,s,c,l,u;Array.isArray(n)&&(r=n,n=r[0]);var d=n!=null&&typeof n;if(d===`string`&&n in e&&(s=n,n=r[1],Array.isArray(n)?(c=n,l=r[2]):(i&&(o=1),r=a.slice(r,1),d=typeof n)),!c){if(u=d===`number`?r:d===`object`&&n.length!=null?n:null,u){s||=u.length>=3?`rgb`:`gray`;var p=e[s].length;l=u[p],i&&(o+=u===arguments?p+(l==null?0:1):1),u.length>p&&(u=a.slice(u,0,p))}else if(d===`string`){var m=fromCSS(n);s=m[0],c=m[1],c.length===4&&(l=c[3],c.length--)}else if(d===`object`)if(n.constructor===Color){if(s=n._type,c=n._components.slice(),l=n._alpha,s===`gradient`)for(var h=1,g=c.length;h<g;h++){var _=c[h];_&&(c[h]=_.clone())}}else if(n.constructor===B)s=`gradient`,u=r;else{s=`hue`in n?`lightness`in n?`hsl`:`hsb`:`gradient`in n||`stops`in n||`radial`in n?`gradient`:`gray`in n?`gray`:`rgb`;var v=e[s],y=t[s];this._components=c=[];for(var h=0,g=v.length;h<g;h++){var b=n[v[h]];b==null&&!h&&s===`gradient`&&`stops`in n&&(b={stops:n.stops,radial:n.radial}),b=y[h].call(this,b),b!=null&&(c[h]=b)}l=n.alpha}i&&s&&(o=1)}if(this._type=s||`rgb`,!c){this._components=c=[];for(var y=t[this._type],h=0,g=y.length;h<g;h++){var b=y[h].call(this,u&&u[h]);b!=null&&(c[h]=b)}}return this._components=c,this._properties=e[this._type],this._alpha=l,i&&(this.__read=o),this},set:`#initialize`,_serialize:function(e,t){var n=this.getComponents();return a.serialize(/^(gray|rgb)$/.test(this._type)?n:[this._type].concat(n),e,!0,t)},_changed:function(){this._canvasStyle=null,this._owner&&(this._setter?this._owner[this._setter](this):this._owner._changed(129))},_convert:function(e){var t;return this._type===e?this._components.slice():(t=s[this._type+`-`+e])?t.apply(this,this._components):s[`rgb-`+e].apply(this,s[this._type+`-rgb`].apply(this,this._components))},convert:function(e){return new z(e,this._convert(e),this._alpha)},getType:function(){return this._type},setType:function(t){this._components=this._convert(t),this._properties=e[t],this._type=t},getComponents:function(){var e=this._components.slice();return this._alpha!=null&&e.push(this._alpha),e},getAlpha:function(){return this._alpha==null?1:this._alpha},setAlpha:function(e){this._alpha=e==null?null:Math.min(Math.max(e,0),1),this._changed()},hasAlpha:function(){return this._alpha!=null},equals:function(e){var t=a.isPlainValue(e,!0)?z.read(arguments):e;return t===this||t&&this._class===t._class&&this._type===t._type&&this.getAlpha()===t.getAlpha()&&a.equals(this._components,t._components)||!1},toString:function(){for(var e=this._properties,t=[],n=this._type===`gradient`,r=u.instance,i=0,a=e.length;i<a;i++){var o=this._components[i];o!=null&&t.push(e[i]+`: `+(n?o:r.number(o)))}return this._alpha!=null&&t.push(`alpha: `+r.number(this._alpha)),`{ `+t.join(`, `)+` }`},toCSS:function(e){var t=this._convert(`rgb`),n=e||this._alpha==null?1:this._alpha;function convert(e){return Math.round((e<0?0:e>1?1:e)*255)}return t=[convert(t[0]),convert(t[1]),convert(t[2])],n<1&&t.push(n<0?0:n),e?`#`+((1<<24)+(t[0]<<16)+(t[1]<<8)+t[2]).toString(16).slice(1):(t.length==4?`rgba(`:`rgb(`)+t.join(`,`)+`)`},toCanvasStyle:function(e,t){if(this._canvasStyle)return this._canvasStyle;if(this._type!==`gradient`)return this._canvasStyle=this.toCSS();var n=this._components,r=n[0],i=r._stops,a=n[1],o=n[2],s=n[3],c=t&&t.inverted(),l;if(c&&(a=c._transformPoint(a),o=c._transformPoint(o),s&&=c._transformPoint(s)),r._radial){var u=o.getDistance(a);if(s){var d=s.subtract(a);d.getLength()>u&&(s=a.add(d.normalize(u-.1)))}var p=s||a;l=e.createRadialGradient(p.x,p.y,0,a.x,a.y,u)}else l=e.createLinearGradient(a.x,a.y,o.x,o.y);for(var m=0,h=i.length;m<h;m++){var g=i[m],_=g._offset;l.addColorStop(_??m/(h-1),g._color.toCanvasStyle())}return this._canvasStyle=l},transform:function(e){if(this._type===`gradient`){for(var t=this._components,n=1,r=t.length;n<r;n++){var i=t[n];e._transformPoint(i,i,!0)}this._changed()}},statics:{_types:e,random:function(){var e=Math.random;return new z(e(),e(),e())},_setOwner:function(e,t,n){return e&&(e._owner&&t&&e._owner!==t&&(e=e.clone()),!e._owner^!t&&(e._owner=t||null,e._setter=n||null)),e}}})},new function(){return a.each({add:function(e,t){return e+t},subtract:function(e,t){return e-t},multiply:function(e,t){return e*t},divide:function(e,t){return e/t}},function(e,t){this[t]=function(t){t=z.read(arguments);for(var n=this._type,r=this._components,i=t._convert(n),a=0,o=r.length;a<o;a++)i[a]=e(r[a],i[a]);return new z(n,i,this._alpha==null?null:e(this._alpha,t.getAlpha()))}},{})}),B=a.extend({_class:`Gradient`,initialize:function Gradient(e,t){this._id=p.get(),e&&a.isPlainObject(e)&&(this.set(e),e=t=null),this._stops??this.setStops(e||[`white`,`black`]),this._radial??this.setRadial(typeof t==`string`&&t===`radial`||t||!1)},_serialize:function(e,t){return t.add(this,function(){return a.serialize([this._stops,this._radial],e,!0,t)})},_changed:function(){for(var e=0,t=this._owners&&this._owners.length;e<t;e++)this._owners[e]._changed()},_addOwner:function(e){this._owners||=[],this._owners.push(e)},_removeOwner:function(e){var t=this._owners?this._owners.indexOf(e):-1;t!=-1&&(this._owners.splice(t,1),this._owners.length||(this._owners=n))},clone:function(){for(var e=[],t=0,n=this._stops.length;t<n;t++)e[t]=this._stops[t].clone();return new B(e,this._radial)},getStops:function(){return this._stops},setStops:function(e){if(e.length<2)throw Error(`Gradient stop list needs to contain at least two stops.`);var t=this._stops;if(t)for(var r=0,i=t.length;r<i;r++)t[r]._owner=n;t=this._stops=re.readList(e,0,{clone:!0});for(var r=0,i=t.length;r<i;r++)t[r]._owner=this;this._changed()},getRadial:function(){return this._radial},setRadial:function(e){this._radial=e,this._changed()},equals:function(e){if(e===this)return!0;if(e&&this._class===e._class){var t=this._stops,n=e._stops,r=t.length;if(r===n.length){for(var i=0;i<r;i++)if(!t[i].equals(n[i]))return!1;return!0}}return!1}}),re=a.extend({_class:`GradientStop`,initialize:function GradientStop(e,t){var r=e,i=t;typeof e==`object`&&t===n&&(Array.isArray(e)&&typeof e[0]!=`number`?(r=e[0],i=e[1]):(`color`in e||`offset`in e||`rampPoint`in e)&&(r=e.color,i=e.offset||e.rampPoint||0)),this.setColor(r),this.setOffset(i)},clone:function(){return new re(this._color.clone(),this._offset)},_serialize:function(e,t){var n=this._color,r=this._offset;return a.serialize(r==null?[n]:[n,r],e,!0,t)},_changed:function(){this._owner&&this._owner._changed(129)},getOffset:function(){return this._offset},setOffset:function(e){this._offset=e,this._changed()},getRampPoint:`#getOffset`,setRampPoint:`#setOffset`,getColor:function(){return this._color},setColor:function(){z._setOwner(this._color,null),this._color=z._setOwner(z.read(arguments,0),this,`setColor`),this._changed()},equals:function(e){return e===this||e&&this._class===e._class&&this._color.equals(e._color)&&this._offset==e._offset||!1}}),ie=a.extend(new function(){var e={fillColor:null,fillRule:`nonzero`,strokeColor:null,strokeWidth:1,strokeCap:`butt`,strokeJoin:`miter`,strokeScaling:!0,miterLimit:10,dashOffset:0,dashArray:[],shadowColor:null,shadowBlur:0,shadowOffset:new m,selectedColor:null},t=a.set({},e,{fontFamily:`sans-serif`,fontWeight:`normal`,fontSize:12,leading:null,justification:`left`}),r=a.set({},t,{fillColor:new z}),i={strokeWidth:193,strokeCap:193,strokeJoin:193,strokeScaling:201,miterLimit:193,fontFamily:9,fontWeight:9,fontSize:9,font:9,leading:9,justification:9},o={beans:!0},s={_class:`Style`,beans:!0,initialize:function Style(n,i,a){this._values={},this._owner=i,this._project=i&&i._project||a||Z.project,this._defaults=!i||i instanceof w?t:i instanceof R?r:e,n&&this.set(n)}};return a.each(t,function(e,t){var r=/Color$/.test(t),c=t===`shadowOffset`,l=a.capitalize(t),u=i[t],d=`set`+l,p=`get`+l;s[d]=function(e){var n=this._owner,i=n&&n._children,a=i&&i.length>0&&!(n instanceof L);if(a)for(var o=0,s=i.length;o<s;o++)i[o]._style[d](e);if((t===`selectedColor`||!a)&&t in this._defaults){var c=this._values[t];c!==e&&(r&&(c&&(z._setOwner(c,null),c._canvasStyle=null),e&&e.constructor===z&&(e=z._setOwner(e,n,a&&d))),this._values[t]=e,n&&n._changed(u||129))}},s[p]=function(e){var i=this._owner,o=i&&i._children,s=o&&o.length>0&&!(i instanceof L),l;if(s&&!e)for(var u=0,h=o.length;u<h;u++){var g=o[u]._style[p]();if(!u)l=g;else if(!a.equals(l,g))return n}else if(t in this._defaults){var l=this._values[t];if(l===n)l=this._defaults[t],l&&l.clone&&(l=l.clone());else{var _=r?z:c?m:null;_&&!(l&&l.constructor===_)&&(this._values[t]=l=_.read([l],0,{readNull:!0,clone:!0}))}}return l&&r&&(l=z._setOwner(l,i,s&&d)),l},o[p]=function(e){return this._style[p](e)},o[d]=function(e){this._style[d](e)}}),a.each({Font:`FontFamily`,WindingRule:`FillRule`},function(e,t){var n=`get`+t,r=`set`+t;s[n]=o[n]=`#get`+e,s[r]=o[r]=`#set`+e}),C.inject(o),s},{set:function(e){var t=e instanceof ie,n=t?e._values:e;if(n){for(var r in n)if(r in this._defaults){var i=n[r];this[r]=i&&t&&i.clone?i.clone():i}}},equals:function(e){function compare(e,t,r){var i=e._values,o=t._values,s=t._defaults;for(var c in i){var l=i[c],u=o[c];if(!(r&&c in o)&&!a.equals(l,u===n?s[c]:u))return!1}return!0}return e===this||e&&this._class===e._class&&compare(this,e)&&compare(e,this,!0)||!1},_dispose:function(){var e=this.getFillColor();e&&(e._canvasStyle=null),e=this.getStrokeColor(),e&&(e._canvasStyle=null),e=this.getShadowColor(),e&&(e._canvasStyle=null)},hasFill:function(){var e=this.getFillColor();return!!e&&e.alpha>0},hasStroke:function(){var e=this.getStrokeColor();return!!e&&e.alpha>0&&this.getStrokeWidth()>0},hasShadow:function(){var e=this.getShadowColor();return!!e&&e.alpha>0&&(this.getShadowBlur()>0||!this.getShadowOffset().isZero())},getView:function(){return this._project._view},getFontStyle:function(){var e=this.getFontSize();return this.getFontWeight()+` `+e+(/[a-z]/i.test(e+``)?` `:`px `)+this.getFontFamily()},getFont:`#getFontFamily`,setFont:`#setFontFamily`,getLeading:function getLeading(){var e=getLeading.base.call(this),t=this.getFontSize();return/pt|em|%|px/.test(t)&&(t=this.getView().getPixelSize(t)),e??t*1.2}}),V=new function(){function handlePrefix(e,t,n,r){for(var i=[``,`webkit`,`moz`,`Moz`,`ms`,`o`],a=t[0].toUpperCase()+t.substring(1),o=0;o<6;o++){var s=i[o],c=s?s+a:t;if(c in e){if(n)e[c]=r;else return e[c];break}}}return{getStyles:function(e){var t=e&&e.nodeType!==9?e.ownerDocument:e,n=t&&t.defaultView;return n&&n.getComputedStyle(e,``)},getBounds:function(e,t){var n=e.ownerDocument,r=n.body,i=n.documentElement,a;try{a=e.getBoundingClientRect()}catch{a={left:0,top:0,width:0,height:0}}var o=a.left-(i.clientLeft||r.clientLeft||0),s=a.top-(i.clientTop||r.clientTop||0);if(!t){var c=n.defaultView;o+=c.pageXOffset||i.scrollLeft||r.scrollLeft,s+=c.pageYOffset||i.scrollTop||r.scrollTop}return new v(o,s,a.width,a.height)},getViewportBounds:function(e){var t=e.ownerDocument,n=t.defaultView,r=t.documentElement;return new v(0,0,n.innerWidth||r.clientWidth,n.innerHeight||r.clientHeight)},getOffset:function(e,t){return V.getBounds(e,t).getPoint()},getSize:function(e){return V.getBounds(e,!0).getSize()},isInvisible:function(e){return V.getSize(e).equals(new g(0,0))},isInView:function(e){return!V.isInvisible(e)&&V.getViewportBounds(e).intersects(V.getBounds(e,!0))},isInserted:function(e){return i.body.contains(e)},getPrefixed:function(e,t){return e&&handlePrefix(e,t)},setPrefixed:function(e,t,n){if(typeof t==`object`)for(var r in t)handlePrefix(e,r,!0,t[r]);else handlePrefix(e,t,!0,n)}}},H={add:function(e,t){if(e)for(var n in t)for(var r=t[n],a=n.split(/[\s,]+/g),o=0,s=a.length;o<s;o++){var c=a[o],l=e===i&&(c===`touchstart`||c===`touchmove`)?{passive:!1}:!1;e.addEventListener(c,r,l)}},remove:function(e,t){if(e)for(var n in t)for(var r=t[n],i=n.split(/[\s,]+/g),a=0,o=i.length;a<o;a++)e.removeEventListener(i[a],r,!1)},getPoint:function(e){var t=e.targetTouches?e.targetTouches.length?e.targetTouches[0]:e.changedTouches[0]:e;return new m(t.pageX||t.clientX+i.documentElement.scrollLeft,t.pageY||t.clientY+i.documentElement.scrollTop)},getTarget:function(e){return e.target||e.srcElement},getRelatedTarget:function(e){return e.relatedTarget||e.toElement},getOffset:function(e,t){return H.getPoint(e).subtract(V.getOffset(t||H.getTarget(e)))}};H.requestAnimationFrame=new function(){var e=V.getPrefixed(r,`requestAnimationFrame`),t=!1,n=[],i;function handleCallbacks(){var r=n;n=[];for(var i=0,a=r.length;i<a;i++)r[i]();t=e&&n.length,t&&e(handleCallbacks)}return function(r){n.push(r),e?t||=(e(handleCallbacks),!0):i||=setInterval(handleCallbacks,1e3/60)}};var U=a.extend(o,{_class:`View`,initialize:function View(e,t){function getSize(e){return t[e]||parseInt(t.getAttribute(e),10)}function getCanvasSize(){var e=V.getSize(t);return e.isNaN()||e.isZero()?new g(getSize(`width`),getSize(`height`)):e}var n;if(r&&t){this._id=t.getAttribute(`id`),this._id??t.setAttribute(`id`,this._id=`paper-view-`+ View._id++),H.add(t,this._viewEvents);var a=`none`;if(V.setPrefixed(t.style,{userDrag:a,userSelect:a,touchCallout:a,contentZooming:a,tapHighlightColor:`rgba(0,0,0,0)`}),s.hasAttribute(t,`resize`)){var o=this;H.add(r,this._windowEvents={resize:function(){o.setViewSize(getCanvasSize())}})}if(n=getCanvasSize(),s.hasAttribute(t,`stats`)&&typeof Stats<`u`){this._stats=new Stats;var c=this._stats.domElement,l=c.style,u=V.getOffset(t);l.position=`absolute`,l.left=u.x+`px`,l.top=u.y+`px`,i.body.appendChild(c)}}else n=new g(t),t=null;this._project=e,this._scope=e._scope,this._element=t,this._pixelRatio||=r&&r.devicePixelRatio||1,this._setElementSize(n.width,n.height),this._viewSize=n,View._views.push(this),View._viewsById[this._id]=this,(this._matrix=new b)._owner=this,View._focused||=this,this._frameItems={},this._frameItemCount=0,this._itemEvents={native:{},virtual:{}},this._autoUpdate=!Z.agent.node,this._needsUpdate=!1},remove:function(){if(!this._project)return!1;U._focused===this&&(U._focused=null),U._views.splice(U._views.indexOf(this),1),delete U._viewsById[this._id];var e=this._project;return e._view===this&&(e._view=null),H.remove(this._element,this._viewEvents),H.remove(r,this._windowEvents),this._element=this._project=null,this.off(`frame`),this._animate=!1,this._frameItems={},!0},_events:a.each(C._itemHandlers.concat([`onResize`,`onKeyDown`,`onKeyUp`]),function(e){this[e]={}},{onFrame:{install:function(){this.play()},uninstall:function(){this.pause()}}}),_animate:!1,_time:0,_count:0,getAutoUpdate:function(){return this._autoUpdate},setAutoUpdate:function(e){this._autoUpdate=e,e&&this.requestUpdate()},update:function(){},draw:function(){this.update()},requestUpdate:function(){if(!this._requested){var e=this;H.requestAnimationFrame(function(){if(e._requested=!1,e._animate){e.requestUpdate();var t=e._element;(!V.getPrefixed(i,`hidden`)||s.getAttribute(t,`keepalive`)===`true`)&&V.isInView(t)&&e._handleFrame()}e._autoUpdate&&e.update()}),this._requested=!0}},play:function(){this._animate=!0,this.requestUpdate()},pause:function(){this._animate=!1},_handleFrame:function(){Z=this._scope;var e=Date.now()/1e3,t=this._last?e-this._last:0;this._last=e,this.emit(`frame`,new a({delta:t,time:this._time+=t,count:this._count++})),this._stats&&this._stats.update()},_animateItem:function(e,t){var n=this._frameItems;t?(n[e._id]={item:e,time:0,count:0},++this._frameItemCount===1&&this.on(`frame`,this._handleFrameItems)):(delete n[e._id],--this._frameItemCount===0&&this.off(`frame`,this._handleFrameItems))},_handleFrameItems:function(e){for(var t in this._frameItems){var n=this._frameItems[t];n.item.emit(`frame`,new a(e,{time:n.time+=e.delta,count:n.count++}))}},_changed:function(){this._project._changed(4097),this._bounds=this._decomposed=n},getElement:function(){return this._element},getPixelRatio:function(){return this._pixelRatio},getResolution:function(){return this._pixelRatio*72},getViewSize:function(){var e=this._viewSize;return new _(e.width,e.height,this,`setViewSize`)},setViewSize:function(){var e=g.read(arguments),t=e.subtract(this._viewSize);t.isZero()||(this._setElementSize(e.width,e.height),this._viewSize.set(e),this._changed(),this.emit(`resize`,{size:e,delta:t}),this._autoUpdate&&this.update())},_setElementSize:function(e,t){var n=this._element;n&&(n.width!==e&&(n.width=e),n.height!==t&&(n.height=t))},getBounds:function(){return this._bounds||=this._matrix.inverted()._transformBounds(new v(new m,this._viewSize)),this._bounds},getSize:function(){return this.getBounds().getSize()},isVisible:function(){return V.isInView(this._element)},isInserted:function(){return V.isInserted(this._element)},getPixelSize:function(e){var t=this._element,n;if(t){var r=t.parentNode,a=i.createElement(`div`);a.style.fontSize=e,r.appendChild(a),n=parseFloat(V.getStyles(a).fontSize),r.removeChild(a)}else n=parseFloat(n);return n},getTextWidth:function(e,t){return 0}},a.each([`rotate`,`scale`,`shear`,`skew`],function(e){var t=e===`rotate`;this[e]=function(){var n=arguments,r=(t?a:m).read(n),i=m.read(n,0,{readNull:!0});return this.transform(new b()[e](r,i||this.getCenter(!0)))}},{_decompose:function(){return this._decomposed||=this._matrix.decompose()},translate:function(){var e=new b;return this.transform(e.translate.apply(e,arguments))},getCenter:function(){return this.getBounds().getCenter()},setCenter:function(){var e=m.read(arguments);this.translate(this.getCenter().subtract(e))},getZoom:function(){var e=this._decompose().scaling;return(e.x+e.y)/2},setZoom:function(e){this.transform(new b().scale(e/this.getZoom(),this.getCenter()))},getRotation:function(){return this._decompose().rotation},setRotation:function(e){var t=this.getRotation();t!=null&&e!=null&&this.rotate(e-t)},getScaling:function(){var e=this._decompose().scaling;return new h(e.x,e.y,this,`setScaling`)},setScaling:function(){var e=this.getScaling(),t=m.read(arguments,0,{clone:!0,readNull:!0});e&&t&&this.scale(t.x/e.x,t.y/e.y)},getMatrix:function(){return this._matrix},setMatrix:function(){var e=this._matrix;e.set.apply(e,arguments)},transform:function(e){this._matrix.append(e)},scrollBy:function(){this.translate(m.read(arguments).negate())}}),{projectToView:function(){return this._matrix._transformPoint(m.read(arguments))},viewToProject:function(){return this._matrix._inverseTransform(m.read(arguments))},getEventPoint:function(e){return this.viewToProject(H.getOffset(e,this._element))}},{statics:{_views:[],_viewsById:{},_id:0,create:function(e,t){return i&&typeof t==`string`&&(t=i.getElementById(t)),new(r?W:U)(e,t)}}},new function(){if(!r)return;var e,t,n=!1,a=!1;function getView(e){var t=H.getTarget(e);return t.getAttribute&&U._viewsById[t.getAttribute(`id`)]}function updateFocus(){var e=U._focused;if(!e||!e.isVisible()){for(var n=0,r=U._views.length;n<r;n++)if((e=U._views[n]).isVisible()){U._focused=t=e;break}}}function handleMouseMove(e,t,n){e._handleMouseEvent(`mousemove`,t,n)}var o=r.navigator,s,c,l;o.pointerEnabled||o.msPointerEnabled?(s=`pointerdown MSPointerDown`,c=`pointermove MSPointerMove`,l=`pointerup pointercancel MSPointerUp MSPointerCancel`):(s=`touchstart`,c=`touchmove`,l=`touchend touchcancel`,`ontouchstart`in r&&o.userAgent.match(/mobile|tablet|ip(ad|hone|od)|android|silk/i)||(s+=` mousedown`,c+=` mousemove`,l+=` mouseup`));var u={},d={mouseout:function(e){var t=U._focused,n=H.getRelatedTarget(e);if(t&&(!n||n.nodeName===`HTML`)){var r=H.getOffset(e,t._element),i=r.x,a=Math.abs,o=a(i),s=o-(1<<25);r.x=a(s)<o?s*(i<0?-1:1):i,handleMouseMove(t,e,t.viewToProject(r))}},scroll:updateFocus};u[s]=function(e){var t=U._focused=getView(e);n||(n=!0,t._handleMouseEvent(`mousedown`,e))},d[c]=function(n){var r=U._focused;if(!a){var i=getView(n);i?r!==i&&(r&&handleMouseMove(r,n),e||=r,r=U._focused=t=i):t&&t===r&&(e&&!e.isInserted()&&(e=null),r=U._focused=e,e=null,updateFocus())}r&&handleMouseMove(r,n)},d[s]=function(){a=!0},d[l]=function(e){var t=U._focused;t&&n&&t._handleMouseEvent(`mouseup`,e),a=n=!1},H.add(i,d),H.add(r,{load:updateFocus});var p=!1,m=!1,h={doubleclick:`click`,mousedrag:`mousemove`},g=!1,_,v,y,b,x,S,C,w;function emitMouseEvent(e,t,n,r,i,a,o){var s=!1,c;function emit(e,n){if(e.responds(n)){if(c||=new ce(n,r,i,t||e,a?i.subtract(a):null),e.emit(n,c)&&(p=!0,c.prevented&&(m=!0),c.stopped))return s=!0}else{var o=h[n];if(o)return emit(e,o)}}for(;e&&e!==o&&!emit(e,n);)e=e._parent;return s}function emitMouseEvents(e,t,n,r,i,a){return e._project.removeOn(n),m=p=!1,x&&emitMouseEvent(x,null,n,r,i,a)||t&&t!==x&&!t.isDescendant(x)&&emitMouseEvent(t,null,n===`mousedrag`?`mousemove`:n,r,i,a,x)||emitMouseEvent(e,x||t||e,n,r,i,a)}var T={mousedown:{mousedown:1,mousedrag:1,click:1,doubleclick:1},mouseup:{mouseup:1,mousedrag:1,click:1,doubleclick:1},mousemove:{mousedrag:1,mousemove:1,mouseenter:1,mouseleave:1}};return{_viewEvents:u,_handleMouseEvent:function(e,t,r){var i=this._itemEvents,a=i.native[e],o=e===`mousemove`,s=this._scope.tool,c=this;function responds(e){return i.virtual[e]||c.responds(e)||s&&s.responds(e)}o&&n&&responds(`mousedrag`)&&(e=`mousedrag`),r||=this.getEventPoint(t);var l=this.getBounds().contains(r),u=a&&l&&c._project.hitTest(r,{tolerance:0,fill:!0,stroke:!0}),d=u&&u.item||null,h=!1,T={};if(T[e.substr(5)]=!0,a&&d!==b&&(b&&emitMouseEvent(b,null,`mouseleave`,t,r),d&&emitMouseEvent(d,null,`mouseenter`,t,r),b=d),g^l&&(emitMouseEvent(this,null,l?`mouseenter`:`mouseleave`,t,r),h=!0),(l||T.drag)&&!r.equals(v)&&(emitMouseEvents(this,d,o?e:`mousemove`,t,r,v),h=!0),g=l,T.down&&l||T.up&&_){if(emitMouseEvents(this,d,e,t,r,_),T.down){if(w=d===S&&Date.now()-C<300,y=S=d,!m&&d){for(var E=d;E&&!E.responds(`mousedrag`);)E=E._parent;E&&(x=d)}_=r}else T.up&&(!m&&d===y&&(C=Date.now(),emitMouseEvents(this,d,w?`doubleclick`:`click`,t,r,_),w=!1),y=x=null);g=!1,h=!0}v=r,h&&s&&(p=s._handleMouseEvent(e,t,r,T)||p),t.cancelable!==!1&&(p&&!T.move||T.down&&responds(`mouseup`))&&t.preventDefault()},_handleKeyEvent:function(e,t,n,r){var i=this._scope,a=i.tool,o;function emit(a){a.responds(e)&&(Z=i,a.emit(e,o||=new ae(e,t,n,r)))}this.isVisible()&&(emit(this),a&&a.responds(e)&&emit(a))},_countItemEvent:function(e,t){var n=this._itemEvents,r=n.native,i=n.virtual;for(var a in T)r[a]=(r[a]||0)+(T[a][e]||0)*t;i[e]=(i[e]||0)+t},statics:{updateFocus,_resetState:function(){n=a=p=g=!1,e=t=_=v=y=b=x=S=C=w=null}}}}),W=U.extend({_class:`CanvasView`,initialize:function CanvasView(e,t){if(!(t instanceof r.HTMLCanvasElement)){var n=g.read(arguments,1);if(n.isZero())throw Error(`Cannot create CanvasView with the provided argument: `+a.slice(arguments,1));t=q.getCanvas(n)}var i=this._context=t.getContext(`2d`);i.save(),this._pixelRatio=1,/^off|false$/.test(s.getAttribute(t,`hidpi`))||(this._pixelRatio=(r.devicePixelRatio||1)/(V.getPrefixed(i,`backingStorePixelRatio`)||1)),U.call(this,e,t),this._needsUpdate=!0},remove:function remove(){return this._context.restore(),remove.base.call(this)},_setElementSize:function _setElementSize(e,t){var n=this._pixelRatio;if(_setElementSize.base.call(this,e*n,t*n),n!==1){var r=this._element,i=this._context;if(!s.hasAttribute(r,`resize`)){var a=r.style;a.width=e+`px`,a.height=t+`px`}i.restore(),i.save(),i.scale(n,n)}},getContext:function(){return this._context},getPixelSize:function getPixelSize(e){var t=Z.agent,n;if(t&&t.firefox)n=getPixelSize.base.call(this,e);else{var r=this._context,i=r.font;r.font=e+` serif`,n=parseFloat(r.font),r.font=i}return n},getTextWidth:function(e,t){var n=this._context,r=n.font,i=0;n.font=e;for(var a=0,o=t.length;a<o;a++)i=Math.max(i,n.measureText(t[a]).width);return n.font=r,i},update:function(){if(!this._needsUpdate)return!1;var e=this._project,t=this._context,n=this._viewSize;return t.clearRect(0,0,n.width+1,n.height+1),e&&e.draw(t,this._matrix,this._pixelRatio),this._needsUpdate=!1,!0}}),G=a.extend({_class:`Event`,initialize:function Event(e){this.event=e,this.type=e&&e.type},prevented:!1,stopped:!1,preventDefault:function(){this.prevented=!0,this.event.preventDefault()},stopPropagation:function(){this.stopped=!0,this.event.stopPropagation()},stop:function(){this.stopPropagation(),this.preventDefault()},getTimeStamp:function(){return this.event.timeStamp},getModifiers:function(){return oe.modifiers}}),ae=G.extend({_class:`KeyEvent`,initialize:function KeyEvent(e,t,n,r){this.type=e,this.event=t,this.key=n,this.character=r},toString:function(){return`{ type: '`+this.type+`', key: '`+this.key+`', character: '`+this.character+`', modifiers: `+this.getModifiers()+` }`}}),oe=new function(){var e={" ":`tab`," ":`space`,"\b":`backspace`,"":`delete`,Spacebar:`space`,Del:`delete`,Win:`meta`,Esc:`escape`},t={tab:` `,space:` `,enter:`\r`},o={},s={},c,l,u=new a({shift:!1,control:!1,alt:!1,meta:!1,capsLock:!1,space:!1}).inject({option:{get:function(){return this.alt}},command:{get:function(){var e=Z&&Z.agent;return e&&e.mac?this.meta:this.control}}});function getKey(t){var r=t.key||t.keyIdentifier;return r=/^U\+/.test(r)?String.fromCharCode(parseInt(r.substr(2),16)):/^Arrow[A-Z]/.test(r)?r.substr(5):r===`Unidentified`||r===n?String.fromCharCode(t.keyCode):r,e[r]||(r.length>1?a.hyphenate(r):r.toLowerCase())}function handleKey(e,t,n,r){var i=U._focused,l;if(o[t]=e,e?s[t]=n:delete s[t],t.length>1&&(l=a.camelize(t))in u){u[l]=e;var d=Z&&Z.agent;if(l===`meta`&&d&&d.mac)if(e)c={};else{for(var p in c)p in s&&handleKey(!1,p,c[p],r);c=null}}else e&&c&&(c[t]=n);i&&i._handleKeyEvent(e?`keydown`:`keyup`,r,t,n)}return H.add(i,{keydown:function(e){var n=getKey(e),r=Z&&Z.agent;n.length>1||r&&r.chrome&&(e.altKey||r.mac&&e.metaKey||!r.mac&&e.ctrlKey)?handleKey(!0,n,t[n]||(n.length>1?``:n),e):l=n},keypress:function(e){if(l){var t=getKey(e),n=e.charCode,r=n>=32?String.fromCharCode(n):t.length>1?``:t;t!==l&&(t=r.toLowerCase()),handleKey(!0,t,r,e),l=null}},keyup:function(e){var t=getKey(e);t in s&&handleKey(!1,t,s[t],e)}}),H.add(r,{blur:function(e){for(var t in s)handleKey(!1,t,s[t],e)}}),{modifiers:u,isDown:function(e){return!!o[e]}}},ce=G.extend({_class:`MouseEvent`,initialize:function MouseEvent(e,t,n,r,i){this.type=e,this.event=t,this.point=n,this.target=r,this.delta=i},toString:function(){return`{ type: '`+this.type+`', point: `+this.point+`, target: `+this.target+(this.delta?`, delta: `+this.delta:``)+`, modifiers: `+this.getModifiers()+` }`}}),le=G.extend({_class:`ToolEvent`,_item:null,initialize:function ToolEvent(e,t,n){this.tool=e,this.type=t,this.event=n},_choosePoint:function(e,t){return e||(t?t.clone():null)},getPoint:function(){return this._choosePoint(this._point,this.tool._point)},setPoint:function(e){this._point=e},getLastPoint:function(){return this._choosePoint(this._lastPoint,this.tool._lastPoint)},setLastPoint:function(e){this._lastPoint=e},getDownPoint:function(){return this._choosePoint(this._downPoint,this.tool._downPoint)},setDownPoint:function(e){this._downPoint=e},getMiddlePoint:function(){return!this._middlePoint&&this.tool._lastPoint?this.tool._point.add(this.tool._lastPoint).divide(2):this._middlePoint},setMiddlePoint:function(e){this._middlePoint=e},getDelta:function(){return!this._delta&&this.tool._lastPoint?this.tool._point.subtract(this.tool._lastPoint):this._delta},setDelta:function(e){this._delta=e},getCount:function(){return this.tool[/^mouse(down|up)$/.test(this.type)?`_downCount`:`_moveCount`]},setCount:function(e){this.tool[/^mouse(down|up)$/.test(this.type)?`downCount`:`count`]=e},getItem:function(){if(!this._item){var e=this.tool._scope.project.hitTest(this.getPoint());if(e){for(var t=e.item,n=t._parent;/^(Group|CompoundPath)$/.test(n._class);)t=n,n=n._parent;this._item=t}}return this._item},setItem:function(e){this._item=e},toString:function(){return`{ type: `+this.type+`, point: `+this.getPoint()+`, count: `+this.getCount()+`, modifiers: `+this.getModifiers()+` }`}}),ue=c.extend({_class:`Tool`,_list:`tools`,_reference:`tool`,_events:[`onMouseDown`,`onMouseUp`,`onMouseDrag`,`onMouseMove`,`onActivate`,`onDeactivate`,`onEditOptions`,`onKeyDown`,`onKeyUp`],initialize:function Tool(e){c.call(this),this._moveCount=-1,this._downCount=-1,this.set(e)},getMinDistance:function(){return this._minDistance},setMinDistance:function(e){this._minDistance=e,e!=null&&this._maxDistance!=null&&e>this._maxDistance&&(this._maxDistance=e)},getMaxDistance:function(){return this._maxDistance},setMaxDistance:function(e){this._maxDistance=e,this._minDistance!=null&&e!=null&&e<this._minDistance&&(this._minDistance=e)},getFixedDistance:function(){return this._minDistance==this._maxDistance?this._minDistance:null},setFixedDistance:function(e){this._minDistance=this._maxDistance=e},_handleMouseEvent:function(e,t,n,r){Z=this._scope,r.drag&&!this.responds(e)&&(e=`mousemove`);var i=r.move||r.drag,a=this.responds(e),o=!1,s=this;function update(e,t){var a=n,o=i?s._point:s._downPoint||a;if(i){if(s._moveCount>=0&&a.equals(o))return!1;if(o&&(e!=null||t!=null)){var c=a.subtract(o),l=c.getLength();if(l<(e||0))return!1;t&&(a=o.add(c.normalize(Math.min(l,t))))}s._moveCount++}return s._point=a,s._lastPoint=o||a,r.down&&(s._moveCount=-1,s._downPoint=a,s._downCount++),!0}function emit(){a&&(o=s.emit(e,new le(s,e,t))||o)}if(r.down)update(),emit();else if(r.up)update(null,this._maxDistance),emit();else if(a)for(;update(this._minDistance,this._maxDistance);)emit();return o}}),de=a.extend(o,{_class:`Tween`,statics:{easings:new a({linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:-1+2*(2-e)*e},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}})},initialize:function Tween(e,t,n,r,i,a){this.object=e;var o=typeof i,s=o===`function`;this.type=s?o:o===`string`?i:`linear`,this.easing=s?i:Tween.easings[this.type],this.duration=r,this.running=!1,this._then=null,this._startTime=null;var c=t||n;this._keys=c?Object.keys(c):[],this._parsedKeys=this._parseKeys(this._keys),this._from=c&&this._getState(t),this._to=c&&this._getState(n),a!==!1&&this.start()},then:function(e){return this._then=e,this},start:function(){return this._startTime=null,this.running=!0,this},stop:function(){return this.running=!1,this},update:function(e){if(this.running){e>=1&&(e=1,this.running=!1);for(var t=this.easing(e),n=this._keys,getValue=function(n){return typeof n==`function`?n(t,e):n},r=0,i=n&&n.length;r<i;r++){var o=n[r],s=getValue(this._from[o]),c=getValue(this._to[o]),l=s&&c&&s.__add&&c.__add?c.__subtract(s).__multiply(t).__add(s):(c-s)*t+s;this._setProperty(this._parsedKeys[o],l)}this.responds(`update`)&&this.emit(`update`,new a({progress:e,factor:t})),!this.running&&this._then&&this._then(this.object)}return this},_events:{onUpdate:{}},_handleFrame:function(e){var t=this._startTime,n=t?(e-t)/this.duration:0;t||(this._startTime=e),this.update(n)},_getState:function(e){for(var t=this._keys,n={},r=0,i=t.length;r<i;r++){var a=t[r],o=this._parsedKeys[a],s=this._getProperty(o),c;if(e){var l=this._resolveValue(s,e[a]);this._setProperty(o,l),c=this._getProperty(o),c=c&&c.clone?c.clone():c,this._setProperty(o,s)}else c=s&&s.clone?s.clone():s;n[a]=c}return n},_resolveValue:function(e,t){if(t){if(Array.isArray(t)&&t.length===2){var n=t[0];return n&&n.match&&n.match(/^[+\-\*\/]=/)?this._calculate(e,n[0],t[1]):t}else if(typeof t==`string`){var r=t.match(/^[+\-*/]=(.*)/);if(r){var i=JSON.parse(r[1].replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:/g,`"$2": `));return this._calculate(e,t[0],i)}}}return t},_calculate:function(e,t,n){return Z.PaperScript.calculateBinary(e,t,n)},_parseKeys:function(e){for(var t={},n=0,r=e.length;n<r;n++){var i=e[n];t[i]=i.replace(/\.([^.]*)/g,`/$1`).replace(/\[['"]?([^'"\]]*)['"]?\]/g,`/$1`).split(`/`)}return t},_getProperty:function(e,t){for(var n=this.object,r=0,i=e.length-(t||0);r<i&&n;r++)n=n[e[r]];return n},_setProperty:function(e,t){var n=this._getProperty(e,1);n&&(n[e[e.length-1]]=t)}}),fe={request:function(t){var n=new e.XMLHttpRequest;return n.open((t.method||`get`).toUpperCase(),t.url,a.pick(t.async,!0)),t.mimeType&&n.overrideMimeType(t.mimeType),n.onload=function(){var e=n.status;e===0||e===200?t.onLoad&&t.onLoad.call(n,n.responseText):n.onerror()},n.onerror=function(){var e=n.status,r=`Could not load "`+t.url+`" (Status: `+e+`)`;if(t.onError)t.onError(r,e);else throw Error(r)},n.send(null)}},q=a.exports.CanvasProvider={canvases:[],getCanvas:function(e,t,n){if(!r)return null;var a,o=!0;typeof e==`object`&&(t=e.height,e=e.width),this.canvases.length?a=this.canvases.pop():(a=i.createElement(`canvas`),o=!1);var s=a.getContext(`2d`,n||{});if(!s)throw Error(`Canvas `+a+` is unable to provide a 2D context.`);return a.width===e&&a.height===t?o&&s.clearRect(0,0,e+1,t+1):(a.width=e,a.height=t),s.save(),a},getContext:function(e,t,n){var r=this.getCanvas(e,t,n);return r?r.getContext(`2d`,n||{}):null},release:function(e){var t=e&&e.canvas?e.canvas:e;t&&t.getContext&&(t.getContext(`2d`).restore(),this.canvases.push(t))}},J=new function(){var e=Math.min,t=Math.max,n=Math.abs,r,i,o,s,c,l,u,d,p,m,h;function getLum(e,t,n){return .2989*e+.587*t+.114*n}function setLum(n,r,i,a){var o=a-getLum(n,r,i);p=n+o,m=r+o,h=i+o;var a=getLum(p,m,h),s=e(p,m,h),c=t(p,m,h);if(s<0){var l=a-s;p=a+(p-a)*a/l,m=a+(m-a)*a/l,h=a+(h-a)*a/l}if(c>255){var u=255-a,d=c-a;p=a+(p-a)*u/d,m=a+(m-a)*u/d,h=a+(h-a)*u/d}}function getSat(n,r,i){return t(n,r,i)-e(n,r,i)}function setSat(n,r,i,a){var o=[n,r,i],s=t(n,r,i),c=e(n,r,i),l;c=c===n?0:c===r?1:2,s=s===n?0:s===r?1:2,l=e(c,s)===0?t(c,s)===1?2:1:0,o[s]>o[c]?(o[l]=(o[l]-o[c])*a/(o[s]-o[c]),o[s]=a):o[l]=o[s]=0,o[c]=0,p=o[0],m=o[1],h=o[2]}var g={multiply:function(){p=c*r/255,m=l*i/255,h=u*o/255},screen:function(){p=c+r-c*r/255,m=l+i-l*i/255,h=u+o-u*o/255},overlay:function(){p=c<128?2*c*r/255:255-2*(255-c)*(255-r)/255,m=l<128?2*l*i/255:255-2*(255-l)*(255-i)/255,h=u<128?2*u*o/255:255-2*(255-u)*(255-o)/255},"soft-light":function(){var e=r*c/255;p=e+c*(255-(255-c)*(255-r)/255-e)/255,e=i*l/255,m=e+l*(255-(255-l)*(255-i)/255-e)/255,e=o*u/255,h=e+u*(255-(255-u)*(255-o)/255-e)/255},"hard-light":function(){p=r<128?2*r*c/255:255-2*(255-r)*(255-c)/255,m=i<128?2*i*l/255:255-2*(255-i)*(255-l)/255,h=o<128?2*o*u/255:255-2*(255-o)*(255-u)/255},"color-dodge":function(){p=c===0?0:r===255?255:e(255,255*c/(255-r)),m=l===0?0:i===255?255:e(255,255*l/(255-i)),h=u===0?0:o===255?255:e(255,255*u/(255-o))},"color-burn":function(){p=c===255?255:r===0?0:t(0,255-(255-c)*255/r),m=l===255?255:i===0?0:t(0,255-(255-l)*255/i),h=u===255?255:o===0?0:t(0,255-(255-u)*255/o)},darken:function(){p=c<r?c:r,m=l<i?l:i,h=u<o?u:o},lighten:function(){p=c>r?c:r,m=l>i?l:i,h=u>o?u:o},difference:function(){p=c-r,p<0&&(p=-p),m=l-i,m<0&&(m=-m),h=u-o,h<0&&(h=-h)},exclusion:function(){p=c+r*(255-c-c)/255,m=l+i*(255-l-l)/255,h=u+o*(255-u-u)/255},hue:function(){setSat(r,i,o,getSat(c,l,u)),setLum(p,m,h,getLum(c,l,u))},saturation:function(){setSat(c,l,u,getSat(r,i,o)),setLum(p,m,h,getLum(c,l,u))},luminosity:function(){setLum(c,l,u,getLum(r,i,o))},color:function(){setLum(r,i,o,getLum(c,l,u))},add:function(){p=e(c+r,255),m=e(l+i,255),h=e(u+o,255)},subtract:function(){p=t(c-r,0),m=t(l-i,0),h=t(u-o,0)},average:function(){p=(c+r)/2,m=(l+i)/2,h=(u+o)/2},negation:function(){p=255-n(255-r-c),m=255-n(255-i-l),h=255-n(255-o-u)}},_=this.nativeModes=a.each([`source-over`,`source-in`,`source-out`,`source-atop`,`destination-over`,`destination-in`,`destination-out`,`destination-atop`,`lighter`,`darker`,`copy`,`xor`],function(e){this[e]=!0},{}),v=q.getContext(1,1,{willReadFrequently:!0});v&&(a.each(g,function(e,t){var n=t===`darken`,r=!1;v.save();try{v.fillStyle=n?`#300`:`#a00`,v.fillRect(0,0,1,1),v.globalCompositeOperation=t,v.globalCompositeOperation===t&&(v.fillStyle=n?`#a00`:`#300`,v.fillRect(0,0,1,1),r=v.getImageData(0,0,1,1).data[0]===n?51:170)}catch{}v.restore(),_[t]=r}),q.release(v)),this.process=function(e,t,n,a,v){var y=t.canvas,b=e===`normal`;if(b||_[e])n.save(),n.setTransform(1,0,0,1,0,0),n.globalAlpha=a,b||(n.globalCompositeOperation=e),n.drawImage(y,v.x,v.y),n.restore();else{var x=g[e];if(!x)return;for(var S=n.getImageData(v.x,v.y,y.width,y.height),C=S.data,w=t.getImageData(0,0,y.width,y.height).data,T=0,E=C.length;T<E;T+=4){r=w[T],c=C[T],i=w[T+1],l=C[T+1],o=w[T+2],u=C[T+2],s=w[T+3],d=C[T+3],x();var D=s*a/255,O=1-D;C[T]=D*p+O*c,C[T+1]=D*m+O*l,C[T+2]=D*h+O*u,C[T+3]=s*a+O*d}n.putImageData(S,v.x,v.y)}}},Y=new function(){var e=`http://www.w3.org/2000/svg`,t=`http://www.w3.org/2000/xmlns`,n=`http://www.w3.org/1999/xlink`,r={href:n,xlink:t,xmlns:t+`/`,"xmlns:xlink":t+`/`};function create(t,n,r){return set(i.createElementNS(e,t),n,r)}function get(e,t){var n=r[t],i=n?e.getAttributeNS(n,t):e.getAttribute(t);return i===`null`?null:i}function set(e,t,n){for(var i in t){var a=t[i],o=r[i];typeof a==`number`&&n&&(a=n.number(a)),o?e.setAttributeNS(o,i,a):e.setAttribute(i,a)}return e}return{svg:e,xmlns:t,xlink:n,create,get,set}},X=a.each({fillColor:[`fill`,`color`],fillRule:[`fill-rule`,`string`],strokeColor:[`stroke`,`color`],strokeWidth:[`stroke-width`,`number`],strokeCap:[`stroke-linecap`,`string`],strokeJoin:[`stroke-linejoin`,`string`],strokeScaling:[`vector-effect`,`lookup`,{true:`none`,false:`non-scaling-stroke`},function(e,t){return!t&&(e instanceof F||e instanceof E||e instanceof R)}],miterLimit:[`stroke-miterlimit`,`number`],dashArray:[`stroke-dasharray`,`array`],dashOffset:[`stroke-dashoffset`,`number`],fontFamily:[`font-family`,`string`],fontWeight:[`font-weight`,`string`],fontSize:[`font-size`,`number`],justification:[`text-anchor`,`lookup`,{left:`start`,center:`middle`,right:`end`}],opacity:[`opacity`,`number`],blendMode:[`mix-blend-mode`,`style`]},function(e,t){var n=a.capitalize(t),r=e[2];this[t]={type:e[1],property:t,attribute:e[0],toSVG:r,fromSVG:r&&a.each(r,function(e,t){this[e]=t},{}),exportFilter:e[3],get:`get`+n,set:`set`+n}},{});new function(){var t;function getTransform(e,n,r){var i=new a,o=e.getTranslation();if(n){var s;e.isInvertible()?(e=e._shiftless(),s=e._inverseTransform(o),o=null):s=new m,i[r?`cx`:`x`]=s.x,i[r?`cy`:`y`]=s.y}if(!e.isIdentity()){var c=e.decompose();if(c){var l=[],u=c.rotation,p=c.scaling,h=c.skewing;o&&!o.isZero()&&l.push(`translate(`+t.point(o)+`)`),u&&l.push(`rotate(`+t.number(u)+`)`),(!d.isZero(p.x-1)||!d.isZero(p.y-1))&&l.push(`scale(`+t.point(p)+`)`),h.x&&l.push(`skewX(`+t.number(h.x)+`)`),h.y&&l.push(`skewY(`+t.number(h.y)+`)`),i.transform=l.join(` `)}else i.transform=`matrix(`+e.getValues().join(`,`)+`)`}return i}function exportGroup(e,n){for(var r=getTransform(e._matrix),i=e._children,a=Y.create(`g`,r,t),o=0,s=i.length;o<s;o++){var c=i[o],l=exportSVG(c,n);if(l)if(c.isClipMask()){var u=Y.create(`clipPath`);u.appendChild(l),setDefinition(c,u,`clip`),Y.set(a,{"clip-path":`url(#`+u.id+`)`})}else a.appendChild(l)}return a}function exportRaster(e,n){var r=getTransform(e._matrix,!0),i=e.getSize(),a=e.getImage();return r.x-=i.width/2,r.y-=i.height/2,r.width=i.width,r.height=i.height,r.href=n.embedImages==0&&a&&a.src||e.toDataURL(),Y.create(`image`,r,t)}function exportPath(e,n){var r=n.matchShapes;if(r){var i=e.toShape(!1);if(i)return exportShape(i,n)}var a=e._segments,o=a.length,s,c=getTransform(e._matrix);if(r&&o>=2&&!e.hasHandles())if(o>2){s=e._closed?`polygon`:`polyline`;for(var l=[],u=0;u<o;u++)l.push(t.point(a[u]._point));c.points=l.join(` `)}else{s=`line`;var d=a[0]._point,p=a[1]._point;c.set({x1:d.x,y1:d.y,x2:p.x,y2:p.y})}else s=`path`,c.d=e.getPathData(null,n.precision);return Y.create(s,c,t)}function exportShape(e){var n=e._type,r=e._radius,i=getTransform(e._matrix,!0,n!==`rectangle`);if(n===`rectangle`){n=`rect`;var a=e._size,o=a.width,s=a.height;i.x-=o/2,i.y-=s/2,i.width=o,i.height=s,r.isZero()&&(r=null)}return r&&(n===`circle`?i.r=r:(i.rx=r.width,i.ry=r.height)),Y.create(n,i,t)}function exportCompoundPath(e,n){var r=getTransform(e._matrix),i=e.getPathData(null,n.precision);return i&&(r.d=i),Y.create(`path`,r,t)}function exportSymbolItem(e,n){var r=getTransform(e._matrix,!0),i=e._definition,a=getDefinition(i,`symbol`),o=i._item,s=o.getStrokeBounds();return a||(a=Y.create(`symbol`,{viewBox:t.rectangle(s)}),a.appendChild(exportSVG(o,n)),setDefinition(i,a,`symbol`)),r.href=`#`+a.id,r.x+=s.x,r.y+=s.y,r.width=s.width,r.height=s.height,r.overflow=`visible`,Y.create(`use`,r,t)}function exportGradient(e){var n=getDefinition(e,`color`);if(!n){var r=e.getGradient(),i=r._radial,a=e.getOrigin(),o=e.getDestination(),s;if(i){s={cx:a.x,cy:a.y,r:a.getDistance(o)};var c=e.getHighlight();c&&(s.fx=c.x,s.fy=c.y)}else s={x1:a.x,y1:a.y,x2:o.x,y2:o.y};s.gradientUnits=`userSpaceOnUse`,n=Y.create((i?`radial`:`linear`)+`Gradient`,s,t);for(var l=r._stops,u=0,d=l.length;u<d;u++){var p=l[u],m=p._color,h=m.getAlpha();s={offset:p._offset??u/(d-1)},m&&(s[`stop-color`]=m.toCSS(!0)),h<1&&(s[`stop-opacity`]=h),n.appendChild(Y.create(`stop`,s,t))}setDefinition(e,n,`color`)}return`url(#`+n.id+`)`}function exportText(e){var n=Y.create(`text`,getTransform(e._matrix,!0),t);return n.textContent=e._content,n}var n={Group:exportGroup,Layer:exportGroup,Raster:exportRaster,Path:exportPath,Shape:exportShape,CompoundPath:exportCompoundPath,SymbolItem:exportSymbolItem,PointText:exportText};function applyStyle(e,n,r,i){var o={},s=!i&&e.getParent(),c=[];return e._name!=null&&(o.id=e._name),a.each(X,function(t){var n=t.get,i=t.type,l=e[n]();if(t.exportFilter?t.exportFilter(e,l):r.reduceAttributes==0||!s||!a.equals(s[n](),l)){if(i===`color`&&l!=null){var u=l.getAlpha();u<1&&(o[t.attribute+`-opacity`]=u)}i===`style`?c.push(t.attribute+`: `+l):o[t.attribute]=l==null?`none`:i===`color`?l.gradient?exportGradient(l,e):l.toCSS(!0):i===`array`?l.join(`,`):i===`lookup`?t.toSVG[l]:l}}),c.length&&(o.style=c.join(`;`)),o.opacity===1&&delete o.opacity,e._visible||(o.visibility=`hidden`),Y.set(n,o,t)}var r;function getDefinition(e,t){return r||={ids:{},svgs:{}},e&&r.svgs[t+`-`+(e._id||e.__id||(e.__id=p.get(`svg`)))]}function setDefinition(e,t,n){r||getDefinition();var i=r.ids[n]=(r.ids[n]||0)+1;t.id=n+`-`+i,r.svgs[n+`-`+(e._id||e.__id)]=t}function exportDefinitions(t,n){var i=t,a=null;if(r){for(var o in i=t.nodeName.toLowerCase()===`svg`&&t,r.svgs)a||=(i||(i=Y.create(`svg`),i.appendChild(t)),i.insertBefore(Y.create(`defs`),i.firstChild)),a.appendChild(r.svgs[o]);r=null}return n.asString?new e.XMLSerializer().serializeToString(i):i}function exportSVG(e,t,r){var i=n[e._class],a=i&&i(e,t);if(a){var o=t.onExport;o&&(a=o(e,a,t)||a);var s=JSON.stringify(e._data);s&&s!==`{}`&&s!==`null`&&a.setAttribute(`data-paper-data`,s)}return a&&applyStyle(e,a,t,r)}function setOptions(e){return e||={},t=new u(e.precision),e}C.inject({exportSVG:function(e){return e=setOptions(e),exportDefinitions(exportSVG(this,e,!0),e)}}),S.inject({exportSVG:function(e){e=setOptions(e);var n=this._children,r=this.getView(),i=a.pick(e.bounds,`view`),o=e.matrix||i===`view`&&r._matrix,s=o&&b.read([o]),c=i===`view`?new v([0,0],r.getViewSize()):i===`content`?C._getBounds(n,s,{stroke:!0}).rect:v.read([i],0,{readNull:!0}),l={version:`1.1`,xmlns:Y.svg,"xmlns:xlink":Y.xlink};c&&(l.width=c.width,l.height=c.height,(c.x||c.x===0||c.y||c.y===0)&&(l.viewBox=t.rectangle(c)));var u=Y.create(`svg`,l,t),d=u;s&&!s.isIdentity()&&(d=u.appendChild(Y.create(`g`,getTransform(s),t)));for(var p=0,m=n.length;p<m;p++)d.appendChild(exportSVG(n[p],e,!0));return exportDefinitions(u,e)}})},new function(){var t={},o;function getValue(e,t,n,r,i,a){var s=Y.get(e,t)||a,c=s==null?r?null:n?``:0:n?s:parseFloat(s);return/%\s*$/.test(s)?c/100*(i?1:o[/x|^width/.test(t)?`width`:`height`]):c}function getPoint(e,t,n,r,i,a,o){return t=getValue(e,t||`x`,!1,r,i,a),n=getValue(e,n||`y`,!1,r,i,o),r&&(t==null||n==null)?null:new m(t,n)}function getSize(e,t,n,r,i){return t=getValue(e,t||`width`,!1,r,i),n=getValue(e,n||`height`,!1,r,i),r&&(t==null||n==null)?null:new g(t,n)}function convertValue(e,t,n){return e===`none`?null:t===`number`?parseFloat(e):t===`array`?e?e.split(/[\s,]+/g).map(parseFloat):[]:t===`color`?getDefinition(e)||e:t===`lookup`?n[e]:e}function importGroup(e,t,n,r){var i=e.childNodes,a=t===`clippath`,o=t===`defs`,s=new w,c=s._project,l=c._currentStyle,u=[];if(!a&&!o&&(s=applyAttributes(s,e,r),c._currentStyle=s._style.clone()),r)for(var d=e.querySelectorAll(`defs`),p=0,m=d.length;p<m;p++)importNode(d[p],n,!1);for(var p=0,m=i.length;p<m;p++){var h=i[p],g;h.nodeType===1&&!/^defs$/i.test(h.nodeName)&&(g=importNode(h,n,!1))&&!(g instanceof k)&&u.push(g)}return s.addChildren(u),a&&(s=applyAttributes(s.reduce(),e,r)),c._currentStyle=l,(a||o)&&(s.remove(),s=null),s}function importPoly(e,t){for(var n=e.getAttribute(`points`).match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g),r=[],i=0,a=n.length;i<a;i+=2)r.push(new m(parseFloat(n[i]),parseFloat(n[i+1])));var o=new I(r);return t===`polygon`&&o.closePath(),o}function importPath(e){return F.create(e.getAttribute(`d`))}function importGradient(e,n){var r=(getValue(e,`href`,!0)||``).substring(1),i=n===`radialgradient`,a;if(r)a=t[r].getGradient(),a._radial^i&&(a=a.clone(),a._radial=i);else{for(var o=e.childNodes,s=[],c=0,l=o.length;c<l;c++){var u=o[c];u.nodeType===1&&s.push(applyAttributes(new re,u))}a=new B(s,i)}var d,p,m,h=getValue(e,`gradientUnits`,!0)!==`userSpaceOnUse`;i?(d=getPoint(e,`cx`,`cy`,!1,h,`50%`,`50%`),p=d.add(getValue(e,`r`,!1,!1,h,`50%`),0),m=getPoint(e,`fx`,`fy`,!0,h)):(d=getPoint(e,`x1`,`y1`,!1,h,`0%`,`0%`),p=getPoint(e,`x2`,`y2`,!1,h,`100%`,`0%`));var g=applyAttributes(new z(a,d,p,m),e);return g._scaleToBounds=h,null}var s={"#document":function(e,t,n,r){for(var i=e.childNodes,a=0,o=i.length;a<o;a++){var s=i[a];if(s.nodeType===1)return importNode(s,n,r)}},g:importGroup,svg:importGroup,clippath:importGroup,polygon:importPoly,polyline:importPoly,path:importPath,lineargradient:importGradient,radialgradient:importGradient,image:function(e){var t=new D(getValue(e,`href`,!0));return t.on(`load`,function(){var t=getSize(e);this.setSize(t);var n=getPoint(e).add(t.divide(2));this._matrix.append(new b().translate(n))}),t},symbol:function(e,t,n,r){return new k(importGroup(e,t,n,r),!0)},defs:importGroup,use:function(e){var n=(getValue(e,`href`,!0)||``).substring(1),r=t[n],i=getPoint(e);return r?r instanceof k?r.place(i):r.clone().translate(i):null},circle:function(e){return new E.Circle(getPoint(e,`cx`,`cy`),getValue(e,`r`))},ellipse:function(e){return new E.Ellipse({center:getPoint(e,`cx`,`cy`),radius:getSize(e,`rx`,`ry`)})},rect:function(e){return new E.Rectangle(new v(getPoint(e),getSize(e)),getSize(e,`rx`,`ry`))},line:function(e){return new I.Line(getPoint(e,`x1`,`y1`),getPoint(e,`x2`,`y2`))},text:function(e){var t=new ne(getPoint(e).add(getPoint(e,`dx`,`dy`)));return t.setContent(e.textContent.trim()||``),t},switch:importGroup};function applyTransform(e,t,n,r){if(e.transform){for(var i=(r.getAttribute(n)||``).split(/\)\s*/g),a=new b,o=0,s=i.length;o<s;o++){var c=i[o];if(!c)break;for(var l=c.split(/\(\s*/),u=l[0].trim(),d=l[1].split(/[\s,]+/g),p=0,m=d.length;p<m;p++)d[p]=parseFloat(d[p]);switch(u){case`matrix`:a.append(new b(d[0],d[1],d[2],d[3],d[4],d[5]));break;case`rotate`:a.rotate(d[0],d[1]||0,d[2]||0);break;case`translate`:a.translate(d[0],d[1]||0);break;case`scale`:a.scale(d);break;case`skewX`:a.skew(d[0],0);break;case`skewY`:a.skew(0,d[0]);break}}e.transform(a)}}function applyOpacity(e,t,n){var r=n===`fill-opacity`?`getFillColor`:`getStrokeColor`,i=e[r]&&e[r]();i&&i.setAlpha(parseFloat(t))}var c=a.set(a.each(X,function(e){this[e.attribute]=function(t,n){if(t[e.set]&&(t[e.set](convertValue(n,e.type,e.fromSVG)),e.type===`color`)){var r=t[e.get]();if(r&&r._scaleToBounds){var i=t.getBounds();r.transform(new b().translate(i.getPoint()).scale(i.getSize()))}}}},{}),{id:function(e,n){t[n]=e,e.setName&&e.setName(n)},"clip-path":function(e,t){var n=getDefinition(t);if(n)if(n=n.clone(),n.setClipMask(!0),e instanceof w)e.insertChild(0,n);else return new w(n,e)},gradientTransform:applyTransform,transform:applyTransform,"fill-opacity":applyOpacity,"stroke-opacity":applyOpacity,visibility:function(e,t){e.setVisible&&e.setVisible(t===`visible`)},display:function(e,t){e.setVisible&&e.setVisible(t!==null)},"stop-color":function(e,t){e.setColor&&e.setColor(t)},"stop-opacity":function(e,t){e._color&&e._color.setAlpha(parseFloat(t))},offset:function(e,t){if(e.setOffset){var n=t.match(/(.*)%$/);e.setOffset(n?n[1]/100:parseFloat(t))}},viewBox:function(e,t,n,r,i){var a=new v(convertValue(t,`array`)),o=getSize(r,null,null,!0),s,c;if(e instanceof w){var l=o?o.divide(a.getSize()):1,c=new b().scale(l).translate(a.getPoint().negate());s=e}else e instanceof k&&(o&&a.setSize(o),s=e._item);if(s){if(getAttribute(r,`overflow`,i)!==`visible`){var u=new E.Rectangle(a);u.setClipMask(!0),s.addChild(u)}c&&s.transform(c)}}});function getAttribute(e,t,r){var i=e.attributes[t],o=i&&i.value;if(!o&&e.style){var s=a.camelize(t);o=e.style[s],!o&&r.node[s]!==r.parent[s]&&(o=r.node[s])}return o?o===`none`?null:o:n}function applyAttributes(e,t,r){var i=t.parentNode,o={node:V.getStyles(t)||{},parent:!r&&!/^defs$/i.test(i.tagName)&&V.getStyles(i)||{}};return a.each(c,function(r,i){var a=getAttribute(t,i,o);e=a!==n&&r(e,a,i,t,o)||e}),e}function getDefinition(e){var n=e&&e.match(/\((?:["'#]*)([^"')]+)/),i=n&&n[1],a=i&&t[r?i.replace(r.location.href.split(`#`)[0]+`#`,``):i];return a&&a._scaleToBounds&&(a=a.clone(),a._scaleToBounds=!0),a}function importNode(e,n,r){var c=e.nodeName.toLowerCase(),l=c!==`#document`,u=i.body,d,p,m;r&&l&&(o=Z.getView().getSize(),o=getSize(e,null,null,!0)||o,d=Y.create(`svg`,{style:`stroke-width: 1px; stroke-miterlimit: 10`}),p=e.parentNode,m=e.nextSibling,d.appendChild(e),u.appendChild(d));var h=Z.settings,g=h.applyMatrix,_=h.insertItems;h.applyMatrix=!1,h.insertItems=!1;var v=s[c],y=v&&v(e,c,n,r)||null;if(h.insertItems=_,h.applyMatrix=g,y){l&&!(y instanceof w)&&(y=applyAttributes(y,e,r));var b=n.onImport,x=l&&e.getAttribute(`data-paper-data`);b&&(y=b(e,y,n)||y),n.expandShapes&&y instanceof E&&(y.remove(),y=y.toPath()),x&&(y._data=JSON.parse(x))}return d&&(u.removeChild(d),p&&(m?p.insertBefore(e,m):p.appendChild(e))),r&&(t={},y&&a.pick(n.applyMatrix,g)&&y.matrix.apply(!0,!0)),y}function importSVG(t,r,a){if(!t)return null;r=typeof r==`function`?{onLoad:r}:r||{};var o=Z,s=null;function onLoad(i){try{var c=typeof i==`object`?i:new e.DOMParser().parseFromString(i.trim(),`image/svg+xml`);if(!c.nodeName)throw c=null,Error(`Unsupported SVG source: `+t);Z=o,s=importNode(c,r,!0),(!r||r.insert!==!1)&&a._insertItem(n,s);var l=r.onLoad;l&&l(s,i)}catch(e){onError(e)}}function onError(e,t){var n=r.onError;if(n)n(e,t);else throw Error(e)}if(typeof t==`string`&&!/^[\s\S]*</.test(t)){var c=i.getElementById(t);c?onLoad(c):fe.request({url:t,async:!0,onLoad,onError})}else if(typeof File<`u`&&t instanceof File){var l=new FileReader;return l.onload=function(){onLoad(l.result)},l.onerror=function(){onError(l.error)},l.readAsText(t)}else onLoad(t);return s}C.inject({importSVG:function(e,t){return importSVG(e,t,this)}}),S.inject({importSVG:function(e,t){return this.activate(),importSVG(e,t,this)}})},a.exports.PaperScript=function(){var t=this,n=t.acorn;if(!n&&typeof require<`u`)try{n=se()}catch{}if(!n){var o,c;n=o=c={},(function(e,t){if(typeof o==`object`&&typeof c==`object`)return t(o);if(typeof define==`function`&&define.amd)return define([`exports`],t);t(e.acorn||={})})(this,function(e){"use strict";e.version=`0.5.0`;var t,n,r,i;e.parse=function(e,i){return n=String(e),r=n.length,setOptions(i),initTokenState(),parseTopLevel(t.program)};var a=e.defaultOptions={ecmaVersion:5,strictSemicolons:!1,allowTrailingCommas:!0,forbidReserved:!1,allowReturnOutsideFunction:!1,locations:!1,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null};function setOptions(e){for(var n in t=e||{},a)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=a[n]);i=t.sourceFile||null}var o=e.getLineInfo=function(e,t){for(var n=1,r=0;;){Ve.lastIndex=r;var i=Ve.exec(e);if(i&&i.index<t)++n,r=i.index+i[0].length;else break}return{line:n,column:t-r}};e.tokenize=function(e,i){n=String(e),r=n.length,setOptions(i),initTokenState();var a={};function getToken(e){return y=l,readToken(e),a.start=c,a.end=l,a.startLoc=u,a.endLoc=d,a.type=p,a.value=m,a}return getToken.jumpTo=function(e,r){if(s=e,t.locations){g=1,_=Ve.lastIndex=0;for(var i;(i=Ve.exec(n))&&i.index<e;)++g,_=i.index+i[0].length}h=r,skipSpace()},getToken};var s,c,l,u,d,p,m,h,g,_,v,y,b,x,S,C;function raise(e,t){var r=o(n,e);t+=` (`+r.line+`:`+r.column+`)`;var i=SyntaxError(t);throw i.pos=e,i.loc=r,i.raisedAt=s,i}var w=[],T={type:`num`},E={type:`regexp`},D={type:`string`},O={type:`name`},k={type:`eof`},A={keyword:`break`},j={keyword:`case`,beforeExpr:!0},M={keyword:`catch`},N={keyword:`continue`},P={keyword:`debugger`},F={keyword:`default`},I={keyword:`do`,isLoop:!0},L={keyword:`else`,beforeExpr:!0},ee={keyword:`finally`},te={keyword:`for`,isLoop:!0},R={keyword:`function`},ne={keyword:`if`},z={keyword:`return`,beforeExpr:!0},B={keyword:`switch`},re={keyword:`throw`,beforeExpr:!0},ie={keyword:`try`},V={keyword:`var`},H={keyword:`while`,isLoop:!0},U={keyword:`with`},W={keyword:`new`,beforeExpr:!0},G={keyword:`this`},ae={keyword:`null`,atomValue:null},oe={keyword:`true`,atomValue:!0},K={keyword:`false`,atomValue:!1},se={keyword:`in`,binop:7,beforeExpr:!0},ce={break:A,case:j,catch:M,continue:N,debugger:P,default:F,do:I,else:L,finally:ee,for:te,function:R,if:ne,return:z,switch:B,throw:re,try:ie,var:V,while:H,with:U,null:ae,true:oe,false:K,new:W,in:se,instanceof:{keyword:`instanceof`,binop:7,beforeExpr:!0},this:G,typeof:{keyword:`typeof`,prefix:!0,beforeExpr:!0},void:{keyword:`void`,prefix:!0,beforeExpr:!0},delete:{keyword:`delete`,prefix:!0,beforeExpr:!0}},le={type:`[`,beforeExpr:!0},ue={type:`]`},de={type:`{`,beforeExpr:!0},fe={type:`}`},q={type:`(`,beforeExpr:!0},J={type:`)`},Y={type:`,`,beforeExpr:!0},X={type:`;`,beforeExpr:!0},Z={type:`:`,beforeExpr:!0},pe={type:`.`},me={type:`?`,beforeExpr:!0},he={binop:10,beforeExpr:!0},ge={isAssign:!0,beforeExpr:!0},_e={isAssign:!0,beforeExpr:!0},ve={postfix:!0,prefix:!0,isUpdate:!0},ye={prefix:!0,beforeExpr:!0},be={binop:1,beforeExpr:!0},xe={binop:2,beforeExpr:!0},Se={binop:3,beforeExpr:!0},Ce={binop:4,beforeExpr:!0},we={binop:5,beforeExpr:!0},Te={binop:6,beforeExpr:!0},Ee={binop:7,beforeExpr:!0},De={binop:8,beforeExpr:!0},Oe={binop:9,prefix:!0,beforeExpr:!0},ke={binop:10,beforeExpr:!0};for(var Ae in e.tokTypes={bracketL:le,bracketR:ue,braceL:de,braceR:fe,parenL:q,parenR:J,comma:Y,semi:X,colon:Z,dot:pe,question:me,slash:he,eq:ge,name:O,eof:k,num:T,regexp:E,string:D},ce)e.tokTypes[`_`+Ae]=ce[Ae];function makePredicate(e){e=e.split(` `);var t=``,n=[];out:for(var r=0;r<e.length;++r){for(var i=0;i<n.length;++i)if(n[i][0].length==e[r].length){n[i].push(e[r]);continue out}n.push([e[r]])}function compareTo(e){if(e.length==1)return t+=`return str === `+JSON.stringify(e[0])+`;`;t+=`switch(str){`;for(var n=0;n<e.length;++n)t+=`case `+JSON.stringify(e[n])+`:`;t+=`return true}return false;`}if(n.length>3){n.sort(function(e,t){return t.length-e.length}),t+=`switch(str.length){`;for(var r=0;r<n.length;++r){var a=n[r];t+=`case `+a[0].length+`:`,compareTo(a)}t+=`}`}else compareTo(e);return Function(`str`,t)}var je=makePredicate(`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`),Me=makePredicate(`class enum extends super const export import`),Ne=makePredicate(`implements interface let package private protected public static yield`),Pe=makePredicate(`eval arguments`),Fe=makePredicate(`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`),Ie=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Le=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,Re=`̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_`,ze=RegExp(`[`+Le+`]`),Be=RegExp(`[`+Le+Re+`]`),Q=/[\n\r\u2028\u2029]/,Ve=/\r\n|[\n\r\u2028\u2029]/g,He=e.isIdentifierStart=function(e){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e>=170&&ze.test(String.fromCharCode(e))},Ue=e.isIdentifierChar=function(e){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e>=170&&Be.test(String.fromCharCode(e))};function line_loc_t(){this.line=g,this.column=s-_}function initTokenState(){g=1,s=_=0,h=!0,skipSpace()}function finishToken(e,n){l=s,t.locations&&(d=new line_loc_t),p=e,skipSpace(),m=n,h=e.beforeExpr}function skipBlockComment(){var e=t.onComment&&t.locations&&new line_loc_t,r=s,i=n.indexOf(`*/`,s+=2);if(i===-1&&raise(s-2,`Unterminated comment`),s=i+2,t.locations){Ve.lastIndex=r;for(var a;(a=Ve.exec(n))&&a.index<s;)++g,_=a.index+a[0].length}t.onComment&&t.onComment(!0,n.slice(r+2,i),r,s,e,t.locations&&new line_loc_t)}function skipLineComment(){for(var e=s,i=t.onComment&&t.locations&&new line_loc_t,a=n.charCodeAt(s+=2);s<r&&a!==10&&a!==13&&a!==8232&&a!==8233;)++s,a=n.charCodeAt(s);t.onComment&&t.onComment(!1,n.slice(e+2,s),e,s,i,t.locations&&new line_loc_t)}function skipSpace(){for(;s<r;){var e=n.charCodeAt(s);if(e===32)++s;else if(e===13){++s;var i=n.charCodeAt(s);i===10&&++s,t.locations&&(++g,_=s)}else if(e===10||e===8232||e===8233)++s,t.locations&&(++g,_=s);else if(e>8&&e<14)++s;else if(e===47){var i=n.charCodeAt(s+1);if(i===42)skipBlockComment();else if(i===47)skipLineComment();else break}else if(e===160)++s;else if(e>=5760&&Ie.test(String.fromCharCode(e)))++s;else break}}function readToken_dot(){var e=n.charCodeAt(s+1);return e>=48&&e<=57?readNumber(!0):(++s,finishToken(pe))}function readToken_slash(){var e=n.charCodeAt(s+1);return h?(++s,readRegexp()):e===61?finishOp(_e,2):finishOp(he,1)}function readToken_mult_modulo(){return n.charCodeAt(s+1)===61?finishOp(_e,2):finishOp(ke,1)}function readToken_pipe_amp(e){var t=n.charCodeAt(s+1);return t===e?finishOp(e===124?be:xe,2):t===61?finishOp(_e,2):finishOp(e===124?Se:we,1)}function readToken_caret(){return n.charCodeAt(s+1)===61?finishOp(_e,2):finishOp(Ce,1)}function readToken_plus_min(e){var t=n.charCodeAt(s+1);return t===e?t==45&&n.charCodeAt(s+2)==62&&Q.test(n.slice(y,s))?(s+=3,skipLineComment(),skipSpace(),readToken()):finishOp(ve,2):t===61?finishOp(_e,2):finishOp(Oe,1)}function readToken_lt_gt(e){var t=n.charCodeAt(s+1),r=1;return t===e?(r=e===62&&n.charCodeAt(s+2)===62?3:2,n.charCodeAt(s+r)===61?finishOp(_e,r+1):finishOp(De,r)):t==33&&e==60&&n.charCodeAt(s+2)==45&&n.charCodeAt(s+3)==45?(s+=4,skipLineComment(),skipSpace(),readToken()):(t===61&&(r=n.charCodeAt(s+2)===61?3:2),finishOp(Ee,r))}function readToken_eq_excl(e){return n.charCodeAt(s+1)===61?finishOp(Te,n.charCodeAt(s+2)===61?3:2):finishOp(e===61?ge:ye,1)}function getTokenFromCode(e){switch(e){case 46:return readToken_dot();case 40:return++s,finishToken(q);case 41:return++s,finishToken(J);case 59:return++s,finishToken(X);case 44:return++s,finishToken(Y);case 91:return++s,finishToken(le);case 93:return++s,finishToken(ue);case 123:return++s,finishToken(de);case 125:return++s,finishToken(fe);case 58:return++s,finishToken(Z);case 63:return++s,finishToken(me);case 48:var t=n.charCodeAt(s+1);if(t===120||t===88)return readHexNumber();case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return readNumber(!1);case 34:case 39:return readString(e);case 47:return readToken_slash(e);case 37:case 42:return readToken_mult_modulo();case 124:case 38:return readToken_pipe_amp(e);case 94:return readToken_caret();case 43:case 45:return readToken_plus_min(e);case 60:case 62:return readToken_lt_gt(e);case 61:case 33:return readToken_eq_excl(e);case 126:return finishOp(ye,1)}return!1}function readToken(e){if(e?s=c+1:c=s,t.locations&&(u=new line_loc_t),e)return readRegexp();if(s>=r)return finishToken(k);var i=n.charCodeAt(s);if(He(i)||i===92)return readWord();var a=getTokenFromCode(i);if(a===!1){var o=String.fromCharCode(i);if(o===`\\`||ze.test(o))return readWord();raise(s,`Unexpected character '`+o+`'`)}return a}function finishOp(e,t){var r=n.slice(s,s+t);s+=t,finishToken(e,r)}function readRegexp(){for(var e=``,t,i,a=s;;){s>=r&&raise(a,`Unterminated regular expression`);var o=n.charAt(s);if(Q.test(o)&&raise(a,`Unterminated regular expression`),t)t=!1;else{if(o===`[`)i=!0;else if(o===`]`&&i)i=!1;else if(o===`/`&&!i)break;t=o===`\\`}++s}var e=n.slice(a,s);++s;var c=readWord1();c&&!/^[gmsiy]*$/.test(c)&&raise(a,`Invalid regexp flag`);try{var l=new RegExp(e,c)}catch(e){e instanceof SyntaxError&&raise(a,e.message),raise(e)}return finishToken(E,l)}function readInt(e,t){for(var r=s,i=0,a=0,o=t??1/0;a<o;++a){var c=n.charCodeAt(s),l=c>=97?c-97+10:c>=65?c-65+10:c>=48&&c<=57?c-48:1/0;if(l>=e)break;++s,i=i*e+l}return s===r||t!=null&&s-r!==t?null:i}function readHexNumber(){s+=2;var e=readInt(16);return e??raise(c+2,`Expected hexadecimal number`),He(n.charCodeAt(s))&&raise(s,`Identifier directly after number`),finishToken(T,e)}function readNumber(e){var t=s,r=!1,i=n.charCodeAt(s)===48;!e&&readInt(10)===null&&raise(t,`Invalid number`),n.charCodeAt(s)===46&&(++s,readInt(10),r=!0);var a=n.charCodeAt(s);(a===69||a===101)&&(a=n.charCodeAt(++s),(a===43||a===45)&&++s,readInt(10)===null&&raise(t,`Invalid number`),r=!0),He(n.charCodeAt(s))&&raise(s,`Identifier directly after number`);var o=n.slice(t,s),c;return r?c=parseFloat(o):!i||o.length===1?c=parseInt(o,10):/[89]/.test(o)||C?raise(t,`Invalid number`):c=parseInt(o,8),finishToken(T,c)}function readString(e){s++;for(var i=``;;){s>=r&&raise(c,`Unterminated string constant`);var a=n.charCodeAt(s);if(a===e)return++s,finishToken(D,i);if(a===92){a=n.charCodeAt(++s);var o=/^[0-7]+/.exec(n.slice(s,s+3));for(o&&=o[0];o&&parseInt(o,8)>255;)o=o.slice(0,-1);if(o===`0`&&(o=null),++s,o)C&&raise(s-2,`Octal literal in strict mode`),i+=String.fromCharCode(parseInt(o,8)),s+=o.length-1;else switch(a){case 110:i+=`
|
|
14
|
+
`;break;case 114:i+=`\r`;break;case 120:i+=String.fromCharCode(readHexChar(2));break;case 117:i+=String.fromCharCode(readHexChar(4));break;case 85:i+=String.fromCharCode(readHexChar(8));break;case 116:i+=` `;break;case 98:i+=`\b`;break;case 118:i+=`\v`;break;case 102:i+=`\f`;break;case 48:i+=`\0`;break;case 13:n.charCodeAt(s)===10&&++s;case 10:t.locations&&(_=s,++g);break;default:i+=String.fromCharCode(a);break}}else (a===13||a===10||a===8232||a===8233)&&raise(c,`Unterminated string constant`),i+=String.fromCharCode(a),++s}}function readHexChar(e){var t=readInt(16,e);return t===null&&raise(c,`Bad character escape sequence`),t}var We;function readWord1(){We=!1;for(var e,t=!0,r=s;;){var i=n.charCodeAt(s);if(Ue(i))We&&(e+=n.charAt(s)),++s;else if(i===92){We||(e=n.slice(r,s)),We=!0,n.charCodeAt(++s)!=117&&raise(s,`Expecting Unicode escape sequence \\uXXXX`),++s;var a=readHexChar(4),o=String.fromCharCode(a);o||raise(s-1,`Invalid Unicode escape`),(t?He(a):Ue(a))||raise(s-4,`Invalid Unicode escape`),e+=o}else break;t=!1}return We?e:n.slice(r,s)}function readWord(){var e=readWord1(),t=O;return!We&&Fe(e)&&(t=ce[e]),finishToken(t,e)}function next(){v=c,y=l,b=d,readToken()}function setStrict(e){if(C=e,s=c,t.locations)for(;s<_;)_=n.lastIndexOf(`
|
|
15
|
+
`,_-2)+1,--g;skipSpace(),readToken()}function node_t(){this.type=null,this.start=c,this.end=null}function node_loc_t(){this.start=u,this.end=null,i!==null&&(this.source=i)}function startNode(){var e=new node_t;return t.locations&&(e.loc=new node_loc_t),t.directSourceFile&&(e.sourceFile=t.directSourceFile),t.ranges&&(e.range=[c,0]),e}function startNodeFrom(e){var n=new node_t;return n.start=e.start,t.locations&&(n.loc=new node_loc_t,n.loc.start=e.loc.start),t.ranges&&(n.range=[e.range[0],0]),n}function finishNode(e,n){return e.type=n,e.end=y,t.locations&&(e.loc.end=b),t.ranges&&(e.range[1]=y),e}function isUseStrict(e){return t.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&e.expression.value===`use strict`}function eat(e){if(p===e)return next(),!0}function canInsertSemicolon(){return!t.strictSemicolons&&(p===k||p===fe||Q.test(n.slice(y,c)))}function semicolon(){!eat(X)&&!canInsertSemicolon()&&unexpected()}function expect(e){p===e?next():unexpected()}function unexpected(){raise(c,`Unexpected token`)}function checkLVal(e){e.type!==`Identifier`&&e.type!==`MemberExpression`&&raise(e.start,`Assigning to rvalue`),C&&e.type===`Identifier`&&Pe(e.name)&&raise(e.start,`Assigning to `+e.name+` in strict mode`)}function parseTopLevel(e){v=y=s,t.locations&&(b=new line_loc_t),x=C=null,S=[],readToken();var n=e||startNode(),r=!0;for(e||(n.body=[]);p!==k;){var i=parseStatement();n.body.push(i),r&&isUseStrict(i)&&setStrict(!0),r=!1}return finishNode(n,`Program`)}var Ge={kind:`loop`},Ke={kind:`switch`};function parseStatement(){(p===he||p===_e&&m==`/=`)&&readToken(!0);var e=p,r=startNode();switch(e){case A:case N:next();var i=e===A;eat(X)||canInsertSemicolon()?r.label=null:p===O?(r.label=parseIdent(),semicolon()):unexpected();for(var a=0;a<S.length;++a){var o=S[a];if((r.label==null||o.name===r.label.name)&&(o.kind!=null&&(i||o.kind===`loop`)||r.label&&i))break}return a===S.length&&raise(r.start,`Unsyntactic `+e.keyword),finishNode(r,i?`BreakStatement`:`ContinueStatement`);case P:return next(),semicolon(),finishNode(r,`DebuggerStatement`);case I:return next(),S.push(Ge),r.body=parseStatement(),S.pop(),expect(H),r.test=parseParenExpression(),semicolon(),finishNode(r,`DoWhileStatement`);case te:if(next(),S.push(Ge),expect(q),p===X)return parseFor(r,null);if(p===V){var s=startNode();return next(),parseVar(s,!0),finishNode(s,`VariableDeclaration`),s.declarations.length===1&&eat(se)?parseForIn(r,s):parseFor(r,s)}var s=parseExpression(!1,!0);return eat(se)?(checkLVal(s),parseForIn(r,s)):parseFor(r,s);case R:return next(),parseFunction(r,!0);case ne:return next(),r.test=parseParenExpression(),r.consequent=parseStatement(),r.alternate=eat(L)?parseStatement():null,finishNode(r,`IfStatement`);case z:return!x&&!t.allowReturnOutsideFunction&&raise(c,`'return' outside of function`),next(),eat(X)||canInsertSemicolon()?r.argument=null:(r.argument=parseExpression(),semicolon()),finishNode(r,`ReturnStatement`);case B:next(),r.discriminant=parseParenExpression(),r.cases=[],expect(de),S.push(Ke);for(var l,u;p!=fe;)if(p===j||p===F){var d=p===j;l&&finishNode(l,`SwitchCase`),r.cases.push(l=startNode()),l.consequent=[],next(),d?l.test=parseExpression():(u&&raise(v,`Multiple default clauses`),u=!0,l.test=null),expect(Z)}else l||unexpected(),l.consequent.push(parseStatement());return l&&finishNode(l,`SwitchCase`),next(),S.pop(),finishNode(r,`SwitchStatement`);case re:return next(),Q.test(n.slice(y,c))&&raise(y,`Illegal newline after throw`),r.argument=parseExpression(),semicolon(),finishNode(r,`ThrowStatement`);case ie:if(next(),r.block=parseBlock(),r.handler=null,p===M){var h=startNode();next(),expect(q),h.param=parseIdent(),C&&Pe(h.param.name)&&raise(h.param.start,`Binding `+h.param.name+` in strict mode`),expect(J),h.guard=null,h.body=parseBlock(),r.handler=finishNode(h,`CatchClause`)}return r.guardedHandlers=w,r.finalizer=eat(ee)?parseBlock():null,!r.handler&&!r.finalizer&&raise(r.start,`Missing catch or finally clause`),finishNode(r,`TryStatement`);case V:return next(),parseVar(r),semicolon(),finishNode(r,`VariableDeclaration`);case H:return next(),r.test=parseParenExpression(),S.push(Ge),r.body=parseStatement(),S.pop(),finishNode(r,`WhileStatement`);case U:return C&&raise(c,`'with' in strict mode`),next(),r.object=parseParenExpression(),r.body=parseStatement(),finishNode(r,`WithStatement`);case de:return parseBlock();case X:return next(),finishNode(r,`EmptyStatement`);default:var g=m,_=parseExpression();if(e===O&&_.type===`Identifier`&&eat(Z)){for(var a=0;a<S.length;++a)S[a].name===g&&raise(_.start,`Label '`+g+`' is already declared`);var b=p.isLoop?`loop`:p===B?`switch`:null;return S.push({name:g,kind:b}),r.body=parseStatement(),S.pop(),r.label=_,finishNode(r,`LabeledStatement`)}else return r.expression=_,semicolon(),finishNode(r,`ExpressionStatement`)}}function parseParenExpression(){expect(q);var e=parseExpression();return expect(J),e}function parseBlock(e){var t=startNode(),n=!0,r=!1,i;for(t.body=[],expect(de);!eat(fe);){var a=parseStatement();t.body.push(a),n&&e&&isUseStrict(a)&&(i=r,setStrict(r=!0)),n=!1}return r&&!i&&setStrict(!1),finishNode(t,`BlockStatement`)}function parseFor(e,t){return e.init=t,expect(X),e.test=p===X?null:parseExpression(),expect(X),e.update=p===J?null:parseExpression(),expect(J),e.body=parseStatement(),S.pop(),finishNode(e,`ForStatement`)}function parseForIn(e,t){return e.left=t,e.right=parseExpression(),expect(J),e.body=parseStatement(),S.pop(),finishNode(e,`ForInStatement`)}function parseVar(e,t){for(e.declarations=[],e.kind=`var`;;){var n=startNode();if(n.id=parseIdent(),C&&Pe(n.id.name)&&raise(n.id.start,`Binding `+n.id.name+` in strict mode`),n.init=eat(ge)?parseExpression(!0,t):null,e.declarations.push(finishNode(n,`VariableDeclarator`)),!eat(Y))break}return e}function parseExpression(e,t){var n=parseMaybeAssign(t);if(!e&&p===Y){var r=startNodeFrom(n);for(r.expressions=[n];eat(Y);)r.expressions.push(parseMaybeAssign(t));return finishNode(r,`SequenceExpression`)}return n}function parseMaybeAssign(e){var t=parseMaybeConditional(e);if(p.isAssign){var n=startNodeFrom(t);return n.operator=m,n.left=t,next(),n.right=parseMaybeAssign(e),checkLVal(t),finishNode(n,`AssignmentExpression`)}return t}function parseMaybeConditional(e){var t=parseExprOps(e);if(eat(me)){var n=startNodeFrom(t);return n.test=t,n.consequent=parseExpression(!0),expect(Z),n.alternate=parseExpression(!0,e),finishNode(n,`ConditionalExpression`)}return t}function parseExprOps(e){return parseExprOp(parseMaybeUnary(),-1,e)}function parseExprOp(e,t,n){var r=p.binop;if(r!=null&&(!n||p!==se)&&r>t){var i=startNodeFrom(e);i.left=e,i.operator=m;var a=p;return next(),i.right=parseExprOp(parseMaybeUnary(),r,n),parseExprOp(finishNode(i,a===be||a===xe?`LogicalExpression`:`BinaryExpression`),t,n)}return e}function parseMaybeUnary(){if(p.prefix){var e=startNode(),t=p.isUpdate;return e.operator=m,e.prefix=!0,h=!0,next(),e.argument=parseMaybeUnary(),t?checkLVal(e.argument):C&&e.operator===`delete`&&e.argument.type===`Identifier`&&raise(e.start,`Deleting local variable in strict mode`),finishNode(e,t?`UpdateExpression`:`UnaryExpression`)}for(var n=parseExprSubscripts();p.postfix&&!canInsertSemicolon();){var e=startNodeFrom(n);e.operator=m,e.prefix=!1,e.argument=n,checkLVal(n),next(),n=finishNode(e,`UpdateExpression`)}return n}function parseExprSubscripts(){return parseSubscripts(parseExprAtom())}function parseSubscripts(e,t){if(eat(pe)){var n=startNodeFrom(e);return n.object=e,n.property=parseIdent(!0),n.computed=!1,parseSubscripts(finishNode(n,`MemberExpression`),t)}else if(eat(le)){var n=startNodeFrom(e);return n.object=e,n.property=parseExpression(),n.computed=!0,expect(ue),parseSubscripts(finishNode(n,`MemberExpression`),t)}else if(!t&&eat(q)){var n=startNodeFrom(e);return n.callee=e,n.arguments=parseExprList(J,!1),parseSubscripts(finishNode(n,`CallExpression`),t)}else return e}function parseExprAtom(){switch(p){case G:var e=startNode();return next(),finishNode(e,`ThisExpression`);case O:return parseIdent();case T:case D:case E:var e=startNode();return e.value=m,e.raw=n.slice(c,l),next(),finishNode(e,`Literal`);case ae:case oe:case K:var e=startNode();return e.value=p.atomValue,e.raw=p.keyword,next(),finishNode(e,`Literal`);case q:var r=u,i=c;next();var a=parseExpression();return a.start=i,a.end=l,t.locations&&(a.loc.start=r,a.loc.end=d),t.ranges&&(a.range=[i,l]),expect(J),a;case le:var e=startNode();return next(),e.elements=parseExprList(ue,!0,!0),finishNode(e,`ArrayExpression`);case de:return parseObj();case R:var e=startNode();return next(),parseFunction(e,!1);case W:return parseNew();default:unexpected()}}function parseNew(){var e=startNode();return next(),e.callee=parseSubscripts(parseExprAtom(),!0),eat(q)?e.arguments=parseExprList(J,!1):e.arguments=w,finishNode(e,`NewExpression`)}function parseObj(){var e=startNode(),n=!0,r=!1;for(e.properties=[],next();!eat(fe);){if(n)n=!1;else if(expect(Y),t.allowTrailingCommas&&eat(fe))break;var i={key:parsePropertyName()},a=!1,o;if(eat(Z)?(i.value=parseExpression(!0),o=i.kind=`init`):t.ecmaVersion>=5&&i.key.type===`Identifier`&&(i.key.name===`get`||i.key.name===`set`)?(a=r=!0,o=i.kind=i.key.name,i.key=parsePropertyName(),p!==q&&unexpected(),i.value=parseFunction(startNode(),!1)):unexpected(),i.key.type===`Identifier`&&(C||r))for(var s=0;s<e.properties.length;++s){var c=e.properties[s];if(c.key.name===i.key.name){var l=o==c.kind||a&&c.kind===`init`||o===`init`&&(c.kind===`get`||c.kind===`set`);l&&!C&&o===`init`&&c.kind===`init`&&(l=!1),l&&raise(i.key.start,`Redefinition of property`)}}e.properties.push(i)}return finishNode(e,`ObjectExpression`)}function parsePropertyName(){return p===T||p===D?parseExprAtom():parseIdent(!0)}function parseFunction(e,t){p===O?e.id=parseIdent():t?unexpected():e.id=null,e.params=[];var n=!0;for(expect(q);!eat(J);)n?n=!1:expect(Y),e.params.push(parseIdent());var r=x,i=S;if(x=!0,S=[],e.body=parseBlock(!0),x=r,S=i,C||e.body.body.length&&isUseStrict(e.body.body[0]))for(var a=e.id?-1:0;a<e.params.length;++a){var o=a<0?e.id:e.params[a];if((Ne(o.name)||Pe(o.name))&&raise(o.start,`Defining '`+o.name+`' in strict mode`),a>=0)for(var s=0;s<a;++s)o.name===e.params[s].name&&raise(o.start,`Argument name clash in strict mode`)}return finishNode(e,t?`FunctionDeclaration`:`FunctionExpression`)}function parseExprList(e,n,r){for(var i=[],a=!0;!eat(e);){if(a)a=!1;else if(expect(Y),n&&t.allowTrailingCommas&&eat(e))break;r&&p===Y?i.push(null):i.push(parseExpression(!0))}return i}function parseIdent(e){var r=startNode();return e&&t.forbidReserved==`everywhere`&&(e=!1),p===O?(!e&&(t.forbidReserved&&(t.ecmaVersion===3?je:Me)(m)||C&&Ne(m))&&n.slice(c,l).indexOf(`\\`)==-1&&raise(c,`The keyword '`+m+`' is reserved`),r.name=m):e&&p.keyword?r.name=p.keyword:unexpected(),h=!1,next(),finishNode(r,`Identifier`)}}),n.version||(n=null)}function parse(e,r){return(t.acorn||n).parse(e,r)}var l={"+":`__add`,"-":`__subtract`,"*":`__multiply`,"/":`__divide`,"%":`__modulo`,"==":`__equals`,"!=":`__equals`},u={"-":`__negate`,"+":`__self`},d=a.each([`add`,`subtract`,`multiply`,`divide`,`modulo`,`equals`,`negate`],function(e){this[`__`+e]=`#`+e},{__self:function(){return this}});m.inject(d),g.inject(d),z.inject(d);function __$__(e,t,n){var r=l[t];if(e&&e[r]){var i=e[r](n);return t===`!=`?!i:i}switch(t){case`+`:return e+n;case`-`:return e-n;case`*`:return e*n;case`/`:return e/n;case`%`:return e%n;case`==`:return e==n;case`!=`:return e!=n}}function $__(e,t){var n=u[e];if(t&&t[n])return t[n]();switch(e){case`+`:return+t;case`-`:return-t}}function compile(t,n){if(!t)return``;n||={};var a=[];function getOffset(e){for(var t=0,n=a.length;t<n;t++){var r=a[t];if(r[0]>=e)break;e+=r[1]}return e}function getCode(e){return t.substring(getOffset(e.range[0]),getOffset(e.range[1]))}function getBetween(e,n){return t.substring(getOffset(e.range[1]),getOffset(n.range[0]))}function replaceCode(e,n){for(var r=getOffset(e.range[0]),i=getOffset(e.range[1]),o=0,s=a.length-1;s>=0;s--)if(r>a[s][0]){o=s+1;break}a.splice(o,0,[r,n.length-i+r]),t=t.substring(0,r)+n+t.substring(i)}function handleOverloading(e,t){switch(e.type){case`UnaryExpression`:if(e.operator in u&&e.argument.type!==`Literal`){var n=getCode(e.argument);replaceCode(e,`$__("`+e.operator+`", `+n+`)`)}break;case`BinaryExpression`:if(e.operator in l&&e.left.type!==`Literal`){var r=getCode(e.left),i=getCode(e.right),a=getBetween(e.left,e.right),o=e.operator;replaceCode(e,`__$__(`+r+`,`+a.replace(RegExp(`\\`+o),`"`+o+`"`)+`, `+i+`)`)}break;case`UpdateExpression`:case`AssignmentExpression`:var s=t&&t.type;if(!(s===`ForStatement`||s===`BinaryExpression`&&/^[=!<>]/.test(t.operator)||s===`MemberExpression`&&t.computed)){if(e.type===`UpdateExpression`){var n=getCode(e.argument),c=`__$__(`+n+`, "`+e.operator[0]+`", 1)`,d=n+` = `+c;e.prefix?d=`(`+d+`)`:(s===`AssignmentExpression`||s===`VariableDeclarator`||s===`BinaryExpression`)&&(getCode(t.left||t.id)===n&&(d=c),d=n+`; `+d),replaceCode(e,d)}else if(/^.=$/.test(e.operator)&&e.left.type!==`Literal`){var r=getCode(e.left),i=getCode(e.right),c=r+` = __$__(`+r+`, "`+e.operator[0]+`", `+i+`)`;replaceCode(e,/^\(.*\)$/.test(getCode(e))?`(`+c+`)`:c)}}break}}function handleExports(e){switch(e.type){case`ExportDefaultDeclaration`:replaceCode({range:[e.start,e.declaration.start]},`module.exports = `);break;case`ExportNamedDeclaration`:var t=e.declaration,n=e.specifiers;if(t){var r=t.declarations;r&&(r.forEach(function(e){replaceCode(e,`module.exports.`+getCode(e))}),replaceCode({range:[e.start,t.start+t.kind.length]},``))}else if(n){var i=n.map(function(e){var t=getCode(e);return`module.exports.`+t+` = `+t+`; `}).join(``);i&&replaceCode(e,i)}break}}function walkAST(e,t,n){if(e){for(var r in e)if(r!==`range`&&r!==`loc`){var i=e[r];if(Array.isArray(i))for(var a=0,o=i.length;a<o;a++)walkAST(i[a],e,n);else i&&typeof i==`object`&&walkAST(i,e,n)}n.operatorOverloading!==!1&&handleOverloading(e,t),n.moduleExports!==!1&&handleExports(e)}}function encodeVLQ(e){var t=``,n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;for(e=(Math.abs(e)<<1)+(e<0?1:0);e||!t;){var r=e&31;e>>=5,e&&(r|=32),t+=n[r]}return t}var o=n.url||``,s=n.sourceMaps,c=n.paperFeatures||{},d=n.source||t,p=n.offset||0,m=Z.agent,h=m.versionNumber,g=!1,_=/\r\n|\n|\r/gm,v;if(s&&(m.chrome&&h>=30||m.webkit&&h>=537.76||m.firefox&&h>=23||m.node)){if(m.node)p-=2;else if(r&&o&&!r.location.href.indexOf(o)){var y=i.getElementsByTagName(`html`)[0].innerHTML;p=y.substr(0,y.indexOf(t)+1).match(_).length+1}g=p>0&&!(m.chrome&&h>=36||m.safari&&h>=600||m.firefox&&h>=40||m.node);var b=[`AA`+encodeVLQ(g?0:p)+`A`];b.length=(t.match(_)||[]).length+1+(g?p:0),v={version:3,file:o,names:[],mappings:b.join(`;AACA`),sourceRoot:``,sources:[o],sourcesContent:[d]}}return(c.operatorOverloading!==!1||c.moduleExports!==!1)&&walkAST(parse(t,{ranges:!0,preserveParens:!0,sourceType:`module`}),null,c),v&&(g&&(t=Array(p+1).join(`
|
|
16
|
+
`)+t),/^(inline|both)$/.test(s)&&(t+=`
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,`+e.btoa(unescape(encodeURIComponent(JSON.stringify(v))))),t+=`
|
|
18
|
+
//# sourceURL=`+(o||`paperscript`)),{url:o,source:d,code:t,map:v}}function execute(e,t,n){Z=t;var r=t.getView(),o=/\btool\.\w+|\s+on(?:Key|Mouse)(?:Up|Down|Move|Drag)\b/.test(e)&&!/\bnew\s+Tool\b/.test(e)?new ue:null,s=o?o._events:[],c=[`onFrame`,`onResize`].concat(s),l=[],u=[],d;e=(typeof e==`object`?e:compile(e,n)).code;function expose(t,n){for(var r in t)(n||!/^_/.test(r))&&RegExp(`([\\b\\s\\W]|^)`+r.replace(/\$/g,`\\$`)+`\\b`).test(e)&&(l.push(r),u.push(t[r]))}expose({__$__,$__,paper:t,tool:o},!0),expose(t),e=`var module = { exports: {} }; `+e;var p=a.each(c,function(t){RegExp(`\\s+`+t+`\\b`).test(e)&&(l.push(t),this.push(`module.exports.`+t+` = `+t+`;`))},[]).join(`
|
|
19
|
+
`);p&&(e+=`
|
|
20
|
+
`+p),e+=`
|
|
21
|
+
return module.exports;`;var h=Z.agent;if(i&&(h.chrome||h.firefox&&h.versionNumber<40)){var g=i.createElement(`script`),_=i.head||i.getElementsByTagName(`head`)[0];h.firefox&&(e=`
|
|
22
|
+
`+e),g.appendChild(i.createTextNode(`document.__paperscript__ = function(`+l+`) {`+e+`
|
|
23
|
+
}`)),_.appendChild(g),d=i.__paperscript__,delete i.__paperscript__,_.removeChild(g)}else d=Function(l,e);var p=d&&d.apply(t,u),v=p||{};return a.each(s,function(e){var t=v[e];t&&(o[e]=t)}),r&&(v.onResize&&r.setOnResize(v.onResize),r.emit(`resize`,{size:r.size,delta:new m}),v.onFrame&&r.setOnFrame(v.onFrame),r.requestUpdate()),p}function loadScript(e){if(/^text\/(?:x-|)paperscript$/.test(e.type)&&s.getAttribute(e,`ignore`)!==`true`){var t=s.getAttribute(e,`canvas`),n=i.getElementById(t),r=e.src||e.getAttribute(`data-src`),a=s.hasAttribute(e,`async`),o=`data-paper-scope`;if(!n)throw Error(`Unable to find canvas with id "`+t+`"`);var c=s.get(n.getAttribute(o))||new s().setup(n);return n.setAttribute(o,c._id),r?fe.request({url:r,async:a,mimeType:`text/plain`,onLoad:function(e){execute(e,c,r)}}):execute(e.innerHTML,c,e.baseURI),e.setAttribute(`data-paper-ignore`,`true`),c}}function loadAll(){a.each(i&&i.getElementsByTagName(`script`),loadScript)}function load(e){return e?loadScript(e):loadAll()}return r&&(i.readyState===`complete`?setTimeout(loadAll):H.add(r,{load:loadAll})),{compile,execute,load,parse,calculateBinary:__$__,calculateUnary:$__}}.call(this);var Z=new(s.inject(a.exports,{Base:a,Numerical:d,Key:oe,DomEvent:H,DomElement:V,document:i,window:r,Symbol:k,PlacedSymbol:O}));return Z.agent.node&&K()(Z),typeof define==`function`&&define.amd?define(`paper`,Z):typeof t==`object`&&t&&(t.exports=Z),Z}).call(e,typeof self==`object`?self:null)})),le=e.i(ce(),1),ue=(0,r.defineComponent)({name:`CalculateSupplementaryAngle`,components:{UserInputNumber:i.UserInputNumber},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:n}){let a=(0,i.useViewable)(e,n,`CalculateSupplementaryAngle`),o=(0,i.useQuestionView)(a),s=(0,r.ref)(``),c=(0,r.ref)(null),l=(0,r.ref)();o.question.value=new Y(e.data);let getBisectingPoint=(e,n,r,i,a,o,s=30)=>new e.Point(n/2+s*t.a(r+(i+a)/2),o/2+s*t.c(r+(i+a)/2));return(0,r.onMounted)(async()=>{if(await(0,r.nextTick)(),!c.value)return;l.value=new le.default.PaperScope,l.value.setup(c.value);let e=l.value,n=c.value.width,i=c.value.height,a=t.o(0,360),s=n*t.a(a),u=n*t.c(a),d=new e.Path.Line({from:new e.Point(n/2+s,i/2+u),to:new e.Point(n/2-s,i/2-u)});d.strokeColor=new le.default.Color(`black`);let p=0,m=[];if(o.question.value)for(let r=0;r<o.question.value.angles.length;r++){let s=o.question.value.angles[r];p+=s,console.log(`drawing angle ${r}:
|
|
24
|
+
angle: ${s}
|
|
25
|
+
angleSum: ${p}
|
|
26
|
+
`);let c,l=p-s;c=r===o.question.value.angles.length-1?180:p;let u=new e.Point(n/2+30*t.a(a+l),i/2+30*t.c(a+l)),d=getBisectingPoint(e,n,a,l,c,i),h=new e.Point(n/2+30*t.a(a+c),i/2+30*t.c(a+c)),g=n*t.a(a+p),_=n*t.c(a+p),v=new e.Path.Line({from:new e.Point(n/2,i/2),to:new e.Point(n/2+g,i/2+_)});if(v.strokeColor=new le.default.Color(0,0,0),m.push(v),o.question.value.targetAngleIndex===r){console.log(`drawing targetAngle at i = ${r}:
|
|
27
|
+
baseAngle: ${a}
|
|
28
|
+
targetAngle: ${s}
|
|
29
|
+
sum: ${p}
|
|
30
|
+
nextAngle: ${c}
|
|
31
|
+
`);let t=new le.default.Color(.1,.5,.8,.35),o=new e.Path.Arc({from:u,through:d,to:h});o.strokeColor=new le.default.Color(.1,.5,.8,.75),o.strokeWidth=3,o.fillColor=t;let l=new e.Path;l.closed=!0,l.add(u),l.add(new le.default.Point(n/2,i/2)),l.add(h),l.fillColor=t}else{let t=new le.default.PointText(d);t.content=s.toString()+`°`;let r=!0,o=20;for(;r;)r=!1,t.bounds.center=getBisectingPoint(e,n,a,l,c,i,o),m.forEach(e=>{e.intersects(t)&&(r=!0)}),o+=7}}}),(0,r.onBeforeUnmount)(()=>{l.value=void 0}),{answer:s,canvasRef:c,...a,...o}}}),de={"data-viewable":`CalculateSupplementaryAngle`},fe={ref:`canvasRef`,width:`300`,height:`300`};function _sfc_render$1(e,t,n,i,a,o){let s=(0,r.resolveComponent)(`user-input-number`);return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,de,[t[1]||=(0,r.createElementVNode)(`h2`,null,`What is the measurement of the highlighted angle?`,-1),(0,r.createElementVNode)(`canvas`,fe,null,512),t[2]||=(0,r.createElementVNode)(`br`,null,null,-1),(0,r.createVNode)(s,{modelValue:e.answer,"onUpdate:modelValue":t[0]||=t=>e.answer=t},null,8,[`modelValue`])])}e.r(_sfc_render$1,`_sfc_render`);var q=t.r(ue,[[`render`,_sfc_render$1],[`__scopeId`,`data-v-4f8ac466`]]),J=[{name:`AngleCount`,type:a.FieldType.INT,validator:{instructions:`Must be 2 or 3.`,test:e=>e===`2`||e===`3`?{status:a.Status.ok,msg:``}:{status:a.Status.error,msg:`Must be 2 or 3.`}}}],Y=class SupplementaryAngles extends i.Question{static dataShapes=[{name:a.DataShapeName.MATH_SupplimentaryAngles,fields:J}];static views=[q];angles=[];targetAngleIndex;angleCount;constructor(e){super(e),this.angleCount=e[0].AngleCount;let n=0;for(let e=0;e<=this.angleCount-2;e++){let e=t.o(25,155-n);this.angles.push(e),n+=e}this.angles.push(180-n),this.targetAngleIndex=t.o(0,this.angleCount-1)}isCorrect(e){return this.angles[this.targetAngleIndex]===e}dataShapes(){return SupplementaryAngles.dataShapes}views(){return SupplementaryAngles.views}},X=(0,r.defineComponent)({name:`VerbalAddition`,props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){let n=(0,i.useViewable)(e,t,`VerbalAddition`),a=(0,i.useQuestionView)(n),o=(0,r.ref)([``,``,``,``,``]);a.question.value=new be(e.data);let s=(0,r.computed)(()=>a.question.value?a.question.value:new be(e.data)),track=e=>{console.log(`change in ${e}!
|
|
32
|
+
userAnswer: ${o.value.toString()}\n
|
|
33
|
+
qAnswer: ${s.value?.answer.toString()}`),s.value&&s.value.answer[e].toString().length===o.value[e].length&&(parseInt(o.value[e])===s.value.answer[e]?(document.getElementById(`input`+e)?.classList.add(`correct`),document.getElementById(`input`+e)?.classList.remove(`incorrect`),document.getElementById(`input`+e)?.setAttribute(`disabled`,`true`),e+1<o.value.length?document.getElementById(`input`+(e+1))?.focus():a.submitAnswer(o.value)):(document.getElementById(`input`+e)?.classList.add(`incorrect`),a.submitAnswer(o.value),console.log(`Wrong! ${o.value[e]} !== ${s.value.answer[e]}`)))};return(0,r.onMounted)(()=>{console.log(`focusing...`),document.getElementById(`input0`)?.focus()}),{...n,...a,answer:o,question:s,track}}}),Z={"data-viewable":`VerbalAddition`,class:`text-h5`},pe={class:`text-h5`},me=[`value`],he=[`id`,`onUpdate:modelValue`,`autofocus`,`onKeyup`],ge={key:0};function _sfc_render(e,t,n,i,a,o){return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Z,[(0,r.createElementVNode)(`div`,pe,[t[0]||=(0,r.createTextVNode)(` Count by `),(0,r.createElementVNode)(`strong`,null,(0,r.toDisplayString)(e.question?.n),1),t[1]||=(0,r.createTextVNode)(`s: `)]),(0,r.createElementVNode)(`input`,{type:`text`,disabled:``,class:`correct`,value:e.question.answer[0]-e.question.n},null,8,me),t[2]||=(0,r.createTextVNode)(`, `),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.question.answer,(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:n},[(0,r.withDirectives)((0,r.createElementVNode)(`input`,{id:`input${n}`,ref_for:!0,ref:`input${n}`,class:(0,r.normalizeClass)(`input${t}${n}`),"onUpdate:modelValue":t=>e.answer[n]=t,type:`text`,autofocus:n===0,onKeyup:t=>e.track(n)},null,42,he),[[r.vModelText,e.answer[n]]]),n===e.question.answer.length-1?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,ge,`, `))]))),128))])}var _e=t.r(X,[[`render`,_sfc_render],[`__scopeId`,`data-v-0452c3a5`]]),ve=function(e){return e.LEFT=`LEFT`,e.RIGHT=`RIGHT`,e}(ve||{}),ye=[{name:`n`,type:a.FieldType.INT},{name:`hand`,type:a.FieldType.STRING,validator:{test:e=>e===ve.LEFT||e===ve.RIGHT?{status:a.Status.ok,msg:``}:{status:a.Status.error,msg:`Hand must be ${ve.LEFT} or ${ve.RIGHT}`}}}],data=function(){let e=[];for(let t=2;t<=10;t++)e.push({n:t,hand:ve.LEFT}),e.push({n:t,hand:ve.RIGHT});return e};function asInt(e){return typeof e==`string`?parseInt(e):e}var be=class CountBy extends i.Question{static dataShapes=[{name:a.DataShapeName.MATH_CountBy,fields:ye}];static views=[_e];n;hand;static seedData=data();static acceptsUserData=!1;constructor(e){super(e),this.n=e[0].n,this.hand=e[0].hand}get answer(){let e=[],t=this.hand===ve.LEFT?this.n:6*this.n;for(let n=0;n<5;n++)e.push(t+n*this.n);return e}isCorrect(e){console.log(`Solution: ${this.answer.toString()}`);for(let t=0;t<this.answer.length;t++)if(asInt(e[t])!==this.answer[t])return console.log(`answer[${t}] == ${e[t]} !== ${this.answer[t]}`),!1;return!0}dataShapes(){return CountBy.dataShapes}views(){return CountBy.views}},xe=new t.t(`math`,[y,O,m,M,re,oe,Y,be]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return xe}});
|
|
34
|
+
//# sourceMappingURL=math-B1oDAkOy.cjs.map
|