presenter 0.2.4 → 0.3.1
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/README.md +1 -1
- package/dist/jest.config.d.ts +13 -0
- package/dist/presenter-code.js +1 -0
- package/dist/presenter-export.js +1 -0
- package/dist/presenter-morph.js +1 -0
- package/dist/presenter.js +1 -1
- package/dist/src/code/codeBlock.d.ts +83 -0
- package/dist/src/code/index.d.ts +1 -0
- package/dist/src/export/index.d.ts +22 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/morph/index.d.ts +34 -0
- package/dist/src/objects/arrow.d.ts +23 -6
- package/dist/src/objects/circle.d.ts +12 -0
- package/dist/src/objects/grid.d.ts +17 -0
- package/dist/src/objects/group.d.ts +4 -0
- package/dist/src/objects/image.d.ts +2 -0
- package/dist/src/objects/line.d.ts +6 -0
- package/dist/src/objects/text.d.ts +20 -0
- package/dist/src/objects/text.test.d.ts +1 -0
- package/dist/src/objects/vectorGraphic.d.ts +28 -0
- package/dist/src/presentation/object.d.ts +20 -11
- package/dist/src/presentation/presentation.d.ts +29 -1
- package/dist/src/presentation/presentation.test.d.ts +1 -0
- package/dist/src/presentation/slide.d.ts +19 -4
- package/dist/src/util/animation.d.ts +22 -0
- package/dist/src/util/easing.d.ts +12 -0
- package/dist/src/util/easing.test.d.ts +1 -0
- package/dist/webpack.config.d.ts +51 -3
- package/package.json +38 -8
- package/dist/dist/presenter.d.ts +0 -1
package/README.md
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export let preset: string;
|
|
2
|
+
export let testEnvironment: string;
|
|
3
|
+
export let transform: {
|
|
4
|
+
"^.+\\.ts$": (string | {
|
|
5
|
+
diagnostics: {
|
|
6
|
+
ignoreCodes: string[];
|
|
7
|
+
};
|
|
8
|
+
})[];
|
|
9
|
+
"^.+\\.es.js": string[];
|
|
10
|
+
};
|
|
11
|
+
export let transformIgnorePatterns: string[];
|
|
12
|
+
export let collectCoverageFrom: string[];
|
|
13
|
+
export let coverageReporters: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.PresenterCode=n():t.PresenterCode=n()}(this,(()=>(()=>{"use strict";var t={d:(n,e)=>{for(var o in e)t.o(e,o)&&!t.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:e[o]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};t.r(n),t.d(n,{CodeBlock:()=>m});var e,o=function(){function t(t,n,e){this.origin=t,this.width=n,this.height=e}return t.fromElement=function(n){var e=n.getBBox();return new t({x:e.x,y:e.y},e.width,e.height)},t}(),r=function(){return r=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},r.apply(this,arguments)},i=function(){function t(t){this.props=r({position:{x:0,y:0},anchor:"topleft"},t),this.initialProps=r({},this.props),this._element=null,this._presentation=null,this._children=[]}return t.prototype.tagName=function(){return"g"},t.prototype.attributes=function(){return{}},t.prototype.additionalAttributes=function(){return{}},t.prototype.styles=function(){var t=this.props.opacity;return r({},void 0!==t?{opacity:t.toString()}:{})},t.prototype.children=function(){return[]},t.prototype.requiresChildrenUpdate=function(t){return!1},t.prototype.positionAttributes=function(t){if(null===this._presentation)throw new Error("Cannot compute object position attributes without presentation");var n=this.positionInPresentation(t.origin),e=n.x,r=n.y,i=this.anchorBoundingBox(new o({x:e,y:r},t.width,t.height));return{x:i.origin.x,y:i.origin.y}},t.prototype.generate=function(t){this.props=r({},this.initialProps),this._presentation=t;for(var n=this.createElement(),e=0,o=Object.entries(this.attributes());e<o.length;e++){var i=o[e],a=i[0],s=i[1];n.setAttribute(a,s)}for(var c=0,l=Object.entries(this.styles());c<l.length;c++){var p=l[c],u=p[0];s=p[1],n.style.setProperty(u,s)}this._children=this.children();for(var h=0,f=this._children;h<f.length;h++){var d=f[h];n.appendChild(d)}this._element=n;for(var g=0,y=Object.entries(this.additionalAttributes());g<y.length;g++){var v=y[g];a=v[0],s=v[1],n.setAttribute(a,s)}return n},t.prototype.createElement=function(){return document.createElementNS("http://www.w3.org/2000/svg",this.tagName())},t.prototype.element=function(){if(null===this._element)throw new Error("Element not yet generated");return this._element},t.prototype.animate=function(t,n,e,o){var i=this;return void 0===n&&(n={}),void 0===e&&(e=null),void 0===o&&(o=!0),function(a){if(null===i._presentation)throw new Error("Cannot animate object without presentation");var s=i.requiresChildrenUpdate(t);i.props=r(r({},i.props),t),s&&(i._children=i.children());var c=i.attributes(),l=i.styles(),p=i.additionalAttributes(),u=Object.fromEntries(Object.entries(c).filter((function(t){var n=t[0],e=t[1];return i._element.getAttribute(n)!==e}))),h=Object.fromEntries(Object.entries(l).filter((function(t){var n=t[0],e=t[1];return i._element.style.getPropertyValue(n)!==e}))),f=Object.fromEntries(Object.entries(p).filter((function(t){var n=t[0],e=t[1];return i._element.getAttribute(n)!==e})));a(r(r(r({animate:o,element:i.element(),attributes:r(r({},u),f),styles:h},null!==e?{delay:e}:{}),s?{children:i._children}:{}),{animationParams:r(r({duration:500,easing:"linear"},n),"cubic"===n.easing?{easing:"cubicBezier(0.42, 0, 0.58, 1)"}:{})}))}},t.prototype.set=function(t,n){return void 0===n&&(n=null),this.animate(t,{},n,!1)},t.prototype.move=function(t,n){return void 0===n&&(n={}),this.animate({position:t},n)},t.prototype.fadeIn=function(t){return void 0===t&&(t={}),this.animate({opacity:1},t)},t.prototype.fadeOut=function(t){return void 0===t&&(t={}),this.animate({opacity:0},t)},t.prototype.show=function(){return this.set({opacity:1})},t.prototype.hide=function(){return this.set({opacity:0})},t.prototype.positionInPresentation=function(t){var n=this._presentation,e=t.x,o=t.y;return e<=1&&e>=-1&&(e*=n.boundingBox.width),o<=1&&o>=-1&&(o*=n.boundingBox.height),{x:e,y:o}},t.prototype.anchorBoundingBox=function(t){var n=this,e=function(){switch(n.props.anchor){case"topleft":case"top":case"topright":return t.origin.y;case"left":case"center":case"right":return t.origin.y-t.height/2;case"bottomleft":case"bottom":case"bottomright":return t.origin.y-t.height}}(),r=function(){switch(n.props.anchor){case"topleft":case"left":case"bottomleft":return t.origin.x;case"top":case"center":case"bottom":return t.origin.x-t.width/2;case"topright":case"right":case"bottomright":return t.origin.x-t.width}}();return new o({x:r,y:e},t.width,t.height)},t.prototype.computeRenderedBoundingBox=function(t,n){void 0===n&&(n=null);var e=this._presentation.computeRenderedBoundingBox(t,n);return new o({x:this.props.position.x,y:this.props.position.y},e.width,e.height)},t}(),a=(e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},e(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}),s=function(){return s=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},s.apply(this,arguments)},c=function(t){function n(n,e,o){return void 0===e&&(e={}),void 0===o&&(o=null),t.call(this,s({objects:n,position:{x:0,y:0},positioned:null===o?"position"in e:o,rotation:0,rotationOrigin:{x:0,y:0},scale:1},e))||this}return a(n,t),n.prototype.tagName=function(){return"g"},n.prototype.attributes=function(){return s({},t.prototype.attributes.call(this))},n.prototype.additionalAttributes=function(){var t=this.props.scale,n="rotate(".concat(this.props.rotation,", ").concat(this.props.rotationOrigin.x,", ").concat(this.props.rotationOrigin.y,")"),e="scale(".concat(t,")");if(!this.props.positioned){var r=this.positionInPresentation(this.props.position),i=r.x,a=r.y;return{transform:"translate(".concat(i,", ").concat(a,") ").concat(n," ").concat(e)}}var s=this._presentation.computeRenderedBoundingBox(this._element);s.width*=t,s.height*=t;var c=this.positionInPresentation(this.props.position),l=c.x,p=c.y,u=this.anchorBoundingBox(new o({x:l,y:p},s.width,s.height)),h=u.origin.x-s.origin.x,f=u.origin.y-s.origin.y;return{transform:"translate(".concat(h,", ").concat(f,") ").concat(n," ").concat(e)}},n.prototype.children=function(){var t=this;return this.props.objects.map((function(n){return n.generate(t._presentation),n._element}))},n}(i),l=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),p=function(){return p=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},p.apply(this,arguments)},u=function(t){function n(n){return void 0===n&&(n={}),t.call(this,p({fill:"#000000",width:100,height:100,rounding:0,borderWidth:0,borderColor:"#000000"},n))||this}return l(n,t),n.prototype.tagName=function(){return"rect"},n.prototype.attributes=function(){var n=this.props,e=n.position,r=n.width,i=n.height,a=n.fill,s=n.rounding,c=n.borderWidth,l=n.borderColor,u=this.positionAttributes(new o(e,r,i)),h=u.x,f=u.y;return p(p(p({},t.prototype.attributes.call(this)),{fill:a,width:r.toString(),height:i.toString(),rx:s.toString(),x:h.toString(),y:f.toString()}),c>0?{"stroke-width":c.toString(),stroke:l}:{})},n}(i);function h(t,n,e){void 0===n&&(n="1em"),void 0===e&&(e="start");for(var o=[],r=0,i=0,a=t;i<a.length;i++){var s=a[i];r++;var c=document.createElementNS("http://www.w3.org/2000/svg","tspan");if(c.setAttribute("x","0"),c.setAttribute("text-anchor",e),r>1&&c.setAttribute("dy",n),0===s.length||1===s.length&&""===s[0])c.appendChild(document.createTextNode(" ")),o.push(c);else if("string"!=typeof s){for(var l=0,p=s;l<p.length;l++){var u=p[l];if("string"==typeof u)c.appendChild(document.createTextNode(u));else{var h=u[0],f=u[1],d=document.createElementNS("http://www.w3.org/2000/svg","tspan");d.textContent=h;for(var g={fill:f.color,dy:f.dy,"text-decoration":f.textDecoration},y=0,v=Object.entries(g);y<v.length;y++){var b=v[y],m=b[0];void 0!==(_=b[1])&&d.setAttribute(m,_.toString())}for(var w={"font-family":f.fontFamily?'"'.concat(f.fontFamily,'"'):void 0,"font-size":f.fontSize,"font-weight":f.fontWeight,"font-style":f.fontStyle},x=0,O=Object.entries(w);x<O.length;x++){var _,j=O[x];m=j[0],void 0!==(_=j[1])&&d.style.setProperty(m,_.toString())}c.appendChild(d)}}o.push(c)}else c.appendChild(document.createTextNode(s)),o.push(c)}return o}var f=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),d=function(){return d=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},d.apply(this,arguments)},g=function(t){function n(n,e){return void 0===e&&(e={}),t.call(this,d({content:n,color:"#000000",fontSize:150,fontStyle:"normal",fontWeight:"normal",fontFamily:"Arial",dominantBaseline:"ideographic",textDecoration:"none",length:null,align:"left",lineSpacing:"1em",ligatures:null},e))||this}return f(n,t),n.prototype.isRichText=function(){return"string"!=typeof this.props.content},n.prototype.tagName=function(){return"text"},n.prototype.attributes=function(){var n=this.props,e=n.color,o=n.textDecoration;return d(d(d({},t.prototype.attributes.call(this)),"none"!==o?{"text-decoration":o}:{}),{fill:e})},n.prototype.additionalAttributes=function(){var n=this.computeRenderedBoundingBox(this.element(),this.childrenWithContentLength(this.contentLength())),e=this.positionAttributes(n),o=e.x,r=e.y;return this.isRichText()&&("center"===this.props.align?o+=n.width/2:"right"===this.props.align&&(o+=n.width)),d(d(d({},t.prototype.additionalAttributes.call(this)),this.isRichText()?{transform:"translate(".concat(o.toString()," ").concat(r.toString(),")"),y:"1em"}:{x:o.toString(),y:(r+n.height).toString()}),{"dominant-baseline":this.props.dominantBaseline})},n.prototype.styles=function(){var n=this.props,e=n.fontSize,o=n.fontFamily,r=n.fontStyle,i=n.fontWeight,a=n.ligatures;return d(d(d(d(d({},t.prototype.styles.call(this)),"normal"!==r?{"font-style":r}:{}),"normal"!==i?{"font-weight":i.toString()}:{}),null!==a?{"font-variant-ligatures":a}:{}),{"font-size":"".concat(e,"px"),"font-family":'"'.concat(o,'"'),"white-space":"pre"})},n.prototype.children=function(){var t,n=null!==(t=this.props.length)&&void 0!==t?t:this.contentLength();return this.childrenWithContentLength(n)},n.prototype.requiresChildrenUpdate=function(t){return"content"in t&&t.content!==this.props.content||"length"in t&&t.length!==this.props.length},n.prototype.contentLength=function(){return"string"==typeof this.props.content?this.props.content.length:this.props.content.reduce((function(t,n){return"string"==typeof n?t+n.length:t+n.reduce((function(t,n){return t+("string"==typeof n?n:n[0]).length}),0)}),0)},n.prototype.childrenWithContentLength=function(t){var n=this.props.content;if("string"==typeof n){var e=null===t?n:n.slice(0,t);return[document.createTextNode(e)]}var o="left"===this.props.align?"start":"center"===this.props.align?"middle":"end";if(null===t)return h(n,this.props.lineSpacing,o);for(var r=t,i=[],a=0,s=n;a<s.length;a++){var c=s[a];if("string"==typeof c)c.length<=r?(i.push(c),r-=c.length):(i.push(c.slice(0,r)),r=0);else{for(var l=[],p=0,u=c;p<u.length;p++){var f=u[p];if("string"==typeof f?f.length<=r?(l.push(f),r-=f.length):(l.push(f.slice(0,r)),r=0):f[0].length<=r?(l.push(f),r-=f[0].length):(l.push([f[0].slice(0,r),f[1]]),r=0),0===r)break}i.push(l)}if(0===r)break}return h(i,this.props.lineSpacing,o)},n.prototype.regenerateChildren=function(){this._children=this.children(),this._element.innerHTML="";for(var t=0,n=this._children;t<n.length;t++){var e=n[t];this._element.appendChild(e)}},n.prototype.animate=function(n,e,o,r){var i=this;void 0===e&&(e={}),void 0===o&&(o=null),void 0===r&&(r=!0);var a=n.length,s=function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]])}return e}(n,["length"]);return void 0===a?t.prototype.animate.call(this,s,e,o,r):function(n){var c;i.writeOn(a,null!==(c=e.duration)&&void 0!==c?c:1e3,r)(n),Object.keys(s).length>0&&t.prototype.animate.call(i,s,e,o,r)(n)}},n.prototype.writeOn=function(t,n,e){var o=this;void 0===t&&(t=null),void 0===n&&(n=1e3),void 0===e&&(e=!0);var r=null,i=null,a=null,s=function(e){var c;null===a&&(a=e),null===r&&(r=null!==(c=o.props.length)&&void 0!==c?c:o.contentLength()),null===i&&(i=null!=t?t:o.contentLength());var l=e-a,p=Math.min(l/n,1);o.props.length=Math.floor(r+(i-r)*p),o.regenerateChildren(),p<1&&requestAnimationFrame(s)};return function(n){return n({animate:e,animateCallback:function(){a=null,r=null,i=null,requestAnimationFrame(s)},updateCallback:function(){a=null,r=null,i=null,o.props.length=t,o.regenerateChildren()}})}},n}(i),y=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),v=function(){return v=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},v.apply(this,arguments)},b=function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]])}return e},m=function(t){function n(e){void 0===e&&(e={});var o,r=this,i=v({code:"",highlights:null,length:null,fontFamily:"Courier New",fontSize:130,textColor:"#ffffff",backgroundColor:"#000000",backgroundRounding:10,padding:50,lineHeight:null!==(o=e.fontSize)&&void 0!==o?o:130,characterWidth:80,focusColor:"#4166a5",focusOpacity:0,focusRounding:10,focusLineStart:1,focusLineEnd:1,focusColStart:1,focusColEnd:1,focusPaddingX:0,focusPaddingY:0,focusOffsetX:0,focusOffsetY:0,position:{x:0,y:0},anchor:"topleft"},e),a=n.getComponentProps(i),s=a.group,c=a.background,l=a.focus,p=a.text,h=p.content,f=b(p,["content"]),d=new u(c),y=new u(l),m=new g(h,f);return(r=t.call(this,[d,y,m],s)||this).codeBlockProps=i,r.background=d,r.focus=y,r.text=m,r}return y(n,t),n.prototype.animate=function(e,o,r,i){var a=this;return void 0===o&&(o={}),void 0===r&&(r=null),void 0===i&&(i=!0),function(s){a.codeBlockProps=v(v({},a.codeBlockProps),e);var c=n.getComponentProps(a.codeBlockProps),l=c.group,p=c.background,u=c.focus,h=c.text,f=h.content,d=b(h,["content"]);t.prototype.animate.call(a,l,o,r,i)(s),a.background.animate(p,o,r,i)(s),a.focus.animate(u,o,r,i)(s),a.text.animate(v({content:f},d),o,r,i)(s)}},n.getComponentProps=function(t){var e=t.padding,o=t.characterWidth,r=t.lineHeight,i=t.focusLineStart,a=t.focusLineEnd,s=t.focusColStart,c=t.focusColEnd,l=t.focusOffsetX,p=t.focusOffsetY,u=t.focusPaddingX,h=t.focusPaddingY,f=t.code.trimEnd(),d=f.split("\n").reduce((function(t,n){return Math.max(t,n.length)}),0),g=n.buildTextContent(f,t.highlights);return{group:{position:t.position,anchor:t.anchor},background:{width:o*d+2*e,height:r*g.length+2*e,rounding:t.backgroundRounding,fill:null===t.backgroundColor?"transparent":t.backgroundColor,position:{x:0,y:0},anchor:"topleft"},focus:{width:o*(c-s+1)+2*u,height:r*(a-i+1)+2*h,rounding:t.focusRounding,fill:t.focusColor,opacity:t.focusOpacity,position:{x:e+(s-1)*o-u+l,y:e+(i-1)*r-h+p},anchor:"topleft"},text:{content:g,length:t.length,fontFamily:t.fontFamily,fontSize:t.fontSize,color:t.textColor,position:{x:e,y:e},anchor:"topleft"}}},n.buildTextContent=function(t,n){if(null===n)return t.split("\n").map((function(t){return t}));for(var e=t.split("\n"),o=[],r=0,i=n;r<i.length;r++){for(var a=[],s=0,c=i[r];s<c.length;s++){var l=c[s];a.push([e[o.length].substring(l.start-1,l.end),{color:l.color,fontWeight:l.bold?"bold":"normal"}])}o.push(a)}return o},n.computePropsForText=function(t,n){var e=new g(Array(10).fill("H".repeat(10)),n);e.generate(t);var o=new g(Array(50).fill("H".repeat(50)),n);o.generate(t);var r=e.computeRenderedBoundingBox(e.element()),i=o.computeRenderedBoundingBox(o.element());return{lineHeight:(i.height-r.height)/40,characterWidth:(i.width-r.width)/40}},n}(c);return n})()));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.PresenterExport=t():e.PresenterExport=t()}(this,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{exportAllSlides:()=>U,exportCurrentSlideContainer:()=>V,renderCurrentSlide:()=>H,renderPresentationAsImages:()=>M});const n=(()=>{let e=0;return()=>(e+=1,`u${`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4)}${e}`)})();function r(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function o(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function i(e,t={}){return{width:t.width||function(e){const t=o(e,"border-left-width"),n=o(e,"border-right-width");return e.clientWidth+t+n}(e),height:t.height||function(e){const t=o(e,"border-top-width"),n=o(e,"border-bottom-width");return e.clientHeight+t+n}(e)}}const a=16384;function c(e){return new Promise(((t,n)=>{const r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e}))}const s=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return null!==n&&(n.constructor.name===t.name||s(n,t))};function l(e,t,o){const i=window.getComputedStyle(e,o),a=i.getPropertyValue("content");if(""===a||"none"===a)return;const c=n();try{t.className=`${t.className} ${c}`}catch(e){return}const s=document.createElement("style");s.appendChild(function(e,t,n){const o=`.${e}:${t}`,i=n.cssText?function(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}(n):function(e){return r(e).map((t=>`${t}: ${e.getPropertyValue(t)}${e.getPropertyPriority(t)?" !important":""};`)).join(" ")}(n);return document.createTextNode(`${o}{${i}}`)}(c,o,i)),t.appendChild(s)}const u="application/font-woff",d="image/jpeg",h={woff:u,woff2:u,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:d,jpeg:d,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function f(e){const t=function(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}(e).toLowerCase();return h[t]||""}function p(e){return-1!==e.search(/^(data:)/)}function g(e,t){return`data:${t};base64,${e}`}async function m(e,t,n){const r=await fetch(e,t);if(404===r.status)throw new Error(`Resource "${r.url}" not found`);const o=await r.blob();return new Promise(((e,t)=>{const i=new FileReader;i.onerror=t,i.onloadend=()=>{try{e(n({res:r,result:i.result}))}catch(e){t(e)}},i.readAsDataURL(o)}))}const y={};async function w(e,t,n){const r=function(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}(e,t,n.includeQueryParams);if(null!=y[r])return y[r];let o;n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime());try{const r=await m(e,n.fetchRequestInit,(({res:e,result:n})=>(t||(t=e.headers.get("Content-Type")||""),function(e){return e.split(/,/)[1]}(n))));o=g(r,t)}catch(t){o=n.imagePlaceholder||"";let r=`Failed to fetch resource: ${e}`;t&&(r="string"==typeof t?t:t.message),r&&console.warn(r)}return y[r]=o,o}const b=e=>null!=e.tagName&&"SLOT"===e.tagName.toUpperCase();async function v(e,t,n){return n||!t.filter||t.filter(e)?Promise.resolve(e).then((e=>async function(e,t){return s(e,HTMLCanvasElement)?async function(e){const t=e.toDataURL();return"data:,"===t?e.cloneNode(!1):c(t)}(e):s(e,HTMLVideoElement)?async function(e,t){if(e.currentSrc){const t=document.createElement("canvas"),n=t.getContext("2d");return t.width=e.clientWidth,t.height=e.clientHeight,null==n||n.drawImage(e,0,0,t.width,t.height),c(t.toDataURL())}const n=e.poster,r=f(n);return c(await w(n,r,t))}(e,t):s(e,HTMLIFrameElement)?async function(e){var t;try{if(null===(t=null==e?void 0:e.contentDocument)||void 0===t?void 0:t.body)return await v(e.contentDocument.body,{},!0)}catch(e){}return e.cloneNode(!1)}(e):e.cloneNode(!1)}(e,t))).then((n=>async function(e,t,n){var o,i;let a=[];return a=b(e)&&e.assignedNodes?r(e.assignedNodes()):s(e,HTMLIFrameElement)&&(null===(o=e.contentDocument)||void 0===o?void 0:o.body)?r(e.contentDocument.body.childNodes):r((null!==(i=e.shadowRoot)&&void 0!==i?i:e).childNodes),0===a.length||s(e,HTMLVideoElement)||await a.reduce(((e,r)=>e.then((()=>v(r,n))).then((e=>{e&&t.appendChild(e)}))),Promise.resolve()),t}(e,n,t))).then((t=>function(e,t){return s(t,Element)&&(function(e,t){const n=t.style;if(!n)return;const o=window.getComputedStyle(e);o.cssText?(n.cssText=o.cssText,n.transformOrigin=o.transformOrigin):r(o).forEach((r=>{let i=o.getPropertyValue(r);if("font-size"===r&&i.endsWith("px")){const e=Math.floor(parseFloat(i.substring(0,i.length-2)))-.1;i=`${e}px`}s(e,HTMLIFrameElement)&&"display"===r&&"inline"===i&&(i="block"),"d"===r&&t.getAttribute("d")&&(i=`path(${t.getAttribute("d")})`),n.setProperty(r,i,o.getPropertyPriority(r))}))}(e,t),function(e,t){l(e,t,":before"),l(e,t,":after")}(e,t),function(e,t){s(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),s(e,HTMLInputElement)&&t.setAttribute("value",e.value)}(e,t),function(e,t){if(s(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find((t=>e.value===t.getAttribute("value")));r&&r.setAttribute("selected","")}}(e,t)),t}(e,t))).then((e=>async function(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(0===n.length)return e;const r={};for(let o=0;o<n.length;o++){const i=n[o].getAttribute("xlink:href");if(i){const n=e.querySelector(i),o=document.querySelector(i);n||!o||r[i]||(r[i]=await v(o,t,!0))}}const o=Object.values(r);if(o.length){const t="http://www.w3.org/1999/xhtml",n=document.createElementNS(t,"svg");n.setAttribute("xmlns",t),n.style.position="absolute",n.style.width="0",n.style.height="0",n.style.overflow="hidden",n.style.display="none";const r=document.createElementNS(t,"defs");n.appendChild(r);for(let e=0;e<o.length;e++)r.appendChild(o[e]);e.appendChild(n)}return e}(e,t))):null}const S=/url\((['"]?)([^'"]+?)\1\)/g,x=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,E=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function C(e){return-1!==e.search(S)}async function P(e,t,n){if(!C(e))return e;const r=function(e,{preferredFontFormat:t}){return t?e.replace(E,(e=>{for(;;){const[n,,r]=x.exec(e)||[];if(!r)return"";if(r===t)return`src: ${n};`}})):e}(e,n),o=function(e){const t=[];return e.replace(S,((e,n,r)=>(t.push(r),e))),t.filter((e=>!p(e)))}(r);return o.reduce(((e,r)=>e.then((e=>async function(e,t,n,r,o){try{const i=n?function(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),o=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(o),t&&(r.href=t),o.href=e,o.href}(t,n):t,a=f(t);let c;return c=o?g(await o(i),a):await w(i,a,r),e.replace(function(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}(t),`$1${c}$3`)}catch(e){}return e}(e,r,t,n)))),Promise.resolve(r))}async function $(e,t,n){var r;const o=null===(r=t.style)||void 0===r?void 0:r.getPropertyValue(e);if(o){const r=await P(o,null,n);return t.style.setProperty(e,r,t.style.getPropertyPriority(e)),!0}return!1}async function T(e,t){s(e,Element)&&(await async function(e,t){await $("background",e,t)||await $("background-image",e,t),await $("mask",e,t)||await $("mask-image",e,t)}(e,t),await async function(e,t){const n=s(e,HTMLImageElement);if((!n||p(e.src))&&(!s(e,SVGImageElement)||p(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,o=await w(r,f(r),t);await new Promise(((t,r)=>{e.onload=t,e.onerror=r;const i=e;i.decode&&(i.decode=t),"lazy"===i.loading&&(i.loading="eager"),n?(e.srcset="",e.src=o):e.href.baseVal=o}))}(e,t),await async function(e,t){const n=r(e.childNodes).map((e=>T(e,t)));await Promise.all(n).then((()=>e))}(e,t))}const R={};async function N(e){let t=R[e];if(null!=t)return t;const n=await fetch(e);return t={url:e,cssText:await n.text()},R[e]=t,t}async function A(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map((async o=>{let i=o.replace(r,"$1");return i.startsWith("https://")||(i=new URL(i,e.url).href),m(i,t.fetchRequestInit,(({result:e})=>(n=n.replace(o,`url(${e})`),[o,e])))}));return Promise.all(o).then((()=>n))}function k(e){if(null==e)return[];const t=[];let n=e.replace(/(\/\*[\s\S]*?\*\/)/gi,"");const r=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const e=r.exec(n);if(null===e)break;t.push(e[0])}n=n.replace(r,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let e=o.exec(n);if(null===e){if(e=i.exec(n),null===e)break;o.lastIndex=i.lastIndex}else i.lastIndex=o.lastIndex;t.push(e[0])}return t}async function L(e,t){const n=null!=t.fontEmbedCSS?t.fontEmbedCSS:t.skipFonts?null:await async function(e,t){const n=await async function(e,t){if(null==e.ownerDocument)throw new Error("Provided element is not within a Document");const n=r(e.ownerDocument.styleSheets),o=await async function(e,t){const n=[],o=[];return e.forEach((n=>{if("cssRules"in n)try{r(n.cssRules||[]).forEach(((e,r)=>{if(e.type===CSSRule.IMPORT_RULE){let i=r+1;const a=N(e.href).then((e=>A(e,t))).then((e=>k(e).forEach((e=>{try{n.insertRule(e,e.startsWith("@import")?i+=1:n.cssRules.length)}catch(t){console.error("Error inserting rule from remote css",{rule:e,error:t})}})))).catch((e=>{console.error("Error loading remote css",e.toString())}));o.push(a)}}))}catch(r){const i=e.find((e=>null==e.href))||document.styleSheets[0];null!=n.href&&o.push(N(n.href).then((e=>A(e,t))).then((e=>k(e).forEach((e=>{i.insertRule(e,n.cssRules.length)})))).catch((e=>{console.error("Error loading remote stylesheet",e)}))),console.error("Error inlining remote css file",r)}})),Promise.all(o).then((()=>(e.forEach((e=>{if("cssRules"in e)try{r(e.cssRules||[]).forEach((e=>{n.push(e)}))}catch(t){console.error(`Error while reading CSS rules from ${e.href}`,t)}})),n)))}(n,t);return function(e){return e.filter((e=>e.type===CSSRule.FONT_FACE_RULE)).filter((e=>C(e.style.getPropertyValue("src"))))}(o)}(e,t);return(await Promise.all(n.map((e=>{const n=e.parentStyleSheet?e.parentStyleSheet.href:null;return P(e.cssText,n,t)})))).join("\n")}(e,t);if(n){const t=document.createElement("style"),r=document.createTextNode(n);t.appendChild(r),e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}}async function O(e,t={}){const{width:n,height:r}=i(e,t),o=await v(e,t,!0);return await L(o,t),await T(o,t),function(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;null!=r&&Object.keys(r).forEach((e=>{n[e]=r[e]}))}(o,t),await async function(e,t,n){const r="http://www.w3.org/2000/svg",o=document.createElementNS(r,"svg"),i=document.createElementNS(r,"foreignObject");return o.setAttribute("width",`${t}`),o.setAttribute("height",`${n}`),o.setAttribute("viewBox",`0 0 ${t} ${n}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),o.appendChild(i),i.appendChild(e),async function(e){return Promise.resolve().then((()=>(new XMLSerializer).serializeToString(e))).then(encodeURIComponent).then((e=>`data:image/svg+xml;charset=utf-8,${e}`))}(o)}(o,n,r)}async function j(e,t={}){return(await async function(e,t={}){const{width:n,height:r}=i(e,t),o=await O(e,t),s=await c(o),l=document.createElement("canvas"),u=l.getContext("2d"),d=t.pixelRatio||function(){let e,t;try{t=process}catch(e){}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}(),h=t.canvasWidth||n,f=t.canvasHeight||r;return l.width=h*d,l.height=f*d,t.skipAutoScale||function(e){(e.width>a||e.height>a)&&(e.width>a&&e.height>a?e.width>e.height?(e.height*=a/e.width,e.width=a):(e.width*=a/e.height,e.height=a):e.width>a?(e.height*=a/e.width,e.width=a):(e.width*=a/e.height,e.height=a))}(l),l.style.width=`${h}`,l.style.height=`${f}`,t.backgroundColor&&(u.fillStyle=t.backgroundColor,u.fillRect(0,0,l.width,l.height)),u.drawImage(s,0,0,l.width,l.height),l}(e,t)).toDataURL()}var I=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},D=function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(s){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}};function H(e,t){return I(this,void 0,void 0,(function(){var n,r;return D(this,(function(o){switch(o.label){case 0:return[4,j(e.svg,{canvasWidth:e.boundingBox.width/2,canvasHeight:e.boundingBox.height/2})];case 1:return n=o.sent(),(r=document.createElement("a")).download=t,r.href=n,document.body.appendChild(r),r.click(),document.body.removeChild(r),[2]}}))}))}function M(e){return I(this,void 0,void 0,(function(){var t,n,r,o,i,a,c;return D(this,(function(s){switch(s.label){case 0:if(!e)throw new Error("No presentation provided");t=0,n=0,r=e.slides,s.label=1;case 1:if(!(n<r.length))return[3,6];o=r[n],i=0,a=o.getKeyBuilds(),s.label=2;case 2:return i<a.length?(c=a[i],t++,o.render(e,c),[4,H(e,"".concat(String(t).padStart(3,"0"),".png"))]):[3,5];case 3:s.sent(),s.label=4;case 4:return i++,[3,2];case 5:return n++,[3,1];case 6:return[2]}}))}))}function V(e,t,n){return I(this,void 0,void 0,(function(){var r,o,i,a,c,s,l;return D(this,(function(u){switch(u.label){case 0:return r=e.boundingBox,o=r.width,i=r.height,[4,j(e.background,{canvasWidth:o/2,canvasHeight:i/2})];case 1:return a=u.sent(),c=e.additionalElementContainer.querySelector("canvas"),s=c?c.toDataURL():null,[4,j(e.svg,{canvasWidth:o/2,canvasHeight:i/2})];case 2:return l=u.sent(),[4,fetch("".concat(n,"/export"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:t,backgroundDataUrl:a,canvasDataUrl:s,svgDataUrl:l})})];case 3:return u.sent(),[2]}}))}))}function U(e,t){return I(this,void 0,void 0,(function(){var n,r,o,i,a,c,s;return D(this,(function(l){switch(l.label){case 0:if(!e)throw new Error("No presentation provided");n=0,r=0,o=e.slides,l.label=1;case 1:if(!(r<o.length))return[3,6];i=o[r],a=0,c=i.getKeyBuilds(),l.label=2;case 2:return a<c.length?(s=c[a],n++,i.render(e,s),[4,V(e,"".concat(String(n).padStart(3,"0"),".png"),t)]):[3,5];case 3:l.sent(),l.label=4;case 4:return a++,[3,2];case 5:return r++,[3,1];case 6:return[4,fetch("".concat(t,"/generate-pdf"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:"".concat(e.title,".pdf"),images:Array(n).fill(null).map((function(e,t){return"".concat(String(t+1).padStart(3,"0"),".png")}))})})];case 7:return l.sent(),[2]}}))}))}return t})()));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.PresenterMorph=n():t.PresenterMorph=n()}(this,(()=>(()=>{var t={814:function(t,n){!function(t){"use strict";function n(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&At.indexOf(t)>=0}function e(t){return t>=48&&t<=57}function r(t){return t>=48&&t<=57||43===t||45===t||46===t}function i(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function a(t){for(;t.index<t.max&&n(t.path.charCodeAt(t.index));)t.index++}function o(t){var n,r=t.index,i=r,a=t.max,o=!1,s=!1,u=!1,h=!1;if(i>=a)t.err="SvgPath: missed param (at pos "+i+")";else if(43!==(n=t.path.charCodeAt(i))&&45!==n||(n=++i<a?t.path.charCodeAt(i):0),e(n)||46===n){if(46!==n){if(o=48===n,n=++i<a?t.path.charCodeAt(i):0,o&&i<a&&n&&e(n))return void(t.err="SvgPath: numbers started with `0` such as `09` are ilegal (at pos "+r+")");for(;i<a&&e(t.path.charCodeAt(i));)i++,s=!0;n=i<a?t.path.charCodeAt(i):0}if(46===n){for(h=!0,i++;e(t.path.charCodeAt(i));)i++,u=!0;n=i<a?t.path.charCodeAt(i):0}if(101===n||69===n){if(h&&!s&&!u)return void(t.err="SvgPath: invalid float exponent (at pos "+i+")");if(43!==(n=++i<a?t.path.charCodeAt(i):0)&&45!==n||i++,!(i<a&&e(t.path.charCodeAt(i))))return void(t.err="SvgPath: invalid float exponent (at pos "+i+")");for(;i<a&&e(t.path.charCodeAt(i));)i++}t.index=i,t.param=parseFloat(t.path.slice(r,i))+0}else t.err="SvgPath: param should start with 0..9 or `.` (at pos "+i+")"}function s(t){var n,e;e=(n=t.path[t.segmentStart]).toLowerCase();var r=t.data;if("m"===e&&r.length>2&&(t.result.push([n,r[0],r[1]]),r=r.slice(2),e="l",n="m"===n?"l":"L"),"r"===e)t.result.push([n].concat(r));else for(;r.length>=Lt[e]&&(t.result.push([n].concat(r.splice(0,Lt[e]))),Lt[e]););}function u(t){var n,e,i,u=t.max;if(t.segmentStart=t.index,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}(t.path.charCodeAt(t.index)))if(e=Lt[t.path[t.index].toLowerCase()],t.index++,a(t),t.data=[],e){for(n=!1;;){for(i=e;i>0;i--){if(o(t),t.err.length)return;t.data.push(t.param),a(t),n=!1,t.index<u&&44===t.path.charCodeAt(t.index)&&(t.index++,a(t),n=!0)}if(!n){if(t.index>=t.max)break;if(!r(t.path.charCodeAt(t.index)))break}}s(t)}else s(t);else t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")"}function h(t,n){return[t[0]*n[0]+t[2]*n[1],t[1]*n[0]+t[3]*n[1],t[0]*n[2]+t[2]*n[3],t[1]*n[2]+t[3]*n[3],t[0]*n[4]+t[2]*n[5]+t[4],t[1]*n[4]+t[3]*n[5]+t[5]]}function c(){if(!(this instanceof c))return new c;this.queue=[],this.cache=null}function f(t,n,e,r){var i=t*r-n*e<0?-1:1,a=(t*e+n*r)/(Math.sqrt(t*t+n*n)*Math.sqrt(t*t+n*n));return a>1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)}function l(t,n,e,r,i,a,o,s,u,h){var c=h*(t-e)/2+u*(n-r)/2,l=-u*(t-e)/2+h*(n-r)/2,p=o*o,g=s*s,v=c*c,x=l*l,y=p*g-p*x-g*v;y<0&&(y=0),y/=p*x+g*v;var d=(y=Math.sqrt(y)*(i===a?-1:1))*o/s*l,m=y*-s/o*c,M=h*d-u*m+(t+e)/2,w=u*d+h*m+(n+r)/2,b=(c-d)/o,L=(l-m)/s,A=(-c-d)/o,P=(-l-m)/s,q=f(1,0,b,L),k=f(b,L,A,P);return 0===a&&k>0&&(k-=Ct),1===a&&k<0&&(k+=Ct),[M,w,q,k]}function p(t,n){var e=4/3*Math.tan(n/4),r=Math.cos(t),i=Math.sin(t),a=Math.cos(t+n),o=Math.sin(t+n);return[r,i,r-i*e,i+r*e,a+o*e,o-a*e,a,o]}function g(t,n,e){if(!(this instanceof g))return new g(t,n,e);this.rx=t,this.ry=n,this.ax=e}function v(t){if(!(this instanceof v))return new v(t);var n=Pt(t);this.segments=n.segments,this.err=n.err,this.__stack=[]}function x(t,n,e,r,i,a,o,s){this.a={x:t,y:n},this.b={x:e,y:r},this.c={x:i,y:a},this.d={x:o,y:s},null!=o&&null!=s?(this.getArcLength=q,this.getPoint=w,this.getDerivative=d):(this.getArcLength=b,this.getPoint=M,this.getDerivative=y),this.init()}function y(t,n,e){return{x:2*(1-e)*(t[1]-t[0])+2*e*(t[2]-t[1]),y:2*(1-e)*(n[1]-n[0])+2*e*(n[2]-n[1])}}function d(t,n,e){return M([3*(t[1]-t[0]),3*(t[2]-t[1]),3*(t[3]-t[2])],[3*(n[1]-n[0]),3*(n[2]-n[1]),3*(n[3]-n[2])],e)}function m(t,n,e,r,i){for(var a=1,o=t/n,s=(t-e(r,i,o))/n;a>.001;){var u=e(r,i,o+s),h=e(r,i,o-s),c=Math.abs(t-u)/n,f=Math.abs(t-h)/n;c<a?(a=c,o+=s):f<a?(a=f,o-=s):s/=2}return o}function M(t,n,e){return{x:(1-e)*(1-e)*t[0]+2*(1-e)*e*t[1]+e*e*t[2],y:(1-e)*(1-e)*n[0]+2*(1-e)*e*n[1]+e*e*n[2]}}function w(t,n,e){return{x:(1-e)*(1-e)*(1-e)*t[0]+3*(1-e)*(1-e)*e*t[1]+3*(1-e)*e*e*t[2]+e*e*e*t[3],y:(1-e)*(1-e)*(1-e)*n[0]+3*(1-e)*(1-e)*e*n[1]+3*(1-e)*e*e*n[2]+e*e*e*n[3]}}function b(t,n,e){void 0===e&&(e=1);var r=t[0]-2*t[1]+t[2],i=n[0]-2*n[1]+n[2],a=2*t[1]-2*t[0],o=2*n[1]-2*n[0],s=4*(r*r+i*i),u=4*(r*a+i*o),h=a*a+o*o;if(0===s)return e*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(n[2]-n[0],2));var c=u/(2*s),f=e+c,l=h/s-c*c;return Math.sqrt(s)/2*(f*Math.sqrt(f*f+l)-c*Math.sqrt(c*c+l)+l*Math.log(Math.abs((f+Math.sqrt(f*f+l))/(c+Math.sqrt(c*c+l)))))}function L(t,n){return Yt[t][n]}function A(t,n,e){var r,i,a,o=e.length-1;if(0===o)return 0;if(0===t){for(i=0,a=0;a<=o;a++)i+=L(o,a)*Math.pow(1-n,o-a)*Math.pow(n,a)*e[a];return i}for(r=new Array(o),a=0;a<o;a++)r[a]=o*(e[a+1]-e[a]);return A(t-1,n,r)}function P(t,n,e){var r=A(1,e,t),i=A(1,e,n),a=r*r+i*i;return Math.sqrt(a)}function q(t,n,e){var r,i,a,o;for(void 0===e&&(e=1),r=e/2,i=0,a=0;a<20;a++)o=r*Vt[20][a]+r,i+=Xt[20][a]*P(t,n,o);return r*i}function k(t,n,e,r){var i=t*e+n*r;return i>1&&(i=1),i<-1&&(i=-1),(t*r-n*e<0?-1:1)*Math.acos(i)}function _(t,n){var e=4/3*Math.tan(n/4),r=Math.cos(t),i=Math.sin(t),a=Math.cos(t+n),o=Math.sin(t+n);return[r,i,r-i*e,i+r*e,a+o*e,o-a*e,a,o]}function S(t,n,e,r,i,a,o,s,u){var h=0,c=[],f=[];Dt(t,n,e,r,i,a,o,s,u).forEach((function(t){var n=new It(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]),e=n.getTotalLength();h+=e,c.push(e),f.push(n)})),this.length=h,this.partialLengths=c,this.curves=f}function C(t,n,e,r){this.x0=t,this.x1=n,this.y0=e,this.y1=r}function E(t,n){return Math.sqrt((t[0]-n[0])*(t[0]-n[0])+(t[1]-n[1])*(t[1]-n[1]))}function T(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function Z(t,n,e){var r=t.map((function(t,e){return function(t,n){return function(e){return t.map((function(t,r){return t+e*(n[r]-t)}))}}(t,n[e])}));return function(t){var n=r.map((function(n){return n(t)}));return e?I(n):n}}function F(t){return"number"==typeof t&&isFinite(t)}function j(t){return function(t){for(var n=0;n<t.length-2;n++){var e=t[n],r=t[n+1],i=t[n+2];if(e[0]*(r[1]-i[1])+r[0]*(i[1]-e[1])+i[0]*(e[1]-r[1]))return!0}return!1}(t)?wt(t):[(t[0][0]+t[t.length-1][0])/2,(t[0][1]+t[t.length-1][1])/2]}function z(t){return new Zt(t).abs()}function O(t){return t.toString().split("M").map((function(t,n){return t=t.trim(),n&&t?"M"+t:t})).filter((function(t){return t}))}function I(t){return"M"+t.join("L")+"Z"}function V(t,n){var e=z(t);return function(t){var n=t.segments||[],e=[];if(!n.length||"M"!==n[0][0])return!1;for(var r=0;r<n.length;r++){var i=n[r],a=i[0],o=i[1],s=i[2];if("M"===a&&r||"Z"===a)break;if("M"===a||"L"===a)e.push([o,s]);else if("H"===a)e.push([o,e[e.length-1][1]]);else{if("V"!==a)return!1;e.push([e[e.length-1][0],o])}}return!!e.length&&{ring:e}}(e)||function(t,n){var e,r,i=O(t)[0],a=[],o=3;if(!i)throw new TypeError(Ut);e=(r=function(t){if("undefined"!=typeof window&&window&&window.document)try{var n=window.document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d",t),n}catch(t){}return Qt(t)}(i)).getTotalLength(),n&&F(n)&&n>0&&(o=Math.max(o,Math.ceil(e/n)));for(var s=0;s<o;s++){var u=r.getPointAtLength(e*s/o);a.push([u.x,u.y])}return{ring:a,skipBisect:!0}}(e,n)}function X(t,n){for(var e=t.length+n,r=bt(t)/n,i=0,a=0,o=r/2;t.length<e;){var s=t[i],u=t[(i+1)%t.length],h=E(s,u);o<=a+h?(t.splice(i+1,0,h?T(s,u,(o-a)/h):s.slice(0)),o+=r):(a+=h,i++)}}function Y(t,n){var e,r;if("string"==typeof t){var i=V(t,n);t=i.ring,r=i.skipBisect}else if(!Array.isArray(t))throw new TypeError(Ut);if(!function(t){return t.every((function(t){return Array.isArray(t)&&t.length>=2&&F(t[0])&&F(t[1])}))}(e=t.slice(0)))throw new TypeError(Ut);return e.length>1&&function(t,n){return E(t,n)<1e-9}(e[0],e[e.length-1])&&e.pop(),Mt(e)>0&&e.reverse(),!r&&n&&F(n)&&n>0&&function(t,n){void 0===n&&(n=1/0);for(var e=0;e<t.length;e++)for(var r=t[e],i=e===t.length-1?t[0]:t[e+1];E(r,i)>n;)i=T(r,i,.5),t.splice(e+1,0,i)}(e,n),e}function G(t,n,e){var r;return X(t,(r=t.length-n.length)<0?-1*r:0),X(n,r>0?r:0),Bt(t,n),Z(t,n,e)}function D(t,n,e){e=e||2;var r,i,a,o,s,u,h,c=n&&n.length,f=c?n[0]*e:t.length,l=H(t,0,f,e,!0),p=[];if(!l)return p;if(c&&(l=function(t,n,e,r){var i,a,o,s=[];for(i=0,a=n.length;i<a;i++)(o=H(t,n[i]*r,i<a-1?n[i+1]*r:t.length,r,!1))===o.next&&(o.steiner=!0),s.push(tt(o));for(s.sort($),i=0;i<s.length;i++)J(s[i],e),e=N(e,e.next);return e}(t,n,l,e)),t.length>80*e){r=a=t[0],i=o=t[1];for(var g=e;g<f;g+=e)(s=t[g])<r&&(r=s),(u=t[g+1])<i&&(i=u),s>a&&(a=s),u>o&&(o=u);h=Math.max(a-r,o-i)}return Q(l,p,e,r,i,h),p}function H(t,n,e,r,i){var a,o;if(i===ft(t,n,e,r)>0)for(a=n;a<e;a+=r)o=ut(a,t[a],t[a+1],o);else for(a=e-r;a>=n;a-=r)o=ut(a,t[a],t[a+1],o);return o&&it(o,o.next)&&(ht(o),o=o.next),o}function N(t,n){if(!t)return t;n||(n=t);var e,r=t;do{if(e=!1,r.steiner||!it(r,r.next)&&0!==rt(r.prev,r,r.next))r=r.next;else{if(ht(r),(r=n=r.prev)===r.next)return null;e=!0}}while(e||r!==n);return n}function Q(t,n,e,r,i,a,o){if(t){!o&&a&&function(t,n,e,r){var i=t;do{null===i.z&&(i.z=K(i.x,i.y,n,e,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var n,e,r,i,a,o,s,u,h=1;do{for(e=t,t=null,a=null,o=0;e;){for(o++,r=e,s=0,n=0;n<h&&(s++,r=r.nextZ);n++);for(u=h;s>0||u>0&&r;)0===s?(i=r,r=r.nextZ,u--):0!==u&&r?e.z<=r.z?(i=e,e=e.nextZ,s--):(i=r,r=r.nextZ,u--):(i=e,e=e.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;e=r}a.nextZ=null,h*=2}while(o>1)}(i)}(t,r,i,a);for(var s,u,h=t;t.prev!==t.next;)if(s=t.prev,u=t.next,a?R(t,r,i,a):U(t))n.push(s.i/e),n.push(t.i/e),n.push(u.i/e),ht(t),t=u.next,h=u.next;else if((t=u)===h){o?1===o?Q(t=B(t,n,e),n,e,r,i,a,2):2===o&&W(t,n,e,r,i,a):Q(N(t),n,e,r,i,a,1);break}}}function U(t){var n=t.prev,e=t,r=t.next;if(rt(n,e,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(nt(n.x,n.y,e.x,e.y,r.x,r.y,i.x,i.y)&&rt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function R(t,n,e,r){var i=t.prev,a=t,o=t.next;if(rt(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,u=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,h=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=K(s,u,n,e,r),l=K(h,c,n,e,r),p=t.nextZ;p&&p.z<=l;){if(p!==t.prev&&p!==t.next&&nt(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&rt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&nt(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&rt(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function B(t,n,e){var r=t;do{var i=r.prev,a=r.next.next;!it(i,a)&&at(i,r,r.next,a)&&ot(i,a)&&ot(a,i)&&(n.push(i.i/e),n.push(r.i/e),n.push(a.i/e),ht(r),ht(r.next),r=t=a),r=r.next}while(r!==t);return r}function W(t,n,e,r,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&et(o,s)){var u=st(o,s);return o=N(o,o.next),u=N(u,u.next),Q(o,n,e,r,i,a),void Q(u,n,e,r,i,a)}s=s.next}o=o.next}while(o!==t)}function $(t,n){return t.x-n.x}function J(t,n){if(n=function(t,n){var e,r=n,i=t.x,a=t.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o){if(o=s,s===i){if(a===r.y)return r;if(a===r.next.y)return r.next}e=r.x<r.next.x?r:r.next}}r=r.next}while(r!==n);if(!e)return null;if(i===o)return e.prev;var u,h=e,c=e.x,f=e.y,l=1/0;for(r=e.next;r!==h;)i>=r.x&&r.x>=c&&nt(a<f?i:o,a,c,f,a<f?o:i,a,r.x,r.y)&&((u=Math.abs(a-r.y)/(i-r.x))<l||u===l&&r.x>e.x)&&ot(r,t)&&(e=r,l=u),r=r.next;return e}(t,n)){var e=st(n,t);N(e,e.next)}}function K(t,n,e,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-e)/i)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-r)/i)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function tt(t){var n=t,e=t;do{n.x<e.x&&(e=n),n=n.next}while(n!==t);return e}function nt(t,n,e,r,i,a,o,s){return(i-o)*(n-s)-(t-o)*(a-s)>=0&&(t-o)*(r-s)-(e-o)*(n-s)>=0&&(e-o)*(a-s)-(i-o)*(r-s)>=0}function et(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&at(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}(t,n)&&ot(t,n)&&ot(n,t)&&function(t,n){var e=t,r=!1,i=(t.x+n.x)/2,a=(t.y+n.y)/2;do{e.y>a!=e.next.y>a&&i<(e.next.x-e.x)*(a-e.y)/(e.next.y-e.y)+e.x&&(r=!r),e=e.next}while(e!==t);return r}(t,n)}function rt(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function it(t,n){return t.x===n.x&&t.y===n.y}function at(t,n,e,r){return!!(it(t,n)&&it(e,r)||it(t,r)&&it(e,n))||rt(t,n,e)>0!=rt(t,n,r)>0&&rt(e,r,t)>0!=rt(e,r,n)>0}function ot(t,n){return rt(t.prev,t,t.next)<0?rt(t,n,t.next)>=0&&rt(t,t.prev,n)>=0:rt(t,n,t.prev)<0||rt(t,t.next,n)<0}function st(t,n){var e=new ct(t.i,t.x,t.y),r=new ct(n.i,n.x,n.y),i=t.next,a=n.prev;return t.next=n,n.prev=t,e.next=i,i.prev=e,r.next=e,e.prev=r,a.next=r,r.prev=a,r}function ut(t,n,e,r){var i=new ct(t,n,e);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function ht(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ct(t,n,e){this.i=t,this.x=n,this.y=e,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ft(t,n,e,r){for(var i=0,a=n,o=e-r;a<e;a+=r)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}function lt(t,n){var e=n.id,r=n.bbox,i=null==n.properties?{}:n.properties,a=pt(t,n);return null==e&&null==r?{type:"Feature",properties:i,geometry:a}:null==r?{type:"Feature",id:e,properties:i,geometry:a}:{type:"Feature",id:e,bbox:r,properties:i,geometry:a}}function pt(t,n){function e(t,n){n.length&&n.pop();for(var e=u[t<0?~t:t],r=0,i=e.length;r<i;++r)n.push(s(e[r],r));t<0&&Kt(n,i)}function r(t){return s(t)}function i(t){for(var n=[],r=0,i=t.length;r<i;++r)e(t[r],n);return n.length<2&&n.push(n[0]),n}function a(t){for(var n=i(t);n.length<4;)n.push(n[0]);return n}function o(t){return t.map(a)}var s=Jt(t.transform),u=t.arcs;return function t(n){var e,a=n.type;switch(a){case"GeometryCollection":return{type:a,geometries:n.geometries.map(t)};case"Point":e=r(n.coordinates);break;case"MultiPoint":e=n.coordinates.map(r);break;case"LineString":e=i(n.arcs);break;case"MultiLineString":e=n.arcs.map(i);break;case"Polygon":e=o(n.arcs);break;case"MultiPolygon":e=n.arcs.map(o);break;default:return null}return{type:a,coordinates:e}}(n)}function gt(t,n){function e(t){t.forEach((function(n){n.forEach((function(n){(i[n=n<0?~n:n]||(i[n]=[])).push(t)}))})),a.push(t)}function r(n){return function(t){for(var n,e=-1,r=t.length,i=t[r-1],a=0;++e<r;)n=i,i=t[e],a+=n[0]*i[1]-n[1]*i[0];return Math.abs(a)}(pt(t,{type:"Polygon",arcs:[n]}).coordinates[0])}var i={},a=[],o=[];return n.forEach((function t(n){switch(n.type){case"GeometryCollection":n.geometries.forEach(t);break;case"Polygon":e(n.arcs);break;case"MultiPolygon":n.arcs.forEach(e)}})),a.forEach((function(t){if(!t._){var n=[],e=[t];for(t._=1,o.push(n);t=e.pop();)n.push(t),t.forEach((function(t){t.forEach((function(t){i[t<0?~t:t].forEach((function(t){t._||(t._=1,e.push(t))}))}))}))}})),a.forEach((function(t){delete t._})),{type:"MultiPolygon",arcs:o.map((function(n){var e,a=[];if(n.forEach((function(t){t.forEach((function(t){t.forEach((function(t){i[t<0?~t:t].length<2&&a.push(t)}))}))})),(e=(a=nn(t,a)).length)>1)for(var o,s,u=1,h=r(a[0]);u<e;++u)(o=r(a[u]))>h&&(s=a[0],a[0]=a[u],a[u]=s,h=o);return a}))}}function vt(t,n,e){void 0===e&&(e={});var r=e.maxSegmentLength;void 0===r&&(r=10);var i=e.string;void 0===i&&(i=!0);var a=e.single;void 0===a&&(a=!1);var o=Y(t,r);o.length<n.length+2&&X(o,n.length+2-o.length);var s,u=sn(o,n.length),h=n.map((function(t){return Y(t,r)})),c="string"==typeof t&&t;return a&&!n.every((function(t){return"string"==typeof t}))||(s=n.slice(0)),xt(u,h,{match:!0,string:i,single:a,t0:c,t1:s})}function xt(t,n,e){void 0===e&&(e={});var r=e.string,i=e.single,a=e.t0,o=e.t1,s=e.match,u=s?un(t,n):t.map((function(t,n){return n})),h=u.map((function(e,i){return G(t[e],n[i],r)}));if(s&&Array.isArray(a)&&(a=u.map((function(t){return a[t]}))),i&&r&&(Array.isArray(a)&&(a=a.join(" ")),Array.isArray(o)&&(o=o.join(" "))),i){var c=r?function(t){return h.map((function(n){return n(t)})).join(" ")}:function(t){return h.map((function(n){return n(t)}))};return r&&(a||o)?function(t){return t<1e-4&&a||1-t<1e-4&&o||c(t)}:c}return r?(a=Array.isArray(a)?a.map((function(t){return"string"==typeof t&&t})):[],o=Array.isArray(o)?o.map((function(t){return"string"==typeof t&&t})):[],h.map((function(t,n){return a[n]||o[n]?function(e){return e<1e-4&&a[n]||1-e<1e-4&&o[n]||t(e)}:t}))):h}function yt(t,n,e,r,i){return mt(function(t,n,e){return function(r){var i=j(r),a=bt(r.concat([r[0]])),o=Math.atan2(r[0][1]-i[1],r[0][0]-i[0]),s=0;return r.map((function(i,u){var h;return u&&(s+=E(i,r[u-1])),h=o+2*Math.PI*(a?s/a:u/r.length),[Math.cos(h)*e+t,Math.sin(h)*e+n]}))}}(t,n,e),r,function(t,n,e){var r=t-e+","+n,i="A"+e+","+e+",0,1,1,";return"M"+r+i+(t+e)+","+n+i+r+"Z"}(t,n,e),2*Math.PI*e,i)}function dt(t,n,e,r,i,a){return mt(function(t,n,e,r){return function(i){var a=j(i),o=bt(i.concat([i[0]])),s=Math.atan2(i[0][1]-a[1],i[0][0]-a[0]),u=0;s<0&&(s=2*Math.PI+s);var h=s/(2*Math.PI);return i.map((function(a,s){s&&(u+=E(a,i[s-1]));var c=function(t){return t<=1/8?[1,.5+4*t]:t<=3/8?[1.5-4*t,1]:t<=5/8?[0,2.5-4*t]:t<=7/8?[4*t-2.5,0]:[1,4*t-3.5]}((h+(o?u/o:s/i.length))%1);return[t+c[0]*e,n+c[1]*r]}))}}(t,n,e,r),i,function(t,n,e,r){var i=t+e,a=n+r;return"M"+t+","+n+"L"+i+","+n+"L"+i+","+a+"L"+t+","+a+"Z"}(t,n,e,r),2*e+2*r,a)}function mt(t,n,e,r,i){void 0===i&&(i={});var a=i.maxSegmentLength;void 0===a&&(a=10);var o=i.string;void 0===o&&(o=!0);var s,u,h=Y(n,a);return F(r)&&h.length<r/a&&X(h,Math.ceil(r/a-h.length)),s=t(h),u=Z(s,h,o),o?function(t){return t<1e-4?e:u(t)}:u}var Mt=function(t){for(var n,e=-1,r=t.length,i=t[r-1],a=0;++e<r;)n=i,i=t[e],a+=n[1]*i[0]-n[0]*i[1];return a/2},wt=function(t){for(var n,e,r=-1,i=t.length,a=0,o=0,s=t[i-1],u=0;++r<i;)n=s,s=t[r],u+=e=n[0]*s[1]-s[0]*n[1],a+=(n[0]+s[0])*e,o+=(n[1]+s[1])*e;return[a/(u*=3),o/u]},bt=function(t){for(var n,e,r=-1,i=t.length,a=t[i-1],o=a[0],s=a[1],u=0;++r<i;)n=o,e=s,n-=o=(a=t[r])[0],e-=s=a[1],u+=Math.sqrt(n*n+e*e);return u},Lt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},At=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],Pt=function(t){var n=new i(t),e=n.max;for(a(n);n.index<e&&!n.err.length;)u(n);return n.err.length?n.result=[]:n.result.length&&("mM".indexOf(n.result[0][0])<0?(n.err="SvgPath: string should start with `M` or `m`",n.result=[]):n.result[0][0]="M"),{err:n.err,segments:n.result}};c.prototype.matrix=function(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]||(this.cache=null,this.queue.push(t)),this},c.prototype.translate=function(t,n){return 0===t&&0===n||(this.cache=null,this.queue.push([1,0,0,1,t,n])),this},c.prototype.scale=function(t,n){return 1===t&&1===n||(this.cache=null,this.queue.push([t,0,0,n,0,0])),this},c.prototype.rotate=function(t,n,e){var r,i,a;return 0!==t&&(this.translate(n,e),r=t*Math.PI/180,i=Math.cos(r),a=Math.sin(r),this.queue.push([i,a,-a,i,0,0]),this.cache=null,this.translate(-n,-e)),this},c.prototype.skewX=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},c.prototype.skewY=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},c.prototype.toArray=function(){var t=this;if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var n=1;n<this.queue.length;n++)t.cache=h(t.cache,t.queue[n]);return this.cache},c.prototype.calc=function(t,n,e){var r;return this.queue.length?(this.cache||(this.cache=this.toArray()),[t*(r=this.cache)[0]+n*r[2]+(e?0:r[4]),t*r[1]+n*r[3]+(e?0:r[5])]):[t,n]};var qt=c,kt={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},_t=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,St=/[\s,]+/,Ct=2*Math.PI,Et=Math.PI/180;g.prototype.transform=function(t){var n=Math.cos(this.ax*Et),e=Math.sin(this.ax*Et),r=[this.rx*(t[0]*n+t[2]*e),this.rx*(t[1]*n+t[3]*e),this.ry*(-t[0]*e+t[2]*n),this.ry*(-t[1]*e+t[3]*n)],i=r[0]*r[0]+r[2]*r[2],a=r[1]*r[1]+r[3]*r[3],o=((r[0]-r[3])*(r[0]-r[3])+(r[2]+r[1])*(r[2]+r[1]))*((r[0]+r[3])*(r[0]+r[3])+(r[2]-r[1])*(r[2]-r[1])),s=(i+a)/2;if(o<1e-10*s)return this.rx=this.ry=Math.sqrt(s),this.ax=0,this;var u=r[0]*r[1]+r[2]*r[3],h=s+(o=Math.sqrt(o))/2,c=s-o/2;return this.ax=Math.abs(u)<1e-10&&Math.abs(h-a)<1e-10?90:180*Math.atan(Math.abs(u)>Math.abs(h-a)?(h-i)/u:u/(h-a))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(h),this.ry=Math.sqrt(c)):(this.ax+=90,this.rx=Math.sqrt(c),this.ry=Math.sqrt(h)),this},g.prototype.isDegenerate=function(){return this.rx<1e-10*this.ry||this.ry<1e-10*this.rx};var Tt=g;v.prototype.__matrix=function(t){var n,e=this;t.queue.length&&this.iterate((function(r,i,a,o){var s,u,h,c;switch(r[0]){case"v":u=0===(s=t.calc(0,r[1],!0))[0]?["v",s[1]]:["l",s[0],s[1]];break;case"V":u=(s=t.calc(a,r[1],!1))[0]===t.calc(a,o,!1)[0]?["V",s[1]]:["L",s[0],s[1]];break;case"h":u=0===(s=t.calc(r[1],0,!0))[1]?["h",s[0]]:["l",s[0],s[1]];break;case"H":u=(s=t.calc(r[1],o,!1))[1]===t.calc(a,o,!1)[1]?["H",s[0]]:["L",s[0],s[1]];break;case"a":case"A":var f=t.toArray(),l=Tt(r[1],r[2],r[3]).transform(f);if(f[0]*f[3]-f[1]*f[2]<0&&(r[5]=r[5]?"0":"1"),s=t.calc(r[6],r[7],"a"===r[0]),"A"===r[0]&&r[6]===a&&r[7]===o||"a"===r[0]&&0===r[6]&&0===r[7]){u=["a"===r[0]?"l":"L",s[0],s[1]];break}u=l.isDegenerate()?["a"===r[0]?"l":"L",s[0],s[1]]:[r[0],l.rx,l.ry,l.ax,r[4],r[5],s[0],s[1]];break;case"m":c=i>0,u=["m",(s=t.calc(r[1],r[2],c))[0],s[1]];break;default:for(u=[h=r[0]],c=h.toLowerCase()===h,n=1;n<r.length;n+=2)s=t.calc(r[n],r[n+1],c),u.push(s[0],s[1])}e.segments[i]=u}),!0)},v.prototype.__evaluateStack=function(){var t,n;if(this.__stack.length){if(1===this.__stack.length)return this.__matrix(this.__stack[0]),void(this.__stack=[]);for(t=qt(),n=this.__stack.length;--n>=0;)t.matrix(this.__stack[n].toArray());this.__matrix(t),this.__stack=[]}},v.prototype.toString=function(){var t,n,e=this,r=[];this.__evaluateStack();for(var i=0;i<this.segments.length;i++)n=e.segments[i][0],t=i>0&&"m"!==n&&"M"!==n&&n===e.segments[i-1][0],r=r.concat(t?e.segments[i].slice(1):e.segments[i]);return r.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")},v.prototype.translate=function(t,n){return this.__stack.push(qt().translate(t,n||0)),this},v.prototype.scale=function(t,n){return this.__stack.push(qt().scale(t,n||0===n?n:t)),this},v.prototype.rotate=function(t,n,e){return this.__stack.push(qt().rotate(t,n||0,e||0)),this},v.prototype.skewX=function(t){return this.__stack.push(qt().skewX(t)),this},v.prototype.skewY=function(t){return this.__stack.push(qt().skewY(t)),this},v.prototype.matrix=function(t){return this.__stack.push(qt().matrix(t)),this},v.prototype.transform=function(t){return t.trim()?(this.__stack.push(function(t){var n,e,r=new qt;return t.split(_t).forEach((function(t){if(t.length){if(void 0!==kt[t])return void(n=t);switch(e=t.split(St).map((function(t){return+t||0})),n){case"matrix":return void(6===e.length&&r.matrix(e));case"scale":return void(1===e.length?r.scale(e[0],e[0]):2===e.length&&r.scale(e[0],e[1]));case"rotate":return void(1===e.length?r.rotate(e[0],0,0):3===e.length&&r.rotate(e[0],e[1],e[2]));case"translate":return void(1===e.length?r.translate(e[0],0):2===e.length&&r.translate(e[0],e[1]));case"skewX":return void(1===e.length&&r.skewX(e[0]));case"skewY":return void(1===e.length&&r.skewY(e[0]))}}})),r}(t)),this):this},v.prototype.round=function(t){var n,e=0,r=0,i=0,a=0;return t=t||0,this.__evaluateStack(),this.segments.forEach((function(o){var s=o[0].toLowerCase()===o[0];switch(o[0]){case"H":case"h":return s&&(o[1]+=i),i=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case"V":case"v":return s&&(o[1]+=a),a=o[1]-o[1].toFixed(t),void(o[1]=+o[1].toFixed(t));case"Z":case"z":return i=e,void(a=r);case"M":case"m":return s&&(o[1]+=i,o[2]+=a),i=o[1]-o[1].toFixed(t),a=o[2]-o[2].toFixed(t),e=i,r=a,o[1]=+o[1].toFixed(t),void(o[2]=+o[2].toFixed(t));case"A":case"a":return s&&(o[6]+=i,o[7]+=a),i=o[6]-o[6].toFixed(t),a=o[7]-o[7].toFixed(t),o[1]=+o[1].toFixed(t),o[2]=+o[2].toFixed(t),o[3]=+o[3].toFixed(t+2),o[6]=+o[6].toFixed(t),void(o[7]=+o[7].toFixed(t));default:return n=o.length,s&&(o[n-2]+=i,o[n-1]+=a),i=o[n-2]-o[n-2].toFixed(t),a=o[n-1]-o[n-1].toFixed(t),void o.forEach((function(n,e){e&&(o[e]=+o[e].toFixed(t))}))}})),this},v.prototype.iterate=function(t,n){var e,r,i,a=this.segments,o={},s=!1,u=0,h=0,c=0,f=0;if(n||this.__evaluateStack(),a.forEach((function(n,e){var r=t(n,e,u,h);Array.isArray(r)&&(o[e]=r,s=!0);var i=n[0]===n[0].toLowerCase();switch(n[0]){case"m":case"M":return u=n[1]+(i?u:0),h=n[2]+(i?h:0),c=u,void(f=h);case"h":case"H":return void(u=n[1]+(i?u:0));case"v":case"V":return void(h=n[1]+(i?h:0));case"z":case"Z":return u=c,void(h=f);default:u=n[n.length-2]+(i?u:0),h=n[n.length-1]+(i?h:0)}})),!s)return this;for(i=[],e=0;e<a.length;e++)if(void 0!==o[e])for(r=0;r<o[e].length;r++)i.push(o[e][r]);else i.push(a[e]);return this.segments=i,this},v.prototype.abs=function(){return this.iterate((function(t,n,e,r){var i,a=t[0],o=a.toUpperCase();if(a!==o)switch(t[0]=o,a){case"v":return void(t[1]+=r);case"a":return t[6]+=e,void(t[7]+=r);default:for(i=1;i<t.length;i++)t[i]+=i%2?e:r}}),!0),this},v.prototype.rel=function(){return this.iterate((function(t,n,e,r){var i,a=t[0],o=a.toLowerCase();if(a!==o&&(0!==n||"M"!==a))switch(t[0]=o,a){case"V":return void(t[1]-=r);case"A":return t[6]-=e,void(t[7]-=r);default:for(i=1;i<t.length;i++)t[i]-=i%2?e:r}}),!0),this},v.prototype.unarc=function(){return this.iterate((function(t,n,e,r){var i,a,o,s=[],u=t[0];return"A"!==u&&"a"!==u?null:("a"===u?(a=e+t[6],o=r+t[7]):(a=t[6],o=t[7]),0===(i=function(t,n,e,r,i,a,o,s,u){var h=Math.sin(u*Ct/360),c=Math.cos(u*Ct/360),f=c*(t-e)/2+h*(n-r)/2,g=-h*(t-e)/2+c*(n-r)/2;if(0===f&&0===g)return[];if(0===o||0===s)return[];o=Math.abs(o),s=Math.abs(s);var v=f*f/(o*o)+g*g/(s*s);v>1&&(o*=Math.sqrt(v),s*=Math.sqrt(v));var x=l(t,n,e,r,i,a,o,s,h,c),y=[],d=x[2],m=x[3],M=Math.max(Math.ceil(Math.abs(m)/(Ct/4)),1);m/=M;for(var w=0;w<M;w++)y.push(p(d,m)),d+=m;return y.map((function(t){for(var n=0;n<t.length;n+=2){var e=t[n+0],r=t[n+1],i=c*(e*=o)-h*(r*=s),a=h*e+c*r;t[n+0]=i+x[0],t[n+1]=a+x[1]}return t}))}(e,r,a,o,t[4],t[5],t[1],t[2],t[3])).length?[["a"===t[0]?"l":"L",t[6],t[7]]]:(i.forEach((function(t){s.push(["C",t[2],t[3],t[4],t[5],t[6],t[7]])})),s))})),this},v.prototype.unshort=function(){var t,n,e,r,i,a=this.segments;return this.iterate((function(o,s,u,h){var c,f=o[0],l=f.toUpperCase();s&&("T"===l?(c="t"===f,"Q"===(e=a[s-1])[0]?(t=e[1]-u,n=e[2]-h):"q"===e[0]?(t=e[1]-e[3],n=e[2]-e[4]):(t=0,n=0),r=-t,i=-n,c||(r+=u,i+=h),a[s]=[c?"q":"Q",r,i,o[1],o[2]]):"S"===l&&(c="s"===f,"C"===(e=a[s-1])[0]?(t=e[3]-u,n=e[4]-h):"c"===e[0]?(t=e[3]-e[5],n=e[4]-e[6]):(t=0,n=0),r=-t,i=-n,c||(r+=u,i+=h),a[s]=[c?"c":"C",r,i,o[1],o[2],o[3],o[4]]))})),this};var Zt=v,Ft={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},jt=/([astvzqmhlc])([^astvzqmhlc]*)/gi,zt=function(t){var n=[];return t.replace(jt,(function(t,e,r){var i=e.toLowerCase();for(r=function(t){var n=t.match(Ot);return n?n.map(Number):[]}(r),"m"===i&&r.length>2&&(n.push([e].concat(r.splice(0,2))),i="l",e="m"===e?"l":"L");r.length>=0;){if(r.length===Ft[i])return r.unshift(e),n.push(r);if(r.length<Ft[i])throw new Error("malformed path data");n.push([e].concat(r.splice(0,Ft[i])))}})),n},Ot=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,It=function(t,n,e,r,i,a,o,s){return new x(t,n,e,r,i,a,o,s)};x.prototype={constructor:x,init:function(){this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y])},getTotalLength:function(){return this.length},getPointAtLength:function(t){var n=m(t,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]);return this.getPoint([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],n)},getTangentAtLength:function(t){var n=m(t,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]),e=this.getDerivative([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],n),r=Math.sqrt(e.x*e.x+e.y*e.y);return r>0?{x:e.x/r,y:e.y/r}:{x:0,y:0}},getPropertiesAtLength:function(t){var n,e=m(t,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]),r=this.getDerivative([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e),i=Math.sqrt(r.x*r.x+r.y*r.y);n=i>0?{x:r.x/i,y:r.y/i}:{x:0,y:0};var a=this.getPoint([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e);return{x:a.x,y:a.y,tangentX:n.x,tangentY:n.y}}};var Vt=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],Xt=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],Yt=[[1],[1,1],[1,2,1],[1,3,3,1]],Gt=2*Math.PI,Dt=function(t,n,e,r,i,a,o,s,u){var h=Math.sin(i*Gt/360),c=Math.cos(i*Gt/360),f=c*(t-s)/2+h*(n-u)/2,l=-h*(t-s)/2+c*(n-u)/2;if(0===f&&0===l)return[];if(0===e||0===r)return[];e=Math.abs(e),r=Math.abs(r);var p=f*f/(e*e)+l*l/(r*r);p>1&&(e*=Math.sqrt(p),r*=Math.sqrt(p));var g=function(t,n,e,r,i,a,o,s,u,h){var c=h*(t-e)/2+u*(n-r)/2,f=-u*(t-e)/2+h*(n-r)/2,l=o*o,p=s*s,g=c*c,v=f*f,x=l*p-l*v-p*g;x<0&&(x=0),x/=l*v+p*g;var y=(x=Math.sqrt(x)*(i===a?-1:1))*o/s*f,d=x*-s/o*c,m=h*y-u*d+(t+e)/2,M=u*y+h*d+(n+r)/2,w=(c-y)/o,b=(f-d)/s,L=(-c-y)/o,A=(-f-d)/s,P=k(1,0,w,b),q=k(w,b,L,A);return 0===a&&q>0&&(q-=Gt),1===a&&q<0&&(q+=Gt),[m,M,P,q]}(t,n,s,u,a,o,e,r,h,c),v=[],x=g[2],y=g[3],d=Math.max(Math.ceil(Math.abs(y)/(Gt/4)),1);y/=d;for(var m=0;m<d;m++)v.push(_(x,y)),x+=y;return v.map((function(t){for(var n=0;n<t.length;n+=2){var i=t[n+0],a=t[n+1],o=c*(i*=e)-h*(a*=r),s=h*i+c*a;t[n+0]=o+g[0],t[n+1]=s+g[1]}return t}))},Ht=function(t,n,e,r,i,a,o,s,u){return new S(t,n,e,r,i,a,o,s,u)};S.prototype={constructor:S,init:function(){},getTotalLength:function(){return this.length},getPointAtLength:function(t){t<0?t=0:t>this.length&&(t=this.length);for(var n=this.partialLengths.length-1;this.partialLengths[n]>=t&&this.partialLengths[n]>0;)n--;n<this.partialLengths.length-1&&n++;for(var e=0,r=0;r<n;r++)e+=this.partialLengths[r];return this.curves[n].getPointAtLength(t-e)},getTangentAtLength:function(t){t<0?t=0:t>this.length&&(t=this.length);for(var n=this.partialLengths.length-1;this.partialLengths[n]>=t&&this.partialLengths[n]>0;)n--;n<this.partialLengths.length-1&&n++;for(var e=0,r=0;r<n;r++)e+=this.partialLengths[r];return this.curves[n].getTangentAtLength(t-e)},getPropertiesAtLength:function(t){var n=this.getTangentAtLength(t),e=this.getPointAtLength(t);return{x:e.x,y:e.y,tangentX:n.x,tangentY:n.y}}};var Nt=function(t,n,e,r){return new C(t,n,e,r)};C.prototype.getTotalLength=function(){return Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2))},C.prototype.getPointAtLength=function(t){var n=t/Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2)),e=(this.x1-this.x0)*n,r=(this.y1-this.y0)*n;return{x:this.x0+e,y:this.y0+r}},C.prototype.getTangentAtLength=function(){var t=Math.sqrt((this.x1-this.x0)*(this.x1-this.x0)+(this.y1-this.y0)*(this.y1-this.y0));return{x:(this.x1-this.x0)/t,y:(this.y1-this.y0)/t}},C.prototype.getPropertiesAtLength=function(t){var n=this.getPointAtLength(t),e=this.getTangentAtLength();return{x:n.x,y:n.y,tangentX:e.x,tangentY:e.y}};var Qt=function(t){function n(t){if(!t)return null;for(var a,o=zt(t),s=[0,0],u=[0,0],h=0;h<o.length;h++)"M"===o[h][0]?(s=[o[h][1],o[h][2]],i.push(null)):"m"===o[h][0]?(s=[o[h][1]+s[0],o[h][2]+s[1]],i.push(null)):"L"===o[h][0]?(e+=Math.sqrt(Math.pow(s[0]-o[h][1],2)+Math.pow(s[1]-o[h][2],2)),i.push(new Nt(s[0],o[h][1],s[1],o[h][2])),s=[o[h][1],o[h][2]]):"l"===o[h][0]?(e+=Math.sqrt(Math.pow(o[h][1],2)+Math.pow(o[h][2],2)),i.push(new Nt(s[0],o[h][1]+s[0],s[1],o[h][2]+s[1])),s=[o[h][1]+s[0],o[h][2]+s[1]]):"H"===o[h][0]?(e+=Math.abs(s[0]-o[h][1]),i.push(new Nt(s[0],o[h][1],s[1],s[1])),s[0]=o[h][1]):"h"===o[h][0]?(e+=Math.abs(o[h][1]),i.push(new Nt(s[0],s[0]+o[h][1],s[1],s[1])),s[0]=o[h][1]+s[0]):"V"===o[h][0]?(e+=Math.abs(s[1]-o[h][1]),i.push(new Nt(s[0],s[0],s[1],o[h][1])),s[1]=o[h][1]):"v"===o[h][0]?(e+=Math.abs(o[h][1]),i.push(new Nt(s[0],s[0],s[1],s[1]+o[h][1])),s[1]=o[h][1]+s[1]):"z"===o[h][0]||"Z"===o[h][0]?(e+=Math.sqrt(Math.pow(o[0][1]-s[0],2)+Math.pow(o[0][2]-s[1],2)),i.push(new Nt(s[0],o[0][1],s[1],o[0][2])),s=[o[0][1],o[0][2]]):"C"===o[h][0]?(a=new It(s[0],s[1],o[h][1],o[h][2],o[h][3],o[h][4],o[h][5],o[h][6]),e+=a.getTotalLength(),s=[o[h][5],o[h][6]],i.push(a)):"c"===o[h][0]?(a=new It(s[0],s[1],s[0]+o[h][1],s[1]+o[h][2],s[0]+o[h][3],s[1]+o[h][4],s[0]+o[h][5],s[1]+o[h][6]),e+=a.getTotalLength(),s=[o[h][5]+s[0],o[h][6]+s[1]],i.push(a)):"S"===o[h][0]?(a=h>0&&["C","c","S","s"].indexOf(o[h-1][0])>-1?new It(s[0],s[1],2*s[0]-o[h-1][o[h-1].length-4],2*s[1]-o[h-1][o[h-1].length-3],o[h][1],o[h][2],o[h][3],o[h][4]):new It(s[0],s[1],s[0],s[1],o[h][1],o[h][2],o[h][3],o[h][4]),e+=a.getTotalLength(),s=[o[h][3],o[h][4]],i.push(a)):"s"===o[h][0]?(a=h>0&&["C","c","S","s"].indexOf(o[h-1][0])>-1?new It(s[0],s[1],s[0]+a.d.x-a.c.x,s[1]+a.d.y-a.c.y,s[0]+o[h][1],s[1]+o[h][2],s[0]+o[h][3],s[1]+o[h][4]):new It(s[0],s[1],s[0],s[1],s[0]+o[h][1],s[1]+o[h][2],s[0]+o[h][3],s[1]+o[h][4]),e+=a.getTotalLength(),s=[o[h][3]+s[0],o[h][4]+s[1]],i.push(a)):"Q"===o[h][0]?(a=new It(s[0],s[1],o[h][1],o[h][2],o[h][3],o[h][4]),e+=a.getTotalLength(),i.push(a),s=[o[h][3],o[h][4]],u=[o[h][1],o[h][2]]):"q"===o[h][0]?(a=new It(s[0],s[1],s[0]+o[h][1],s[1]+o[h][2],s[0]+o[h][3],s[1]+o[h][4]),e+=a.getTotalLength(),u=[s[0]+o[h][1],s[1]+o[h][2]],s=[o[h][3]+s[0],o[h][4]+s[1]],i.push(a)):"T"===o[h][0]?(a=h>0&&["Q","q","T","t"].indexOf(o[h-1][0])>-1?new It(s[0],s[1],2*s[0]-u[0],2*s[1]-u[1],o[h][1],o[h][2]):new Nt(s[0],o[h][1],s[1],o[h][2]),i.push(a),e+=a.getTotalLength(),u=[2*s[0]-u[0],2*s[1]-u[1]],s=[o[h][1],o[h][2]]):"t"===o[h][0]?(a=h>0&&["Q","q","T","t"].indexOf(o[h-1][0])>-1?new It(s[0],s[1],2*s[0]-u[0],2*s[1]-u[1],s[0]+o[h][1],s[1]+o[h][2]):new Nt(s[0],s[0]+o[h][1],s[1],s[1]+o[h][2]),e+=a.getTotalLength(),u=[2*s[0]-u[0],2*s[1]-u[1]],s=[o[h][1]+s[0],o[h][2]+s[0]],i.push(a)):"A"===o[h][0]?(a=new Ht(s[0],s[1],o[h][1],o[h][2],o[h][3],o[h][4],o[h][5],o[h][6],o[h][7]),e+=a.getTotalLength(),s=[o[h][6],o[h][7]],i.push(a)):"a"===o[h][0]&&(a=new Ht(s[0],s[1],o[h][1],o[h][2],o[h][3],o[h][4],o[h][5],s[0]+o[h][6],s[1]+o[h][7]),e+=a.getTotalLength(),s=[s[0]+o[h][6],s[1]+o[h][7]],i.push(a)),r.push(e);return n}var e=0,r=[],i=[];n.getTotalLength=function(){return e},n.getPointAtLength=function(t){var n=a(t);return i[n.i].getPointAtLength(n.fraction)},n.getTangentAtLength=function(t){var n=a(t);return i[n.i].getTangentAtLength(n.fraction)},n.getPropertiesAtLength=function(t){var n=a(t);return i[n.i].getPropertiesAtLength(n.fraction)};var a=function(t){t<0?t=0:t>e&&(t=e);for(var n=r.length-1;r[n]>=t&&r[n]>0;)n--;return n++,{fraction:t-r[n-1],i:n}};return n(t)},Ut='All shapes must be supplied as arrays of [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d).\nExample valid ways of supplying a shape would be:\n[[0, 0], [10, 0], [10, 10]]\n"M0,0 L10,0 L10,10Z"\n',Rt="flubber.all() expects two arrays of equal length as arguments. Each element in both arrays should be an array of [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d).",Bt=function(t,n){for(var e,r,i,a=t.length,o=1/0,s=0;s<a;s++)!function(i){r=0,n.forEach((function(n,e){var o=E(t[(i+e)%a],n);r+=o*o})),r<o&&(o=r,e=i)}(s);e&&(i=t.splice(0,e),t.splice.apply(t,[t.length,0].concat(i)))},Wt=D;D.deviation=function(t,n,e,r){var i=n&&n.length,a=i?n[0]*e:t.length,o=Math.abs(ft(t,0,a,e));if(i)for(var s=0,u=n.length;s<u;s++){var h=n[s]*e,c=s<u-1?n[s+1]*e:t.length;o-=Math.abs(ft(t,h,c,e))}var f=0;for(s=0;s<r.length;s+=3){var l=r[s]*e,p=r[s+1]*e,g=r[s+2]*e;f+=Math.abs((t[l]-t[g])*(t[p+1]-t[l+1])-(t[l]-t[p])*(t[g+1]-t[l+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},D.flatten=function(t){for(var n=t[0][0].length,e={vertices:[],holes:[],dimensions:n},r=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<n;o++)e.vertices.push(t[i][a][o]);i>0&&(r+=t[i-1].length,e.holes.push(r))}return e};var $t=function(t){return t},Jt=function(t){if(null==t)return $t;var n,e,r=t.scale[0],i=t.scale[1],a=t.translate[0],o=t.translate[1];return function(t,s){s||(n=e=0);var u=2,h=t.length,c=new Array(h);for(c[0]=(n+=t[0])*r+a,c[1]=(e+=t[1])*i+o;u<h;)c[u]=t[u],++u;return c}},Kt=function(t,n){for(var e,r=t.length,i=r-n;i<--r;)e=t[i],t[i++]=t[r],t[r]=e},tn=function(t,n){return"GeometryCollection"===n.type?{type:"FeatureCollection",features:n.geometries.map((function(n){return lt(t,n)}))}:lt(t,n)},nn=function(t,n){function e(n){var e,r=t.arcs[n<0?~n:n],i=r[0];return t.transform?(e=[0,0],r.forEach((function(t){e[0]+=t[0],e[1]+=t[1]}))):e=r[r.length-1],n<0?[e,i]:[i,e]}function r(t,n){for(var e in t){var r=t[e];delete n[r.start],delete r.start,delete r.end,r.forEach((function(t){i[t<0?~t:t]=1})),s.push(r)}}var i={},a={},o={},s=[],u=-1;return n.forEach((function(e,r){var i,a=t.arcs[e<0?~e:e];a.length<3&&!a[1][0]&&!a[1][1]&&(i=n[++u],n[u]=e,n[r]=i)})),n.forEach((function(t){var n,r,i=e(t),s=i[0],u=i[1];if(n=o[s])if(delete o[n.end],n.push(t),n.end=u,r=a[u]){delete a[r.start];var h=r===n?n:n.concat(r);a[h.start=n.start]=o[h.end=r.end]=h}else a[n.start]=o[n.end]=n;else if(n=a[u])if(delete a[n.start],n.unshift(t),n.start=s,r=o[s]){delete o[r.end];var c=r===n?n:r.concat(n);a[c.start=r.start]=o[c.end=n.end]=c}else a[n.start]=o[n.end]=n;else a[(n=[t]).start=s]=o[n.end=u]=n})),r(o,a),r(a,o),n.forEach((function(t){i[t<0?~t:t]||s.push([t])})),s},en=function(t,n){for(var e=0,r=t.length;e<r;){var i=e+r>>>1;t[i]<n?e=i+1:r=i}return e},rn=function(t){function n(t,n){t.forEach((function(t){t<0&&(t=~t);var e=r[t];e?e.push(n):r[t]=[n]}))}function e(t,e){t.forEach((function(t){n(t,e)}))}var r={},i=t.map((function(){return[]})),a={LineString:n,MultiLineString:e,Polygon:e,MultiPolygon:function(t,n){t.forEach((function(t){e(t,n)}))}};for(var o in t.forEach((function t(n,e){"GeometryCollection"===n.type?n.geometries.forEach((function(n){t(n,e)})):n.type in a&&a[n.type](n.arcs,e)})),r)for(var s=r[o],u=s.length,h=0;h<u;++h)for(var c=h+1;c<u;++c){var f,l=s[h],p=s[c];(f=i[l])[o=en(f,p)]!==p&&f.splice(o,0,p),(f=i[p])[o=en(f,l)]!==l&&f.splice(o,0,l)}return i},an=function(t,n){return t<n?-1:t>n?1:t>=n?0:NaN},on=function(t){return 1===t.length&&(t=function(t){return function(n,e){return an(t(n),e)}}(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var a=r+i>>>1;t(n[a],e)<0?r=a+1:i=a}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var a=r+i>>>1;t(n[a],e)>0?i=a:r=a+1}return r}}},sn=(on(an).right,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2),function(t,n){return function(t,n){for(var e=t.objects.triangles.geometries,r=on((function(t){return t.area})).left;e.length>n;)!function(){var n=e[0],i=rn(e)[0][0],a=e[i],o=gt(t,[n,a]);o.area=n.area+a.area,o.type="Polygon",o.arcs=o.arcs[0],e.splice(i,1),e.shift(),e.splice(r(e,o.area),0,o)}();if(n>e.length)throw new RangeError("Can't collapse topology into "+n+" pieces.");return tn(t,t.objects.triangles).features.map((function(t){return t.geometry.coordinates[0].pop(),t.geometry.coordinates[0]}))}(function(t,n){var e={},r={type:"Topology",objects:{triangles:{type:"GeometryCollection",geometries:[]}},arcs:[]};return t.forEach((function(t){var i=[];t.forEach((function(t,a){var o=t[0]<t[1]?t.join(","):t[1]+","+t[0],s=t.map((function(t){return n[t]}));o in e?i.push(~e[o]):(i.push(e[o]=r.arcs.length),r.arcs.push(s))})),r.objects.triangles.geometries.push({type:"Polygon",area:Math.abs(Mt(t.map((function(t){return n[t[0]]})))),arcs:[i]})})),r.objects.triangles.geometries.sort((function(t,n){return t.area-n.area})),r}(function(t){for(var n=Wt(t.reduce((function(t,n){return t.concat([n[0]],[n[1]])}),[])),e=[],r=0,i=n.length;r<i;r+=3)e.push([[n[r],n[r+1]],[n[r+1],n[r+2]],[n[r+2],n[r]]]);return e}(t),t),n)}),un=function(t,n){if(t.length>8)return t.map((function(t,n){return n}));var e=t.map((function(t){return n.map((function(n){return function(t,n){var e=E(j(t),j(n));return e*e}(t,n)}))}));return function(t,n,e){var r=1/0,i=t.map((function(t,n){return n}));return function t(n,a,o){void 0===a&&(a=[]),void 0===o&&(o=0);for(var s=0;s<n.length;s++){var u=n.splice(s,1),h=e[u[0]][a.length];o+h<r&&(n.length?t(n.slice(),a.concat(u),o+h):(r=o+h,i=a.concat(u))),n.length&&n.splice(s,0,u[0])}}(i),i}(t,0,e)};t.interpolate=function(t,n,e){void 0===e&&(e={});var r=e.maxSegmentLength;void 0===r&&(r=10);var i=e.string;void 0===i&&(i=!0);var a=G(Y(t,r),Y(n,r),i);return!i||"string"!=typeof t&&"string"!=typeof n?a:function(e){return e<1e-4&&"string"==typeof t?t:1-e<1e-4&&"string"==typeof n?n:a(e)}},t.separate=vt,t.combine=function(t,n,e){void 0===e&&(e={});var r=e.maxSegmentLength;void 0===r&&(r=10);var i=e.string;void 0===i&&(i=!0);var a=e.single;void 0===a&&(a=!1);var o=vt(n,t,{maxSegmentLength:r,string:i,single:a});return a?function(t){return o(1-t)}:o.map((function(t){return function(n){return t(1-n)}}))},t.interpolateAll=function(t,n,e){void 0===e&&(e={});var r=e.maxSegmentLength;void 0===r&&(r=10);var i=e.string;void 0===i&&(i=!0);var a=e.single;if(void 0===a&&(a=!1),!Array.isArray(t)||!Array.isArray(n)||t.length!==n.length||!t.length)throw new TypeError(Rt);var o,s,u=function(t){return Y(t,r)},h=t.map(u),c=n.map(u);return a?(t.every((function(t){return"string"==typeof t}))&&(o=t.slice(0)),n.every((function(t){return"string"==typeof t}))&&(s=n.slice(0))):(o=t.slice(0),s=n.slice(0)),xt(h,c,{string:i,single:a,t0:o,t1:s,match:!1})},t.splitPathString=function(t){return O(z(t))},t.toPathString=I,t.fromCircle=yt,t.toCircle=function(t,n,e,r,i){var a=yt(n,e,r,t,i);return function(t){return a(1-t)}},t.fromRect=dt,t.toRect=function(t,n,e,r,i,a){var o=dt(n,e,r,i,t,a);return function(t){return o(1-t)}},Object.defineProperty(t,"__esModule",{value:!0})}(n)}},n={};function e(r){var i=n[r];if(void 0!==i)return i.exports;var a=n[r]={exports:{}};return t[r].call(a.exports,a,a.exports,e),a.exports}e.d=(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";e.r(r),e.d(r,{morphPath:()=>a,morphPathSimple:()=>s,morphPathSmooth:()=>o});var t=e(814);function n(t){var n=function(t,n,e){return Math.min(Math.max(t,n),e)}(t,0,1);return Math.pow(n,2)*(3-2*n)}var i=function(){return i=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var i in n=arguments[e])Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t},i.apply(this,arguments)};function a(t,e,r,i){var a=null,o=null,s=null,u="duration"in i?i.duration:500,h="easing"in i&&"function"==typeof i.easing?i.easing:n;function c(n){null===a&&(a=n),null===o&&(o="function"==typeof t?t():t),null===s&&(s=r(o.getAttribute("d"),e));var i=n-a,f=Math.min(i/u,1),l=h(f),p=s(l);o.setAttribute("d",p),f<1&&requestAnimationFrame(c)}return function(n){return n({animate:!0,animateCallback:function(){a=null,o=null,s=null,requestAnimationFrame(c)},updateCallback:function(){("function"==typeof t?t():t).setAttribute("d",e)}})}}function o(n,e,r){return void 0===r&&(r={}),a(n,e,(function(n,e){var i;return(0,t.interpolate)(n,e,{maxSegmentLength:null!==(i=r.maxSegmentLength)&&void 0!==i?i:10})}),r)}function s(t,n,e){void 0===e&&(e={});var r="duration"in e?e.duration:500,a="easing"in e&&"string"==typeof e.easing?e.easing:null;return function(e){var o="function"==typeof t?t():t;e({animate:!0,element:o,animationParams:i({d:n,duration:r},null!==a?{easing:a}:{}),updateCallback:function(){o.setAttribute("d",n)}})}}})(),r})()));
|
package/dist/presenter.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Presenter=n():t.Presenter=n()}(this,(()=>(()=>{"use strict";var t={d:(n,e)=>{for(var r in e)t.o(e,r)&&!t.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:e[r]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};t.r(n),t.d(n,{Arrow:()=>St,BoundingBox:()=>e,Group:()=>Pt,Image:()=>At,Line:()=>vt,Paragraph:()=>kt,Polygon:()=>wt,Presentation:()=>o,Rectangle:()=>zt,Slide:()=>ht,SlideObject:()=>dt,Text:()=>Dt,VectorGraphic:()=>qt,anime:()=>it,generateTextNodes:()=>It,performAnimation:()=>lt,skipAnimation:()=>pt});var e=function(){function t(t,n,e){this.origin=t,this.width=n,this.height=e}return t.fromElement=function(n){var e=n.getBBox();return new t({x:e.x,y:e.y},e.width,e.height)},t}(),r=function(){return r=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},r.apply(this,arguments)},o=function(){function t(t,n,o,i){if(void 0===i&&(i={}),null===this.element)throw new Error("Presentation cannot be mounted to null element.");this.title=t,this.element=o,this.slides=n,this.options=r({width:3840,height:2160,backgroundColor:"#ffffff"},i),this.presentationState={currentSlide:0},this.boundingBox=new e({x:0,y:0},this.options.width,this.options.height),this.container=null,this.svg=null,this.shadow=null}return t.prototype.present=function(){var t=this;this.container=document.createElement("div"),this.container.style.width="100%",this.container.style.aspectRatio="".concat(this.options.width," / ").concat(this.options.height),this.container.style.position="relative",this.container.style.top="50%",this.container.style.transform="translateY(-50%)",this.container.style.marginLeft="auto",this.container.style.marginRight="auto",this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.backgroundColor=this.options.backgroundColor,this.svg.style.cursor="none",this.setupKeyboardCommands(),this.shadow=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.shadow.style.visibility="hidden",[this.svg,this.shadow].forEach((function(n){n.setAttribute("width","100%"),n.setAttribute("viewBox","0 0 ".concat(t.options.width," ").concat(t.options.height)),n.style.position="absolute"})),this.isFullBodyPresentation()&&(document.title=this.title,document.documentElement.style.height="100%",document.body.style.height="100%",document.body.style.width="100%",document.body.style.margin="0",document.body.style.backgroundColor="#000000",window.matchMedia("(min-aspect-ratio: ".concat(this.options.width," / ").concat(this.options.height,")")).addEventListener("change",this.updateSVGContainerSize.bind(this)),this.updateSVGContainerSize()),this.container.appendChild(this.shadow),this.container.appendChild(this.svg),this.element.appendChild(this.container),this.presentationState.currentSlide=0;var n=this.slides[this.presentationState.currentSlide];void 0!==n&&n.render(this)},t.prototype.setupKeyboardCommands=function(){var t=this,n=this.isFullBodyPresentation()?document.body:this.svg;n.addEventListener("keyup",(function(n){"ArrowRight"===n.key||" "===n.key?t.next(!n.shiftKey):"ArrowLeft"===n.key&&t.previous(!n.shiftKey)})),n.addEventListener("mousemove",(function(n){t.svg.style.cursor="auto"}))},t.prototype.updateSVGContainerSize=function(){window.innerHeight/window.innerWidth>this.options.height/this.options.width?(this.container.style.width="100%",this.container.style.height="auto"):(this.container.style.width="auto",this.container.style.height="100%")},t.prototype.next=function(t){this.svg.style.cursor="none";var n=this.slides[this.presentationState.currentSlide];if(!(void 0===n||t&&n.nextAnimation(this))){this.presentationState.currentSlide++;var e=this.slides[this.presentationState.currentSlide];if(void 0===e)return;e.render(this)}},t.prototype.previous=function(t){this.svg.style.cursor="none";var n=this.slides[this.presentationState.currentSlide];if(void 0!==n){if(t&&n.animationIndex>0)n.render(this,n.animationIndex-1);else if(!t||0!==this.presentationState.currentSlide){this.presentationState.currentSlide>0&&this.presentationState.currentSlide--;var e=this.slides[this.presentationState.currentSlide];void 0!==e&&e.render(this,t?e.animations.length:0)}}else{this.presentationState.currentSlide=this.slides.length-1;var r=this.slides[this.presentationState.currentSlide];if(void 0===r)return;r.render(this,t?r.animations.length:0)}},t.prototype.isFullBodyPresentation=function(){return this.element===document.body},t.prototype.computeRenderedBoundingBox=function(t,n){if(void 0===n&&(n=null),null===n&&this.svg.contains(t))return e.fromElement(t);var r=t.cloneNode(!0);if(null!==n){r.innerHTML="";for(var o=0,i=n;o<i.length;o++){var a=i[o];r.appendChild(a.cloneNode(!0))}}this.shadow.appendChild(r);var s=e.fromElement(r);return this.shadow.removeChild(r),s},t}(),i={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},a={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},s=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],u={CSS:{},springs:{}};function c(t,n,e){return Math.min(Math.max(t,n),e)}function l(t,n){return t.indexOf(n)>-1}function p(t,n){return t.apply(null,n)}var h={arr:function(t){return Array.isArray(t)},obj:function(t){return l(Object.prototype.toString.call(t),"Object")},pth:function(t){return h.obj(t)&&t.hasOwnProperty("totalLength")},svg:function(t){return t instanceof SVGElement},inp:function(t){return t instanceof HTMLInputElement},dom:function(t){return t.nodeType||h.svg(t)},str:function(t){return"string"==typeof t},fnc:function(t){return"function"==typeof t},und:function(t){return void 0===t},nil:function(t){return h.und(t)||null===t},hex:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)},rgb:function(t){return/^rgb/.test(t)},hsl:function(t){return/^hsl/.test(t)},col:function(t){return h.hex(t)||h.rgb(t)||h.hsl(t)},key:function(t){return!i.hasOwnProperty(t)&&!a.hasOwnProperty(t)&&"targets"!==t&&"keyframes"!==t}};function f(t){var n=/\(([^)]+)\)/.exec(t);return n?n[1].split(",").map((function(t){return parseFloat(t)})):[]}function d(t,n){var e=f(t),r=c(h.und(e[0])?1:e[0],.1,100),o=c(h.und(e[1])?100:e[1],.1,100),i=c(h.und(e[2])?10:e[2],.1,100),a=c(h.und(e[3])?0:e[3],.1,100),s=Math.sqrt(o/r),l=i/(2*Math.sqrt(o*r)),p=l<1?s*Math.sqrt(1-l*l):0,d=l<1?(l*s-a)/p:-a+s;function y(t){var e=n?n*t/1e3:t;return e=l<1?Math.exp(-e*l*s)*(1*Math.cos(p*e)+d*Math.sin(p*e)):(1+d*e)*Math.exp(-e*s),0===t||1===t?t:1-e}return n?y:function(){var n=u.springs[t];if(n)return n;for(var e=1/6,r=0,o=0;;)if(1===y(r+=e)){if(++o>=16)break}else o=0;var i=r*e*1e3;return u.springs[t]=i,i}}function y(t){return void 0===t&&(t=10),function(n){return Math.ceil(c(n,1e-6,1)*t)*(1/t)}}var g,v,m=function(){var t=.1;function n(t,n){return 1-3*n+3*t}function e(t,n){return 3*n-6*t}function r(t){return 3*t}function o(t,o,i){return((n(o,i)*t+e(o,i))*t+r(o))*t}function i(t,o,i){return 3*n(o,i)*t*t+2*e(o,i)*t+r(o)}return function(n,e,r,a){if(0<=n&&n<=1&&0<=r&&r<=1){var s=new Float32Array(11);if(n!==e||r!==a)for(var u=0;u<11;++u)s[u]=o(u*t,n,r);return function(u){return n===e&&r===a||0===u||1===u?u:o(function(e){for(var a=0,u=1;10!==u&&s[u]<=e;++u)a+=t;--u;var c=a+(e-s[u])/(s[u+1]-s[u])*t,l=i(c,n,r);return l>=.001?function(t,n,e,r){for(var a=0;a<4;++a){var s=i(n,e,r);if(0===s)return n;n-=(o(n,e,r)-t)/s}return n}(e,c,n,r):0===l?c:function(t,n,e,r,i){var a,s,u=0;do{(a=o(s=n+(e-n)/2,r,i)-t)>0?e=s:n=s}while(Math.abs(a)>1e-7&&++u<10);return s}(e,a,a+t,n,r)}(u),e,a)}}}}(),b=(g={linear:function(){return function(t){return t}}},v={Sine:function(){return function(t){return 1-Math.cos(t*Math.PI/2)}},Expo:function(){return function(t){return t?Math.pow(2,10*t-10):0}},Circ:function(){return function(t){return 1-Math.sqrt(1-t*t)}},Back:function(){return function(t){return t*t*(3*t-2)}},Bounce:function(){return function(t){for(var n,e=4;t<((n=Math.pow(2,--e))-1)/11;);return 1/Math.pow(4,3-e)-7.5625*Math.pow((3*n-2)/22-t,2)}},Elastic:function(t,n){void 0===t&&(t=1),void 0===n&&(n=.5);var e=c(t,1,10),r=c(n,.1,2);return function(t){return 0===t||1===t?t:-e*Math.pow(2,10*(t-1))*Math.sin((t-1-r/(2*Math.PI)*Math.asin(1/e))*(2*Math.PI)/r)}}},["Quad","Cubic","Quart","Quint"].forEach((function(t,n){v[t]=function(){return function(t){return Math.pow(t,n+2)}}})),Object.keys(v).forEach((function(t){var n=v[t];g["easeIn"+t]=n,g["easeOut"+t]=function(t,e){return function(r){return 1-n(t,e)(1-r)}},g["easeInOut"+t]=function(t,e){return function(r){return r<.5?n(t,e)(2*r)/2:1-n(t,e)(-2*r+2)/2}},g["easeOutIn"+t]=function(t,e){return function(r){return r<.5?(1-n(t,e)(1-2*r))/2:(n(t,e)(2*r-1)+1)/2}}})),g);function w(t,n){if(h.fnc(t))return t;var e=t.split("(")[0],r=b[e],o=f(t);switch(e){case"spring":return d(t,n);case"cubicBezier":return p(m,o);case"steps":return p(y,o);default:return p(r,o)}}function x(t){try{return document.querySelectorAll(t)}catch(t){return}}function O(t,n){for(var e=t.length,r=arguments.length>=2?arguments[1]:void 0,o=[],i=0;i<e;i++)if(i in t){var a=t[i];n.call(r,a,i,t)&&o.push(a)}return o}function S(t){return t.reduce((function(t,n){return t.concat(h.arr(n)?S(n):n)}),[])}function _(t){return h.arr(t)?t:(h.str(t)&&(t=x(t)||t),t instanceof NodeList||t instanceof HTMLCollection?[].slice.call(t):[t])}function j(t,n){return t.some((function(t){return t===n}))}function P(t){var n={};for(var e in t)n[e]=t[e];return n}function C(t,n){var e=P(t);for(var r in t)e[r]=n.hasOwnProperty(r)?n[r]:t[r];return e}function M(t,n){var e=P(t);for(var r in n)e[r]=h.und(t[r])?n[r]:t[r];return e}function A(t){var n=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t);if(n)return n[1]}function B(t,n){return h.fnc(t)?t(n.target,n.id,n.total):t}function E(t,n){return t.getAttribute(n)}function k(t,n,e){if(j([e,"deg","rad","turn"],A(n)))return n;var r=u.CSS[n+e];if(!h.und(r))return r;var o=document.createElement(t.tagName),i=t.parentNode&&t.parentNode!==document?t.parentNode:document.body;i.appendChild(o),o.style.position="absolute",o.style.width=100+e;var a=100/o.offsetWidth;i.removeChild(o);var s=a*parseFloat(n);return u.CSS[n+e]=s,s}function I(t,n,e){if(n in t.style){var r=n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=t.style[n]||getComputedStyle(t).getPropertyValue(r)||"0";return e?k(t,o,e):o}}function T(t,n){return h.dom(t)&&!h.inp(t)&&(!h.nil(E(t,n))||h.svg(t)&&t[n])?"attribute":h.dom(t)&&j(s,n)?"transform":h.dom(t)&&"transform"!==n&&I(t,n)?"css":null!=t[n]?"object":void 0}function N(t){if(h.dom(t)){for(var n,e=t.style.transform||"",r=/(\w+)\(([^)]*)\)/g,o=new Map;n=r.exec(e);)o.set(n[1],n[2]);return o}}function D(t,n,e,r){switch(T(t,n)){case"transform":return function(t,n,e,r){var o=l(n,"scale")?1:0+function(t){return l(t,"translate")||"perspective"===t?"px":l(t,"rotate")||l(t,"skew")?"deg":void 0}(n),i=N(t).get(n)||o;return e&&(e.transforms.list.set(n,i),e.transforms.last=n),r?k(t,i,r):i}(t,n,r,e);case"css":return I(t,n,e);case"attribute":return E(t,n);default:return t[n]||0}}function F(t,n){var e=/^(\*=|\+=|-=)/.exec(t);if(!e)return t;var r=A(t)||0,o=parseFloat(n),i=parseFloat(t.replace(e[0],""));switch(e[0][0]){case"+":return o+i+r;case"-":return o-i+r;case"*":return o*i+r}}function L(t,n){if(h.col(t))return function(t){return h.rgb(t)?(e=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(n=t))?"rgba("+e[1]+",1)":n:h.hex(t)?function(t){var n=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,n,e,r){return n+n+e+e+r+r})),e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return"rgba("+parseInt(e[1],16)+","+parseInt(e[2],16)+","+parseInt(e[3],16)+",1)"}(t):h.hsl(t)?function(t){var n,e,r,o=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(t),i=parseInt(o[1],10)/360,a=parseInt(o[2],10)/100,s=parseInt(o[3],10)/100,u=o[4]||1;function c(t,n,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?t+6*(n-t)*e:e<.5?n:e<2/3?t+(n-t)*(2/3-e)*6:t}if(0==a)n=e=r=s;else{var l=s<.5?s*(1+a):s+a-s*a,p=2*s-l;n=c(p,l,i+1/3),e=c(p,l,i),r=c(p,l,i-1/3)}return"rgba("+255*n+","+255*e+","+255*r+","+u+")"}(t):void 0;var n,e}(t);if(/\s/g.test(t))return t;var e=A(t),r=e?t.substr(0,t.length-e.length):t;return n?r+n:r}function z(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function W(t){for(var n,e=t.points,r=0,o=0;o<e.numberOfItems;o++){var i=e.getItem(o);o>0&&(r+=z(n,i)),n=i}return r}function H(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return function(t){return 2*Math.PI*E(t,"r")}(t);case"rect":return function(t){return 2*E(t,"width")+2*E(t,"height")}(t);case"line":return function(t){return z({x:E(t,"x1"),y:E(t,"y1")},{x:E(t,"x2"),y:E(t,"y2")})}(t);case"polyline":return W(t);case"polygon":return function(t){var n=t.points;return W(t)+z(n.getItem(n.numberOfItems-1),n.getItem(0))}(t)}}function q(t,n){var e=n||{},r=e.el||function(t){for(var n=t.parentNode;h.svg(n)&&h.svg(n.parentNode);)n=n.parentNode;return n}(t),o=r.getBoundingClientRect(),i=E(r,"viewBox"),a=o.width,s=o.height,u=e.viewBox||(i?i.split(" "):[0,0,a,s]);return{el:r,viewBox:u,x:u[0]/1,y:u[1]/1,w:a,h:s,vW:u[2],vH:u[3]}}function R(t,n,e){function r(e){void 0===e&&(e=0);var r=n+e>=1?n+e:0;return t.el.getPointAtLength(r)}var o=q(t.el,t.svg),i=r(),a=r(-1),s=r(1),u=e?1:o.w/o.vW,c=e?1:o.h/o.vH;switch(t.property){case"x":return(i.x-o.x)*u;case"y":return(i.y-o.y)*c;case"angle":return 180*Math.atan2(s.y-a.y,s.x-a.x)/Math.PI}}function V(t,n){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=L(h.pth(t)?t.totalLength:t,n)+"";return{original:r,numbers:r.match(e)?r.match(e).map(Number):[0],strings:h.str(t)||n?r.split(e):[]}}function G(t){return O(t?S(h.arr(t)?t.map(_):_(t)):[],(function(t,n,e){return e.indexOf(t)===n}))}function $(t){var n=G(t);return n.map((function(t,e){return{target:t,id:e,total:n.length,transforms:{list:N(t)}}}))}function K(t,n){var e=P(n);if(/^spring/.test(e.easing)&&(e.duration=d(e.easing)),h.arr(t)){var r=t.length;2!==r||h.obj(t[0])?h.fnc(n.duration)||(e.duration=n.duration/r):t={value:t}}var o=h.arr(t)?t:[t];return o.map((function(t,e){var r=h.obj(t)&&!h.pth(t)?t:{value:t};return h.und(r.delay)&&(r.delay=e?0:n.delay),h.und(r.endDelay)&&(r.endDelay=e===o.length-1?n.endDelay:0),r})).map((function(t){return M(t,e)}))}var Y={css:function(t,n,e){return t.style[n]=e},attribute:function(t,n,e){return t.setAttribute(n,e)},object:function(t,n,e){return t[n]=e},transform:function(t,n,e,r,o){if(r.list.set(n,e),n===r.last||o){var i="";r.list.forEach((function(t,n){i+=n+"("+t+") "})),t.style.transform=i}}};function U(t,n){$(t).forEach((function(t){for(var e in n){var r=B(n[e],t),o=t.target,i=A(r),a=D(o,e,i,t),s=F(L(r,i||A(a)),a),u=T(o,e);Y[u](o,e,s,t.transforms,!0)}}))}function X(t,n){return O(S(t.map((function(t){return n.map((function(n){return function(t,n){var e=T(t.target,n.name);if(e){var r=function(t,n){var e;return t.tweens.map((function(r){var o=function(t,n){var e={};for(var r in t){var o=B(t[r],n);h.arr(o)&&1===(o=o.map((function(t){return B(t,n)}))).length&&(o=o[0]),e[r]=o}return e.duration=parseFloat(e.duration),e.delay=parseFloat(e.delay),e}(r,n),i=o.value,a=h.arr(i)?i[1]:i,s=A(a),u=D(n.target,t.name,s,n),c=e?e.to.original:u,l=h.arr(i)?i[0]:c,p=A(l)||A(u),f=s||p;return h.und(a)&&(a=c),o.from=V(l,f),o.to=V(F(a,l),f),o.start=e?e.end:0,o.end=o.start+o.delay+o.duration+o.endDelay,o.easing=w(o.easing,o.duration),o.isPath=h.pth(i),o.isPathTargetInsideSVG=o.isPath&&h.svg(n.target),o.isColor=h.col(o.from.original),o.isColor&&(o.round=1),e=o,o}))}(n,t),o=r[r.length-1];return{type:e,property:n.name,animatable:t,tweens:r,duration:o.end,delay:r[0].delay,endDelay:o.endDelay}}}(t,n)}))}))),(function(t){return!h.und(t)}))}function Z(t,n){var e=t.length,r=function(t){return t.timelineOffset?t.timelineOffset:0},o={};return o.duration=e?Math.max.apply(Math,t.map((function(t){return r(t)+t.duration}))):n.duration,o.delay=e?Math.min.apply(Math,t.map((function(t){return r(t)+t.delay}))):n.delay,o.endDelay=e?o.duration-Math.max.apply(Math,t.map((function(t){return r(t)+t.duration-t.endDelay}))):n.endDelay,o}var Q=0,J=[],tt=function(){var t;function n(e){for(var r=J.length,o=0;o<r;){var i=J[o];i.paused?(J.splice(o,1),r--):(i.tick(e),o++)}t=o>0?requestAnimationFrame(n):void 0}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){et.suspendWhenDocumentHidden&&(nt()?t=cancelAnimationFrame(t):(J.forEach((function(t){return t._onDocumentVisibility()})),tt()))})),function(){t||nt()&&et.suspendWhenDocumentHidden||!(J.length>0)||(t=requestAnimationFrame(n))}}();function nt(){return!!document&&document.hidden}function et(t){void 0===t&&(t={});var n,e=0,r=0,o=0,s=0,u=null;function l(t){var n=window.Promise&&new Promise((function(t){return u=t}));return t.finished=n,n}var p=function(t){var n=C(i,t),e=C(a,t),r=function(t,n){var e=[],r=n.keyframes;for(var o in r&&(n=M(function(t){for(var n=O(S(t.map((function(t){return Object.keys(t)}))),(function(t){return h.key(t)})).reduce((function(t,n){return t.indexOf(n)<0&&t.push(n),t}),[]),e={},r=function(r){var o=n[r];e[o]=t.map((function(t){var n={};for(var e in t)h.key(e)?e==o&&(n.value=t[e]):n[e]=t[e];return n}))},o=0;o<n.length;o++)r(o);return e}(r),n)),n)h.key(o)&&e.push({name:o,tweens:K(n[o],t)});return e}(e,t),o=$(t.targets),s=X(o,r),u=Z(s,e),c=Q;return Q++,M(n,{id:c,children:[],animatables:o,animations:s,duration:u.duration,delay:u.delay,endDelay:u.endDelay})}(t);function f(){var t=p.direction;"alternate"!==t&&(p.direction="normal"!==t?"normal":"reverse"),p.reversed=!p.reversed,n.forEach((function(t){return t.reversed=p.reversed}))}function d(t){return p.reversed?p.duration-t:t}function y(){e=0,r=d(p.currentTime)*(1/et.speed)}function g(t,n){n&&n.seek(t-n.timelineOffset)}function v(t){for(var n=0,e=p.animations,r=e.length;n<r;){var o=e[n],i=o.animatable,a=o.tweens,s=a.length-1,u=a[s];s&&(u=O(a,(function(n){return t<n.end}))[0]||u);for(var l=c(t-u.start-u.delay,0,u.duration)/u.duration,h=isNaN(l)?1:u.easing(l),f=u.to.strings,d=u.round,y=[],g=u.to.numbers.length,v=void 0,m=0;m<g;m++){var b=void 0,w=u.to.numbers[m],x=u.from.numbers[m]||0;b=u.isPath?R(u.value,h*w,u.isPathTargetInsideSVG):x+h*(w-x),d&&(u.isColor&&m>2||(b=Math.round(b*d)/d)),y.push(b)}var S=f.length;if(S){v=f[0];for(var _=0;_<S;_++){f[_];var j=f[_+1],P=y[_];isNaN(P)||(v+=j?P+j:P+" ")}}else v=y[0];Y[o.type](i.target,o.property,v,i.transforms),o.currentValue=v,n++}}function m(t){p[t]&&!p.passThrough&&p[t](p)}function b(t){var i=p.duration,a=p.delay,h=i-p.endDelay,y=d(t);p.progress=c(y/i*100,0,100),p.reversePlayback=y<p.currentTime,n&&function(t){if(p.reversePlayback)for(var e=s;e--;)g(t,n[e]);else for(var r=0;r<s;r++)g(t,n[r])}(y),!p.began&&p.currentTime>0&&(p.began=!0,m("begin")),!p.loopBegan&&p.currentTime>0&&(p.loopBegan=!0,m("loopBegin")),y<=a&&0!==p.currentTime&&v(0),(y>=h&&p.currentTime!==i||!i)&&v(i),y>a&&y<h?(p.changeBegan||(p.changeBegan=!0,p.changeCompleted=!1,m("changeBegin")),m("change"),v(y)):p.changeBegan&&(p.changeCompleted=!0,p.changeBegan=!1,m("changeComplete")),p.currentTime=c(y,0,i),p.began&&m("update"),t>=i&&(r=0,p.remaining&&!0!==p.remaining&&p.remaining--,p.remaining?(e=o,m("loopComplete"),p.loopBegan=!1,"alternate"===p.direction&&f()):(p.paused=!0,p.completed||(p.completed=!0,m("loopComplete"),m("complete"),!p.passThrough&&"Promise"in window&&(u(),l(p)))))}return l(p),p.reset=function(){var t=p.direction;p.passThrough=!1,p.currentTime=0,p.progress=0,p.paused=!0,p.began=!1,p.loopBegan=!1,p.changeBegan=!1,p.completed=!1,p.changeCompleted=!1,p.reversePlayback=!1,p.reversed="reverse"===t,p.remaining=p.loop,n=p.children;for(var e=s=n.length;e--;)p.children[e].reset();(p.reversed&&!0!==p.loop||"alternate"===t&&1===p.loop)&&p.remaining++,v(p.reversed?p.duration:0)},p._onDocumentVisibility=y,p.set=function(t,n){return U(t,n),p},p.tick=function(t){o=t,e||(e=o),b((o+(r-e))*et.speed)},p.seek=function(t){b(d(t))},p.pause=function(){p.paused=!0,y()},p.play=function(){p.paused&&(p.completed&&p.reset(),p.paused=!1,J.push(p),y(),tt())},p.reverse=function(){f(),p.completed=!p.reversed,y()},p.restart=function(){p.reset(),p.play()},p.remove=function(t){ot(G(t),p)},p.reset(),p.autoplay&&p.play(),p}function rt(t,n){for(var e=n.length;e--;)j(t,n[e].animatable.target)&&n.splice(e,1)}function ot(t,n){var e=n.animations,r=n.children;rt(t,e);for(var o=r.length;o--;){var i=r[o],a=i.animations;rt(t,a),a.length||i.children.length||r.splice(o,1)}e.length||r.length||n.pause()}et.version="3.2.1",et.speed=1,et.suspendWhenDocumentHidden=!0,et.running=J,et.remove=function(t){for(var n=G(t),e=J.length;e--;)ot(n,J[e])},et.get=D,et.set=U,et.convertPx=k,et.path=function(t,n){var e=h.str(t)?x(t)[0]:t,r=n||100;return function(t){return{property:t,el:e,svg:q(e),totalLength:H(e)*(r/100)}}},et.setDashoffset=function(t){var n=H(t);return t.setAttribute("stroke-dasharray",n),n},et.stagger=function(t,n){void 0===n&&(n={});var e=n.direction||"normal",r=n.easing?w(n.easing):null,o=n.grid,i=n.axis,a=n.from||0,s="first"===a,u="center"===a,c="last"===a,l=h.arr(t),p=l?parseFloat(t[0]):parseFloat(t),f=l?parseFloat(t[1]):0,d=A(l?t[1]:t)||0,y=n.start||0+(l?p:0),g=[],v=0;return function(t,n,h){if(s&&(a=0),u&&(a=(h-1)/2),c&&(a=h-1),!g.length){for(var m=0;m<h;m++){if(o){var b=u?(o[0]-1)/2:a%o[0],w=u?(o[1]-1)/2:Math.floor(a/o[0]),x=b-m%o[0],O=w-Math.floor(m/o[0]),S=Math.sqrt(x*x+O*O);"x"===i&&(S=-x),"y"===i&&(S=-O),g.push(S)}else g.push(Math.abs(a-m));v=Math.max.apply(Math,g)}r&&(g=g.map((function(t){return r(t/v)*v}))),"reverse"===e&&(g=g.map((function(t){return i?t<0?-1*t:-t:Math.abs(v-t)})))}return y+(l?(f-p)/v:p)*(Math.round(100*g[n])/100)+d}},et.timeline=function(t){void 0===t&&(t={});var n=et(t);return n.duration=0,n.add=function(e,r){var o=J.indexOf(n),i=n.children;function s(t){t.passThrough=!0}o>-1&&J.splice(o,1);for(var u=0;u<i.length;u++)s(i[u]);var c=M(e,C(a,t));c.targets=c.targets||t.targets;var l=n.duration;c.autoplay=!1,c.direction=n.direction,c.timelineOffset=h.und(r)?l:F(r,l),s(n),n.seek(c.timelineOffset);var p=et(c);s(p),i.push(p);var f=Z(i,t);return n.delay=f.delay,n.endDelay=f.endDelay,n.duration=f.duration,n.seek(0),n.reset(),n.autoplay&&n.play(),n},n},et.easing=w,et.penner=b,et.random=function(t,n){return Math.floor(Math.random()*(n-t+1))+t};const it=et;var at,st=function(){return st=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},st.apply(this,arguments)},ut=function(t,n,e,r){return new(e||(e=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(a,s)}u((r=r.apply(t,n||[])).next())}))},ct=function(t,n){var e,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(e=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=n.call(t,i)}catch(t){s=[6,t],r=0}finally{e=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},lt=function(t){return ut(void 0,void 0,void 0,(function(){var n,e,r,o,i,a,s;return ct(this,(function(u){switch(u.label){case 0:Array.isArray(t)||(t=[t]),n=function(t){var n,e,r;return ct(this,(function(o){switch(o.label){case 0:return void 0===t.delay?[3,2]:[4,new Promise((function(n){return setTimeout(n,t.delay)}))];case 1:o.sent(),o.label=2;case 2:if(!1===t.animate&&pt(t),void 0!==t.element&&(it(st(st(st({targets:t.element},null!==(i=t.attributes)&&void 0!==i?i:{}),null!==(a=t.styles)&&void 0!==a?a:{}),null!==(s=t.animationParams)&&void 0!==s?s:{})),t.children))for(t.element.innerHTML="",n=0,e=t.children;n<e.length;n++)r=e[n],t.element.appendChild(r);return[2]}}))},e=0,r=t,u.label=1;case 1:return e<r.length?(o=r[e],[5,n(o)]):[3,4];case 2:u.sent(),u.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},pt=function(t){return ut(void 0,void 0,void 0,(function(){var n,e,r,o,i,a,s,u,c,l,p,h,f,d,y;return ct(this,(function(g){for(Array.isArray(t)||(t=[t]),n=0,e=t;n<e.length;n++)if(r=e[n],o=r.element){if(r.attributes)for(i=0,a=Object.entries(r.attributes);i<a.length;i++)s=a[i],p=s[0],h=s[1],o.setAttribute(p,h);if(r.styles)for(u=0,c=Object.entries(r.styles);u<c.length;u++)l=c[u],p=l[0],h=l[1],o.style[p]=h;if(r.children)for(o.innerHTML="",f=0,d=r.children;f<d.length;f++)y=d[f],o.appendChild(y)}return[2]}))}))},ht=function(){function t(t,n){void 0===n&&(n=[]),this.objects=t.filter((function(t){return null!==t})),this.animations=n,this.animationIndex=0,this.debugAnimation=null,this.keyBuilds=null}return t.prototype.render=function(t,n){if(void 0===n&&(n=0),this.animationIndex=n,this.objects.forEach((function(n){n.generate(t)})),null===this.debugAnimation||t.svg.innerHTML)for(e=0;e<this.animationIndex;e++)(r=this.animations[e])&&r(pt);else{for(var e=0;e<=this.debugAnimation;e++){var r;(r=this.animations[e])&&r(pt)}this.animationIndex=this.debugAnimation+1}t.svg.innerHTML="",this.objects.forEach((function(n){t.svg.appendChild(n.element())}))},t.prototype.nextAnimation=function(t){var n=this.animations[this.animationIndex];return!!n&&(n(lt),this.animationIndex++,!0)},t.prototype.getKeyBuilds=function(){var t=this;return"first"===this.keyBuilds?[0]:"last"===this.keyBuilds?[this.animations.length]:"all"===this.keyBuilds?Array.from({length:this.animations.length+1},(function(t,n){return n})):"none"===this.keyBuilds?[]:Array.isArray(this.keyBuilds)?this.keyBuilds.filter((function(n){return n>=0&&n<=t.animations.length})):[0]},t}(),ft=function(){return ft=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},ft.apply(this,arguments)},dt=function(){function t(t){this.props=ft({position:{x:0,y:0},anchor:"topleft"},t),this.initialProps=ft({},this.props),this._element=null,this._presentation=null,this._children=[]}return t.prototype.tagName=function(){return"g"},t.prototype.attributes=function(){return{}},t.prototype.additionalAttributes=function(){return{}},t.prototype.styles=function(){var t=this.props.opacity;return ft({},void 0!==t?{opacity:t.toString()}:{})},t.prototype.children=function(){return[]},t.prototype.requiresChildrenUpdate=function(t){return!1},t.prototype.positionAttributes=function(t){if(null===this._presentation)throw new Error("Cannot compute object position attributes without presentation");var n=this.positionInPresentation(t.origin),r=n.x,o=n.y,i=this.anchorBoundingBox(new e({x:r,y:o},t.width,t.height));return{x:i.origin.x,y:i.origin.y}},t.prototype.generate=function(t){this.props=ft({},this.initialProps),this._presentation=t;for(var n=this.createElement(),e=0,r=Object.entries(this.attributes());e<r.length;e++){var o=r[e],i=o[0],a=o[1];n.setAttribute(i,a)}for(var s=0,u=Object.entries(this.styles());s<u.length;s++){var c=u[s],l=c[0];a=c[1],n.style.setProperty(l,a)}this._children=this.children();for(var p=0,h=this._children;p<h.length;p++){var f=h[p];n.appendChild(f)}this._element=n;for(var d=0,y=Object.entries(this.additionalAttributes());d<y.length;d++){var g=y[d];i=g[0],a=g[1],n.setAttribute(i,a)}return n},t.prototype.createElement=function(){return document.createElementNS("http://www.w3.org/2000/svg",this.tagName())},t.prototype.element=function(){if(null===this._element)throw new Error("Element not yet generated");return this._element},t.prototype.animation=function(t,n,e,r){var o=this;if(void 0===n&&(n={}),void 0===e&&(e=null),void 0===r&&(r=!0),null===this._presentation)throw new Error("Cannot animate object without presentation");var i=this.requiresChildrenUpdate(t);this.props=ft(ft({},this.props),t),i&&(this._children=this.children());var a=this.attributes(),s=this.styles(),u=this.additionalAttributes(),c=Object.fromEntries(Object.entries(a).filter((function(t){var n=t[0],e=t[1];return o._element.getAttribute(n)!==e}))),l=Object.fromEntries(Object.entries(s).filter((function(t){var n=t[0],e=t[1];return o._element.style.getPropertyValue(n)!==e}))),p=Object.fromEntries(Object.entries(u).filter((function(t){var n=t[0],e=t[1];return o._element.getAttribute(n)!==e})));return ft(ft(ft({animate:r,element:this.element(),attributes:ft(ft({},c),p),styles:l},null!==e?{delay:e}:{}),i?{children:this._children}:{}),{animationParams:ft(ft({duration:500,easing:"linear"},n),"cubic"===n.easing?{easing:"cubicBezier(0.42, 0, 0.58, 1)"}:{})})},t.prototype.update=function(t,n){return void 0===n&&(n=null),this.animation(t,{},n,!1)},t.prototype.animate=function(t,n){var e=this;return void 0===n&&(n={}),function(r){r(e.animation(t,n))}},t.prototype.set=function(t){var n=this;return function(e){e(n.update(t))}},t.prototype.move=function(t,n){return void 0===n&&(n={}),this.animate({position:t},n)},t.prototype.positionInPresentation=function(t){var n=this._presentation,e=t.x,r=t.y;return e<=1&&e>=-1&&(e*=n.boundingBox.width),r<=1&&r>=-1&&(r*=n.boundingBox.height),{x:e,y:r}},t.prototype.anchorBoundingBox=function(t){var n=this,r=function(){switch(n.props.anchor){case"topleft":case"top":case"topright":return t.origin.y;case"left":case"center":case"right":return t.origin.y-t.height/2;case"bottomleft":case"bottom":case"bottomright":return t.origin.y-t.height}}(),o=function(){switch(n.props.anchor){case"topleft":case"left":case"bottomleft":return t.origin.x;case"top":case"center":case"bottom":return t.origin.x-t.width/2;case"topright":case"right":case"bottomright":return t.origin.x-t.width}}();return new e({x:o,y:r},t.width,t.height)},t.prototype.computeRenderedBoundingBox=function(t,n){void 0===n&&(n=null);var r=this._presentation.computeRenderedBoundingBox(t,n);return new e({x:this.props.position.x,y:this.props.position.y},r.width,r.height)},t}(),yt=(at=function(t,n){return at=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},at(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}at(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),gt=function(){return gt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},gt.apply(this,arguments)},vt=function(t){function n(n){return void 0===n&&(n={}),t.call(this,gt({start:{x:0,y:0},end:{x:100,y:100},color:"#000000",width:10},n))||this}return yt(n,t),n.prototype.tagName=function(){return"line"},n.prototype.attributes=function(){var n=this.props,e=n.color,r=n.width,o=this.positionInPresentation(this.props.start),i=this.positionInPresentation(this.props.end);return gt(gt({},t.prototype.attributes.call(this)),{x1:o.x.toString(),y1:o.y.toString(),x2:i.x.toString(),y2:i.y.toString(),stroke:e,"stroke-width":r.toString()})},n}(dt),mt=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),bt=function(){return bt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},bt.apply(this,arguments)},wt=function(t){function n(n,e){return void 0===e&&(e={}),t.call(this,bt({points:n,fill:"#000000",borderWidth:0,borderColor:"#000000"},e))||this}return mt(n,t),n.prototype.tagName=function(){return"polygon"},n.prototype.attributes=function(){var n=this.props,e=n.points,r=n.fill,o=n.borderWidth,i=n.borderColor,a=e.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ");return bt(bt(bt({},t.prototype.attributes.call(this)),{points:a,fill:r}),o>0?{"stroke-width":o.toString(),stroke:i}:{})},n}(dt),xt=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Ot=function(){return Ot=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},Ot.apply(this,arguments)},St=function(t){function n(n){void 0===n&&(n={});var e,r,o=this,i=null!==(e=n.width)&&void 0!==e?e:10,a=null!==(r=n.arrowSize)&&void 0!==r?r:4*i;return(o=t.call(this,Ot({start:{x:0,y:0},end:{x:100,y:100},color:"#000000",width:i,arrowSize:a},n))||this).line=null,o.arrowhead=null,o}return xt(n,t),n.prototype.tagName=function(){return"g"},n.prototype.calculateShapes=function(t){t.width;var n=t.arrowSize,e=this.positionInPresentation(t.start),r=this.positionInPresentation(t.end),o=Math.atan2(r.y-e.y,r.x-e.x);return{line:{start:e,end:{x:r.x-n/2*Math.cos(o),y:r.y-n/2*Math.sin(o)}},arrowhead:[{x:r.x-n*Math.cos(o-Math.PI/6),y:r.y-n*Math.sin(o-Math.PI/6)},r,{x:r.x-n*Math.cos(o+Math.PI/6),y:r.y-n*Math.sin(o+Math.PI/6)}]}},n.prototype.children=function(){var t=this.props,n=t.color,e=t.width,r=(t.arrowSize,this.positionInPresentation(this.props.start)),o=this.positionInPresentation(this.props.end),i=(Math.atan2(o.y-r.y,o.x-r.x),this.calculateShapes(this.props));return this.line=new vt({start:i.line.start,end:i.line.end,color:n,width:e}),this.line.generate(this._presentation),this.arrowhead=new wt(i.arrowhead,{fill:n,borderWidth:0,borderColor:n}),this.arrowhead.generate(this._presentation),[this.line.element(),this.arrowhead.element()]},n.prototype.animations=function(t,n){void 0===n&&(n={});var e=Ot(Ot({},this.props),t),r=this.calculateShapes(e);return[this.line.animation(Ot(Ot({start:r.line.start,end:r.line.end},t.color?{color:t.color}:{}),t.width?{width:t.width}:{}),n),this.arrowhead.animation(Ot({points:r.arrowhead},t.color?{fill:t.color}:{}),n)]},n}(dt),_t=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),jt=function(){return jt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},jt.apply(this,arguments)},Pt=function(t){function n(n,e,r){return void 0===e&&(e={}),void 0===r&&(r=null),t.call(this,jt({objects:n,position:{x:0,y:0},positioned:null===r?"position"in e:r},e))||this}return _t(n,t),n.prototype.tagName=function(){return"g"},n.prototype.attributes=function(){return jt({},t.prototype.attributes.call(this))},n.prototype.additionalAttributes=function(){if(!this.props.positioned){var t=this.positionInPresentation(this.props.position),n=t.x,r=t.y;return{transform:"translate(".concat(n,", ").concat(r,")")}}var o=this._presentation.computeRenderedBoundingBox(this._element),i=this.positionInPresentation(this.props.position),a=i.x,s=i.y,u=this.anchorBoundingBox(new e({x:a,y:s},o.width,o.height)),c=u.origin.x-o.origin.x,l=u.origin.y-o.origin.y;return{transform:"translate(".concat(c,", ").concat(l,")")}},n.prototype.children=function(){var t=this;return this.props.objects.map((function(n){return n.generate(t._presentation),n._element}))},n}(dt),Ct=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Mt=function(){return Mt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},Mt.apply(this,arguments)},At=function(t){function n(n,e){return void 0===e&&(e={}),t.call(this,Mt({href:n,width:100,height:100},e))||this}return Ct(n,t),n.prototype.tagName=function(){return"image"},n.prototype.attributes=function(){var n=this.props,r=n.position,o=n.href,i=n.width,a=n.height,s=this.positionAttributes(new e(r,i,a)),u=s.x,c=s.y;return Mt(Mt({},t.prototype.attributes.call(this)),{href:o,width:i.toString(),height:a.toString(),x:u.toString(),y:c.toString()})},n}(dt),Bt=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Et=function(){return Et=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},Et.apply(this,arguments)},kt=function(t){function n(n,e){return void 0===e&&(e={}),t.call(this,Et({content:n,width:1e3,height:1e3,fontSize:100,fontFamily:"Arial",color:"#000000"},e))||this}return Bt(n,t),n.prototype.tagName=function(){return"foreignObject"},n.prototype.attributes=function(){var n=this.props,e=n.position,r=n.width,o=n.height;return Et(Et({},t.prototype.attributes.call(this)),{x:e.x.toString(),y:e.y.toString(),width:r.toString(),height:o.toString()})},n.prototype.children=function(){for(var t=this.props.content,n=document.createElement("div"),e={"font-family":'"'.concat(this.props.fontFamily,'"'),"font-size":"".concat(this.props.fontSize,"px"),color:this.props.color},r=0,o=Object.entries(e);r<o.length;r++){var i=o[r],a=i[0],s=i[1];console.log([a,s]),void 0!==s&&n.style.setProperty(a,s.toString())}if("string"==typeof t)n.textContent=t;else for(var u=0,c=t;u<c.length;u++){var l=c[u],p=document.createElement("p");p.textContent=l,n.appendChild(p)}return[n]},n.prototype.additionalAttributes=function(){var n=this.computeRenderedBoundingBox(this.element(),this._children),e=this.positionAttributes(n),r=e.x,o=e.y;return Et(Et({},t.prototype.additionalAttributes.call(this)),{x:r.toString(),y:o.toString()})},n.prototype.requiresChildrenUpdate=function(t){return"content"in t&&t.content!==this.props.content},n}(dt);function It(t,n,e){void 0===n&&(n="1em"),void 0===e&&(e="start");for(var r=[],o=0,i=0,a=t;i<a.length;i++){var s=a[i];o++;var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");if(u.setAttribute("x","0"),u.setAttribute("text-anchor",e),o>1&&u.setAttribute("dy",n),0===s.length||1===s.length&&""===s[0])u.appendChild(document.createTextNode(" ")),r.push(u);else if("string"!=typeof s){for(var c=0,l=s;c<l.length;c++){var p=l[c];if("string"==typeof p)u.appendChild(document.createTextNode(p));else{var h=p[0],f=p[1],d=document.createElementNS("http://www.w3.org/2000/svg","tspan");d.textContent=h;for(var y={fill:f.color,dy:f.dy,"text-decoration":f.textDecoration},g=0,v=Object.entries(y);g<v.length;g++){var m=v[g],b=m[0];void 0!==(S=m[1])&&d.setAttribute(b,S.toString())}for(var w={"font-family":f.fontFamily?'"'.concat(f.fontFamily,'"'):void 0,"font-size":f.fontSize,"font-weight":f.fontWeight,"font-style":f.fontStyle},x=0,O=Object.entries(w);x<O.length;x++){var S,_=O[x];b=_[0],void 0!==(S=_[1])&&d.style.setProperty(b,S.toString())}u.appendChild(d)}}r.push(u)}else u.appendChild(document.createTextNode(s)),r.push(u)}return r}var Tt=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Nt=function(){return Nt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},Nt.apply(this,arguments)},Dt=function(t){function n(n,e){return void 0===e&&(e={}),t.call(this,Nt({content:n,color:"#000000",fontSize:150,fontStyle:"normal",fontWeight:"normal",fontFamily:"Arial",dominantBaseline:"ideographic",textDecoration:"none",align:"left",lineSpacing:"1em"},e))||this}return Tt(n,t),n.prototype.isRichText=function(){return"string"!=typeof this.props.content},n.prototype.tagName=function(){return"text"},n.prototype.attributes=function(){var n=this.props,e=n.color,r=n.textDecoration;return Nt(Nt(Nt({},t.prototype.attributes.call(this)),"none"!==r?{"text-decoration":r}:{}),{fill:e})},n.prototype.additionalAttributes=function(){var n=this.computeRenderedBoundingBox(this.element(),this._children),e=this.positionAttributes(n),r=e.x,o=e.y;return Nt(Nt(Nt({},t.prototype.additionalAttributes.call(this)),this.isRichText()?{transform:"translate(".concat(r.toString()," ").concat(o.toString(),")"),y:"1em"}:{x:r.toString(),y:(o+n.height).toString()}),{"dominant-baseline":this.props.dominantBaseline})},n.prototype.styles=function(){var n=this.props,e=n.fontSize,r=n.fontFamily,o=n.fontStyle,i=n.fontWeight;return Nt(Nt(Nt(Nt({},t.prototype.styles.call(this)),"normal"!==o?{"font-style":o}:{}),"normal"!==i?{"font-weight":i.toString()}:{}),{"font-size":"".concat(e,"px"),"font-family":'"'.concat(r,'"'),"white-space":"pre"})},n.prototype.children=function(){var t=this.props.content;if("string"==typeof t)return[document.createTextNode(t)];var n="left"===this.props.align?"start":"center"===this.props.align?"middle":"end";return It(t,this.props.lineSpacing,n)},n.prototype.requiresChildrenUpdate=function(t){return"content"in t&&t.content!==this.props.content},n}(dt),Ft=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Lt=function(){return Lt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},Lt.apply(this,arguments)},zt=function(t){function n(n){return void 0===n&&(n={}),t.call(this,Lt({fill:"#000000",width:100,height:100,rounding:0,borderWidth:0,borderColor:"#000000"},n))||this}return Ft(n,t),n.prototype.tagName=function(){return"rect"},n.prototype.attributes=function(){var n=this.props,r=n.position,o=n.width,i=n.height,a=n.fill,s=n.rounding,u=n.borderWidth,c=n.borderColor,l=this.positionAttributes(new e(r,o,i)),p=l.x,h=l.y;return Lt(Lt(Lt({},t.prototype.attributes.call(this)),{fill:a,width:o.toString(),height:i.toString(),rx:s.toString(),x:p.toString(),y:h.toString()}),u>0?{"stroke-width":u.toString(),stroke:c}:{})},n}(dt),Wt=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Ht=function(){return Ht=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},Ht.apply(this,arguments)},qt=function(t){function n(n,e){return void 0===e&&(e={}),t.call(this,Ht({svg:n,width:100,height:100},e))||this}return Wt(n,t),n.prototype.tagName=function(){return"svg"},n.prototype.createElement=function(){var t=(new DOMParser).parseFromString(this.props.svg,"image/svg+xml").documentElement;return this.parsedChildren=Array.from(t.childNodes),t.innerHTML="",t},n.prototype.attributes=function(){var n=this.props,r=n.position,o=n.width,i=n.height,a=this.positionAttributes(new e(r,o,i)),s=a.x,u=a.y;return Ht(Ht({},t.prototype.attributes.call(this)),{width:o.toString(),height:i.toString(),x:s.toString(),y:u.toString()})},n.prototype.children=function(){return this.parsedChildren},n}(dt);return n})()));
|
|
1
|
+
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Presenter=n():t.Presenter=n()}(this,(()=>(()=>{"use strict";var t={d:(n,e)=>{for(var r in e)t.o(e,r)&&!t.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:e[r]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};t.r(n),t.d(n,{Arrow:()=>_t,BoundingBox:()=>e,Circle:()=>Et,Grid:()=>Bt,Group:()=>It,Image:()=>Dt,Line:()=>wt,Paragraph:()=>qt,Polygon:()=>St,Presentation:()=>o,Rectangle:()=>$t,Slide:()=>yt,SlideObject:()=>vt,Text:()=>Gt,VectorGraphic:()=>Xt,animateStateChange:()=>pt,anime:()=>it,clamp:()=>Zt,easeCubic:()=>Jt,easeLinear:()=>Qt,generateTextNodes:()=>zt,performAnimation:()=>lt,skipAnimation:()=>ct});var e=function(){function t(t,n,e){this.origin=t,this.width=n,this.height=e}return t.fromElement=function(n){var e=n.getBBox();return new t({x:e.x,y:e.y},e.width,e.height)},t}(),r=function(){return r=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},r.apply(this,arguments)},o=function(){function t(t,n,o,i){void 0===i&&(i={});var a=this;if(null===this.element)throw new Error("Presentation cannot be mounted to null element.");if(0===n.length)throw new Error("Presentation requires at least one slide");this.title=t,this.element=o,this.slides=n,this.options=r({width:3840,height:2160,backgroundColor:"#ffffff"},i),this.presentationState={currentSlide:0},this.boundingBox=new e({x:0,y:0},this.options.width,this.options.height),this.container=null,this.svg=null,this.shadow=null,this.background=null,this.additionalElementContainer=null,this.textCommand={active:!1,command:""},this.shortcuts={s:{slideIndex:0,animationIndex:0},e:{slideIndex:n.length-1,animationIndex:n[n.length-1].animations.length}};for(var s=0;s<n.length;s++)this.shortcuts[(s+1).toString()]={slideIndex:s,animationIndex:0};n.forEach((function(t,n){t.props.shortcuts.forEach((function(t){var e="string"==typeof t?t:t[0],r="string"==typeof t?0:t[1];a.shortcuts[e]={slideIndex:n,animationIndex:r}}))}))}return t.prototype.present=function(){var t=this;this.container=document.createElement("div"),this.container.style.width="100%",this.container.style.aspectRatio="".concat(this.options.width," / ").concat(this.options.height),this.container.style.position="relative",this.container.style.top="50%",this.container.style.transform="translateY(-50%)",this.container.style.marginLeft="auto",this.container.style.marginRight="auto",this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.backgroundColor="transparent",this.svg.style.cursor="none",this.setupKeyboardCommands(),this.shadow=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.shadow.style.visibility="hidden",this.background=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.background.style.backgroundColor=this.options.backgroundColor,this.additionalElementContainer=document.createElement("div"),this.additionalElementContainer.style.width="100%",this.additionalElementContainer.style.height="100%",this.additionalElementContainer.style.position="absolute",[this.svg,this.shadow,this.background].forEach((function(n){n.setAttribute("width","100%"),n.setAttribute("viewBox","0 0 ".concat(t.options.width," ").concat(t.options.height)),n.style.position="absolute"})),this.isFullBodyPresentation()&&(document.title=this.title,document.documentElement.style.height="100%",document.body.style.height="100%",document.body.style.width="100%",document.body.style.margin="0",document.body.style.backgroundColor="#000000",window.matchMedia("(min-aspect-ratio: ".concat(this.options.width," / ").concat(this.options.height,")")).addEventListener("change",this.updateSVGContainerSize.bind(this)),this.updateSVGContainerSize()),this.navigatorContainer=document.createElement("div"),this.navigatorContainer.style.position="absolute",this.navigatorContainer.style.height="100%",this.navigatorContainer.style.width="200px",this.navigatorContainer.style.backgroundColor="#e6e6e6",this.navigatorContainer.style.overflow="scroll",this.navigatorContainer.style.display="none",this.slides.forEach((function(n,e){var r=document.createElement("button");r.style.display="block",r.style.margin="10px",r.style.padding="10px",r.style.width="calc(100% - 20px)",r.style.textAlign="left",r.style.backgroundColor="transparent",r.style.border="none",r.style.cursor="pointer",r.innerHTML="".concat(e+1),null!==n.props.title&&(r.innerHTML+=": ".concat(n.props.title)),r.addEventListener("click",(function(){t.navigatorContainer.style.display="none",t.presentationState.currentSlide=e,n.render(t)})),t.navigatorContainer.appendChild(r)})),this.container.appendChild(this.shadow),this.container.appendChild(this.background),this.container.appendChild(this.additionalElementContainer),this.container.appendChild(this.svg),this.container.appendChild(this.navigatorContainer),this.element.appendChild(this.container),this.presentationState.currentSlide=0;var n=this.slides[this.presentationState.currentSlide];void 0!==n&&n.render(this)},t.prototype.setupKeyboardCommands=function(){var t=this,n=this.isFullBodyPresentation()?document.body:this.container;n.addEventListener("keyup",this.handleKeyboardEvent.bind(this)),n.addEventListener("mousemove",(function(){t.svg.style.cursor="auto"}))},t.prototype.handleKeyboardEvent=function(t){if("Escape"!==t.key){if("ArrowRight"===t.key||" "===t.key)return this.resetTextCommand(),void this.next(!t.shiftKey);if("ArrowLeft"===t.key)return this.resetTextCommand(),void this.previous(!t.shiftKey);if(this.textCommand.active){if("Enter"===t.key){var n=this.textCommand.command;this.resetTextCommand();var e=this.shortcuts[n];if(void 0===e)return;var r=this.slides[this.presentationState.currentSlide];this.shortcuts.b={slideIndex:this.presentationState.currentSlide,animationIndex:r.animationIndex},this.presentationState.currentSlide=e.slideIndex;var o=this.slides[this.presentationState.currentSlide];if(void 0===o)return;return void o.render(this,e.animationIndex)}"Backspace"===t.key?this.textCommand.command=this.textCommand.command.slice(0,-1):this.textCommand.command+=t.key}else if("g"===t.key)this.textCommand.active=!0,this.textCommand.command="";else if("`"===t.key){var i="block"===this.navigatorContainer.style.display;this.navigatorContainer.style.display=i?"none":"block"}}else this.resetTextCommand()},t.prototype.resetTextCommand=function(){this.textCommand.active=!1,this.textCommand.command=""},t.prototype.updateSVGContainerSize=function(){window.innerHeight/window.innerWidth>this.options.height/this.options.width?(this.container.style.width="100%",this.container.style.height="auto"):(this.container.style.width="auto",this.container.style.height="100%")},t.prototype.next=function(t){return n=this,e=void 0,o=function(){var n,e,r;return function(t,n){var e,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(e=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=n.call(t,i)}catch(t){s=[6,t],r=0}finally{e=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}(this,(function(o){switch(o.label){case 0:return this.svg.style.cursor="none",void 0===(n=this.slides[this.presentationState.currentSlide])?[2]:(e=!t)?[3,2]:[4,n.nextAnimation()];case 1:e=!o.sent(),o.label=2;case 2:if(e){if(this.presentationState.currentSlide++,void 0===(r=this.slides[this.presentationState.currentSlide]))return[2];r.render(this)}return[2]}}))},new((r=void 0)||(r=Promise))((function(t,i){function a(t){try{u(o.next(t))}catch(t){i(t)}}function s(t){try{u(o.throw(t))}catch(t){i(t)}}function u(n){var e;n.done?t(n.value):(e=n.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((o=o.apply(n,e||[])).next())}));var n,e,r,o},t.prototype.previous=function(t){this.svg.style.cursor="none";var n=this.slides[this.presentationState.currentSlide];if(void 0!==n){if(t&&n.animationIndex>0)n.render(this,n.animationIndex-1);else if(!t||0!==this.presentationState.currentSlide){this.presentationState.currentSlide>0&&this.presentationState.currentSlide--;var e=this.slides[this.presentationState.currentSlide];void 0!==e&&e.render(this,t?e.animations.length:0)}}else{this.presentationState.currentSlide=this.slides.length-1;var r=this.slides[this.presentationState.currentSlide];if(void 0===r)return;r.render(this,t?r.animations.length:0)}},t.prototype.isFullBodyPresentation=function(){return this.element===document.body},t.prototype.computeRenderedBoundingBox=function(t,n){if(void 0===n&&(n=null),null===n&&this.svg.contains(t))return e.fromElement(t);var r=t.cloneNode(!0);if(null!==n){r.innerHTML="";for(var o=0,i=n;o<i.length;o++){var a=i[o];r.appendChild(a.cloneNode(!0))}}this.shadow.appendChild(r);var s=e.fromElement(r);return this.shadow.removeChild(r),s},t}(),i={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},a={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},s=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],u={CSS:{},springs:{}};function l(t,n,e){return Math.min(Math.max(t,n),e)}function c(t,n){return t.indexOf(n)>-1}function p(t,n){return t.apply(null,n)}var h={arr:function(t){return Array.isArray(t)},obj:function(t){return c(Object.prototype.toString.call(t),"Object")},pth:function(t){return h.obj(t)&&t.hasOwnProperty("totalLength")},svg:function(t){return t instanceof SVGElement},inp:function(t){return t instanceof HTMLInputElement},dom:function(t){return t.nodeType||h.svg(t)},str:function(t){return"string"==typeof t},fnc:function(t){return"function"==typeof t},und:function(t){return void 0===t},nil:function(t){return h.und(t)||null===t},hex:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)},rgb:function(t){return/^rgb/.test(t)},hsl:function(t){return/^hsl/.test(t)},col:function(t){return h.hex(t)||h.rgb(t)||h.hsl(t)},key:function(t){return!i.hasOwnProperty(t)&&!a.hasOwnProperty(t)&&"targets"!==t&&"keyframes"!==t}};function f(t){var n=/\(([^)]+)\)/.exec(t);return n?n[1].split(",").map((function(t){return parseFloat(t)})):[]}function d(t,n){var e=f(t),r=l(h.und(e[0])?1:e[0],.1,100),o=l(h.und(e[1])?100:e[1],.1,100),i=l(h.und(e[2])?10:e[2],.1,100),a=l(h.und(e[3])?0:e[3],.1,100),s=Math.sqrt(o/r),c=i/(2*Math.sqrt(o*r)),p=c<1?s*Math.sqrt(1-c*c):0,d=c<1?(c*s-a)/p:-a+s;function y(t){var e=n?n*t/1e3:t;return e=c<1?Math.exp(-e*c*s)*(1*Math.cos(p*e)+d*Math.sin(p*e)):(1+d*e)*Math.exp(-e*s),0===t||1===t?t:1-e}return n?y:function(){var n=u.springs[t];if(n)return n;for(var e=1/6,r=0,o=0;;)if(1===y(r+=e)){if(++o>=16)break}else o=0;var i=r*e*1e3;return u.springs[t]=i,i}}function y(t){return void 0===t&&(t=10),function(n){return Math.ceil(l(n,1e-6,1)*t)*(1/t)}}var g,v,m=function(){var t=.1;function n(t,n){return 1-3*n+3*t}function e(t,n){return 3*n-6*t}function r(t){return 3*t}function o(t,o,i){return((n(o,i)*t+e(o,i))*t+r(o))*t}function i(t,o,i){return 3*n(o,i)*t*t+2*e(o,i)*t+r(o)}return function(n,e,r,a){if(0<=n&&n<=1&&0<=r&&r<=1){var s=new Float32Array(11);if(n!==e||r!==a)for(var u=0;u<11;++u)s[u]=o(u*t,n,r);return function(u){return n===e&&r===a||0===u||1===u?u:o(function(e){for(var a=0,u=1;10!==u&&s[u]<=e;++u)a+=t;--u;var l=a+(e-s[u])/(s[u+1]-s[u])*t,c=i(l,n,r);return c>=.001?function(t,n,e,r){for(var a=0;a<4;++a){var s=i(n,e,r);if(0===s)return n;n-=(o(n,e,r)-t)/s}return n}(e,l,n,r):0===c?l:function(t,n,e,r,i){var a,s,u=0;do{(a=o(s=n+(e-n)/2,r,i)-t)>0?e=s:n=s}while(Math.abs(a)>1e-7&&++u<10);return s}(e,a,a+t,n,r)}(u),e,a)}}}}(),b=(g={linear:function(){return function(t){return t}}},v={Sine:function(){return function(t){return 1-Math.cos(t*Math.PI/2)}},Expo:function(){return function(t){return t?Math.pow(2,10*t-10):0}},Circ:function(){return function(t){return 1-Math.sqrt(1-t*t)}},Back:function(){return function(t){return t*t*(3*t-2)}},Bounce:function(){return function(t){for(var n,e=4;t<((n=Math.pow(2,--e))-1)/11;);return 1/Math.pow(4,3-e)-7.5625*Math.pow((3*n-2)/22-t,2)}},Elastic:function(t,n){void 0===t&&(t=1),void 0===n&&(n=.5);var e=l(t,1,10),r=l(n,.1,2);return function(t){return 0===t||1===t?t:-e*Math.pow(2,10*(t-1))*Math.sin((t-1-r/(2*Math.PI)*Math.asin(1/e))*(2*Math.PI)/r)}}},["Quad","Cubic","Quart","Quint"].forEach((function(t,n){v[t]=function(){return function(t){return Math.pow(t,n+2)}}})),Object.keys(v).forEach((function(t){var n=v[t];g["easeIn"+t]=n,g["easeOut"+t]=function(t,e){return function(r){return 1-n(t,e)(1-r)}},g["easeInOut"+t]=function(t,e){return function(r){return r<.5?n(t,e)(2*r)/2:1-n(t,e)(-2*r+2)/2}},g["easeOutIn"+t]=function(t,e){return function(r){return r<.5?(1-n(t,e)(1-2*r))/2:(n(t,e)(2*r-1)+1)/2}}})),g);function w(t,n){if(h.fnc(t))return t;var e=t.split("(")[0],r=b[e],o=f(t);switch(e){case"spring":return d(t,n);case"cubicBezier":return p(m,o);case"steps":return p(y,o);default:return p(r,o)}}function x(t){try{return document.querySelectorAll(t)}catch(t){return}}function O(t,n){for(var e=t.length,r=arguments.length>=2?arguments[1]:void 0,o=[],i=0;i<e;i++)if(i in t){var a=t[i];n.call(r,a,i,t)&&o.push(a)}return o}function S(t){return t.reduce((function(t,n){return t.concat(h.arr(n)?S(n):n)}),[])}function C(t){return h.arr(t)?t:(h.str(t)&&(t=x(t)||t),t instanceof NodeList||t instanceof HTMLCollection?[].slice.call(t):[t])}function j(t,n){return t.some((function(t){return t===n}))}function _(t){var n={};for(var e in t)n[e]=t[e];return n}function P(t,n){var e=_(t);for(var r in t)e[r]=n.hasOwnProperty(r)?n[r]:t[r];return e}function k(t,n){var e=_(t);for(var r in n)e[r]=h.und(t[r])?n[r]:t[r];return e}function E(t){var n=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t);if(n)return n[1]}function A(t,n){return h.fnc(t)?t(n.target,n.id,n.total):t}function M(t,n){return t.getAttribute(n)}function I(t,n,e){if(j([e,"deg","rad","turn"],E(n)))return n;var r=u.CSS[n+e];if(!h.und(r))return r;var o=document.createElement(t.tagName),i=t.parentNode&&t.parentNode!==document?t.parentNode:document.body;i.appendChild(o),o.style.position="absolute",o.style.width=100+e;var a=100/o.offsetWidth;i.removeChild(o);var s=a*parseFloat(n);return u.CSS[n+e]=s,s}function T(t,n,e){if(n in t.style){var r=n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=t.style[n]||getComputedStyle(t).getPropertyValue(r)||"0";return e?I(t,o,e):o}}function B(t,n){return h.dom(t)&&!h.inp(t)&&(!h.nil(M(t,n))||h.svg(t)&&t[n])?"attribute":h.dom(t)&&j(s,n)?"transform":h.dom(t)&&"transform"!==n&&T(t,n)?"css":null!=t[n]?"object":void 0}function N(t){if(h.dom(t)){for(var n,e=t.style.transform||"",r=/(\w+)\(([^)]*)\)/g,o=new Map;n=r.exec(e);)o.set(n[1],n[2]);return o}}function L(t,n,e,r){switch(B(t,n)){case"transform":return function(t,n,e,r){var o=c(n,"scale")?1:0+function(t){return c(t,"translate")||"perspective"===t?"px":c(t,"rotate")||c(t,"skew")?"deg":void 0}(n),i=N(t).get(n)||o;return e&&(e.transforms.list.set(n,i),e.transforms.last=n),r?I(t,i,r):i}(t,n,r,e);case"css":return T(t,n,e);case"attribute":return M(t,n);default:return t[n]||0}}function D(t,n){var e=/^(\*=|\+=|-=)/.exec(t);if(!e)return t;var r=E(t)||0,o=parseFloat(n),i=parseFloat(t.replace(e[0],""));switch(e[0][0]){case"+":return o+i+r;case"-":return o-i+r;case"*":return o*i+r}}function F(t,n){if(h.col(t))return function(t){return h.rgb(t)?(e=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(n=t))?"rgba("+e[1]+",1)":n:h.hex(t)?function(t){var n=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,n,e,r){return n+n+e+e+r+r})),e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return"rgba("+parseInt(e[1],16)+","+parseInt(e[2],16)+","+parseInt(e[3],16)+",1)"}(t):h.hsl(t)?function(t){var n,e,r,o=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(t),i=parseInt(o[1],10)/360,a=parseInt(o[2],10)/100,s=parseInt(o[3],10)/100,u=o[4]||1;function l(t,n,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?t+6*(n-t)*e:e<.5?n:e<2/3?t+(n-t)*(2/3-e)*6:t}if(0==a)n=e=r=s;else{var c=s<.5?s*(1+a):s+a-s*a,p=2*s-c;n=l(p,c,i+1/3),e=l(p,c,i),r=l(p,c,i-1/3)}return"rgba("+255*n+","+255*e+","+255*r+","+u+")"}(t):void 0;var n,e}(t);if(/\s/g.test(t))return t;var e=E(t),r=e?t.substr(0,t.length-e.length):t;return n?r+n:r}function W(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function q(t){for(var n,e=t.points,r=0,o=0;o<e.numberOfItems;o++){var i=e.getItem(o);o>0&&(r+=W(n,i)),n=i}return r}function z(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return function(t){return 2*Math.PI*M(t,"r")}(t);case"rect":return function(t){return 2*M(t,"width")+2*M(t,"height")}(t);case"line":return function(t){return W({x:M(t,"x1"),y:M(t,"y1")},{x:M(t,"x2"),y:M(t,"y2")})}(t);case"polyline":return q(t);case"polygon":return function(t){var n=t.points;return q(t)+W(n.getItem(n.numberOfItems-1),n.getItem(0))}(t)}}function H(t,n){var e=n||{},r=e.el||function(t){for(var n=t.parentNode;h.svg(n)&&h.svg(n.parentNode);)n=n.parentNode;return n}(t),o=r.getBoundingClientRect(),i=M(r,"viewBox"),a=o.width,s=o.height,u=e.viewBox||(i?i.split(" "):[0,0,a,s]);return{el:r,viewBox:u,x:u[0]/1,y:u[1]/1,w:a,h:s,vW:u[2],vH:u[3]}}function R(t,n,e){function r(e){void 0===e&&(e=0);var r=n+e>=1?n+e:0;return t.el.getPointAtLength(r)}var o=H(t.el,t.svg),i=r(),a=r(-1),s=r(1),u=e?1:o.w/o.vW,l=e?1:o.h/o.vH;switch(t.property){case"x":return(i.x-o.x)*u;case"y":return(i.y-o.y)*l;case"angle":return 180*Math.atan2(s.y-a.y,s.x-a.x)/Math.PI}}function G(t,n){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=F(h.pth(t)?t.totalLength:t,n)+"";return{original:r,numbers:r.match(e)?r.match(e).map(Number):[0],strings:h.str(t)||n?r.split(e):[]}}function V(t){return O(t?S(h.arr(t)?t.map(C):C(t)):[],(function(t,n,e){return e.indexOf(t)===n}))}function K(t){var n=V(t);return n.map((function(t,e){return{target:t,id:e,total:n.length,transforms:{list:N(t)}}}))}function $(t,n){var e=_(n);if(/^spring/.test(e.easing)&&(e.duration=d(e.easing)),h.arr(t)){var r=t.length;2!==r||h.obj(t[0])?h.fnc(n.duration)||(e.duration=n.duration/r):t={value:t}}var o=h.arr(t)?t:[t];return o.map((function(t,e){var r=h.obj(t)&&!h.pth(t)?t:{value:t};return h.und(r.delay)&&(r.delay=e?0:n.delay),h.und(r.endDelay)&&(r.endDelay=e===o.length-1?n.endDelay:0),r})).map((function(t){return k(t,e)}))}var Y={css:function(t,n,e){return t.style[n]=e},attribute:function(t,n,e){return t.setAttribute(n,e)},object:function(t,n,e){return t[n]=e},transform:function(t,n,e,r,o){if(r.list.set(n,e),n===r.last||o){var i="";r.list.forEach((function(t,n){i+=n+"("+t+") "})),t.style.transform=i}}};function U(t,n){K(t).forEach((function(t){for(var e in n){var r=A(n[e],t),o=t.target,i=E(r),a=L(o,e,i,t),s=D(F(r,i||E(a)),a),u=B(o,e);Y[u](o,e,s,t.transforms,!0)}}))}function X(t,n){return O(S(t.map((function(t){return n.map((function(n){return function(t,n){var e=B(t.target,n.name);if(e){var r=function(t,n){var e;return t.tweens.map((function(r){var o=function(t,n){var e={};for(var r in t){var o=A(t[r],n);h.arr(o)&&1===(o=o.map((function(t){return A(t,n)}))).length&&(o=o[0]),e[r]=o}return e.duration=parseFloat(e.duration),e.delay=parseFloat(e.delay),e}(r,n),i=o.value,a=h.arr(i)?i[1]:i,s=E(a),u=L(n.target,t.name,s,n),l=e?e.to.original:u,c=h.arr(i)?i[0]:l,p=E(c)||E(u),f=s||p;return h.und(a)&&(a=l),o.from=G(c,f),o.to=G(D(a,c),f),o.start=e?e.end:0,o.end=o.start+o.delay+o.duration+o.endDelay,o.easing=w(o.easing,o.duration),o.isPath=h.pth(i),o.isPathTargetInsideSVG=o.isPath&&h.svg(n.target),o.isColor=h.col(o.from.original),o.isColor&&(o.round=1),e=o,o}))}(n,t),o=r[r.length-1];return{type:e,property:n.name,animatable:t,tweens:r,duration:o.end,delay:r[0].delay,endDelay:o.endDelay}}}(t,n)}))}))),(function(t){return!h.und(t)}))}function Z(t,n){var e=t.length,r=function(t){return t.timelineOffset?t.timelineOffset:0},o={};return o.duration=e?Math.max.apply(Math,t.map((function(t){return r(t)+t.duration}))):n.duration,o.delay=e?Math.min.apply(Math,t.map((function(t){return r(t)+t.delay}))):n.delay,o.endDelay=e?o.duration-Math.max.apply(Math,t.map((function(t){return r(t)+t.duration-t.endDelay}))):n.endDelay,o}var Q=0,J=[],tt=function(){var t;function n(e){for(var r=J.length,o=0;o<r;){var i=J[o];i.paused?(J.splice(o,1),r--):(i.tick(e),o++)}t=o>0?requestAnimationFrame(n):void 0}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){et.suspendWhenDocumentHidden&&(nt()?t=cancelAnimationFrame(t):(J.forEach((function(t){return t._onDocumentVisibility()})),tt()))})),function(){t||nt()&&et.suspendWhenDocumentHidden||!(J.length>0)||(t=requestAnimationFrame(n))}}();function nt(){return!!document&&document.hidden}function et(t){void 0===t&&(t={});var n,e=0,r=0,o=0,s=0,u=null;function c(t){var n=window.Promise&&new Promise((function(t){return u=t}));return t.finished=n,n}var p=function(t){var n=P(i,t),e=P(a,t),r=function(t,n){var e=[],r=n.keyframes;for(var o in r&&(n=k(function(t){for(var n=O(S(t.map((function(t){return Object.keys(t)}))),(function(t){return h.key(t)})).reduce((function(t,n){return t.indexOf(n)<0&&t.push(n),t}),[]),e={},r=function(r){var o=n[r];e[o]=t.map((function(t){var n={};for(var e in t)h.key(e)?e==o&&(n.value=t[e]):n[e]=t[e];return n}))},o=0;o<n.length;o++)r(o);return e}(r),n)),n)h.key(o)&&e.push({name:o,tweens:$(n[o],t)});return e}(e,t),o=K(t.targets),s=X(o,r),u=Z(s,e),l=Q;return Q++,k(n,{id:l,children:[],animatables:o,animations:s,duration:u.duration,delay:u.delay,endDelay:u.endDelay})}(t);function f(){var t=p.direction;"alternate"!==t&&(p.direction="normal"!==t?"normal":"reverse"),p.reversed=!p.reversed,n.forEach((function(t){return t.reversed=p.reversed}))}function d(t){return p.reversed?p.duration-t:t}function y(){e=0,r=d(p.currentTime)*(1/et.speed)}function g(t,n){n&&n.seek(t-n.timelineOffset)}function v(t){for(var n=0,e=p.animations,r=e.length;n<r;){var o=e[n],i=o.animatable,a=o.tweens,s=a.length-1,u=a[s];s&&(u=O(a,(function(n){return t<n.end}))[0]||u);for(var c=l(t-u.start-u.delay,0,u.duration)/u.duration,h=isNaN(c)?1:u.easing(c),f=u.to.strings,d=u.round,y=[],g=u.to.numbers.length,v=void 0,m=0;m<g;m++){var b=void 0,w=u.to.numbers[m],x=u.from.numbers[m]||0;b=u.isPath?R(u.value,h*w,u.isPathTargetInsideSVG):x+h*(w-x),d&&(u.isColor&&m>2||(b=Math.round(b*d)/d)),y.push(b)}var S=f.length;if(S){v=f[0];for(var C=0;C<S;C++){f[C];var j=f[C+1],_=y[C];isNaN(_)||(v+=j?_+j:_+" ")}}else v=y[0];Y[o.type](i.target,o.property,v,i.transforms),o.currentValue=v,n++}}function m(t){p[t]&&!p.passThrough&&p[t](p)}function b(t){var i=p.duration,a=p.delay,h=i-p.endDelay,y=d(t);p.progress=l(y/i*100,0,100),p.reversePlayback=y<p.currentTime,n&&function(t){if(p.reversePlayback)for(var e=s;e--;)g(t,n[e]);else for(var r=0;r<s;r++)g(t,n[r])}(y),!p.began&&p.currentTime>0&&(p.began=!0,m("begin")),!p.loopBegan&&p.currentTime>0&&(p.loopBegan=!0,m("loopBegin")),y<=a&&0!==p.currentTime&&v(0),(y>=h&&p.currentTime!==i||!i)&&v(i),y>a&&y<h?(p.changeBegan||(p.changeBegan=!0,p.changeCompleted=!1,m("changeBegin")),m("change"),v(y)):p.changeBegan&&(p.changeCompleted=!0,p.changeBegan=!1,m("changeComplete")),p.currentTime=l(y,0,i),p.began&&m("update"),t>=i&&(r=0,p.remaining&&!0!==p.remaining&&p.remaining--,p.remaining?(e=o,m("loopComplete"),p.loopBegan=!1,"alternate"===p.direction&&f()):(p.paused=!0,p.completed||(p.completed=!0,m("loopComplete"),m("complete"),!p.passThrough&&"Promise"in window&&(u(),c(p)))))}return c(p),p.reset=function(){var t=p.direction;p.passThrough=!1,p.currentTime=0,p.progress=0,p.paused=!0,p.began=!1,p.loopBegan=!1,p.changeBegan=!1,p.completed=!1,p.changeCompleted=!1,p.reversePlayback=!1,p.reversed="reverse"===t,p.remaining=p.loop,n=p.children;for(var e=s=n.length;e--;)p.children[e].reset();(p.reversed&&!0!==p.loop||"alternate"===t&&1===p.loop)&&p.remaining++,v(p.reversed?p.duration:0)},p._onDocumentVisibility=y,p.set=function(t,n){return U(t,n),p},p.tick=function(t){o=t,e||(e=o),b((o+(r-e))*et.speed)},p.seek=function(t){b(d(t))},p.pause=function(){p.paused=!0,y()},p.play=function(){p.paused&&(p.completed&&p.reset(),p.paused=!1,J.push(p),y(),tt())},p.reverse=function(){f(),p.completed=!p.reversed,y()},p.restart=function(){p.reset(),p.play()},p.remove=function(t){ot(V(t),p)},p.reset(),p.autoplay&&p.play(),p}function rt(t,n){for(var e=n.length;e--;)j(t,n[e].animatable.target)&&n.splice(e,1)}function ot(t,n){var e=n.animations,r=n.children;rt(t,e);for(var o=r.length;o--;){var i=r[o],a=i.animations;rt(t,a),a.length||i.children.length||r.splice(o,1)}e.length||r.length||n.pause()}et.version="3.2.1",et.speed=1,et.suspendWhenDocumentHidden=!0,et.running=J,et.remove=function(t){for(var n=V(t),e=J.length;e--;)ot(n,J[e])},et.get=L,et.set=U,et.convertPx=I,et.path=function(t,n){var e=h.str(t)?x(t)[0]:t,r=n||100;return function(t){return{property:t,el:e,svg:H(e),totalLength:z(e)*(r/100)}}},et.setDashoffset=function(t){var n=z(t);return t.setAttribute("stroke-dasharray",n),n},et.stagger=function(t,n){void 0===n&&(n={});var e=n.direction||"normal",r=n.easing?w(n.easing):null,o=n.grid,i=n.axis,a=n.from||0,s="first"===a,u="center"===a,l="last"===a,c=h.arr(t),p=c?parseFloat(t[0]):parseFloat(t),f=c?parseFloat(t[1]):0,d=E(c?t[1]:t)||0,y=n.start||0+(c?p:0),g=[],v=0;return function(t,n,h){if(s&&(a=0),u&&(a=(h-1)/2),l&&(a=h-1),!g.length){for(var m=0;m<h;m++){if(o){var b=u?(o[0]-1)/2:a%o[0],w=u?(o[1]-1)/2:Math.floor(a/o[0]),x=b-m%o[0],O=w-Math.floor(m/o[0]),S=Math.sqrt(x*x+O*O);"x"===i&&(S=-x),"y"===i&&(S=-O),g.push(S)}else g.push(Math.abs(a-m));v=Math.max.apply(Math,g)}r&&(g=g.map((function(t){return r(t/v)*v}))),"reverse"===e&&(g=g.map((function(t){return i?t<0?-1*t:-t:Math.abs(v-t)})))}return y+(c?(f-p)/v:p)*(Math.round(100*g[n])/100)+d}},et.timeline=function(t){void 0===t&&(t={});var n=et(t);return n.duration=0,n.add=function(e,r){var o=J.indexOf(n),i=n.children;function s(t){t.passThrough=!0}o>-1&&J.splice(o,1);for(var u=0;u<i.length;u++)s(i[u]);var l=k(e,P(a,t));l.targets=l.targets||t.targets;var c=n.duration;l.autoplay=!1,l.direction=n.direction,l.timelineOffset=h.und(r)?c:D(r,c),s(n),n.seek(l.timelineOffset);var p=et(l);s(p),i.push(p);var f=Z(i,t);return n.delay=f.delay,n.endDelay=f.endDelay,n.duration=f.duration,n.seek(0),n.reset(),n.autoplay&&n.play(),n},n},et.easing=w,et.penner=b,et.random=function(t,n){return Math.floor(Math.random()*(n-t+1))+t};const it=et;var at=function(){return at=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},at.apply(this,arguments)},st=function(t,n,e,r){return new(e||(e=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(a,s)}u((r=r.apply(t,n||[])).next())}))},ut=function(t,n){var e,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(e=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=n.call(t,i)}catch(t){s=[6,t],r=0}finally{e=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},lt=function(t){return st(void 0,void 0,void 0,(function(){var n,e,r,o,i,a,s;return ut(this,(function(u){switch(u.label){case 0:Array.isArray(t)||(t=[t]),n=function(t){var n,e,r;return ut(this,(function(o){switch(o.label){case 0:return void 0===t.delay?[3,2]:[4,new Promise((function(n){return setTimeout(n,t.delay)}))];case 1:o.sent(),o.label=2;case 2:if(!1===t.animate)return ct(t),[2,"continue"];if(void 0!==t.animateCallback&&t.animateCallback(),void 0!==t.element&&(it(at(at(at({targets:t.element},null!==(i=t.attributes)&&void 0!==i?i:{}),null!==(a=t.styles)&&void 0!==a?a:{}),null!==(s=t.animationParams)&&void 0!==s?s:{})),t.children))for(t.element.innerHTML="",n=0,e=t.children;n<e.length;n++)r=e[n],t.element.appendChild(r);return[2]}}))},e=0,r=t,u.label=1;case 1:return e<r.length?(o=r[e],[5,n(o)]):[3,4];case 2:u.sent(),u.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},ct=function(t){return st(void 0,void 0,void 0,(function(){var n,e,r,o,i,a,s,u,l,c,p,h,f,d,y;return ut(this,(function(g){for(Array.isArray(t)||(t=[t]),n=0,e=t;n<e.length;n++)if((r=e[n]).updateCallback&&r.updateCallback(),o=r.element){if(r.attributes)for(i=0,a=Object.entries(r.attributes);i<a.length;i++)s=a[i],p=s[0],h=s[1],o.setAttribute(p,h);if(r.styles)for(u=0,l=Object.entries(r.styles);u<l.length;u++)c=l[u],p=c[0],h=c[1],o.style[p]=h;if(r.children)for(o.innerHTML="",f=0,d=r.children;f<d.length;f++)y=d[f],o.appendChild(y)}return[2]}))}))};function pt(t,n,e){void 0===e&&(e=500);var r=Object.keys(n),o=null,i=null;function a(s){null===o&&(o=s),null===i&&(i=at({},t.state));for(var u=s-o,l=Math.min(u/e,1),c=0,p=r;c<p.length;c++){var h=p[c];if("number"==typeof n[h]){var f=i[h],d=n[h];t.state[h]=f+l*(d-f)}else 1==l&&(t.state[h]=n[h])}l<1&&requestAnimationFrame(a)}return function(e){return e({animate:!0,animateCallback:function(){o=null,i=null,requestAnimationFrame(a)},updateCallback:function(){for(var e=0,o=r;e<o.length;e++){var i=o[e];t.state[i]=n[i]}}})}}var ht,ft=function(){return ft=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},ft.apply(this,arguments)},dt=function(t,n){var e,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(e=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=n.call(t,i)}catch(t){s=[6,t],r=0}finally{e=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},yt=function(){function t(t,n,e){void 0===n&&(n=[]),void 0===e&&(e={}),this.objects=t.filter((function(t){return null!==t})),this.animations=n,this.animationIndex=0,this.debugAnimation=null,this.keyBuilds="last",this.props=ft({additionalElement:null,shortcuts:[],title:null},e)}return t.prototype.render=function(t,n){if(void 0===n&&(n=0),this.animationIndex=n,this.objects.forEach((function(n){n.generate(t)})),t.additionalElementContainer.innerHTML="",null!==this.props.additionalElement){var e="function"==typeof this.props.additionalElement?this.props.additionalElement():this.props.additionalElement;e.style.width="100%",e.style.height="auto",t.additionalElementContainer.appendChild(e)}if(null===this.debugAnimation||t.svg.innerHTML){for(a=0;a<this.animationIndex;a++)if(s=this.animations[a])if(Array.isArray(s))for(var r=0,o=s;r<o.length;r++)"number"!=typeof(c=o[r])&&c(ct);else s(ct)}else{var i=this.debugAnimation;i<0&&(i=this.animations.length+i);for(var a=0;a<=i;a++){var s;if(s=this.animations[a])if(Array.isArray(s))for(var u=0,l=s;u<l.length;u++){var c;"number"!=typeof(c=l[u])&&c(ct)}else s(ct)}this.animationIndex=i+1}t.svg.innerHTML="",this.objects.forEach((function(n){t.svg.appendChild(n.element())}))},t.prototype.nextAnimation=function(){return t=this,n=void 0,r=function(){var t,n,e,r,o;return dt(this,(function(i){switch(i.label){case 0:if(!(t=this.animations[this.animationIndex]))return[3,7];if(!Array.isArray(t))return[3,5];n=function(t){return dt(this,(function(n){switch(n.label){case 0:return"number"!=typeof t?[3,2]:[4,new Promise((function(n){return setTimeout(n,t)}))];case 1:return n.sent(),[2,"continue"];case 2:return t(lt),[2]}}))},e=0,r=t,i.label=1;case 1:return e<r.length?(o=r[e],[5,n(o)]):[3,4];case 2:i.sent(),i.label=3;case 3:return e++,[3,1];case 4:return[3,6];case 5:t(lt),i.label=6;case 6:return this.animationIndex++,[2,!0];case 7:return[2,!1]}}))},new((e=void 0)||(e=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(a,s)}u((r=r.apply(t,n||[])).next())}));var t,n,e,r},t.prototype.getKeyBuilds=function(){var t=this;return"first"===this.keyBuilds?[0]:"last"===this.keyBuilds?[this.animations.length]:"all"===this.keyBuilds?Array.from({length:this.animations.length+1},(function(t,n){return n})):"none"===this.keyBuilds?[]:Array.isArray(this.keyBuilds)?this.keyBuilds.filter((function(n){return n>=0&&n<=t.animations.length})):[0]},t}(),gt=function(){return gt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},gt.apply(this,arguments)},vt=function(){function t(t){this.props=gt({position:{x:0,y:0},anchor:"topleft"},t),this.initialProps=gt({},this.props),this._element=null,this._presentation=null,this._children=[]}return t.prototype.tagName=function(){return"g"},t.prototype.attributes=function(){return{}},t.prototype.additionalAttributes=function(){return{}},t.prototype.styles=function(){var t=this.props.opacity;return gt({},void 0!==t?{opacity:t.toString()}:{})},t.prototype.children=function(){return[]},t.prototype.requiresChildrenUpdate=function(t){return!1},t.prototype.positionAttributes=function(t){if(null===this._presentation)throw new Error("Cannot compute object position attributes without presentation");var n=this.positionInPresentation(t.origin),r=n.x,o=n.y,i=this.anchorBoundingBox(new e({x:r,y:o},t.width,t.height));return{x:i.origin.x,y:i.origin.y}},t.prototype.generate=function(t){this.props=gt({},this.initialProps),this._presentation=t;for(var n=this.createElement(),e=0,r=Object.entries(this.attributes());e<r.length;e++){var o=r[e],i=o[0],a=o[1];n.setAttribute(i,a)}for(var s=0,u=Object.entries(this.styles());s<u.length;s++){var l=u[s],c=l[0];a=l[1],n.style.setProperty(c,a)}this._children=this.children();for(var p=0,h=this._children;p<h.length;p++){var f=h[p];n.appendChild(f)}this._element=n;for(var d=0,y=Object.entries(this.additionalAttributes());d<y.length;d++){var g=y[d];i=g[0],a=g[1],n.setAttribute(i,a)}return n},t.prototype.createElement=function(){return document.createElementNS("http://www.w3.org/2000/svg",this.tagName())},t.prototype.element=function(){if(null===this._element)throw new Error("Element not yet generated");return this._element},t.prototype.animate=function(t,n,e,r){var o=this;return void 0===n&&(n={}),void 0===e&&(e=null),void 0===r&&(r=!0),function(i){if(null===o._presentation)throw new Error("Cannot animate object without presentation");var a=o.requiresChildrenUpdate(t);o.props=gt(gt({},o.props),t),a&&(o._children=o.children());var s=o.attributes(),u=o.styles(),l=o.additionalAttributes(),c=Object.fromEntries(Object.entries(s).filter((function(t){var n=t[0],e=t[1];return o._element.getAttribute(n)!==e}))),p=Object.fromEntries(Object.entries(u).filter((function(t){var n=t[0],e=t[1];return o._element.style.getPropertyValue(n)!==e}))),h=Object.fromEntries(Object.entries(l).filter((function(t){var n=t[0],e=t[1];return o._element.getAttribute(n)!==e})));i(gt(gt(gt({animate:r,element:o.element(),attributes:gt(gt({},c),h),styles:p},null!==e?{delay:e}:{}),a?{children:o._children}:{}),{animationParams:gt(gt({duration:500,easing:"linear"},n),"cubic"===n.easing?{easing:"cubicBezier(0.42, 0, 0.58, 1)"}:{})}))}},t.prototype.set=function(t,n){return void 0===n&&(n=null),this.animate(t,{},n,!1)},t.prototype.move=function(t,n){return void 0===n&&(n={}),this.animate({position:t},n)},t.prototype.fadeIn=function(t){return void 0===t&&(t={}),this.animate({opacity:1},t)},t.prototype.fadeOut=function(t){return void 0===t&&(t={}),this.animate({opacity:0},t)},t.prototype.show=function(){return this.set({opacity:1})},t.prototype.hide=function(){return this.set({opacity:0})},t.prototype.positionInPresentation=function(t){var n=this._presentation,e=t.x,r=t.y;return e<=1&&e>=-1&&(e*=n.boundingBox.width),r<=1&&r>=-1&&(r*=n.boundingBox.height),{x:e,y:r}},t.prototype.anchorBoundingBox=function(t){var n=this,r=function(){switch(n.props.anchor){case"topleft":case"top":case"topright":return t.origin.y;case"left":case"center":case"right":return t.origin.y-t.height/2;case"bottomleft":case"bottom":case"bottomright":return t.origin.y-t.height}}(),o=function(){switch(n.props.anchor){case"topleft":case"left":case"bottomleft":return t.origin.x;case"top":case"center":case"bottom":return t.origin.x-t.width/2;case"topright":case"right":case"bottomright":return t.origin.x-t.width}}();return new e({x:o,y:r},t.width,t.height)},t.prototype.computeRenderedBoundingBox=function(t,n){void 0===n&&(n=null);var r=this._presentation.computeRenderedBoundingBox(t,n);return new e({x:this.props.position.x,y:this.props.position.y},r.width,r.height)},t}(),mt=(ht=function(t,n){return ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},ht(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}ht(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),bt=function(){return bt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},bt.apply(this,arguments)},wt=function(t){function n(n){return void 0===n&&(n={}),t.call(this,bt({start:{x:0,y:0},end:{x:100,y:100},color:"#000000",width:10,linecap:null,drawn:!0},n))||this}return mt(n,t),n.prototype.tagName=function(){return"line"},n.prototype.attributes=function(){var n=this.props,e=n.color,r=n.drawn,o=n.width,i=n.linecap,a=this.positionInPresentation(this.props.start),s=this.positionInPresentation(this.props.end),u=a.x.toString(),l=a.y.toString(),c=s.x.toString(),p=s.y.toString();return r||(c=u,p=l),bt(bt(bt({},t.prototype.attributes.call(this)),{x1:u,y1:l,x2:c,y2:p,stroke:e,"stroke-width":o.toString()}),null!==i?{"stroke-linecap":i}:{})},n}(vt),xt=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Ot=function(){return Ot=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},Ot.apply(this,arguments)},St=function(t){function n(n,e){return void 0===e&&(e={}),t.call(this,Ot({points:n,fill:"#000000",borderWidth:0,borderColor:"#000000"},e))||this}return xt(n,t),n.prototype.tagName=function(){return"polygon"},n.prototype.attributes=function(){var n=this.props,e=n.points,r=n.fill,o=n.borderWidth,i=n.borderColor,a=e.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ");return Ot(Ot(Ot({},t.prototype.attributes.call(this)),{points:a,fill:r}),o>0?{"stroke-width":o.toString(),stroke:i}:{})},n}(vt),Ct=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),jt=function(){return jt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},jt.apply(this,arguments)},_t=function(t){function n(n){void 0===n&&(n={});var e,r,o,i=this,a=null!==(e=n.width)&&void 0!==e?e:10,s=null!==(r=n.arrowSize)&&void 0!==r?r:4*a,u=null!==(o=n.opacity)&&void 0!==o?o:!1===n.drawn?0:1;return(i=t.call(this,jt({start:{x:0,y:0},end:{x:100,y:100},color:"#000000",width:a,arrowSize:s,opacity:u,drawn:!0,padStart:{x:0,y:0},padEnd:{x:0,y:0}},n))||this).line=null,i.arrowhead=null,i}return Ct(n,t),n.prototype.tagName=function(){return"g"},n.prototype.calculateShapes=function(t){var n,e,r,o,i=t.arrowSize,a=t.drawn,s=this.positionInPresentation(t.start),u=this.positionInPresentation(t.end);s.x+=null!==(n=t.padStart.x)&&void 0!==n?n:0,s.y+=null!==(e=t.padStart.y)&&void 0!==e?e:0,u.x+=null!==(r=t.padEnd.x)&&void 0!==r?r:0,u.y+=null!==(o=t.padEnd.y)&&void 0!==o?o:0;var l=Math.atan2(u.y-s.y,u.x-s.x),c=a?u:s,p={x:c.x-i*Math.cos(l-Math.PI/6),y:c.y-i*Math.sin(l-Math.PI/6)},h={x:c.x-i*Math.cos(l+Math.PI/6),y:c.y-i*Math.sin(l+Math.PI/6)};return{line:{start:s,end:a?{x:u.x-2*i/3*Math.cos(l),y:u.y-2*i/3*Math.sin(l)}:s},arrowhead:[p,c,h]}},n.prototype.children=function(){var t=this.props,n=t.color,e=t.width,r=this.calculateShapes(this.props);return this.line=new wt({start:r.line.start,end:r.line.end,color:n,width:e}),this.line.generate(this._presentation),this.arrowhead=new St(r.arrowhead,{fill:n,borderWidth:0,borderColor:n}),this.arrowhead.generate(this._presentation),[this.line.element(),this.arrowhead.element()]},n.prototype.animate=function(n,e,r,o){var i=this;void 0===e&&(e={}),void 0===r&&(r=null),void 0===o&&(o=!0);var a=n.start,s=n.end,u=n.drawn,l=n.color,c=n.width,p=n.arrowSize,h=function(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e}(n,["start","end","drawn","color","width","arrowSize"]),f=Object.fromEntries(Object.entries({start:a,end:s,drawn:u,color:l,width:c,arrowSize:p}).filter((function(t){return t[0],void 0!==t[1]})));return function(n){u&&!("opacity"in h)&&0===i.props.opacity&&i.set({opacity:1})(n),0!==Object.keys(h).length&&t.prototype.animate.call(i,h,e,r,o)(n),0!==Object.keys(f).length&&i.animateArrow(f,e,r,o)(n)}},n.prototype.draw=function(t){return void 0===t&&(t={}),this.animate({drawn:!0},t)},n.prototype.animateArrow=function(t,n,e,r){var o=this;void 0===n&&(n={}),void 0===e&&(e=null),void 0===r&&(r=!0);var i=jt(jt({},this.props),t),a=this.calculateShapes(i);return function(e){var r=o.line.animate(jt(jt({start:a.line.start,end:a.line.end},t.color?{color:t.color}:{}),t.width?{width:t.width}:{}),n),i=o.arrowhead.animate(jt({points:a.arrowhead},t.color?{fill:t.color}:{}),n);r(e),i(e)}},n}(vt),Pt=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),kt=function(){return kt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},kt.apply(this,arguments)},Et=function(t){function n(n){return void 0===n&&(n={}),t.call(this,kt({fill:"#000000",radius:100,borderWidth:0,borderColor:"#000000"},n))||this}return Pt(n,t),n.prototype.tagName=function(){return"circle"},n.prototype.attributes=function(){var n=this.props,r=n.position,o=n.radius,i=n.fill,a=n.borderWidth,s=n.borderColor,u=this.positionAttributes(new e(r,2*o,2*o)),l=u.x,c=u.y;return kt(kt(kt({},t.prototype.attributes.call(this)),{fill:i,r:o.toString(),cx:(l+o).toString(),cy:(c+o).toString()}),a>0?{"stroke-width":a.toString(),stroke:s}:{})},n}(vt),At=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Mt=function(){return Mt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},Mt.apply(this,arguments)},It=function(t){function n(n,e,r){return void 0===e&&(e={}),void 0===r&&(r=null),t.call(this,Mt({objects:n,position:{x:0,y:0},positioned:null===r?"position"in e:r,rotation:0,rotationOrigin:{x:0,y:0},scale:1},e))||this}return At(n,t),n.prototype.tagName=function(){return"g"},n.prototype.attributes=function(){return Mt({},t.prototype.attributes.call(this))},n.prototype.additionalAttributes=function(){var t=this.props.scale,n="rotate(".concat(this.props.rotation,", ").concat(this.props.rotationOrigin.x,", ").concat(this.props.rotationOrigin.y,")"),r="scale(".concat(t,")");if(!this.props.positioned){var o=this.positionInPresentation(this.props.position),i=o.x,a=o.y;return{transform:"translate(".concat(i,", ").concat(a,") ").concat(n," ").concat(r)}}var s=this._presentation.computeRenderedBoundingBox(this._element);s.width*=t,s.height*=t;var u=this.positionInPresentation(this.props.position),l=u.x,c=u.y,p=this.anchorBoundingBox(new e({x:l,y:c},s.width,s.height)),h=p.origin.x-s.origin.x,f=p.origin.y-s.origin.y;return{transform:"translate(".concat(h,", ").concat(f,") ").concat(n," ").concat(r)}},n.prototype.children=function(){var t=this;return this.props.objects.map((function(n){return n.generate(t._presentation),n._element}))},n}(vt),Tt=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Bt=function(t){function n(n){var e=this,r=n.rows,o=void 0===r?1:r,i=n.cols,a=void 0===i?1:i,s=n.spacing,u=void 0===s?{x:0,y:0}:s,l=n.origin,c=void 0===l?{x:0,y:0}:l,p=n.objects,h=void 0===p?function(){return null}:p,f=function(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e}(n,["rows","cols","spacing","origin","objects"]);void 0===u.x&&(u.x=0),void 0===u.y&&(u.y=0);for(var d=[],y=0;y<o;y++){for(var g=[],v=0;v<a;v++){var m=h(y,v);null!==m&&(m.props.position.x=c.x+u.x*v,m.props.position.y=c.y+u.y*y),g.push(m)}d.push(g)}return e=t.call(this,function(t,n,e){if(e||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return t.concat(r||Array.prototype.slice.call(n))}([],d.flat().filter((function(t){return null!==t})),!0),f)||this,e.objects=d,e}return Tt(n,t),n}(It),Nt=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Lt=function(){return Lt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},Lt.apply(this,arguments)},Dt=function(t){function n(n,e){return void 0===e&&(e={}),t.call(this,Lt({href:n,width:100,height:100,rounding:0},e))||this}return Nt(n,t),n.prototype.tagName=function(){return"image"},n.prototype.attributes=function(){var n=this.props,r=n.position,o=n.href,i=n.width,a=n.height,s=this.positionAttributes(new e(r,i,a)),u=s.x,l=s.y;return Lt(Lt({},t.prototype.attributes.call(this)),{href:o,width:i.toString(),height:a.toString(),x:u.toString(),y:l.toString()})},n.prototype.styles=function(){var n=this.props.rounding;return Lt(Lt({},t.prototype.styles.call(this)),0!==n?{"clip-path":"inset(0px round ".concat(n,"px)")}:{})},n}(vt),Ft=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Wt=function(){return Wt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},Wt.apply(this,arguments)},qt=function(t){function n(n,e){return void 0===e&&(e={}),t.call(this,Wt({content:n,width:1e3,height:1e3,fontSize:100,fontFamily:"Arial",color:"#000000"},e))||this}return Ft(n,t),n.prototype.tagName=function(){return"foreignObject"},n.prototype.attributes=function(){var n=this.props,e=n.position,r=n.width,o=n.height;return Wt(Wt({},t.prototype.attributes.call(this)),{x:e.x.toString(),y:e.y.toString(),width:r.toString(),height:o.toString()})},n.prototype.children=function(){for(var t=this.props.content,n=document.createElement("div"),e={"font-family":'"'.concat(this.props.fontFamily,'"'),"font-size":"".concat(this.props.fontSize,"px"),color:this.props.color},r=0,o=Object.entries(e);r<o.length;r++){var i=o[r],a=i[0],s=i[1];void 0!==s&&n.style.setProperty(a,s.toString())}if("string"==typeof t)n.textContent=t;else for(var u=0,l=t;u<l.length;u++){var c=l[u],p=document.createElement("p");p.textContent=c,n.appendChild(p)}return[n]},n.prototype.additionalAttributes=function(){var n=this.computeRenderedBoundingBox(this.element(),this._children),e=this.positionAttributes(n),r=e.x,o=e.y;return Wt(Wt({},t.prototype.additionalAttributes.call(this)),{x:r.toString(),y:o.toString()})},n.prototype.requiresChildrenUpdate=function(t){return"content"in t&&t.content!==this.props.content},n}(vt);function zt(t,n,e){void 0===n&&(n="1em"),void 0===e&&(e="start");for(var r=[],o=0,i=0,a=t;i<a.length;i++){var s=a[i];o++;var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");if(u.setAttribute("x","0"),u.setAttribute("text-anchor",e),o>1&&u.setAttribute("dy",n),0===s.length||1===s.length&&""===s[0])u.appendChild(document.createTextNode(" ")),r.push(u);else if("string"!=typeof s){for(var l=0,c=s;l<c.length;l++){var p=c[l];if("string"==typeof p)u.appendChild(document.createTextNode(p));else{var h=p[0],f=p[1],d=document.createElementNS("http://www.w3.org/2000/svg","tspan");d.textContent=h;for(var y={fill:f.color,dy:f.dy,"text-decoration":f.textDecoration},g=0,v=Object.entries(y);g<v.length;g++){var m=v[g],b=m[0];void 0!==(S=m[1])&&d.setAttribute(b,S.toString())}for(var w={"font-family":f.fontFamily?'"'.concat(f.fontFamily,'"'):void 0,"font-size":f.fontSize,"font-weight":f.fontWeight,"font-style":f.fontStyle},x=0,O=Object.entries(w);x<O.length;x++){var S,C=O[x];b=C[0],void 0!==(S=C[1])&&d.style.setProperty(b,S.toString())}u.appendChild(d)}}r.push(u)}else u.appendChild(document.createTextNode(s)),r.push(u)}return r}var Ht=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Rt=function(){return Rt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},Rt.apply(this,arguments)},Gt=function(t){function n(n,e){return void 0===e&&(e={}),t.call(this,Rt({content:n,color:"#000000",fontSize:150,fontStyle:"normal",fontWeight:"normal",fontFamily:"Arial",dominantBaseline:"ideographic",textDecoration:"none",length:null,align:"left",lineSpacing:"1em",ligatures:null},e))||this}return Ht(n,t),n.prototype.isRichText=function(){return"string"!=typeof this.props.content},n.prototype.tagName=function(){return"text"},n.prototype.attributes=function(){var n=this.props,e=n.color,r=n.textDecoration;return Rt(Rt(Rt({},t.prototype.attributes.call(this)),"none"!==r?{"text-decoration":r}:{}),{fill:e})},n.prototype.additionalAttributes=function(){var n=this.computeRenderedBoundingBox(this.element(),this.childrenWithContentLength(this.contentLength())),e=this.positionAttributes(n),r=e.x,o=e.y;return this.isRichText()&&("center"===this.props.align?r+=n.width/2:"right"===this.props.align&&(r+=n.width)),Rt(Rt(Rt({},t.prototype.additionalAttributes.call(this)),this.isRichText()?{transform:"translate(".concat(r.toString()," ").concat(o.toString(),")"),y:"1em"}:{x:r.toString(),y:(o+n.height).toString()}),{"dominant-baseline":this.props.dominantBaseline})},n.prototype.styles=function(){var n=this.props,e=n.fontSize,r=n.fontFamily,o=n.fontStyle,i=n.fontWeight,a=n.ligatures;return Rt(Rt(Rt(Rt(Rt({},t.prototype.styles.call(this)),"normal"!==o?{"font-style":o}:{}),"normal"!==i?{"font-weight":i.toString()}:{}),null!==a?{"font-variant-ligatures":a}:{}),{"font-size":"".concat(e,"px"),"font-family":'"'.concat(r,'"'),"white-space":"pre"})},n.prototype.children=function(){var t,n=null!==(t=this.props.length)&&void 0!==t?t:this.contentLength();return this.childrenWithContentLength(n)},n.prototype.requiresChildrenUpdate=function(t){return"content"in t&&t.content!==this.props.content||"length"in t&&t.length!==this.props.length},n.prototype.contentLength=function(){return"string"==typeof this.props.content?this.props.content.length:this.props.content.reduce((function(t,n){return"string"==typeof n?t+n.length:t+n.reduce((function(t,n){return t+("string"==typeof n?n:n[0]).length}),0)}),0)},n.prototype.childrenWithContentLength=function(t){var n=this.props.content;if("string"==typeof n){var e=null===t?n:n.slice(0,t);return[document.createTextNode(e)]}var r="left"===this.props.align?"start":"center"===this.props.align?"middle":"end";if(null===t)return zt(n,this.props.lineSpacing,r);for(var o=t,i=[],a=0,s=n;a<s.length;a++){var u=s[a];if("string"==typeof u)u.length<=o?(i.push(u),o-=u.length):(i.push(u.slice(0,o)),o=0);else{for(var l=[],c=0,p=u;c<p.length;c++){var h=p[c];if("string"==typeof h?h.length<=o?(l.push(h),o-=h.length):(l.push(h.slice(0,o)),o=0):h[0].length<=o?(l.push(h),o-=h[0].length):(l.push([h[0].slice(0,o),h[1]]),o=0),0===o)break}i.push(l)}if(0===o)break}return zt(i,this.props.lineSpacing,r)},n.prototype.regenerateChildren=function(){this._children=this.children(),this._element.innerHTML="";for(var t=0,n=this._children;t<n.length;t++){var e=n[t];this._element.appendChild(e)}},n.prototype.animate=function(n,e,r,o){var i=this;void 0===e&&(e={}),void 0===r&&(r=null),void 0===o&&(o=!0);var a=n.length,s=function(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e}(n,["length"]);return void 0===a?t.prototype.animate.call(this,s,e,r,o):function(n){var u;i.writeOn(a,null!==(u=e.duration)&&void 0!==u?u:1e3,o)(n),Object.keys(s).length>0&&t.prototype.animate.call(i,s,e,r,o)(n)}},n.prototype.writeOn=function(t,n,e){var r=this;void 0===t&&(t=null),void 0===n&&(n=1e3),void 0===e&&(e=!0);var o=null,i=null,a=null,s=function(e){var u;null===a&&(a=e),null===o&&(o=null!==(u=r.props.length)&&void 0!==u?u:r.contentLength()),null===i&&(i=null!=t?t:r.contentLength());var l=e-a,c=Math.min(l/n,1);r.props.length=Math.floor(o+(i-o)*c),r.regenerateChildren(),c<1&&requestAnimationFrame(s)};return function(n){return n({animate:e,animateCallback:function(){a=null,o=null,i=null,requestAnimationFrame(s)},updateCallback:function(){a=null,o=null,i=null,r.props.length=t,r.regenerateChildren()}})}},n}(vt),Vt=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Kt=function(){return Kt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},Kt.apply(this,arguments)},$t=function(t){function n(n){return void 0===n&&(n={}),t.call(this,Kt({fill:"#000000",width:100,height:100,rounding:0,borderWidth:0,borderColor:"#000000"},n))||this}return Vt(n,t),n.prototype.tagName=function(){return"rect"},n.prototype.attributes=function(){var n=this.props,r=n.position,o=n.width,i=n.height,a=n.fill,s=n.rounding,u=n.borderWidth,l=n.borderColor,c=this.positionAttributes(new e(r,o,i)),p=c.x,h=c.y;return Kt(Kt(Kt({},t.prototype.attributes.call(this)),{fill:a,width:o.toString(),height:i.toString(),rx:s.toString(),x:p.toString(),y:h.toString()}),u>0?{"stroke-width":u.toString(),stroke:l}:{})},n}(vt),Yt=function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),Ut=function(){return Ut=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},Ut.apply(this,arguments)},Xt=function(t){function n(n,e){return void 0===e&&(e={}),t.call(this,Ut({svg:n,width:100,height:100},e))||this}return Yt(n,t),n.svgNode=function(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement},n.prototype.tagName=function(){return"svg"},n.prototype.createElement=function(){var t=this.constructor.svgNode(this.props.svg);return this.parsedChildren=Array.from(t.childNodes),t.innerHTML="",t},n.prototype.attributes=function(){var n=this.props,r=n.position,o=n.width,i=n.height,a=this.positionAttributes(new e(r,o,i)),s=a.x,u=a.y;return Ut(Ut({},t.prototype.attributes.call(this)),{width:o.toString(),height:i.toString(),x:s.toString(),y:u.toString()})},n.prototype.children=function(){return this.parsedChildren},n.prototype.animatePath=function(t,n,e,r){var o=this;return void 0===e&&(e=500),void 0===r&&(r=!0),function(i){var a,s=o.element().querySelector(t);i(Ut(Ut({animate:r,element:s},n),{animationParams:Ut({duration:e},null!==(a=n.animationParams)&&void 0!==a?a:{})}))}},n.prototype.setPath=function(t,n){return this.animatePath(t,n,0,!1)},n.prototype.drawOn=function(t,n){var e=this,r=Ut({color:"#000000",strokeWidth:5,fill:!0,fillColor:null,drawDuration:1e3,fillDuration:1e3,easing:"linear"},n),o=r.color,i=r.strokeWidth,a=r.fill,s=r.fillColor,u=r.drawDuration,l=r.fillDuration,c=r.easing;return function(n){var r=e.element().querySelector(t);if(!r)throw new Error("Path element with selector ".concat(t," not found"));var p=r.getTotalLength();r.setAttribute("stroke-dashoffset","".concat(p)),r.setAttribute("stroke-dasharray","".concat(p)),r.setAttribute("stroke-width","".concat(i)),r.setAttribute("stroke",o),n({animate:!0,element:r,attributes:{"stroke-dashoffset":"0"},animationParams:{duration:u,easing:c}}),a&&n({animate:!0,delay:u,element:r,attributes:{fill:null!=s?s:o,"stroke-dasharray":"none"},animationParams:{duration:l}})}},n}(vt);function Zt(t,n,e){return Math.min(Math.max(t,n),e)}function Qt(t){return Zt(t,0,1)}function Jt(t){var n=Zt(t,0,1);return Math.pow(n,2)*(3-2*n)}return n})()));
|