You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

typeit

Package Overview
Dependencies
Maintainers
1
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 8.0.0-rc.1 to 8.0.0-rc.2

11

dist/helpers/setCursorStyles.d.ts
import { Element, Options } from "../types";
export declare const cursorFontStyles: readonly ["font-family", "font-weight", "font-size", "font-style", "line-height", "color"];
export declare const cursorFontStyles: {
readonly "font-family": "";
readonly "font-weight": "";
readonly "font-size": "";
readonly "font-style": "";
readonly "line-height": "";
readonly color: "";
readonly "margin-left": "-.125em";
readonly "margin-right": ".125em";
};
export declare const setCursorStyles: (id: string, options: Options, element: Element) => void;

2

dist/index.esm.js
// TypeIt by Alex MacArthur - https://typeitjs.com
const e=[null,null,{}];var t=(e,t)=>Object.assign({},e,t),n=e=>Array.from(e),r=e=>(new DOMParser).parseFromString(e,"text/html").body;const o=(e,t=null,r=!1)=>{let i=n(e.childNodes).flatMap(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:o(e);var t});return t&&(i=i.filter(e=>!t.contains(e))),r?i.reverse():i},i=(e,t=null)=>({node:t,content:e});function s(e){let t=r(e);return o(t).flatMap(e=>e.nodeValue?n(e.nodeValue).map(t=>i(t,e)):i(e))}function u(e,t=!0){return t?s(e):n(e).map(e=>i(e))}var l=e=>document.createElement(e),c=e=>document.createTextNode(e),a=(e,t="")=>{let n=l("style");n.id=t,n.appendChild(c(e)),document.head.appendChild(n)},f=e=>Array.isArray(e);const h=e=>Number.isInteger(e),d=(e,t=document,n=!1)=>t["querySelector"+(n?"All":"")](e),m={started:!1,completed:!1,frozen:!1,destroyed:!1},v={breakLines:!0,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,html:!0,lifeLike:!0,loop:!1,loopDelay:750,nextStringDelay:750,speed:100,startDelay:250,startDelete:!1,strings:[],waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},p=(e,t,n="START")=>{let r=new RegExp("END","i").test(n),i=d(".ti-cursor",t),s=e?d(e,t):t,u=o(s,i,!0),l=u[0],c=u[u.length-1],a=r&&!e?0:o(t,i,!0).findIndex(e=>e.isSameNode(r?l:c));return r&&a--,a+1};var y=e=>(f(e)||(e=[e/2,e/2]),e),g=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));let P=e=>e/2;var b=e=>"value"in e;const S=e=>"function"==typeof e?e():e;var N=e=>"BODY"===e.tagName;const M=(e,t)=>{let r=n(d("*",t,!0));return[t].concat(r.reverse()).find(t=>t.cloneNode().isEqualNode(e.cloneNode()))},T=(e,t,n,r)=>{let i=t.content instanceof HTMLElement,s=t.node,u=null==s?void 0:s.parentNode,l=i?t.content:c(t.content);if(b(e))return void(e.value=""+e.value+t.content);if(!i&&u&&!N(u)){let r=M(u,e);if(r&&((e,t)=>{let n=e.nextSibling;return!n||n.isEqualNode(t)})(r,n))e=r;else{l=u.cloneNode(),l.appendChild(c(t.content));let n=u.parentNode,r=n.cloneNode();if(!N(n)){let t=M(r,e);for(;!t&&!N(n);){let o=r;o.innerHTML=l.outerHTML,l=o,n=n.parentNode,r=n.cloneNode(),t=M(r,e)}e=t||e}}}let a=o(e,n,!0)[r-1],f=a?a.parentNode:e;f.insertBefore(l,f.contains(n)?n:null)};var w=e=>e&&e.remove();const x=["font-family","font-weight","font-size","font-style","line-height","color"];function j(e,t,n){if(!e.s){if(n instanceof D){if(!n.s)return void(n.o=j.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(j.bind(null,e,t),j.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const D=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{j(r,1,e(this.v))}catch(e){j(r,2,e)}return r}return this}return this.o=function(e){try{const o=e.v;1&e.s?j(r,1,t?t(o):o):n?j(r,1,n(o)):j(r,2,o)}catch(e){j(r,2,e)}},r},e}();function E(e){return e instanceof D&&1&e.s}function L(e,t,n){var r,o,i=-1;return function s(u){try{for(;++i<e.length&&(!n||!n());)if((u=t(i))&&u.then){if(!E(u))return void u.then(s,o||(o=j.bind(null,r=new D,2)));u=u.v}r?j(r,1,u):r=u}catch(e){j(r||(r=new D),2,e)}}(),r}function k(e,t,n){for(var r;;){var o=e();if(E(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!E(i)){r=1;break}i=i.s}if(t){var s=t();if(s&&s.then&&!E(s)){r=2;break}}}var u=new D,l=j.bind(null,u,2);return(0===r?o.then(a):1===r?i.then(c):s.then(f)).then(void 0,l),u;function c(r){i=r;do{if(t&&(s=t())&&s.then&&!E(s))return void s.then(f).then(void 0,l);if(!(o=e())||E(o)&&!o.v)return void j(u,1,i);if(o.then)return void o.then(a).then(void 0,l);E(i=n())&&(i=i.v)}while(!i||!i.then);i.then(c).then(void 0,l)}function a(e){e?(i=n())&&i.then?i.then(c).then(void 0,l):c(i):j(u,1,i)}function f(){(o=e())?o.then?o.then(a).then(void 0,l):a(o):j(u,1,i)}}function C(c,N={}){const M=this,j=function(e,t){try{return Promise.resolve(function(e,t,n){try{return Promise.resolve(new Promise(r=>{n.push(setTimeout(function(){try{return Promise.resolve(e()).then(function(){r()})}catch(e){return Promise.reject(e)}},t))}))}catch(e){return Promise.reject(e)}}(e,t,J))}catch(e){return Promise.reject(e)}},D=()=>b(Y),E=e=>function(e){let{speed:t,deleteSpeed:n,lifeLike:r}=e;return n=null!==n?n:t/3,r?[g(t,P(t)),g(n,P(n))]:[t,n]}(Z)[e],C=(e,t=0)=>e?E(t):0,z=(e,t)=>(_.add(e),((e={})=>{let t=e.delay;t&&_.add([[q,t]])})(t),this),A=()=>(e=>b(e)?n(e.value):o(e,d(".ti-cursor",e),!0))(Y),H=(e={})=>[[F,e],[F,Z]],R=e=>{let t=Z.nextStringDelay;_.add([[q,t[0]],...e,[q,t[1]]])},B=e=>{ee&&(te.classList.toggle("disabled",e),te.classList.toggle("with-delay",!e))},I=function(){try{let e;X.started=!0;let t,n=_.getItems();const r=function(r,o){try{var i=function(){function r(e){return X.completed=!0,Promise.resolve(Z.afterComplete(...t)).then(function(){if(!Z.loop)throw"";let e=Z.loopDelay;j(function(){try{return Promise.resolve(function(e){try{function t(t){return _.reset(),_.set(0,[q,e,{}]),Promise.resolve(Q({num:null})).then(function(){})}return Promise.resolve(K?Promise.resolve(O({value:K})).then(t):t())}catch(e){return Promise.reject(e)}}(e[0])).then(function(){I()})}catch(e){return Promise.reject(e)}},e[1])})}const o=L(n,function(e){if(X.frozen||X.destroyed)throw"";let r=n[e],o=r[2];return t=[r,M],o.freezeCursor&&B(!0),Promise.resolve(Z.beforeStep(...t)).then(function(){return Promise.resolve(r[0].call(M,r[1],o)).then(function(){return Promise.resolve(Z.afterStep(...t)).then(function(){_.setMeta(e,{executed:!0}),B(!1)})})})},function(){return e});return o&&o.then?o.then(r):r()}()}catch(e){return}return i&&i.then?i.then(void 0,function(){}):i}();return Promise.resolve(r&&r.then?r.then(function(t){return e?t:M}):e?r:M)}catch(e){return Promise.reject(e)}},q=(e=0)=>j(()=>{},e),O=function({value:e,to:t="START",instant:n=!1}){try{let r=(({el:e,move:t,cursorPos:n,to:r})=>h(t)?-1*t:p(t,e,r)-n)({el:Y,move:e,cursorPos:K,to:t}),o=()=>{K+=r<0?-1:1,((e,t,n,r)=>{let o=t[Math.min(r,t.length)-1];(e=(null==o?void 0:o.parentNode)||e).insertBefore(n,o||null)})(Y,A(),te,K)};return Promise.resolve(j(function(){try{let e=0;const t=k(function(){return e<Math.abs(r)},function(){return e++},function(){return n?void o():Promise.resolve(j(o,E(0))).then(function(e){})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},C(n))).then(function(){})}catch(e){return Promise.reject(e)}},V=({chars:e,instant:t,silent:n})=>j(function(){try{function r(r){function i(){return n?void 0:Promise.resolve(Z.afterString(e)).then(function(e){})}const s=L(e,function(n){return t?void o(e[n]):Promise.resolve(j(()=>{o(e[n])},E(0))).then(function(e){})});return s&&s.then?s.then(i):i()}const o=e=>T(Y,e,te,K);return Promise.resolve(n?r():Promise.resolve(Z.beforeString(e)).then(r))}catch(e){return Promise.reject(e)}},C(t)),F=function(e){try{return Z=t(Z,e),Promise.resolve()}catch(e){return Promise.reject(e)}},U=function(){try{return D()?(Y.value="",Promise.resolve()):(A().forEach(e=>{w(e)}),Promise.resolve())}catch(e){return Promise.reject(e)}},Q=function({num:e=null,instant:t=!1,to:n="START"}){try{const r=e=>h(e)?e:p(e,Y,n);return Promise.resolve(j(function(){try{let n=r(e);const o=()=>{let e=A();var t;e.length&&(D()?Y.value=Y.value.slice(0,-1):(w(e[K]),t=te,d("*",Y,!0).forEach(e=>{if(!e.innerHTML&&"BR"!==e.tagName&&!e.isSameNode(t)){let t=e;for(;1===t.parentElement.childNodes.length;)t=t.parentElement;w(t)}})))};let i=0;const s=k(function(){return i<n},function(){return i++},function(){return t?void o():Promise.resolve(j(o,E(1))).then(function(e){})});return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},C(t,1))).then(function(){const t=function(){if(null===e&&A().length-1>0)return Promise.resolve(Q({num:null})).then(function(){})}();if(t&&t.then)return t.then(function(){})})}catch(e){return Promise.reject(e)}};this.break=function(e){const t=i(l("BR"));return z([[V,{chars:[t],silent:!0}]],e)},this.delete=function(e=null,t={}){e=S(e);let n=H(t),r=e,{instant:o,to:i}=t;return z([n[0],[Q,{num:r,instant:o,to:i},W],n[1]],t)},this.empty=function(e={}){return z([[U]],e)},this.exec=function(e,t){let n=H(t);return z([n[0],[e,null],n[1]],t)},this.move=function(e,t={}){e=S(e);let n=H(t),{instant:r,to:o}=t;return z([n[0],[O,{value:null===e?"":e,to:o,instant:r},W],n[1]],t)},this.options=function(e){return e=S(e),z([[F,e]],e)},this.pause=function(e,t={}){return z([[q,S(e)]],t)},this.type=function(e,t={}){e=S(e);let n=H(t),r=u(e,Z.html),{instant:o}=t;return z([n[0],[V,{chars:r,instant:o},W],n[1]],t)},this.is=function(e){return X[e]},this.destroy=function(e=!0){J.forEach(e=>clearTimeout(e)),J=[],S(e)&&w(te),X.destroyed=!0},this.freeze=function(){X.frozen=!0},this.unfreeze=function(){X.frozen=!1,I()},this.reset=function(){!this.is("destroyed")&&this.destroy(),_.reset(),K=0;for(let e in X)X[e]=!1;return Y[D()?"value":"innerHTML"]="",this},this.go=function(){return X.started?this:(function(){try{function e(e){requestAnimationFrame(()=>{requestAnimationFrame(()=>{const e=te.getBoundingClientRect().width/2;te.style.margin="0 -"+(e+2)+"px 0 -"+(e-2)+"px"})})}if(!D()&&Y.appendChild(te),!ee)return Promise.resolve();((e,t,n)=>{let r="[data-typeit-id='"+e+"'] .ti-cursor",o=getComputedStyle(n),i=x.reduce((e,t)=>e+" "+t+": var(--ti-"+t+", "+o[t]+");","");a("@keyframes blink-"+e+" { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } "+r+" { display: inline; "+i+" animation: blink-"+e+" "+t.cursorSpeed/1e3+"s infinite; } "+r+".with-delay { animation-delay: 500ms; } "+r+".disabled { animation: none; }",e)})($,Z,Y);const t="loaded"===document.fonts.status;Promise.resolve(t?e():Promise.resolve(document.fonts.ready).then(e))}catch(e){return Promise.reject(e)}}(),Z.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(Y,I.bind(this)),this):(I(),this))},this.getQueue=function(){return _},this.getOptions=function(){return Z},this.getElement=function(){return Y};let Y="string"==typeof(G=c)?d(G):G;var G;let J=[],K=0,W={freezeCursor:!0},X=t({},m),Z=t(v,N);Z=t(Z,{html:!D()&&Z.html,nextStringDelay:y(Z.nextStringDelay),loopDelay:y(Z.loopDelay)});let $=Math.random().toString().substring(2,9),_=function(n){const r=function(t){return o=o.concat(t.map(t=>e.map((e,n)=>t[n]?t[n]:e))),this};let o=[];return r(n),{add:r,set:function(e,t){o[e]=t},reset:function(){o=o.map(e=>(e[2].executed=!1,e))},getItems:function(){return o.filter(e=>!e[2].executed)},setMeta:function(e,n){o[e][2]=t(o[e][2],n)}}}([[q,Z.startDelay]]);Y.dataset.typeitId=$,a("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}");let ee=Z.cursor&&!D(),te=(()=>{if(D())return;let e=l("span");return e.className="ti-cursor",ee?(e.innerHTML=r(Z.cursorChar).innerHTML,e):(e.style.visibility="hidden",e)})();var ne;Z.strings=(e=>{let t=Y.innerHTML;return t?(Y.innerHTML="",Z.startDelete?(s(t).forEach(e=>{T(Y,e,te,K)}),R([[Q,{num:null}]]),e):t.trim().split(/<br(?:\s*?)(?:\/)?>/).concat(e)):e})(f(ne=Z.strings)?ne:[ne]),Z.strings.length&&(()=>{let e=Z.strings.filter(e=>!!e);e.forEach((t,n)=>{let r=u(t,Z.html);if(_.add([[V,{chars:r},W]]),n+1===e.length)return;const o=Z.breakLines?[[V,{chars:[i(l("BR"))]},W]]:[[Q,{num:r.length},W]];R(o)})})()}export{C as default};
const e=[null,null,{}];var t=(e,t)=>Object.assign({},e,t),n=e=>Array.from(e),r=e=>{let t=document.implementation.createHTMLDocument();return t.body.innerHTML=e,t.body};const o=(e,t=null,r=!1)=>{let i=n(e.childNodes).flatMap(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:o(e);var t});return t&&(i=i.filter(e=>!t.contains(e))),r?i.reverse():i},i=(e,t=null)=>({node:t,content:e});function s(e){let t=r(e);return o(t).flatMap(e=>e.nodeValue?n(e.nodeValue).map(t=>i(t,e)):i(e))}function u(e,t=!0){return t?s(e):n(e).map(e=>i(e))}var l=e=>document.createElement(e),c=e=>document.createTextNode(e),a=(e,t="")=>{let n=l("style");n.id=t,n.appendChild(c(e)),document.head.appendChild(n)},f=e=>Array.isArray(e);const h=e=>Number.isInteger(e),d=(e,t=document,n=!1)=>t["querySelector"+(n?"All":"")](e),m={started:!1,completed:!1,frozen:!1,destroyed:!1},v={breakLines:!0,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,html:!0,lifeLike:!0,loop:!1,loopDelay:750,nextStringDelay:750,speed:100,startDelay:250,startDelete:!1,strings:[],waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},p=(e,t,n="START")=>{let r=new RegExp("END","i").test(n),i=d(".ti-cursor",t),s=e?d(e,t):t,u=o(s,i,!0),l=u[0],c=u[u.length-1],a=r&&!e?0:o(t,i,!0).findIndex(e=>e.isSameNode(r?l:c));return r&&a--,a+1};var y=e=>(f(e)||(e=[e/2,e/2]),e),g=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));let P=e=>e/2;var b=e=>"value"in e;const S=e=>"function"==typeof e?e():e;var N=e=>"BODY"===e.tagName;const T=(e,t)=>{let r=n(d("*",t,!0));return[t].concat(r.reverse()).find(t=>t.cloneNode().isEqualNode(e.cloneNode()))},M=(e,t,n,r)=>{let i=t.content instanceof HTMLElement,s=t.node,u=null==s?void 0:s.parentNode,l=i?t.content:c(t.content);if(b(e))return void(e.value=""+e.value+t.content);if(!i&&u&&!N(u)){let r=T(u,e);if(r&&((e,t)=>{let n=e.nextSibling;return!n||n.isEqualNode(t)})(r,n))e=r;else{l=u.cloneNode(),l.appendChild(c(t.content));let n=u.parentNode,r=n.cloneNode();if(!N(n)){let t=T(r,e);for(;!t&&!N(n);){let o=r;o.innerHTML=l.outerHTML,l=o,n=n.parentNode,r=n.cloneNode(),t=T(r,e)}e=t||e}}}let a=o(e,n,!0)[r-1],f=a?a.parentNode:e;f.insertBefore(l,f.contains(n)?n:null)};var L=e=>e&&e.remove();const j={"font-family":"","font-weight":"","font-size":"","font-style":"","line-height":"",color:"","margin-left":"-.125em","margin-right":".125em"};function w(e,t,n){if(!e.s){if(n instanceof D){if(!n.s)return void(n.o=w.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(w.bind(null,e,t),w.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const D=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{w(r,1,e(this.v))}catch(e){w(r,2,e)}return r}return this}return this.o=function(e){try{const o=e.v;1&e.s?w(r,1,t?t(o):o):n?w(r,1,n(o)):w(r,2,o)}catch(e){w(r,2,e)}},r},e}();function E(e){return e instanceof D&&1&e.s}function x(e,t,n){var r,o,i=-1;return function s(u){try{for(;++i<e.length&&(!n||!n());)if((u=t(i))&&u.then){if(!E(u))return void u.then(s,o||(o=w.bind(null,r=new D,2)));u=u.v}r?w(r,1,u):r=u}catch(e){w(r||(r=new D),2,e)}}(),r}function k(e,t,n){for(var r;;){var o=e();if(E(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!E(i)){r=1;break}i=i.s}if(t){var s=t();if(s&&s.then&&!E(s)){r=2;break}}}var u=new D,l=w.bind(null,u,2);return(0===r?o.then(a):1===r?i.then(c):s.then(f)).then(void 0,l),u;function c(r){i=r;do{if(t&&(s=t())&&s.then&&!E(s))return void s.then(f).then(void 0,l);if(!(o=e())||E(o)&&!o.v)return void w(u,1,i);if(o.then)return void o.then(a).then(void 0,l);E(i=n())&&(i=i.v)}while(!i||!i.then);i.then(c).then(void 0,l)}function a(e){e?(i=n())&&i.then?i.then(c).then(void 0,l):c(i):w(u,1,i)}function f(){(o=e())?o.then?o.then(a).then(void 0,l):a(o):w(u,1,i)}}function C(c,N={}){const T=this,w=function(e,t){try{return Promise.resolve(function(e,t,n){try{return Promise.resolve(new Promise(r=>{n.push(setTimeout(function(){try{return Promise.resolve(e()).then(function(){r()})}catch(e){return Promise.reject(e)}},t))}))}catch(e){return Promise.reject(e)}}(e,t,J))}catch(e){return Promise.reject(e)}},D=()=>b(F),E=e=>function(e){let{speed:t,deleteSpeed:n,lifeLike:r}=e;return n=null!==n?n:t/3,r?[g(t,P(t)),g(n,P(n))]:[t,n]}(Z)[e],C=(e,t=0)=>e?E(t):0,H=(e,t)=>(_.add(e),((e={})=>{let t=e.delay;t&&_.add([[O,t]])})(t),this),z=()=>(e=>b(e)?n(e.value):o(e,d(".ti-cursor",e),!0))(F),R=(e={})=>[[U,e],[U,Z]],A=e=>{let t=Z.nextStringDelay;_.add([[O,t[0]],...e,[O,t[1]]])},B=e=>{ee&&(te.classList.toggle("disabled",e),te.classList.toggle("with-delay",!e))},I=function(){try{let e;X.started=!0;let t,n=_.getItems();const r=function(r,o){try{var i=function(){function r(e){return X.completed=!0,Promise.resolve(Z.afterComplete(...t)).then(function(){if(!Z.loop)throw"";let e=Z.loopDelay;w(function(){try{return Promise.resolve(function(e){try{function t(t){return _.reset(),_.set(0,[O,e,{}]),Promise.resolve(Y({num:null})).then(function(){})}return Promise.resolve(K?Promise.resolve(V({value:K})).then(t):t())}catch(e){return Promise.reject(e)}}(e[0])).then(function(){I()})}catch(e){return Promise.reject(e)}},e[1])})}const o=x(n,function(e){if(X.frozen||X.destroyed)throw"";let r=n[e],o=r[2];return t=[r,T],o.freezeCursor&&B(!0),Promise.resolve(Z.beforeStep(...t)).then(function(){return Promise.resolve(r[0].call(T,r[1],o)).then(function(){return Promise.resolve(Z.afterStep(...t)).then(function(){_.setMeta(e,{executed:!0}),B(!1)})})})},function(){return e});return o&&o.then?o.then(r):r()}()}catch(e){return}return i&&i.then?i.then(void 0,function(){}):i}();return Promise.resolve(r&&r.then?r.then(function(t){return e?t:T}):e?r:T)}catch(e){return Promise.reject(e)}},O=(e=0)=>w(()=>{},e),V=function({value:e,to:t="START",instant:n=!1}){try{let r=(({el:e,move:t,cursorPos:n,to:r})=>h(t)?-1*t:p(t,e,r)-n)({el:F,move:e,cursorPos:K,to:t}),o=()=>{K+=r<0?-1:1,((e,t,n,r)=>{let o=t[Math.min(r,t.length)-1];(e=(null==o?void 0:o.parentNode)||e).insertBefore(n,o||null)})(F,z(),te,K)};return Promise.resolve(w(function(){try{let e=0;const t=k(function(){return e<Math.abs(r)},function(){return e++},function(){return n?void o():Promise.resolve(w(o,E(0))).then(function(e){})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},C(n))).then(function(){})}catch(e){return Promise.reject(e)}},q=({chars:e,instant:t,silent:n})=>w(function(){try{function r(r){function i(){return n?void 0:Promise.resolve(Z.afterString(e)).then(function(e){})}const s=x(e,function(n){return t?void o(e[n]):Promise.resolve(w(()=>{o(e[n])},E(0))).then(function(e){})});return s&&s.then?s.then(i):i()}const o=e=>M(F,e,te,K);return Promise.resolve(n?r():Promise.resolve(Z.beforeString(e)).then(r))}catch(e){return Promise.reject(e)}},C(t)),U=function(e){try{return Z=t(Z,e),Promise.resolve()}catch(e){return Promise.reject(e)}},Q=function(){try{return D()?(F.value="",Promise.resolve()):(z().forEach(e=>{L(e)}),Promise.resolve())}catch(e){return Promise.reject(e)}},Y=function({num:e=null,instant:t=!1,to:n="START"}){try{const r=e=>h(e)?e:p(e,F,n);return Promise.resolve(w(function(){try{let n=r(e);const o=()=>{let e=z();var t;e.length&&(D()?F.value=F.value.slice(0,-1):(L(e[K]),t=te,d("*",F,!0).forEach(e=>{if(!e.innerHTML&&"BR"!==e.tagName&&!e.isSameNode(t)){let t=e;for(;1===t.parentElement.childNodes.length;)t=t.parentElement;L(t)}})))};let i=0;const s=k(function(){return i<n},function(){return i++},function(){return t?void o():Promise.resolve(w(o,E(1))).then(function(e){})});return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},C(t,1))).then(function(){const t=function(){if(null===e&&z().length-1>0)return Promise.resolve(Y({num:null})).then(function(){})}();if(t&&t.then)return t.then(function(){})})}catch(e){return Promise.reject(e)}};this.break=function(e){const t=i(l("BR"));return H([[q,{chars:[t],silent:!0}]],e)},this.delete=function(e=null,t={}){e=S(e);let n=R(t),r=e,{instant:o,to:i}=t;return H([n[0],[Y,{num:r,instant:o,to:i},W],n[1]],t)},this.empty=function(e={}){return H([[Q]],e)},this.exec=function(e,t){let n=R(t);return H([n[0],[e,null],n[1]],t)},this.move=function(e,t={}){e=S(e);let n=R(t),{instant:r,to:o}=t;return H([n[0],[V,{value:null===e?"":e,to:o,instant:r},W],n[1]],t)},this.options=function(e){return e=S(e),H([[U,e]],e)},this.pause=function(e,t={}){return H([[O,S(e)]],t)},this.type=function(e,t={}){e=S(e);let n=R(t),r=u(e,Z.html),{instant:o}=t;return H([n[0],[q,{chars:r,instant:o},W],n[1]],t)},this.is=function(e){return X[e]},this.destroy=function(e=!0){J.forEach(e=>clearTimeout(e)),J=[],S(e)&&L(te),X.destroyed=!0},this.freeze=function(){X.frozen=!0},this.unfreeze=function(){X.frozen=!1,I()},this.reset=function(){!this.is("destroyed")&&this.destroy(),_.reset(),K=0;for(let e in X)X[e]=!1;return F[D()?"value":"innerHTML"]="",this},this.go=function(){return X.started?this:(function(){try{!D()&&F.appendChild(te),ee?(((e,t,n)=>{let r="[data-typeit-id='"+e+"'] .ti-cursor",o=getComputedStyle(n),i=Object.entries(j).reduce((e,[t,n])=>e+" "+t+": var(--ti-"+t+", "+(n||o[t])+");","");a("@keyframes blink-"+e+" { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } "+r+" { display: inline; letter-spacing: -1em; "+i+" animation: blink-"+e+" "+t.cursorSpeed/1e3+"s infinite; } "+r+".with-delay { animation-delay: 500ms; } "+r+".disabled { animation: none; }",e)})($,Z,F),Promise.resolve()):Promise.resolve()}catch(e){return Promise.reject(e)}}(),Z.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(F,I.bind(this)),this):(I(),this))},this.getQueue=function(){return _},this.getOptions=function(){return Z},this.getElement=function(){return F};let F="string"==typeof(G=c)?d(G):G;var G;let J=[],K=0,W={freezeCursor:!0},X=t({},m),Z=t(v,N);Z=t(Z,{html:!D()&&Z.html,nextStringDelay:y(Z.nextStringDelay),loopDelay:y(Z.loopDelay)});let $=Math.random().toString().substring(2,9),_=function(n){const r=function(t){return o=o.concat(t.map(t=>e.map((e,n)=>t[n]?t[n]:e))),this};let o=[];return r(n),{add:r,set:function(e,t){o[e]=t},reset:function(){o=o.map(e=>(e[2].executed=!1,e))},getItems:function(){return o.filter(e=>!e[2].executed)},setMeta:function(e,n){o[e][2]=t(o[e][2],n)}}}([[O,Z.startDelay]]);F.dataset.typeitId=$,a("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}");let ee=Z.cursor&&!D(),te=(()=>{if(D())return;let e=l("span");return e.className="ti-cursor",ee?(e.innerHTML=r(Z.cursorChar).innerHTML,e):(e.style.visibility="hidden",e)})();var ne;Z.strings=(e=>{let t=F.innerHTML;return t?(F.innerHTML="",Z.startDelete?(s(t).forEach(e=>{M(F,e,te,K)}),A([[Y,{num:null}]]),e):t.trim().split(/<br(?:\s*?)(?:\/)?>/).concat(e)):e})(f(ne=Z.strings)?ne:[ne]),Z.strings.length&&(()=>{let e=Z.strings.filter(e=>!!e);e.forEach((t,n)=>{let r=u(t,Z.html);if(_.add([[q,{chars:r},W]]),n+1===e.length)return;const o=Z.breakLines?[[q,{chars:[i(l("BR"))]},W]]:[[Y,{num:r.length},W]];A(o)})})()}export{C as default};
// TypeIt by Alex MacArthur - https://typeitjs.com
const e=[null,null,{}];var t=(e,t)=>Object.assign({},e,t),n=e=>Array.from(e),r=e=>(new DOMParser).parseFromString(e,"text/html").body;const o=(e,t=null,r=!1)=>{let i=n(e.childNodes).flatMap(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:o(e);var t});return t&&(i=i.filter(e=>!t.contains(e))),r?i.reverse():i},i=(e,t=null)=>({node:t,content:e});function s(e){let t=r(e);return o(t).flatMap(e=>e.nodeValue?n(e.nodeValue).map(t=>i(t,e)):i(e))}function u(e,t=!0){return t?s(e):n(e).map(e=>i(e))}var l=e=>document.createElement(e),c=e=>document.createTextNode(e),a=(e,t="")=>{let n=l("style");n.id=t,n.appendChild(c(e)),document.head.appendChild(n)},f=e=>Array.isArray(e);const h=e=>Number.isInteger(e),d=(e,t=document,n=!1)=>t["querySelector"+(n?"All":"")](e),m={started:!1,completed:!1,frozen:!1,destroyed:!1},v={breakLines:!0,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,html:!0,lifeLike:!0,loop:!1,loopDelay:750,nextStringDelay:750,speed:100,startDelay:250,startDelete:!1,strings:[],waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},p=(e,t,n="START")=>{let r=new RegExp("END","i").test(n),i=d(".ti-cursor",t),s=e?d(e,t):t,u=o(s,i,!0),l=u[0],c=u[u.length-1],a=r&&!e?0:o(t,i,!0).findIndex(e=>e.isSameNode(r?l:c));return r&&a--,a+1};var y=e=>(f(e)||(e=[e/2,e/2]),e),g=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));let P=e=>e/2;var b=e=>"value"in e;const S=e=>"function"==typeof e?e():e;var N=e=>"BODY"===e.tagName;const M=(e,t)=>{let r=n(d("*",t,!0));return[t].concat(r.reverse()).find(t=>t.cloneNode().isEqualNode(e.cloneNode()))},T=(e,t,n,r)=>{let i=t.content instanceof HTMLElement,s=t.node,u=null==s?void 0:s.parentNode,l=i?t.content:c(t.content);if(b(e))return void(e.value=""+e.value+t.content);if(!i&&u&&!N(u)){let r=M(u,e);if(r&&((e,t)=>{let n=e.nextSibling;return!n||n.isEqualNode(t)})(r,n))e=r;else{l=u.cloneNode(),l.appendChild(c(t.content));let n=u.parentNode,r=n.cloneNode();if(!N(n)){let t=M(r,e);for(;!t&&!N(n);){let o=r;o.innerHTML=l.outerHTML,l=o,n=n.parentNode,r=n.cloneNode(),t=M(r,e)}e=t||e}}}let a=o(e,n,!0)[r-1],f=a?a.parentNode:e;f.insertBefore(l,f.contains(n)?n:null)};var w=e=>e&&e.remove();const x=["font-family","font-weight","font-size","font-style","line-height","color"];function j(e,t,n){if(!e.s){if(n instanceof D){if(!n.s)return void(n.o=j.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(j.bind(null,e,t),j.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const D=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{j(r,1,e(this.v))}catch(e){j(r,2,e)}return r}return this}return this.o=function(e){try{const o=e.v;1&e.s?j(r,1,t?t(o):o):n?j(r,1,n(o)):j(r,2,o)}catch(e){j(r,2,e)}},r},e}();function E(e){return e instanceof D&&1&e.s}function L(e,t,n){var r,o,i=-1;return function s(u){try{for(;++i<e.length&&(!n||!n());)if((u=t(i))&&u.then){if(!E(u))return void u.then(s,o||(o=j.bind(null,r=new D,2)));u=u.v}r?j(r,1,u):r=u}catch(e){j(r||(r=new D),2,e)}}(),r}function k(e,t,n){for(var r;;){var o=e();if(E(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!E(i)){r=1;break}i=i.s}if(t){var s=t();if(s&&s.then&&!E(s)){r=2;break}}}var u=new D,l=j.bind(null,u,2);return(0===r?o.then(a):1===r?i.then(c):s.then(f)).then(void 0,l),u;function c(r){i=r;do{if(t&&(s=t())&&s.then&&!E(s))return void s.then(f).then(void 0,l);if(!(o=e())||E(o)&&!o.v)return void j(u,1,i);if(o.then)return void o.then(a).then(void 0,l);E(i=n())&&(i=i.v)}while(!i||!i.then);i.then(c).then(void 0,l)}function a(e){e?(i=n())&&i.then?i.then(c).then(void 0,l):c(i):j(u,1,i)}function f(){(o=e())?o.then?o.then(a).then(void 0,l):a(o):j(u,1,i)}}module.exports=function(c,N={}){const M=this,j=function(e,t){try{return Promise.resolve(function(e,t,n){try{return Promise.resolve(new Promise(r=>{n.push(setTimeout(function(){try{return Promise.resolve(e()).then(function(){r()})}catch(e){return Promise.reject(e)}},t))}))}catch(e){return Promise.reject(e)}}(e,t,J))}catch(e){return Promise.reject(e)}},D=()=>b(Y),E=e=>function(e){let{speed:t,deleteSpeed:n,lifeLike:r}=e;return n=null!==n?n:t/3,r?[g(t,P(t)),g(n,P(n))]:[t,n]}(Z)[e],C=(e,t=0)=>e?E(t):0,z=(e,t)=>(_.add(e),((e={})=>{let t=e.delay;t&&_.add([[q,t]])})(t),this),A=()=>(e=>b(e)?n(e.value):o(e,d(".ti-cursor",e),!0))(Y),H=(e={})=>[[F,e],[F,Z]],R=e=>{let t=Z.nextStringDelay;_.add([[q,t[0]],...e,[q,t[1]]])},B=e=>{ee&&(te.classList.toggle("disabled",e),te.classList.toggle("with-delay",!e))},I=function(){try{let e;X.started=!0;let t,n=_.getItems();const r=function(r,o){try{var i=function(){function r(e){return X.completed=!0,Promise.resolve(Z.afterComplete(...t)).then(function(){if(!Z.loop)throw"";let e=Z.loopDelay;j(function(){try{return Promise.resolve(function(e){try{function t(t){return _.reset(),_.set(0,[q,e,{}]),Promise.resolve(Q({num:null})).then(function(){})}return Promise.resolve(K?Promise.resolve(O({value:K})).then(t):t())}catch(e){return Promise.reject(e)}}(e[0])).then(function(){I()})}catch(e){return Promise.reject(e)}},e[1])})}const o=L(n,function(e){if(X.frozen||X.destroyed)throw"";let r=n[e],o=r[2];return t=[r,M],o.freezeCursor&&B(!0),Promise.resolve(Z.beforeStep(...t)).then(function(){return Promise.resolve(r[0].call(M,r[1],o)).then(function(){return Promise.resolve(Z.afterStep(...t)).then(function(){_.setMeta(e,{executed:!0}),B(!1)})})})},function(){return e});return o&&o.then?o.then(r):r()}()}catch(e){return}return i&&i.then?i.then(void 0,function(){}):i}();return Promise.resolve(r&&r.then?r.then(function(t){return e?t:M}):e?r:M)}catch(e){return Promise.reject(e)}},q=(e=0)=>j(()=>{},e),O=function({value:e,to:t="START",instant:n=!1}){try{let r=(({el:e,move:t,cursorPos:n,to:r})=>h(t)?-1*t:p(t,e,r)-n)({el:Y,move:e,cursorPos:K,to:t}),o=()=>{K+=r<0?-1:1,((e,t,n,r)=>{let o=t[Math.min(r,t.length)-1];(e=(null==o?void 0:o.parentNode)||e).insertBefore(n,o||null)})(Y,A(),te,K)};return Promise.resolve(j(function(){try{let e=0;const t=k(function(){return e<Math.abs(r)},function(){return e++},function(){return n?void o():Promise.resolve(j(o,E(0))).then(function(e){})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},C(n))).then(function(){})}catch(e){return Promise.reject(e)}},V=({chars:e,instant:t,silent:n})=>j(function(){try{function r(r){function i(){return n?void 0:Promise.resolve(Z.afterString(e)).then(function(e){})}const s=L(e,function(n){return t?void o(e[n]):Promise.resolve(j(()=>{o(e[n])},E(0))).then(function(e){})});return s&&s.then?s.then(i):i()}const o=e=>T(Y,e,te,K);return Promise.resolve(n?r():Promise.resolve(Z.beforeString(e)).then(r))}catch(e){return Promise.reject(e)}},C(t)),F=function(e){try{return Z=t(Z,e),Promise.resolve()}catch(e){return Promise.reject(e)}},U=function(){try{return D()?(Y.value="",Promise.resolve()):(A().forEach(e=>{w(e)}),Promise.resolve())}catch(e){return Promise.reject(e)}},Q=function({num:e=null,instant:t=!1,to:n="START"}){try{const r=e=>h(e)?e:p(e,Y,n);return Promise.resolve(j(function(){try{let n=r(e);const o=()=>{let e=A();var t;e.length&&(D()?Y.value=Y.value.slice(0,-1):(w(e[K]),t=te,d("*",Y,!0).forEach(e=>{if(!e.innerHTML&&"BR"!==e.tagName&&!e.isSameNode(t)){let t=e;for(;1===t.parentElement.childNodes.length;)t=t.parentElement;w(t)}})))};let i=0;const s=k(function(){return i<n},function(){return i++},function(){return t?void o():Promise.resolve(j(o,E(1))).then(function(e){})});return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},C(t,1))).then(function(){const t=function(){if(null===e&&A().length-1>0)return Promise.resolve(Q({num:null})).then(function(){})}();if(t&&t.then)return t.then(function(){})})}catch(e){return Promise.reject(e)}};this.break=function(e){const t=i(l("BR"));return z([[V,{chars:[t],silent:!0}]],e)},this.delete=function(e=null,t={}){e=S(e);let n=H(t),r=e,{instant:o,to:i}=t;return z([n[0],[Q,{num:r,instant:o,to:i},W],n[1]],t)},this.empty=function(e={}){return z([[U]],e)},this.exec=function(e,t){let n=H(t);return z([n[0],[e,null],n[1]],t)},this.move=function(e,t={}){e=S(e);let n=H(t),{instant:r,to:o}=t;return z([n[0],[O,{value:null===e?"":e,to:o,instant:r},W],n[1]],t)},this.options=function(e){return e=S(e),z([[F,e]],e)},this.pause=function(e,t={}){return z([[q,S(e)]],t)},this.type=function(e,t={}){e=S(e);let n=H(t),r=u(e,Z.html),{instant:o}=t;return z([n[0],[V,{chars:r,instant:o},W],n[1]],t)},this.is=function(e){return X[e]},this.destroy=function(e=!0){J.forEach(e=>clearTimeout(e)),J=[],S(e)&&w(te),X.destroyed=!0},this.freeze=function(){X.frozen=!0},this.unfreeze=function(){X.frozen=!1,I()},this.reset=function(){!this.is("destroyed")&&this.destroy(),_.reset(),K=0;for(let e in X)X[e]=!1;return Y[D()?"value":"innerHTML"]="",this},this.go=function(){return X.started?this:(function(){try{function e(e){requestAnimationFrame(()=>{requestAnimationFrame(()=>{const e=te.getBoundingClientRect().width/2;te.style.margin="0 -"+(e+2)+"px 0 -"+(e-2)+"px"})})}if(!D()&&Y.appendChild(te),!ee)return Promise.resolve();((e,t,n)=>{let r="[data-typeit-id='"+e+"'] .ti-cursor",o=getComputedStyle(n),i=x.reduce((e,t)=>e+" "+t+": var(--ti-"+t+", "+o[t]+");","");a("@keyframes blink-"+e+" { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } "+r+" { display: inline; "+i+" animation: blink-"+e+" "+t.cursorSpeed/1e3+"s infinite; } "+r+".with-delay { animation-delay: 500ms; } "+r+".disabled { animation: none; }",e)})($,Z,Y);const t="loaded"===document.fonts.status;Promise.resolve(t?e():Promise.resolve(document.fonts.ready).then(e))}catch(e){return Promise.reject(e)}}(),Z.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(Y,I.bind(this)),this):(I(),this))},this.getQueue=function(){return _},this.getOptions=function(){return Z},this.getElement=function(){return Y};let Y="string"==typeof(G=c)?d(G):G;var G;let J=[],K=0,W={freezeCursor:!0},X=t({},m),Z=t(v,N);Z=t(Z,{html:!D()&&Z.html,nextStringDelay:y(Z.nextStringDelay),loopDelay:y(Z.loopDelay)});let $=Math.random().toString().substring(2,9),_=function(n){const r=function(t){return o=o.concat(t.map(t=>e.map((e,n)=>t[n]?t[n]:e))),this};let o=[];return r(n),{add:r,set:function(e,t){o[e]=t},reset:function(){o=o.map(e=>(e[2].executed=!1,e))},getItems:function(){return o.filter(e=>!e[2].executed)},setMeta:function(e,n){o[e][2]=t(o[e][2],n)}}}([[q,Z.startDelay]]);Y.dataset.typeitId=$,a("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}");let ee=Z.cursor&&!D(),te=(()=>{if(D())return;let e=l("span");return e.className="ti-cursor",ee?(e.innerHTML=r(Z.cursorChar).innerHTML,e):(e.style.visibility="hidden",e)})();var ne;Z.strings=(e=>{let t=Y.innerHTML;return t?(Y.innerHTML="",Z.startDelete?(s(t).forEach(e=>{T(Y,e,te,K)}),R([[Q,{num:null}]]),e):t.trim().split(/<br(?:\s*?)(?:\/)?>/).concat(e)):e})(f(ne=Z.strings)?ne:[ne]),Z.strings.length&&(()=>{let e=Z.strings.filter(e=>!!e);e.forEach((t,n)=>{let r=u(t,Z.html);if(_.add([[V,{chars:r},W]]),n+1===e.length)return;const o=Z.breakLines?[[V,{chars:[i(l("BR"))]},W]]:[[Q,{num:r.length},W]];R(o)})})()};
const e=[null,null,{}];var t=(e,t)=>Object.assign({},e,t),n=e=>Array.from(e),r=e=>{let t=document.implementation.createHTMLDocument();return t.body.innerHTML=e,t.body};const o=(e,t=null,r=!1)=>{let i=n(e.childNodes).flatMap(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:o(e);var t});return t&&(i=i.filter(e=>!t.contains(e))),r?i.reverse():i},i=(e,t=null)=>({node:t,content:e});function s(e){let t=r(e);return o(t).flatMap(e=>e.nodeValue?n(e.nodeValue).map(t=>i(t,e)):i(e))}function u(e,t=!0){return t?s(e):n(e).map(e=>i(e))}var l=e=>document.createElement(e),c=e=>document.createTextNode(e),a=(e,t="")=>{let n=l("style");n.id=t,n.appendChild(c(e)),document.head.appendChild(n)},f=e=>Array.isArray(e);const h=e=>Number.isInteger(e),d=(e,t=document,n=!1)=>t["querySelector"+(n?"All":"")](e),m={started:!1,completed:!1,frozen:!1,destroyed:!1},v={breakLines:!0,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,html:!0,lifeLike:!0,loop:!1,loopDelay:750,nextStringDelay:750,speed:100,startDelay:250,startDelete:!1,strings:[],waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},p=(e,t,n="START")=>{let r=new RegExp("END","i").test(n),i=d(".ti-cursor",t),s=e?d(e,t):t,u=o(s,i,!0),l=u[0],c=u[u.length-1],a=r&&!e?0:o(t,i,!0).findIndex(e=>e.isSameNode(r?l:c));return r&&a--,a+1};var y=e=>(f(e)||(e=[e/2,e/2]),e),g=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));let P=e=>e/2;var b=e=>"value"in e;const S=e=>"function"==typeof e?e():e;var N=e=>"BODY"===e.tagName;const T=(e,t)=>{let r=n(d("*",t,!0));return[t].concat(r.reverse()).find(t=>t.cloneNode().isEqualNode(e.cloneNode()))},M=(e,t,n,r)=>{let i=t.content instanceof HTMLElement,s=t.node,u=null==s?void 0:s.parentNode,l=i?t.content:c(t.content);if(b(e))return void(e.value=""+e.value+t.content);if(!i&&u&&!N(u)){let r=T(u,e);if(r&&((e,t)=>{let n=e.nextSibling;return!n||n.isEqualNode(t)})(r,n))e=r;else{l=u.cloneNode(),l.appendChild(c(t.content));let n=u.parentNode,r=n.cloneNode();if(!N(n)){let t=T(r,e);for(;!t&&!N(n);){let o=r;o.innerHTML=l.outerHTML,l=o,n=n.parentNode,r=n.cloneNode(),t=T(r,e)}e=t||e}}}let a=o(e,n,!0)[r-1],f=a?a.parentNode:e;f.insertBefore(l,f.contains(n)?n:null)};var L=e=>e&&e.remove();const j={"font-family":"","font-weight":"","font-size":"","font-style":"","line-height":"",color:"","margin-left":"-.125em","margin-right":".125em"};function w(e,t,n){if(!e.s){if(n instanceof D){if(!n.s)return void(n.o=w.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(w.bind(null,e,t),w.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const D=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{w(r,1,e(this.v))}catch(e){w(r,2,e)}return r}return this}return this.o=function(e){try{const o=e.v;1&e.s?w(r,1,t?t(o):o):n?w(r,1,n(o)):w(r,2,o)}catch(e){w(r,2,e)}},r},e}();function E(e){return e instanceof D&&1&e.s}function x(e,t,n){var r,o,i=-1;return function s(u){try{for(;++i<e.length&&(!n||!n());)if((u=t(i))&&u.then){if(!E(u))return void u.then(s,o||(o=w.bind(null,r=new D,2)));u=u.v}r?w(r,1,u):r=u}catch(e){w(r||(r=new D),2,e)}}(),r}function k(e,t,n){for(var r;;){var o=e();if(E(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!E(i)){r=1;break}i=i.s}if(t){var s=t();if(s&&s.then&&!E(s)){r=2;break}}}var u=new D,l=w.bind(null,u,2);return(0===r?o.then(a):1===r?i.then(c):s.then(f)).then(void 0,l),u;function c(r){i=r;do{if(t&&(s=t())&&s.then&&!E(s))return void s.then(f).then(void 0,l);if(!(o=e())||E(o)&&!o.v)return void w(u,1,i);if(o.then)return void o.then(a).then(void 0,l);E(i=n())&&(i=i.v)}while(!i||!i.then);i.then(c).then(void 0,l)}function a(e){e?(i=n())&&i.then?i.then(c).then(void 0,l):c(i):w(u,1,i)}function f(){(o=e())?o.then?o.then(a).then(void 0,l):a(o):w(u,1,i)}}module.exports=function(c,N={}){const T=this,w=function(e,t){try{return Promise.resolve(function(e,t,n){try{return Promise.resolve(new Promise(r=>{n.push(setTimeout(function(){try{return Promise.resolve(e()).then(function(){r()})}catch(e){return Promise.reject(e)}},t))}))}catch(e){return Promise.reject(e)}}(e,t,J))}catch(e){return Promise.reject(e)}},D=()=>b(F),E=e=>function(e){let{speed:t,deleteSpeed:n,lifeLike:r}=e;return n=null!==n?n:t/3,r?[g(t,P(t)),g(n,P(n))]:[t,n]}(Z)[e],C=(e,t=0)=>e?E(t):0,H=(e,t)=>(_.add(e),((e={})=>{let t=e.delay;t&&_.add([[O,t]])})(t),this),z=()=>(e=>b(e)?n(e.value):o(e,d(".ti-cursor",e),!0))(F),R=(e={})=>[[U,e],[U,Z]],A=e=>{let t=Z.nextStringDelay;_.add([[O,t[0]],...e,[O,t[1]]])},B=e=>{ee&&(te.classList.toggle("disabled",e),te.classList.toggle("with-delay",!e))},I=function(){try{let e;X.started=!0;let t,n=_.getItems();const r=function(r,o){try{var i=function(){function r(e){return X.completed=!0,Promise.resolve(Z.afterComplete(...t)).then(function(){if(!Z.loop)throw"";let e=Z.loopDelay;w(function(){try{return Promise.resolve(function(e){try{function t(t){return _.reset(),_.set(0,[O,e,{}]),Promise.resolve(Y({num:null})).then(function(){})}return Promise.resolve(K?Promise.resolve(V({value:K})).then(t):t())}catch(e){return Promise.reject(e)}}(e[0])).then(function(){I()})}catch(e){return Promise.reject(e)}},e[1])})}const o=x(n,function(e){if(X.frozen||X.destroyed)throw"";let r=n[e],o=r[2];return t=[r,T],o.freezeCursor&&B(!0),Promise.resolve(Z.beforeStep(...t)).then(function(){return Promise.resolve(r[0].call(T,r[1],o)).then(function(){return Promise.resolve(Z.afterStep(...t)).then(function(){_.setMeta(e,{executed:!0}),B(!1)})})})},function(){return e});return o&&o.then?o.then(r):r()}()}catch(e){return}return i&&i.then?i.then(void 0,function(){}):i}();return Promise.resolve(r&&r.then?r.then(function(t){return e?t:T}):e?r:T)}catch(e){return Promise.reject(e)}},O=(e=0)=>w(()=>{},e),V=function({value:e,to:t="START",instant:n=!1}){try{let r=(({el:e,move:t,cursorPos:n,to:r})=>h(t)?-1*t:p(t,e,r)-n)({el:F,move:e,cursorPos:K,to:t}),o=()=>{K+=r<0?-1:1,((e,t,n,r)=>{let o=t[Math.min(r,t.length)-1];(e=(null==o?void 0:o.parentNode)||e).insertBefore(n,o||null)})(F,z(),te,K)};return Promise.resolve(w(function(){try{let e=0;const t=k(function(){return e<Math.abs(r)},function(){return e++},function(){return n?void o():Promise.resolve(w(o,E(0))).then(function(e){})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},C(n))).then(function(){})}catch(e){return Promise.reject(e)}},q=({chars:e,instant:t,silent:n})=>w(function(){try{function r(r){function i(){return n?void 0:Promise.resolve(Z.afterString(e)).then(function(e){})}const s=x(e,function(n){return t?void o(e[n]):Promise.resolve(w(()=>{o(e[n])},E(0))).then(function(e){})});return s&&s.then?s.then(i):i()}const o=e=>M(F,e,te,K);return Promise.resolve(n?r():Promise.resolve(Z.beforeString(e)).then(r))}catch(e){return Promise.reject(e)}},C(t)),U=function(e){try{return Z=t(Z,e),Promise.resolve()}catch(e){return Promise.reject(e)}},Q=function(){try{return D()?(F.value="",Promise.resolve()):(z().forEach(e=>{L(e)}),Promise.resolve())}catch(e){return Promise.reject(e)}},Y=function({num:e=null,instant:t=!1,to:n="START"}){try{const r=e=>h(e)?e:p(e,F,n);return Promise.resolve(w(function(){try{let n=r(e);const o=()=>{let e=z();var t;e.length&&(D()?F.value=F.value.slice(0,-1):(L(e[K]),t=te,d("*",F,!0).forEach(e=>{if(!e.innerHTML&&"BR"!==e.tagName&&!e.isSameNode(t)){let t=e;for(;1===t.parentElement.childNodes.length;)t=t.parentElement;L(t)}})))};let i=0;const s=k(function(){return i<n},function(){return i++},function(){return t?void o():Promise.resolve(w(o,E(1))).then(function(e){})});return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},C(t,1))).then(function(){const t=function(){if(null===e&&z().length-1>0)return Promise.resolve(Y({num:null})).then(function(){})}();if(t&&t.then)return t.then(function(){})})}catch(e){return Promise.reject(e)}};this.break=function(e){const t=i(l("BR"));return H([[q,{chars:[t],silent:!0}]],e)},this.delete=function(e=null,t={}){e=S(e);let n=R(t),r=e,{instant:o,to:i}=t;return H([n[0],[Y,{num:r,instant:o,to:i},W],n[1]],t)},this.empty=function(e={}){return H([[Q]],e)},this.exec=function(e,t){let n=R(t);return H([n[0],[e,null],n[1]],t)},this.move=function(e,t={}){e=S(e);let n=R(t),{instant:r,to:o}=t;return H([n[0],[V,{value:null===e?"":e,to:o,instant:r},W],n[1]],t)},this.options=function(e){return e=S(e),H([[U,e]],e)},this.pause=function(e,t={}){return H([[O,S(e)]],t)},this.type=function(e,t={}){e=S(e);let n=R(t),r=u(e,Z.html),{instant:o}=t;return H([n[0],[q,{chars:r,instant:o},W],n[1]],t)},this.is=function(e){return X[e]},this.destroy=function(e=!0){J.forEach(e=>clearTimeout(e)),J=[],S(e)&&L(te),X.destroyed=!0},this.freeze=function(){X.frozen=!0},this.unfreeze=function(){X.frozen=!1,I()},this.reset=function(){!this.is("destroyed")&&this.destroy(),_.reset(),K=0;for(let e in X)X[e]=!1;return F[D()?"value":"innerHTML"]="",this},this.go=function(){return X.started?this:(function(){try{!D()&&F.appendChild(te),ee?(((e,t,n)=>{let r="[data-typeit-id='"+e+"'] .ti-cursor",o=getComputedStyle(n),i=Object.entries(j).reduce((e,[t,n])=>e+" "+t+": var(--ti-"+t+", "+(n||o[t])+");","");a("@keyframes blink-"+e+" { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } "+r+" { display: inline; letter-spacing: -1em; "+i+" animation: blink-"+e+" "+t.cursorSpeed/1e3+"s infinite; } "+r+".with-delay { animation-delay: 500ms; } "+r+".disabled { animation: none; }",e)})($,Z,F),Promise.resolve()):Promise.resolve()}catch(e){return Promise.reject(e)}}(),Z.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(F,I.bind(this)),this):(I(),this))},this.getQueue=function(){return _},this.getOptions=function(){return Z},this.getElement=function(){return F};let F="string"==typeof(G=c)?d(G):G;var G;let J=[],K=0,W={freezeCursor:!0},X=t({},m),Z=t(v,N);Z=t(Z,{html:!D()&&Z.html,nextStringDelay:y(Z.nextStringDelay),loopDelay:y(Z.loopDelay)});let $=Math.random().toString().substring(2,9),_=function(n){const r=function(t){return o=o.concat(t.map(t=>e.map((e,n)=>t[n]?t[n]:e))),this};let o=[];return r(n),{add:r,set:function(e,t){o[e]=t},reset:function(){o=o.map(e=>(e[2].executed=!1,e))},getItems:function(){return o.filter(e=>!e[2].executed)},setMeta:function(e,n){o[e][2]=t(o[e][2],n)}}}([[O,Z.startDelay]]);F.dataset.typeitId=$,a("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}");let ee=Z.cursor&&!D(),te=(()=>{if(D())return;let e=l("span");return e.className="ti-cursor",ee?(e.innerHTML=r(Z.cursorChar).innerHTML,e):(e.style.visibility="hidden",e)})();var ne;Z.strings=(e=>{let t=F.innerHTML;return t?(F.innerHTML="",Z.startDelete?(s(t).forEach(e=>{M(F,e,te,K)}),A([[Y,{num:null}]]),e):t.trim().split(/<br(?:\s*?)(?:\/)?>/).concat(e)):e})(f(ne=Z.strings)?ne:[ne]),Z.strings.length&&(()=>{let e=Z.strings.filter(e=>!!e);e.forEach((t,n)=>{let r=u(t,Z.html);if(_.add([[q,{chars:r},W]]),n+1===e.length)return;const o=Z.breakLines?[[q,{chars:[i(l("BR"))]},W]]:[[Y,{num:r.length},W]];A(o)})})()};
// TypeIt by Alex MacArthur - https://typeitjs.com
const e=[null,null,{}];var t=(e,t)=>Object.assign({},e,t),n=e=>Array.from(e),r=e=>(new DOMParser).parseFromString(e,"text/html").body;const i=(e,t=null,r=!1)=>{let a=n(e.childNodes).flatMap(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:i(e);var t});return t&&(a=a.filter(e=>!t.contains(e))),r?a.reverse():a},a=(e,t=null)=>({node:t,content:e});function o(e){let t=r(e);return i(t).flatMap(e=>e.nodeValue?n(e.nodeValue).map(t=>a(t,e)):a(e))}function l(e,t=!0){return t?o(e):n(e).map(e=>a(e))}var s=e=>document.createElement(e),u=e=>document.createTextNode(e),c=(e,t="")=>{let n=s("style");n.id=t,n.appendChild(u(e)),document.head.appendChild(n)},d=e=>Array.isArray(e);const f=e=>Number.isInteger(e),h=(e,t=document,n=!1)=>t["querySelector"+(n?"All":"")](e),m={started:!1,completed:!1,frozen:!1,destroyed:!1},p={breakLines:!0,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,html:!0,lifeLike:!0,loop:!1,loopDelay:750,nextStringDelay:750,speed:100,startDelay:250,startDelete:!1,strings:[],waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},y=(e,t,n="START")=>{let r=new RegExp("END","i").test(n),a=h(".ti-cursor",t),o=e?h(e,t):t,l=i(o,a,!0),s=l[0],u=l[l.length-1],c=r&&!e?0:i(t,a,!0).findIndex(e=>e.isSameNode(r?s:u));return r&&c--,c+1};var g=e=>(d(e)||(e=[e/2,e/2]),e),v=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));let w=e=>e/2;var b=e=>"value"in e;const S=e=>"function"==typeof e?e():e;var N=e=>"BODY"===e.tagName;const M=(e,t)=>{let r=n(h("*",t,!0));return[t].concat(r.reverse()).find(t=>t.cloneNode().isEqualNode(e.cloneNode()))},T=(e,t,n,r)=>{let a=t.content instanceof HTMLElement,o=t.node,l=null==o?void 0:o.parentNode,s=a?t.content:u(t.content);if(b(e))return void(e.value=`${e.value}${t.content}`);if(!a&&l&&!N(l)){let r=M(l,e);if(r&&((e,t)=>{let n=e.nextSibling;return!n||n.isEqualNode(t)})(r,n))e=r;else{s=l.cloneNode(),s.appendChild(u(t.content));let n=l.parentNode,r=n.cloneNode();if(!N(n)){let t=M(r,e);for(;!t&&!N(n);){let i=r;i.innerHTML=s.outerHTML,s=i,n=n.parentNode,r=n.cloneNode(),t=M(r,e)}e=t||e}}}let c=i(e,n,!0)[r-1],d=c?c.parentNode:e;d.insertBefore(s,d.contains(n)?n:null)};var x=e=>e&&e.remove();const $=["font-family","font-weight","font-size","font-style","line-height","color"];function D(u,N={}){const M=async(e,t)=>await(async(e,t,n)=>new Promise(r=>{n.push(setTimeout(async()=>{await e(),r()},t))}))(e,t,j),D=()=>b(F),E=e=>function(e){let{speed:t,deleteSpeed:n,lifeLike:r}=e;return n=null!==n?n:t/3,r?[v(t,w(t)),v(n,w(n))]:[t,n]}(J)[e],L=(e,t=0)=>e?E(t):0,C=(e,t)=>(W.add(e),((e={})=>{let t=e.delay;t&&W.add([[B,t]])})(t),this),k=()=>(e=>b(e)?n(e.value):i(e,h(".ti-cursor",e),!0))(F),z=(e={})=>[[O,e],[O,J]],A=e=>{let t=J.nextStringDelay;W.add([[B,t[0]],...e,[B,t[1]]])},H=e=>{X&&(Z.classList.toggle("disabled",e),Z.classList.toggle("with-delay",!e))},R=async()=>{G.started=!0;let e,t=W.getItems();try{for(let n=0;n<t.length;n++){if(G.frozen||G.destroyed)throw"";let r=t[n],i=r[2];e=[r,this],i.freezeCursor&&H(!0),await J.beforeStep(...e),await r[0].call(this,r[1],i),await J.afterStep(...e),W.setMeta(n,{executed:!0}),H(!1)}if(G.completed=!0,await J.afterComplete(...e),!J.loop)throw"";let n=J.loopDelay;M(async()=>{await(async e=>{Q&&await I({value:Q}),W.reset(),W.set(0,[B,e,{}]),await V({num:null})})(n[0]),R()},n[1])}catch(e){}return this},B=(e=0)=>M(()=>{},e),I=async({value:e,to:t="START",instant:n=!1})=>{let r=(({el:e,move:t,cursorPos:n,to:r})=>f(t)?-1*t:y(t,e,r)-n)({el:F,move:e,cursorPos:Q,to:t}),i=()=>{Q+=r<0?-1:1,((e,t,n,r)=>{let i=t[Math.min(r,t.length)-1];(e=(null==i?void 0:i.parentNode)||e).insertBefore(n,i||null)})(F,k(),Z,Q)};await M(async()=>{for(let e=0;e<Math.abs(r);e++)n?i():await M(i,E(0))},L(n))},q=({chars:e,instant:t,silent:n})=>M(async()=>{const r=e=>T(F,e,Z,Q);n||await J.beforeString(e);for(let n=0;n<e.length;n++)t?r(e[n]):await M(()=>{r(e[n])},E(0));n||await J.afterString(e)},L(t)),O=async e=>{J=t(J,e)},P=async()=>{D()?F.value="":k().forEach(e=>{x(e)})},V=async({num:e=null,instant:t=!1,to:n="START"})=>{await M(async()=>{let r=f(i=e)?i:y(i,F,n);var i;const a=()=>{let e=k();var t;e.length&&(D()?F.value=F.value.slice(0,-1):(x(e[Q]),t=Z,h("*",F,!0).forEach(e=>{if(!e.innerHTML&&"BR"!==e.tagName&&!e.isSameNode(t)){let t=e;for(;1===t.parentElement.childNodes.length;)t=t.parentElement;x(t)}})))};for(let e=0;e<r;e++)t?a():await M(a,E(1))},L(t,1)),null===e&&k().length-1>0&&await V({num:null})};this.break=function(e){const t=a(s("BR"));return C([[q,{chars:[t],silent:!0}]],e)},this.delete=function(e=null,t={}){e=S(e);let n=z(t),r=e,{instant:i,to:a}=t;return C([n[0],[V,{num:r,instant:i,to:a},Y],n[1]],t)},this.empty=function(e={}){return C([[P]],e)},this.exec=function(e,t){let n=z(t);return C([n[0],[e,null],n[1]],t)},this.move=function(e,t={}){e=S(e);let n=z(t),{instant:r,to:i}=t;return C([n[0],[I,{value:null===e?"":e,to:i,instant:r},Y],n[1]],t)},this.options=function(e){return e=S(e),C([[O,e]],e)},this.pause=function(e,t={}){return C([[B,S(e)]],t)},this.type=function(e,t={}){e=S(e);let n=z(t),r=l(e,J.html),{instant:i}=t;return C([n[0],[q,{chars:r,instant:i},Y],n[1]],t)},this.is=function(e){return G[e]},this.destroy=function(e=!0){j.forEach(e=>clearTimeout(e)),j=[],S(e)&&x(Z),G.destroyed=!0},this.freeze=function(){G.frozen=!0},this.unfreeze=function(){G.frozen=!1,R()},this.reset=function(){!this.is("destroyed")&&this.destroy(),W.reset(),Q=0;for(let e in G)G[e]=!1;return F[D()?"value":"innerHTML"]="",this},this.go=function(){return G.started?this:((async()=>{!D()&&F.appendChild(Z),X&&(((e,t,n)=>{let r=`[data-typeit-id='${e}'] .ti-cursor`,i=getComputedStyle(n),a=$.reduce((e,t)=>`${e} ${t}: var(--ti-${t}, ${i[t]});`,"");c(`@keyframes blink-${e} { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } ${r} { display: inline; ${a} animation: blink-${e} ${t.cursorSpeed/1e3}s infinite; } ${r}.with-delay { animation-delay: 500ms; } ${r}.disabled { animation: none; }`,e)})(K,J,F),"loaded"===document.fonts.status||await document.fonts.ready,requestAnimationFrame(()=>{requestAnimationFrame(()=>{const e=Z.getBoundingClientRect().width/2;Z.style.margin=`0 -${e+2}px 0 -${e-2}px`})}))})(),J.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(F,R.bind(this)),this):(R(),this))},this.getQueue=function(){return W},this.getOptions=function(){return J},this.getElement=function(){return F};let F="string"==typeof(U=u)?h(U):U;var U;let j=[],Q=0,Y={freezeCursor:!0},G=t({},m),J=t(p,N);J=t(J,{html:!D()&&J.html,nextStringDelay:g(J.nextStringDelay),loopDelay:g(J.loopDelay)});let K=Math.random().toString().substring(2,9),W=function(n){const r=function(t){return i=i.concat(t.map(t=>e.map((e,n)=>t[n]?t[n]:e))),this};let i=[];return r(n),{add:r,set:function(e,t){i[e]=t},reset:function(){i=i.map(e=>(e[2].executed=!1,e))},getItems:function(){return i.filter(e=>!e[2].executed)},setMeta:function(e,n){i[e][2]=t(i[e][2],n)}}}([[B,J.startDelay]]);F.dataset.typeitId=K,c("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}");let X=J.cursor&&!D(),Z=(()=>{if(D())return;let e=s("span");return e.className="ti-cursor",X?(e.innerHTML=r(J.cursorChar).innerHTML,e):(e.style.visibility="hidden",e)})();var _;J.strings=(e=>{let t=F.innerHTML;return t?(F.innerHTML="",J.startDelete?(o(t).forEach(e=>{T(F,e,Z,Q)}),A([[V,{num:null}]]),e):t.trim().split(/<br(?:\s*?)(?:\/)?>/).concat(e)):e})(d(_=J.strings)?_:[_]),J.strings.length&&(()=>{let e=J.strings.filter(e=>!!e);e.forEach((t,n)=>{let r=l(t,J.html);if(W.add([[q,{chars:r},Y]]),n+1===e.length)return;const i=J.breakLines?[[q,{chars:[a(s("BR"))]},Y]]:[[V,{num:r.length},Y]];A(i)})})()}export{D as default};
const e=[null,null,{}];var t=(e,t)=>Object.assign({},e,t),n=e=>Array.from(e),r=e=>{let t=document.implementation.createHTMLDocument();return t.body.innerHTML=e,t.body};const i=(e,t=null,r=!1)=>{let a=n(e.childNodes).flatMap(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:i(e);var t});return t&&(a=a.filter(e=>!t.contains(e))),r?a.reverse():a},a=(e,t=null)=>({node:t,content:e});function l(e){let t=r(e);return i(t).flatMap(e=>e.nodeValue?n(e.nodeValue).map(t=>a(t,e)):a(e))}function o(e,t=!0){return t?l(e):n(e).map(e=>a(e))}var s=e=>document.createElement(e),u=e=>document.createTextNode(e),c=(e,t="")=>{let n=s("style");n.id=t,n.appendChild(u(e)),document.head.appendChild(n)},d=e=>Array.isArray(e);const f=e=>Number.isInteger(e),h=(e,t=document,n=!1)=>t["querySelector"+(n?"All":"")](e),m={started:!1,completed:!1,frozen:!1,destroyed:!1},p={breakLines:!0,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,html:!0,lifeLike:!0,loop:!1,loopDelay:750,nextStringDelay:750,speed:100,startDelay:250,startDelete:!1,strings:[],waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},y=(e,t,n="START")=>{let r=new RegExp("END","i").test(n),a=h(".ti-cursor",t),l=e?h(e,t):t,o=i(l,a,!0),s=o[0],u=o[o.length-1],c=r&&!e?0:i(t,a,!0).findIndex(e=>e.isSameNode(r?s:u));return r&&c--,c+1};var g=e=>(d(e)||(e=[e/2,e/2]),e),v=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));let b=e=>e/2;var w=e=>"value"in e;const S=e=>"function"==typeof e?e():e;var N=e=>"BODY"===e.tagName;const T=(e,t)=>{let r=n(h("*",t,!0));return[t].concat(r.reverse()).find(t=>t.cloneNode().isEqualNode(e.cloneNode()))},M=(e,t,n,r)=>{let a=t.content instanceof HTMLElement,l=t.node,o=null==l?void 0:l.parentNode,s=a?t.content:u(t.content);if(w(e))return void(e.value=`${e.value}${t.content}`);if(!a&&o&&!N(o)){let r=T(o,e);if(r&&((e,t)=>{let n=e.nextSibling;return!n||n.isEqualNode(t)})(r,n))e=r;else{s=o.cloneNode(),s.appendChild(u(t.content));let n=o.parentNode,r=n.cloneNode();if(!N(n)){let t=T(r,e);for(;!t&&!N(n);){let i=r;i.innerHTML=s.outerHTML,s=i,n=n.parentNode,r=n.cloneNode(),t=T(r,e)}e=t||e}}}let c=i(e,n,!0)[r-1],d=c?c.parentNode:e;d.insertBefore(s,d.contains(n)?n:null)};var L=e=>e&&e.remove();const D={"font-family":"","font-weight":"","font-size":"","font-style":"","line-height":"",color:"","margin-left":"-.125em","margin-right":".125em"};function E(u,N={}){const T=async(e,t)=>await(async(e,t,n)=>new Promise(r=>{n.push(setTimeout(async()=>{await e(),r()},t))}))(e,t,Q),E=()=>w(j),$=e=>function(e){let{speed:t,deleteSpeed:n,lifeLike:r}=e;return n=null!==n?n:t/3,r?[v(t,b(t)),v(n,b(n))]:[t,n]}(J)[e],x=(e,t=0)=>e?$(t):0,C=(e,t)=>(W.add(e),((e={})=>{let t=e.delay;t&&W.add([[B,t]])})(t),this),H=()=>(e=>w(e)?n(e.value):i(e,h(".ti-cursor",e),!0))(j),k=(e={})=>[[V,e],[V,J]],z=e=>{let t=J.nextStringDelay;W.add([[B,t[0]],...e,[B,t[1]]])},R=e=>{X&&(Z.classList.toggle("disabled",e),Z.classList.toggle("with-delay",!e))},A=async()=>{G.started=!0;let e,t=W.getItems();try{for(let n=0;n<t.length;n++){if(G.frozen||G.destroyed)throw"";let r=t[n],i=r[2];e=[r,this],i.freezeCursor&&R(!0),await J.beforeStep(...e),await r[0].call(this,r[1],i),await J.afterStep(...e),W.setMeta(n,{executed:!0}),R(!1)}if(G.completed=!0,await J.afterComplete(...e),!J.loop)throw"";let n=J.loopDelay;T(async()=>{await(async e=>{Y&&await I({value:Y}),W.reset(),W.set(0,[B,e,{}]),await P({num:null})})(n[0]),A()},n[1])}catch(e){}return this},B=(e=0)=>T(()=>{},e),I=async({value:e,to:t="START",instant:n=!1})=>{let r=(({el:e,move:t,cursorPos:n,to:r})=>f(t)?-1*t:y(t,e,r)-n)({el:j,move:e,cursorPos:Y,to:t}),i=()=>{Y+=r<0?-1:1,((e,t,n,r)=>{let i=t[Math.min(r,t.length)-1];(e=(null==i?void 0:i.parentNode)||e).insertBefore(n,i||null)})(j,H(),Z,Y)};await T(async()=>{for(let e=0;e<Math.abs(r);e++)n?i():await T(i,$(0))},x(n))},O=({chars:e,instant:t,silent:n})=>T(async()=>{const r=e=>M(j,e,Z,Y);n||await J.beforeString(e);for(let n=0;n<e.length;n++)t?r(e[n]):await T(()=>{r(e[n])},$(0));n||await J.afterString(e)},x(t)),V=async e=>{J=t(J,e)},q=async()=>{E()?j.value="":H().forEach(e=>{L(e)})},P=async({num:e=null,instant:t=!1,to:n="START"})=>{await T(async()=>{let r=f(i=e)?i:y(i,j,n);var i;const a=()=>{let e=H();var t;e.length&&(E()?j.value=j.value.slice(0,-1):(L(e[Y]),t=Z,h("*",j,!0).forEach(e=>{if(!e.innerHTML&&"BR"!==e.tagName&&!e.isSameNode(t)){let t=e;for(;1===t.parentElement.childNodes.length;)t=t.parentElement;L(t)}})))};for(let e=0;e<r;e++)t?a():await T(a,$(1))},x(t,1)),null===e&&H().length-1>0&&await P({num:null})};this.break=function(e){const t=a(s("BR"));return C([[O,{chars:[t],silent:!0}]],e)},this.delete=function(e=null,t={}){e=S(e);let n=k(t),r=e,{instant:i,to:a}=t;return C([n[0],[P,{num:r,instant:i,to:a},F],n[1]],t)},this.empty=function(e={}){return C([[q]],e)},this.exec=function(e,t){let n=k(t);return C([n[0],[e,null],n[1]],t)},this.move=function(e,t={}){e=S(e);let n=k(t),{instant:r,to:i}=t;return C([n[0],[I,{value:null===e?"":e,to:i,instant:r},F],n[1]],t)},this.options=function(e){return e=S(e),C([[V,e]],e)},this.pause=function(e,t={}){return C([[B,S(e)]],t)},this.type=function(e,t={}){e=S(e);let n=k(t),r=o(e,J.html),{instant:i}=t;return C([n[0],[O,{chars:r,instant:i},F],n[1]],t)},this.is=function(e){return G[e]},this.destroy=function(e=!0){Q.forEach(e=>clearTimeout(e)),Q=[],S(e)&&L(Z),G.destroyed=!0},this.freeze=function(){G.frozen=!0},this.unfreeze=function(){G.frozen=!1,A()},this.reset=function(){!this.is("destroyed")&&this.destroy(),W.reset(),Y=0;for(let e in G)G[e]=!1;return j[E()?"value":"innerHTML"]="",this},this.go=function(){return G.started?this:((async()=>{!E()&&j.appendChild(Z),X&&((e,t,n)=>{let r=`[data-typeit-id='${e}'] .ti-cursor`,i=getComputedStyle(n),a=Object.entries(D).reduce((e,[t,n])=>`${e} ${t}: var(--ti-${t}, ${n||i[t]});`,"");c(`@keyframes blink-${e} { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } ${r} { display: inline; letter-spacing: -1em; ${a} animation: blink-${e} ${t.cursorSpeed/1e3}s infinite; } ${r}.with-delay { animation-delay: 500ms; } ${r}.disabled { animation: none; }`,e)})(K,J,j)})(),J.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(j,A.bind(this)),this):(A(),this))},this.getQueue=function(){return W},this.getOptions=function(){return J},this.getElement=function(){return j};let j="string"==typeof(U=u)?h(U):U;var U;let Q=[],Y=0,F={freezeCursor:!0},G=t({},m),J=t(p,N);J=t(J,{html:!E()&&J.html,nextStringDelay:g(J.nextStringDelay),loopDelay:g(J.loopDelay)});let K=Math.random().toString().substring(2,9),W=function(n){const r=function(t){return i=i.concat(t.map(t=>e.map((e,n)=>t[n]?t[n]:e))),this};let i=[];return r(n),{add:r,set:function(e,t){i[e]=t},reset:function(){i=i.map(e=>(e[2].executed=!1,e))},getItems:function(){return i.filter(e=>!e[2].executed)},setMeta:function(e,n){i[e][2]=t(i[e][2],n)}}}([[B,J.startDelay]]);j.dataset.typeitId=K,c("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}");let X=J.cursor&&!E(),Z=(()=>{if(E())return;let e=s("span");return e.className="ti-cursor",X?(e.innerHTML=r(J.cursorChar).innerHTML,e):(e.style.visibility="hidden",e)})();var _;J.strings=(e=>{let t=j.innerHTML;return t?(j.innerHTML="",J.startDelete?(l(t).forEach(e=>{M(j,e,Z,Y)}),z([[P,{num:null}]]),e):t.trim().split(/<br(?:\s*?)(?:\/)?>/).concat(e)):e})(d(_=J.strings)?_:[_]),J.strings.length&&(()=>{let e=J.strings.filter(e=>!!e);e.forEach((t,n)=>{let r=o(t,J.html);if(W.add([[O,{chars:r},F]]),n+1===e.length)return;const i=J.breakLines?[[O,{chars:[a(s("BR"))]},F]]:[[P,{num:r.length},F]];z(i)})})()}export{E as default};
// TypeIt by Alex MacArthur - https://typeitjs.com
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e||self).TypeIt=t()}(this,function(){const e=[null,null,{}];var t=(e,t)=>Object.assign({},e,t),n=e=>Array.from(e),r=e=>(new DOMParser).parseFromString(e,"text/html").body;const o=(e,t=null,r=!1)=>{let i=n(e.childNodes).flatMap(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:o(e);var t});return t&&(i=i.filter(e=>!t.contains(e))),r?i.reverse():i},i=(e,t=null)=>({node:t,content:e});function s(e){let t=r(e);return o(t).flatMap(e=>e.nodeValue?n(e.nodeValue).map(t=>i(t,e)):i(e))}function u(e,t=!0){return t?s(e):n(e).map(e=>i(e))}var l=e=>document.createElement(e),c=e=>document.createTextNode(e),a=(e,t="")=>{let n=l("style");n.id=t,n.appendChild(c(e)),document.head.appendChild(n)},f=e=>Array.isArray(e);const h=e=>Number.isInteger(e),d=(e,t=document,n=!1)=>t["querySelector"+(n?"All":"")](e),m="ti-cursor",v="START",p={started:!1,completed:!1,frozen:!1,destroyed:!1},y={breakLines:!0,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,html:!0,lifeLike:!0,loop:!1,loopDelay:750,nextStringDelay:750,speed:100,startDelay:250,startDelete:!1,strings:[],waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},g=(e,t,n=v)=>{let r=new RegExp("END","i").test(n),i=d(".ti-cursor",t),s=e?d(e,t):t,u=o(s,i,!0),l=u[0],c=u[u.length-1],a=r&&!e?0:o(t,i,!0).findIndex(e=>e.isSameNode(r?l:c));return r&&a--,a+1};var P=e=>(f(e)||(e=[e/2,e/2]),e),b=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));let S=e=>e/2;var N=e=>"value"in e;const M=e=>"function"==typeof e?e():e;var w=e=>"BODY"===e.tagName;const T=(e,t)=>{let r=n(d("*",t,!0));return[t].concat(r.reverse()).find(t=>t.cloneNode().isEqualNode(e.cloneNode()))},x=(e,t,n,r)=>{let i=t.content instanceof HTMLElement,s=t.node,u=null==s?void 0:s.parentNode,l=i?t.content:c(t.content);if(N(e))return void(e.value=""+e.value+t.content);if(!i&&u&&!w(u)){let r=T(u,e);if(r&&((e,t)=>{let n=e.nextSibling;return!n||n.isEqualNode(t)})(r,n))e=r;else{l=u.cloneNode(),l.appendChild(c(t.content));let n=u.parentNode,r=n.cloneNode();if(!w(n)){let t=T(r,e);for(;!t&&!w(n);){let o=r;o.innerHTML=l.outerHTML,l=o,n=n.parentNode,r=n.cloneNode(),t=T(r,e)}e=t||e}}}let a=o(e,n,!0)[r-1],f=a?a.parentNode:e;f.insertBefore(l,f.contains(n)?n:null)};var j=e=>e&&e.remove();const D=["font-family","font-weight","font-size","font-style","line-height","color"];function E(e,t,n){if(!e.s){if(n instanceof L){if(!n.s)return void(n.o=E.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(E.bind(null,e,t),E.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const L=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{E(r,1,e(this.v))}catch(e){E(r,2,e)}return r}return this}return this.o=function(e){try{const o=e.v;1&e.s?E(r,1,t?t(o):o):n?E(r,1,n(o)):E(r,2,o)}catch(e){E(r,2,e)}},r},e}();function k(e){return e instanceof L&&1&e.s}function C(e,t,n){var r,o,i=-1;return function s(u){try{for(;++i<e.length&&(!n||!n());)if((u=t(i))&&u.then){if(!k(u))return void u.then(s,o||(o=E.bind(null,r=new L,2)));u=u.v}r?E(r,1,u):r=u}catch(e){E(r||(r=new L),2,e)}}(),r}function z(e,t,n){for(var r;;){var o=e();if(k(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!k(i)){r=1;break}i=i.s}if(t){var s=t();if(s&&s.then&&!k(s)){r=2;break}}}var u=new L,l=E.bind(null,u,2);return(0===r?o.then(a):1===r?i.then(c):s.then(f)).then(void 0,l),u;function c(r){i=r;do{if(t&&(s=t())&&s.then&&!k(s))return void s.then(f).then(void 0,l);if(!(o=e())||k(o)&&!o.v)return void E(u,1,i);if(o.then)return void o.then(a).then(void 0,l);k(i=n())&&(i=i.v)}while(!i||!i.then);i.then(c).then(void 0,l)}function a(e){e?(i=n())&&i.then?i.then(c).then(void 0,l):c(i):E(u,1,i)}function f(){(o=e())?o.then?o.then(a).then(void 0,l):a(o):E(u,1,i)}}return function(c,w={}){const T=this,E=function(e,t){try{return Promise.resolve(function(e,t,n){try{return Promise.resolve(new Promise(r=>{n.push(setTimeout(function(){try{return Promise.resolve(e()).then(function(){r()})}catch(e){return Promise.reject(e)}},t))}))}catch(e){return Promise.reject(e)}}(e,t,W))}catch(e){return Promise.reject(e)}},L=()=>N(J),k=e=>function(e){let{speed:t,deleteSpeed:n,lifeLike:r}=e;return n=null!==n?n:t/3,r?[b(t,S(t)),b(n,S(n))]:[t,n]}(_)[e],H=(e,t=0)=>e?k(t):0,B=(e,t)=>(te.add(e),((e={})=>{let t=e.delay;t&&te.add([[V,t]])})(t),this),I=()=>(e=>N(e)?n(e.value):o(e,d(".ti-cursor",e),!0))(J),A=(e={})=>[[Q,e],[Q,_]],R=e=>{let t=_.nextStringDelay;te.add([[V,t[0]],...e,[V,t[1]]])},q=e=>{ne&&(re.classList.toggle("disabled",e),re.classList.toggle("with-delay",!e))},O=function(){try{let e;$.started=!0;let t,n=te.getItems();const r=function(r,o){try{var i=function(){function r(e){return $.completed=!0,Promise.resolve(_.afterComplete(...t)).then(function(){if(!_.loop)throw"";let e=_.loopDelay;E(function(){try{return Promise.resolve(function(e){try{function t(t){return te.reset(),te.set(0,[V,e,{}]),Promise.resolve(G({num:null})).then(function(){})}return Promise.resolve(X?Promise.resolve(F({value:X})).then(t):t())}catch(e){return Promise.reject(e)}}(e[0])).then(function(){O()})}catch(e){return Promise.reject(e)}},e[1])})}const o=C(n,function(e){if($.frozen||$.destroyed)throw"";let r=n[e],o=r[2];return t=[r,T],o.freezeCursor&&q(!0),Promise.resolve(_.beforeStep(...t)).then(function(){return Promise.resolve(r[0].call(T,r[1],o)).then(function(){return Promise.resolve(_.afterStep(...t)).then(function(){te.setMeta(e,{executed:!0}),q(!1)})})})},function(){return e});return o&&o.then?o.then(r):r()}()}catch(e){return}return i&&i.then?i.then(void 0,function(){}):i}();return Promise.resolve(r&&r.then?r.then(function(t){return e?t:T}):e?r:T)}catch(e){return Promise.reject(e)}},V=(e=0)=>E(()=>{},e),F=function({value:e,to:t=v,instant:n=!1}){try{let r=(({el:e,move:t,cursorPos:n,to:r})=>h(t)?-1*t:g(t,e,r)-n)({el:J,move:e,cursorPos:X,to:t}),o=()=>{X+=r<0?-1:1,((e,t,n,r)=>{let o=t[Math.min(r,t.length)-1];(e=(null==o?void 0:o.parentNode)||e).insertBefore(n,o||null)})(J,I(),re,X)};return Promise.resolve(E(function(){try{let e=0;const t=z(function(){return e<Math.abs(r)},function(){return e++},function(){return n?void o():Promise.resolve(E(o,k(0))).then(function(e){})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},H(n))).then(function(){})}catch(e){return Promise.reject(e)}},U=({chars:e,instant:t,silent:n})=>E(function(){try{function r(r){function i(){return n?void 0:Promise.resolve(_.afterString(e)).then(function(e){})}const s=C(e,function(n){return t?void o(e[n]):Promise.resolve(E(()=>{o(e[n])},k(0))).then(function(e){})});return s&&s.then?s.then(i):i()}const o=e=>x(J,e,re,X);return Promise.resolve(n?r():Promise.resolve(_.beforeString(e)).then(r))}catch(e){return Promise.reject(e)}},H(t)),Q=function(e){try{return _=t(_,e),Promise.resolve()}catch(e){return Promise.reject(e)}},Y=function(){try{return L()?(J.value="",Promise.resolve()):(I().forEach(e=>{j(e)}),Promise.resolve())}catch(e){return Promise.reject(e)}},G=function({num:e=null,instant:t=!1,to:n=v}){try{const r=e=>h(e)?e:g(e,J,n);return Promise.resolve(E(function(){try{let n=r(e);const o=()=>{let e=I();var t;e.length&&(L()?J.value=J.value.slice(0,-1):(j(e[X]),t=re,d("*",J,!0).forEach(e=>{if(!e.innerHTML&&"BR"!==e.tagName&&!e.isSameNode(t)){let t=e;for(;1===t.parentElement.childNodes.length;)t=t.parentElement;j(t)}})))};let i=0;const s=z(function(){return i<n},function(){return i++},function(){return t?void o():Promise.resolve(E(o,k(1))).then(function(e){})});return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},H(t,1))).then(function(){const t=function(){if(null===e&&I().length-1>0)return Promise.resolve(G({num:null})).then(function(){})}();if(t&&t.then)return t.then(function(){})})}catch(e){return Promise.reject(e)}};this.break=function(e){const t=i(l("BR"));return B([[U,{chars:[t],silent:!0}]],e)},this.delete=function(e=null,t={}){e=M(e);let n=A(t),r=e,{instant:o,to:i}=t;return B([n[0],[G,{num:r,instant:o,to:i},Z],n[1]],t)},this.empty=function(e={}){return B([[Y]],e)},this.exec=function(e,t){let n=A(t);return B([n[0],[e,null],n[1]],t)},this.move=function(e,t={}){e=M(e);let n=A(t),{instant:r,to:o}=t;return B([n[0],[F,{value:null===e?"":e,to:o,instant:r},Z],n[1]],t)},this.options=function(e){return e=M(e),B([[Q,e]],e)},this.pause=function(e,t={}){return B([[V,M(e)]],t)},this.type=function(e,t={}){e=M(e);let n=A(t),r=u(e,_.html),{instant:o}=t;return B([n[0],[U,{chars:r,instant:o},Z],n[1]],t)},this.is=function(e){return $[e]},this.destroy=function(e=!0){W.forEach(e=>clearTimeout(e)),W=[],M(e)&&j(re),$.destroyed=!0},this.freeze=function(){$.frozen=!0},this.unfreeze=function(){$.frozen=!1,O()},this.reset=function(){!this.is("destroyed")&&this.destroy(),te.reset(),X=0;for(let e in $)$[e]=!1;return J[L()?"value":"innerHTML"]="",this},this.go=function(){return $.started?this:(function(){try{function e(e){requestAnimationFrame(()=>{requestAnimationFrame(()=>{const e=re.getBoundingClientRect().width/2;re.style.margin="0 -"+(e+2)+"px 0 -"+(e-2)+"px"})})}if(!L()&&J.appendChild(re),!ne)return Promise.resolve();((e,t,n)=>{let r="[data-typeit-id='"+e+"'] ."+m,o=getComputedStyle(n),i=D.reduce((e,t)=>e+" "+t+": var(--ti-"+t+", "+o[t]+");","");a("@keyframes blink-"+e+" { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } "+r+" { display: inline; "+i+" animation: blink-"+e+" "+t.cursorSpeed/1e3+"s infinite; } "+r+".with-delay { animation-delay: 500ms; } "+r+".disabled { animation: none; }",e)})(ee,_,J);const t="loaded"===document.fonts.status;Promise.resolve(t?e():Promise.resolve(document.fonts.ready).then(e))}catch(e){return Promise.reject(e)}}(),_.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(J,O.bind(this)),this):(O(),this))},this.getQueue=function(){return te},this.getOptions=function(){return _},this.getElement=function(){return J};let J="string"==typeof(K=c)?d(K):K;var K;let W=[],X=0,Z={freezeCursor:!0},$=t({},p),_=t(y,w);_=t(_,{html:!L()&&_.html,nextStringDelay:P(_.nextStringDelay),loopDelay:P(_.loopDelay)});let ee=Math.random().toString().substring(2,9),te=function(n){const r=function(t){return o=o.concat(t.map(t=>e.map((e,n)=>t[n]?t[n]:e))),this};let o=[];return r(n),{add:r,set:function(e,t){o[e]=t},reset:function(){o=o.map(e=>(e[2].executed=!1,e))},getItems:function(){return o.filter(e=>!e[2].executed)},setMeta:function(e,n){o[e][2]=t(o[e][2],n)}}}([[V,_.startDelay]]);J.dataset.typeitId=ee,a("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}");let ne=_.cursor&&!L(),re=(()=>{if(L())return;let e=l("span");return e.className=m,ne?(e.innerHTML=r(_.cursorChar).innerHTML,e):(e.style.visibility="hidden",e)})();var oe;_.strings=(e=>{let t=J.innerHTML;return t?(J.innerHTML="",_.startDelete?(s(t).forEach(e=>{x(J,e,re,X)}),R([[G,{num:null}]]),e):t.trim().split(/<br(?:\s*?)(?:\/)?>/).concat(e)):e})(f(oe=_.strings)?oe:[oe]),_.strings.length&&(()=>{let e=_.strings.filter(e=>!!e);e.forEach((t,n)=>{let r=u(t,_.html);if(te.add([[U,{chars:r},Z]]),n+1===e.length)return;const o=_.breakLines?[[U,{chars:[i(l("BR"))]},Z]]:[[G,{num:r.length},Z]];R(o)})})()}});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e||self).TypeIt=t()}(this,function(){const e=[null,null,{}];var t=(e,t)=>Object.assign({},e,t),n=e=>Array.from(e),r=e=>{let t=document.implementation.createHTMLDocument();return t.body.innerHTML=e,t.body};const o=(e,t=null,r=!1)=>{let i=n(e.childNodes).flatMap(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:o(e);var t});return t&&(i=i.filter(e=>!t.contains(e))),r?i.reverse():i},i=(e,t=null)=>({node:t,content:e});function s(e){let t=r(e);return o(t).flatMap(e=>e.nodeValue?n(e.nodeValue).map(t=>i(t,e)):i(e))}function u(e,t=!0){return t?s(e):n(e).map(e=>i(e))}var l=e=>document.createElement(e),c=e=>document.createTextNode(e),a=(e,t="")=>{let n=l("style");n.id=t,n.appendChild(c(e)),document.head.appendChild(n)},f=e=>Array.isArray(e);const h=e=>Number.isInteger(e),d=(e,t=document,n=!1)=>t["querySelector"+(n?"All":"")](e),m="ti-cursor",v="START",p={started:!1,completed:!1,frozen:!1,destroyed:!1},y={breakLines:!0,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,html:!0,lifeLike:!0,loop:!1,loopDelay:750,nextStringDelay:750,speed:100,startDelay:250,startDelete:!1,strings:[],waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},g=(e,t,n=v)=>{let r=new RegExp("END","i").test(n),i=d(".ti-cursor",t),s=e?d(e,t):t,u=o(s,i,!0),l=u[0],c=u[u.length-1],a=r&&!e?0:o(t,i,!0).findIndex(e=>e.isSameNode(r?l:c));return r&&a--,a+1};var P=e=>(f(e)||(e=[e/2,e/2]),e),b=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));let N=e=>e/2;var S=e=>"value"in e;const M=e=>"function"==typeof e?e():e;var T=e=>"BODY"===e.tagName;const j=(e,t)=>{let r=n(d("*",t,!0));return[t].concat(r.reverse()).find(t=>t.cloneNode().isEqualNode(e.cloneNode()))},L=(e,t,n,r)=>{let i=t.content instanceof HTMLElement,s=t.node,u=null==s?void 0:s.parentNode,l=i?t.content:c(t.content);if(S(e))return void(e.value=""+e.value+t.content);if(!i&&u&&!T(u)){let r=j(u,e);if(r&&((e,t)=>{let n=e.nextSibling;return!n||n.isEqualNode(t)})(r,n))e=r;else{l=u.cloneNode(),l.appendChild(c(t.content));let n=u.parentNode,r=n.cloneNode();if(!T(n)){let t=j(r,e);for(;!t&&!T(n);){let o=r;o.innerHTML=l.outerHTML,l=o,n=n.parentNode,r=n.cloneNode(),t=j(r,e)}e=t||e}}}let a=o(e,n,!0)[r-1],f=a?a.parentNode:e;f.insertBefore(l,f.contains(n)?n:null)};var w=e=>e&&e.remove();const D={"font-family":"","font-weight":"","font-size":"","font-style":"","line-height":"",color:"","margin-left":"-.125em","margin-right":".125em"};function E(e,t,n){if(!e.s){if(n instanceof x){if(!n.s)return void(n.o=E.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(E.bind(null,e,t),E.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const x=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{E(r,1,e(this.v))}catch(e){E(r,2,e)}return r}return this}return this.o=function(e){try{const o=e.v;1&e.s?E(r,1,t?t(o):o):n?E(r,1,n(o)):E(r,2,o)}catch(e){E(r,2,e)}},r},e}();function k(e){return e instanceof x&&1&e.s}function C(e,t,n){var r,o,i=-1;return function s(u){try{for(;++i<e.length&&(!n||!n());)if((u=t(i))&&u.then){if(!k(u))return void u.then(s,o||(o=E.bind(null,r=new x,2)));u=u.v}r?E(r,1,u):r=u}catch(e){E(r||(r=new x),2,e)}}(),r}function H(e,t,n){for(var r;;){var o=e();if(k(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!k(i)){r=1;break}i=i.s}if(t){var s=t();if(s&&s.then&&!k(s)){r=2;break}}}var u=new x,l=E.bind(null,u,2);return(0===r?o.then(a):1===r?i.then(c):s.then(f)).then(void 0,l),u;function c(r){i=r;do{if(t&&(s=t())&&s.then&&!k(s))return void s.then(f).then(void 0,l);if(!(o=e())||k(o)&&!o.v)return void E(u,1,i);if(o.then)return void o.then(a).then(void 0,l);k(i=n())&&(i=i.v)}while(!i||!i.then);i.then(c).then(void 0,l)}function a(e){e?(i=n())&&i.then?i.then(c).then(void 0,l):c(i):E(u,1,i)}function f(){(o=e())?o.then?o.then(a).then(void 0,l):a(o):E(u,1,i)}}return function(c,T={}){const j=this,E=function(e,t){try{return Promise.resolve(function(e,t,n){try{return Promise.resolve(new Promise(r=>{n.push(setTimeout(function(){try{return Promise.resolve(e()).then(function(){r()})}catch(e){return Promise.reject(e)}},t))}))}catch(e){return Promise.reject(e)}}(e,t,W))}catch(e){return Promise.reject(e)}},x=()=>S(J),k=e=>function(e){let{speed:t,deleteSpeed:n,lifeLike:r}=e;return n=null!==n?n:t/3,r?[b(t,N(t)),b(n,N(n))]:[t,n]}(_)[e],z=(e,t=0)=>e?k(t):0,I=(e,t)=>(te.add(e),((e={})=>{let t=e.delay;t&&te.add([[q,t]])})(t),this),B=()=>(e=>S(e)?n(e.value):o(e,d(".ti-cursor",e),!0))(J),R=(e={})=>[[Y,e],[Y,_]],A=e=>{let t=_.nextStringDelay;te.add([[q,t[0]],...e,[q,t[1]]])},O=e=>{ne&&(re.classList.toggle("disabled",e),re.classList.toggle("with-delay",!e))},V=function(){try{let e;$.started=!0;let t,n=te.getItems();const r=function(r,o){try{var i=function(){function r(e){return $.completed=!0,Promise.resolve(_.afterComplete(...t)).then(function(){if(!_.loop)throw"";let e=_.loopDelay;E(function(){try{return Promise.resolve(function(e){try{function t(t){return te.reset(),te.set(0,[q,e,{}]),Promise.resolve(G({num:null})).then(function(){})}return Promise.resolve(X?Promise.resolve(U({value:X})).then(t):t())}catch(e){return Promise.reject(e)}}(e[0])).then(function(){V()})}catch(e){return Promise.reject(e)}},e[1])})}const o=C(n,function(e){if($.frozen||$.destroyed)throw"";let r=n[e],o=r[2];return t=[r,j],o.freezeCursor&&O(!0),Promise.resolve(_.beforeStep(...t)).then(function(){return Promise.resolve(r[0].call(j,r[1],o)).then(function(){return Promise.resolve(_.afterStep(...t)).then(function(){te.setMeta(e,{executed:!0}),O(!1)})})})},function(){return e});return o&&o.then?o.then(r):r()}()}catch(e){return}return i&&i.then?i.then(void 0,function(){}):i}();return Promise.resolve(r&&r.then?r.then(function(t){return e?t:j}):e?r:j)}catch(e){return Promise.reject(e)}},q=(e=0)=>E(()=>{},e),U=function({value:e,to:t=v,instant:n=!1}){try{let r=(({el:e,move:t,cursorPos:n,to:r})=>h(t)?-1*t:g(t,e,r)-n)({el:J,move:e,cursorPos:X,to:t}),o=()=>{X+=r<0?-1:1,((e,t,n,r)=>{let o=t[Math.min(r,t.length)-1];(e=(null==o?void 0:o.parentNode)||e).insertBefore(n,o||null)})(J,B(),re,X)};return Promise.resolve(E(function(){try{let e=0;const t=H(function(){return e<Math.abs(r)},function(){return e++},function(){return n?void o():Promise.resolve(E(o,k(0))).then(function(e){})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},z(n))).then(function(){})}catch(e){return Promise.reject(e)}},Q=({chars:e,instant:t,silent:n})=>E(function(){try{function r(r){function i(){return n?void 0:Promise.resolve(_.afterString(e)).then(function(e){})}const s=C(e,function(n){return t?void o(e[n]):Promise.resolve(E(()=>{o(e[n])},k(0))).then(function(e){})});return s&&s.then?s.then(i):i()}const o=e=>L(J,e,re,X);return Promise.resolve(n?r():Promise.resolve(_.beforeString(e)).then(r))}catch(e){return Promise.reject(e)}},z(t)),Y=function(e){try{return _=t(_,e),Promise.resolve()}catch(e){return Promise.reject(e)}},F=function(){try{return x()?(J.value="",Promise.resolve()):(B().forEach(e=>{w(e)}),Promise.resolve())}catch(e){return Promise.reject(e)}},G=function({num:e=null,instant:t=!1,to:n=v}){try{const r=e=>h(e)?e:g(e,J,n);return Promise.resolve(E(function(){try{let n=r(e);const o=()=>{let e=B();var t;e.length&&(x()?J.value=J.value.slice(0,-1):(w(e[X]),t=re,d("*",J,!0).forEach(e=>{if(!e.innerHTML&&"BR"!==e.tagName&&!e.isSameNode(t)){let t=e;for(;1===t.parentElement.childNodes.length;)t=t.parentElement;w(t)}})))};let i=0;const s=H(function(){return i<n},function(){return i++},function(){return t?void o():Promise.resolve(E(o,k(1))).then(function(e){})});return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},z(t,1))).then(function(){const t=function(){if(null===e&&B().length-1>0)return Promise.resolve(G({num:null})).then(function(){})}();if(t&&t.then)return t.then(function(){})})}catch(e){return Promise.reject(e)}};this.break=function(e){const t=i(l("BR"));return I([[Q,{chars:[t],silent:!0}]],e)},this.delete=function(e=null,t={}){e=M(e);let n=R(t),r=e,{instant:o,to:i}=t;return I([n[0],[G,{num:r,instant:o,to:i},Z],n[1]],t)},this.empty=function(e={}){return I([[F]],e)},this.exec=function(e,t){let n=R(t);return I([n[0],[e,null],n[1]],t)},this.move=function(e,t={}){e=M(e);let n=R(t),{instant:r,to:o}=t;return I([n[0],[U,{value:null===e?"":e,to:o,instant:r},Z],n[1]],t)},this.options=function(e){return e=M(e),I([[Y,e]],e)},this.pause=function(e,t={}){return I([[q,M(e)]],t)},this.type=function(e,t={}){e=M(e);let n=R(t),r=u(e,_.html),{instant:o}=t;return I([n[0],[Q,{chars:r,instant:o},Z],n[1]],t)},this.is=function(e){return $[e]},this.destroy=function(e=!0){W.forEach(e=>clearTimeout(e)),W=[],M(e)&&w(re),$.destroyed=!0},this.freeze=function(){$.frozen=!0},this.unfreeze=function(){$.frozen=!1,V()},this.reset=function(){!this.is("destroyed")&&this.destroy(),te.reset(),X=0;for(let e in $)$[e]=!1;return J[x()?"value":"innerHTML"]="",this},this.go=function(){return $.started?this:(function(){try{!x()&&J.appendChild(re),ne?(((e,t,n)=>{let r="[data-typeit-id='"+e+"'] ."+m,o=getComputedStyle(n),i=Object.entries(D).reduce((e,[t,n])=>e+" "+t+": var(--ti-"+t+", "+(n||o[t])+");","");a("@keyframes blink-"+e+" { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } "+r+" { display: inline; letter-spacing: -1em; "+i+" animation: blink-"+e+" "+t.cursorSpeed/1e3+"s infinite; } "+r+".with-delay { animation-delay: 500ms; } "+r+".disabled { animation: none; }",e)})(ee,_,J),Promise.resolve()):Promise.resolve()}catch(e){return Promise.reject(e)}}(),_.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(J,V.bind(this)),this):(V(),this))},this.getQueue=function(){return te},this.getOptions=function(){return _},this.getElement=function(){return J};let J="string"==typeof(K=c)?d(K):K;var K;let W=[],X=0,Z={freezeCursor:!0},$=t({},p),_=t(y,T);_=t(_,{html:!x()&&_.html,nextStringDelay:P(_.nextStringDelay),loopDelay:P(_.loopDelay)});let ee=Math.random().toString().substring(2,9),te=function(n){const r=function(t){return o=o.concat(t.map(t=>e.map((e,n)=>t[n]?t[n]:e))),this};let o=[];return r(n),{add:r,set:function(e,t){o[e]=t},reset:function(){o=o.map(e=>(e[2].executed=!1,e))},getItems:function(){return o.filter(e=>!e[2].executed)},setMeta:function(e,n){o[e][2]=t(o[e][2],n)}}}([[q,_.startDelay]]);J.dataset.typeitId=ee,a("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}");let ne=_.cursor&&!x(),re=(()=>{if(x())return;let e=l("span");return e.className=m,ne?(e.innerHTML=r(_.cursorChar).innerHTML,e):(e.style.visibility="hidden",e)})();var oe;_.strings=(e=>{let t=J.innerHTML;return t?(J.innerHTML="",_.startDelete?(s(t).forEach(e=>{L(J,e,re,X)}),A([[G,{num:null}]]),e):t.trim().split(/<br(?:\s*?)(?:\/)?>/).concat(e)):e})(f(oe=_.strings)?oe:[oe]),_.strings.length&&(()=>{let e=_.strings.filter(e=>!!e);e.forEach((t,n)=>{let r=u(t,_.html);if(te.add([[Q,{chars:r},Z]]),n+1===e.length)return;const o=_.breakLines?[[Q,{chars:[i(l("BR"))]},Z]]:[[G,{num:r.length},Z]];A(o)})})()}});
{
"name": "typeit",
"version": "8.0.0-rc.1",
"version": "8.0.0-rc.2",
"description": "The most versatile animated typing utility on the planet.",

@@ -5,0 +5,0 @@ "author": "Alex MacArthur <alex@macarthur.me> (https://macarthur.me)",

@@ -6,6 +6,6 @@ /**

export default (content): HTMLElement => {
const parser = new DOMParser();
const doc = parser.parseFromString(content, "text/html");
let doc = document.implementation.createHTMLDocument();
doc.body.innerHTML = content;
return doc.body;
};

@@ -5,10 +5,12 @@ import { CURSOR_CLASS, DATA_ATTRIBUTE } from "../contants";

export const cursorFontStyles = [
"font-family",
"font-weight",
"font-size",
"font-style",
"line-height",
"color",
] as const;
export const cursorFontStyles = {
"font-family": "",
"font-weight": "",
"font-size": "",
"font-style": "",
"line-height": "",
"color": "",
"margin-left": "-.125em",
"margin-right": ".125em"
} as const;

@@ -21,9 +23,8 @@ export const setCursorStyles = (

let rootSelector = `[${DATA_ATTRIBUTE}='${id}']`;
let cursorSelector = `${rootSelector} .${CURSOR_CLASS}`;
let computedStyles = getComputedStyle(element);
let customProperties = cursorFontStyles.reduce(
(accumulator, item: typeof cursorFontStyles[number]) => {
return `${accumulator} ${item}: var(--ti-${item}, ${computedStyles[item]});`;
let customProperties = Object.entries(cursorFontStyles).reduce(
(accumulator, [item, value]) => {
return `${accumulator} ${item}: var(--ti-${item}, ${value || computedStyles[item]});`;
},

@@ -35,4 +36,3 @@ ""

appendStyleBlock(
`@keyframes blink-${id} { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } ${cursorSelector} { display: inline; ${customProperties} animation: blink-${id} ${
options.cursorSpeed / 1000
`@keyframes blink-${id} { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } ${cursorSelector} { display: inline; letter-spacing: -1em; ${customProperties} animation: blink-${id} ${options.cursorSpeed / 1000
}s infinite; } ${cursorSelector}.with-delay { animation-delay: 500ms; } ${cursorSelector}.disabled { animation: none; }`,

@@ -39,0 +39,0 @@ id

@@ -140,16 +140,2 @@ import Queue from "./Queue";

setCursorStyles(_id, _opts, _element);
(document as any).fonts.status === "loaded" ||
(await (document as any).fonts.ready);
// Guarantee that the text has been fully painted after font has loaded.
requestAnimationFrame(() => {
requestAnimationFrame(() => {
const calculatedMargin = _cursor.getBoundingClientRect().width / 2;
_cursor.style.margin = `0 -${calculatedMargin + 2}px 0 -${
calculatedMargin - 2
}px`;
});
});
};

@@ -156,0 +142,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc