/*! For license information please see index.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["factit-lib"]=e():t["factit-lib"]=e()}(this,(()=>(()=>{"use strict";var t={893:(t,e,n)=>{n.d(e,{Z:()=>i}),t=n.hmd(t);var r=r||function(t){if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var e=t.document,n=function(){return t.URL||t.webkitURL||t},r=e.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,i=t.webkitRequestFileSystem,a=t.requestFileSystem||i||t.mozRequestFileSystem,c=function(e){(t.setImmediate||t.setTimeout)((function(){throw e}),0)},s="application/octet-stream",u=0,l=function(e){var r=function(){"string"==typeof e?n().revokeObjectURL(e):e.remove()};t.chrome?r():setTimeout(r,500)},f=function(t,e,n){for(var r=(e=[].concat(e)).length;r--;){var o=t["on"+e[r]];if("function"==typeof o)try{o.call(t,n||t)}catch(t){c(t)}}},p=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t},y=function(c,y){c=p(c);var d,h,v,b,m,g=this,w=c.type,O=!1,j=function(){f(g,"writestart progress write writeend".split(" "))},S=function(){!O&&d||(d=n().createObjectURL(c)),h?h.location.href=d:null==t.open(d,"_blank")&&"undefined"!=typeof safari&&(t.location.href=d),g.readyState=g.DONE,j(),l(d)},P=function(t){return function(){if(g.readyState!==g.DONE)return t.apply(this,arguments)}},E={create:!0,exclusive:!1};if(g.readyState=g.INIT,y||(y="download"),o)return d=n().createObjectURL(c),r.href=d,r.download=y,b=r,(m=e.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,t,0,0,0,0,0,!1,!1,!1,!1,0,null),b.dispatchEvent(m),g.readyState=g.DONE,j(),void l(d);t.chrome&&w&&w!==s&&(v=c.slice||c.webkitSlice,c=v.call(c,0,c.size,s),O=!0),i&&"download"!==y&&(y+=".download"),(w===s||i)&&(h=t),a?(u+=c.size,a(t.TEMPORARY,u,P((function(t){t.root.getDirectory("saved",E,P((function(t){var e=function(){t.getFile(y,E,P((function(t){t.createWriter(P((function(e){e.onwriteend=function(e){h.location.href=t.toURL(),g.readyState=g.DONE,f(g,"writeend",e),l(t)},e.onerror=function(){var t=e.error;t.code!==t.ABORT_ERR&&S()},"writestart progress write abort".split(" ").forEach((function(t){e["on"+t]=g["on"+t]})),e.write(c),g.abort=function(){e.abort(),g.readyState=g.DONE},g.readyState=g.WRITING})),S)})),S)};t.getFile(y,{create:!1},P((function(t){t.remove(),e()})),P((function(t){t.code===t.NOT_FOUND_ERR?e():S()})))})),S)})),S)):S()},d=y.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e){return navigator.msSaveOrOpenBlob(p(t),e)}:(d.abort=function(){var t=this;t.readyState=t.DONE,f(t,"abort")},d.readyState=d.INIT=0,d.WRITING=1,d.DONE=2,d.error=d.onwritestart=d.onprogress=d.onwrite=d.onabort=d.onerror=d.onwriteend=null,function(t,e){return new y(t,e)})}alert("Veuillez Utiliser un autre navigateur, L'application Factit n'est supporte par le navigateur ie")}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||(void 0).content),o=o||void 0;t.exports?t.exports.saveAs=r:null!=o&&null!=o.amd&&o([],(function(){return r}));const i=r}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r](i,i.exports,n),i.loaded=!0,i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{n.r(r),n.d(r,{Btn:()=>We,Button:()=>Ye,Card:()=>qo,CardAction:()=>ti,CardContent:()=>li,CardImage:()=>Ni,CardTitle:()=>wi,Col:()=>ka,CollapsBody:()=>hr,CollapsElement:()=>Pr,CollapsTrigger:()=>Mr,Collapsible:()=>ir,Collection:()=>lc,CollectionItem:()=>wc,Cube:()=>Vi,DateField:()=>be,EmailField:()=>q,Field:()=>M,FieldTrigger:()=>mt,Flash:()=>qa,FlashMessage:()=>ou,Form:()=>h,FormActions:()=>ln,IconSideLink:()=>Do,Icons:()=>t,InnerPage:()=>ca,Loader:()=>Va,Logo:()=>wn,Overlay:()=>Yi,PasswordField:()=>kt,PhoneField:()=>Xt,PostCodeField:()=>At,RadioIcons:()=>tc,Row:()=>ba,SideCollapsible:()=>qr,SideLink:()=>no,SideMenu:()=>Vn,SideMenuItem:()=>$n,SideNav:()=>Ln,SidenavEl:()=>po,SidenavSearch:()=>So,Signature_Cmp:()=>Uc,StokeBtn:()=>Ne,Tabs:()=>Ra,TextArea:()=>oe,Toast:()=>Js,Waves:()=>Oe,saveAs:()=>Oc.Z});var t={};n.r(t),n.d(t,{AddIcon:()=>J,AttachementIcon:()=>nt,CancelIcon:()=>Q,CarIcon:()=>st,CheveronDown:()=>G,CheveronLeft:()=>X,CheveronRight:()=>K,CheveronUp:()=>Z,ClentIcon:()=>ct,ClientIcon:()=>it,DeleteIcon:()=>tt,EditIcon:()=>et,EyeDropperIcon:()=>ot,EyeIcon:()=>rt,MenuIcon:()=>ut,SaveIcon:()=>Y,UserIcon:()=>at});var e={};n.r(e),n.d(e,{P:()=>t});const o=require("react");var i=n.n(o);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(){return c=Object.assign?Object.assign.bind():function(t){for(var e=1;e>t/4).toString(16)}))}},{key:"render",value:function(){return i().createElement("div",{style:{color:"red"}},"Vous n'avez pas implementez la method render")}}])&&b(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(i().Component);try{S.displayName="Commun"}catch(t){}const P=S,E=require("@d3v4pp/rex");var _=n.n(E);function k(t){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k(t)}function C(t,e){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];if(t&&this.setState({focusCount:this.state.focusCount+1}),this.state.focusCount>0||t){var e=this.props,n=e.min,r=e.max,o=e.required,i=e.vtype,a=e.vtypeMsg;if(""!==this.el.value){var c=this.el.value.length;return n&&r&&(cr)?(this.setState({errmsg:n!=r?"la longueur doit être comprise entre ".concat(n," et ").concat(r," caractères."):"doit avoir une longueur de ".concat(n," caractères")}),this.el.classList.remove("valid"),this.el.classList.add("invalid"),this.invalidate(),!1):!n&&r&&c>r?(this.setState({errmsg:"doit avoir une longueur maximale de ".concat(r," caractères.")}),this.el.classList.remove("valid"),this.el.classList.add("invalid"),this.invalidate(),!1):n&&!r&&c>t/4).toString(16)}))}},{key:"getErrorView",value:function(){if(null!=this.state.errmsg&&""!==this.state.errmsg)return i().createElement("div",{className:"helper-text"},this.state.errmsg)}},{key:"render",value:function(){var t=this;return i().createElement("div",{className:"input-field"},i().createElement("label",{ref:function(e){return t.label=e},htmlFor:this.id,className:this.state.labelClassName},this.props.label+(!0===this.props.required?" *":"")),i().createElement("input",{ref:function(e){t.el=e},"data-role":this.props["data-role"],value:this.props.value||"",placeholder:this.props.placeholder,onChange:this.props.onChange||function(){},onFocus:function(e){return t.onFocus.bind(t)(e)},type:this.props.type||"text",disabled:this.props.disabled||!1,autoFocus:this.props.autoFocus||!1,"data-cy":this.props["data-cy"],onBlur:function(e){return t.onBlur.bind(t)(e)},onKeyUp:this.onKeyUp.bind(this),id:this.id,className:"validate "+this.props.className}),this.getErrorView())}}],r&&C(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(P);try{D.displayName="Field"}catch(t){}D.defaultProps={type:"text",className:"",placeholder:"",label:""};const M=D;function R(t){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(t)}function A(t,e){for(var n=0;n1&&this.isValid()}},{key:"uuidv4",value:function(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)}))}},{key:"render",value:function(){var t=this;return i().createElement("div",{className:"input-field"},i().createElement("label",{ref:function(e){return t.label=e},htmlFor:this.id,className:this.state.labelClassName},this.props.label),i().createElement("input",{ref:function(e){t.el=e},"data-cy":this.props["data-cy"],placeholder:this.props.placeholder,value:this.props.value,type:"text",onChange:this.props.onChange,onFocus:function(e){return t.onFocus.bind(t)(e)},onBlur:function(e){return t.onBlur.bind(t)(e)},onKeyUp:this.onKeyDown.bind(this),autoFocus:this.props.autoFocus||!1,id:this.id,disabled:this.props.disabled,className:"validate "+this.props.className}),this.getErrorView())}}])&&A(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(M);try{U.displayName="EmailField"}catch(t){}U.defaultProps={type:"email",enterkey:function(){},icon:"at",className:"",placeholder:"",label:""};const q=U;function H(){return H=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&void 0!==arguments[0]&&arguments[0];if(t&&this.setState({focusCount:this.state.focusCount+1}),this.state.focusCount>0||t){var e=this.props,n=e.min,r=e.max,o=e.required,i=e.vtype,a=e.vtypeMsg;if(""!==this.el.value){var c=this.el.value.length;return n&&r&&(cr)?(this.setState({errmsg:n!=r?"la longueur doit être comprise entre ".concat(n," et ").concat(r," caractères."):"doit avoir une longueur de ".concat(n," caractères")}),this.el.classList.remove("valid"),this.el.classList.add("invalid"),this.invalidate(),!1):!n&&r&&c>r?(this.setState({errmsg:"doit avoir une longueur maximale de ".concat(r," caractères.")}),this.el.classList.remove("valid"),this.el.classList.add("invalid"),this.invalidate(),!1):n&&!r&&c>t/4).toString(16)}))}},{key:"getErrorView",value:function(){if(null!=this.state.errmsg&&""!==this.state.errmsg)return i().createElement("div",{className:"helper-text"},this.state.errmsg)}},{key:"getAddBtn",value:function(){var t=this;if(this.props.trigger)return i().createElement("button",{className:"webo second white-text",onClick:function(e){t.props.onTrigger&&"function"==typeof t.props.onTrigger&&t.props.onTrigger(e)}},i().createElement(J,{style:{height:"25px",width:"25px"}})," ")}},{key:"render",value:function(){var t=this;return i().createElement("div",{className:"inputFieldTrigger "},i().createElement("label",{ref:function(e){return t.label=e},htmlFor:this.id,className:this.state.labelClassName||""},this.props.label+(this.props.required?"*":"")),i().createElement("input",{ref:function(e){t.el=e},placeholder:this.props.placeholder,className:"validate "+this.props.className,value:this.props.value||"",onChange:this.props.onChange||function(){},onFocus:function(e){return t.onFocus.bind(t)(e)},type:this.props.type||"text",disabled:this.props.disabled||!1,autoFocus:this.props.autoFocus||!1,"data-cy":this.props["data-cy"],onBlur:function(e){return t.onBlur.bind(t)(e)},onKeyPress:this.onKeyUp.bind(this),id:this.id}),this.getAddBtn())}}],r&&ft(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(P);try{bt.displayName="FieldTrigger"}catch(t){}bt.defaultProps={trigger:!0,type:"text",className:"",placeholder:"",label:""};const mt=bt;function gt(t){return gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gt(t)}function wt(t,e){for(var n=0;n0)return this.state.error.map((function(t,e){return i().createElement("div",{key:e,className:"helper-text"},t)}))}},{key:"isPasswordValid",value:function(t){var e=function(t,e,n){var r=[];return t.length<8&&r.push("Au minimum 8 caractères"),t.length>32&&r.push("Au maximum 32 caractères"),!(r.length>0)||r}(t),n=!0===e?[]:e;return t.match(/[0-9]/)||n.push("Au minimum 1 caractère numérique"),t.match(/[a-z]/)||n.push("Au minimum 1 caractère minuscule"),t.match(/[A-Z]/)||n.push("Au minimum 1 caractère majuscule"),t.match(/[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/)||n.push("Au minimum 1 caractère special"),!(n.length>0)||n}},{key:"isValid",value:function(){var t=this.isPasswordValid(this.el.value);return!0===t?(this.setState({error:null}),this.el.classList.remove("invalid"),this.el.classList.add("valid"),!0):(this.setState({error:t}),this.el.classList.remove("valid"),this.el.classList.add("invalid"),!1)}},{key:"setValue",value:function(t){this.el.current.value=t,""!=t&&this.label.classList.add("active")}},{key:"getIcon",value:function(){var t=this;return""!==this.props.icon?i().createElement("i",{ref:function(e){return t.icon=e},className:"s-icon prefix"},this.props.icon):null}},{key:"onBlur",value:function(){""!=this.props.placeholder||this.el&&""!=this.el.value?this.label.classList.contains("active")||this.label.classList.add("active"):this.label.classList.remove("active"),"function"==typeof this.props.onBlur&&this.onBlur(),this.isValid()}},{key:"onFocus",value:function(){this.label.classList.contains("active")||this.label.classList.add("active"),this.setState({focusCount:this.state.focusCount+1})}},{key:"componentDidMount",value:function(){(""!=this.props.placeholder||this.el&&""!=this.el.value)&&(this.label.classList.add("active"),this.setState({labelClassName:"active"}))}},{key:"onKeyDown",value:function(t){this.isValid(),""==t.target.value?(this.label.classList.remove("active"),this.setState({labelClassName:""})):(this.label.classList.add("active"),this.setState({labelClassName:"active"})),"Enter"==t.key&&this.props.enteraction&&this.props.enteraction(t),this.state.focusCount>1&&this.isValid()}},{key:"uuidv4",value:function(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)}))}},{key:"render",value:function(){var t=this;return i().createElement(i().Fragment,null,i().createElement("label",{ref:function(e){return t.label=e},htmlFor:this.id,className:this.state.labelClassName},this.props.label),i().createElement("input",{ref:function(e){t.el=e},autoComplete:this.props.autoComplete||"on",placeholder:this.props.placeholder,value:this.props.value,onChange:this.props.onChange,type:"password","data-cy":this.props["data-cy"],onFocus:function(e){return t.onFocus.bind(t)(e)},onBlur:function(e){return t.onBlur.bind(t)(e)},onKeyPress:this.onKeyDown.bind(this),autoFocus:this.props.autoFocus||!1,id:this.id,name:this.id,className:"validate "+this.props.className}),this.getErrorView())}}])&&wt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(M);try{_t.displayName="PasswordFIeld"}catch(t){}_t.defaultProps={type:"password",icon:"dialpad",enterkey:function(){},className:"",placeholder:"",label:""};const kt=_t;function Ct(t){return Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ct(t)}function xt(){return xt=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&void 0!==arguments[0]&&arguments[0];if(t&&this.setState({focusCount:this.state.focusCount+1}),this.state.focusCount>0||t){var e=this.props,n=e.min,r=e.max,o=e.required,i=e.vtype,a=e.vtypeMsg;if(""!==this.el.value){var c=this.el.value.length;return n&&r&&(cr)?(this.setState({errmsg:n!=r?"doit avoir une longeur comprise entre ".concat(n," et ").concat(r,"."):"doit avoir une longeur de ".concat(n," caractères")}),this.el.classList.remove("valid"),this.el.classList.add("invalid"),this.invalidate(),!1):!n&&r&&c>r?(this.setState({errmsg:"doit avoir une longeur maximal de ".concat(r,".")}),this.el.classList.remove("valid"),this.el.classList.add("invalid"),this.invalidate(),!1):n&&!r&&c>t/4).toString(16)}))}},{key:"getErrorView",value:function(){if(null!=this.state.errmsg&&""!==this.state.errmsg)return i().createElement("div",{className:"helper-text"},this.state.errmsg)}},{key:"render",value:function(){var t=this;return i().createElement("div",{className:"input-field"},i().createElement("label",{ref:function(e){return t.label=e},htmlFor:this.id,className:this.state.labelClassName},this.props.label+(!0===this.props.required?" *":"")),i().createElement($t(),{ref:function(e){t.el=e},value:this.props.value||"",onChange:this.props.onChange||function(){},disabled:this.props.disabled||!1,onFocus:function(e){return t.onFocus.bind(t)(e)},onBlur:function(e){return t.onBlur.bind(t)(e)},"data-cy":this.props["data-cy"],onKeyUp:this.onKeyUp.bind(this),id:this.id,minRows:"4",className:"textarea "+this.props.className}),this.getErrorView())}}],r&&Yt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(i().Component);try{re.displayName="Field"}catch(t){}re.defaultProps={enteraction:function(){},type:"text",className:"",placeholder:"",label:""};const oe=re,ie=require("react-datepicker");var ae=n.n(ie);require("react-datepicker/dist/react-datepicker.css");const ce=require("date-fns/locale/fr");var se=n.n(ce);function ue(t){return ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ue(t)}function le(t,e){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];if(t&&this.setState({focusCount:this.state.focusCount+1}),this.state.focusCount>0||t){var e=this.props,n=e.required,r=e.vtype,o=e.vtypeMsg;if(""===this.el.input.value)return n?(this.setState({errmsg:"Ne doit pas être vide."}),this.invalidate(),!1):(this.setState({errmsg:""}),this.el.input.classList.remove("invalid"),this.el.input.classList.add("valid"),!0);var i=Date.now(),a=this.el.input.value.split("/"),c=a[0];a[0]=a[1],a[1]=c;var s=Date.parse(a.join("/")+" 23:59");switch(this.setState({errmsg:""}),r){case"future":return i>s?(this.setState({errmsg:o||"Doit être dans le future."}),this.el.input.classList.remove("valid"),this.el.input.classList.add("invalid"),!1):(this.setState({errmsg:""}),this.el.input.classList.remove("invalid"),this.el.input.classList.add("valid"),!0);case"past":return it.length)&&(e=t.length);for(var n=0,r=new Array(e);n0){var c=i-t,s=a-e;n+=Math.sqrt(c*c+s*s)}t=i,e=a}return n}},{key:"point",value:function(t,e,n,r,o){return e*(1-t)*(1-t)*(1-t)+3*n*(1-t)*(1-t)*t+3*r*(1-t)*t*t+o*t*t*t}}],[{key:"fromPoints",value:function(e,n){var r=this.calculateControlPoints(e[0],e[1],e[2]).c2,o=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new t(e[1],r,o,e[2],n.start,n.end)}},{key:"calculateControlPoints",value:function(t,e,n){var r=t.x-e.x,o=t.y-e.y,i=e.x-n.x,a=e.y-n.y,c=(t.x+e.x)/2,s=(t.y+e.y)/2,u=(e.x+n.x)/2,l=(e.y+n.y)/2,f=Math.sqrt(r*r+o*o),p=Math.sqrt(i*i+a*a),y=p/(f+p),d=u+(c-u)*y,h=l+(s-l)*y,v=e.x-d,b=e.y-h;return{c1:new Tc(c+v,s+b),c2:new Tc(u+v,l+b)}}}]),t}(),Dc=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Cc(this,e),(n=Sc(this,e)).canvas=t,n._drawingStroke=!1,n._isEmpty=!0,n._lastPoints=[],n._data=[],n._lastVelocity=0,n._lastWidth=0,n._handleMouseDown=function(t){1===t.buttons&&n._strokeBegin(t)},n._handleMouseMove=function(t){n._strokeMoveUpdate(t)},n._handleMouseUp=function(t){1===t.buttons&&n._strokeEnd(t)},n._handleTouchStart=function(t){if(t.cancelable&&t.preventDefault(),1===t.targetTouches.length){var e=t.changedTouches[0];n._strokeBegin(e)}},n._handleTouchMove=function(t){t.cancelable&&t.preventDefault();var e=t.targetTouches[0];n._strokeMoveUpdate(e)},n._handleTouchEnd=function(t){if(t.target===n.canvas){t.cancelable&&t.preventDefault();var e=t.changedTouches[0];n._strokeEnd(e)}},n._handlePointerStart=function(t){t.preventDefault(),n._strokeBegin(t)},n._handlePointerMove=function(t){n._strokeMoveUpdate(t)},n._handlePointerEnd=function(t){n._drawingStroke&&(t.preventDefault(),n._strokeEnd(t))},n.velocityFilterWeight=r.velocityFilterWeight||.7,n.minWidth=r.minWidth||.5,n.maxWidth=r.maxWidth||2.5,n.throttle="throttle"in r?r.throttle:16,n.minDistance="minDistance"in r?r.minDistance:5,n.dotSize=r.dotSize||0,n.penColor=r.penColor||"black",n.backgroundColor=r.backgroundColor||"rgba(0,0,0,0)",n.compositeOperation=r.compositeOperation||"source-over",n._strokeMoveUpdate=n.throttle?function(t){var e,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250,i=0,a=null,c=function(){i=Date.now(),a=null,e=t.apply(n,r),a||(n=null,r=[])};return function(){var s=Date.now(),u=o-(s-i);n=this;for(var l=arguments.length,f=new Array(l),p=0;po?(a&&(clearTimeout(a),a=null),i=s,e=t.apply(n,r),a||(n=null,r=[])):a||(a=window.setTimeout(c,u)),e}}(e.prototype._strokeUpdate,n.throttle):e.prototype._strokeUpdate,n._ctx=t.getContext("2d"),n.clear(),n.on(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_c(t,e)}(e,t),Lc(e,[{key:"clear",value:function(){var t=this._ctx,e=this.canvas;t.fillStyle=this.backgroundColor,t.clearRect(0,0,e.width,e.height),t.fillRect(0,0,e.width,e.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0}},{key:"fromDataURL",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,o){var i=new Image,a=n.ratio||window.devicePixelRatio||1,c=n.width||e.canvas.width/a,s=n.height||e.canvas.height/a,u=n.xOffset||0,l=n.yOffset||0;e._reset(e._getPointGroupOptions()),i.onload=function(){e._ctx.drawImage(i,u,l,c,s),r()},i.onerror=function(t){o(t)},i.crossOrigin="anonymous",i.src=t,e._isEmpty=!1}))}},{key:"toDataURL",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",e=arguments.length>1?arguments[1]:void 0;return"image/svg+xml"===t?("object"!==kc(e)&&(e=void 0),"data:image/svg+xml;base64,".concat(btoa(this.toSVG(e)))):("number"!=typeof e&&(e=void 0),this.canvas.toDataURL(t,e))}},{key:"on",value:function(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";var t=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!t?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}},{key:"off",value:function(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerStart),this.canvas.removeEventListener("pointermove",this._handlePointerMove),this.canvas.ownerDocument.removeEventListener("pointerup",this._handlePointerEnd),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("mousemove",this._handleMouseMove),this.canvas.ownerDocument.removeEventListener("mouseup",this._handleMouseUp),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this.canvas.removeEventListener("touchmove",this._handleTouchMove),this.canvas.removeEventListener("touchend",this._handleTouchEnd)}},{key:"isEmpty",value:function(){return this._isEmpty}},{key:"fromData",value:function(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clear;(void 0===e||e)&&this.clear(),this._fromData(t,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(t)}},{key:"toData",value:function(){return this._data}},{key:"_getPointGroupOptions",value:function(t){return{penColor:t&&"penColor"in t?t.penColor:this.penColor,dotSize:t&&"dotSize"in t?t.dotSize:this.dotSize,minWidth:t&&"minWidth"in t?t.minWidth:this.minWidth,maxWidth:t&&"maxWidth"in t?t.maxWidth:this.maxWidth,velocityFilterWeight:t&&"velocityFilterWeight"in t?t.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:t&&"compositeOperation"in t?t.compositeOperation:this.compositeOperation}}},{key:"_strokeBegin",value:function(t){if(this.dispatchEvent(new CustomEvent("beginStroke",{detail:t,cancelable:!0}))){this._drawingStroke=!0;var e=this._getPointGroupOptions(),n=Object.assign(Object.assign({},e),{points:[]});this._data.push(n),this._reset(e),this._strokeUpdate(t)}}},{key:"_strokeUpdate",value:function(t){if(this._drawingStroke)if(0!==this._data.length){this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:t}));var e=t.clientX,n=t.clientY,r=void 0!==t.pressure?t.pressure:void 0!==t.force?t.force:0,o=this._createPoint(e,n,r),i=this._data[this._data.length-1],a=i.points,c=a.length>0&&a[a.length-1],s=!!c&&o.distanceTo(c)<=this.minDistance,u=this._getPointGroupOptions(i);if(!c||!c||!s){var l=this._addPoint(o,u);c?l&&this._drawCurve(l,u):this._drawDot(o,u),a.push({time:o.time,x:o.x,y:o.y,pressure:o.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:t}))}else this._strokeBegin(t)}},{key:"_strokeEnd",value:function(t){this._drawingStroke&&(this._strokeUpdate(t),this._drawingStroke=!1,this.dispatchEvent(new CustomEvent("endStroke",{detail:t})))}},{key:"_handlePointerEvents",value:function(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerStart),this.canvas.addEventListener("pointermove",this._handlePointerMove),this.canvas.ownerDocument.addEventListener("pointerup",this._handlePointerEnd)}},{key:"_handleMouseEvents",value:function(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown),this.canvas.addEventListener("mousemove",this._handleMouseMove),this.canvas.ownerDocument.addEventListener("mouseup",this._handleMouseUp)}},{key:"_handleTouchEvents",value:function(){this.canvas.addEventListener("touchstart",this._handleTouchStart),this.canvas.addEventListener("touchmove",this._handleTouchMove),this.canvas.addEventListener("touchend",this._handleTouchEnd)}},{key:"_reset",value:function(t){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(t.minWidth+t.maxWidth)/2,this._ctx.fillStyle=t.penColor,this._ctx.globalCompositeOperation=t.compositeOperation}},{key:"_createPoint",value:function(t,e,n){var r=this.canvas.getBoundingClientRect();return new Tc(t-r.left,e-r.top,n,(new Date).getTime())}},{key:"_addPoint",value:function(t,e){var n=this._lastPoints;if(n.push(t),n.length>2){3===n.length&&n.unshift(n[0]);var r=this._calculateCurveWidths(n[1],n[2],e),o=Bc.fromPoints(n,r);return n.shift(),o}return null}},{key:"_calculateCurveWidths",value:function(t,e,n){var r=n.velocityFilterWeight*e.velocityFrom(t)+(1-n.velocityFilterWeight)*this._lastVelocity,o=this._strokeWidth(r,n),i={end:o,start:this._lastWidth};return this._lastVelocity=r,this._lastWidth=o,i}},{key:"_strokeWidth",value:function(t,e){return Math.max(e.maxWidth/(t+1),e.minWidth)}},{key:"_drawCurveSegment",value:function(t,e,n){var r=this._ctx;r.moveTo(t,e),r.arc(t,e,n,0,2*Math.PI,!1),this._isEmpty=!1}},{key:"_drawCurve",value:function(t,e){var n=this._ctx,r=t.endWidth-t.startWidth,o=2*Math.ceil(t.length());n.beginPath(),n.fillStyle=e.penColor;for(var i=0;i0?e.dotSize:(e.minWidth+e.maxWidth)/2;n.beginPath(),this._drawCurveSegment(t.x,t.y,r),n.closePath(),n.fillStyle=e.penColor,n.fill()}},{key:"_fromData",value:function(t,e,n){var r,o=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return jc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}(t);try{for(o.s();!(r=o.n()).done;){var i=r.value,a=i.points,c=this._getPointGroupOptions(i);if(a.length>1)for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{}).includeBackgroundColor,e=void 0!==t&&t,n=this._data,r=Math.max(window.devicePixelRatio||1,1),o=this.canvas.width/r,i=this.canvas.height/r,a=document.createElementNS("http://www.w3.org/2000/svg","svg");if(a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),a.setAttribute("viewBox","".concat(0," ").concat(0," ").concat(o," ").concat(i)),a.setAttribute("width",o.toString()),a.setAttribute("height",i.toString()),e&&this.backgroundColor){var c=document.createElement("rect");c.setAttribute("width","100%"),c.setAttribute("height","100%"),c.setAttribute("fill",this.backgroundColor),a.appendChild(c)}return this._fromData(n,(function(t,e){var n=e.penColor,r=document.createElement("path");if(!(isNaN(t.control1.x)||isNaN(t.control1.y)||isNaN(t.control2.x)||isNaN(t.control2.y))){var o="M ".concat(t.startPoint.x.toFixed(3),",").concat(t.startPoint.y.toFixed(3)," ")+"C ".concat(t.control1.x.toFixed(3),",").concat(t.control1.y.toFixed(3)," ")+"".concat(t.control2.x.toFixed(3),",").concat(t.control2.y.toFixed(3)," ")+"".concat(t.endPoint.x.toFixed(3),",").concat(t.endPoint.y.toFixed(3));r.setAttribute("d",o),r.setAttribute("stroke-width",(2.25*t.endWidth).toFixed(3)),r.setAttribute("stroke",n),r.setAttribute("fill","none"),r.setAttribute("stroke-linecap","round"),a.appendChild(r)}}),(function(t,e){var n=e.penColor,r=e.dotSize,o=e.minWidth,i=e.maxWidth,c=document.createElement("circle"),s=r>0?r:(o+i)/2;c.setAttribute("r",s.toString()),c.setAttribute("cx",t.x.toString()),c.setAttribute("cy",t.y.toString()),c.setAttribute("fill",n),a.appendChild(c)})),a.outerHTML}}]),e}(function(){function t(){Cc(this,t);try{this._et=new EventTarget}catch(t){this._et=document}}return Lc(t,[{key:"addEventListener",value:function(t,e,n){this._et.addEventListener(t,e,n)}},{key:"dispatchEvent",value:function(t){return this._et.dispatchEvent(t)}},{key:"removeEventListener",value:function(t,e,n){this._et.removeEventListener(t,e,n)}}]),t}());function Mc(t){return Mc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mc(t)}function Rc(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1}function Yc(t,e){return t.apply(null,e)}var Qc={arr:function(t){return Array.isArray(t)},obj:function(t){return Gc(Object.prototype.toString.call(t),"Object")},pth:function(t){return Qc.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||Qc.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 Qc.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 Qc.hex(t)||Qc.rgb(t)||Qc.hsl(t)},key:function(t){return!Hc.hasOwnProperty(t)&&!Kc.hasOwnProperty(t)&&"targets"!==t&&"keyframes"!==t}};function Jc(t){var e=/\(([^)]+)\)/.exec(t);return e?e[1].split(",").map((function(t){return parseFloat(t)})):[]}function ts(t,e){var n=Jc(t),r=$c(Qc.und(n[0])?1:n[0],.1,100),o=$c(Qc.und(n[1])?100:n[1],.1,100),i=$c(Qc.und(n[2])?10:n[2],.1,100),a=$c(Qc.und(n[3])?0:n[3],.1,100),c=Math.sqrt(o/r),s=i/(2*Math.sqrt(o*r)),u=s<1?c*Math.sqrt(1-s*s):0,l=s<1?(s*c-a)/u:-a+c;function f(t){var n=e?e*t/1e3:t;return n=s<1?Math.exp(-n*s*c)*(1*Math.cos(u*n)+l*Math.sin(u*n)):(1+l*n)*Math.exp(-n*c),0===t||1===t?t:1-n}return e?f:function(){var e=Zc.springs[t];if(e)return e;for(var n=1/6,r=0,o=0;;)if(1===f(r+=n)){if(++o>=16)break}else o=0;var i=r*n*1e3;return Zc.springs[t]=i,i}}function es(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return function(e){return Math.ceil($c(e,1e-6,1)*t)*(1/t)}}var ns,rs,os=function(){var t=.1;function e(t,e){return 1-3*e+3*t}function n(t,e){return 3*e-6*t}function r(t){return 3*t}function o(t,o,i){return((e(o,i)*t+n(o,i))*t+r(o))*t}function i(t,o,i){return 3*e(o,i)*t*t+2*n(o,i)*t+r(o)}return function(e,n,r,a){if(0<=e&&e<=1&&0<=r&&r<=1){var c=new Float32Array(11);if(e!==n||r!==a)for(var s=0;s<11;++s)c[s]=o(s*t,e,r);return function(s){return e===n&&r===a||0===s||1===s?s:o(function(n){for(var a=0,s=1;10!==s&&c[s]<=n;++s)a+=t;--s;var u=a+(n-c[s])/(c[s+1]-c[s])*t,l=i(u,e,r);return l>=.001?function(t,e,n,r){for(var a=0;a<4;++a){var c=i(e,n,r);if(0===c)return e;e-=(o(e,n,r)-t)/c}return e}(n,u,e,r):0===l?u:function(t,e,n,r,i){var a,c,s=0;do{(a=o(c=e+(n-e)/2,r,i)-t)>0?n=c:e=c}while(Math.abs(a)>1e-7&&++s<10);return c}(n,a,a+t,e,r)}(s),n,a)}}}}(),is=(ns={linear:function(){return function(t){return t}}},rs={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 e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}},Elastic:function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,e=$c(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,1,10),n=$c(t,.1,2);return function(t){return 0===t||1===t?t:-e*Math.pow(2,10*(t-1))*Math.sin((t-1-n/(2*Math.PI)*Math.asin(1/e))*(2*Math.PI)/n)}}},["Quad","Cubic","Quart","Quint"].forEach((function(t,e){rs[t]=function(){return function(t){return Math.pow(t,e+2)}}})),Object.keys(rs).forEach((function(t){var e=rs[t];ns["easeIn"+t]=e,ns["easeOut"+t]=function(t,n){return function(r){return 1-e(t,n)(1-r)}},ns["easeInOut"+t]=function(t,n){return function(r){return r<.5?e(t,n)(2*r)/2:1-e(t,n)(-2*r+2)/2}},ns["easeOutIn"+t]=function(t,n){return function(r){return r<.5?(1-e(t,n)(1-2*r))/2:(e(t,n)(2*r-1)+1)/2}}})),ns);function as(t,e){if(Qc.fnc(t))return t;var n=t.split("(")[0],r=is[n],o=Jc(t);switch(n){case"spring":return ts(t,e);case"cubicBezier":return Yc(os,o);case"steps":return Yc(es,o);default:return Yc(r,o)}}function cs(t){try{return document.querySelectorAll(t)}catch(t){return}}function ss(t,e){for(var n=t.length,r=arguments.length>=2?arguments[1]:void 0,o=[],i=0;i1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(0==a)e=n=r=c;else{var l=c<.5?c*(1+a):c+a-c*a,f=2*c-l;e=u(f,l,i+1/3),n=u(f,l,i),r=u(f,l,i-1/3)}return"rgba(".concat(255*e,",").concat(255*n,",").concat(255*r,",").concat(s,")")}(t):void 0;var e,n}(t);if(/\s/g.test(t))return t;var n=hs(t),r=n?t.substr(0,t.length-n.length):t;return e?r+e:r}function Es(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function _s(t){for(var e,n=t.points,r=0,o=0;o0&&(r+=Es(e,i)),e=i}return r}function ks(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return function(t){return 2*Math.PI*bs(t,"r")}(t);case"rect":return function(t){return 2*bs(t,"width")+2*bs(t,"height")}(t);case"line":return function(t){return Es({x:bs(t,"x1"),y:bs(t,"y1")},{x:bs(t,"x2"),y:bs(t,"y2")})}(t);case"polyline":return _s(t);case"polygon":return function(t){var e=t.points;return _s(t)+Es(e.getItem(e.numberOfItems-1),e.getItem(0))}(t)}}function Cs(t,e){var n=e||{},r=n.el||function(t){for(var e=t.parentNode;Qc.svg(e)&&Qc.svg(e.parentNode);)e=e.parentNode;return e}(t),o=r.getBoundingClientRect(),i=bs(r,"viewBox"),a=o.width,c=o.height,s=n.viewBox||(i?i.split(" "):[0,0,a,c]);return{el:r,viewBox:s,x:s[0]/1,y:s[1]/1,w:a,h:c,vW:s[2],vH:s[3]}}function xs(t,e,n){function r(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=e+n>=1?e+n:0;return t.el.getPointAtLength(r)}var o=Cs(t.el,t.svg),i=r(),a=r(-1),c=r(1),s=n?1:o.w/o.vW,u=n?1:o.h/o.vH;switch(t.property){case"x":return(i.x-o.x)*s;case"y":return(i.y-o.y)*u;case"angle":return 180*Math.atan2(c.y-a.y,c.x-a.x)/Math.PI}}function Ls(t,e){var n=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=Ps(Qc.pth(t)?t.totalLength:t,e)+"";return{original:r,numbers:r.match(n)?r.match(n).map(Number):[0],strings:Qc.str(t)||e?r.split(n):[]}}function Ns(t){return ss(t?us(Qc.arr(t)?t.map(ls):ls(t)):[],(function(t,e,n){return n.indexOf(t)===e}))}function Ts(t){var e=Ns(t);return e.map((function(t,n){return{target:t,id:n,total:e.length,transforms:{list:Os(t)}}}))}function Bs(t,e){var n=ps(e);if(/^spring/.test(n.easing)&&(n.duration=ts(n.easing)),Qc.arr(t)){var r=t.length;2!==r||Qc.obj(t[0])?Qc.fnc(e.duration)||(n.duration=e.duration/r):t={value:t}}var o=Qc.arr(t)?t:[t];return o.map((function(t,n){var r=Qc.obj(t)&&!Qc.pth(t)?t:{value:t};return Qc.und(r.delay)&&(r.delay=n?0:e.delay),Qc.und(r.endDelay)&&(r.endDelay=n===o.length-1?e.endDelay:0),r})).map((function(t){return ds(t,n)}))}var Ds={css:function(t,e,n){return t.style[e]=n},attribute:function(t,e,n){return t.setAttribute(e,n)},object:function(t,e,n){return t[e]=n},transform:function(t,e,n,r,o){if(r.list.set(e,n),e===r.last||o){var i="";r.list.forEach((function(t,e){i+="".concat(e,"(").concat(t,") ")})),t.style.transform=i}}};function Ms(t,e){Ts(t).forEach((function(t){for(var n in e){var r=vs(e[n],t),o=t.target,i=hs(r),a=js(o,n,i,t),c=Ss(Ps(r,i||hs(a)),a),s=ws(o,n);Ds[s](o,n,c,t.transforms,!0)}}))}function Rs(t,e){return ss(us(t.map((function(t){return e.map((function(e){return function(t,e){var n=ws(t.target,e.name);if(n){var r=function(t,e){var n;return t.tweens.map((function(r){var o=function(t,e){var n={};for(var r in t){var o=vs(t[r],e);Qc.arr(o)&&1===(o=o.map((function(t){return vs(t,e)}))).length&&(o=o[0]),n[r]=o}return n.duration=parseFloat(n.duration),n.delay=parseFloat(n.delay),n}(r,e),i=o.value,a=Qc.arr(i)?i[1]:i,c=hs(a),s=js(e.target,t.name,c,e),u=n?n.to.original:s,l=Qc.arr(i)?i[0]:u,f=hs(l)||hs(s),p=c||f;return Qc.und(a)&&(a=u),o.from=Ls(l,p),o.to=Ls(Ss(a,l),p),o.start=n?n.end:0,o.end=o.start+o.delay+o.duration+o.endDelay,o.easing=as(o.easing,o.duration),o.isPath=Qc.pth(i),o.isPathTargetInsideSVG=o.isPath&&Qc.svg(e.target),o.isColor=Qc.col(o.from.original),o.isColor&&(o.round=1),n=o,o}))}(e,t),o=r[r.length-1];return{type:n,property:e.name,animatable:t,tweens:r,duration:o.end,delay:r[0].delay,endDelay:o.endDelay}}}(t,e)}))}))),(function(t){return!Qc.und(t)}))}function As(t,e){var n=t.length,r=function(t){return t.timelineOffset?t.timelineOffset:0},o={};return o.duration=n?Math.max.apply(Math,t.map((function(t){return r(t)+t.duration}))):e.duration,o.delay=n?Math.min.apply(Math,t.map((function(t){return r(t)+t.delay}))):e.delay,o.endDelay=n?o.duration-Math.max.apply(Math,t.map((function(t){return r(t)+t.duration-t.endDelay}))):e.endDelay,o}var Fs=0,Is=[],Vs=function(){var t;function e(n){for(var r=Is.length,o=0;o0?requestAnimationFrame(e):void 0}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){zs.suspendWhenDocumentHidden&&(Ws()?t=cancelAnimationFrame(t):(Is.forEach((function(t){return t._onDocumentVisibility()})),Vs()))})),function(){t||Ws()&&zs.suspendWhenDocumentHidden||!(Is.length>0)||(t=requestAnimationFrame(e))}}();function Ws(){return!!document&&document.hidden}function zs(){var t,e=0,n=0,r=0,o=0,i=null;function a(t){var e=window.Promise&&new Promise((function(t){return i=t}));return t.finished=e,e}var c,s,u,l,f,p,y,d,h=(s=ys(Hc,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),u=ys(Kc,c),l=function(t,e){var n=[],r=e.keyframes;for(var o in r&&(e=ds(function(t){for(var e=ss(us(t.map((function(t){return Object.keys(t)}))),(function(t){return Qc.key(t)})).reduce((function(t,e){return t.indexOf(e)<0&&t.push(e),t}),[]),n={},r=function(){var r=e[o];n[r]=t.map((function(t){var e={};for(var n in t)Qc.key(n)?n==r&&(e.value=t[n]):e[n]=t[n];return e}))},o=0;o2||(m=Math.round(m*p)/p)),y.push(m)}var O=f.length;if(O){v=f[0];for(var j=0;j0&&(h.began=!0,O("begin")),!h.loopBegan&&h.currentTime>0&&(h.loopBegan=!0,O("loopBegin")),f<=u&&0!==h.currentTime&&w(0),(f>=l&&h.currentTime!==s||!s)&&w(s),f>u&&f=s&&(n=0,h.remaining&&!0!==h.remaining&&h.remaining--,h.remaining?(e=r,O("loopComplete"),h.loopBegan=!1,"alternate"===h.direction&&v()):(h.paused=!0,h.completed||(h.completed=!0,O("loopComplete"),O("complete"),!h.passThrough&&"Promise"in window&&(i(),a(h)))))}return a(h),h.reset=function(){var e=h.direction;h.passThrough=!1,h.currentTime=0,h.progress=0,h.paused=!0,h.began=!1,h.loopBegan=!1,h.changeBegan=!1,h.completed=!1,h.changeCompleted=!1,h.reversePlayback=!1,h.reversed="reverse"===e,h.remaining=h.loop,t=h.children;for(var n=o=t.length;n--;)h.children[n].reset();(h.reversed&&!0!==h.loop||"alternate"===e&&1===h.loop)&&h.remaining++,w(h.reversed?h.duration:0)},h._onDocumentVisibility=m,h.set=function(t,e){return Ms(t,e),h},h.tick=function(t){r=t,e||(e=r),j((r+(n-e))*zs.speed)},h.seek=function(t){j(b(t))},h.pause=function(){h.paused=!0,m()},h.play=function(){h.paused&&(h.completed&&h.reset(),h.paused=!1,Is.push(h),m(),Vs())},h.reverse=function(){v(),h.completed=!h.reversed,m()},h.restart=function(){h.reset(),h.play()},h.remove=function(t){qs(Ns(t),h)},h.reset(),h.autoplay&&h.play(),h}function Us(t,e){for(var n=e.length;n--;)fs(t,e[n].animatable.target)&&e.splice(n,1)}function qs(t,e){var n=e.animations,r=e.children;Us(t,n);for(var o=r.length;o--;){var i=r[o],a=i.animations;Us(t,a),a.length||i.children.length||r.splice(o,1)}n.length||r.length||e.pause()}zs.version="3.2.2",zs.speed=1,zs.suspendWhenDocumentHidden=!0,zs.running=Is,zs.remove=function(t){for(var e=Ns(t),n=Is.length;n--;)qs(e,Is[n])},zs.get=js,zs.set=Ms,zs.convertPx=ms,zs.path=function(t,e){var n=Qc.str(t)?cs(t)[0]:t,r=e||100;return function(t){return{property:t,el:n,svg:Cs(n),totalLength:ks(n)*(r/100)}}},zs.setDashoffset=function(t){var e=ks(t);return t.setAttribute("stroke-dasharray",e),e},zs.stagger=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction||"normal",r=e.easing?as(e.easing):null,o=e.grid,i=e.axis,a=e.from||0,c="first"===a,s="center"===a,u="last"===a,l=Qc.arr(t),f=l?parseFloat(t[0]):parseFloat(t),p=l?parseFloat(t[1]):0,y=hs(l?t[1]:t)||0,d=e.start||0+(l?f:0),h=[],v=0;return function(t,e,b){if(c&&(a=0),s&&(a=(b-1)/2),u&&(a=b-1),!h.length){for(var m=0;m0&&void 0!==arguments[0]?arguments[0]:{},e=zs(t);return e.duration=0,e.add=function(n,r){var o=Is.indexOf(e),i=e.children;function a(t){t.passThrough=!0}o>-1&&Is.splice(o,1);for(var c=0;c0){var n=e.target.parentElement.querySelectorAll(".toast")[0];n.panning=!0,t._draggedToast=n,n.classList.add("panning"),n.style.transition="",n.startingXPos=t._xPos(e),n.time=Date.now(),n.xPos=t._xPos(e)}}},{key:"_onDragMove",value:function(e){if(t._draggedToast){e.preventDefault();var n=t._draggedToast;n.deltaX=Math.abs(n.xPos-t._xPos(e)),n.xPos=t._xPos(e),n.velocityX=n.deltaX/(Date.now()-n.time),n.time=Date.now();var r=n.xPos-n.startingXPos,o=.8*n.offsetWidth;n.style.transform="translateX(".concat(r,"px)"),n.style.opacity=1-Math.abs(r/o)}}},{key:"_onDragEnd",value:function(){if(t._draggedToast){var e=t._draggedToast;e.panning=!1,e.classList.remove("panning");var n=e.xPos-e.startingXPos,r=.8*e.offsetWidth;Math.abs(n)>r||e.velocityX>1?(e.wasSwiped=!0,e.remove()):(e.style.transition="transform .2s, opacity .2s",e.style.transform="",e.style.opacity=""),t._draggedToast=null}}},{key:"_xPos",value:function(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientX:t.clientX}},{key:"dismissAll",value:function(){for(var e in t._toasts)t._toasts[e].dismiss()}}],(n=[{key:"_createToast",value:function(){var e=document.createElement("div");return e.classList.add("toast"),this.options.classes.length&&this.options.classes.split(" ").forEach((function(t){e.classList.add(t)})),("object"===("undefined"==typeof HTMLElement?"undefined":Zs(HTMLElement))?this.message instanceof HTMLElement:this.message&&"object"===Zs(this.message)&&null!==this.message&&1===this.message.nodeType&&"string"==typeof this.message.nodeName)?e.appendChild(this.message):this.message.jquery?$(e).append(this.message[0]):e.innerHTML=this.message,t._container.appendChild(e),e}},{key:"_animateIn",value:function(){Hs({targets:this.el,top:0,opacity:1,duration:this.options.inDuration,easing:"easeOutCubic"})}},{key:"_setTimer",value:function(){var t=this;this.timeRemaining!==1/0&&(this.counterInterval=setInterval((function(){t.panning||(t.timeRemaining-=20),t.timeRemaining<=0&&t.dismiss()}),20))}},{key:"dismiss",value:function(){var e=this;window.clearInterval(this.counterInterval);var n=this.el.offsetWidth*this.options.activationPercent;this.wasSwiped&&(this.el.style.transition="transform .05s, opacity .05s",this.el.style.transform="translateX(".concat(n,"px)"),this.el.style.opacity=0),Hs({targets:this.el,opacity:0,marginTop:-40,duration:this.options.outDuration,easing:"easeOutExpo",complete:function(){"function"==typeof e.options.completeCallback&&e.options.completeCallback(),e.$el.remove(),t._toasts.splice(t._toasts.indexOf(e),1),0===t._toasts.length&&t._removeContainer()}})}}])&&Ks(e.prototype,n),r&&Ks(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();Qs._toasts=[],Qs._container=null,Qs._draggedToast=null;const Js=Qs;function tu(t){return tu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tu(t)}function eu(t,e){for(var n=0;n