presenter 0.1.1 → 0.2.2

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.
Files changed (43) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +39 -1
  3. package/dist/presenter.js +1 -1
  4. package/dist/src/index.d.ts +15 -0
  5. package/dist/src/objects/arrow.d.ts +36 -0
  6. package/dist/src/objects/group.d.ts +16 -0
  7. package/dist/src/objects/image.d.ts +11 -0
  8. package/dist/src/objects/line.d.ts +13 -0
  9. package/dist/src/objects/paragraph.d.ts +17 -0
  10. package/dist/src/objects/polygon.d.ts +13 -0
  11. package/dist/src/objects/rectangle.d.ts +14 -0
  12. package/dist/src/objects/text.d.ts +29 -0
  13. package/dist/src/objects/vectorGraphic.d.ts +14 -0
  14. package/dist/src/presentation/object.d.ts +122 -0
  15. package/dist/src/presentation/presentation.d.ts +99 -0
  16. package/dist/src/presentation/slide.d.ts +23 -0
  17. package/dist/src/util/animation.d.ts +37 -0
  18. package/dist/src/util/position.d.ts +11 -0
  19. package/dist/src/util/richText.d.ts +18 -0
  20. package/dist/webpack.config.d.ts +22 -0
  21. package/package.json +8 -5
  22. package/.husky/pre-commit +0 -1
  23. package/.prettierrc +0 -1
  24. package/examples/README.md +0 -23
  25. package/examples/simple/dist/index.html +0 -8
  26. package/examples/simple/package-lock.json +0 -3754
  27. package/examples/simple/package.json +0 -18
  28. package/examples/simple/src/index.ts +0 -20
  29. package/examples/simple/tsconfig.json +0 -10
  30. package/examples/simple/webpack.config.js +0 -25
  31. package/src/index.ts +0 -16
  32. package/src/objects/image.ts +0 -55
  33. package/src/objects/rectangle.ts +0 -53
  34. package/src/objects/text.ts +0 -79
  35. package/src/presentation/object.ts +0 -190
  36. package/src/presentation/presentation.ts +0 -299
  37. package/src/presentation/slide.ts +0 -52
  38. package/src/presentation/theme.ts +0 -3
  39. package/src/themes/default.ts +0 -7
  40. package/src/themes/index.ts +0 -1
  41. package/src/util/position.ts +0 -21
  42. package/tsconfig.json +0 -12
  43. package/webpack.config.js +0 -32
package/README.md CHANGED
@@ -1,3 +1,41 @@
1
1
  # Presenter.js
2
2
 
3
- A JavaScript-based presentation library
3
+ Presenter.js is a JavaScript library for creating visual presentations.
4
+
5
+ This library is still in development and its API may change at any time.
6
+
7
+ ## Getting Started
8
+
9
+ ### Installing Presenter.js
10
+
11
+ Install Presenter.js via `npm`.
12
+
13
+ ```
14
+ $ npm install presenter
15
+ ```
16
+
17
+ ### Sample Usage
18
+
19
+ Create a presentation by specifying a list of slides, where each slide may contain objects and animations.
20
+
21
+ ```javascript
22
+ import { Presentation, Slide, Text } from "presenter";
23
+
24
+ const slide = new Slide([
25
+ new Text("Welcome to Presenter.js!", {
26
+ position: { x: 0.5, y: 0.5 },
27
+ anchor: "center",
28
+ fontSize: 150,
29
+ }),
30
+ ]);
31
+
32
+ document.addEventListener("DOMContentLoaded", () => {
33
+ const presentation = new Presentation(
34
+ "My Presentation",
35
+ [slide],
36
+ document.body,
37
+ );
38
+
39
+ presentation.present();
40
+ });
41
+ ```
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,{BoundingBox:()=>r,DefaultTheme:()=>e,Image:()=>pt,Presentation:()=>i,Rectangle:()=>wt,Slide:()=>a,SlideObject:()=>lt,Text:()=>vt});const e={backgroundColor:"#ffffff"};var r=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}(),o=function(){return o=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},o.apply(this,arguments)},i=function(){function t(t,n,i,a){if(void 0===a&&(a={}),null===this.element)throw new Error("Presentation cannot be mounted to null element.");this.title=t,this.element=i,this.slides=n,this.options=o({width:3840,height:2160,theme:e},a),this.presentationState={currentSlide:0},this.boundingBox=new r({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.theme.backgroundColor,this.svg.style.cursor="none";var n=this.isFullBodyPresentation()?document.body:this.svg;n.addEventListener("keyup",(function(n){"ArrowRight"===n.key||" "===n.key?t.next():"ArrowLeft"===n.key&&t.previous()})),n.addEventListener("mousemove",(function(n){t.svg.style.cursor="auto"})),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 e=this.slides[this.presentationState.currentSlide];void 0!==e&&e.render(this)},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(){this.svg.style.cursor="none";var t=this.slides[this.presentationState.currentSlide];if(void 0!==t&&!t.nextAnimation(this)){this.presentationState.currentSlide++;var n=this.slides[this.presentationState.currentSlide];if(void 0===n)return;n.render(this)}},t.prototype.previous=function(){this.svg.style.cursor="none";var t=this.slides[this.presentationState.currentSlide];if(void 0!==t){if(t.animationIndex>0)return t.animationIndex=0,void t.render(this);if(0!==this.presentationState.currentSlide){this.presentationState.currentSlide--;var n=this.slides[this.presentationState.currentSlide];void 0!==n&&n.render(this)}}else{this.presentationState.currentSlide=this.slides.length-1;var e=this.slides[this.presentationState.currentSlide];if(void 0===e)return;e.render(this)}},t.prototype.isFullBodyPresentation=function(){return this.element===document.body},t.prototype.theme=function(){return this.options.theme},t.prototype.computeRenderedBoundingBox=function(t){var n=t.cloneNode(!0);this.shadow.appendChild(n);var e=r.fromElement(n);return this.shadow.removeChild(n),e},t}(),a=function(){function t(t,n){void 0===n&&(n=[]),this.objects=t.filter((function(t){return null!==t})),this.animations=n,this.animationIndex=0}return t.prototype.render=function(t){t.svg.innerHTML="",this.animationIndex=0,this.objects.forEach((function(n){n._element=n.generate(t),t.svg.appendChild(n.element())}))},t.prototype.nextAnimation=function(t){var n=this.animations[this.animationIndex];return!!n&&(n(t),this.animationIndex++,!0)},t.prototype.sleep=function(t){return n=this,e=void 0,o=function(){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=u(0),a.throw=u(1),a.return=u(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(s){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(e=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=n.call(t,i)}catch(t){u=[6,t],r=0}finally{e=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}}(this,(function(n){return[2,new Promise((function(n){return setTimeout(n,t)}))]}))},new((r=void 0)||(r=Promise))((function(t,i){function a(t){try{s(o.next(t))}catch(t){i(t)}}function u(t){try{s(o.throw(t))}catch(t){i(t)}}function s(n){var e;n.done?t(n.value):(e=n.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((o=o.apply(n,e||[])).next())}));var n,e,r,o},t}(),u={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},s={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},c=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],l={CSS:{},springs:{}};function f(t,n,e){return Math.min(Math.max(t,n),e)}function h(t,n){return t.indexOf(n)>-1}function p(t,n){return t.apply(null,n)}var d={arr:function(t){return Array.isArray(t)},obj:function(t){return h(Object.prototype.toString.call(t),"Object")},pth:function(t){return d.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||d.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 d.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 d.hex(t)||d.rgb(t)||d.hsl(t)},key:function(t){return!u.hasOwnProperty(t)&&!s.hasOwnProperty(t)&&"targets"!==t&&"keyframes"!==t}};function g(t){var n=/\(([^)]+)\)/.exec(t);return n?n[1].split(",").map((function(t){return parseFloat(t)})):[]}function v(t,n){var e=g(t),r=f(d.und(e[0])?1:e[0],.1,100),o=f(d.und(e[1])?100:e[1],.1,100),i=f(d.und(e[2])?10:e[2],.1,100),a=f(d.und(e[3])?0:e[3],.1,100),u=Math.sqrt(o/r),s=i/(2*Math.sqrt(o*r)),c=s<1?u*Math.sqrt(1-s*s):0,h=s<1?(s*u-a)/c:-a+u;function p(t){var e=n?n*t/1e3:t;return e=s<1?Math.exp(-e*s*u)*(1*Math.cos(c*e)+h*Math.sin(c*e)):(1+h*e)*Math.exp(-e*u),0===t||1===t?t:1-e}return n?p:function(){var n=l.springs[t];if(n)return n;for(var e=1/6,r=0,o=0;;)if(1===p(r+=e)){if(++o>=16)break}else o=0;var i=r*e*1e3;return l.springs[t]=i,i}}function y(t){return void 0===t&&(t=10),function(n){return Math.ceil(f(n,1e-6,1)*t)*(1/t)}}var m,w,b=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 u=new Float32Array(11);if(n!==e||r!==a)for(var s=0;s<11;++s)u[s]=o(s*t,n,r);return function(s){return n===e&&r===a||0===s||1===s?s:o(function(e){for(var a=0,s=1;10!==s&&u[s]<=e;++s)a+=t;--s;var c=a+(e-u[s])/(u[s+1]-u[s])*t,l=i(c,n,r);return l>=.001?function(t,n,e,r){for(var a=0;a<4;++a){var u=i(n,e,r);if(0===u)return n;n-=(o(n,e,r)-t)/u}return n}(e,c,n,r):0===l?c:function(t,n,e,r,i){var a,u,s=0;do{(a=o(u=n+(e-n)/2,r,i)-t)>0?e=u:n=u}while(Math.abs(a)>1e-7&&++s<10);return u}(e,a,a+t,n,r)}(s),e,a)}}}}(),x=(m={linear:function(){return function(t){return t}}},w={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=f(t,1,10),r=f(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){w[t]=function(){return function(t){return Math.pow(t,n+2)}}})),Object.keys(w).forEach((function(t){var n=w[t];m["easeIn"+t]=n,m["easeOut"+t]=function(t,e){return function(r){return 1-n(t,e)(1-r)}},m["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}},m["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}}})),m);function O(t,n){if(d.fnc(t))return t;var e=t.split("(")[0],r=x[e],o=g(t);switch(e){case"spring":return v(t,n);case"cubicBezier":return p(b,o);case"steps":return p(y,o);default:return p(r,o)}}function S(t){try{return document.querySelectorAll(t)}catch(t){return}}function P(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 M(t){return t.reduce((function(t,n){return t.concat(d.arr(n)?M(n):n)}),[])}function B(t){return d.arr(t)?t:(d.str(t)&&(t=S(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 A(t){var n={};for(var e in t)n[e]=t[e];return n}function C(t,n){var e=A(t);for(var r in t)e[r]=n.hasOwnProperty(r)?n[r]:t[r];return e}function E(t,n){var e=A(t);for(var r in n)e[r]=d.und(t[r])?n[r]:t[r];return e}function k(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 I(t,n){return d.fnc(t)?t(n.target,n.id,n.total):t}function _(t,n){return t.getAttribute(n)}function T(t,n,e){if(j([e,"deg","rad","turn"],k(n)))return n;var r=l.CSS[n+e];if(!d.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 u=a*parseFloat(n);return l.CSS[n+e]=u,u}function D(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?T(t,o,e):o}}function F(t,n){return d.dom(t)&&!d.inp(t)&&(!d.nil(_(t,n))||d.svg(t)&&t[n])?"attribute":d.dom(t)&&j(c,n)?"transform":d.dom(t)&&"transform"!==n&&D(t,n)?"css":null!=t[n]?"object":void 0}function N(t){if(d.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(F(t,n)){case"transform":return function(t,n,e,r){var o=h(n,"scale")?1:0+function(t){return h(t,"translate")||"perspective"===t?"px":h(t,"rotate")||h(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?T(t,i,r):i}(t,n,r,e);case"css":return D(t,n,e);case"attribute":return _(t,n);default:return t[n]||0}}function q(t,n){var e=/^(\*=|\+=|-=)/.exec(t);if(!e)return t;var r=k(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 z(t,n){if(d.col(t))return function(t){return d.rgb(t)?(e=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(n=t))?"rgba("+e[1]+",1)":n:d.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):d.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,u=parseInt(o[3],10)/100,s=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=u;else{var l=u<.5?u*(1+a):u+a-u*a,f=2*u-l;n=c(f,l,i+1/3),e=c(f,l,i),r=c(f,l,i-1/3)}return"rgba("+255*n+","+255*e+","+255*r+","+s+")"}(t):void 0;var n,e}(t);if(/\s/g.test(t))return t;var e=k(t),r=e?t.substr(0,t.length-e.length):t;return n?r+n:r}function H(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function R(t){for(var n,e=t.points,r=0,o=0;o<e.numberOfItems;o++){var i=e.getItem(o);o>0&&(r+=H(n,i)),n=i}return r}function V(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return function(t){return 2*Math.PI*_(t,"r")}(t);case"rect":return function(t){return 2*_(t,"width")+2*_(t,"height")}(t);case"line":return function(t){return H({x:_(t,"x1"),y:_(t,"y1")},{x:_(t,"x2"),y:_(t,"y2")})}(t);case"polyline":return R(t);case"polygon":return function(t){var n=t.points;return R(t)+H(n.getItem(n.numberOfItems-1),n.getItem(0))}(t)}}function G(t,n){var e=n||{},r=e.el||function(t){for(var n=t.parentNode;d.svg(n)&&d.svg(n.parentNode);)n=n.parentNode;return n}(t),o=r.getBoundingClientRect(),i=_(r,"viewBox"),a=o.width,u=o.height,s=e.viewBox||(i?i.split(" "):[0,0,a,u]);return{el:r,viewBox:s,x:s[0]/1,y:s[1]/1,w:a,h:u,vW:s[2],vH:s[3]}}function W(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=G(t.el,t.svg),i=r(),a=r(-1),u=r(1),s=e?1:o.w/o.vW,c=e?1:o.h/o.vH;switch(t.property){case"x":return(i.x-o.x)*s;case"y":return(i.y-o.y)*c;case"angle":return 180*Math.atan2(u.y-a.y,u.x-a.x)/Math.PI}}function $(t,n){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=z(d.pth(t)?t.totalLength:t,n)+"";return{original:r,numbers:r.match(e)?r.match(e).map(Number):[0],strings:d.str(t)||n?r.split(e):[]}}function Y(t){return P(t?M(d.arr(t)?t.map(B):B(t)):[],(function(t,n,e){return e.indexOf(t)===n}))}function X(t){var n=Y(t);return n.map((function(t,e){return{target:t,id:e,total:n.length,transforms:{list:N(t)}}}))}function Z(t,n){var e=A(n);if(/^spring/.test(e.easing)&&(e.duration=v(e.easing)),d.arr(t)){var r=t.length;2!==r||d.obj(t[0])?d.fnc(n.duration)||(e.duration=n.duration/r):t={value:t}}var o=d.arr(t)?t:[t];return o.map((function(t,e){var r=d.obj(t)&&!d.pth(t)?t:{value:t};return d.und(r.delay)&&(r.delay=e?0:n.delay),d.und(r.endDelay)&&(r.endDelay=e===o.length-1?n.endDelay:0),r})).map((function(t){return E(t,e)}))}var Q={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 J(t,n){X(t).forEach((function(t){for(var e in n){var r=I(n[e],t),o=t.target,i=k(r),a=L(o,e,i,t),u=q(z(r,i||k(a)),a),s=F(o,e);Q[s](o,e,u,t.transforms,!0)}}))}function K(t,n){return P(M(t.map((function(t){return n.map((function(n){return function(t,n){var e=F(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=I(t[r],n);d.arr(o)&&1===(o=o.map((function(t){return I(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=d.arr(i)?i[1]:i,u=k(a),s=L(n.target,t.name,u,n),c=e?e.to.original:s,l=d.arr(i)?i[0]:c,f=k(l)||k(s),h=u||f;return d.und(a)&&(a=c),o.from=$(l,h),o.to=$(q(a,l),h),o.start=e?e.end:0,o.end=o.start+o.delay+o.duration+o.endDelay,o.easing=O(o.easing,o.duration),o.isPath=d.pth(i),o.isPathTargetInsideSVG=o.isPath&&d.svg(n.target),o.isColor=d.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!d.und(t)}))}function U(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 tt=0,nt=[],et=function(){var t;function n(e){for(var r=nt.length,o=0;o<r;){var i=nt[o];i.paused?(nt.splice(o,1),r--):(i.tick(e),o++)}t=o>0?requestAnimationFrame(n):void 0}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){ot.suspendWhenDocumentHidden&&(rt()?t=cancelAnimationFrame(t):(nt.forEach((function(t){return t._onDocumentVisibility()})),et()))})),function(){t||rt()&&ot.suspendWhenDocumentHidden||!(nt.length>0)||(t=requestAnimationFrame(n))}}();function rt(){return!!document&&document.hidden}function ot(t){void 0===t&&(t={});var n,e=0,r=0,o=0,i=0,a=null;function c(t){var n=window.Promise&&new Promise((function(t){return a=t}));return t.finished=n,n}var l=function(t){var n=C(u,t),e=C(s,t),r=function(t,n){var e=[],r=n.keyframes;for(var o in r&&(n=E(function(t){for(var n=P(M(t.map((function(t){return Object.keys(t)}))),(function(t){return d.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)d.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)d.key(o)&&e.push({name:o,tweens:Z(n[o],t)});return e}(e,t),o=X(t.targets),i=K(o,r),a=U(i,e),c=tt;return tt++,E(n,{id:c,children:[],animatables:o,animations:i,duration:a.duration,delay:a.delay,endDelay:a.endDelay})}(t);function h(){var t=l.direction;"alternate"!==t&&(l.direction="normal"!==t?"normal":"reverse"),l.reversed=!l.reversed,n.forEach((function(t){return t.reversed=l.reversed}))}function p(t){return l.reversed?l.duration-t:t}function g(){e=0,r=p(l.currentTime)*(1/ot.speed)}function v(t,n){n&&n.seek(t-n.timelineOffset)}function y(t){for(var n=0,e=l.animations,r=e.length;n<r;){var o=e[n],i=o.animatable,a=o.tweens,u=a.length-1,s=a[u];u&&(s=P(a,(function(n){return t<n.end}))[0]||s);for(var c=f(t-s.start-s.delay,0,s.duration)/s.duration,h=isNaN(c)?1:s.easing(c),p=s.to.strings,d=s.round,g=[],v=s.to.numbers.length,y=void 0,m=0;m<v;m++){var w=void 0,b=s.to.numbers[m],x=s.from.numbers[m]||0;w=s.isPath?W(s.value,h*b,s.isPathTargetInsideSVG):x+h*(b-x),d&&(s.isColor&&m>2||(w=Math.round(w*d)/d)),g.push(w)}var O=p.length;if(O){y=p[0];for(var S=0;S<O;S++){p[S];var M=p[S+1],B=g[S];isNaN(B)||(y+=M?B+M:B+" ")}}else y=g[0];Q[o.type](i.target,o.property,y,i.transforms),o.currentValue=y,n++}}function m(t){l[t]&&!l.passThrough&&l[t](l)}function w(t){var u=l.duration,s=l.delay,d=u-l.endDelay,g=p(t);l.progress=f(g/u*100,0,100),l.reversePlayback=g<l.currentTime,n&&function(t){if(l.reversePlayback)for(var e=i;e--;)v(t,n[e]);else for(var r=0;r<i;r++)v(t,n[r])}(g),!l.began&&l.currentTime>0&&(l.began=!0,m("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,m("loopBegin")),g<=s&&0!==l.currentTime&&y(0),(g>=d&&l.currentTime!==u||!u)&&y(u),g>s&&g<d?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,m("changeBegin")),m("change"),y(g)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,m("changeComplete")),l.currentTime=f(g,0,u),l.began&&m("update"),t>=u&&(r=0,l.remaining&&!0!==l.remaining&&l.remaining--,l.remaining?(e=o,m("loopComplete"),l.loopBegan=!1,"alternate"===l.direction&&h()):(l.paused=!0,l.completed||(l.completed=!0,m("loopComplete"),m("complete"),!l.passThrough&&"Promise"in window&&(a(),c(l)))))}return c(l),l.reset=function(){var t=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed="reverse"===t,l.remaining=l.loop,n=l.children;for(var e=i=n.length;e--;)l.children[e].reset();(l.reversed&&!0!==l.loop||"alternate"===t&&1===l.loop)&&l.remaining++,y(l.reversed?l.duration:0)},l._onDocumentVisibility=g,l.set=function(t,n){return J(t,n),l},l.tick=function(t){o=t,e||(e=o),w((o+(r-e))*ot.speed)},l.seek=function(t){w(p(t))},l.pause=function(){l.paused=!0,g()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,nt.push(l),g(),et())},l.reverse=function(){h(),l.completed=!l.reversed,g()},l.restart=function(){l.reset(),l.play()},l.remove=function(t){at(Y(t),l)},l.reset(),l.autoplay&&l.play(),l}function it(t,n){for(var e=n.length;e--;)j(t,n[e].animatable.target)&&n.splice(e,1)}function at(t,n){var e=n.animations,r=n.children;it(t,e);for(var o=r.length;o--;){var i=r[o],a=i.animations;it(t,a),a.length||i.children.length||r.splice(o,1)}e.length||r.length||n.pause()}ot.version="3.2.1",ot.speed=1,ot.suspendWhenDocumentHidden=!0,ot.running=nt,ot.remove=function(t){for(var n=Y(t),e=nt.length;e--;)at(n,nt[e])},ot.get=L,ot.set=J,ot.convertPx=T,ot.path=function(t,n){var e=d.str(t)?S(t)[0]:t,r=n||100;return function(t){return{property:t,el:e,svg:G(e),totalLength:V(e)*(r/100)}}},ot.setDashoffset=function(t){var n=V(t);return t.setAttribute("stroke-dasharray",n),n},ot.stagger=function(t,n){void 0===n&&(n={});var e=n.direction||"normal",r=n.easing?O(n.easing):null,o=n.grid,i=n.axis,a=n.from||0,u="first"===a,s="center"===a,c="last"===a,l=d.arr(t),f=l?parseFloat(t[0]):parseFloat(t),h=l?parseFloat(t[1]):0,p=k(l?t[1]:t)||0,g=n.start||0+(l?f:0),v=[],y=0;return function(t,n,d){if(u&&(a=0),s&&(a=(d-1)/2),c&&(a=d-1),!v.length){for(var m=0;m<d;m++){if(o){var w=s?(o[0]-1)/2:a%o[0],b=s?(o[1]-1)/2:Math.floor(a/o[0]),x=w-m%o[0],O=b-Math.floor(m/o[0]),S=Math.sqrt(x*x+O*O);"x"===i&&(S=-x),"y"===i&&(S=-O),v.push(S)}else v.push(Math.abs(a-m));y=Math.max.apply(Math,v)}r&&(v=v.map((function(t){return r(t/y)*y}))),"reverse"===e&&(v=v.map((function(t){return i?t<0?-1*t:-t:Math.abs(y-t)})))}return g+(l?(h-f)/y:f)*(Math.round(100*v[n])/100)+p}},ot.timeline=function(t){void 0===t&&(t={});var n=ot(t);return n.duration=0,n.add=function(e,r){var o=nt.indexOf(n),i=n.children;function a(t){t.passThrough=!0}o>-1&&nt.splice(o,1);for(var u=0;u<i.length;u++)a(i[u]);var c=E(e,C(s,t));c.targets=c.targets||t.targets;var l=n.duration;c.autoplay=!1,c.direction=n.direction,c.timelineOffset=d.und(r)?l:q(r,l),a(n),n.seek(c.timelineOffset);var f=ot(c);a(f),i.push(f);var h=U(i,t);return n.delay=h.delay,n.endDelay=h.endDelay,n.duration=h.duration,n.seek(0),n.reset(),n.autoplay&&n.play(),n},n},ot.easing=O,ot.penner=x,ot.random=function(t,n){return Math.floor(Math.random()*(n-t+1))+t};const ut=ot;var st,ct=function(){return ct=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},ct.apply(this,arguments)},lt=function(){function t(t){this.props=ct({position:null,verticalAnchor:"top",horizontalAnchor:"start"},t),this._element=null}return t.prototype.generate=function(t){return null},t.prototype.element=function(){if(null===this._element)throw new Error("Element not yet generated");return this._element},t.prototype.animate=function(t,n){void 0===n&&(n=null);var e=t.bbox,r=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}(t,["bbox"]),o=ct(ct(ct({},r),void 0!==e?this.computePositionAttributes(n,e):{}),"cubic"===t.easing?{easing:"cubicBezier(0.42, 0, 0.58, 1)"}:{});ut(ct({targets:this.element(),duration:500,easing:"linear"},o))},t.prototype.animation=function(t){var n=this;return function(){return n.animate(t)}},t.prototype.animateMove=function(t,n,e){this.animate(ct({x:t.x,y:t.y},n),e)},t.prototype.positionInPresentation=function(t,n,e){return{x:n<=1?n*t.boundingBox.width:n,y:e<=1?e*t.boundingBox.height:e}},t.prototype.anchorBoundingBox=function(t){var n=this.props,e=n.verticalAnchor,o=n.horizontalAnchor,i=function(){switch(e){case"top":return t.origin.y;case"center":return t.origin.y-t.height/2;case"bottom":return t.origin.y-t.height}}(),a=function(){switch(o){case"start":return t.origin.x;case"center":return t.origin.x-t.width/2;case"end":return t.origin.x-t.width}}();return new r({x:a,y:i},t.width,t.height)},t.prototype.computeRenderedBoundingBox=function(t,n,e){void 0===e&&(e=!1);var o=n.computeRenderedBoundingBox(t);return new r({x:this.props.position.x,y:this.props.position.y},o.width,o.height)},t.prototype.computePositionAttributes=function(t,n){if(null===t)throw new Error("Cannot compute object position attributes without presentation");var e=this.positionInPresentation(t,n.origin.x,n.origin.y),o=e.x,i=e.y,a=this.anchorBoundingBox(new r({x:o,y:i},n.width,n.height));return{x:a.origin.x,y:a.origin.y}},t.prototype.setPositionAttributes=function(t,n,e){for(var r=0,o=Object.entries(this.computePositionAttributes(t,n));r<o.length;r++){var i=o[r],a=i[0],u=i[1];e.setAttribute(a,u.toString())}},t}(),ft=(st=function(t,n){return st=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])},st(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}st(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),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)},pt=function(t){function n(n){if(void 0===n&&(n={}),!n.href)throw new Error("Image requires a href");return t.call(this,ht({width:100,height:100},n))||this}return ft(n,t),n.prototype.generate=function(t){var n=this.props,e=n.width,o=n.height,i=n.href,a=document.createElementNS("http://www.w3.org/2000/svg","image");return a.setAttribute("href",i),a.setAttribute("width",e.toString()),a.setAttribute("height",o.toString()),this.setPositionAttributes(t,new r(this.props.position,e,o),a),a},n.prototype.animateMove=function(t,n,e){var o=new r(t,this.props.width,this.props.height);this.animate(ht({bbox:o},n),e)},n}(lt),dt=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)}}(),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({color:"#000000",content:"",fontSize:40,fontStyle:"normal",fontFamily:"Arial"},n))||this}return dt(n,t),n.prototype.generate=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","text");return n.innerHTML=this.props.content,n.style.font="".concat(this.props.fontStyle," ").concat(this.props.fontSize,"px ").concat(this.props.fontFamily),n.style.fill=this.props.color,this.setPositionAttributes(t,this.computeRenderedBoundingBox(n,t,!0),n),n},n.prototype.computePositionAttributes=function(t,n){var e=this.positionInPresentation(t,n.origin.x,n.origin.y),o=e.x,i=e.y,a=this.anchorBoundingBox(new r({x:o,y:i},n.width,n.height));return{x:a.origin.x,y:a.origin.y+n.height}},n.prototype.animateMove=function(t,n,e){var o=this.computeRenderedBoundingBox(this.element(),e,!0),i=new r(t,o.width,o.height);console.log(i),this.animate(gt({bbox:i},n),e)},n}(lt),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)}}(),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)},wt=function(t){function n(n){return void 0===n&&(n={}),t.call(this,mt({color:"#000000",width:100,height:100},n))||this}return yt(n,t),n.prototype.generate=function(t){var n=this.props,e=n.width,o=n.height,i=n.color,a=document.createElementNS("http://www.w3.org/2000/svg","rect");return a.setAttribute("fill",i),a.setAttribute("width",e.toString()),a.setAttribute("height",o.toString()),this.setPositionAttributes(t,new r(this.props.position,e,o),a),a},n.prototype.animateMove=function(t,n,e){var o=new r(t,this.props.width,this.props.height);this.animate(mt({bbox:o},n),e)},n}(lt);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:()=>St,BoundingBox:()=>e,Group:()=>Pt,Image:()=>At,Line:()=>vt,Paragraph:()=>It,Polygon:()=>wt,Presentation:()=>o,Rectangle:()=>Wt,Slide:()=>ht,SlideObject:()=>dt,Text:()=>Ft,VectorGraphic:()=>Rt,createSpacePreservingTextNode:()=>kt,generateTextNodes:()=>Tt,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 E(t,n){return h.fnc(t)?t(n.target,n.id,n.total):t}function B(t,n){return t.getAttribute(n)}function I(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 k(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 T(t,n){return h.dom(t)&&!h.inp(t)&&(!h.nil(B(t,n))||h.svg(t)&&t[n])?"attribute":h.dom(t)&&j(s,n)?"transform":h.dom(t)&&"transform"!==n&&k(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?I(t,i,r):i}(t,n,r,e);case"css":return k(t,n,e);case"attribute":return B(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*B(t,"r")}(t);case"rect":return function(t){return 2*B(t,"width")+2*B(t,"height")}(t);case"line":return function(t){return z({x:B(t,"x1"),y:B(t,"y1")},{x:B(t,"x2"),y:B(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=B(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 Y(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 K={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=E(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);K[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=E(t[r],n);h.arr(o)&&1===(o=o.map((function(t){return E(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:Y(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];K[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=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: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}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.sleep=function(t){return n=this,e=void 0,o=function(){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(n){return[2,new Promise((function(n){return setTimeout(n,t)}))]}))},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}(),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),Et=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)},It=function(t){function n(n,e){return void 0===e&&(e={}),t.call(this,Bt({content:n,width:1e3,height:1e3,fontSize:100,fontFamily:"Arial",color:"#000000"},e))||this}return Et(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 Bt(Bt({},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 Bt(Bt({},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 kt(t){return document.createTextNode(t.replace(/\s/g," "))}function Tt(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(kt(" ")),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(kt(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(kt(s)),r.push(u)}return r}var 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)}}(),Dt=function(){return Dt=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},Dt.apply(this,arguments)},Ft=function(t){function n(n,e){return void 0===e&&(e={}),t.call(this,Dt({content:n,color:"#000000",fontSize:150,fontStyle:"normal",fontWeight:"normal",fontFamily:"Arial",dominantBaseline:"ideographic",textDecoration:"none",align:"left",lineSpacing:"1em"},e))||this}return Nt(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 Dt(Dt(Dt({},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 Dt(Dt(Dt({},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 Dt(Dt(Dt(Dt({},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,'"')})},n.prototype.children=function(){var t=this.props.content;if("string"==typeof t)return[kt(t)];var n="left"===this.props.align?"start":"center"===this.props.align?"middle":"end";return Tt(t,this.props.lineSpacing,n)},n.prototype.requiresChildrenUpdate=function(t){return"content"in t&&t.content!==this.props.content},n}(dt),Lt=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)}}(),zt=function(){return zt=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},zt.apply(this,arguments)},Wt=function(t){function n(n){return void 0===n&&(n={}),t.call(this,zt({fill:"#000000",width:100,height:100,rounding:0,borderWidth:0,borderColor:"#000000"},n))||this}return Lt(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 zt(zt(zt({},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),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)}}(),qt=function(){return qt=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},qt.apply(this,arguments)},Rt=function(t){function n(n,e){return void 0===e&&(e={}),t.call(this,qt({svg:n,width:100,height:100},e))||this}return Ht(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 qt(qt({},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})()));
@@ -0,0 +1,15 @@
1
+ export * from "./presentation/presentation";
2
+ export * from "./presentation/slide";
3
+ export * from "./presentation/object";
4
+ export * from "./objects/arrow";
5
+ export * from "./objects/group";
6
+ export * from "./objects/image";
7
+ export * from "./objects/line";
8
+ export * from "./objects/paragraph";
9
+ export * from "./objects/polygon";
10
+ export * from "./objects/text";
11
+ export * from "./objects/rectangle";
12
+ export * from "./objects/vectorGraphic";
13
+ export * from "./util/animation";
14
+ export * from "./util/position";
15
+ export * from "./util/richText";
@@ -0,0 +1,36 @@
1
+ import { ObjectProps, SlideObject } from "../presentation/object";
2
+ import { AnimationProps } from "../util/animation";
3
+ import { Position } from "../util/position";
4
+ import { Line } from "./line";
5
+ import { Polygon } from "./polygon";
6
+ export interface ArrowProps extends ObjectProps {
7
+ start: Position;
8
+ end: Position;
9
+ color: string;
10
+ width: number;
11
+ arrowSize: number;
12
+ }
13
+ export declare class Arrow extends SlideObject<ArrowProps> {
14
+ line: Line | null;
15
+ arrowhead: Polygon | null;
16
+ constructor(props?: Partial<ArrowProps>);
17
+ tagName(): string;
18
+ /**
19
+ * Computes coordinates for the line and arrowhead of the arrow.
20
+ */
21
+ calculateShapes(props: ArrowProps): {
22
+ line: {
23
+ start: Position;
24
+ end: {
25
+ x: number;
26
+ y: number;
27
+ };
28
+ };
29
+ arrowhead: Position[];
30
+ };
31
+ children(): Node[];
32
+ /**
33
+ * Returns animations for changes in arrowhead.
34
+ */
35
+ animations(arrowProps: Partial<ArrowProps>, animationParams?: anime.AnimeParams): AnimationProps[];
36
+ }
@@ -0,0 +1,16 @@
1
+ import { ObjectProps, SlideObject } from "../presentation/object";
2
+ export interface GroupProps extends ObjectProps {
3
+ /**
4
+ * A positioned group places the group's anchor at a particular coordinate.
5
+ * A non-positioned group uses the position as an offset for its children.
6
+ */
7
+ positioned: boolean;
8
+ objects: SlideObject<any>[];
9
+ }
10
+ export declare class Group extends SlideObject<GroupProps> {
11
+ constructor(objects: SlideObject<any>[], props?: Partial<GroupProps>, positioned?: boolean | null);
12
+ tagName(): string;
13
+ attributes(): Partial<Record<string, string>>;
14
+ additionalAttributes(): Partial<Record<string, string>>;
15
+ children(): Node[];
16
+ }
@@ -0,0 +1,11 @@
1
+ import { ObjectProps, SlideObject } from "../presentation/object";
2
+ export interface ImageProps extends ObjectProps {
3
+ href: string;
4
+ width: number;
5
+ height: number;
6
+ }
7
+ export declare class Image extends SlideObject<ImageProps> {
8
+ constructor(href: string, props?: Partial<ImageProps>);
9
+ tagName(): string;
10
+ attributes(): Partial<Record<string, string>>;
11
+ }
@@ -0,0 +1,13 @@
1
+ import { ObjectProps, SlideObject } from "../presentation/object";
2
+ import { Position } from "../util/position";
3
+ export interface LineProps extends ObjectProps {
4
+ start: Position;
5
+ end: Position;
6
+ color: string;
7
+ width: number;
8
+ }
9
+ export declare class Line extends SlideObject<LineProps> {
10
+ constructor(props?: Partial<LineProps>);
11
+ tagName(): string;
12
+ attributes(): Partial<Record<string, string>>;
13
+ }
@@ -0,0 +1,17 @@
1
+ import { ObjectProps, SlideObject } from "../presentation/object";
2
+ export interface ParagraphProps extends ObjectProps {
3
+ content: string | string[];
4
+ width: number;
5
+ height: number;
6
+ fontSize: number;
7
+ fontFamily: string;
8
+ color: string;
9
+ }
10
+ export declare class Paragraph extends SlideObject<ParagraphProps> {
11
+ constructor(content: string | string[], props?: Partial<ParagraphProps>);
12
+ tagName(): string;
13
+ attributes(): Partial<Record<string, string>>;
14
+ children(): Node[];
15
+ additionalAttributes(): Partial<Record<string, string>>;
16
+ requiresChildrenUpdate(props: Partial<ParagraphProps>): boolean;
17
+ }
@@ -0,0 +1,13 @@
1
+ import { ObjectProps, SlideObject } from "../presentation/object";
2
+ import { Position } from "../util/position";
3
+ export interface PolygonProps extends ObjectProps {
4
+ points: Position[];
5
+ fill: string;
6
+ borderWidth: number;
7
+ borderColor: string;
8
+ }
9
+ export declare class Polygon extends SlideObject<PolygonProps> {
10
+ constructor(points: Position[], props?: Partial<PolygonProps>);
11
+ tagName(): string;
12
+ attributes(): Partial<Record<string, string>>;
13
+ }
@@ -0,0 +1,14 @@
1
+ import { ObjectProps, SlideObject } from "../presentation/object";
2
+ export interface RectangleProps extends ObjectProps {
3
+ fill: string;
4
+ width: number;
5
+ height: number;
6
+ rounding: number;
7
+ borderWidth: number;
8
+ borderColor: string;
9
+ }
10
+ export declare class Rectangle extends SlideObject<RectangleProps> {
11
+ constructor(props?: Partial<RectangleProps>);
12
+ tagName(): string;
13
+ attributes(): Partial<Record<string, string>>;
14
+ }
@@ -0,0 +1,29 @@
1
+ import { ObjectProps, SlideObject } from "../presentation/object";
2
+ import { RichTextSpan } from "../util/richText";
3
+ export type TextContent = string | (string | RichTextSpan[])[];
4
+ export interface TextProps extends ObjectProps {
5
+ content: TextContent;
6
+ fontStyle: string;
7
+ fontWeight: string | number;
8
+ fontSize: number;
9
+ fontFamily: string;
10
+ color: string;
11
+ dominantBaseline: string;
12
+ textDecoration: string;
13
+ align: "left" | "center" | "right";
14
+ lineSpacing: string;
15
+ }
16
+ export declare class Text extends SlideObject<TextProps> {
17
+ constructor(content: TextContent, props?: Partial<TextProps>);
18
+ isRichText(): boolean;
19
+ tagName(): string;
20
+ attributes(): Partial<Record<string, string>>;
21
+ /**
22
+ * Text elements return position as additional attributes since computing text
23
+ * size and position requires other properties to be set first.
24
+ */
25
+ additionalAttributes(): Partial<Record<string, string>>;
26
+ styles(): Partial<Record<string, string>>;
27
+ children(): Node[];
28
+ requiresChildrenUpdate(props: Partial<TextProps>): boolean;
29
+ }
@@ -0,0 +1,14 @@
1
+ import { ObjectProps, SlideObject } from "../presentation/object";
2
+ export interface VectorGraphicProps extends ObjectProps {
3
+ svg: string;
4
+ width: number;
5
+ height: number;
6
+ }
7
+ export declare class VectorGraphic extends SlideObject<VectorGraphicProps> {
8
+ parsedChildren: Node[];
9
+ constructor(svg: string, props?: Partial<VectorGraphicProps>);
10
+ tagName(): string;
11
+ createElement(): SVGElement;
12
+ attributes(): Partial<Record<string, string>>;
13
+ children(): Node[];
14
+ }
@@ -0,0 +1,122 @@
1
+ import { BoundingBox, Position } from "../util/position";
2
+ import { Presentation } from "./presentation";
3
+ import { AnimationProps, BuildFunction } from "../util/animation";
4
+ export interface ObjectProps {
5
+ position: Position | null;
6
+ opacity?: number;
7
+ anchor: "topleft" | "top" | "topright" | "left" | "center" | "right" | "bottomleft" | "bottom" | "bottomright";
8
+ }
9
+ export declare class SlideObject<Props extends ObjectProps> {
10
+ /**
11
+ * Starting values for each property.
12
+ */
13
+ initialProps: Props;
14
+ /**
15
+ * Current values for each property.
16
+ */
17
+ props: Props;
18
+ _presentation: Presentation | null;
19
+ _element: SVGElement | null;
20
+ _children: Node[];
21
+ /**
22
+ * Initializes a new object to include on a slide.
23
+ * @param props Object properties.
24
+ */
25
+ constructor(props: Partial<Props>);
26
+ /**
27
+ * Returns the tag name of the element.
28
+ * @returns Tag name.
29
+ */
30
+ tagName(): string;
31
+ /**
32
+ * Returns the DOM attributes that should be set for the element.
33
+ * @returns Object with attribute names and values.
34
+ */
35
+ attributes(): Partial<Record<string, string>>;
36
+ /**
37
+ * Returns additional DOM attributes to be set for the element.
38
+ * Some attributes can't be computed until after an element's other properties are set:
39
+ * e.g. text position depends on content and font size.
40
+ * Additional attributes are computed after all other attributes, styles, and children.
41
+ * @returns Object with attribute names and values.
42
+ */
43
+ additionalAttributes(): Partial<Record<string, string>>;
44
+ /**
45
+ * Returns the styles that should be set for the element.
46
+ * @returns Object with style names and values.
47
+ */
48
+ styles(): Partial<Record<string, string>>;
49
+ /**
50
+ * Returns the children that should be rendered for the object.
51
+ * @returns Array of SVG elements.
52
+ */
53
+ children(): Node[];
54
+ /**
55
+ * Given a set of prop updates, checks if the children of the object need to be updated.
56
+ * @param props Properties to update.
57
+ * @returns Boolean indicating whether children need to be updated.
58
+ */
59
+ requiresChildrenUpdate(props: Partial<Props>): boolean;
60
+ /**
61
+ * Given a particular initial bounding box, returns the DOM position attributes that should be set for the element.
62
+ * @param bbox Bounding box.
63
+ * @returns Object with attribute names and values.
64
+ */
65
+ positionAttributes(bbox: BoundingBox): any;
66
+ /**
67
+ * Re-generates the SVG element for the object.
68
+ * @param presentation Presentation object.
69
+ * @returns SVG element.
70
+ */
71
+ generate(presentation: Presentation): SVGElement;
72
+ /**
73
+ * Creates a new HTML element for the object.
74
+ */
75
+ createElement(): SVGElement;
76
+ /**
77
+ * Returns the element for the object.
78
+ * @returns SVG element.
79
+ */
80
+ element(): SVGElement;
81
+ /**
82
+ * Returns an animation to perform.
83
+ * @param props Properties of object to change.
84
+ * @param animationParams Animation behavior parameters.
85
+ * @returns Animation properties.
86
+ */
87
+ animation(props: Partial<Props>, animationParams?: anime.AnimeParams, delay?: number | null, animate?: boolean): AnimationProps;
88
+ /**
89
+ * Returns an update animation that skips the animation and just performs the change.
90
+ * @param props Properties of object to change.
91
+ */
92
+ update(props: Partial<Props>, delay?: number | null): AnimationProps;
93
+ /**
94
+ * Performs an animation on the object.
95
+ */
96
+ animate(props: Partial<Props>, animationParams?: anime.AnimeParams): BuildFunction;
97
+ /**
98
+ * Sets properties of the object.
99
+ */
100
+ set(props: Partial<Props>): BuildFunction;
101
+ /**
102
+ * Animates a movement of the object.
103
+ */
104
+ move(position: Position, animationParams?: anime.AnimeParams): BuildFunction;
105
+ /**
106
+ * Allow for x and y values to be interpreted as percentages of total width/height.
107
+ */
108
+ positionInPresentation(position: Position): Position;
109
+ /**
110
+ * Adjusts a bounding box to be anchored given the object's vertical and horizontal anchor settings.
111
+ * @param bbox Bounding box to anchor.
112
+ * @returns Anchored bounding box.
113
+ */
114
+ anchorBoundingBox(bbox: BoundingBox): BoundingBox;
115
+ /**
116
+ * Computes a bounding box for a given element given its rendered size and defined position.
117
+ * @param element Element for which to compute size.
118
+ * @param children Custom children to use when computing bounding box.
119
+ * @returns
120
+ */
121
+ computeRenderedBoundingBox(element: SVGGraphicsElement, children?: Node[] | null): BoundingBox;
122
+ }