@integry/sdk 0.0.69 → 0.0.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).IntegryJS=t()}(this,(function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(t,n){if(t){if("string"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}function n(n){return function(t){if(Array.isArray(t))return e(t)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||t(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,l,"next",e)}function l(e){r(a,i,o,s,l,"throw",e)}s(void 0)}))}}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a,s=Object.prototype,l=s.hasOwnProperty,u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",d=u.asyncIterator||"@@asyncIterator",p=u.toStringTag||"@@toStringTag";function f(e,t,n,r){var i=t&&t.prototype instanceof b?t:b,o=Object.create(i.prototype),a=new L(r||[]);return o._invoke=function(e,t,n){var r=m;return function(i,o){if(r===h)throw new Error("Generator is already running");if(r===y){if("throw"===i)throw o;return P()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=T(a,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===m)throw r=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var l=_(e,t,n);if("normal"===l.type){if(r=n.done?y:v,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=y,n.method="throw",n.arg=l.arg)}}}(e,n,a),o}function _(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}var m="suspendedStart",v="suspendedYield",h="executing",y="completed",g={};function b(){}function w(){}function x(){}var I={};I[c]=function(){return this};var k=Object.getPrototypeOf,C=k&&k(k(N([])));C&&C!==s&&l.call(C,c)&&(I=C);var S=x.prototype=b.prototype=Object.create(I);function O(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function M(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))}function D(e,t){function n(r,i,a,s){var u=_(e[r],e,i);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"===o(d)&&l.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var r;this._invoke=function(e,i){function o(){return new t((function(t,r){n(e,i,t,r)}))}return r=r?r.then(o,o):o()}}function T(e,t){var n=e.iterator[t.method];if(n===a){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=a,T(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var r=_(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,g;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=a),t.delegate=null,g):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function N(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=a,t.done=!0,t};return r.next=r}}return{next:P}}function P(){return{value:a,done:!0}}w.prototype=S.constructor=x,x.constructor=w,x[p]=w.displayName="GeneratorFunction",O(D.prototype),D.prototype[d]=function(){return this},O(S),S[p]="Generator",S[c]=function(){return this},S.toString=function(){return"[object Generator]"},L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(R),!e)for(var t in this)"t"===t.charAt(0)&&l.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=a)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=a),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=l.call(i,"catchLoc"),u=l.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=a),g}};var E={wrap:f,isGeneratorFunction:M,AsyncIterator:D,mark:function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,p in e||(e[p]="GeneratorFunction")),e.prototype=Object.create(S),e},awrap:function(e){return{__await:e}},async:function(e,t,n,r,i){void 0===i&&(i=Promise);var o=new D(f(e,t,n,r),i);return M(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},keys:function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},values:N};function j(){return(j=i(E.mark((function e(t,r){var i,o,a,s,l;return E.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=(i=function(e){return new Uint8Array(n(unescape(encodeURIComponent(e))).map((function(e){return e.charCodeAt(0)})))})(r),a=i(t),e.next=5,crypto.subtle.importKey("raw",o,{name:"HMAC",hash:"SHA-256"},!0,["sign"]);case 5:return s=e.sent,e.next=8,crypto.subtle.sign("HMAC",s,a);case 8:return l=e.sent,e.abrupt("return",n(new Uint8Array(l)).map((function(e){return e.toString(16).padStart(2,"0")})).join(""));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function F(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var U,H,B,W,J,q,G,K={},Z=[],Y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function Q(e,t){for(var n in t)e[n]=t[n];return e}function X(e){var t=e.parentNode;t&&t.removeChild(e)}function $(e,t,n){var r,i=arguments,o={};for(r in t)"key"!==r&&"ref"!==r&&(o[r]=t[r]);if(arguments.length>3)for(n=[n],r=3;r<arguments.length;r++)n.push(i[r]);if(null!=n&&(o.children=n),"function"==typeof e&&null!=e.defaultProps)for(r in e.defaultProps)void 0===o[r]&&(o[r]=e.defaultProps[r]);return ee(e,o,t&&t.key,t&&t.ref)}function ee(e,t,n,r){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:null,__c:null,constructor:void 0};return U.vnode&&U.vnode(i),i}function te(e){return e.children}function ne(e,t){this.props=e,this.context=t}function re(e,t){if(null==t)return e.__?re(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?re(e):null}function ie(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return ie(e)}}function oe(e){(!e.__d&&(e.__d=!0)&&1===B.push(e)||J!==U.debounceRendering)&&((J=U.debounceRendering)||W)(ae)}function ae(){var e,t,n,r,i,o,a;for(B.sort((function(e,t){return t.__v.__b-e.__v.__b}));e=B.pop();)e.__d&&(n=void 0,r=void 0,o=(i=(t=e).__v).__e,(a=t.__P)&&(n=[],r=fe(a,i,Q({},i),t.__n,void 0!==a.ownerSVGElement,null,n,null==o?re(i):o),_e(n,i),r!=o&&ie(i)))}function se(e,t,n,r,i,o,a,s,l){var u,c,d,p,f,_,m,v=n&&n.__k||Z,h=v.length;if(s==K&&(s=null!=o?o[0]:h?re(n,0):null),u=0,t.__k=le(t.__k,(function(n){if(null!=n){if(n.__=t,n.__b=t.__b+1,null===(d=v[u])||d&&n.key==d.key&&n.type===d.type)v[u]=void 0;else for(c=0;c<h;c++){if((d=v[c])&&n.key==d.key&&n.type===d.type){v[c]=void 0;break}d=null}if(p=fe(e,n,d=d||K,r,i,o,a,s,l),(c=n.ref)&&d.ref!=c&&(m||(m=[]),d.ref&&m.push(d.ref,null,n),m.push(c,n.__c||p,n)),null!=p){if(null==_&&(_=p),null!=n.__d)p=n.__d,n.__d=null;else if(o==d||p!=s||null==p.parentNode){e:if(null==s||s.parentNode!==e)e.appendChild(p);else{for(f=s,c=0;(f=f.nextSibling)&&c<h;c+=2)if(f==p)break e;e.insertBefore(p,s)}"option"==t.type&&(e.value="")}s=p.nextSibling,"function"==typeof t.type&&(t.__d=p)}}return u++,n})),t.__e=_,null!=o&&"function"!=typeof t.type)for(u=o.length;u--;)null!=o[u]&&X(o[u]);for(u=h;u--;)null!=v[u]&&ve(v[u],v[u]);if(m)for(u=0;u<m.length;u++)me(m[u],m[++u],m[++u])}function le(e,t,n){if(null==n&&(n=[]),null==e||"boolean"==typeof e)t&&n.push(t(null));else if(Array.isArray(e))for(var r=0;r<e.length;r++)le(e[r],t,n);else n.push(t?t("string"==typeof e||"number"==typeof e?ee(null,e,null,null):null!=e.__e||null!=e.__c?ee(e.type,e.props,e.key,null):e):e);return n}function ue(e,t,n,r,i){var o;for(o in n)o in t||de(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"value"===o||"checked"===o||n[o]===t[o]||de(e,o,t[o],n[o],r)}function ce(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]="number"==typeof n&&!1===Y.test(t)?n+"px":null==n?"":n}function de(e,t,n,r,i){var o,a,s,l,u;if(i?"className"===t&&(t="class"):"class"===t&&(t="className"),"key"===t||"children"===t);else if("style"===t)if(o=e.style,"string"==typeof n)o.cssText=n;else{if("string"==typeof r&&(o.cssText="",r=null),r)for(a in r)n&&a in n||ce(o,a,"");if(n)for(s in n)r&&n[s]===r[s]||ce(o,s,n[s])}else"o"===t[0]&&"n"===t[1]?(l=t!==(t=t.replace(/Capture$/,"")),u=t.toLowerCase(),t=(u in e?u:t).slice(2),n?(r||e.addEventListener(t,pe,l),(e.l||(e.l={}))[t]=n):e.removeEventListener(t,pe,l)):"list"!==t&&"tagName"!==t&&"form"!==t&&"type"!==t&&!i&&t in e?e[t]=null==n?"":n:"function"!=typeof n&&"dangerouslySetInnerHTML"!==t&&(t!==(t=t.replace(/^xlink:?/,""))?null==n||!1===n?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),n):null==n||!1===n?e.removeAttribute(t):e.setAttribute(t,n))}function pe(e){this.l[e.type](U.event?U.event(e):e)}function fe(e,t,n,r,i,o,a,s,l){var u,c,d,p,f,_,m,v,h,y,g=t.type;if(void 0!==t.constructor)return null;(u=U.__b)&&u(t);try{e:if("function"==typeof g){if(v=t.props,h=(u=g.contextType)&&r[u.__c],y=u?h?h.props.value:u.__:r,n.__c?m=(c=t.__c=n.__c).__=c.__E:("prototype"in g&&g.prototype.render?t.__c=c=new g(v,y):(t.__c=c=new ne(v,y),c.constructor=g,c.render=he),h&&h.sub(c),c.props=v,c.state||(c.state={}),c.context=y,c.__n=r,d=c.__d=!0,c.__h=[]),null==c.__s&&(c.__s=c.state),null!=g.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Q({},c.__s)),Q(c.__s,g.getDerivedStateFromProps(v,c.__s))),p=c.props,f=c.state,d)null==g.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==g.getDerivedStateFromProps&&v!==p&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(v,y),!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(v,c.__s,y)){for(c.props=v,c.state=c.__s,c.__d=!1,c.__v=t,t.__e=n.__e,t.__k=n.__k,c.__h.length&&a.push(c),u=0;u<t.__k.length;u++)t.__k[u]&&(t.__k[u].__=t);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(v,c.__s,y),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(p,f,_)}))}c.context=y,c.props=v,c.state=c.__s,(u=U.__r)&&u(t),c.__d=!1,c.__v=t,c.__P=e,u=c.render(c.props,c.state,c.context),t.__k=le(null!=u&&u.type==te&&null==u.key?u.props.children:u),null!=c.getChildContext&&(r=Q(Q({},r),c.getChildContext())),d||null==c.getSnapshotBeforeUpdate||(_=c.getSnapshotBeforeUpdate(p,f)),se(e,t,n,r,i,o,a,s,l),c.base=t.__e,c.__h.length&&a.push(c),m&&(c.__E=c.__=null),c.__e=null}else t.__e=function(e,t,n,r,i,o,a,s){var l,u,c,d,p,f=n.props,_=t.props;if(i="svg"===t.type||i,null==e&&null!=o)for(l=0;l<o.length;l++)if(null!=(u=o[l])&&(null===t.type?3===u.nodeType:u.localName===t.type)){e=u,o[l]=null;break}if(null==e){if(null===t.type)return document.createTextNode(_);e=i?document.createElementNS("http://www.w3.org/2000/svg",t.type):document.createElement(t.type),o=null}if(null===t.type)null!=o&&(o[o.indexOf(e)]=null),f===_||s||e.data==_||(e.data=_);else if(t!==n){if(null!=o&&(o=Z.slice.call(e.childNodes)),c=(f=n.props||K).dangerouslySetInnerHTML,d=_.dangerouslySetInnerHTML,!s){if(f===K)for(f={},p=0;p<e.attributes.length;p++)f[e.attributes[p].name]=e.attributes[p].value;(d||c)&&(d&&c&&d.__html==c.__html||(e.innerHTML=d&&d.__html||""))}ue(e,_,f,i,s),t.__k=t.props.children,d||se(e,t,n,r,"foreignObject"!==t.type&&i,o,a,K,s),s||("value"in _&&void 0!==_.value&&_.value!==e.value&&(e.value=null==_.value?"":_.value),"checked"in _&&void 0!==_.checked&&_.checked!==e.checked&&(e.checked=_.checked))}return e}(n.__e,t,n,r,i,o,a,l);(u=U.diffed)&&u(t)}catch(e){U.__e(e,t,n)}return t.__e}function _e(e,t){U.__c&&U.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){U.__e(e,t.__v)}}))}function me(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){U.__e(e,n)}}function ve(e,t,n){var r,i,o;if(U.unmount&&U.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||me(r,null,t)),n||"function"==typeof e.type||(n=null!=(i=e.__e)),e.__e=e.__d=null,null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){U.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&ve(r[o],t,n);null!=i&&X(i)}function he(e,t,n){return this.constructor(e,n)}function ye(e,t,n){var r,i,o;U.__&&U.__(e,t),i=(r=n===q)?null:n&&n.__k||t.__k,e=$(te,null,[e]),o=[],fe(t,(r?t:n||t).__k=e,i||K,K,void 0!==t.ownerSVGElement,n&&!r?[n]:i?null:Z.slice.call(t.childNodes),o,n||K,r),_e(o,e)}function ge(e){var t={},n={__c:"__cC"+G++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,i=this;return this.getChildContext||(r=[],this.getChildContext=function(){return t[n.__c]=i,t},this.shouldComponentUpdate=function(t){e.value!==t.value&&r.some((function(e){e.context=t.value,oe(e)}))},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Consumer.contextType=n,n}U={__e:function(e,t){for(var n,r;t=t.__;)if((n=t.__c)&&!n.__)try{if(n.constructor&&null!=n.constructor.getDerivedStateFromError&&(r=!0,n.setState(n.constructor.getDerivedStateFromError(e))),null!=n.componentDidCatch&&(r=!0,n.componentDidCatch(e)),r)return oe(n.__E=n)}catch(t){e=t}throw e}},H=function(e){return null!=e&&void 0===e.constructor},ne.prototype.setState=function(e,t){var n;n=this.__s!==this.state?this.__s:this.__s=Q({},this.state),"function"==typeof e&&(e=e(n,this.props)),e&&Q(n,e),null!=e&&this.__v&&(this.__e=!1,t&&this.__h.push(t),oe(this))},ne.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),oe(this))},ne.prototype.render=te,B=[],W="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,q=K,G=0;var be=Object.freeze({__proto__:null,render:ye,hydrate:function(e,t){ye(e,t,q)},createElement:$,h:$,Fragment:te,createRef:function(){return{}},get isValidElement(){return H},Component:ne,cloneElement:function(e,t){return t=Q(Q({},e.props),t),arguments.length>2&&(t.children=Z.slice.call(arguments,2)),ee(e.type,t,t.key||e.key,t.ref||e.ref)},createContext:ge,toChildArray:le,_unmount:ve,get options(){return U}}),we=function e(t,n,r,i){var o;n[0]=0;for(var a=1;a<n.length;a++){var s=n[a++],l=n[a]?(n[0]|=s?1:2,r[n[a++]]):n[++a];3===s?i[0]=l:4===s?i[1]=Object.assign(i[1]||{},l):5===s?(i[1]=i[1]||{})[n[++a]]=l:6===s?i[1][n[++a]]+=l+"":s?(o=t.apply(l,e(t,l,r,["",null])),i.push(o),l[0]?n[0]|=2:(n[a-2]=0,n[a]=o)):i.push(l)}return i},xe=new Map;var Ie=function(e){var t=xe.get(this);return t||(t=new Map,xe.set(this,t)),(t=we(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,r=1,i="",o="",a=[0],s=function(e){1===r&&(e||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?a.push(0,e,i):3===r&&(e||i)?(a.push(3,e,i),r=2):2===r&&"..."===i&&e?a.push(4,e,0):2===r&&i&&!e?a.push(5,0,!0,i):r>=5&&((i||!e&&5===r)&&(a.push(r,0,i,n),r=6),e&&(a.push(r,e,0,n),r=6)),i=""},l=0;l<e.length;l++){l&&(1===r&&s(),s(l));for(var u=0;u<e[l].length;u++)t=e[l][u],1===r?"<"===t?(s(),a=[a],r=3):i+=t:4===r?"--"===i&&">"===t?(r=1,i=""):i=t+i[0]:o?t===o?o="":i+=t:'"'===t||"'"===t?o=t:">"===t?(s(),r=1):r&&("="===t?(r=5,n=i,i=""):"/"===t&&(r<5||">"===e[l][u+1])?(s(),3===r&&(a=a[0]),r=a,(a=a[0]).push(2,0,r),r=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(s(),r=2):i+=t),3===r&&"!--"===i&&(r=4,a=a[0])}return s(),a}(e)),t),arguments,[])).length>1?t:t[0]}.bind($),ke="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ce(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}function Se(e){var t={exports:{}};return e(t,t.exports),t.exports}var Oe=Ce(be),Me=Se((function(e,t){var n=Oe;function r(e,t){for(var n in t)e[n]=t[n];return e}function i(e){this.getChildContext=function(){return{store:e.store}}}i.prototype.render=function(e){return e.children&&e.children[0]||e.children},t.connect=function(e,t){var i;return"function"!=typeof e&&("string"==typeof(i=e||{})&&(i=i.split(/\s*,\s*/)),e=function(e){for(var t={},n=0;n<i.length;n++)t[i[n]]=e[i[n]];return t}),function(i){function o(o,a){var s=this,l=a.store,u=e(l?l.getState():{},o),c=t?function(e,t){"function"==typeof e&&(e=e(t));var n={};for(var r in e)n[r]=t.action(e[r]);return n}(t,l):{store:l},d=function(){var t=e(l?l.getState():{},o);for(var n in t)if(t[n]!==u[n])return u=t,s.setState({});for(var r in u)if(!(r in t))return u=t,s.setState({})};this.componentWillReceiveProps=function(e){o=e,d()},this.componentDidMount=function(){l.subscribe(d)},this.componentWillUnmount=function(){l.unsubscribe(d)},this.render=function(e){return n.h(i,r(r(r({},c),e),u))}}return(o.prototype=new n.Component).constructor=o}},t.Provider=i}));function De(e,t){return t=t||{},new Promise((function(n,r){var i=new XMLHttpRequest,o=[],a=[],s={},l=function e(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:e,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){o.push(t=t.toLowerCase()),a.push([t,n]),s[t]=s[t]?s[t]+","+n:n})),n(l())},i.onerror=r,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)}))}function Te(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ae(e,t){return(Ae=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Re(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ae(e,t)}function Le(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?Te(e):t}function Ne(e){return(Ne=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pe(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Ee(e,t,n){return(Ee=Pe()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&Ae(i,n.prototype),i}).apply(null,arguments)}function je(e){var t="function"==typeof Map?new Map:void 0;return(je=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return Ee(e,arguments,Ne(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Ae(r,e)})(e)}function Fe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}var ze=function(e){Re(n,e);var t=Fe(n);function n(e,r){var i;return z(this,n),V(Te(i=t.call(this,e)),"statusCode",void 0),V(Te(i),"response",void 0),i.name=i.constructor.name,i.statusCode=null==r?void 0:r.status,i.response=r,i}return n}(je(Error)),Ve=function(){var e=i(E.mark((function e(t){var n,r,i;return E.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!1,!t.ok){e.next=16;break}return e.prev=2,e.next=5,t.json();case 5:return r=e.sent,n&&console.log(r),e.abrupt("return",{data:r,status:t.status});case 10:return e.prev=10,e.t0=e.catch(2),n&&console.log("Response is not in json"),e.abrupt("return",{data:null,status:t.status});case 14:e.next=22;break;case 16:if(405!==t.status){e.next=22;break}return e.next=19,t.json();case 19:return e.t1=e.sent,e.t2=t.status,e.abrupt("return",{data:e.t1,status:e.t2});case 22:return n&&console.log("Received a non-2xx status code"),i=new ze(t.statusText,t),e.abrupt("return",Promise.reject(i));case 25:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t){return e.apply(this,arguments)}}();function Ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function He(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ue(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Be=function e(t){var n=this;z(this,e),V(this,"config",void 0),V(this,"getTemplate",function(){var t=i(E.mark((function t(r){var i,o;return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new URL("".concat(n.config.baseUrlv2,"/template/").concat(r,"/")),e.addUrlSearchParams(i,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId,self_api_key:n.config.apiKey||null}),t.prev=2,t.next=5,De(i.toString()).then((function(e){return Ve(e)}));case 5:return o=t.sent,t.abrupt("return",o.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),V(this,"getAuthUrl",(function(t){var r=new URL("".concat(n.config.baseUrl,"/auth/login/").concat(t,"/"));return e.addUrlSearchParams(r,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId}),r.toString()})),V(this,"getTemplateStep",function(){var t=i(E.mark((function t(r){var i,o;return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new URL("".concat(n.config.baseUrl,"/template_step/").concat(r,"/")),e.addUrlSearchParams(i,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId,self_api_key:n.config.apiKey||null}),t.prev=2,t.next=5,De(i.toString()).then((function(e){return Ve(e)}));case 5:return o=t.sent,t.abrupt("return",o.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),V(this,"verifyOAuth",function(){var t=i(E.mark((function t(r){var i,o;return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new URL("".concat(n.config.baseUrl,"/").concat(n.config.oauthVerifyPath)),e.addUrlSearchParams(i,{authorization_id:"".concat(r),app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId}),t.prev=2,t.next=5,De(i.toString(),{method:"POST"}).then(Ve);case 5:return o=t.sent,t.abrupt("return",!!o.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),V(this,"deleteAuth",function(){var t=i(E.mark((function t(r){var i,o;return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new URL("".concat(n.config.baseUrl,"/connected-accounts/").concat(r)),e.addUrlSearchParams(i,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId}),t.prev=2,t.next=5,De(i.toString(),{method:"DELETE"}).then((function(e){return Ve(e)}));case 5:return o=t.sent,t.abrupt("return",{status:o.status,data:o.data});case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),V(this,"callDynamicDataEndpoint",function(){var t=i(E.mark((function t(r){var i,o,a=arguments;return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:{},e.addUrlSearchParams(r,He({app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId},i)),t.prev=2,t.next=5,De(r.toString()).then((function(e){return Ve(e)}));case 5:return o=t.sent,t.abrupt("return",o.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),V(this,"getTemplateListing",function(){var t=i(E.mark((function t(r){var i,o;return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new URL("".concat(n.config.baseUrl,"/bundle/").concat(r,"/")),e.addUrlSearchParams(i,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId}),t.prev=2,t.next=5,De(i.toString()).then((function(e){return Ve(e)}));case 5:return o=t.sent,t.abrupt("return",o.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),V(this,"saveIntegration",function(){var t=i(E.mark((function t(r){var i,o;return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new URL("".concat(n.config.baseUrlv2,"/integration/")),e.addUrlSearchParams(i,{async:!1,app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId,activate:!0}),t.prev=2,t.next=5,De(i.toString(),{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}}).then((function(e){return Ve(e)}));case 5:return o=t.sent,t.abrupt("return",o.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),V(this,"updateIntegration",function(){var t=i(E.mark((function t(r,i){var o,a;return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new URL("".concat(n.config.baseUrlv2,"/integration/").concat(r,"/")),e.addUrlSearchParams(o,{async:!1,app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId,activate:!0}),t.prev=2,t.next=5,De(o.toString(),{method:"PUT",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}).then((function(e){return Ve(e)}));case 5:return a=t.sent,t.abrupt("return",a.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()),V(this,"deleteIntegration",function(){var t=i(E.mark((function t(r){var i,o;return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new URL("".concat(n.config.baseUrl,"/setup/template/").concat(r,"/")),e.addUrlSearchParams(i,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId}),t.prev=2,t.next=5,De(i.toString(),{method:"DELETE"}).then((function(e){return Ve(e)}));case 5:return o=t.sent,t.abrupt("return",o.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),V(this,"toggleIntegration",function(){var t=i(E.mark((function t(r,i){var o,a;return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new URL("".concat(n.config.baseUrlv2,"/integration/").concat(r,"/").concat(i?"enable":"disable","/")),e.addUrlSearchParams(o,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId}),t.prev=2,t.next=5,De(o.toString(),{method:"PUT"}).then((function(e){return Ve(e)}));case 5:return a=t.sent,t.abrupt("return",a.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()),V(this,"getIntegrationById",function(){var t=i(E.mark((function t(r){var i,o;return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new URL("".concat(n.config.baseUrlv2,"/integration/").concat(r)),e.addUrlSearchParams(i,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId}),t.prev=2,t.next=5,De(i.toString(),{method:"GET"}).then((function(e){return Ve(e)}));case 5:return o=t.sent,t.abrupt("return",o.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),V(this,"getIntegrationStatuses",function(){var t=i(E.mark((function t(r){var i,o;return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new URL("".concat(n.config.baseUrlv2,"/integration_status/")),e.addUrlSearchParams(i,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId}),t.prev=2,t.next=5,De(i.toString(),{method:"PUT",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}}).then(Ve);case 5:return o=t.sent,t.abrupt("return",o);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),this.config=t};function We(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Je(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,n)||t(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}V(Be,"addUrlSearchParams",(function(e,t){return Object.keys(t).map((function(n){return void 0!==t[n]&&e.searchParams.append(n,"".concat(t[n]))}))}));var qe,Ge,Ke,Ze=[],Ye=U.__r,Qe=U.diffed,Xe=U.__c,$e=U.unmount;function et(e){U.__h&&U.__h(Ge);var t=Ge.__H||(Ge.__H={t:[],u:[]});return e>=t.t.length&&t.t.push({}),t.t[e]}function tt(e){return function(e,t,n){var r=et(qe++);return r.__c||(r.__c=Ge,r.i=[n?n(t):dt(void 0,t),function(t){var n=e(r.i[0],t);r.i[0]!==n&&(r.i[0]=n,r.__c.setState({}))}]),r.i}(dt,e)}function nt(e,t){var n=et(qe++);ct(n.o,t)&&(n.i=e,n.o=t,Ge.__H.u.push(n))}function rt(e){return it((function(){return{current:e}}),[])}function it(e,t){var n=et(qe++);return ct(n.o,t)?(n.o=t,n.v=e,n.i=e()):n.i}function ot(e,t){return it((function(){return e}),t)}function at(e){var t=Ge.context[e.__c];if(!t)return e.__;var n=et(qe++);return null==n.i&&(n.i=!0,t.sub(Ge)),t.props.value}function st(){Ze.some((function(e){e.__P&&(e.__H.u.forEach(lt),e.__H.u.forEach(ut),e.__H.u=[])})),Ze=[]}function lt(e){e.m&&e.m()}function ut(e){var t=e.i();"function"==typeof t&&(e.m=t)}function ct(e,t){return!e||t.some((function(t,n){return t!==e[n]}))}function dt(e,t){return"function"==typeof t?t(e):t}function pt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ft(e,t,n){return t&&pt(e.prototype,t),n&&pt(e,n),e}U.__r=function(e){Ye&&Ye(e),qe=0,(Ge=e.__c).__H&&(Ge.__H.u.forEach(lt),Ge.__H.u.forEach(ut),Ge.__H.u=[])},U.diffed=function(e){Qe&&Qe(e);var t=e.__c;if(t){var n=t.__H;n&&n.u.length&&(1!==Ze.push(t)&&Ke===U.requestAnimationFrame||((Ke=U.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);"undefined"!=typeof window&&(t=requestAnimationFrame(n))})(st))}},U.__c=function(e,t){t.some((function(e){e.__h.forEach(lt),e.__h=e.__h.filter((function(e){return!e.i||ut(e)}))})),Xe&&Xe(e,t)},U.unmount=function(e){$e&&$e(e);var t=e.__c;if(t){var n=t.__H;n&&n.t.forEach((function(e){return e.m&&e.m()}))}};var _t=["message"],mt=E.mark(Mt),vt=E.mark(Dt);function ht(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return yt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yt(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gt(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}var xt=function(e){Re(r,e);var t=wt(r);function r(e,i){var o,a;z(this,r);var s=e.message,l=We(e,_t),u=e.path,c=0===u.length?s:"At path: "+u.join(".")+" -- "+s;return o=t.call(this,c),Object.assign(Te(o),l),o.name=o.constructor.name,o.failures=function(){var t;return null!=(t=a)?t:a=[e].concat(n(i()))},o}return r}(je(TypeError));function It(e){return kt(e)&&"function"==typeof e[Symbol.iterator]}function kt(e){return"object"===o(e)&&null!=e}function Ct(e){return"string"==typeof e?JSON.stringify(e):""+e}function St(e){var t=e.next(),n=t.done,r=t.value;return n?void 0:r}function Ot(e,t,n,r){if(!0!==e){!1===e?e={}:"string"==typeof e&&(e={message:e});var i=t.path,o=t.branch,a=n.type,s=e,l=s.refinement,u=s.message,c=void 0===u?"Expected a value of type `"+a+"`"+(l?" with refinement `"+l+"`":"")+", but received: `"+Ct(r)+"`":u;return bt(bt({value:r,type:a,refinement:l,key:i[i.length-1],path:i,branch:o},e),{},{message:c})}}function Mt(e,t,n,r){var i,o,a,s;return E.wrap((function(l){for(;;)switch(l.prev=l.next){case 0:It(e)||(e=[e]),i=ht(e),l.prev=2,i.s();case 4:if((o=i.n()).done){l.next=12;break}if(a=o.value,!(s=Ot(a,t,n,r))){l.next=10;break}return l.next=10,s;case 10:l.next=4;break;case 12:l.next=17;break;case 14:l.prev=14,l.t0=l.catch(2),i.e(l.t0);case 17:return l.prev=17,i.f(),l.finish(17);case 20:case"end":return l.stop()}}),mt,null,[[2,14,17,20]])}function Dt(e,t){var r,i,o,a,s,l,u,c,d,p,f,_,m,v,h,y,g,b,w,x,I,k,C,S,O,M,D,T,A=arguments;return E.wrap((function(R){for(;;)switch(R.prev=R.next){case 0:if(r=A.length>2&&void 0!==A[2]?A[2]:{},i=r.path,o=void 0===i?[]:i,a=r.branch,s=void 0===a?[e]:a,l=r.coerce,u=void 0!==l&&l,c=r.mask,d=void 0!==c&&c,p={path:o,branch:s},u&&(e=t.coercer(e,p),d&&"type"!==t.type&&kt(t.schema)&&kt(e)&&!Array.isArray(e)))for(f in e)void 0===t.schema[f]&&delete e[f];_=!0,m=ht(t.validator(e,p)),R.prev=6,m.s();case 8:if((v=m.n()).done){R.next=15;break}return h=v.value,_=!1,R.next=13,[h,void 0];case 13:R.next=8;break;case 15:R.next=20;break;case 17:R.prev=17,R.t0=R.catch(6),m.e(R.t0);case 20:return R.prev=20,m.f(),R.finish(20);case 23:y=ht(t.entries(e,p)),R.prev=24,y.s();case 26:if((g=y.n()).done){R.next=53;break}b=Je(g.value,3),w=b[0],x=b[1],I=b[2],k=Dt(x,I,{path:void 0===w?o:[].concat(n(o),[w]),branch:void 0===w?s:[].concat(n(s),[x]),coerce:u,mask:d}),C=ht(k),R.prev=30,C.s();case 32:if((S=C.n()).done){R.next=43;break}if(!(O=S.value)[0]){R.next=40;break}return _=!1,R.next=38,[O[0],void 0];case 38:R.next=41;break;case 40:u&&(x=O[1],void 0===w?e=x:e instanceof Map?e.set(w,x):e instanceof Set?e.add(x):kt(e)&&(e[w]=x));case 41:R.next=32;break;case 43:R.next=48;break;case 45:R.prev=45,R.t1=R.catch(30),C.e(R.t1);case 48:return R.prev=48,C.f(),R.finish(48);case 51:R.next=26;break;case 53:R.next=58;break;case 55:R.prev=55,R.t2=R.catch(24),y.e(R.t2);case 58:return R.prev=58,y.f(),R.finish(58);case 61:if(!_){R.next=80;break}M=ht(t.refiner(e,p)),R.prev=63,M.s();case 65:if((D=M.n()).done){R.next=72;break}return T=D.value,_=!1,R.next=70,[T,void 0];case 70:R.next=65;break;case 72:R.next=77;break;case 74:R.prev=74,R.t3=R.catch(63),M.e(R.t3);case 77:return R.prev=77,M.f(),R.finish(77);case 80:if(!_){R.next=83;break}return R.next=83,[void 0,e];case 83:case"end":return R.stop()}}),vt,null,[[6,17,20,23],[24,55,58,61],[30,45,48,51],[63,74,77,80]])}var Tt=function(){function e(t){var n=this;z(this,e);var r=t.type,i=t.schema,o=t.validator,a=t.refiner,s=t.coercer,l=void 0===s?function(e){return e}:s,u=t.entries,c=void 0===u?E.mark((function e(){return E.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})):u;this.type=r,this.schema=i,this.entries=c,this.coercer=l,this.validator=o?function(e,t){return Mt(o(e,t),t,n,e)}:function(){return[]},this.refiner=a?function(e,t){return Mt(a(e,t),t,n,e)}:function(){return[]}}return ft(e,[{key:"assert",value:function(e){return At(e,this)}},{key:"create",value:function(e){return function(e,t){var n=Rt(e,t,{coerce:!0});if(n[0])throw n[0];return n[1]}(e,this)}},{key:"is",value:function(e){return function(e,t){return!Rt(e,t)[0]}(e,this)}},{key:"mask",value:function(e){return function(e,t){var n=Rt(e,t,{coerce:!0,mask:!0});if(n[0])throw n[0];return n[1]}(e,this)}},{key:"validate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Rt(e,this,t)}}]),e}();function At(e,t){var n=Rt(e,t);if(n[0])throw n[0]}function Rt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Dt(e,t,n),i=St(r);if(i[0]){var o=new xt(i[0],E.mark((function e(){var t,n,i;return E.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=ht(r),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=10;break}if(!(i=n.value)[0]){e.next=8;break}return e.next=8,i[0];case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),t.e(e.t0);case 15:return e.prev=15,t.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[1,12,15,18]])})));return[o,void 0]}var a=i[1];return[void 0,a]}function Lt(e,t){return new Tt({type:e,schema:null,validator:t})}function Nt(e){return new Tt({type:"array",schema:e,entries:E.mark((function t(n){var r,i,o,a,s;return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e||!Array.isArray(n)){t.next=18;break}r=ht(n.entries()),t.prev=2,r.s();case 4:if((i=r.n()).done){t.next=10;break}return o=Je(i.value,2),a=o[0],s=o[1],t.next=8,[a,s,e];case 8:t.next=4;break;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(2),r.e(t.t0);case 15:return t.prev=15,r.f(),t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[2,12,15,18]])})),coercer:function(e){return Array.isArray(e)?e.slice():e},validator:function(e){return Array.isArray(e)||"Expected an array value, but received: "+Ct(e)}})}function Pt(){return Lt("boolean",(function(e){return"boolean"==typeof e}))}function Et(){return Lt("date",(function(e){return e instanceof Date&&!isNaN(e.getTime())||"Expected a valid `Date` object, but received: "+Ct(e)}))}function jt(e){return new Tt(bt(bt({},e),{},{validator:function(t,n){return null===t||e.validator(t,n)},refiner:function(t,n){return null===t||e.refiner(t,n)}}))}function Ft(){return Lt("number",(function(e){return"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+Ct(e)}))}function zt(e){var t=e?Object.keys(e):[],n=Lt("never",(function(){return!1}));return new Tt({type:"object",schema:e||null,entries:E.mark((function r(i){var o,a,s,l,u,c,d;return E.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e||!kt(i)){r.next=37;break}o=new Set(Object.keys(i)),a=ht(t),r.prev=3,a.s();case 5:if((s=a.n()).done){r.next=12;break}return l=s.value,o.delete(l),r.next=10,[l,i[l],e[l]];case 10:r.next=5;break;case 12:r.next=17;break;case 14:r.prev=14,r.t0=r.catch(3),a.e(r.t0);case 17:return r.prev=17,a.f(),r.finish(17);case 20:u=ht(o),r.prev=21,u.s();case 23:if((c=u.n()).done){r.next=29;break}return d=c.value,r.next=27,[d,i[d],n];case 27:r.next=23;break;case 29:r.next=34;break;case 31:r.prev=31,r.t1=r.catch(21),u.e(r.t1);case 34:return r.prev=34,u.f(),r.finish(34);case 37:case"end":return r.stop()}}),r,null,[[3,14,17,20],[21,31,34,37]])})),validator:function(e){return kt(e)||"Expected an object, but received: "+Ct(e)},coercer:function(e){return kt(e)?bt({},e):e}})}function Vt(e){return new Tt(bt(bt({},e),{},{validator:function(t,n){return void 0===t||e.validator(t,n)},refiner:function(t,n){return void 0===t||e.refiner(t,n)}}))}function Ut(){return Lt("string",(function(e){return"string"==typeof e||"Expected a string, but received: "+Ct(e)}))}function Ht(e,t,n){return new Tt(bt(bt({},e),{},{refiner:function(e){var t=E.mark(n);function n(n,r){var i=arguments;return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(e.apply(this,i),"t0",1);case 1:return t.abrupt("return",t.t0);case 2:case"end":return t.stop()}}),t,this)}return n.toString=function(){return e.toString()},n}(E.mark((function r(i,o){var a,s,l,u,c;return E.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.delegateYield(e.refiner(i,o),"t0",1);case 1:a=n(i,o),s=Mt(a,o,e,i),l=ht(s),r.prev=4,l.s();case 6:if((u=l.n()).done){r.next=12;break}return c=u.value,r.next=10,bt(bt({},c),{},{refinement:t});case 10:r.next=6;break;case 12:r.next=17;break;case 14:r.prev=14,r.t1=r.catch(4),l.e(r.t1);case 17:return r.prev=17,l.f(),r.finish(17);case 20:case"end":return r.stop()}}),r,null,[[4,14,17,20]])})))}))}var Bt=ge(null);function Wt(e,t){for(var n in t)e[n]=t[n];return e}var Jt={stepState:{steps:[],currentStep:{type:"CONFIRMATION"},stepIndex:0,showValidation:!1,allStepsCompleted:!1},genericData:{bundleId:null,templateId:null,templateApp:null,isPreviewMode:!1},stepMapping:{},stepDataMapping:{},parentChildMapping:{}};function qt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qt(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Kt=function(e){return{setSteps:function(e,t){var n=[],r=-1;return t.forEach((function(e){if(e.activity.auth_required&&!e.hide_authorization&&(r+=1,n.push({stepId:e.id,title:"Connect ".concat(e.activity.app.name),iconUrl:e.activity.app.icon_url,isCompleted:!1,isCurrentlyOpen:!1,type:"AUTH",requiredFields:[e.id],invalidFields:V({},e.id,""),isValid:!1,itemIndex:r})),e.is_visible&&e.template_fields.length>0){var t=e.template_fields.filter((function(e){return e.is_visible})).length>0,i=e.template_fields.filter((function(e){return e.is_required&&e.is_visible})).map((function(e){return e.id})),o=e.template_fields.filter((function(e){return e.is_required&&!e.default_value})).reduce((function(e,t){return Gt(Gt({},e),{},V({},t.id,""))}),{}),a=!(Object.keys(o).length>0);t&&(r+=1,n.push({stepId:e.id,title:e.title,iconUrl:e.activity.app.icon_url,isCompleted:!1,isCurrentlyOpen:!1,type:"CONFIGURATION",requiredFields:i,invalidFields:o,isValid:a,itemIndex:r}))}})),Gt(Gt({},e),{},{stepState:{steps:n,currentStep:n[0],stepIndex:0,showValidation:!1,allStepsCompleted:!1}})},setIntegrationData:function(e,t){var n=e.stepDataMapping,r=e.stepMapping,i=t.steps.reduce((function(e,t){return r[t.template_step]&&t.authorization?Gt(Gt({},e),{},V({},t.template_step,{authId:Number(t.authorization),stepId:t.id})):e}),{}),o=t.steps.reduce((function(e,t){return n[t.template_step]?Gt(Gt({},e),{},V({},t.template_step,t.app_user_data)):e}),{}),a=Gt({},r),s=Gt({},n),l=e.stepState.steps.map((function(e){return Gt(Gt({},e),{},{isCompleted:!0})}));return Object.keys(o).forEach((function(e){s[Number(e)]=Gt(Gt({},n[Number(e)]),o[Number(e)].reduce((function(t,r){return n[Number(e)]?Gt(Gt({},t),{},V({},r.template_field,Gt(Gt({},n[Number(e)][r.template_field]),{},{integrationFieldId:r.id,value:n[Number(e)][r.template_field].isDynamic?null:r.value,objectValue:n[Number(e)][r.template_field].isDynamic?JSON.parse(r.value):null}))):t}),{}))})),Object.keys(i).forEach((function(e){a[Number(e)]=Gt(Gt({},a[Number(e)]),{},{integrationStepId:i[Number(e)].stepId,isAuthVerified:!0,selectedAuthId:i[Number(e)].authId})})),Gt(Gt({},e),{},{stepMapping:a,stepDataMapping:s,stepState:Gt(Gt({},e.stepState),{},{steps:l,currentStep:l[0],stepIndex:0,showValidation:!1,allStepsCompleted:!0})})},showStepValidationState:function(e){return{stepState:Gt(Gt({},e.stepState),{},{showValidation:!0})}},hideStepValidationState:function(e){return{stepState:Gt(Gt({},e.stepState),{},{showValidation:!1})}},gotoNextStep:function(e){var t=e.stepState;if(t){var r=Number(t.stepIndex)+1,i=t.steps[Number(t.stepIndex)+1],o=Gt(Gt({},t.steps[e.stepState.stepIndex]),{},{isCompleted:!0});return i?{stepState:Gt(Gt({},t),{},{steps:[].concat(n(t.steps.slice(0,t.stepIndex)),[o],n(t.steps.slice(t.stepIndex+1))),currentStep:Gt({},i),stepIndex:r,showValidation:!1})}:{stepState:Gt(Gt({},t),{},{steps:[].concat(n(t.steps.slice(0,t.stepIndex)),[o],n(t.steps.slice(t.stepIndex+1))),currentStep:{type:"CONFIRMATION"},stepIndex:r,allStepsCompleted:!0,showValidation:!1})}}return e},gotoPreviousStep:function(e){if(e.stepState){var t=Number(e.stepState.stepIndex)-1,n=e.stepState.steps[Number(e.stepState.stepIndex)-1];return{stepState:Gt(Gt({},e.stepState),{},{currentStep:n,stepIndex:t,showValidation:!n.isValid})}}return e},gotoStepInPreview:function(e,t){var n=e.stepState,r=t.stepId,i=t.type;if(r&&"CONFIRMATION"!==i){var o=n.steps.findIndex((function(e){return e.stepId===r&&e.type===i}));if(o>-1)return{stepState:Gt(Gt({},e.stepState),{},{currentStep:n.steps[o],stepIndex:o,allStepsCompleted:!1})}}return r||"CONFIRMATION"!==i?e:{stepState:Gt(Gt({},n),{},{currentStep:{type:"CONFIRMATION"},stepIndex:n.steps.length,allStepsCompleted:!0})}},gotoStep:function(e,t){var r=e.stepState,i=r.stepIndex;if(r){var o=r.steps[i],a=r.steps[t];if(e.genericData.isPreviewMode)return t===r.steps.length?{stepState:Gt(Gt({},r),{},{currentStep:{type:"CONFIRMATION"},stepIndex:r.steps.length,allStepsCompleted:!0})}:{stepState:Gt(Gt({},e.stepState),{},{currentStep:Gt({},a),stepIndex:t,allStepsCompleted:!1})};if(r.allStepsCompleted&&t===r.steps.length)return{stepState:Gt(Gt({},r),{},{currentStep:{type:"CONFIRMATION"},stepIndex:r.steps.length,allStepsCompleted:!0})};if(o&&o.isValid&&i===r.steps.length-1&&t===r.steps.length){var s=Gt(Gt({},r.steps[i]),{},{isCompleted:!0});return{stepState:Gt(Gt({},r),{},{steps:[].concat(n(r.steps.slice(0,i)),[s],n(r.steps.slice(i+1))),currentStep:{type:"CONFIRMATION"},stepIndex:t,allStepsCompleted:!0})}}if(a&&a.isCompleted)return{stepState:Gt(Gt({},e.stepState),{},{currentStep:Gt({},a),stepIndex:t,showValidation:!a.isValid})};if(o&&o.isValid&&t===i+1){var l=Gt(Gt({},r.steps[i]),{},{isCompleted:!0});return{stepState:Gt(Gt({},e.stepState),{},{steps:[].concat(n(r.steps.slice(0,i)),[l],n(r.steps.slice(i+1))),currentStep:Gt({},a),stepIndex:t})}}}return e},verifyStepValidity:function(e,t){var n=e.stepDataMapping[t],r=!(Object.keys(n).map((function(e){return n[Number(e)]})).filter((function(e){return e.isRequired&&!e.value&&!e.objectValue})).length>0);return{stepState:Gt(Gt({},e.stepState),{},{currentStep:Gt(Gt({},e.stepState.currentStep),{},{isValid:r})})}},getStepState:function(){return e.getState().stepState},setGenericData:function(e,t){return{genericData:Gt(Gt({},e.genericData),t)}},setTemplateApp:function(e,t){return{genericData:Gt(Gt({},e.genericData),{},{templateApp:{name:t.name,iconUrl:t.iconUrl}})}},setStepMapping:function(e,t){var n=t.reduce((function(t,n){var r,i,o,a,s=null,l=!1;n.hide_authorization||e.genericData.isPreviewMode?(l=!0,s=null!==(o=null===(a=n.authorization_type.authorizations[0])||void 0===a?void 0:a.id)&&void 0!==o?o:null):(n.step_authorization||e.stepMapping[n.id])&&(s=e.stepMapping[n.id].selectedAuthId);return Gt(Gt({},t),{},V({},n.id,{step:n,authorizations:null!==(r=null===(i=n.authorization_type.authorizations)||void 0===i?void 0:i.map((function(e){return{authorizationId:e.id,userIdentity:e.user_identity,authType:e.authorization_type,disableLink:e.disable_link,isErrored:!1,isVerified:l}})))&&void 0!==r?r:[],isAuthVerified:l,selectedAuthId:s}))}),{}),r=t.reduce((function(t,n){return Gt(Gt({},t),{},V({},n.id,Gt(Gt({},e.stepDataMapping[n.id]),n.template_fields.reduce((function(t,r){var i,o;return Gt(Gt({},t),{},V({},r.id,{fieldId:r.id,value:!r.is_visible||r.default_value?r.default_value:e.stepDataMapping[n.id]&&e.stepDataMapping[n.id][r.id]&&e.stepDataMapping[n.id][r.id].value||"",machineName:null===(i=r.activity_field)||void 0===i?void 0:i.machine_name,isRequired:r.is_required,isVisible:r.is_visible,isDynamic:"DYNAMIC"===(null===(o=r.activity_field)||void 0===o?void 0:o.type)}))}),{}))))}),{});return{stepMapping:Gt(Gt({},e.stepMapping),n),stepDataMapping:Gt(Gt({},e.stepDataMapping),r),genericData:Gt(Gt({},e.genericData),{},{templateApp:{name:t.length>0?t[0].activity.app.name:"",iconUrl:t.length>0?t[0].activity.app.icon_url:""}})}},setActivityOutputData:function(e,t){return Gt(Gt({},e),{},{activityOutputData:t.activityOutputData})},setDynamicFieldData:function(e,t){return Gt(Gt({},e),{},{dynamicFieldData:Object.keys(t.dynamicFieldData).reduce((function(e,n){return Gt(Gt({},e),{},V({},"{".concat(n,"}"),t.dynamicFieldData[n]))}),{})})},setParentChildMapping:function(e,t){var n=t.reduce((function(t,n){return Gt(Gt({},t),{},V({},n.id,Gt(Gt({},e.parentChildMapping[n.id]),n.template_fields.reduce((function(e,t){var n,r,i,o,a;return t.activity_field?Gt(Gt({},e),{},V({},null===(n=t.activity_field)||void 0===n?void 0:n.machine_name,{fieldId:t.id,childFields:null!==(r=t.activity_field)&&void 0!==r&&r.child_fields?JSON.parse(null===(i=t.activity_field)||void 0===i?void 0:i.child_fields):null,parentFields:null!==(o=t.activity_field)&&void 0!==o&&o.parent_fields?JSON.parse(null===(a=t.activity_field)||void 0===a?void 0:a.parent_fields):null})):e}),{}))))}),{});return{parentChildMapping:Gt(Gt({},e.parentChildMapping),n)}},addAuthorization:function(e,t){var r=t.stepId,i=t.authData;return{stepMapping:Gt(Gt({},e.stepMapping),{},V({},r,Gt(Gt({},e.stepMapping[r]),{},{authorizations:[].concat(n(e.stepMapping[r].authorizations),[i])})))}},removeAuthorization:function(e,t){var n=t.stepId,r=t.authId;return{stepMapping:Gt(Gt({},e.stepMapping),{},V({},n,Gt(Gt({},e.stepMapping[n]),{},{authorizations:e.stepMapping[n].authorizations.filter((function(e){return e.authorizationId!==r}))})))}},toggleVerifyAuthorizationFlag:function(e,t){var r=t.stepId,i=t.authId,o=t.isVerifying,a=e.stepMapping[r].authorizations.findIndex((function(e){return e.authorizationId===i}));return{stepMapping:Gt(Gt({},e.stepMapping),{},V({},r,Gt(Gt({},e.stepMapping[r]),{},{authorizations:[].concat(n(e.stepMapping[r].authorizations.slice(0,a)),[Gt(Gt({},e.stepMapping[r].authorizations[a]),{},{isVerifying:o})],n(e.stepMapping[r].authorizations.slice(a+1)))})))}},toggleDeleteAuthorizationFlag:function(e,t){var r=t.stepId,i=t.authId,o=t.isDeleting,a=t.error,s=e.stepMapping[r].authorizations.findIndex((function(e){return e.authorizationId===i}));return{stepMapping:Gt(Gt({},e.stepMapping),{},V({},r,Gt(Gt({},e.stepMapping[r]),{},{authorizations:[].concat(n(e.stepMapping[r].authorizations.slice(0,s)),[Gt(Gt({},e.stepMapping[r].authorizations[s]),{},{isDeleting:o,error:a})],n(e.stepMapping[r].authorizations.slice(s+1)))})))}},setStepAuthId:function(e,t){var n=t.stepId,r=t.authId;return{stepMapping:Gt(Gt({},e.stepMapping),{},V({},n,Gt(Gt({},e.stepMapping[n]),{},{selectedAuthId:r})))}},setStepAuthorization:function(t,r,i,o,a,s){var l,u,c=t.stepState.steps[t.stepState.stepIndex],d=t.stepMapping[r],p=e.getState().stepState;if("CONFIRMATION"!==c.type&&"CONFIRMATION"!==(null===(l=p.currentStep)||void 0===l?void 0:l.type)&&(null===(u=p.currentStep)||void 0===u?void 0:u.stepId)===r){var f=c.invalidFields;o&&delete f[r];var _=Gt(Gt({},t.stepState.steps[t.stepState.stepIndex]),{},{invalidFields:f,isValid:Object.keys(f).length<1,isCompleted:null!==d.selectedAuthId||o}),m=t.stepMapping[r].authorizations.findIndex((function(e){return e.authorizationId===i}));return{stepState:Gt(Gt({},t.stepState),{},{steps:[].concat(n(t.stepState.steps.slice(0,t.stepState.stepIndex)),[_],n(t.stepState.steps.slice(t.stepState.stepIndex+1))),currentStep:_,showValidation:!o&&!d.selectedAuthId}),stepMapping:Gt(Gt({},t.stepMapping),{},V({},r,Gt(Gt({},t.stepMapping[r]),{},{selectedAuthId:o?i:t.stepMapping[r].selectedAuthId,authorizations:[].concat(n(t.stepMapping[r].authorizations.slice(0,m)),[Gt(Gt({},t.stepMapping[r].authorizations[m]),{},{isVerified:o,isVerifying:!1,didFetchStatus:!0,error:""})],n(t.stepMapping[r].authorizations.slice(m+1)))}))),stepDataMapping:s?t.stepDataMapping:Gt(Gt({},t.stepDataMapping),{},V({},r,Gt(Gt({},t.stepDataMapping[r]),a.reduce((function(e,n){return Gt(Gt({},e),{},V({},n,Gt(Gt({},t.stepDataMapping[r][n]),{},{value:""})))}),{}))))}}return t},resetCustomMappingData:function(e,t){var n,r=null===(n=e.stepMapping[t].step.template_fields.filter((function(e){var t;return"DYNAMIC"===(null===(t=e.activity_field)||void 0===t?void 0:t.type)}))[0])||void 0===n?void 0:n.id;if(r){var i=e.stepDataMapping[t][r];return i&&(i.objectValue={}),{stepDataMapping:Gt(Gt({},e.stepDataMapping),{},V({},t,Gt(Gt({},e.stepDataMapping[t]),{},V({},r,i))))}}return e},setStepFieldData:function(e,t){var r=t.stepId,i=t.fieldId,o=t.value,a=t.isRequired,s=e.stepState.steps[e.stepState.stepIndex];if("CONFIRMATION"!==s.type){var l=s.invalidFields;o?delete l[i]:a&&(l[i]=null);var u=Gt(Gt({},e.stepState.steps[e.stepState.stepIndex]),{},{invalidFields:l,isValid:Object.keys(l).length<1});return{stepState:Gt(Gt({},e.stepState),{},{steps:[].concat(n(e.stepState.steps.slice(0,e.stepState.stepIndex)),[u],n(e.stepState.steps.slice(e.stepState.stepIndex+1))),currentStep:u,allStepsCompleted:!1}),stepDataMapping:Gt(Gt({},e.stepDataMapping),{},V({},r,Gt(Gt({},e.stepDataMapping[r]),{},V({},i,Gt(Gt({},e.stepDataMapping[r][i]),{},{value:o})))))}}return e},setStepMappingData:function(e,t){var n,r,i,o,a=null===(n=e.stepDataMapping[t.stepId][t.fieldId])||void 0===n?void 0:n.objectValue;t.value?r=Gt(Gt({},null!==(i=null===(o=e.stepDataMapping[t.stepId][t.fieldId])||void 0===o?void 0:o.objectValue)&&void 0!==i?i:{}),V({},t.id,t.value)):a&&(delete a[t.id],r=a,0===Object.keys(r).length&&(r=null));return r?{stepDataMapping:Gt(Gt({},e.stepDataMapping),{},V({},t.stepId,Gt(Gt({},e.stepDataMapping[t.stepId]),{},V({},t.fieldId,Gt(Gt({},e.stepDataMapping[t.stepId][t.fieldId]),{},{objectValue:r})))))}:e},reset:function(){return Jt}}},Zt=function(){return function(e){var t=window.__REDUX_DEVTOOLS_EXTENSION__||window.top.__REDUX_DEVTOOLS_EXTENSION__,n=!1;return t?(e.devtools||(e.devtools=t.connect(),e.devtools.subscribe((function(t){"DISPATCH"===t.type&&t.state&&(n="JUMP_TO_ACTION"===t.payload.type||"JUMP_TO_STATE"===t.payload.type,e.setState(JSON.parse(t.state),!0))})),e.devtools.init(e.getState()),e.subscribe((function(t,r){var i=r&&r.name||"setState";n?n=!1:e.devtools.send(i,t)}))),e):(console.warn("Please install/enable Redux devtools extension"),e.devtools=null,e)}(function(e){var t=[];function n(e){for(var n=[],r=0;r<t.length;r++)t[r]===e?e=null:n.push(t[r]);t=n}function r(n,r,i){e=r?n:Wt(Wt({},e),n);for(var o=t,a=0;a<o.length;a++)o[a](e,i)}return e=e||{},{action:function(t){function n(e){r(e,!1,t)}return function(){for(var r=arguments,i=[e],o=0;o<arguments.length;o++)i.push(r[o]);var a=t.apply(this,i);if(null!=a)return a.then?a.then(n):n(a)}},setState:r,subscribe:function(e){return t.push(e),function(){n(e)}},unsubscribe:n,getState:function(){return e}}}(Jt))},Yt=zt({id:Ft(),name:Ut(),description:Ut(),app:zt({id:Ft(),name:Ut(),description:Ut(),icon_url:Ut(),color:Ut(),publishing_status:Ut(),category:Nt(Ut()),app_type:Vt(Ut()),action_url:jt(Vt(Ut())),created_at:Vt(Et()),tags:Ut()}),branding_app:zt({id:Ft(),name:Ut(),description:Ut(),icon_url:Ut(),color:Ut(),publishing_status:Ut(),category:Nt(Ut()),app_type:Vt(Ut()),action_url:jt(Vt(Ut())),created_at:Vt(Et()),tags:Ut()}),button_text:jt(Ut()),is_wizard:Pt(),publishing_status:Ut(),steps:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r="Expected a "+e.type,i=t===n?"of `"+t+"`":"between `"+t+"` and `"+n+"`";return Ht(e,"size",(function(e){if("number"==typeof e||e instanceof Date)return t<=e&&e<=n||r+" "+i+" but received `"+e+"`";if(e instanceof Map||e instanceof Set){var o=e.size;return t<=o&&o<=n||r+" with a size "+i+" but received one with a size of `"+o+"`"}var a=e.length;return t<=a&&a<=n||r+" with a length "+i+" but received one with a length of `"+a+"`"}))}(Nt(zt({id:Ft(),weight:Ft(),title:Ut(),is_visible:Pt(),activity:zt({id:Ft(),name:Ut(),type:Ut(),endpoint:Ut(),auth_required:Pt(),total_fields:Ft(),app:zt({id:Ft(),name:Ut(),description:Ut(),icon_url:Ut(),color:Ut(),publishing_status:Ut(),category:Nt(Ut()),app_type:Vt(Ut()),action_url:jt(Vt(Ut())),created_at:Vt(Et()),tags:Ut()}),activity_output:jt(Ut()),activity_output_url:jt(Ut()),dynamic_field_data_endpoint:jt(Ut())}),authorization_type:zt({id:Ft(),type:Ut(),authorizations:Nt(zt({id:Ft(),authorization_type:Ut(),app_user:Vt(Ft()),app_user_id:Vt(Ft()),disable_link:Vt(Ut()),integration_count:Vt(Ft()),user_identity:Ut()})),provider:Ut(),is_sandbox_enabled:Pt(),authorization_url_sandbox:Ut()}),template_fields:Nt(zt({id:Ft(),is_required:Pt(),is_hidden:Pt(),default_value:jt(Ut()),weight:Ft(),description:Ut(),summary:jt(Ut()),placeholder:jt(Ut()),activity_field:jt(zt({id:Ft(),machine_name:Ut(),type:Ut(),title:Ut(),description:Ut(),weight:Ft(),is_required:Pt(),child_fields:jt(Ut()),is_dynamic:Pt(),data_src:jt(Ut()),data_src_endpoint:jt(Ft()),parent_fields:jt(Ut()),dynamic_field_src:jt(Ut()),default_value:jt(Ut()),auto_machine_name:Ut(),dynamic_field_src_endpoint:jt(Ft()),regex:jt(Ut()),is_searchable:Pt()})),title:jt(Ut()),type:Ut(),child_field:jt(Ut()),child_field_value:jt(Ut()),button_text:jt(Ut()),icon_url:jt(Ut()),long_description:jt(Ut()),regex:jt(Ut()),regex_msg:jt(Ut()),is_visible:Pt()})),allow_multiple_authorizations:Pt(),step_authorization:jt(Ft()),button_text:jt(Ut()),is_self_step:Pt(),summary:jt(Ut()),auth_description:jt(Ut()),hide_authorization:Pt(),machine_name:jt(Ut()),is_custom_machine_name:Pt()})),0,Number.POSITIVE_INFINITY)});function Qt(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var Xt,$t="styles-module_loader__2ufbr";Qt(".styles-module_loader__2ufbr {\n animation-name: styles-module_ckw__1aYrI;\n animation-duration: 1s;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n transform-origin: 50% 50%; }\n\n@keyframes styles-module_ckw__1aYrI {\n 0% {\n transform: rotate(0deg); }\n 100% {\n transform: rotate(360deg); } }\n");var en=function(){return Ie(Xt||(Xt=F(["\n <svg\n class=",'\n width="15"\n height="15"\n viewBox="0 0 15 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M9.13037 0.179352C7.57047 -0.168051 5.94039 -0.00810102 4.47777 0.635883C3.01515 1.27987 1.79647 2.37421 0.999409 3.75937C0.202348 5.14453 -0.131421 6.74808 0.0467641 8.33623C0.224949 9.92438 0.90577 11.4141 1.98997 12.5882C3.07417 13.7623 4.50506 14.5593 6.07402 14.8632C7.64298 15.167 9.26799 14.9618 10.7121 14.2773C12.1562 13.5929 13.344 12.4651 14.1022 11.0582C14.8604 9.65144 15.1494 8.03922 14.9271 6.45665L14.1844 6.56098C14.3845 7.9853 14.1243 9.43629 13.442 10.7024C12.7596 11.9685 11.6906 12.9836 10.3909 13.5996C9.09119 14.2156 7.62869 14.4003 6.21662 14.1269C4.80455 13.8534 3.51675 13.136 2.54097 12.0794C1.56519 11.0227 0.952454 9.68194 0.792088 8.2526C0.631721 6.82327 0.932113 5.38008 1.64947 4.13343C2.36682 2.88679 3.46363 1.90188 4.77999 1.32229C6.09635 0.742709 7.56343 0.598754 8.96733 0.911417L9.13037 0.179352Z"\n fill="#E0E0E0"\n />\n <path\n d="M14.93 6.47755C14.7207 4.95709 14.0501 3.53742 13.0085 2.41017C11.9669 1.28292 10.6046 0.50235 9.10537 0.173829L8.94483 0.906446C10.2941 1.20212 11.5202 1.90462 12.4577 2.91915C13.3951 3.93368 13.9987 5.21138 14.187 6.57979L14.93 6.47755Z"\n fill="#ADADAD"\n />\n </svg>\n'])),$t)};function tn(e){return null!=e}var nn,rn,on,an=Se((function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var i=arguments[r];if(i){var a=o(i);if("string"===a||"number"===a)e.push(i);else if(Array.isArray(i)){if(i.length){var s=n.apply(null,i);s&&e.push(s)}}else if("object"===a)if(i.toString===Object.prototype.toString)for(var l in i)t.call(i,l)&&i[l]&&e.push(l);else e.push(i.toString())}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()})),sn="styles-module_preact-hint__2fj-j",ln="styles-module_preact-hint__top__eUj7n",un="styles-module_preact-hint__bottom__2goUI",cn="styles-module_preact-hint__content__23OpK";function dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dn(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fn(e){var t=rt(null),n=Je(tt(1e4),2),r=n[0],i=n[1],o=e.position;return nt((function(){t.current&&i(t.current.getBoundingClientRect().width)}),[t]),Ie(nn||(nn=F(['\n <div\n class="','"\n style=',"\n >\n <pre class="," ref=",">\n ","\n </pre\n >\n </div>\n "])),"".concat(sn," ").concat("top"===o?ln:un),pn(pn({},{left:e.targetBoundingRect.left-e.rootBoundingRect.left-r/2+e.targetBoundingRect.width/2}),"top"===o?{bottom:e.rootBoundingRect.height-e.targetBoundingRect.top+e.rootBoundingRect.top+2}:{top:e.rootBoundingRect.height-e.targetBoundingRect.top+e.rootBoundingRect.top+2}),cn,t,e.template?e.template(e.content):e.content)}Qt(".styles-module_preact-hint__2fj-j {\n position: absolute;\n z-index: 9999;\n cursor: default; }\n .styles-module_preact-hint__2fj-j::after {\n content: '';\n width: 0;\n height: 0;\n margin: auto;\n display: block;\n position: absolute;\n border: 4px solid transparent; }\n .styles-module_preact-hint__2fj-j.styles-module_preact-hint__top__eUj7n {\n padding-bottom: 4px; }\n .styles-module_preact-hint__2fj-j.styles-module_preact-hint__top__eUj7n::after {\n top: auto;\n left: 0;\n right: 0;\n bottom: 0;\n border-bottom: none;\n border-top-color: #000; }\n .styles-module_preact-hint__2fj-j.styles-module_preact-hint__bottom__2goUI {\n padding-top: 4px; }\n .styles-module_preact-hint__2fj-j.styles-module_preact-hint__bottom__2goUI::after {\n top: 0;\n left: 0;\n right: 0;\n bottom: auto;\n border-top: none;\n border-bottom-color: #000; }\n\n.styles-module_preact-hint__content__23OpK {\n font-family: inherit;\n background: #000000;\n box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.062132);\n padding: 8px;\n margin: 0;\n border-radius: 2px;\n font-style: normal;\n margin: 0;\n line-height: 12px;\n font-weight: normal;\n font-size: 10px;\n color: #ffffff;\n display: block; }\n");var _n=function(e){var t=e.position,n=void 0===t?"bottom":t,r=e.attribute,i=void 0===r?"data-hint":r,o=Je(tt(""),2),a=o[0],s=o[1],l=Je(tt(null),2),u=l[0],c=l[1],d=Je(tt(null),2),p=d[0],f=d[1],_=ot((function(t){c(t),u&&(u.addEventListener("mouseover",(function(e){e.target instanceof Element&&e.target.hasAttribute(i)&&(s(e.target.getAttribute(i)||""),f(e.target.getBoundingClientRect()))})),u.addEventListener("mouseout",(function(e){e.target instanceof Element&&e.target.hasAttribute(i)&&(s(""),f(null))})),e.dismissOnClick&&u.addEventListener("click",(function(){s(""),f(null)})))}),[u]);return Ie(rn||(rn=F(["\n <div ref=",' style="position: relative">\n ',"\n ","\n </div>\n "])),_,a&&u&&p&&Ie(on||(on=F([" <","\n content=","\n position=","\n template=","\n rootBoundingRect=","\n targetBoundingRect=","\n />"])),fn,a,n,e.template,null==u?void 0:u.getBoundingClientRect(),p),e.children)},mn="styles-module_button__osBYJ",vn="styles-module_buttonPrimary__1u5p2",hn="styles-module_disabled__CiT_f",yn="styles-module_buttonSecondary__2HV1m",gn="styles-module_buttonLink__39jcU",bn="styles-module_loader__3dlUQ";Qt(".styles-module_button__osBYJ {\n outline: none;\n cursor: pointer;\n -webkit-appearance: none;\n appearance: none;\n font-size: 12px;\n padding: 0px 15px;\n height: 30px; }\n .styles-module_button__osBYJ.styles-module_buttonPrimary__1u5p2 {\n border: 1px solid #5f4d86;\n background: #5f4d86;\n border-radius: 4px;\n font-size: 12px;\n color: #ffffff; }\n .styles-module_button__osBYJ.styles-module_buttonPrimary__1u5p2:not(.styles-module_disabled__CiT_f):hover {\n background-color: #473a64; }\n .styles-module_button__osBYJ.styles-module_buttonSecondary__2HV1m {\n border: 1px solid #5f4d86;\n background: transparent;\n text-align: center;\n font-size: 12px;\n color: #5f4d86;\n border-radius: 4px; }\n .styles-module_button__osBYJ.styles-module_buttonSecondary__2HV1m:not(.styles-module_disabled__CiT_f):hover {\n background: #5f4d86;\n color: white; }\n .styles-module_button__osBYJ.styles-module_buttonLink__39jcU {\n border: none;\n color: #5f4d86;\n font-weight: 500;\n font-size: 12px;\n background: transparent;\n padding: 0;\n margin: 0; }\n .styles-module_button__osBYJ.styles-module_buttonLink__39jcU:not(.styles-module_disabled__CiT_f):hover {\n color: #473a64; }\n .styles-module_button__osBYJ.styles-module_disabled__CiT_f {\n opacity: 0.5;\n cursor: not-allowed; }\n .styles-module_button__osBYJ .styles-module_loader__3dlUQ {\n display: flex; }\n .styles-module_button__osBYJ .styles-module_loader__3dlUQ svg {\n animation-name: styles-module_fadeInOut__2G3PU;\n animation-duration: 1s;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n animation-delay: 0;\n margin: 0px 2px; }\n .styles-module_button__osBYJ .styles-module_loader__3dlUQ svg:nth-child(2) {\n animation-delay: 0.3s; }\n .styles-module_button__osBYJ .styles-module_loader__3dlUQ svg:nth-child(3) {\n animation-delay: 0.6s; }\n\n@keyframes styles-module_fadeInOut__2G3PU {\n 0% {\n opacity: 0.3; }\n 50% {\n opacity: 1; }\n 100% {\n opacity: 0.3; } }\n");var wn,xn,In,kn,Cn,Sn=["label","type","color","backgroundColor","disabled","tooltip","dismissOnClick","isLoading","position","onClick"];function On(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}!function(e){e.PRIMARY="primary",e.SECONDARY="secondary",e.LINK="link"}(Cn||(Cn={}));var Mn,Dn,Tn,An=function(){return Ie(wn||(wn=F(['\n <svg\n width="6"\n height="6"\n viewBox="0 0 6 6"\n fill="white"\n xmlns="http://www.w3.org/2000/svg"\n >\n <circle cx="3" cy="3" r="3" fill="white" />\n </svg>\n'])))},Rn=function(){return Ie(xn||(xn=F(["\n <div class=",">\n <"," />\n <"," />\n <"," />\n </div>\n"])),bn,An,An,An)},Ln=function(e){var t,n=e.label,r=e.type,i=void 0===r?Cn.PRIMARY:r,o=e.color,a=void 0===o?null:o,s=e.backgroundColor,l=void 0===s?null:s,u=e.disabled,c=void 0!==u&&u,d=e.tooltip,p=e.dismissOnClick,f=void 0===p||p,_=e.isLoading,m=void 0!==_&&_,v=e.position,h=void 0===v?"bottom":v,y=e.onClick,g=void 0===y?void 0:y,b=We(e,Sn);return Ie(In||(In=F(["\n <"," dismissOnClick="," position=",'>\n <button\n type="button"\n onclick=',"\n data-hint=","\n class=","\n style=","\n ","\n >\n ","\n </button>\n <//>\n "])),_n,f,h,g,d||null,an(mn,(V(t={},vn,i===Cn.PRIMARY),V(t,yn,i===Cn.SECONDARY),V(t,gn,i===Cn.LINK),V(t,hn,c),t)),{backgroundColor:i===Cn.PRIMARY?l:null,borderColor:i===Cn.PRIMARY?l:a,color:a},function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?On(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):On(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},b),m?Ie(kn||(kn=F(["<"," />"])),Rn):n)},Nn="styles-module_errorPageWrapper__BMBHQ",Pn="styles-module_errorTitle__1baLE",En="styles-module_errorDescription__1dTc9",jn="styles-module_errorContainer__3WprN",Fn="styles-module_errorPayload__OjsC-";Qt(".styles-module_errorPageWrapper__BMBHQ {\n font-family: monospace;\n border: 1px solid red;\n padding: 30px; }\n .styles-module_errorPageWrapper__BMBHQ .styles-module_errorTitle__1baLE {\n color: #b61717;\n font-weight: bold;\n font-size: 16px;\n line-height: 20px;\n margin-bottom: 8px; }\n .styles-module_errorPageWrapper__BMBHQ .styles-module_errorDescription__1dTc9 {\n font-size: 14px;\n margin-bottom: 18px; }\n .styles-module_errorPageWrapper__BMBHQ .styles-module_errorContainer__3WprN {\n overflow: hidden;\n background: #ffebeb;\n padding: 4px;\n margin-bottom: 20px; }\n .styles-module_errorPageWrapper__BMBHQ .styles-module_errorPayload__OjsC- {\n margin: 0;\n padding: 8px 12px; }\n");var zn=function(e){var t=e.title,n=e.description,r=e.errorPayload,i=e.onDismiss,o=void 0===i?null:i;return Ie(Mn||(Mn=F(['\n <div class="','">\n <div class=',">","</div>\n <div class=",">","</div>\n ","\n ","\n </div>\n "])),Nn,Pn,t,En,n,r&&Ie(Dn||(Dn=F(["\n <div class=",">\n <pre class=",">","</pre>\n <pre class=",">","</pre>\n </div>\n "])),jn,Fn,r.message,Fn,r.stack),o&&Ie(Tn||(Tn=F(["\n <div>\n <",' label="Dismiss" onClick='," />\n </div>\n "])),Ln,o))};function Vn(e){var t,n,r,i,o=Je(tt({width:0,height:0}),2),a=o[0],s=o[1],l=ot((function(){var t=null==e?void 0:e.current;t&&s({width:t.offsetWidth||0,height:t.offsetHeight||0})}),[e]);return nt((function(){l()}),[]),t="resize",n=l,i=rt(),nt((function(){var e=(null==r?void 0:r.current)||window;if(e&&e.addEventListener){i.current!==n&&(i.current=n);var o=function(e){null!=i&&i.current&&i.current(e)};return e.addEventListener(t,o),function(){e.removeEventListener(t,o)}}}),[t,r,n]),a}var Un,Hn,Bn,Wn,Jn,qn="styles-module_navigation__2IuNI",Gn="styles-module_collapse__G_01I",Kn="styles-module_dots__3ItWV",Zn="styles-module_popup__39sdx",Yn="styles-module_show__L1e5K",Qn="styles-module_stepItem__NPXF_",Xn="styles-module_arrow__3C8To",$n="styles-module_navItem__1kxtL",er="styles-module_navItemContent__28oLq",tr="styles-module_imgContainer__wbjM4",nr="styles-module_active__28cMj",rr="styles-module_disabled__1Ltqi";function ir(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}Qt(".styles-module_navigation__2IuNI {\n margin-bottom: 45px;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center; }\n\n.styles-module_collapse__G_01I {\n display: flex;\n width: 30px;\n height: 22px;\n padding-top: 2px;\n align-items: center;\n margin-right: 20px; }\n .styles-module_collapse__G_01I .styles-module_dots__3ItWV {\n cursor: pointer;\n height: 16px;\n padding-right: 10px; }\n .styles-module_collapse__G_01I .styles-module_popup__39sdx {\n position: absolute;\n display: none;\n padding: 0 10px;\n background: #ffffff;\n border: 1px solid #f3f3f3;\n box-shadow: 0px 2px 7px rgba(162, 162, 162, 0.25);\n border-radius: 4px;\n top: 28px;\n z-index: 100; }\n .styles-module_collapse__G_01I .styles-module_popup__39sdx.styles-module_show__L1e5K {\n display: block; }\n .styles-module_collapse__G_01I .styles-module_popup__39sdx .styles-module_stepItem__NPXF_ {\n padding: 10px 0px; }\n .styles-module_collapse__G_01I .styles-module_popup__39sdx .styles-module_stepItem__NPXF_:not(:last-child) {\n border-bottom: 1px solid #f3f3f3; }\n .styles-module_collapse__G_01I .styles-module_arrow__3C8To svg {\n opacity: 0.5; }\n\n.styles-module_navItem__1kxtL {\n cursor: pointer;\n color: #1f2937; }\n .styles-module_navItem__1kxtL .styles-module_navItemContent__28oLq {\n display: flex;\n align-items: center;\n padding-right: 0.25rem; }\n .styles-module_navItem__1kxtL .styles-module_navItemContent__28oLq p {\n margin: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n font-weight: 400;\n color: #333333; }\n .styles-module_navItem__1kxtL .styles-module_navItemContent__28oLq .styles-module_imgContainer__wbjM4 {\n position: relative;\n margin-right: 0.5rem;\n height: 15px;\n width: 15px;\n overflow: hidden;\n border-radius: 9999px; }\n .styles-module_navItem__1kxtL .styles-module_navItemContent__28oLq .styles-module_imgContainer__wbjM4 img,\n .styles-module_navItem__1kxtL .styles-module_navItemContent__28oLq .styles-module_imgContainer__wbjM4 svg {\n position: absolute;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n object-fit: cover; }\n .styles-module_navItem__1kxtL .styles-module_arrow__3C8To {\n margin-top: 2px;\n margin-left: 0.75rem;\n margin-right: 0.5rem; }\n .styles-module_navItem__1kxtL.styles-module_active__28cMj {\n opacity: 1; }\n .styles-module_navItem__1kxtL.styles-module_active__28cMj p {\n font-weight: 500; }\n .styles-module_navItem__1kxtL.styles-module_disabled__1Ltqi {\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n opacity: 0.5; }\n .styles-module_navItem__1kxtL.styles-module_disabled__1Ltqi p {\n font-weight: 400; }\n");var or,ar,sr=Ie(Un||(Un=F([' <svg\n width="15"\n height="15"\n viewBox="0 0 15 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n>\n <rect opacity="0.7" width="15" height="15" rx="7.5" fill="#2ECC71" />\n <path\n d="M9.23107 6.34619L6.96066 8.94234L5.76953 7.58033"\n stroke="white"\n stroke-width="1.2"\n stroke-linecap="round"\n />\n</svg>']))),lr=Ie(Hn||(Hn=F(['\n <svg\n width="15"\n height="15"\n viewBox="0 0 15 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <circle\n cx="7.5"\n cy="7.5"\n r="6.75"\n fill="white"\n stroke="#2ECC71"\n stroke-width="1.5"\n />\n <path\n d="M10.3333 5.5L6.83522 9.5L5 7.40148"\n stroke="#2ECC71"\n stroke-width="1.5"\n stroke-linecap="round"\n />\n </svg>\n']))),ur=function(e){Re(n,e);var t=ir(n);function n(){return z(this,n),t.apply(this,arguments)}return ft(n,[{key:"render",value:function(){var e=this.props,t=e.logoUrl,n=e.isActive,r=void 0!==n&&n,i=e.isCompleted,o=void 0!==i&&i,a=e.isDisabled,s=void 0!==a&&a,l=e.isLastStep,u=void 0!==l&&l,c=e.onClick,d=void 0===c?function(){return null}:c,p=e.showArrow,f=void 0===p||p;return Ie(Bn||(Bn=F(["\n <div\n class=","\n onclick=",'\n tabindex="-1"\n role="button"\n >\n <div class=',">\n <div class=",">\n ","\n ","\n </div>\n <p>","</p>\n ","\n </div>\n </div>\n "])),"".concat($n," ").concat(s?rr:""," ").concat(r?nr:""),d,er,tr,!o||r?Ie(Wn||(Wn=F(["<img src="," />"])),t):sr,u&&lr,this.props.label,!u&&f&&Ie(Jn||(Jn=F(["\n <div class=",'>\n <svg\n width="6"\n height="11"\n viewBox="0 0 6 11"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M0.917969 1.33366L5.08464 5.50033L0.917969 9.66699"\n stroke="#999999"\n stroke-linecap="round"\n />\n </svg>\n </div>\n '])),Xn))}}]),n}(ne);function cr(e,t){nt((function(){var n=function(n){n.target instanceof HTMLElement&&(!e.current||e.current.contains(n.target))||t(n)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),function(){document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}}),[e,t])}var dr,pr,fr,_r,mr,vr=function(e){var t=e.steps,n=e.currentStepIndex,r=e.isPreviewMode,i=e.changeStep,o=rt(),a=rt(),s=Je(tt(!1),2),l=s[0],u=s[1];return cr(o,(function(){return l?u(!1):null})),Ie(or||(or=F(["\n <div class=",">\n <div\n class=","\n ref=","\n onclick=",'\n >\n <svg\n width="16"\n height="17"\n viewBox="0 0 16 17"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M3.60039 9.83213C4.26313 9.83213 4.80039 9.29487 4.80039 8.63213C4.80039 7.96939 4.26313 7.43213 3.60039 7.43213C2.93765 7.43213 2.40039 7.96939 2.40039 8.63213C2.40039 9.29487 2.93765 9.83213 3.60039 9.83213Z"\n fill="#333333"\n />\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M7.60039 9.83213C8.26313 9.83213 8.80039 9.29487 8.80039 8.63213C8.80039 7.96939 8.26313 7.43213 7.60039 7.43213C6.93765 7.43213 6.40039 7.96939 6.40039 8.63213C6.40039 9.29487 6.93765 9.83213 7.60039 9.83213Z"\n fill="#333333"\n />\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M11.6004 9.83213C12.2631 9.83213 12.8004 9.29487 12.8004 8.63213C12.8004 7.96939 12.2631 7.43213 11.6004 7.43213C10.9376 7.43213 10.4004 7.96939 10.4004 8.63213C10.4004 9.29487 10.9376 9.83213 11.6004 9.83213Z"\n fill="#333333"\n />\n </svg>\n </div>\n <div\n ref=','\n class="'," ",'"\n >\n ',"\n </div>\n <div class=",'>\n <svg\n width="6"\n height="11"\n viewBox="0 0 6 11"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M0.917969 1.33366L5.08464 5.50033L0.917969 9.66699"\n stroke="#999999"\n stroke-linecap="round"\n />\n </svg>\n </div>\n </div>\n '])),Gn,Kn,a,(function(){return u(!0)}),o,Zn,l?Yn:"",t.map((function(e){return Ie(ar||(ar=F(["<div class=",">\n <","\n label=","\n logoUrl=","\n isCompleted=","\n isActive=","\n isDisabled=","\n isLastStep=","\n showArrow=","\n onClick=","\n />\n </div>"])),Qn,ur,"CONFIRMATION"!==e.type?e.title:"Confirmation","CONFIRMATION"!==e.type&&e.iconUrl,!r&&e.isCompleted,"CONFIRMATION"!==e.type&&n===e.itemIndex,r&&Number(n)!==e.itemIndex||Number(n)<e.itemIndex,!1,!1,(function(){u(!1),i(e.itemIndex)}))})),Xn)};function hr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hr(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var gr,br,wr,xr,Ir=Me.connect("stepState",Kt)((function(e){var t=rt(),n=e.gotoStep,r=e.stepState,i=r.stepIndex,o=r.steps,a=r.currentStep,s=r.allStepsCompleted,l=at(Bt),u=Vn(t).width,c=function(e,t){var n=Je(tt(e),2),r=n[0],i=n[1];return nt((function(){var n=setTimeout((function(){return i(e)}),t||500);return function(){clearTimeout(n)}}),[e,t]),r}(u,150),d=Je(tt([]),2),p=d[0],f=d[1];nt((function(){var e=0;e=0===c?u:c;var n=[];if(t.current){var r=-1;e/220<=o.length?o.length<=2?n.push({type:"VISIBLE",steps:o.map((function(e){return r+=1,yr(yr({},e),{},{itemIndex:r})}))}):o.length>2&&(r+=1,n.push({type:"VISIBLE",steps:[yr(yr({},o[0]),{},{itemIndex:r})]}),0!==i&&i!==o.length?(i>1&&n.push({type:"COLLAPSED",steps:o.slice(1,i).map((function(e){return r+=1,yr(yr({},e),{},{itemIndex:r})}))}),n.push({type:"VISIBLE",steps:[yr(yr({},o[i]),{},{itemIndex:i})]}),r+=1,o.length-i>1&&n.push({type:"COLLAPSED",steps:o.slice(i+1,o.length).map((function(e){return r+=1,yr(yr({},e),{},{itemIndex:r})}))})):n.push({type:"COLLAPSED",steps:o.slice(1,o.length).map((function(e){return r+=1,yr(yr({},e),{},{itemIndex:r})}))})):n=[{type:"VISIBLE",steps:o.map((function(e,t){return yr(yr({},e),{},{itemIndex:t})}))}]}f(n)}),[o,u,c,i]);var _=function(e){n(e)};return Ie(dr||(dr=F(["\n <div class="," ref=",">\n ","\n ","\n </div>\n "])),qn,t,p.map((function(e){return"VISIBLE"===e.type?e.steps.map((function(e){return Ie(pr||(pr=F(["\n <div\n class=","\n style=","\n >\n <","\n label=","\n logoUrl=","\n isCompleted=","\n isActive=","\n isDisabled=","\n isLastStep=","\n onClick=","\n />\n </div>\n "])),Qn,{maxWidth:220},ur,"CONFIRMATION"!==e.type?e.title:"Confirmation","CONFIRMATION"!==e.type&&e.iconUrl,!(null!=l&&l.isPreviewMode)&&e.isCompleted,"CONFIRMATION"!==(null==a?void 0:a.type)&&"CONFIRMATION"!==e.type&&i===e.itemIndex,!s&&((null==l?void 0:l.isPreviewMode)&&Number(i)!==e.itemIndex||Number(i)<e.itemIndex),e.itemIndex===o.length,(function(){return _(e.itemIndex)}))})):"COLLAPSED"===e.type?Ie(fr||(fr=F(["\n <","\n isPreviewMode=","\n currentStepIndex=","\n changeStep=","\n steps=","\n />\n "])),vr,null==l?void 0:l.isPreviewMode,i,_,e.steps):Ie(_r||(_r=F(["<></>"])))})),p.length>0&&Ie(mr||(mr=F(["\n <",'\n label="Confirmation"\n logoUrl=""\n isCompleted=',"\n isActive=","\n isDisabled=","\n isLastStep=","\n onClick=","\n />\n "])),ur,!0,void 0!==a&&i===o.length,!s&&void 0!==a&&i!==o.length,!0,(function(){var e;return _(null!==(e=o.length)&&void 0!==e?e:0)})))})),kr="styles-module_radio__1wJfU",Cr="styles-module_button__3PLW1",Sr="styles-module_text__Jq7I0",Or="styles-module_description__2UsHV";Qt(".styles-module_radioGroup__1aPpR fieldset {\n border: none;\n padding: 0; }\n\n.styles-module_radio__1wJfU {\n position: relative;\n display: flex;\n align-items: center;\n margin: 10px 0; }\n .styles-module_radio__1wJfU .styles-module_button__3PLW1 {\n position: absolute;\n width: 15px;\n height: 15px;\n left: 0;\n display: inline-block;\n border-radius: 9999px;\n background: transparent; }\n .styles-module_radio__1wJfU .styles-module_button__3PLW1 svg {\n width: 100%;\n height: 100%; }\n .styles-module_radio__1wJfU input[type='radio'] {\n opacity: 0;\n margin: 0; }\n .styles-module_radio__1wJfU label {\n display: flex;\n margin-left: 15px;\n align-items: center;\n cursor: pointer; }\n .styles-module_radio__1wJfU .styles-module_text__Jq7I0 {\n font-style: normal;\n font-weight: normal;\n font-size: 14px;\n margin: 2px 0;\n color: #333333; }\n .styles-module_radio__1wJfU .styles-module_description__2UsHV {\n font-size: 12px;\n line-height: 15px;\n color: #999999; }\n");var Mr,Dr=function(e){var t=e.label,n=e.name,r=e.description,i=void 0===r?null:r,o=e.value,a=e.isChecked,s=void 0!==a&&a,l=e.handleChange,u=void 0===l?function(){return null}:l;return Ie(gr||(gr=F(["\n <div class=",">\n <input\n id=",'\n type="radio"\n name=',"\n value=","\n checked=","\n onclick=","\n />\n <div>\n <label for=",">\n <div class=",">\n ","\n </div>\n <div>\n <div class=",">","</div>\n ","\n </div>\n </label>\n </div>\n </div>\n "])),kr,o,n,o,s,(function(e){if(e.currentTarget instanceof HTMLInputElement){var t=e.currentTarget.value;u(t)}}),o,Cr,Ie(s?br||(br=F(['\n <svg\n width="15"\n height="15"\n viewBox="0 0 15 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M14 7.5C14 11.0899 11.0899 14 7.5 14C3.91015 14 1 11.0899 1 7.5C1 3.91015 3.91015 1 7.5 1C11.0899 1 14 3.91015 14 7.5Z"\n fill="white"\n stroke="#5F4D86"\n stroke-width="2"\n />\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M7.5 11C9.433 11 11 9.433 11 7.5C11 5.567 9.433 4 7.5 4C5.567 4 4 5.567 4 7.5C4 9.433 5.567 11 7.5 11Z"\n fill="#5F4D86"\n />\n </svg>\n '])):wr||(wr=F(['\n <svg\n width="15"\n height="15"\n viewBox="0 0 15 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M14 7.5C14 11.0899 11.0899 14 7.5 14C3.91015 14 1 11.0899 1 7.5C1 3.91015 3.91015 1 7.5 1C11.0899 1 14 3.91015 14 7.5Z"\n fill="white"\n stroke="#E2E0DB"\n stroke-width="2"\n />\n </svg>\n ']))),Sr,t,i&&Ie(xr||(xr=F(["<div class=",">","</div>"])),Or,i))},Tr="styles-module_errorMessage__2b8A_";Qt(".styles-module_errorMessage__2b8A_ {\n margin-top: 4px;\n font-size: 12px;\n color: #f05c42; }\n");var Ar,Rr,Lr,Nr=function(e){var t=e.children;return Ie(Mr||(Mr=F([" <div class=",">","</div> "])),Tr,t)},Pr="styles-module_label__PbFlo",Er="styles-module_required__1XFqi";Qt(".styles-module_label__PbFlo label > div:first-child {\n font-style: normal;\n font-weight: 500;\n font-size: 14px;\n line-height: 17px;\n color: #333333;\n margin-bottom: 5px; }\n\n.styles-module_label__PbFlo label > div:nth-child(2) {\n font-size: 14px;\n line-height: 17px;\n letter-spacing: -0.2px;\n color: #8c8c8c; }\n\n.styles-module_label__PbFlo .styles-module_required__1XFqi {\n color: red;\n font-size: 16px;\n margin-left: 2px; }\n");var jr=function(e){var t=e.title,n=e.description,r=e.isRequired,i=void 0!==r&&r;return Ie(Ar||(Ar=F(["\n <div class=",">\n <label>\n <div>\n ","\n ","\n </div>\n ","\n </label>\n </div>\n "])),Pr,t,i&&Ie(Rr||(Rr=F(["<span class=",">*</span>"])),Er),n&&Ie(Lr||(Lr=F(["<div>","</div>"])),n))},Fr=function(){return!["undefined"==typeof window?"undefined":o(window),"undefined"==typeof document?"undefined":o(document)].includes("undefined")};var zr,Vr,Ur,Hr,Br,Wr,Jr,qr,Gr,Kr,Zr,Yr="styles-module_authSelectorWrap__34g8J",Qr="styles-module_rows__1gpAK",Xr="styles-module_error__aL4zj",$r="styles-module_checkboxRow__3Q67t",ei="styles-module_statusWrap__3amIr",ti="styles-module_deleteIcon__1mAJb",ni="styles-module_status__OwFQa",ri="styles-module_statusRed__1FG13",ii="styles-module_statusOrange__1FNhi",oi="styles-module_statusGreen__1OD_4",ai="styles-module_resend__To8qG";function si(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}Qt(".styles-module_authSelectorWrap__34g8J .styles-module_label__19jW8 {\n font-weight: 800;\n font-size: 14px;\n color: #333333;\n line-height: 20px;\n margin-bottom: 5px; }\n .styles-module_authSelectorWrap__34g8J .styles-module_label__19jW8 span {\n color: #ff4d34;\n margin-left: 2px;\n font-size: 16px; }\n\n.styles-module_authSelectorWrap__34g8J .styles-module_rows__1gpAK {\n margin-top: 10px;\n margin-bottom: 20px; }\n\n.styles-module_authSelectorWrap__34g8J .styles-module_error__aL4zj {\n color: #f05c42; }\n .styles-module_authSelectorWrap__34g8J .styles-module_error__aL4zj button {\n color: #f05c42;\n border-color: #f05c42; }\n\n.styles-module_authSelectorWrap__34g8J .styles-module_errorMessage__3YjSh {\n margin-top: 4px;\n font-size: 12px;\n line-height: 15px;\n letter-spacing: -0.197647px;\n color: #f05c42; }\n\n.styles-module_authSelectorWrap__34g8J .styles-module_description__2c5sj {\n font-size: 14px;\n line-height: 20px;\n color: #8c8c8c;\n margin-bottom: 10px; }\n\n.styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t {\n display: flex;\n align-items: center;\n justify-content: space-between;\n color: #333;\n font-size: 14px;\n min-width: 380px;\n padding-right: 8px; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr {\n display: flex;\n align-items: center;\n font-size: 12px;\n margin-left: 20px; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_deleteIcon__1mAJb {\n padding-left: 8px;\n padding-right: 8px;\n display: flex;\n align-items: center;\n cursor: pointer; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_deleteIcon__1mAJb svg {\n cursor: pointer;\n visibility: hidden;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa {\n position: relative; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa div {\n display: flex;\n align-items: center; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa svg {\n margin-left: 8px; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa .styles-module_statusRed__1FG13,\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa .styles-module_statusOrange__1FNhi,\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa .styles-module_statusGreen__1OD_4 {\n width: 5px;\n height: 5px;\n border-radius: 9999px;\n margin: 0 8px; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa .styles-module_statusRed__1FG13 {\n background: #e26154; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa .styles-module_statusOrange__1FNhi {\n background: #fcc700; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa .styles-module_statusGreen__1OD_4 {\n background: #2ecc71; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa span {\n margin-left: 10px; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa .styles-module_resend__To8qG {\n cursor: pointer; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t:hover .styles-module_statusWrap__3amIr svg {\n visibility: visible;\n -webkit-user-select: auto;\n -ms-user-select: auto;\n user-select: auto; }\n");var li=function(){return Ie(zr||(zr=F(["\n <svg\n class=",'\n width="13"\n height="15"\n viewBox="0 0 13 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M11.8403 5.34L10.1453 6.345C10.5053 6.96 10.7003 7.68 10.7003 8.445C10.7003 10.77 8.81031 12.645 6.50031 12.645C4.19031 12.645 2.30031 10.755 2.30031 8.445C2.30031 6.135 4.19031 4.245 6.50031 4.245V6.15L11.1053 3.27L6.50031 0.375V2.28C3.09531 2.28 0.320312 5.055 0.320312 8.46C0.320313 11.85 3.09531 14.625 6.50031 14.625C9.90531 14.625 12.6803 11.85 12.6803 8.445C12.6803 7.32 12.3653 6.255 11.8403 5.34Z"\n fill="#8D8D8D"\n />\n </svg>\n'])),ai)},ui=function(e){var t=e.label,n=e.name,r=e.value,i=e.isChecked,o=e.status,a=void 0===o?"IDLE":o,s=e.isDeleting,l=void 0!==s&&s,u=e.handleChange,c=e.handleReverify,d=e.handleDelete,p=void 0===d?function(){return null}:d,f=e.error;return Ie(Vr||(Vr=F(["\n <div class=",">\n <","\n label=","\n name=","\n value=","\n isChecked=","\n handleChange=","\n />\n <div class=",">\n <div class=",">\n <div>\n ","\n </div>\n <div>\n ","\n </div>\n <div>\n ","\n </div>\n ","\n ","\n </div>\n <div class="," onclick=",">\n ","\n </div>\n </div>\n </div>\n "])),$r,Dr,t,n,r,i,u,ei,ni,"VERIFYING"===a&&!l&&Ie(Ur||(Ur=F(["<div class="," />\n Verifying <"," /> "])),ii,en),"CONNECTED"===a&&!f&&!l&&Ie(Hr||(Hr=F(["<div class="," />\n Connected"])),oi),"ERROR"===a&&!l&&Ie(Br||(Br=F(["<div class="," />\n Failed\n <div onclick=","><"," /></div>"])),ri,c,li),l&&Ie(Wr||(Wr=F(["<"," />"])),en),f&&!l&&!("VERIFYING"===a)&&Ie(Jr||(Jr=F(["<div class=",">","</div>"])),Xr,f),ti,p,!("VERIFYING"===a||l)&&Ie(qr||(qr=F(['\n <svg\n width="15"\n height="15"\n viewBox="0 0 15 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path d="M1.5 4.1999H13.65" stroke="#F05C42" />\n <path\n d="M11.6254 5.5498V6.2248L10.9504 13.6498H4.20039L3.52539 6.2248V5.5498"\n stroke="#F05C42"\n stroke-linejoin="round"\n />\n <path\n d="M5.55078 3.525V2.175C5.55078 1.80221 5.85299 1.5 6.22578 1.5H8.92578C9.29857 1.5 9.60078 1.80221 9.60078 2.175V3.525"\n stroke="#F05C42"\n />\n </svg>\n ']))))},ci=function(e){Re(n,e);var t=si(n);function n(e){var r;return z(this,n),V(Te(r=t.call(this,e)),"verifyAuth",(function(e,t){var n=r.props.stepId,i=r.props.stepMapping[n].authorizations[e];i&&(i.isVerified?r.props.onAuthSelected(i.authorizationId,!0,!!t):(r.props.toggleVerifyAuthorizationFlag({stepId:n,authId:i.authorizationId,isVerifying:!0}),r.setState({isLoading:!0}),r.props.apiHandler.verifyOAuth(i.authorizationId).then((function(e){e?r.props.onAuthSelected(i.authorizationId,!0,!!t):r.props.onAuthSelected(i.authorizationId,!1,!!t)})).catch((function(e){return console.error(e)})).finally((function(){r.props.toggleVerifyAuthorizationFlag({stepId:n,authId:i.authorizationId,isVerifying:!1}),r.setState({isLoading:!1})}))))})),V(Te(r),"deleteAuth",(function(e){var t=r.props.stepId,n=r.props.stepMapping[t].authorizations[e];r.props.toggleDeleteAuthorizationFlag({stepId:t,authId:n.authorizationId,isDeleting:!0,error:""}),r.props.apiHandler.deleteAuth(n.authorizationId).then((function(e){200===(null==e?void 0:e.status)?r.props.removeAuthorization({stepId:t,authId:n.authorizationId}):405===(null==e?void 0:e.status)?r.props.toggleDeleteAuthorizationFlag({stepId:t,authId:n.authorizationId,isDeleting:!1,error:"".concat(e.data)}):r.props.toggleDeleteAuthorizationFlag({stepId:t,authId:n.authorizationId,isDeleting:!1,error:"An unexpected error occurred"})})).catch((function(e){console.error(e)}))})),V(Te(r),"onAuthResponseReceived",(function(e){void 0!==e&&e.data.activity_name&&(console.info(e.data),r.props.stepId&&(e.data.already_exists?r.props.setStepAuthId({stepId:r.props.stepId,authId:Number(e.data.authorization_id)}):r.props.addAuthorization({stepId:r.props.stepId,authData:{authorizationId:e.data.authorization_id,userIdentity:e.data.user_identity,disableLink:"",authType:"",isVerified:!1,didFetchStatus:!1,isVerifying:!1,isDeleting:!1,error:""}})))})),V(Te(r),"getAuthStatus",(function(e){if(!e)return null;var t="IDLE";return e.isVerified&&e.didFetchStatus&&(t="CONNECTED"),!e.isVerified&&e.didFetchStatus&&(t="ERROR"),e.isVerifying&&(t="VERIFYING"),t})),V(Te(r),"getError",(function(){var e=r.props.stepId,t=r.props.stepMapping[e];return t.authorizations?"Please select a valid ".concat(t.step.activity.app.name," account"):"Please add a valid ".concat(t.step.activity.app.name," account")})),V(Te(r),"openAuthWindow",(function(){var e=r.props,t=e.stepMapping[e.stepId].step;t&&function(e,t,n,r,i){if(n.top){var o=n.top.outerHeight/2+n.top.screenY-i/2,a=n.top.outerWidth/2+n.top.screenX-r/2;return n.open(e,t,"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=".concat(r,", height=").concat(i,", top=").concat(o,", left=").concat(a))}}(r.context.apiHandler.getAuthUrl(t.authorization_type.id),"Auth Window",window,800,600)})),r.state={isLoading:!1,fetched:!1},r}return ft(n,[{key:"componentDidMount",value:function(){Fr()&&window.addEventListener("message",this.onAuthResponseReceived);var e=this.props,t=e.stepId,n=e.stepMapping,r=n[t].selectedAuthId,i=n[t].authorizations.findIndex((function(e){return e.authorizationId===r}));n[t].selectedAuthId&&"IDLE"===this.getAuthStatus(n[t].authorizations[i])&&this.verifyAuth(i,!0)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.stepId,r=t.stepMapping,i=r[n],o=i.selectedAuthId,a=r[n].authorizations.findIndex((function(e){return e.authorizationId===o}));o!==e.stepMapping[n].selectedAuthId&&a&&this.verifyAuth(a),i.authorizations.length===e.stepMapping[n].authorizations.length+1&&this.verifyAuth(i.authorizations.length-1)}},{key:"componentWillUnmount",value:function(){Fr()&&window.removeEventListener("message",this.onAuthResponseReceived)}},{key:"render",value:function(){var e=this,t=this.props,n=t.stepId,r=t.showErrors,i=void 0!==r&&r,o=this.props.stepMapping[n],a=o.authorizations;return Ie(Gr||(Gr=F(["\n <div class=",">\n <",'\n title="Connect account"\n description=',"\n isRequired=","\n />\n <div class=",">\n ","\n </div>\n <div class=",">\n <","\n onClick=","\n label=","\n type=","\n disabled=","\n >\n <//>\n </div>\n ","\n </div>\n "])),Yr,jr,"Select your ".concat(o.step.activity.app.name," account"),!0,Qr,a.map((function(t,n){return Ie(Kr||(Kr=F(["<","\n label=","\n value=","\n status=","\n isChecked=","\n isDeleting=","\n error=","\n handleChange=","\n handleReverify=","\n handleDelete=","\n />"])),ui,t.userIdentity,t.authorizationId,e.getAuthStatus(t),t.authorizationId===o.selectedAuthId,t.isDeleting,t.error,(function(){return e.verifyAuth(n)}),(function(){return e.verifyAuth(n)}),(function(){return e.deleteAuth(n)}))})),i?"".concat(Xr):"",Ln,(function(){return e.openAuthWindow()}),"Add ".concat(o.step.activity.app.name," account"),Cn.SECONDARY,this.state.isLoading,i&&Ie(Zr||(Zr=F(["<",">","<//>"])),Nr,this.getError()))}}]),n}(ne);V(ci,"contextType",Bt);var di,pi,fi=Me.connect(["stepMapping"],Kt)(ci),_i=Se((function(e,t){e.exports=function(){function e(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var t=Object.hasOwnProperty,n=Object.setPrototypeOf,r=Object.isFrozen,i=Object.getPrototypeOf,a=Object.getOwnPropertyDescriptor,s=Object.freeze,l=Object.seal,u=Object.create,c="undefined"!=typeof Reflect&&Reflect,d=c.apply,p=c.construct;d||(d=function(e,t,n){return e.apply(t,n)}),s||(s=function(e){return e}),l||(l=function(e){return e}),p||(p=function(t,n){return new(Function.prototype.bind.apply(t,[null].concat(e(n))))});var f=I(Array.prototype.forEach),_=I(Array.prototype.pop),m=I(Array.prototype.push),v=I(String.prototype.toLowerCase),h=I(String.prototype.match),y=I(String.prototype.replace),g=I(String.prototype.indexOf),b=I(String.prototype.trim),w=I(RegExp.prototype.test),x=k(TypeError);function I(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return d(e,t,r)}}function k(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return p(e,n)}}function C(e,t){n&&n(e,null);for(var i=t.length;i--;){var o=t[i];if("string"==typeof o){var a=v(o);a!==o&&(r(t)||(t[i]=a),o=a)}e[o]=!0}return e}function S(e){var n=u(null),r=void 0;for(r in e)d(t,e,[r])&&(n[r]=e[r]);return n}function O(e,t){for(;null!==e;){var n=a(e,t);if(n){if(n.get)return I(n.get);if("function"==typeof n.value)return I(n.value)}e=i(e)}function r(e){return console.warn("fallback value for",e),null}return r}var M=s(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),D=s(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),T=s(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),A=s(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),R=s(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),L=s(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),N=s(["#text"]),P=s(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),E=s(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),j=s(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=s(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),z=l(/\{\{[\s\S]*|[\s\S]*\}\}/gm),V=l(/<%[\s\S]*|[\s\S]*%>/gm),U=l(/^data-[\-\w.\u00B7-\uFFFF]/),H=l(/^aria-[\-\w]+$/),B=l(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),W=l(/^(?:\w+script|data):/i),J=l(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),q="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)};function G(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var K=function(){return"undefined"==typeof window?null:window},Z=function(e,t){if("object"!==(void 0===e?"undefined":q(e))||"function"!=typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(r)&&(n=t.currentScript.getAttribute(r));var i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function Y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K(),t=function(e){return Y(e)};if(t.version="2.3.1",t.removed=[],!e||!e.document||9!==e.document.nodeType)return t.isSupported=!1,t;var n=e.document,r=e.document,i=e.DocumentFragment,o=e.HTMLTemplateElement,a=e.Node,l=e.Element,u=e.NodeFilter,c=e.NamedNodeMap,d=void 0===c?e.NamedNodeMap||e.MozNamedAttrMap:c,p=e.Text,I=e.Comment,k=e.DOMParser,Q=e.trustedTypes,X=l.prototype,$=O(X,"cloneNode"),ee=O(X,"nextSibling"),te=O(X,"childNodes"),ne=O(X,"parentNode");if("function"==typeof o){var re=r.createElement("template");re.content&&re.content.ownerDocument&&(r=re.content.ownerDocument)}var ie=Z(Q,n),oe=ie&&je?ie.createHTML(""):"",ae=r,se=ae.implementation,le=ae.createNodeIterator,ue=ae.createDocumentFragment,ce=ae.getElementsByTagName,de=n.importNode,pe={};try{pe=S(r).documentMode?r.documentMode:{}}catch(e){}var fe={};t.isSupported="function"==typeof ne&&se&&void 0!==se.createHTMLDocument&&9!==pe;var _e=z,me=V,ve=U,he=H,ye=W,ge=J,be=B,we=null,xe=C({},[].concat(G(M),G(D),G(T),G(R),G(N))),Ie=null,ke=C({},[].concat(G(P),G(E),G(j),G(F))),Ce=null,Se=null,Oe=!0,Me=!0,De=!1,Te=!1,Ae=!1,Re=!1,Le=!1,Ne=!1,Pe=!1,Ee=!0,je=!1,Fe=!0,ze=!0,Ve=!1,Ue={},He=null,Be=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),We=null,Je=C({},["audio","video","img","source","image","track"]),qe=null,Ge=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ke="http://www.w3.org/1998/Math/MathML",Ze="http://www.w3.org/2000/svg",Ye="http://www.w3.org/1999/xhtml",Qe=Ye,Xe=!1,$e=null,et=r.createElement("form"),tt=function(e){$e&&$e===e||(e&&"object"===(void 0===e?"undefined":q(e))||(e={}),e=S(e),we="ALLOWED_TAGS"in e?C({},e.ALLOWED_TAGS):xe,Ie="ALLOWED_ATTR"in e?C({},e.ALLOWED_ATTR):ke,qe="ADD_URI_SAFE_ATTR"in e?C(S(Ge),e.ADD_URI_SAFE_ATTR):Ge,We="ADD_DATA_URI_TAGS"in e?C(S(Je),e.ADD_DATA_URI_TAGS):Je,He="FORBID_CONTENTS"in e?C({},e.FORBID_CONTENTS):Be,Ce="FORBID_TAGS"in e?C({},e.FORBID_TAGS):{},Se="FORBID_ATTR"in e?C({},e.FORBID_ATTR):{},Ue="USE_PROFILES"in e&&e.USE_PROFILES,Oe=!1!==e.ALLOW_ARIA_ATTR,Me=!1!==e.ALLOW_DATA_ATTR,De=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=e.SAFE_FOR_TEMPLATES||!1,Ae=e.WHOLE_DOCUMENT||!1,Ne=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,Ee=!1!==e.RETURN_DOM_IMPORT,je=e.RETURN_TRUSTED_TYPE||!1,Le=e.FORCE_BODY||!1,Fe=!1!==e.SANITIZE_DOM,ze=!1!==e.KEEP_CONTENT,Ve=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||be,Qe=e.NAMESPACE||Ye,Te&&(Me=!1),Pe&&(Ne=!0),Ue&&(we=C({},[].concat(G(N))),Ie=[],!0===Ue.html&&(C(we,M),C(Ie,P)),!0===Ue.svg&&(C(we,D),C(Ie,E),C(Ie,F)),!0===Ue.svgFilters&&(C(we,T),C(Ie,E),C(Ie,F)),!0===Ue.mathMl&&(C(we,R),C(Ie,j),C(Ie,F))),e.ADD_TAGS&&(we===xe&&(we=S(we)),C(we,e.ADD_TAGS)),e.ADD_ATTR&&(Ie===ke&&(Ie=S(Ie)),C(Ie,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&C(qe,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(He===Be&&(He=S(He)),C(He,e.FORBID_CONTENTS)),ze&&(we["#text"]=!0),Ae&&C(we,["html","head","body"]),we.table&&(C(we,["tbody"]),delete Ce.tbody),s&&s(e),$e=e)},nt=C({},["mi","mo","mn","ms","mtext"]),rt=C({},["foreignobject","desc","title","annotation-xml"]),it=C({},D);C(it,T),C(it,A);var ot=C({},R);C(ot,L);var at=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:Ye,tagName:"template"});var n=v(e.tagName),r=v(t.tagName);if(e.namespaceURI===Ze)return t.namespaceURI===Ye?"svg"===n:t.namespaceURI===Ke?"svg"===n&&("annotation-xml"===r||nt[r]):Boolean(it[n]);if(e.namespaceURI===Ke)return t.namespaceURI===Ye?"math"===n:t.namespaceURI===Ze?"math"===n&&rt[r]:Boolean(ot[n]);if(e.namespaceURI===Ye){if(t.namespaceURI===Ze&&!rt[r])return!1;if(t.namespaceURI===Ke&&!nt[r])return!1;var i=C({},["title","style","font","a","script"]);return!ot[n]&&(i[n]||!it[n])}return!1},st=function(e){m(t.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=oe}catch(t){e.remove()}}},lt=function(e,n){try{m(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch(e){m(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),"is"===e&&!Ie[e])if(Ne||Pe)try{st(n)}catch(e){}else try{n.setAttribute(e,"")}catch(e){}},ut=function(e){var t=void 0,n=void 0;if(Le)e="<remove></remove>"+e;else{var i=h(e,/^[\r\n\t ]+/);n=i&&i[0]}var o=ie?ie.createHTML(e):e;if(Qe===Ye)try{t=(new k).parseFromString(o,"text/html")}catch(e){}if(!t||!t.documentElement){t=se.createDocument(Qe,"template",null);try{t.documentElement.innerHTML=Xe?"":o}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),Qe===Ye?ce.call(t,Ae?"html":"body")[0]:Ae?t.documentElement:a},ct=function(e){return le.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},dt=function(e){return!(e instanceof p||e instanceof I||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof d&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},pt=function(e){return"object"===(void 0===a?"undefined":q(a))?e instanceof a:e&&"object"===(void 0===e?"undefined":q(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},ft=function(e,n,r){fe[e]&&f(fe[e],(function(e){e.call(t,n,r,$e)}))},_t=function(e){var n=void 0;if(ft("beforeSanitizeElements",e,null),dt(e))return st(e),!0;if(h(e.nodeName,/[\u0080-\uFFFF]/))return st(e),!0;var r=v(e.nodeName);if(ft("uponSanitizeElement",e,{tagName:r,allowedTags:we}),!pt(e.firstElementChild)&&(!pt(e.content)||!pt(e.content.firstElementChild))&&w(/<[/\w]/g,e.innerHTML)&&w(/<[/\w]/g,e.textContent))return st(e),!0;if("select"===r&&w(/<template/i,e.innerHTML))return st(e),!0;if(!we[r]||Ce[r]){if(ze&&!He[r]){var i=ne(e)||e.parentNode,o=te(e)||e.childNodes;if(o&&i)for(var a=o.length-1;a>=0;--a)i.insertBefore($(o[a],!0),ee(e))}return st(e),!0}return e instanceof l&&!at(e)?(st(e),!0):"noscript"!==r&&"noembed"!==r||!w(/<\/no(script|embed)/i,e.innerHTML)?(Te&&3===e.nodeType&&(n=e.textContent,n=y(n,_e," "),n=y(n,me," "),e.textContent!==n&&(m(t.removed,{element:e.cloneNode()}),e.textContent=n)),ft("afterSanitizeElements",e,null),!1):(st(e),!0)},mt=function(e,t,n){if(Fe&&("id"===t||"name"===t)&&(n in r||n in et))return!1;if(Me&&!Se[t]&&w(ve,t));else if(Oe&&w(he,t));else{if(!Ie[t]||Se[t])return!1;if(qe[t]);else if(w(be,y(n,ge,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==g(n,"data:")||!We[e])if(De&&!w(ye,y(n,ge,"")));else if(n)return!1}return!0},vt=function(e){var n=void 0,r=void 0,i=void 0,o=void 0;ft("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ie};for(o=a.length;o--;){var l=n=a[o],u=l.name,c=l.namespaceURI;if(r=b(n.value),i=v(u),s.attrName=i,s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,ft("uponSanitizeAttribute",e,s),r=s.attrValue,!s.forceKeepAttr&&(lt(u,e),s.keepAttr))if(w(/\/>/i,r))lt(u,e);else{Te&&(r=y(r,_e," "),r=y(r,me," "));var d=e.nodeName.toLowerCase();if(mt(d,i,r))try{c?e.setAttributeNS(c,u,r):e.setAttribute(u,r),_(t.removed)}catch(e){}}}ft("afterSanitizeAttributes",e,null)}},ht=function e(t){var n=void 0,r=ct(t);for(ft("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)ft("uponSanitizeShadowNode",n,null),_t(n)||(n.content instanceof i&&e(n.content),vt(n));ft("afterSanitizeShadowDOM",t,null)};return t.sanitize=function(r,o){var s=void 0,l=void 0,u=void 0,c=void 0,d=void 0;if((Xe=!r)&&(r="\x3c!--\x3e"),"string"!=typeof r&&!pt(r)){if("function"!=typeof r.toString)throw x("toString is not a function");if("string"!=typeof(r=r.toString()))throw x("dirty is not a string, aborting")}if(!t.isSupported){if("object"===q(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof r)return e.toStaticHTML(r);if(pt(r))return e.toStaticHTML(r.outerHTML)}return r}if(Re||tt(o),t.removed=[],"string"==typeof r&&(Ve=!1),Ve);else if(r instanceof a)1===(l=(s=ut("\x3c!----\x3e")).ownerDocument.importNode(r,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?s=l:s.appendChild(l);else{if(!Ne&&!Te&&!Ae&&-1===r.indexOf("<"))return ie&&je?ie.createHTML(r):r;if(!(s=ut(r)))return Ne?null:oe}s&&Le&&st(s.firstChild);for(var p=ct(Ve?r:s);u=p.nextNode();)3===u.nodeType&&u===c||_t(u)||(u.content instanceof i&&ht(u.content),vt(u),c=u);if(c=null,Ve)return r;if(Ne){if(Pe)for(d=ue.call(s.ownerDocument);s.firstChild;)d.appendChild(s.firstChild);else d=s;return Ee&&(d=de.call(n,d,!0)),d}var f=Ae?s.outerHTML:s.innerHTML;return Te&&(f=y(f,_e," "),f=y(f,me," ")),ie&&je?ie.createHTML(f):f},t.setConfig=function(e){tt(e),Re=!0},t.clearConfig=function(){$e=null,Re=!1},t.isValidAttribute=function(e,t,n){$e||tt({});var r=v(e),i=v(t);return mt(r,i,n)},t.addHook=function(e,t){"function"==typeof t&&(fe[e]=fe[e]||[],m(fe[e],t))},t.removeHook=function(e){fe[e]&&_(fe[e])},t.removeHooks=function(e){fe[e]&&(fe[e]=[])},t.removeAllHooks=function(){fe={}},t}return Y()}()})),mi="styles-module_listboxGroupWrapper__1Kt5M",vi="styles-module_listbox__2x2uP",hi="styles-module_customSelect__3d-hM",yi="styles-module_open__2fBAx",gi="styles-module_customOptions__3iNrM",bi="styles-module_customSelectTrigger__2MlIG",wi="styles-module_selected__nLzUy",xi="styles-module_error__2KcSW",Ii="styles-module_arrow__TPQOZ",ki="styles-module_close__3wlz1",Ci="styles-module_listboxItem__2jMpi";Qt(".styles-module_listboxGroupWrapper__1Kt5M fieldset {\n margin: 0;\n padding: 0;\n border: none; }\n\n.styles-module_listbox__2x2uP {\n position: relative;\n max-width: 285px;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n padding-top: 10px; }\n .styles-module_listbox__2x2uP .styles-module_customSelect__3d-hM {\n position: relative;\n display: flex;\n flex-direction: column;\n font-size: 14px;\n letter-spacing: -0.197647px;\n color: #999999; }\n .styles-module_listbox__2x2uP .styles-module_customSelect__3d-hM.styles-module_open__2fBAx .styles-module_customOptions__3iNrM {\n opacity: 1;\n visibility: visible;\n pointer-events: auto; }\n .styles-module_listbox__2x2uP .styles-module_customSelectTrigger__2MlIG {\n position: relative;\n display: flex;\n align-items: center;\n box-sizing: border-box;\n height: 35px;\n padding: 0 10px;\n justify-content: space-between;\n cursor: pointer;\n font-size: 14px;\n border: 1px solid #e2e0db;\n border-radius: 4px; }\n .styles-module_listbox__2x2uP .styles-module_customSelectTrigger__2MlIG span {\n display: flex;\n align-items: center;\n height: 100%;\n padding-right: 10px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis; }\n .styles-module_listbox__2x2uP .styles-module_customSelectTrigger__2MlIG span.styles-module_selected__nLzUy {\n color: #333333; }\n .styles-module_listbox__2x2uP .styles-module_customSelectTrigger__2MlIG:focus {\n outline: none; }\n .styles-module_listbox__2x2uP .styles-module_customSelectTrigger__2MlIG.styles-module_error__2KcSW {\n border-color: #f05c42; }\n .styles-module_listbox__2x2uP .styles-module_customSelectTrigger__2MlIG .styles-module_arrow__TPQOZ {\n transform: rotate(0);\n transition-property: transform;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms; }\n .styles-module_listbox__2x2uP .styles-module_customSelectTrigger__2MlIG .styles-module_arrow__TPQOZ.styles-module_close__3wlz1 {\n transform: rotate(180deg); }\n .styles-module_listbox__2x2uP .styles-module_customOptions__3iNrM {\n position: absolute;\n top: 100%;\n left: 0px;\n right: 0px;\n z-index: 10;\n margin-top: 0.5rem;\n display: block;\n overflow: hidden;\n background-color: #fff;\n font-size: 0.875rem;\n line-height: 1.25rem;\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n pointer-events: none;\n visibility: hidden;\n max-height: 12rem;\n min-height: 100%;\n overflow: auto;\n border-width: 1px;\n border-style: solid;\n border-color: #e2e0db;\n opacity: 0;\n border-radius: 4px; }\n\n.styles-module_listboxItem__2jMpi {\n position: relative;\n display: block;\n cursor: pointer;\n border-width: 0px;\n border-bottom-width: 1px;\n border-style: solid;\n border-color: #e2e0db;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n padding-left: 2.5rem;\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n padding-right: 10px; }\n .styles-module_listboxItem__2jMpi svg {\n position: absolute;\n height: 100%;\n width: 12px;\n left: 16px;\n top: 0; }\n .styles-module_listboxItem__2jMpi:last-child {\n border: none; }\n .styles-module_listboxItem__2jMpi:hover {\n color: #333;\n background: #ececec; }\n .styles-module_listboxItem__2jMpi.styles-module_selected__nLzUy {\n color: #333;\n font-weight: 500; }\n");var Si,Oi,Mi,Di,Ti,Ai,Ri,Li,Ni,Pi,Ei,ji,Fi,zi,Vi,Ui,Hi,Bi,Wi,Ji=function(e){var t=e.id,n=e.value,r=e.isSelected,i=e.onClick;return Ie(di||(di=F(["\n <span\n class=","\n data-value=","\n onclick=","\n >\n ","\n ","\n </span>\n "])),"".concat(Ci," ").concat(r?wi:""),t,i,r&&Ie(pi||(pi=F(['\n <svg\n width="7"\n height="7"\n viewBox="0 0 7 7"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n stroke="#333"\n >\n <path\n d="M6.33333 1.5L2.83522 5.5L1 3.40148"\n stroke-width="1.2"\n stroke-linecap="round"\n />\n </svg>\n ']))),n)},qi=function(e){var t=e.title,n=e.description,r=e.items,i=void 0===r?[]:r,o=e.value,a=void 0===o?null:o,s=e.isOpen,l=void 0!==s&&s,u=e.isDynamic,c=void 0!==u&&u,d=e.endpointData,p=e.isRequired,f=void 0!==p&&p,_=e.placeholder,m=e.onChange,v=void 0===m?function(){return null}:m,h=e.showStepValidation,y=void 0!==h&&h,g=e.responseMapper,b=void 0===g?function(e){return e}:g,w=Je(tt(i),2),x=w[0],I=w[1],k=Je(tt(c&&!i.length&&!a),2),C=k[0],S=k[1],O=Je(tt(l),2),M=O[0],D=O[1],T=rt();cr(T,(function(){return M&&D(!1)})),nt((function(){var t=e.apiHandler,n=e.isDynamic,r=e.endpointUrl;if(n&&r){var i;S(!0);try{i=JSON.parse(d)}catch(e){i=""}t.callDynamicDataEndpoint(new URL(r),i).then((function(e){S(!1),e&&I(b(e))}))}}),[d]);var A=function(){D((function(e){return!e}))},R=it((function(){var e=x.findIndex((function(e){return e.id===a}));return e>-1?x[e].value:"Please Select..."}),[x,a]);return Ie(Si||(Si=F(["\n <div ref=",' class="','">\n <fieldset>\n ',"\n <div class=",">\n <div\n class=","\n >\n <div\n class=",'\n role="button"\n tabindex=',"\n onclick=","\n onkeyup=","\n >\n <span class=",">\n ","\n </span>\n\n <div ref=",' style="display: flex;">\n ',"\n </div>\n </div>\n <div class=",">\n ","\n </div>\n </div>\n ","\n </div>\n </fieldset>\n </div>\n "])),T,mi,t&&Ie(Oi||(Oi=F(["\n <","\n title=","\n description=","\n isRequired=","\n />\n "])),jr,t,n,f),vi,"".concat(hi," ").concat(M?yi:""),"".concat(bi," ").concat(y&&!a&&f&&!M&&xi),0,A,(function(e){"Enter"===e.key&&A()}),a&&wi,C?Ie(Mi||(Mi=F(["Loading"]))):Ie(Di||(Di=F(["\n ","\n "])),x.length>0?Ie(Ti||(Ti=F(["\n ","\n "])),a?Ie(Ai||(Ai=F(["",""])),R):Ie(Ri||(Ri=F(["",""])),_||"Please Select...")):Ie(Li||(Li=F(["No options"])))),T,C?Ie(Ni||(Ni=F(["<","><//>"])),en):Ie(Pi||(Pi=F(["\n <div\n class=",'\n >\n <svg\n width="12"\n height="8"\n viewBox="0 0 12 8"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M11 1.5L6 6.5L1 1.5"\n stroke="#999999"\n stroke-width="2"\n stroke-linecap="round"\n />\n </svg>\n </div>\n '])),"".concat(Ii," ").concat(M?ki:"")),gi,x.length>0&&!C&&Ie(Ei||(Ei=F(["\n ","\n "])),x.map((function(e){return Ie(ji||(ji=F(["\n <","\n key=","\n id=","\n value=","\n isSelected=","\n onClick=","\n ><//>\n "])),Ji,e.id,e.id,e.value,a===e.id,(function(){v(e.id),D(!1)}))}))),y&&!a&&!M&&f&&Ie(Fi||(Fi=F([" <",">Please select an option</",">"])),Nr,Nr))},Gi="styles-module_checkboxWrap__JzZMA",Ki="styles-module_checkbox__3mvqm",Zi="styles-module_button__2oPQ0",Yi="styles-module_text__1AHNH",Qi="styles-module_description__3Ox13";Qt(".styles-module_checkboxGroup__2u-bL fieldset {\n border: none;\n padding: 0; }\n\n.styles-module_checkboxWrap__JzZMA {\n margin-bottom: 22px; }\n\n.styles-module_checkbox__3mvqm {\n position: relative;\n display: flex;\n margon-bottom: 2px;\n align-items: center;\n margin-top: 12px; }\n .styles-module_checkbox__3mvqm .styles-module_button__2oPQ0 {\n display: block;\n height: 20px;\n width: 20px;\n background-color: transparent; }\n .styles-module_checkbox__3mvqm input[type='checkbox'] {\n opacity: 0;\n margin: 0;\n display: none; }\n .styles-module_checkbox__3mvqm label {\n display: flex;\n flex: 1;\n cursor: pointer;\n font-size: 14px;\n color: #333333; }\n .styles-module_checkbox__3mvqm .styles-module_text__1AHNH {\n display: flex;\n color: #333;\n font-size: 14px;\n padding-left: 10px;\n font-weight: 400;\n line-height: 26px;\n margin-top: -2px; }\n .styles-module_checkbox__3mvqm .styles-module_description__3Ox13 {\n font-size: 12px;\n color: #222; }\n");var Xi,$i=function(e){var t=e.label,n=e.name,r=e.description,i=void 0===r?null:r,o=e.value,a=e.isRequired,s=void 0!==a&&a,l=e.isChecked,u=void 0!==l&&l,c=e.showStepValidation,d=void 0!==c&&c,p=e.handleChange,f=void 0===p?function(){return null}:p;return Ie(zi||(zi=F(["\n <div class=",">\n <div class=",">\n <label for=",">\n <input\n id=",'\n type="checkbox"\n name=',"\n value=","\n checked=","\n onclick=","\n />\n <div class=",">\n ","\n </div>\n <div>\n <div class=",">\n ","\n </div>\n ","\n </div>\n </label>\n </div>\n ","\n </div>\n "])),Gi,Ki,n,n,n,o,u,(function(e){if(e.target instanceof HTMLInputElement){var t=e.target,n=t.id,r=t.checked;f(n,r)}}),Zi,Ie(u?Vi||(Vi=F(['\n <svg\n width="20"\n height="20"\n viewBox="0 0 20 20"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M7.86364 15.5L10 13.4923L17.5 6.49357L15.3485 4.5L7.86364 11.4987L4.63636 8.50129L2.5 10.4949L5.71212 13.4923L7.86364 15.5Z"\n fill="#5F4D86"\n />\n <path\n d="M0 0V-2H-2V0H0ZM20 0H22V-2H20V0ZM20 20V22H22V20H20ZM0 20H-2V22H0V20ZM0 2H20V-2H0V2ZM18 0V20H22V0H18ZM20 18H0V22H20V18ZM2 20V0H-2V20H2Z"\n fill="#5F4D86"\n />\n </svg>\n '])):Ui||(Ui=F(['\n <svg\n width="20"\n height="20"\n viewBox="0 0 20 20"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M0 0V-2H-2V0H0ZM20 0H22V-2H20V0ZM20 20V22H22V20H20ZM0 20H-2V22H0V20ZM0 2H20V-2H0V2ZM18 0V20H22V0H18ZM20 18H0V22H20V18ZM2 20V0H-2V20H2Z"\n fill="#5F4D86"\n />\n </svg>\n ']))),Yi,t.map((function(e){return Ie(Hi||(Hi=F(["",""])),e.value)})),i&&Ie(Bi||(Bi=F(["<div class=",">","</div>"])),Qi,i),d&&!o&&s&&Ie(Wi||(Wi=F([" <",">Please select an option</",">"])),Nr,Nr))},eo="styles-module_loader__1RKKC";Qt(".styles-module_loader__1RKKC {\n animation-name: styles-module_ckw__i9e23;\n animation-duration: 1s;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n transform-origin: 50% 50%; }\n\n@keyframes styles-module_ckw__i9e23 {\n 0% {\n transform: rotate(0deg); }\n 100% {\n transform: rotate(360deg); } }\n");var to,no,ro,io,oo,ao=function(){return Ie(Xi||(Xi=F(["\n <svg\n class=",'\n width="26"\n height="25"\n viewBox="0 0 26 25"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M15.7173 0.29892C13.1175 -0.280085 10.4006 -0.0135017 7.96294 1.0598C5.52524 2.13311 3.49412 3.95702 2.16568 6.26562C0.837246 8.57421 0.280965 11.2468 0.57794 13.8937C0.874915 16.5406 2.00962 19.0235 3.81662 20.9803C5.62362 22.9371 8.00843 24.2656 10.6234 24.772C13.2383 25.2784 15.9466 24.9363 18.3535 23.7956C20.7604 22.6548 22.74 20.7751 24.0036 18.4304C25.2673 16.0857 25.749 13.3987 25.3785 10.7611L24.1406 10.935C24.4741 13.3088 24.0406 15.7272 22.9033 17.8374C21.766 19.9476 19.9844 21.6393 17.8182 22.666C15.652 23.6927 13.2145 24.0006 10.861 23.5448C8.50758 23.089 6.36125 21.8934 4.73495 20.1323C3.10866 18.3711 2.08742 16.1366 1.82015 13.7543C1.55287 11.3721 2.05352 8.96679 3.24911 6.88905C4.44471 4.81132 6.27272 3.1698 8.46665 2.20382C10.6606 1.23785 13.1057 0.997923 15.4456 1.51903L15.7173 0.29892Z"\n fill="#EFEFEF"\n />\n <path\n d="M25.3833 10.7959C25.0346 8.26181 23.9168 5.8957 22.1808 4.01695C20.4449 2.13819 18.1743 0.83725 15.6756 0.289715L15.4081 1.51074C17.6569 2.00353 19.7004 3.17437 21.2628 4.86525C22.8251 6.55613 23.8311 8.68563 24.145 10.9663L25.3833 10.7959Z"\n fill="#C4C4C4"\n />\n </svg>\n'])),eo)},so="styles-module_selectWrapper__wU7p8",lo="styles-module_selectedVal__11vC7";Qt(".styles-module_selectWrapper__wU7p8 {\n position: relative;\n width: 100%; }\n .styles-module_selectWrapper__wU7p8 fieldset {\n padding: 0;\n margin: 0;\n border: none; }\n .styles-module_selectWrapper__wU7p8 select {\n width: 100%;\n color: #999999;\n position: relative;\n font-size: 14px;\n -webkit-appearance: none;\n appearance: none;\n padding: 8.5px 14px;\n padding-right: 28px;\n border-radius: 4px;\n border: 1px solid #e2e0db;\n outline: none;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis; }\n .styles-module_selectWrapper__wU7p8 select:focus {\n outline: none; }\n .styles-module_selectWrapper__wU7p8 select.styles-module_selectedVal__11vC7 {\n color: #333; }\n .styles-module_selectWrapper__wU7p8 svg {\n position: absolute;\n right: 10px;\n top: 13px; }\n");var uo,co,po,fo,_o,mo,vo,ho=function(e){var t=e.placeholder,n=e.ariaLabel,r=e.value,i=e.options,o=void 0===i?[]:i,a=e.showUnselectedValue,s=void 0!==a&&a,l=e.unselectedText,u=void 0===l?"Select a value":l,c=e.isRequired,d=void 0!==c&&c,p=e.showStepValidation,f=void 0!==p&&p,_=e.onChange,m=void 0===_?function(){return null}:_;return Ie(to||(to=F(["\n <div class=",">\n <select\n aria-label=","\n onchange=","\n class=","\n >\n ","\n ","\n ",'\n </select>\n <svg\n width="12"\n height="8"\n viewBox="0 0 12 8"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M11 1.5L6 6.5L1 1.5"\n stroke="#999999"\n stroke-width="2"\n stroke-linecap="round"\n />\n </svg>\n </div>\n ',"\n "])),so,n,(function(e){if(e.currentTarget instanceof HTMLSelectElement){var t=e.currentTarget.value,n=o.findIndex((function(e){return"".concat(e.key)==="".concat(t)}));m(n)}}),r&&lo,s&&Ie(no||(no=F([' <option value="">',"</option> "])),u),void 0===r&&Ie(ro||(ro=F(['\n <option value="" disabled selected hidden>',"</option>\n "])),t),o.map((function(e){return Ie(io||(io=F(["\n <option value="," selected=",">\n ","\n </option>\n "])),e.key,r===e.key,e.label)})),d&&!r&&f&&Ie(oo||(oo=F(["<",">Please map this required field<//>"])),Nr))},yo="styles-module_mappingWrap__cU3_M",go="styles-module_mappingInfo__2Nvsw",bo="styles-module_mappingRow__LbAkF",wo="styles-module_loader__3uPJj",xo="styles-module_title__3EC37",Io="styles-module_sampleData__ZpCR2",ko="styles-module_selectBox__2gn7w",Co="styles-module_mappingHeaderItem__3Ue0A";function So(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Oo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?So(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):So(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Qt(".styles-module_mappingWrap__cU3_M .styles-module_mappingInfo__2Nvsw {\n margin-top: 20px;\n display: flex;\n justify-content: flex-end;\n font-size: 10px;\n line-height: 12px;\n display: flex;\n align-items: center;\n letter-spacing: 0.1px;\n color: #999999; }\n .styles-module_mappingWrap__cU3_M .styles-module_mappingInfo__2Nvsw > :not(:last-child) {\n margin-right: 20px; }\n .styles-module_mappingWrap__cU3_M .styles-module_mappingInfo__2Nvsw > div {\n margin-right: 7px; }\n .styles-module_mappingWrap__cU3_M .styles-module_mappingInfo__2Nvsw > div > span:first-child {\n color: #333333;\n margin: 0;\n margin-right: 3px; }\n\n.styles-module_mappingWrap__cU3_M .styles-module_mappingRow__LbAkF:first-child {\n padding-top: 0;\n padding-bottom: 5px;\n height: 60px;\n font-style: normal;\n font-weight: normal;\n font-size: 14px;\n letter-spacing: 0.1px;\n color: #333333; }\n\n.styles-module_loader__3uPJj {\n margin-top: 35px;\n margin-bottom: -60px;\n display: flex;\n justify-content: center; }\n\n.styles-module_mappingRow__LbAkF {\n display: flex;\n box-sizing: content-box;\n align-items: center;\n justify-content: space-between;\n background-color: #fff;\n padding-left: 10px;\n padding-right: 10px;\n height: 90px; }\n .styles-module_mappingRow__LbAkF .styles-module_title__3EC37 {\n width: 40%;\n padding-right: 4px;\n font-weight: 500;\n font-size: 14px;\n color: #333333;\n padding-right: 10px;\n line-height: 18px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis; }\n .styles-module_mappingRow__LbAkF .styles-module_title__3EC37 span {\n color: red;\n font-size: 16px;\n margin-left: 2px; }\n .styles-module_mappingRow__LbAkF .styles-module_sampleData__ZpCR2 {\n display: flex;\n flex-direction: column;\n width: 40%;\n overflow: hidden;\n word-break: break-word;\n padding-right: 20px; }\n .styles-module_mappingRow__LbAkF .styles-module_selectBox__2gn7w {\n width: 40%;\n font-size: 14px; }\n .styles-module_mappingRow__LbAkF:nth-child(even) {\n background: #f8f8f880; }\n .styles-module_mappingRow__LbAkF:first-child {\n color: #333333; }\n .styles-module_mappingRow__LbAkF .styles-module_mappingHeaderItem__3Ue0A {\n display: flex;\n align-items: center;\n width: 40%; }\n .styles-module_mappingRow__LbAkF .styles-module_mappingHeaderItem__3Ue0A:first-child {\n padding-right: 4px; }\n .styles-module_mappingRow__LbAkF .styles-module_mappingHeaderItem__3Ue0A img {\n height: 25px;\n width: 25px;\n padding: 2px;\n object-fit: contain;\n border-radius: 9999px;\n margin-right: 5px; }\n .styles-module_mappingRow__LbAkF pre {\n margin: 0;\n padding: 0;\n color: #7d7d7d;\n height: 20px;\n font-size: 14px;\n line-height: 20px;\n overflow: hidden;\n text-overflow: ellipsis; }\n");var Mo,Do,To=Me.connect(["stepState","genericData","stepMapping","activityOutputData","dynamicFieldData","stepDataMapping","parentChildMapping"],Kt)((function(e){var t,r,o=Je(tt(!0),2),a=o[0],s=o[1],l=Je(tt(!1),2),u=l[0],c=l[1],d=Je(tt(!1),2),p=d[0],f=d[1],_=Je(tt([]),2),m=_[0],v=_[1],h=Je(tt(""),2),y=h[0],g=h[1],b=at(Bt),w=rt(""),x=rt([]);nt((function(){m.length>0&&m.map((function(t,r){var i=e.stepDataMapping[e.stepId][t.fieldId];if(!i.isDynamic&&i.value)i.value.slice(1,-1)&&(x.current=[].concat(n(x.current),[r]));else if(i.isDynamic&&i.value&&t.id){JSON.parse(i.value)[t.id]&&(x.current=[].concat(n(x.current),[r]))}}))}),[m]),nt((function(){var t=e.templateFields.filter((function(e){return e.activity_field&&"DYNAMIC"===e.activity_field.type}))[0];t&&g("".concat(t.id));var r=e.templateFields.filter((function(e){return e.activity_field&&"TEXTFIELD"===e.activity_field.type&&e.is_visible})).map((function(e){return{fieldId:e.id,id:e.activity_field&&e.activity_field.machine_name,title:e.activity_field&&e.activity_field.title,type:"text",isNotDynamic:!0}}));if(t.activity_field){var i,o=e.parentChildMapping[e.stepId][t.activity_field.machine_name],a="";if(o){var l,u=null===(l=o.parentFields)||void 0===l?void 0:l.reduce((function(t,n){var r=e.parentChildMapping[e.stepId][n].fieldId;return Oo(Oo({},t),{},V({},r,e.stepDataMapping[e.stepId][r].value))}),{});a=JSON.stringify(u)}if(a!==w.current)s(!0),c(!0),f(!0),k(),null===(i=C(t))||void 0===i||i.then((function(e){s(!1),x.current=[],w.current=a,Array.isArray(e)?v([].concat(n(r),n(e.map((function(e){return Oo(Oo({},e),{},{fieldId:t.id})}))))):v(r)})).catch((function(e){return console.error(e)}))}}),[e.stepDataMapping[e.stepId]]);var I=function(t){var n=e.stepDataMapping[t];return Object.keys(n).filter((function(e){return n[Number(e)].value})).reduce((function(e,t){var r=n[Number(t)];return Oo(Oo({},e),{},V({},r.machineName,r.value))}),{})},k=function(){var t=i(E.mark((function t(){var n,r,i;return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.stepState.steps[0].stepId,r=I(n),n&&("TRIGGER"!==(i=e.stepMapping[n].step).activity.type&&"QUERY"!==i.activity.type||(i.activity.activity_output_url?(c(!0),null==b||b.apiHandler.callDynamicDataEndpoint(new URL(i.activity.activity_output_url),Oo({authorization_id:"".concat(e.stepMapping[n].selectedAuthId)},r)).then((function(t){c(!1),t&&e.setActivityOutputData({activityOutputData:t})}))):c(!1),i.activity.dynamic_field_data_endpoint?(f(!0),null==b||b.apiHandler.callDynamicDataEndpoint(new URL(i.activity.dynamic_field_data_endpoint),Oo({authorization_id:"".concat(e.stepMapping[n].selectedAuthId)},r)).then((function(t){f(!1),t&&e.setDynamicFieldData({dynamicFieldData:t})}))):f(!1)));case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),C=function(t){var n,r="".concat(null===(n=t.activity_field)||void 0===n?void 0:n.dynamic_field_src);return null==b?void 0:b.apiHandler.callDynamicDataEndpoint(new URL(r),Oo({authorization_id:"".concat(e.endpointData.authId)},e.endpointData.fieldsData))};return Ie(uo||(uo=F(["\n <div>\n <",'\n title="Map data"\n description="Please map fields you want to use from both apps"\n />\n <div>\n ',"\n </div>\n </div>\n "])),jr,a||u||p?Ie(co||(co=F(["<div class=","><"," /></div>"])),wo,ao):Ie(po||(po=F(["\n <div class=",">\n <div class=",">\n <div class=",">\n <img\n src=","\n />\n <div>\n ","\n </div>\n </div>\n <div class=",">Sample Data</div>\n <div class=",">\n <img src="," />\n <div>"," Field</div>\n </div>\n </div>\n ","\n <div class=",">\n <div>\n <span>Mapped</span>\n <span\n >","","\n field","</span\n >\n </div>\n <div>\n <span>Ignored</span>\n <span\n >","","\n field","</span\n >\n </div>\n </div>\n </div>\n "])),yo,bo,Co,e.stepMapping[e.stepId].step.activity.app.icon_url,"".concat(e.stepMapping[e.stepId].step.activity.app.name," Field"),Io,Co,null===(t=e.genericData.templateApp)||void 0===t?void 0:t.iconUrl,null===(r=e.genericData.templateApp)||void 0===r?void 0:r.name,m.map((function(t,r){var i,o,a,s,l,u=t.id||"",c=e.stepDataMapping[e.stepId][t.fieldId];c.isDynamic?s=c.objectValue:s=null===(l=c.value)||void 0===l?void 0:l.slice(1,-1);return!c.isDynamic&&s?a=s:t.id&&c.isDynamic&&c.objectValue&&s[u]&&(a="".concat(s[u]).slice(1,-1)),Ie(fo||(fo=F(["\n <div class=",">\n <div class=",">\n ","","\n </div>\n <div class=",">\n ","\n </div>\n <div class=",">\n <",'\n ariaLabel="Map a value"\n placeholder="Please map a value"\n options=',"\n value=","\n isRequired=","\n showStepValidation=","\n showUnselectedValue=",'\n unselectedText="Skip"\n onChange=',"\n ><//>\n </div>\n </div>\n "])),bo,xo,t.title,(null==c?void 0:c.isRequired)&&Ie(_o||(_o=F(["<span>*</span>"]))),Io,e.dynamicFieldData&&a&&(null===(i=e.dynamicFieldData["{".concat(a,"}")])||void 0===i?void 0:i.map((function(e){return e?Ie(mo||(mo=F(["<pre>","</pre>"])),e):Ie(vo||(vo=F([""])))}))),ko,ho,null===(o=e.activityOutputData)||void 0===o?void 0:o.map((function(e){return{key:e.value,label:e.text}})),a,null==c?void 0:c.isRequired,e.showStepValidation,!0,(function(i){var o;return function(t,r,i,o){var a,s=null===(a=e.activityOutputData)||void 0===a?void 0:a[t],l=x.current.findIndex((function(e){return e===o}));t<0?(x.current=x.current.filter((function(e){return e!==o})),r.isNotDynamic?e.setStepFieldData({stepId:"".concat(e.stepId),fieldId:"".concat(r.fieldId),value:"",isRequired:i}):y&&e.setStepMappingData({stepId:e.stepId,fieldId:Number(y),id:"".concat(r.id),value:null})):s&&(l<0&&(x.current=[].concat(n(x.current),[o])),r.isNotDynamic?e.setStepFieldData({stepId:"".concat(e.stepId),fieldId:"".concat(r.fieldId),value:"{".concat(s.value,"}"),isRequired:i}):y&&e.setStepMappingData({stepId:e.stepId,fieldId:Number(y),id:"".concat(r.id),value:"{".concat(s.value,"}")}))}(i,t,null!==(o=null==c?void 0:c.isRequired)&&void 0!==o&&o,r)}))})),go,x.current.length," ",1!==x.current.length?"s":"",m.length-x.current.length," ",m.length-x.current.length!=1?"s":""))})),Ao="styles-module_inputWrapper__1XBHY";Qt(".styles-module_inputWrapper__1XBHY {\n position: relative;\n width: 100%;\n margin-top: 10px; }\n .styles-module_inputWrapper__1XBHY input {\n width: 100%;\n color: #333;\n display: block;\n box-sizing: border-box;\n -webkit-appearance: none;\n appearance: none;\n padding: 8.5px 14px;\n border-radius: 4px;\n border: 1px solid #e2e0db;\n font-size: 14px;\n outline: none; }\n .styles-module_inputWrapper__1XBHY input:focus {\n outline: none; }\n .styles-module_inputWrapper__1XBHY input:-ms-input-placeholder {\n color: #999999; }\n .styles-module_inputWrapper__1XBHY input::placeholder {\n color: #999999; }\n");var Ro,Lo,No=function(e){var t=e.placeholder,n=e.value,r=e.type,i=void 0===r?"text":r,o=e.control,a=e.handleChange,s=void 0===a?function(){return null}:a;return Ie(Mo||(Mo=F(["\n <div class=",">\n <input\n type=","\n placeholder=","\n value=","\n onkeyup=","\n onchange=","\n />\n ","\n </div>\n "])),Ao,i,t,n,(function(e){if(e.currentTarget instanceof HTMLInputElement){var t=e.currentTarget.value;s(t)}}),(function(e){if(e.currentTarget instanceof HTMLInputElement&&"date"===e.currentTarget.type){var t=e.currentTarget.value;s(t)}}),o&&Ie(Do||(Do=F(["<"," //>"])),o))},Po="styles-module_inputGroupWrapper__FJc-g";Qt(".styles-module_inputGroupWrapper__FJc-g fieldset {\n padding: 0;\n margin: 0;\n border: none; }\n");var Eo,jo,Fo,zo,Vo,Uo=function(e){var t=e.title,n=e.description,r=e.placeholder,i=e.value,o=e.showStepValidation,a=void 0!==o&&o,s=e.isRequired,l=void 0!==s&&s,u=e.onChange,c=void 0===u?function(){return null}:u;return Ie(Ro||(Ro=F(['\n <div class="','">\n <fieldset>\n <'," title="," description="," //>\n <",'\n type="text"\n placeholder=',"\n handleChange=","\n value=","\n ><//>\n </fieldset>\n ","\n </div>\n "])),Po,jr,t,n,No,r,(function(e){c(e)}),i,a&&l&&Ie(Lo||(Lo=F(["",">Please enter a value<//>"])),Nr))},Ho="styles-module_dateGroupWrapper__cV-ne",Bo="styles-module_visibilityToggle__1l7Vl";Qt(".styles-module_dateGroupWrapper__cV-ne fieldset {\n border: none;\n padding: 0;\n margin: 0; }\n\n.styles-module_dateGroupWrapper__cV-ne input[type='date'] {\n position: relative;\n cursor: pointer; }\n\n.styles-module_dateGroupWrapper__cV-ne input[type='date']::-webkit-calendar-picker-indicator {\n position: absolute;\n top: 0;\n right: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n color: transparent;\n background: transparent; }\n\n.styles-module_dateGroupWrapper__cV-ne .styles-module_visibilityToggle__1l7Vl {\n display: flex;\n align-items: center;\n position: absolute;\n top: 0;\n right: 10px;\n bottom: 0;\n margin: 0 auto; }\n .styles-module_dateGroupWrapper__cV-ne .styles-module_visibilityToggle__1l7Vl svg {\n cursor: pointer;\n width: 20px; }\n .styles-module_dateGroupWrapper__cV-ne .styles-module_visibilityToggle__1l7Vl svg:hover {\n opacity: 0.5; }\n");var Wo,Jo,qo,Go,Ko,Zo=function(e){var t=e.title,n=e.description,r=e.placeholder,i=e.value,o=e.showStepValidation,a=void 0!==o&&o,s=e.isRequired,l=void 0!==s&&s,u=e.onChange,c=void 0===u?function(){return null}:u;return Ie(Eo||(Eo=F(['\n <div class="','">\n <fieldset>\n <'," title="," description="," //>\n <",'\n type="date"\n placeholder=',"\n handleChange=","\n value=","\n control=","\n ><//>\n </fieldset>\n ","\n </div>\n "])),Ho,jr,t,n,No,r,c,i,(function(){return Ie(jo||(jo=F([' <div\n role="button"\n class=',"\n onclick=","\n >\n ","\n </div>"])),Bo,(function(){i&&c("")}),Ie(i?zo||(zo=F(['\n <svg\n width="18"\n height="18"\n viewBox="0 0 18 18"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M9 0C13.9673 0 18 4.03275 18 9C18 13.9673 13.9673 18 9 18C4.03275 18 0 13.9673 0 9C0 4.03275 4.03275 0 9 0ZM9 0.75C13.5533 0.75 17.25 4.44675 17.25 9C17.25 13.5533 13.5533 17.25 9 17.25C4.44675 17.25 0.75 13.5533 0.75 9C0.75 4.44675 4.44675 0.75 9 0.75ZM9 8.46975L12.9697 4.5L13.5 5.03025L9.53025 9L13.5 12.9697L12.9697 13.5L9 9.53025L5.03025 13.5L4.5 12.9697L8.46975 9L4.5 5.03025L5.03025 4.5L9 8.46975Z"\n fill="black"\n />\n </svg>\n '])):Fo||(Fo=F(['\n <svg\n width="25"\n height="26"\n viewBox="0 0 25 26"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M16.9543 5.5464H19.335L19.3349 5.54639C20.6491 5.54639 21.7156 6.61204 21.7156 7.92812L21.7147 19.8323C21.7147 21.1466 20.6482 22.2131 19.334 22.2131H5.04866C3.73449 22.2131 2.66797 21.1466 2.66797 19.8323V7.92719C2.66797 6.61296 3.73444 5.54639 5.04866 5.54639L7.42936 5.5473V4.35641C7.42936 3.69791 7.96262 3.16553 8.62019 3.16553C9.27777 3.16553 9.81102 3.69791 9.81102 4.35641V5.5464L14.5717 5.5473V4.35641C14.5717 3.69791 15.105 3.16553 15.7626 3.16553C16.4201 3.16553 16.9534 3.69791 16.9534 4.35641L16.9543 5.5464ZM4.04688 20.8324H20.3369L20.3358 8.7124H4.04688V20.8324Z"\n fill="#999999"\n />\n </svg>\n ']))))}),a&&l&&Ie(Vo||(Vo=F(["",">Please enter a date<//>"])),Nr))},Yo="styles-module_passwordInputWrapper__1rzRX",Qo="styles-module_visibilityToggle__3_Kyp";Qt(".styles-module_passwordInputWrapper__1rzRX fieldset {\n padding: 0;\n margin: 0;\n border: none; }\n\n.styles-module_passwordInputWrapper__1rzRX .styles-module_innerWrap__2CRI3 {\n position: relative; }\n\n.styles-module_passwordInputWrapper__1rzRX input {\n padding-right: 36px; }\n\n.styles-module_visibilityToggle__3_Kyp {\n display: flex;\n align-items: center;\n position: absolute;\n top: 0;\n right: 10px;\n bottom: 0;\n margin: 0 auto; }\n .styles-module_visibilityToggle__3_Kyp svg {\n cursor: pointer;\n width: 20px; }\n .styles-module_visibilityToggle__3_Kyp svg:hover {\n opacity: 0.5; }\n");var Xo,$o,ea=function(e){var t=e.title,n=e.description,r=e.placeholder,i=e.value,o=e.showStepValidation,a=void 0!==o&&o,s=e.isRequired,l=void 0!==s&&s,u=e.onChange,c=void 0===u?function(){return null}:u,d=Je(tt(!1),2),p=d[0],f=d[1],_=function(){f((function(e){return!e}))};return Ie(Wo||(Wo=F(['\n <div class="','">\n <fieldset>\n <'," title="," description="," //>\n <","\n type=","\n placeholder=","\n handleChange=","\n value=","\n control=","\n ><//>\n ","\n </fieldset>\n </div>\n "])),Yo,jr,t,n,No,p?"text":"password",r,c,i,(function(){return Ie(Jo||(Jo=F(["\n <div\n class=","\n onclick=","\n >\n ","\n </div>\n "])),Qo,_,Ie(p?Go||(Go=F([' <svg\n width="20"\n height="12"\n viewBox="0 0 20 12"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M0.183387 6.51359C0.35582 6.72918 4.47535 11.6704 9.71968 11.6704V11.6704C14.964 11.6704 19.0836 6.72924 19.256 6.51357C19.5005 6.21515 19.5005 5.78535 19.256 5.48691V5.48615C19.0835 5.27523 14.964 0.330078 9.71968 0.330078C4.47535 0.330078 0.355766 5.27507 0.183387 5.48693C-0.0611291 5.78535 -0.0611291 6.21515 0.183387 6.51359ZM9.71968 10.0499C6.1643 10.0499 3.04855 7.1924 1.90266 6.00018C3.04632 4.80579 6.1643 1.95044 9.71968 1.95044C13.2751 1.95044 16.3908 4.80797 17.5367 6.00018C16.393 7.19458 13.2751 10.0499 9.71968 10.0499Z"\n fill="#333333"\n />\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.94922 8.29099C7.55668 8.89849 8.3806 9.24021 9.24022 9.24021C10.0998 9.24021 10.9237 8.89845 11.5312 8.29099C12.1387 7.68353 12.4804 6.85956 12.4804 5.99999C12.4804 5.14041 12.1387 4.31648 11.5312 3.70898C10.9238 3.10148 10.0998 2.75977 9.24022 2.75977C8.38064 2.75977 7.55672 3.10152 6.94922 3.70898C6.34172 4.31644 6 5.14041 6 5.99999C6 6.85956 6.34176 7.68349 6.94922 8.29099ZM7.7435 5.3803C7.99408 4.77431 8.58488 4.38021 9.24022 4.38021C9.67002 4.38021 10.0816 4.55031 10.3854 4.85481C10.6899 5.15856 10.86 5.57015 10.86 5.99995C10.86 6.65529 10.4659 7.24607 9.85987 7.49667C9.25464 7.74727 8.5583 7.60905 8.09509 7.14508C7.63111 6.68186 7.49289 5.98552 7.7435 5.3803Z"\n fill="#333333"\n />\n </svg>'])):qo||(qo=F([' <svg\n width="20"\n height="12"\n viewBox="0 0 20 12"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M0.183387 6.51359C0.35582 6.72918 4.47535 11.6704 9.71968 11.6704V11.6704C14.964 11.6704 19.0836 6.72924 19.256 6.51357C19.5005 6.21515 19.5005 5.78535 19.256 5.48691V5.48615C19.0835 5.27523 14.964 0.330078 9.71968 0.330078C4.47535 0.330078 0.355766 5.27507 0.183387 5.48693C-0.0611291 5.78535 -0.0611291 6.21515 0.183387 6.51359ZM9.71968 10.0499C6.1643 10.0499 3.04855 7.1924 1.90266 6.00018C3.04632 4.80579 6.1643 1.95044 9.71968 1.95044C13.2751 1.95044 16.3908 4.80797 17.5367 6.00018C16.393 7.19458 13.2751 10.0499 9.71968 10.0499Z"\n fill="#999999"\n />\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.94922 8.29099C7.55668 8.89849 8.3806 9.24021 9.24022 9.24021C10.0998 9.24021 10.9237 8.89845 11.5312 8.29099C12.1387 7.68353 12.4804 6.85956 12.4804 5.99999C12.4804 5.14041 12.1387 4.31648 11.5312 3.70898C10.9238 3.10148 10.0998 2.75977 9.24022 2.75977C8.38064 2.75977 7.55672 3.10152 6.94922 3.70898C6.34172 4.31644 6 5.14041 6 5.99999C6 6.85956 6.34176 7.68349 6.94922 8.29099ZM7.7435 5.3803C7.99408 4.77431 8.58488 4.38021 9.24022 4.38021C9.67002 4.38021 10.0816 4.55031 10.3854 4.85481C10.6899 5.15856 10.86 5.57015 10.86 5.99995C10.86 6.65529 10.4659 7.24607 9.85987 7.49667C9.25464 7.74727 8.5583 7.60905 8.09509 7.14508C7.63111 6.68186 7.49289 5.98552 7.7435 5.3803Z"\n fill="#999999"\n />\n </svg>']))))}),a&&l&&Ie(Ko||(Ko=F(["",">Please enter a value<//>"])),Nr))},ta="styles-module_textareaInputWrapper__mJffr";Qt(".styles-module_textareaInputWrapper__mJffr fieldset {\n padding: 0;\n margin: 0;\n border: none; }\n\n.styles-module_textareaInputWrapper__mJffr textarea {\n margin-top: 10px;\n font-family: inherit;\n box-sizing: border-box;\n display: block;\n height: 6rem;\n width: 100%;\n resize: none;\n color: #333;\n -webkit-appearance: none;\n appearance: none;\n border-radius: 0.25rem;\n border-width: 1px;\n border-style: solid;\n border: 1px solid #e2e0db;\n padding: 8.5px 14px; }\n .styles-module_textareaInputWrapper__mJffr textarea:focus {\n outline: none; }\n .styles-module_textareaInputWrapper__mJffr textarea:-ms-input-placeholder {\n color: #999; }\n .styles-module_textareaInputWrapper__mJffr textarea::placeholder {\n color: #999; }\n");var na,ra,ia,oa,aa,sa,la,ua,ca,da,pa,fa,_a,ma,va,ha,ya,ga,ba=function(e){var t=e.title,n=e.description,r=e.placeholder,i=e.onChange,o=void 0===i?function(){return null}:i,a=e.showStepValidation,s=void 0!==a&&a,l=e.isRequired,u=void 0!==l&&l;return Ie(Xo||(Xo=F(['\n <div class="','">\n <fieldset>\n <'," title="," description="," //>\n <textarea placeholder="," oninput="," />\n </fieldset>\n ","\n </div>\n "])),ta,jr,t,n,r,(function(e){if(e.currentTarget instanceof HTMLTextAreaElement){var t=e.currentTarget.value;o(t)}}),s&&u&&Ie($o||($o=F(["",">Please enter a value<//>"])),Nr))},wa="styles-module_stepsWrap__1Yzhl",xa="styles-module_stepWrap__eLO77",Ia="styles-module_unsupported__eCxdG";function ka(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ca(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ka(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ka(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Sa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}Qt(".styles-module_stepsWrap__1Yzhl {\n width: 100%; }\n\n.styles-module_stepWrap__eLO77 {\n margin-bottom: 30px; }\n\n.styles-module_unsupported__eCxdG {\n font-size: 12px;\n color: #ca8c1b; }\n");var Oa,Ma,Da,Ta,Aa,Ra,La,Na,Pa,Ea,ja,Fa,za,Va,Ua,Ha,Ba,Wa,Ja,qa,Ga,Ka=function(e){Re(n,e);var t=Sa(n);function n(e){var r;return z(this,n),V(Te(r=t.call(this,e)),"getVisibleFieldsDataOnRootStep",(function(){var e=r.props.stepDataMapping[r.props.step.id];return Object.keys(e).filter((function(t){return e[Number(t)].value})).reduce((function(t,n){var r=e[Number(n)];return Ca(Ca({},t),{},V({},r.machineName,r.value))}),{})})),V(Te(r),"areParentValuesFilled",(function(e,t){for(var n=!0,i=0;i<t.length;i+=1){var o=t[i],a=r.props.parentChildMapping[e][o].fieldId,s=r.props.stepDataMapping[e]&&r.props.stepDataMapping[e][a];if(!s||!s.value){n=!1;break}}return n})),V(Te(r),"doParentFieldsHaveValues",(function(e,t){var n=!0,i=r.props.parentChildMapping[e][t];if(i&&i.parentFields)for(var o=0;o<i.parentFields.length;o+=1){var a=r.props.parentChildMapping[e][i.parentFields[o]],s=r.props.stepDataMapping[e]&&r.props.stepDataMapping[e][a.fieldId];if(!s||!s.value){n=!1;break}}return n})),V(Te(r),"shouldShowStep",(function(e){var t=r.props.step.id,n=r.props.stepMapping&&r.props.stepMapping[t];if("BUTTON"===e.type||"HTML"===e.type)return!0;if(n&&e.activity_field){var i=!e.is_hidden,o=r.props.parentChildMapping[t][e.activity_field.machine_name].parentFields,a=!0;return o&&(a=r.areParentValuesFilled(t,o)),i&&a}return!1})),V(Te(r),"stepIsOfType",(function(e){var t=r.props.step.id,n=r.props.stepMapping&&r.props.stepMapping[t];return e.indexOf(n.step.activity.type)>-1})),V(Te(r),"textFieldParentHasValues",(function(){var e=r.props.step.id,t=r.props.stepMapping&&r.props.stepMapping[e],n=t.step.template_fields.filter((function(e){return e.is_visible})),i=t.selectedAuthId,o=n.filter((function(e){return e.activity_field&&"DYNAMIC"===e.activity_field.type}))[0];return!o||!!(n.length>0&&o&&o.activity_field&&i&&r.doParentFieldsHaveValues(e,o.activity_field.machine_name))})),V(Te(r),"shouldShowMapping",(function(){var e=r.props.step.id,t=r.props.stepMapping&&r.props.stepMapping[e];if(r.stepIsOfType(["ADAPTER","ACTION"])){var n=t.step.template_fields.filter((function(e){return e.is_visible})),i=t.selectedAuthId,o=n.filter((function(e){return e.activity_field&&"DYNAMIC"===e.activity_field.type}))[0];if(!o)return!1;if(n.length>0&&i&&o&&o.activity_field&&r.doParentFieldsHaveValues(e,o.activity_field.machine_name))return!0}return!1})),V(Te(r),"getMappingDataInput",(function(){var e=r.props.step.id;return{authId:(r.props.stepMapping&&r.props.stepMapping[e]).selectedAuthId,fieldsData:r.getVisibleFieldsDataOnRootStep()}})),V(Te(r),"fieldDynamicData",(function(e){var t=r.props.step.id;if(r.props.stepMapping&&r.props.stepMapping[t]&&e.activity_field){var n=r.props.parentChildMapping[t][e.activity_field.machine_name].parentFields;if(n){var i=r.props.parentChildMapping[t][n[0]].fieldId;if(i)return V({},n[0],r.props.stepDataMapping[t][i].value)}}return null})),r.state={loading:!1},r}return ft(n,[{key:"componentDidMount",value:function(){this.props.verifyStepValidity(this.props.step.id)}},{key:"render",value:function(){var e=this,t=this.props,n=t.step,r=t.stepMapping,i=t.stepDataMapping,o=t.setStepFieldData,a=t.showStepValidation,s=r[n.id]&&r[n.id].step,l=i&&i[n.id];return Ie(na||(na=F(["\n ","\n "])),this.state.loading?Ie(ra||(ra=F(["<"," //>"])),en):Ie(ia||(ia=F(["\n ","\n "])),s?Ie(oa||(oa=F(["\n <div class=",">\n ","\n ","\n </div>\n "])),wa,s.template_fields.map((function(t){var r;if(e.shouldShowStep(t)&&t.activity_field)switch(t.activity_field.type){case"SELECT":return Ie(aa||(aa=F(["\n <div class=",">\n <","\n key=","\n apiHandler=","\n title=","\n description=","\n showStepValidation=","\n placeholder=","\n isRequired=","\n value=","\n onChange=","\n endpointUrl=","\n isDynamic=","\n endpointData=","\n ><//>\n </div>\n "])),xa,qi,t.activity_field.id,e.props.apiHandler,t.title||t.activity_field.title,t.description||t.activity_field.description,a,t.placeholder,t.is_required,l&&l[t.id]&&l[t.id].value||"",(function(r){o({stepId:"".concat(n.id),fieldId:"".concat(t.id),value:r,isRequired:t.is_required}),e.props.verifyStepValidity(n.id)}),t.activity_field.data_src,t.activity_field.is_dynamic,JSON.stringify(Ca({authorization_id:e.props.stepMapping&&(null===(r=e.props.stepMapping[e.props.step.id])||void 0===r?void 0:r.selectedAuthId)},e.fieldDynamicData(t))));case"TEXTFIELD":return!e.shouldShowMapping()&&e.textFieldParentHasValues()&&Ie(sa||(sa=F(["\n <div class=",">\n <","\n id=","\n title=","\n description=","\n value=","\n placeholder=","\n showStepValidation=","\n isRequired=","\n onChange=","\n ><//>\n </div>\n "])),xa,Uo,t.activity_field.id,t.title||t.activity_field.title,t.description||t.activity_field.description,l&&l[t.id]&&l[t.id].value||"",t.placeholder||"Please enter a value",a,t.is_required,(function(r){o({stepId:"".concat(n.id),fieldId:"".concat(t.id),value:r,isRequired:t.is_required}),e.props.verifyStepValidity(n.id)}));case"CHECKBOX":var i,s,u;return Ie(la||(la=F(["\n <div class=",">\n <","\n title=","\n description=","\n isRequired=","\n />\n <","\n label=","\n name=","\n value=","\n isChecked=","\n isRequired=","\n showStepValidation=","\n handleChange=","\n />\n </div>\n "])),xa,jr,t.title||t.activity_field.title,t.description||t.activity_field.description,t.is_required,$i,JSON.parse(null!==(i=null===(s=t.activity_field)||void 0===s||null===(u=s.data_src)||void 0===u?void 0:u.replace(/\\'/g,"'"))&&void 0!==i?i:"[]")||[],t.activity_field.machine_name,l&&l[t.id]&&l[t.id].value,l&&l[t.id]&&l[t.id].value,t.is_required,a,(function(r,i){o({stepId:"".concat(n.id),fieldId:"".concat(t.id),value:i,isRequired:t.is_required}),e.props.verifyStepValidity(n.id)}));case"DYNAMIC":return Ie(ua||(ua=F([""])));case"PASSWORD":return Ie(ca||(ca=F(["\n <div class=",">\n <","\n title=","\n description=","\n value=","\n placeholder=","\n showStepValidation=","\n isRequired=","\n onChange=","\n />\n </div>\n "])),xa,ea,t.title||t.activity_field.title,t.description||t.activity_field.description,l&&l[t.id]&&l[t.id].value||"",t.placeholder||"Please enter a value",a,t.is_required,(function(r){o({stepId:"".concat(n.id),fieldId:"".concat(t.id),value:r,isRequired:t.is_required}),e.props.verifyStepValidity(n.id)}));case"TEXTAREA":return Ie(da||(da=F(["\n <div class=",">\n <","\n title=","\n description=","\n value=","\n placeholder=","\n showStepValidation=","\n isRequired=","\n onChange=","\n />\n </div>\n "])),xa,ba,t.title||t.activity_field.title,t.description||t.activity_field.description,l&&l[t.id]&&l[t.id].value||"",t.placeholder||"Please enter a value",a,t.is_required,(function(r){o({stepId:"".concat(n.id),fieldId:"".concat(t.id),value:r,isRequired:t.is_required}),e.props.verifyStepValidity(n.id)}));case"DATE":return Ie(pa||(pa=F(["\n <div class=",">\n <","\n title=","\n description=","\n value=","\n placeholder=","\n showStepValidation=","\n isRequired=","\n onChange=","\n />\n </div>\n "])),xa,Zo,t.title||t.activity_field.title,t.description||t.activity_field.description,l&&l[t.id]&&l[t.id].value||"",t.placeholder||"Please enter a value",a,t.is_required,(function(r){o({stepId:"".concat(n.id),fieldId:"".concat(t.id),value:r,isRequired:t.is_required}),e.props.verifyStepValidity(n.id)}));case"RADIO":return Ie(fa||(fa=F(["\n <div class=",">\n <","\n name=","\n label=","\n description=","\n />\n </div>\n "])),xa,Dr,t.title||t.activity_field.title,t.title||t.activity_field.title,t.description||t.activity_field.description);default:return Ie(_a||(_a=F([" <div\n class=","\n >\n Field: "," is currently not\n supported\n </div>"])),"".concat(xa," ").concat(Ia),t.activity_field.type)}else switch(t.type){case"HTML":return Ie(ma||(ma=F(['\n <div\n style="margin-bottom: 2rem;"\n dangerouslySetInnerHTML=',"\n />\n "])),{__html:_i(window).sanitize(t.default_value)});case"BUTTON":return Ie(va||(va=F(['\n <div style="margin-bottom: 2rem;">\n <'," label="," />\n </div>\n "])),Ln,t.title)}return Ie(ha||(ha=F([""])))})),this.shouldShowMapping()&&Ie(ya||(ya=F(["\n <div class=",">\n <","\n stepId=","\n templateFields=","\n showStepValidation=","\n endpointData=","\n ><//>\n </div>\n "])),xa,To,s.id,s.template_fields,a,this.getMappingDataInput())):Ie(ga||(ga=F(["Step data could not be loaded"])))))}}]),n}(ne),Za=Me.connect(["stepMapping","stepDataMapping","parentChildMapping"],Kt)(Ka),Ya="styles-module_stepsWrap__3VIDN",Qa="styles-module_stepInfo__nU7A7",Xa="styles-module_header__2GDea",$a="styles-module_name__h_9E1",es="styles-module_steps__1tZbw",ts="styles-module_stepContainer__1DBMw",ns="styles-module_top__JXVEL",rs="styles-module_bottom__2g7TT",is="styles-module_buttons__2hBh9",os="styles-module_save__1LVOi",as="styles-module_postSave__3EhMs",ss="styles-module_webhookContainer__2UJ9L",ls="styles-module_webhook__5NihV",us="styles-module_authWrap__em0DI";function cs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ds(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cs(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ps(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}Qt(".styles-module_stepsWrap__3VIDN {\n display: flex;\n border: 1px solid #d7d7d7;\n box-sizing: border-box;\n box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.04);\n border-radius: 4px;\n width: 100%;\n box-sizing: border-box;\n padding: 30px; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepInfo__nU7A7 .styles-module_header__2GDea {\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: space-between; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepInfo__nU7A7 .styles-module_header__2GDea .styles-module_name__h_9E1 {\n display: flex;\n align-items: center;\n font-weight: 500;\n font-size: 20px;\n color: #333333; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepInfo__nU7A7 .styles-module_header__2GDea .styles-module_steps__1tZbw {\n font-size: 12px;\n font-weight: 400;\n color: #8c8c8c; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepInfo__nU7A7 img,\n .styles-module_stepsWrap__3VIDN .styles-module_stepInfo__nU7A7 svg {\n margin-right: 10px;\n height: 25px;\n width: 25px;\n border-radius: 9999px;\n object-fit: contain; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepContainer__1DBMw {\n display: flex;\n width: 100%;\n flex-direction: column; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepContainer__1DBMw .styles-module_top__JXVEL {\n display: flex;\n flex: 1 1 0%;\n padding-top: 50px;\n padding-left: 35px;\n padding-right: 35px;\n width: 100%; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepContainer__1DBMw .styles-module_bottom__2g7TT {\n display: flex;\n height: 2rem;\n align-items: center;\n justify-content: flex-end;\n box-sizing: initial;\n border-width: 0px;\n border-top-width: 1px;\n border-style: solid;\n border-color: #d7d7d7;\n margin-top: 55px;\n padding-top: 20px; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepContainer__1DBMw .styles-module_bottom__2g7TT .styles-module_buttons__2hBh9 {\n display: flex; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepContainer__1DBMw .styles-module_bottom__2g7TT .styles-module_buttons__2hBh9 div:not(:last-child) {\n margin-right: 20px; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepContainer__1DBMw .styles-module_save__1LVOi {\n font-style: normal;\n font-weight: normal;\n margin-top: -30px;\n font-size: 14px;\n color: #8c8c8c;\n padding-bottom: 30px; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepContainer__1DBMw .styles-module_postSave__3EhMs .styles-module_webhookContainer__2UJ9L {\n border: 1px solid #d7d7d7;\n padding: 8px 12px;\n margin-top: 12px;\n border-radius: 4px; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepContainer__1DBMw .styles-module_postSave__3EhMs .styles-module_webhookContainer__2UJ9L .styles-module_webhook__5NihV {\n color: #333;\n font-family: monospace;\n line-height: 20px; }\n\n.styles-module_authWrap__em0DI {\n margin-bottom: 30px;\n width: 100%;\n max-width: 75%; }\n");var fs=function(e){Re(n,e);var t=ps(n);function n(e){var r;return z(this,n),V(Te(r=t.call(this,e)),"getPayload",(function(){var e,t,n=r.props,i=n.stepMapping,o=n.stepDataMapping;return r.context.isPreviewMode?null:(r.setState({loading:!0}),{name:null!==(e=null===(t=r.props.genericData.templateApp)||void 0===t?void 0:t.name)&&void 0!==e?e:"My new flow",notification_email:"",template:Number(r.props.genericData.templateId),bundle_id:Number(r.props.genericData.bundleId),steps:Object.keys(i).map((function(e){return{id:i[e].integrationStepId||i[e].step.id,authorization:Number(i[e].selectedAuthId)||null,template_step:i[e].step.id,app_user_data:i[e].step.template_fields.map((function(t){return{id:o[i[e].step.id][t.id].integrationFieldId||t.id,value:!o[i[e].step.id][t.id].value&&""!==o[i[e].step.id][t.id].value||o[i[e].step.id][t.id].objectValue?JSON.stringify(o[i[e].step.id][t.id].objectValue):"".concat(o[i[e].step.id][t.id].value),template_field:t.id}}))}}))})})),V(Te(r),"createIntegration",(function(){var e=r.getPayload();e&&r.context.apiHandler.saveIntegration(e).then((function(e){r.postSaveOrCreate(e)})).catch((function(e){return console.error(e)}))})),V(Te(r),"postSaveOrCreate",(function(e){var t=r.props.stepMapping,n=Object.keys(t).map((function(e){return t[e]})).filter((function(e){return e.step.activity&&"TRIGGER"===e.step.activity.type}))[0],i=e.steps.filter((function(e){return e.template_step===n.step.id}))[0];if(r.setState({loading:!1}),i&&i.returned_data)try{var o=JSON.parse(i.returned_data);o.is_webhook_url&&o.endpoint&&r.setState({postSave:!0,postSaveData:o,integrationData:e})}catch(e){console.error(e)}else r.dismiss()})),V(Te(r),"updateIntegration",(function(){var e=r.getPayload();e&&r.context.apiHandler.updateIntegration(r.context.integrationId,ds(ds({},e),{},{id:"".concat(r.context.integrationId)})).then((function(e){r.postSaveOrCreate(e)})).catch((function(e){return console.error(e)}))})),V(Te(r),"dismiss",(function(){var e=r.state.integrationData;e&&r.context.eventEmitter.emit("did-save-integration",{integrationId:e.id,name:e.name,templateId:e.template,status:e.status})})),V(Te(r),"handleAuthSelected",(function(e,t,n,i){var o=r.props.stepMapping[t].step.template_fields.filter((function(e){return e.activity_field&&e.activity_field.is_dynamic})).map((function(e){return e.id}));r.props.setStepAuthorization(t,e,n,o,i)})),r.state={loading:!1,selectedAuthStep:null,postSave:!1,postSaveData:null,integrationData:null},r}return ft(n,[{key:"componentDidUpdate",value:function(e){var t,n,r,i,o=e.stepState,a=this.props.stepState;o.stepIndex!==a.stepIndex&&this.context.eventEmitter.emit("did-change-step",{stepId:null!==(t=null===(n=a.steps[a.stepIndex])||void 0===n?void 0:n.stepId)&&void 0!==t?t:null,stepType:null!==(r=null===(i=a.steps[a.stepIndex])||void 0===i?void 0:i.type)&&void 0!==r?r:"CONFIRMATION"})}},{key:"render",value:function(){var e,t,n,r,i,o,a,s,l,u,c,d=this,p=null,f=this.props,_=f.stepState,m=f.stepMapping,v=this.state,h=v.postSave,y=v.postSaveData,g=_.currentStep,b=_.stepIndex,w=_.steps,x=!1,I=!1,k=!1,C=!1;b>-1&&"CONFIRMATION"!==(null==g?void 0:g.type)?(p=m[Number(null==g?void 0:g.stepId)],x=!1,I=_.stepIndex>0,k=null!==(c=null==g?void 0:g.isValid)&&void 0!==c&&c,C=_.showValidation):"CONFIRMATION"===(null==g?void 0:g.type)&&b===w.length&&(I=!0,x=!0);return Ie(Oa||(Oa=F(["\n <div class=",">\n <div class=",">\n <div class=",">\n ","\n </div>\n\n <div class=",">\n ","\n </div>\n ","\n </div>\n </div>\n "])),Ya,ts,Qa,g&&Ie(Ma||(Ma=F(["\n ","\n "])),x?Ie(Da||(Da=F(["\n <div class=",">\n <div class=",'>\n <svg\n width="25"\n height="25"\n viewBox="0 0 25 25"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <circle\n cx="12.5"\n cy="12.5"\n r="11.75"\n fill="white"\n stroke="#2ECC71"\n stroke-width="1.5"\n />\n <path\n d="M17.2209 9.16699L11.3907 15.8337L8.33203 12.3361"\n stroke="#2ECC71"\n stroke-width="1.5"\n stroke-linecap="round"\n />\n </svg>\n <div>\n ',"\n </div>\n </div>\n <div class=",">\n ","\n </div>\n </div>\n "])),Xa,$a,y&&h?"Flow created successfully":"Confirm and activate",es,"Step ".concat((null!==(e=null===(t=this.props.stepState)||void 0===t?void 0:t.stepIndex)&&void 0!==e?e:0)+1," / ").concat((null!==(n=null===(r=this.props.stepState)||void 0===r?void 0:r.steps.length)&&void 0!==n?n:0)+1)):Ie(Ta||(Ta=F(["\n <div class=",">\n <div class=",">\n <img src="," />\n <div>\n ","\n </div>\n </div>\n <div class=",">\n ","\n </div>\n </div>\n "])),Xa,$a,null===(i=p)||void 0===i?void 0:i.step.activity.app.icon_url,"CONFIRMATION"!==(null==g?void 0:g.type)&&(null==g?void 0:g.title),es,"Step ".concat((null!==(o=null===(a=this.props.stepState)||void 0===a?void 0:a.stepIndex)&&void 0!==o?o:0)+1," / ").concat((null!==(s=null===(l=this.props.stepState)||void 0===l?void 0:l.steps.length)&&void 0!==s?s:0)+1))),ns,g?Ie(Aa||(Aa=F(["\n ","\n "])),x?Ie(Ra||(Ra=F(["\n ","\n "])),h||y?Ie(Na||(Na=F(["\n <div class=",">\n <",'\n title="Webhook URL"\n description="Please use the following webhook url to send data"\n />\n <div class=',">\n <div class=",">\n ","\n </div>\n </div>\n </div>\n "])),as,jr,ss,ls,null==y?void 0:y.endpoint):Ie(La||(La=F(["\n <div class=",">\n ","\n </div>\n "])),os,this.context.isEditMode?"Your integration is ready to be updated. Click “Update” to continue.":"Your integration is ready to be enabled. Click “Save” to continue.")):Ie(Pa||(Pa=F(["\n ","\n "])),p&&Ie(Ea||(Ea=F(["\n ","\n "])),"AUTH"===(null==g?void 0:g.type)?Ie(ja||(ja=F(["\n <div class=",">\n <","\n stepId=","\n apiHandler=","\n showErrors=","\n onAuthSelected=","\n >\n <//>\n </div>\n "])),us,fi,p.step.id,this.context.apiHandler,C,(function(e,t,n){var r;return d.handleAuthSelected(e,Number(null===(r=p)||void 0===r?void 0:r.step.id),t,n)})):Ie(Fa||(Fa=F(["\n <","\n step=","\n stepType=","\n showStepValidation=","\n apiHandler=","\n eventEmitter=","\n />\n "])),Za,null===(u=p)||void 0===u?void 0:u.step,null==g?void 0:g.type,C,this.context.apiHandler,this.context.eventEmitter)))):Ie(za||(za=F(["This template has no configured steps"]))),g&&Ie(Va||(Va=F(["\n <div class=",">\n <div class=",">\n ","\n ","\n </div>\n </div>\n "])),rs,is,I&&!h&&!y&&Ie(Ua||(Ua=F(["\n <",'\n label="Back"\n onClick=',"\n type=","\n ><//>\n "])),Ln,(function(){return d.props.gotoPreviousStep()}),Cn.SECONDARY),x?Ie(Ha||(Ha=F(["\n ","\n "])),h||y?Ie(qa||(qa=F(["\n <",'\n label="Continue"\n onClick=',"\n ><//>\n "])),Ln,(function(){return d.dismiss()})):Ie(Ba||(Ba=F(["\n ","\n "])),this.context.isEditMode?Ie(Wa||(Wa=F(["\n <",'\n label="Update"\n isLoading=',"\n onClick=","\n ><//>\n "])),Ln,this.state.loading,(function(){return d.updateIntegration()})):Ie(Ja||(Ja=F(["\n <",'\n label="Save"\n disabled=',"\n tooltip=","\n isLoading=","\n onClick=","\n ><//>\n "])),Ln,this.context.isPreviewMode,this.context.isPreviewMode?'Integration setup will have to be\ndone in "Live View"':null,this.state.loading,(function(){return d.createIntegration()})))):Ie(Ga||(Ga=F(["\n <",'\n label="Next"\n disabled=',"\n onClick=","\n ><//>\n "])),Ln,!k,(function(){return k?d.props.gotoNextStep():d.props.showStepValidationState()}))))}}]),n}(ne);V(fs,"contextType",Bt);var _s,ms,vs,hs,ys,gs,bs,ws=Me.connect(["stepState","genericData","stepMapping","stepDataMapping"],Kt)(fs),xs="styles-module_wrap__2ZgZ0",Is="styles-module_main__11gFF";Qt(".styles-module_wrap__2ZgZ0 {\n position: relative;\n width: 100%;\n max-width: 730px; }\n .styles-module_wrap__2ZgZ0 *,\n .styles-module_wrap__2ZgZ0 *::before,\n .styles-module_wrap__2ZgZ0 *::after {\n box-sizing: border-box; }\n\n.styles-module_main__11gFF {\n width: 100%;\n line-height: 1; }\n");var ks,Cs=["steps"],Ss=Me.connect([""],Kt)((function(e){var t,n=Je(tt(!1),2),r=n[0],o=n[1],a=Je(tt(null),2),s=a[0],l=a[1],u=e.templateId,c=e.bundleId,d=e.customWrapper,p=e.templatePreviewData,f=e.previewMetadata,_=Je(tt(null),2),m=_[0],v=_[1],h=Je(function(e){var t=et(qe++),n=tt();return t.i=e,Ge.componentDidCatch||(Ge.componentDidCatch=function(e){t.i&&t.i(e),n[1](e)}),[n[0],function(){n[1](void 0)}]}((function(){})),2),y=h[0],g=h[1],b=at(Bt);return nt((function(){return function(){e.reset()}}),[]),nt((function(){y&&console.error(y)}),[y]),nt((function(){if(o(!0),null!=b&&b.isPreviewMode&&f){if(!p)throw new Error("Preview data was not provided");try{At(p,Yt)}catch(e){return console.error(e),o(!1),void v(e)}var t=p.steps,n=We(p,Cs);return l(p),e.setGenericData({templateId:Number(n.id),bundleId:Number(c),isPreviewMode:b.isPreviewMode}),e.setSteps(t.filter(tn)),e.setStepMapping(t.filter(tn)),e.setParentChildMapping(t.filter(tn)),e.gotoStepInPreview(f),b.eventEmitter.emit("did-load-preview",{templateId:Number(n.id),templateTitle:n.name,templateDescription:n.description}),void o(!1)}if(!u)throw new Error("Template ID not found");null==b||b.apiHandler.getTemplate(Number(u)).then((function(t){l(t),t&&Promise.all(t.steps.map((function(e){return b.apiHandler.getTemplateStep(Number(e.id))}))).then(function(){var n=i(E.mark((function n(r){var i;return E.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!r){n.next=16;break}if(e.setGenericData({templateId:Number(u),bundleId:Number(c)}),e.setSteps(r.filter(tn)),e.setStepMapping(r.filter(tn)),e.setParentChildMapping(r.filter(tn)),!b.integrationId){n.next=14;break}return n.next=8,b.apiHandler.getIntegrationById(b.integrationId);case 8:if(!(i=n.sent)){n.next=13;break}e.setIntegrationData(i),n.next=14;break;case 13:throw new Error("Error fetching integration data for ID ".concat(b.integrationId));case 14:b.eventEmitter.emit("did-load-template",{templateId:Number(u),templateTitle:t.name,templateDescription:t.description}),o(!1);case 16:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()).catch((function(e){return console.error(e)}))}))}),[u]),d?Ie(_s||(_s=F(["",""])),d):Ie(ms||(ms=F(['\n <div class="'," ",'">\n ',"\n </div>\n "])),xs,"integry-container",y||m?Ie(vs||(vs=F(["\n <","\n title=","\n description=","\n errorPayload=","\n onDismiss=","\n />\n "])),zn,m?"Validation error":"An unexpected error occurred",m?"There was an error validating the preview payload:":"Please review the following stacktrace:",m||y,m?null:g):Ie(hs||(hs=F(["\n <div>\n ","\n </div>\n <div class=",">\n ","\n ","\n </div>\n "])),!r&&s&&Ie(ys||(ys=F(["\n <","\n steps=","\n ><//>\n "])),Ir,null===(t=s.steps)||void 0===t?void 0:t.map((function(e){return{label:e.title,logoUrl:e.activity.app.icon_url}}))),Is,r&&Ie(gs||(gs=F(['<div style="display: flex; justify-content: center;">\n <'," />\n </div>"])),en),!r&&s&&Ie(bs||(bs=F([" <"," steps=","><//> "])),ws,s.steps)))})),Os=Se((function(e){var t,n;t=ke,n=function(){var e="undefined"==typeof window,t=new Map,n=new Map,r=[];r.total=0;var i=[],a=[];function s(){t.clear(),n.clear(),i=[],a=[]}function l(e){for(var t=-9007199254740991,n=e.length-1;n>=0;--n){var r=e[n];if(null!==r){var i=r.score;i>t&&(t=i)}}return-9007199254740991===t?null:t}function u(e,t){var n=e[t];if(void 0!==n)return n;var r=t;Array.isArray(t)||(r=t.split("."));for(var i=r.length,o=-1;e&&++o<i;)e=e[r[o]];return e}function c(e){return"object"===o(e)}var d=function(){var e=[],t=0,n={};function r(){for(var n=0,r=e[n],i=1;i<t;){var o=i+1;n=i,o<t&&e[o].score<e[i].score&&(n=o),e[n-1>>1]=e[n],i=1+(n<<1)}for(var a=n-1>>1;n>0&&r.score<e[a].score;a=(n=a)-1>>1)e[n]=e[a];e[n]=r}return n.add=function(n){var r=t;e[t++]=n;for(var i=r-1>>1;r>0&&n.score<e[i].score;i=(r=i)-1>>1)e[r]=e[i];e[r]=n},n.poll=function(){if(0!==t){var n=e[0];return e[0]=e[--t],r(),n}},n.peek=function(n){if(0!==t)return e[0]},n.replaceTop=function(t){e[0]=t,r()},n},p=d();return function o(f){var _={single:function(e,t,n){return e?(c(e)||(e=_.getPreparedSearch(e)),t?(c(t)||(t=_.getPrepared(t)),((n&&void 0!==n.allowTypo?n.allowTypo:!f||void 0===f.allowTypo||f.allowTypo)?_.algorithm:_.algorithmNoTypo)(e,t,e[0])):null):null},go:function(e,t,n){if(!e)return r;var i=(e=_.prepareSearch(e))[0],o=n&&n.threshold||f&&f.threshold||-9007199254740991,a=n&&n.limit||f&&f.limit||9007199254740991,s=(n&&void 0!==n.allowTypo?n.allowTypo:!f||void 0===f.allowTypo||f.allowTypo)?_.algorithm:_.algorithmNoTypo,d=0,m=0,v=t.length;if(n&&n.keys)for(var h=n.scoreFn||l,y=n.keys,g=y.length,b=v-1;b>=0;--b){for(var w=t[b],x=new Array(g),I=g-1;I>=0;--I)(S=u(w,C=y[I]))?(c(S)||(S=_.getPrepared(S)),x[I]=s(e,S,i)):x[I]=null;x.obj=w;var k=h(x);null!==k&&(k<o||(x.score=k,d<a?(p.add(x),++d):(++m,k>p.peek().score&&p.replaceTop(x))))}else if(n&&n.key){var C=n.key;for(b=v-1;b>=0;--b)(S=u(w=t[b],C))&&(c(S)||(S=_.getPrepared(S)),null!==(O=s(e,S,i))&&(O.score<o||(O={target:O.target,_targetLowerCodes:null,_nextBeginningIndexes:null,score:O.score,indexes:O.indexes,obj:w},d<a?(p.add(O),++d):(++m,O.score>p.peek().score&&p.replaceTop(O)))))}else for(b=v-1;b>=0;--b){var S,O;(S=t[b])&&(c(S)||(S=_.getPrepared(S)),null!==(O=s(e,S,i))&&(O.score<o||(d<a?(p.add(O),++d):(++m,O.score>p.peek().score&&p.replaceTop(O)))))}if(0===d)return r;var M=new Array(d);for(b=d-1;b>=0;--b)M[b]=p.poll();return M.total=d+m,M},goAsync:function(t,n,i){var o=!1,a=new Promise((function(a,s){if(!t)return a(r);var p=(t=_.prepareSearch(t))[0],m=d(),v=n.length-1,h=i&&i.threshold||f&&f.threshold||-9007199254740991,y=i&&i.limit||f&&f.limit||9007199254740991,g=(i&&void 0!==i.allowTypo?i.allowTypo:!f||void 0===f.allowTypo||f.allowTypo)?_.algorithm:_.algorithmNoTypo,b=0,w=0;function x(){if(o)return s("canceled");var d=Date.now();if(i&&i.keys)for(var f=i.scoreFn||l,I=i.keys,k=I.length;v>=0;--v){for(var C=n[v],S=new Array(k),O=k-1;O>=0;--O)(T=u(C,D=I[O]))?(c(T)||(T=_.getPrepared(T)),S[O]=g(t,T,p)):S[O]=null;S.obj=C;var M=f(S);if(null!==M&&!(M<h)&&(S.score=M,b<y?(m.add(S),++b):(++w,M>m.peek().score&&m.replaceTop(S)),v%1e3==0&&Date.now()-d>=10))return void(e?setImmediate(x):setTimeout(x))}else if(i&&i.key){for(var D=i.key;v>=0;--v)if((T=u(C=n[v],D))&&(c(T)||(T=_.getPrepared(T)),null!==(A=g(t,T,p))&&!(A.score<h)&&(A={target:A.target,_targetLowerCodes:null,_nextBeginningIndexes:null,score:A.score,indexes:A.indexes,obj:C},b<y?(m.add(A),++b):(++w,A.score>m.peek().score&&m.replaceTop(A)),v%1e3==0&&Date.now()-d>=10)))return void(e?setImmediate(x):setTimeout(x))}else for(;v>=0;--v){var T,A;if((T=n[v])&&(c(T)||(T=_.getPrepared(T)),null!==(A=g(t,T,p))&&!(A.score<h)&&(b<y?(m.add(A),++b):(++w,A.score>m.peek().score&&m.replaceTop(A)),v%1e3==0&&Date.now()-d>=10)))return void(e?setImmediate(x):setTimeout(x))}if(0===b)return a(r);for(var R=new Array(b),L=b-1;L>=0;--L)R[L]=m.poll();R.total=b+w,a(R)}e?setImmediate(x):x()}));return a.cancel=function(){o=!0},a},highlight:function(e,t,n){if(null===e)return null;void 0===t&&(t="<b>"),void 0===n&&(n="</b>");for(var r="",i=0,o=!1,a=e.target,s=a.length,l=e.indexes,u=0;u<s;++u){var c=a[u];if(l[i]===u){if(o||(o=!0,r+=t),++i===l.length){r+=c+n+a.substr(u+1);break}}else o&&(o=!1,r+=n);r+=c}return r},prepare:function(e){if(e)return{target:e,_targetLowerCodes:_.prepareLowerCodes(e),_nextBeginningIndexes:null,score:null,indexes:null,obj:null}},prepareSlow:function(e){if(e)return{target:e,_targetLowerCodes:_.prepareLowerCodes(e),_nextBeginningIndexes:_.prepareNextBeginningIndexes(e),score:null,indexes:null,obj:null}},prepareSearch:function(e){if(e)return _.prepareLowerCodes(e)},getPrepared:function(e){if(e.length>999)return _.prepare(e);var n=t.get(e);return void 0!==n||(n=_.prepare(e),t.set(e,n)),n},getPreparedSearch:function(e){if(e.length>999)return _.prepareSearch(e);var t=n.get(e);return void 0!==t||(t=_.prepareSearch(e),n.set(e,t)),t},algorithm:function(e,t,n){for(var r=t._targetLowerCodes,o=e.length,s=r.length,l=0,u=0,c=0,d=0;;){if(n===r[u]){if(i[d++]=u,++l===o)break;n=e[0===c?l:c===l?l+1:c===l-1?l-1:l]}if(++u>=s)for(;;){if(l<=1)return null;if(0===c){if(n===e[--l])continue;c=l}else{if(1===c)return null;if((n=e[1+(l=--c)])===e[l])continue}u=i[(d=l)-1]+1;break}}l=0;var p=0,f=!1,m=0,v=t._nextBeginningIndexes;null===v&&(v=t._nextBeginningIndexes=_.prepareNextBeginningIndexes(t.target));var h=u=0===i[0]?0:v[i[0]-1];if(u!==s)for(;;)if(u>=s){if(l<=0){if(++p>o-2)break;if(e[p]===e[p+1])continue;u=h;continue}--l,u=v[a[--m]]}else if(e[0===p?l:p===l?l+1:p===l-1?l-1:l]===r[u]){if(a[m++]=u,++l===o){f=!0;break}++u}else u=v[u];if(f)var y=a,g=m;else y=i,g=d;for(var b=0,w=-1,x=0;x<o;++x)w!==(u=y[x])-1&&(b-=u),w=u;for(f?0!==p&&(b+=-20):(b*=1e3,0!==c&&(b+=-20)),b-=s-o,t.score=b,t.indexes=new Array(g),x=g-1;x>=0;--x)t.indexes[x]=y[x];return t},algorithmNoTypo:function(e,t,n){for(var r=t._targetLowerCodes,o=e.length,s=r.length,l=0,u=0,c=0;;){if(n===r[u]){if(i[c++]=u,++l===o)break;n=e[l]}if(++u>=s)return null}l=0;var d=!1,p=0,f=t._nextBeginningIndexes;if(null===f&&(f=t._nextBeginningIndexes=_.prepareNextBeginningIndexes(t.target)),(u=0===i[0]?0:f[i[0]-1])!==s)for(;;)if(u>=s){if(l<=0)break;--l,u=f[a[--p]]}else if(e[l]===r[u]){if(a[p++]=u,++l===o){d=!0;break}++u}else u=f[u];if(d)var m=a,v=p;else m=i,v=c;for(var h=0,y=-1,g=0;g<o;++g)y!==(u=m[g])-1&&(h-=u),y=u;for(d||(h*=1e3),h-=s-o,t.score=h,t.indexes=new Array(v),g=v-1;g>=0;--g)t.indexes[g]=m[g];return t},prepareLowerCodes:function(e){for(var t=e.length,n=[],r=e.toLowerCase(),i=0;i<t;++i)n[i]=r.charCodeAt(i);return n},prepareBeginningIndexes:function(e){for(var t=e.length,n=[],r=0,i=!1,o=!1,a=0;a<t;++a){var s=e.charCodeAt(a),l=s>=65&&s<=90,u=l||s>=97&&s<=122||s>=48&&s<=57,c=l&&!i||!o||!u;i=l,o=u,c&&(n[r++]=a)}return n},prepareNextBeginningIndexes:function(e){for(var t=e.length,n=_.prepareBeginningIndexes(e),r=[],i=n[0],o=0,a=0;a<t;++a)i>a?r[a]=i:(i=n[++o],r[a]=void 0===i?t:i);return r},cleanup:s,new:o};return _}()},e.exports?e.exports=n():t.fuzzysort=n()})),Ms="styles-module_search__2j0G1",Ds="styles-module_resultCount__12RMZ";function Ts(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}Qt(".styles-module_search__2j0G1 {\n margin-top: 1rem;\n margin-bottom: 0.5rem;\n display: flex;\n width: 100%;\n flex: 1 1 0%;\n overflow: hidden;\n border-radius: 0.25rem;\n border-width: 1px;\n border-style: solid;\n --tw-border-opacity: 1;\n border-color: rgba(229, 231, 235, var(--tw-border-opacity)); }\n .styles-module_search__2j0G1 input {\n margin: 0.25rem;\n height: 100%;\n width: 100%;\n flex: 1 1 0%;\n border-style: none;\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem; }\n\n.styles-module_resultCount__12RMZ {\n display: flex;\n align-items: center;\n justify-content: center;\n border-left-width: 1px;\n border-top-width: 0px;\n border-right-width: 0px;\n border-bottom-width: 0px;\n border-style: solid;\n --tw-border-opacity: 1;\n border-color: rgba(229, 231, 235, var(--tw-border-opacity));\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n font-size: 0.875rem;\n line-height: 1.25rem;\n font-weight: 700;\n --tw-text-opacity: 1;\n color: rgba(156, 163, 175, var(--tw-text-opacity)); }\n");var As,Rs=function(e){Re(n,e);var t=Ts(n);function n(e){var r;return z(this,n),V(Te(r=t.call(this,e)),"onInput",(function(e){if(e.target instanceof HTMLInputElement){var t=e.target.value;r.setState({value:t}),r.props.onChange(t)}})),r.state={value:r.props.initialValue||""},r}return ft(n,[{key:"render",value:function(){return Ie(ks||(ks=F(["\n <div class="," ",">\n <input\n placeholder=","\n value=","\n oninput=","\n />\n <div class=",">"," results</div>\n </div>\n "])),Ms,"integry-search",this.props.placeholder||"Search...",this.state.value,this.onInput,Ds,this.props.resultCount)}}]),n}(ne),Ls="styles-module_nav__bKw4L",Ns="styles-module_tab__3xQCg",Ps="styles-module_tabactive__2JeoG";Qt(".styles-module_nav__bKw4L {\n margin-bottom: 0px;\n margin-top: 0px;\n padding: 0px;\n border-top-width: 0px;\n border-right-width: 0px;\n border-left-width: 0px;\n border-bottom-width: 1px;\n border-style: solid;\n border-color: rgba(107, 114, 128, 0.25); }\n\n.styles-module_tab__3xQCg {\n display: inline-block;\n cursor: pointer;\n list-style-type: none;\n border-bottom-width: 2px;\n border-color: transparent;\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n padding-bottom: 0.25rem;\n line-height: 2rem;\n color: #9ca3af;\n transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n margin-bottom: -1px; }\n .styles-module_tab__3xQCg:hover {\n border-width: 0px;\n border-bottom-width: 2px;\n border-style: solid;\n border-color: #509cf6; }\n\n.styles-module_tabactive__2JeoG {\n border-width: 0px;\n border-bottom-width: 2px;\n border-style: solid;\n border-color: #509cf6;\n color: #374151; }\n");var Es,js,Fs,zs=function(e){var t=e.label,n=e.activeTab,r=e.onClick;return Ie(As||(As=F(["\n <li\n class=","\n onclick=","\n >\n ","\n </li>\n "])),"".concat(Ns," ").concat(n===t?Ps:""),(function(){r(t)}),t)},Vs=function(e){var t=e.preSelectedTab,n=e.children;if(!Array.isArray(n)||n.length<2)throw new Error("Tab Bar must have at least two children");var r=Je(tt(t||n[0].props.label),2),i=r[0],o=r[1],a=function(e){o(e)};return Ie(Es||(Es=F(["\n <div>\n <ol class=",">\n ",'\n </ol>\n <div className="tab-content">\n ',"\n </div>\n </div>\n "])),Ls,n.map((function(e){var t=e.props.label;return Ie(js||(js=F(["\n <","\n activeTab=","\n key=","\n label=","\n onClick=","\n >\n <//>\n "])),zs,i,t,t,a)})),n.map((function(e){if(e.props.label===i)return e.props.children})))},Us="styles-module_toggle__2c6vj",Hs="styles-module_inner__2w3FN",Bs="styles-module_toggled__3gmsw";Qt(".styles-module_toggle__2c6vj {\n position: relative; }\n .styles-module_toggle__2c6vj .styles-module_inner__2w3FN {\n position: relative;\n border-radius: 9999px;\n background-color: #9ca3af;\n transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n transition-timing-function: linear;\n position: relative;\n height: 20px;\n width: 40px; }\n .styles-module_toggle__2c6vj .styles-module_inner__2w3FN.styles-module_toggled__3gmsw {\n background: #39d239; }\n .styles-module_toggle__2c6vj .styles-module_inner__2w3FN label {\n position: absolute;\n left: 0px;\n margin-bottom: 0.5rem;\n transform: translateX(0px);\n cursor: pointer;\n border-radius: 9999px;\n border-width: 2px;\n border-style: solid;\n border-color: #9ca3af;\n background-color: white;\n transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n transition-duration: 300ms;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n height: 16px;\n width: 16px; }\n .styles-module_toggle__2c6vj .styles-module_inner__2w3FN label.styles-module_toggled__3gmsw {\n border-color: #39d239;\n transform: translateX(100%); }\n .styles-module_toggle__2c6vj .styles-module_inner__2w3FN input {\n -webkit-appearance: none;\n appearance: none;\n width: 100%;\n height: 100%; }\n .styles-module_toggle__2c6vj .styles-module_inner__2w3FN input:active {\n outline: none; }\n .styles-module_toggle__2c6vj .styles-module_inner__2w3FN input:focus {\n outline: none; }\n");var Ws,Js,qs,Gs,Ks,Zs=function(e){var t=e.id,n=e.value,r=e.onChange;return Ie(Fs||(Fs=F(["\n <div class=",">\n <div class=",">\n <label for="," class=",'></label>\n <input type="checkbox" id='," onclick="," />\n </div>\n </div>\n "])),Us,"".concat(Hs," ").concat(n?Bs:""," "),t,"".concat(n?Bs:""," "),t,(function(){r(!n)}))},Ys="styles-module_integrations__2vJT8",Qs="styles-module_integration__MtN8C",Xs="styles-module_header__1d_zB",$s="styles-module_row__1UAlk",el="styles-module_topbar__3TTLr";function tl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}Qt(".styles-module_integrations__2vJT8 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n display: flex;\n flex-direction: column; }\n .styles-module_integrations__2vJT8 .styles-module_integration__MtN8C {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem; }\n .styles-module_integrations__2vJT8 .styles-module_integration__MtN8C img {\n height: 3rem;\n width: 3rem; }\n\n.styles-module_header__1d_zB {\n margin-bottom: 0.75rem;\n margin-top: 1.5rem;\n letter-spacing: 0.025em;\n --tw-text-opacity: 1;\n color: rgba(80, 156, 246, var(--tw-text-opacity)); }\n\n.styles-module_row__1UAlk {\n display: flex;\n align-items: center;\n justify-content: space-between;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n border-radius: 0.25rem;\n cursor: pointer;\n border-width: 1px;\n border-style: solid;\n --tw-border-opacity: 1;\n border-color: rgba(229, 231, 235, var(--tw-border-opacity));\n padding-left: 1.25rem;\n padding-right: 1.25rem;\n padding-top: 1rem;\n padding-bottom: 1rem;\n font-size: 0.875rem;\n line-height: 1.25rem;\n --tw-text-opacity: 1;\n color: rgba(55, 65, 81, var(--tw-text-opacity));\n transition: border-color 0.2s; }\n .styles-module_row__1UAlk:hover {\n border-color: #a8a8a8; }\n\n.styles-module_topbar__3TTLr {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-top: 1rem; }\n");var nl,rl,il=function(e){Re(n,e);var t=tl(n);function n(){var e;z(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return V(Te(e=t.call.apply(t,[this].concat(i))),"toggleIntegration",(function(t,n){e.props.apiHandler.toggleIntegration(t,n).then((function(e){console.info(e)})).catch((function(e){return console.error(e)}))})),V(Te(e),"onIntegrationDelete",(function(t){e.props.apiHandler.deleteIntegration(t).then((function(e){console.info(e)})).catch((function(e){return console.error(e)}))})),e}return ft(n,[{key:"render",value:function(){var e=this;return Ie(Ws||(Ws=F(["\n <div>\n <div class=",">\n \x3c!-- <h2 class=",">My Flows</h2> --\x3e\n \x3c!-- <"," items=",' value="sort" //> --\x3e\n </div>\n <div class=','>\n <div class="flex w-12">Status</div>\n <div class="flex w-12"></div>\n <div class="flex-1 pl-4">Integration Name</div>\n <div class="w-24">Runs</div>\n <div class="w-40">Last Activity</div>\n <div class="w-16"></div>\n <div class="flex w-6"></div>\n </div>\n <div class=',">\n ","\n ","\n </div>\n </div>\n "])),el,Xs,qi,[{id:"sort",value:"Sort"}],$s,Ys,this.props.integrations.length<1&&Ie(Js||(Js=F(["No integrations"]))),this.props.integrations.map((function(t){return Ie(qs||(qs=F(['\n <div\n class="'," ",'"\n >\n <div class=','>\n <div class="flex w-12">\n ','\n </div>\n <div class="flex w-12">\n <img src=',' />\n </div>\n <div class="flex-1 pl-4">','</div>\n <div class="w-24">','</div>\n <div class="w-40">\n ','\n </div>\n <div class="w-16">\n <',"\n id=","\n value=","\n onChange=",'\n >\n <//>\n </div>\n <div\n class="flex w-6 cursor-pointer"\n onclick=','\n >\n <svg\n width="12"\n height="15"\n viewBox="0 0 12 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M0 4.16667H12"\n stroke="#F05C42"\n stroke-width="1.2"\n />\n <path\n d="M10 5.5V6.16667L9.33333 13.5H2.66667L2 6.16667V5.5"\n stroke="#F05C42"\n stroke-width="1.2"\n stroke-linejoin="round"\n />\n <path\n d="M4 3.5V2.16667C4 1.79848 4.29848 1.5 4.66667 1.5H7.33333C7.70152 1.5 8 1.79848 8 2.16667V3.5"\n stroke="#F05C42"\n stroke-width="1.2"\n />\n </svg>\n </div>\n </div>\n </div>\n '])),Qs,"integry_container_Integration",$s,"fail"!==t.task_execution.status?Ie(Gs||(Gs=F(['\n <svg\n width="22"\n height="22"\n viewBox="0 0 25 25"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <circle\n cx="12.5"\n cy="12.5"\n r="12.5"\n fill="#2ECC71"\n />\n <path\n d="M17.2209 9.16699L11.3907 15.8337L8.33203 12.3361"\n stroke="white"\n stroke-width="1.2"\n stroke-linecap="round"\n />\n </svg>\n ']))):Ie(Ks||(Ks=F(['<svg\n width="22"\n height="25"\n viewBox="0 0 25 27"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <circle cx="12.5" cy="12.5" r="12.5" fill="#E26154" />\n <g filter="url(#filter0_d)">\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M11.1886 8.05792C11.1209 7.32574 11.7556 6.61621 12.4701 6.61621C13.2413 6.61621 13.8535 7.32568 13.7963 8.05792L13.3542 13.5234C13.3206 14.0117 12.8896 14.3955 12.4019 14.3605C11.9713 14.3255 11.6422 13.9535 11.6196 13.5234L11.1886 8.05792ZM11.1836 16.9743C11.1836 16.3124 11.7654 15.7737 12.4835 15.7737C13.2189 15.7737 13.8007 16.3124 13.8 16.9743V17.2052C13.8 17.8671 13.2015 18.3902 12.4835 18.3902C11.7647 18.3902 11.1836 17.8671 11.1836 17.2052V16.9743Z"\n fill="white"\n />\n </g>\n <defs>\n <filter\n id="filter0_d"\n x="7.18359"\n y="6.61621"\n width="10.6164"\n height="19.7739"\n filterUnits="userSpaceOnUse"\n color-interpolation-filters="sRGB"\n >\n <feFlood\n flood-opacity="0"\n result="BackgroundImageFix"\n />\n <feColorMatrix\n in="SourceAlpha"\n type="matrix"\n values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"\n result="hardAlpha"\n />\n <feOffset dy="4" />\n <feGaussianBlur stdDeviation="2" />\n <feColorMatrix\n type="matrix"\n values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"\n />\n <feBlend\n mode="normal"\n in2="BackgroundImageFix"\n result="effect1_dropShadow"\n />\n <feBlend\n mode="normal"\n in="SourceGraphic"\n in2="effect1_dropShadow"\n result="shape"\n />\n </filter>\n </defs>\n </svg> ']))),t.icon_url,t.name,t.runs_count,t.task_execution.last_execution_at?function(e){var t=Math.floor((Date.now()-e.getTime())/1e3),n=[{label:"year",seconds:31536e3},{label:"month",seconds:2592e3},{label:"day",seconds:86400},{label:"hour",seconds:3600},{label:"minute",seconds:60},{label:"A few second",seconds:0}].find((function(e){return e.seconds<t}));if(n){var r=Math.floor(t/n.seconds);return Number.isInteger(r)||(r=0),"".concat(r>0?r:""," ").concat(n.label).concat(1!==r?"s":""," ago")}return"Cannot be formatted with interval ".concat(n)}(new Date("".concat(t.task_execution.last_execution_at.date," ").concat(t.task_execution.last_execution_at.timezone))):"Never run",Zs,t.id,"ACTIVE"===t.status,(function(n){return e.toggleIntegration(t.id,n)}),(function(){return e.onIntegrationDelete(t.id)}))})))}}]),n}(ne);!function(e){e.MODAL="MODAL",e.INLINE="INLINE",e.DETACHED="DETACHED",e.CUSTOM="CUSTOM"}(nl||(nl={})),function(e){e.GRID="GRID",e.LIST="LIST"}(rl||(rl={}));var ol,al,sl,ll,ul="styles-module_template_list__3HABS",cl="styles-module_template_grid__mH7-0",dl="styles-module_header__cdTrS";function pl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}Qt(".styles-module_template_list__3HABS {\n display: grid;\n grid-template-columns: repeat(1, minmax(0, 1fr));\n gap: 0.5rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem; }\n\n.styles-module_template_grid__mH7-0 {\n display: grid;\n grid-template-columns: repeat(1, minmax(0, 1fr));\n gap: 0.5rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem; }\n @media (min-width: 768px) {\n .styles-module_template_grid__mH7-0 {\n grid-template-columns: repeat(3, minmax(0, 1fr)); } }\n @media (min-width: 1280px) {\n .styles-module_template_grid__mH7-0 {\n grid-template-columns: repeat(5, minmax(0, 1fr)); } }\n\n.styles-module_header__cdTrS {\n margin-bottom: 0.75rem;\n margin-top: 1.5rem;\n letter-spacing: 0.025em;\n --tw-text-opacity: 1;\n color: rgba(80, 156, 246, var(--tw-text-opacity)); }\n");var fl,_l,ml,vl,hl,yl=function(e){Re(n,e);var t=pl(n);function n(){var e;return z(this,n),V(Te(e=t.call(this)),"filterTemplates",(function(t){t?e.setState({filteredTemplates:Os.go(t,e.state.templates,{keys:["name","branding_app.tags"],scoreFn:function(e){var t=e[0],n=e[1];return Math.max(t?t.score+100:-1/0,n?n.score:-1/0)}}).map((function(e){return e.obj}))}):e.setState({filteredTemplates:e.state.templates})})),V(Te(e),"onTemplateClick",(function(t){e.props.setGenericData({templateId:t}),e.props.onTemplateClick&&e.props.onTemplateClick(t)})),e.state={loading:!1,integrations:[],templates:[],filteredTemplates:[]},e}return ft(n,[{key:"componentDidMount",value:function(){var e=this;this.setState({loading:!0}),this.props.apiHandler.getTemplateListing(this.props.bundleId).then((function(t){t&&e.setState({integrations:t.integrations,templates:t.templates,filteredTemplates:t.templates,loading:!1})}))}},{key:"render",value:function(){var e,t,n=this;return Ie(ol||(ol=F(["\n <div>\n ","\n </div>\n "])),this.state.loading?Ie(al||(al=F([" <"," //> "])),en):Ie(sl||(sl=F(["\n <",">\n <div\n label=","\n >\n \x3c!-- <h2 class=",">Available Flows</h2> --\x3e\n <div>\n <","\n resultCount=","\n onChange=",'\n >\n <//>\n </div>\n <div\n class="'," ",'"\n >\n ',"\n </div>\n </div>\n <div label=",">\n <"," apiHandler=","\n integrations="," //>\n </div>\n <//>\n "])),Vs,(null===(e=this.props.userConfig)||void 0===e?void 0:e.availableFlowsLabel)||"Available Flows",dl,Rs,this.state.filteredTemplates.length,(function(e){return n.filterTemplates(e)}),this.props.layout===rl.LIST?ul:cl,"integry-container_TemplatesView",this.state.filteredTemplates.map((function(e){return Ie(ll||(ll=F(["\n <","\n name=","\n description=","\n layout=","\n tags=","\n imgUrl=","\n onClick=","\n >\n <//>\n "])),n.props.templateContainerTemplate,e.name,e.description,n.props.layout,e.branding_app.tags,e.branding_app.icon_url,(function(){return n.onTemplateClick(e.id)}))})),(null===(t=this.props.userConfig)||void 0===t?void 0:t.myFlowsLabel)||"My Flows",il,this.props.apiHandler,this.state.integrations))}}],[{key:"handleClick",value:function(e){e.preventDefault(),e.target instanceof HTMLElement&&console.info(e.target.localName)}}]),n}(ne),gl=Me.connect("userConfig",Kt)(yl),bl="styles-module_navigation__2nFX8",wl="styles-module_navItem__ozaSU",xl="styles-module_navItemContent__3UHl8",Il="styles-module_imgContainer__c7lfR",kl="styles-module_active__1nm22",Cl="styles-module_disabled__1JpJ1";function Sl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}Qt(".styles-module_navigation__2nFX8 {\n width: 12rem; }\n\n.styles-module_navItem__ozaSU {\n margin-bottom: 0.5rem;\n cursor: pointer;\n --tw-text-opacity: 1;\n color: rgba(31, 41, 55, var(--tw-text-opacity)); }\n .styles-module_navItem__ozaSU .styles-module_navItemContent__3UHl8 {\n display: flex;\n height: 2.5rem;\n align-items: center;\n font-size: 0.875rem;\n line-height: 1.25rem; }\n .styles-module_navItem__ozaSU .styles-module_navItemContent__3UHl8 .styles-module_imgContainer__c7lfR {\n margin-right: 0.75rem;\n height: 1.5rem;\n width: 1.5rem;\n overflow: hidden;\n border-radius: 9999px; }\n .styles-module_navItem__ozaSU .styles-module_navItemContent__3UHl8 .styles-module_imgContainer__c7lfR img,\n .styles-module_navItem__ozaSU .styles-module_navItemContent__3UHl8 .styles-module_imgContainer__c7lfR svg {\n height: 100%;\n width: 100%;\n object-fit: cover; }\n .styles-module_navItem__ozaSU.styles-module_active__1nm22 {\n opacity: 1; }\n .styles-module_navItem__ozaSU.styles-module_disabled__1JpJ1 {\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n opacity: 0.5; }\n");var Ol,Ml,Dl,Tl=Ie(fl||(fl=F([' <svg\n width="15"\n height="15"\n viewBox="0 0 15 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n>\n <rect opacity="0.7" width="15" height="15" rx="7.5" fill="#2ECC71" />\n <path\n d="M9.23107 6.34619L6.96066 8.94234L5.76953 7.58033"\n stroke="white"\n stroke-width="1.2"\n stroke-linecap="round"\n />\n</svg>']))),Al=Ie(_l||(_l=F(['\n <svg\n width="15"\n height="15"\n viewBox="0 0 15 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <circle\n cx="7.5"\n cy="7.5"\n r="6.75"\n fill="white"\n stroke="#2ECC71"\n stroke-width="1.5"\n />\n <path\n d="M10.3333 5.5L6.83522 9.5L5 7.40148"\n stroke="#2ECC71"\n stroke-width="1.5"\n stroke-linecap="round"\n />\n </svg>\n']))),Rl=function(e){Re(n,e);var t=Sl(n);function n(){return z(this,n),t.apply(this,arguments)}return ft(n,[{key:"render",value:function(){var e=this.props,t=e.logoUrl,n=e.isActive,r=void 0!==n&&n,i=e.isCompleted,o=void 0!==i&&i,a=e.isDisabled,s=void 0!==a&&a,l=e.isLastStep,u=void 0!==l&&l,c=e.onClick,d=void 0===c?function(){return null}:c;return Ie(ml||(ml=F(["\n <div\n class=","\n onclick=",'\n tabindex="-1"\n role="button"\n >\n <div class=',">\n <div class=",">\n ","\n </div>\n <div>","</div>\n </div>\n </div>\n "])),"".concat(wl," ").concat(s?Cl:""," ").concat(r?kl:""),d,xl,Il,u?Al:Ie(vl||(vl=F(["\n ","\n "])),!o||r?Ie(hl||(hl=F(["<img src="," />"])),t):Tl),this.props.label)}}]),n}(ne);function Ll(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}var Nl=function(e){Re(n,e);var t=Ll(n);function n(){var e;z(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return V(Te(e=t.call.apply(t,[this].concat(i))),"changeStep",(function(t){e.props.gotoStep(t)})),e}return ft(n,[{key:"render",value:function(){var e,t=this,n=this.props.stepState,r=null==n?void 0:n.currentStep;return Ie(Ol||(Ol=F(["\n <div class=",">\n <div>\n ","\n <",'\n label="Confirmation"\n isCompleted=',"\n isActive=","\n isDisabled=","\n isLastStep=","\n onClick=","\n />\n </div>\n </div>\n "])),bl,this.props.stepState&&Ie(Ml||(Ml=F(["\n ","\n "])),null===(e=this.props.stepState)||void 0===e?void 0:e.steps.map((function(e,i){return Ie(Dl||(Dl=F([" <","\n label=","\n logoUrl=","\n isCompleted=","\n isActive=","\n isDisabled=","\n isLastStep=","\n onClick=","\n />"])),Rl,"CONFIRMATION"!==e.type?e.title:"Confirmation","CONFIRMATION"!==e.type&&e.iconUrl,e.isCompleted,"CONFIRMATION"!==(null==r?void 0:r.type)&&"CONFIRMATION"!==e.type&&n.stepIndex===i,Number(null==n?void 0:n.stepIndex)<i,!1,(function(){return t.changeStep(i)}))}))),Rl,!0,void 0!==r&&(null==n?void 0:n.stepIndex)===(null==n?void 0:n.steps.length),void 0!==r&&(null==n?void 0:n.stepIndex)!==(null==n?void 0:n.steps.length),!0,(function(){var e;return t.changeStep(null!==(e=null==n?void 0:n.steps.length)&&void 0!==e?e:0)}))}}]),n}(ne);Nl.defaultProps={currentStepIndex:-1,completedTillIndex:-1};var Pl,El,jl,Fl,zl,Vl,Ul,Hl,Bl,Wl,Jl,ql=Me.connect("stepState",Kt)(Nl),Gl={stepsWrap:"styles-module_stepsWrap__axf95",stepsContainer:"styles-module_stepsContainer__1vEyC",stepContainer:"styles-module_stepContainer__1u05c",top:"styles-module_top__1EhEd",bottom:"styles-module_bottom__3dACP",buttons:"styles-module_buttons__LDv9h"};function Kl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}Qt(".styles-module_stepsWrap__axf95 {\n min-height: 400px;\n margin-top: 1rem;\n display: flex;\n min-height: 400px; }\n .styles-module_stepsWrap__axf95 .styles-module_stepsContainer__1vEyC {\n border-width: 0px;\n border-right-width: 1px;\n border-style: solid;\n --tw-border-opacity: 1;\n border-color: rgba(209, 213, 219, var(--tw-border-opacity));\n padding-right: 1rem; }\n .styles-module_stepsWrap__axf95 .styles-module_stepContainer__1u05c {\n display: flex;\n width: 100%;\n flex-direction: column;\n padding-left: 1rem; }\n .styles-module_stepsWrap__axf95 .styles-module_stepContainer__1u05c .styles-module_top__1EhEd {\n display: flex;\n width: 100%;\n flex: 1 1 0%; }\n .styles-module_stepsWrap__axf95 .styles-module_stepContainer__1u05c .styles-module_bottom__3dACP {\n display: flex;\n justify-content: flex-end; }\n .styles-module_stepsWrap__axf95 .styles-module_stepContainer__1u05c .styles-module_bottom__3dACP .styles-module_buttons__LDv9h {\n display: flex; }\n .styles-module_stepsWrap__axf95 .styles-module_stepContainer__1u05c .styles-module_bottom__3dACP .styles-module_buttons__LDv9h button:not(:last-child) {\n margin-right: 14px; }\n");var Zl=function(e){Re(n,e);var t=Kl(n);function n(e){var r;return z(this,n),V(Te(r=t.call(this,e)),"createIntegration",(function(){var e,t,n=r.props,i=n.stepMapping,o=n.stepDataMapping;console.info(i),r.setState({loading:!0});var a={name:null!==(e=null===(t=r.props.genericData.templateApp)||void 0===t?void 0:t.name)&&void 0!==e?e:"My new flow",notification_email:"",template:Number(r.props.genericData.templateId),bundle_id:Number(r.props.genericData.bundleId),steps:Object.keys(i).map((function(e){return{id:i[e].step.id,authorization:Number(i[e].selectedAuthId),template_step:i[e].step.id,app_user_data:i[e].step.template_fields.map((function(t){return{id:t.id,value:!o[i[e].step.id][t.id].value&&""!==o[i[e].step.id][t.id].value||o[i[e].step.id][t.id].objectValue?JSON.stringify(o[i[e].step.id][t.id].objectValue):"".concat(o[i[e].step.id][t.id].value),template_field:t.id}}))}}))};console.info(a),r.context.apiHandler.saveIntegration(a).then((function(e){console.info(e),r.setState({loading:!1})})).catch((function(e){return console.error(e)}))})),V(Te(r),"handleAuthSelected",(function(e,t,n,i){var o=r.props.stepMapping[t].step.template_fields.filter((function(e){return e.activity_field&&e.activity_field.is_dynamic})).map((function(e){return e.id}));r.props.setStepAuthorization(t,e,n,o,i)})),r.state={loading:!1,selectedAuthStep:null},r}return ft(n,[{key:"render",value:function(){var e,t,n,r,i,o=this,a=null,s=this.props.stepState,l=s.currentStep,u=s.stepIndex,c=s.steps,d=!1,p=!1,f=!1,_=!1;u>-1&&"CONFIRMATION"!==(null==l?void 0:l.type)?(a=this.props.stepMapping[Number(null==l?void 0:l.stepId)],d=!1,p=this.props.stepState.stepIndex>0,f=null!==(i=null==l?void 0:l.isValid)&&void 0!==i&&i,_=s.showValidation):"CONFIRMATION"===(null==l?void 0:l.type)&&u===c.length&&(d=!0);return Ie(Pl||(Pl=F(["\n <div class=",">\n <div class=",">\n <","\n steps=","\n currentStepIndex=","\n completedTillIndex=","\n ><//>\n </div>\n <div class=",">\n <div class=",">\n ","\n </div>\n\n <div class=",">\n ","\n </div>\n <div class=",">\n <div class=",">\n ","\n ","\n </div>\n </div>\n </div>\n </div>\n "])),Gl.stepsWrap,Gl.stepsContainer,ql,null===(e=this.props.steps)||void 0===e?void 0:e.map((function(e){return{label:e.title,logoUrl:e.activity.app.icon_url}})),-1,-1,Gl.stepContainer,Gl.stepInfo,d?Ie(El||(El=F(['\n <svg\n width="25"\n height="25"\n viewBox="0 0 25 25"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <circle\n cx="12.5"\n cy="12.5"\n r="11.75"\n fill="white"\n stroke="#2ECC71"\n stroke-width="1.5"\n />\n <path\n d="M17.2209 9.16699L11.3907 15.8337L8.33203 12.3361"\n stroke="#2ECC71"\n stroke-width="1.5"\n stroke-linecap="round"\n />\n </svg>\n <div>Confirmation</div>\n ']))):Ie(jl||(jl=F(["\n \x3c!-- <img src="," />\n <div>","</div> --\x3e\n "])),null===(t=a)||void 0===t?void 0:t.step.activity.app.icon_url,null===(n=a)||void 0===n?void 0:n.step.title),Gl.top,d?Ie(Fl||(Fl=F(["\n <div class=",">\n Your integration is ready to be enabled. Click “Save” to\n continue.\n </div>\n "])),Gl.save):Ie(zl||(zl=F(["\n ","\n "])),a&&Ie(Vl||(Vl=F(["\n ","\n "])),"AUTH"===(null==l?void 0:l.type)?Ie(Ul||(Ul=F(["\n <div class=",">\n <","\n stepId=","\n apiHandler=","\n showErrors=","\n onAuthSelected=","\n >\n <//>\n </div>\n "])),Gl.stepWrap,fi,a.step.id,this.context.apiHandler,_,(function(e,t,n){var r;return o.handleAuthSelected(e,Number(null===(r=a)||void 0===r?void 0:r.step.id),t,n)})):Ie(Hl||(Hl=F(["\n <","\n step=","\n stepType=","\n showStepValidation=","\n apiHandler=","\n eventEmitter=","\n />\n "])),Za,null===(r=a)||void 0===r?void 0:r.step,null==l?void 0:l.type,_,this.context.apiHandler,this.context.eventEmitter))),Gl.bottom,Gl.buttons,p&&Ie(Bl||(Bl=F(["\n <",'\n label="Back"\n onClick=',"\n type=","\n ><//>\n "])),Ln,(function(){return o.props.gotoPreviousStep()}),Cn.SECONDARY),d?Ie(Wl||(Wl=F(["\n <",'\n label="Save"\n isLoading=',"\n onClick=","\n ><//>\n "])),Ln,this.state.loading,(function(){return o.createIntegration()})):Ie(Jl||(Jl=F(["\n <",'\n label="Next"\n disabled=',"\n onClick=","\n ><//>\n "])),Ln,!f,(function(){return f?o.props.gotoNextStep():o.props.showStepValidationState()})))}}]),n}(ne);V(Zl,"contextType",Bt);var Yl,Ql,Xl,$l=Me.connect(["stepState","genericData","stepMapping","stepDataMapping"],Kt)(Zl),eu="styles-module_header__3p3k1",tu="styles-module_name__2PDqJ",nu="styles-module_description__39K41";function ru(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}Qt(".styles-module_header__3p3k1 {\n width: 100%;\n align-items: center;\n display: flex;\n height: 100%;\n margin-bottom: 1rem; }\n .styles-module_header__3p3k1 img {\n border-radius: 9999px;\n margin-right: 0.5rem; }\n .styles-module_header__3p3k1 .styles-module_name__2PDqJ {\n font-weight: 700;\n line-height: 1.625; }\n .styles-module_header__3p3k1 .styles-module_description__39K41 {\n font-weight: 300;\n font-size: 0.875rem;\n line-height: 1.25rem; }\n");var iu,ou,au,su=function(e){Re(n,e);var t=ru(n);function n(){var e;return z(this,n),(e=t.call(this)).state={loading:!0,template:null},e}return ft(n,[{key:"componentDidMount",value:function(){var e=this;this.props.apiHandler.getTemplate(this.props.templateId).then((function(t){t&&Promise.all(t.steps.map((function(t){return e.props.apiHandler.getTemplateStep(Number(t.id))}))).then((function(n){e.setState({template:t,loading:!1}),e.props.setSteps(n.filter(tn)),e.props.setStepMapping(n.filter(tn)),e.props.setParentChildMapping(n.filter(tn)),e.props.setGenericData({templateId:Number(e.props.templateId),bundleId:Number(e.props.bundleId)})})).catch((function(e){return console.error(e)}))})).catch((function(e){throw new Error(e)}))}},{key:"render",value:function(){var e=this.state.template;return Ie(Yl||(Yl=F(["\n <div>\n ","\n </div>\n "])),this.state.loading?Ie(Ql||(Ql=F(["<"," //>"])),en):Ie(Xl||(Xl=F(["\n <div class=",">\n <img src=",' width="40" />\n <div>\n <div class=',">","</div>\n <div class=",">\n ","\n </div>\n </div>\n </div>\n\n <","\n steps=","\n apiHandler=","\n eventEmitter=","\n />\n "])),eu,null==e?void 0:e.branding_app.icon_url,tu,null==e?void 0:e.name,nu,null==e?void 0:e.description,$l,null==e?void 0:e.steps,this.props.apiHandler,this.props.eventEmitter))}}]),n}(ne),lu=Me.connect("",Kt)(su),uu="styles-module_name__3qMVY",cu="styles-module_description__2S97K",du="styles-module_tags__2fhyE",pu="styles-module_tag__26APx",fu="styles-module_template_list_view__jxmde",_u="styles-module_template_grid_view__WmHjg";function mu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}Qt(".styles-module_name__3qMVY {\n margin-bottom: 0.5rem;\n --tw-text-opacity: 1;\n color: rgba(31, 41, 55, var(--tw-text-opacity)); }\n\n.styles-module_description__2S97K {\n font-size: 0.875rem;\n line-height: 1.25rem;\n --tw-text-opacity: 1;\n color: rgba(107, 114, 128, var(--tw-text-opacity)); }\n\n.styles-module_tags__2fhyE {\n margin-top: 0.5rem;\n margin-bottom: -0.5rem;\n display: flex;\n flex-wrap: wrap; }\n .styles-module_tags__2fhyE .styles-module_tag__26APx {\n margin-right: 0.5rem;\n margin-bottom: 0.5rem;\n border-radius: 0.75rem;\n --tw-bg-opacity: 1;\n background-color: rgba(229, 231, 235, var(--tw-bg-opacity));\n padding: 0.25rem;\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n font-size: 0.75rem;\n line-height: 1rem;\n --tw-text-opacity: 1;\n color: rgba(107, 114, 128, var(--tw-text-opacity)); }\n\n.styles-module_template_list_view__jxmde {\n display: flex;\n cursor: pointer;\n flex-direction: column;\n justify-content: space-between;\n border-radius: 0.25rem;\n border-width: 1px;\n border-style: solid;\n --tw-border-opacity: 1;\n border-color: rgba(229, 231, 235, var(--tw-border-opacity));\n padding-left: 1rem;\n padding-right: 1rem;\n padding-top: 1.25rem;\n padding-bottom: 1.25rem;\n transition: border-color 0.2s; }\n .styles-module_template_list_view__jxmde img {\n margin-bottom: 0.75rem;\n height: 2.5rem;\n width: 2.5rem; }\n .styles-module_template_list_view__jxmde:hover {\n border-color: #a8a8a8; }\n\n.styles-module_template_grid_view__WmHjg {\n display: flex;\n cursor: pointer;\n flex-direction: column;\n justify-content: space-between;\n border-radius: 0.25rem;\n border-width: 1px;\n border-style: solid;\n --tw-border-opacity: 1;\n border-color: rgba(229, 231, 235, var(--tw-border-opacity));\n padding-left: 1rem;\n padding-right: 1rem;\n padding-top: 1.25rem;\n padding-bottom: 1.25rem;\n transition: border-color 0.2s; }\n .styles-module_template_grid_view__WmHjg img {\n margin-bottom: 0.75rem;\n height: 2.5rem;\n width: 2.5rem; }\n .styles-module_template_grid_view__WmHjg:hover {\n border-color: #a8a8a8; }\n");var vu,hu,yu=function(e){Re(n,e);var t=mu(n);function n(e){var r;return z(this,n),V(Te(r=t.call(this,e)),"handleClick",(function(){console.info(r.props.name)})),r.state={templateName:r.props.name},r}return ft(n,[{key:"render",value:function(){return Ie(iu||(iu=F(["\n <div\n onclick=",'\n class="'," ",'"\n >\n <div>\n <img src='," />\n <p class=",">","</p>\n <p class=",">","</p>\n </div>\n ","\n </div>\n "])),this.props.onClick,this.props.layout===rl.LIST?fu:_u,"integry-container_Template",this.props.imgUrl,uu,this.state.templateName,cu,this.props.description,this.props.tags.length>0&&Ie(ou||(ou=F(["\n <div class=",">\n ","\n </div>\n "])),du,this.props.tags.split(",").map((function(e){return Ie(au||(au=F([" <div class=",">","</div> "])),pu,e)}))))}}],[{key:"handleClick",value:function(e){e.preventDefault(),e.target instanceof HTMLElement&&console.info(e.target.localName)}}]),n}(ne),gu="styles-module_modal__3ImBF",bu="styles-module_open__AAUJ5",wu="styles-module_modalContainer__o6TKt",xu="styles-module_inset__-NimT",Iu="styles-module_span__3nIVQ",ku="styles-module_contentWrap__2QGtd",Cu="styles-module_content__3wdFn",Su="styles-module_close__2IqHP";function Ou(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}Qt(".styles-module_modal__3ImBF {\n display: none;\n z-index: 99;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n overflow-y: auto; }\n .styles-module_modal__3ImBF.styles-module_open__AAUJ5 {\n position: fixed;\n display: block; }\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt {\n display: flex;\n min-height: 100vh;\n align-items: flex-end;\n justify-content: center;\n text-align: center; }\n @media (min-width: 640px) {\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt {\n display: block;\n padding: 0; } }\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt .styles-module_inset__-NimT {\n position: fixed;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n transition-property: opacity;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n opacity: 0.75;\n background-color: #111827; }\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt .styles-module_span__3nIVQ {\n display: none; }\n @media (min-width: 640px) {\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt .styles-module_span__3nIVQ {\n display: inline-block;\n height: 100vh;\n vertical-align: middle; } }\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt .styles-module_contentWrap__2QGtd {\n display: none;\n position: relative;\n vertical-align: bottom;\n background: white;\n border-radius: 4px;\n text-align: left;\n overflow: hidden;\n box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt .styles-module_contentWrap__2QGtd.styles-module_open__AAUJ5 {\n display: inline-block; }\n @media (min-width: 640px) {\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt .styles-module_contentWrap__2QGtd {\n width: 100%;\n max-width: 48rem;\n margin-top: 2rem;\n margin-bottom: 2rem;\n vertical-align: middle; } }\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt .styles-module_contentWrap__2QGtd .styles-module_content__3wdFn {\n position: relative;\n background: white;\n padding: 30px; }\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt .styles-module_contentWrap__2QGtd .styles-module_close__2IqHP {\n position: absolute;\n cursor: pointer;\n top: 10px;\n right: 10px; }\n");var Mu,Du=function(e){Re(n,e);var t=Ou(n);function n(){return z(this,n),t.apply(this,arguments)}return ft(n,[{key:"render",value:function(){var e=this.props.isOpen;return Ie(vu||(vu=F(["\n <div\n class=",'\n aria-labelledby="modal-title"\n role="dialog"\n aria-modal="true"\n >\n <div class=',">\n <div class=",' aria-hidden="true"></div>\n\n <span class=',' aria-hidden="true"></span>\n\n <div\n class=',"\n >\n <div class=",">\n <div\n onclick=","\n class=",'\n >\n <svg\n width="20"\n height="22"\n viewBox="0 0 20 22"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M14.2426 16.1822L5.75732 6.86328"\n stroke="#999999"\n stroke-width="2"\n stroke-linecap="round"\n />\n <path\n d="M14.2426 6.86328L5.75732 16.1822"\n stroke="#999999"\n stroke-width="2"\n stroke-linecap="round"\n />\n </svg>\n </div>\n ',"\n </div>\n </div>\n </div>\n </div>\n "])),"".concat(gu," ").concat(e?"".concat(bu):""),wu,xu,Iu,"".concat(ku," ").concat(e?"".concat(bu):""),Cu,this.props.onClose,Su,this.props.isOpen&&Ie(hu||(hu=F([" "," "])),this.props.children))}}]),n}(ne),Tu="styles-module_integry-container__3nnxM";function Au(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}Qt(".styles-module_integry-container__3nnxM {\n margin-bottom: 0.5rem; }\n\n.styles-module_modal__3R9nC {\n position: fixed;\n z-index: 10;\n overflow-y: auto;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px; }\n");var Ru=function(e){Re(n,e);var t=Au(n);function n(e){var r;return z(this,n),V(Te(r=t.call(this,e)),"templateComponent",void 0),V(Te(r),"templateListComponent",void 0),V(Te(r),"store",void 0),V(Te(r),"onTemplateClick",(function(e){r.setState({isModalOpen:!0,templateId:e})})),r.state={isModalOpen:!1,templateId:null},r.store=Zt(),r.store.setState({userConfig:e.userConfig}),r}return ft(n,[{key:"componentWillMount",value:function(){this.templateComponent=yu,this.templateListComponent=gl}},{key:"render",value:function(){var e=this;return Ie(Mu||(Mu=F(["\n <>\n <"," store=",'>\n <div class="'," ",'">\n <',"\n layout=","\n bundleId=","\n templateContainerTemplate=","\n apiHandler=","\n eventEmitter=","\n onTemplateClick=","\n >\n </div>\n <"," \n isOpen="," \n onClose=","\n > \n <"," \n apiHandler=","\n templateId=","\n bundleId="," \n />\n <//>\n <//>\n </>\n "])),Me.Provider,this.store,Tu,"integry-container",this.templateListComponent,this.props.layout,this.props.bundleId,this.templateComponent,this.context.apiHandler,this.context.eventEmitter,this.onTemplateClick,Du,this.state.isModalOpen,(function(){e.store.setState(Jt),e.setState({isModalOpen:!1,templateId:null})}),lu,this.context.apiHandler,this.state.templateId,this.props.bundleId)}}]),n}(ne);function Lu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}V(Ru,"contextType",Bt);var Nu=function(e){Re(n,e);var t=Lu(n);function n(){return z(this,n),t.apply(this,arguments)}return ft(n,[{key:"run",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.handler.apply(null,n)}}]),n}(function(){function e(t,n){z(this,e),V(this,"emitter",void 0),V(this,"handler",void 0),this.emitter=t,this.handler=n}return ft(e,[{key:"getHandler",value:function(){return this.handler}}]),e}());function Pu(e,t,n){return(Pu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ne(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function Eu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ne(e);if(t){var i=Ne(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Le(this,n)}}var ju,Fu,zu,Vu=function(e){Re(n,e);var t=Eu(n);function n(e,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(z(this,n),V(Te(i=t.call(this,e,r)),"total",void 0),V(Te(i),"i",0),i.total=o,i.total<1)throw new Error("{total} can not be less than 1");return i}return ft(n,[{key:"run",value:function(e){for(var t,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];(t=Pu(Ne(n.prototype),"run",this)).call.apply(t,[this,e].concat(i)),++this.i>=this.total&&this.emitter.off(e,this.handler)}}]),n}(Nu),Uu=function(){function e(){z(this,e),V(this,"events",Object.create(null))}return ft(e,[{key:"on",value:function(e,t){this.addEventListener(e,new Nu(this,t))}},{key:"once",value:function(e,t){this.addEventListener(e,new Vu(this,t,1))}},{key:"off",value:function(e,t){var n=this.events[e];null!=n&&n.length&&(this.events[e]=n.filter((function(e){return e.getHandler()!==t})))}},{key:"offAll",value:function(){var e=this;Object.keys(this.events).forEach((function(t){var n=e.events[t];n&&(n.length=0)})),this.events=Object.create(null)}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=this.events[e];i&&i.forEach((function(t){return t.run.apply(t,[e].concat(n))}))}},{key:"addEventListener",value:function(e,t){var n=this.events[e];Array.isArray(n)?n.push(t):this.events[e]=[t]}}]),e}();function Hu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hu(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Wu=function e(t){var n,r,o,a,s=this;(z(this,e),V(this,"config",void 0),V(this,"apiHandler",void 0),V(this,"eventEmitter",new Uu),V(this,"getRandomTemplateId",(function(e){for(var t=[],n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",r=n.length,i=0;i<e;i+=1)t.push(n.charAt(Math.floor(Math.random()*r)));return"x-integry-modal-".concat(t.join(""))})),V(this,"getAuthParamsFromUrl",(function(){var e=Fr()&&new URLSearchParams(window.location.search);if(e){var t=e.get("user_id"),n=e.get("app_key"),r=e.get("hash"),i=e.get("bundle_id");if(!(t&&n&&r&&i))throw new Error("The following auth variables are undefined: ".concat(t?"":"userId"," ").concat(n?"":"appKey"," ").concat(r?"":"hash"," ").concat(i?"":"bundleId"));return{userId:t,appKey:n,hash:r,bundleId:i}}return{userId:"",appKey:"",hash:"",bundleId:""}})),V(this,"printVersion",(function(){console.info("@integry/sdk@".concat(e.SDK_VERSION))})),V(this,"getTemplatesList",i(E.mark((function e(){return E.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s.apiHandler.getTemplateListing(s.config.bundleId));case 1:case"end":return e.stop()}}),e)})))),V(this,"setupTemplateFormDestination",(function(e,t){var n=null;if(t){if(e===nl.MODAL||e===nl.INLINE)throw new Error('The `templateContainerId` property is unsupported when render mode is set to "MODAL" or "INLINE"');(n=document.getElementById(t))||console.warn("The template form render target with id ".concat(t," was not found"))}switch(e){case nl.MODAL:return(n=document.createElement("div")).id=s.getRandomTemplateId(8),document.body.appendChild(n),n;case nl.INLINE:return null;case nl.DETACHED:case nl.CUSTOM:return n;default:throw new Error("Unsupported renderMode ".concat(e," configuration, please provide one of ").concat(JSON.stringify(Object.keys(nl))))}})),V(this,"renderTemplateForm",(function(e,t){var n=document.getElementById(t);if(n){var r=Zt();ye(Ie(ju||(ju=F(["\n <","\n value=","\n >\n <"," store=",">\n <","\n bundleId=","\n templateId=","\n >\n <//>\n <//>\n <//>\n "])),Bt.Provider,{apiHandler:s.apiHandler,eventEmitter:s.eventEmitter,integrationId:s.config.integrationId,isPreviewMode:!1,isEditMode:!!s.config.integrationId},Me.Provider,r,Ss,s.config.bundleId,e),n)}else console.warn("Integry template form render target with id ".concat(t," was not found"))})),V(this,"renderPreview",(function(e){var t=e.templateData,n=e.metadata,r=e.previewContainerId,i=document.getElementById(r);if(i){var o=Zt();ye(Ie(Fu||(Fu=F(["\n <","\n value=","\n >\n <"," store=",">\n <","\n bundleId=","\n isPreviewMode=","\n templatePreviewData=","\n previewMetadata=","\n >\n <//>\n <//>\n <//>\n "])),Bt.Provider,{apiHandler:s.apiHandler,eventEmitter:s.eventEmitter,isPreviewMode:!0},Me.Provider,o,Ss,s.config.bundleId,!0,t,n),i)}else console.warn("Integry template form render target with id ".concat(r," was not found"))})),V(this,"init",(function(e){var t=e.containerId,n=e.templateContainerId,r=e.renderMode,i=document.getElementById(t);if(!r)throw new Error("Template form render mode needs to be defined");if(s.setupTemplateFormDestination(r,n),i){var o=i.getAttribute("x-integry-layout")||rl.LIST;ye(Ie(zu||(zu=F(["\n <","\n value=","\n >\n <","\n bundleId=","\n userConfig=","\n layout=","\n >\n <//>\n <//>\n "])),Bt.Provider,{apiHandler:s.apiHandler,eventEmitter:s.eventEmitter,isPreviewMode:!1},Ru,s.config.bundleId,s.config.userConfig,o),i)}else console.warn("Integry SDK render target with id ".concat(t," was not found"))})),V(this,"destroy",(function(){try{s.eventEmitter.offAll()}catch(e){console.error("There was an error unsubscribing from all events")}})),"staging"===t.env)?r={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:"https://beta.integry.io",baseUrlv2:"https://beta.integry.io/v2",apiKey:null===(o=t.xIntegryConfig)||void 0===o?void 0:o.appAuth.apiKey}:r={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:"https://app.integry.io",baseUrlv2:"https://app.integry.io/v2",apiKey:null===(a=t.xIntegryConfig)||void 0===a?void 0:a.appAuth.apiKey};if("appKey"in t)n=Bu(Bu(Bu({},t),r),{},{appKey:t.appKey,hash:t.hash,userId:t.userId}),this.config=Bu(Bu(Bu({},t),r),{},{appKey:t.appKey,hash:t.hash,userId:t.userId,bundleId:t.bundleId,userConfig:t.userConfig});else{var l=this.getAuthParamsFromUrl()||{};n=Bu(Bu({},r),l),this.config=Bu(Bu(Bu({},r),l),{},{userConfig:t.userConfig})}this.apiHandler=new Be(n)};return V(Wu,"SDK_VERSION","0.0.69"),V(Wu,"RenderModes",nl),V(Wu,"Helpers",void 0),Wu.Helpers={getAuthHash:function(e,t){return j.apply(this,arguments)}},Wu}));
17
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).IntegryJS=t()}(this,(function(){"use strict";function _arrayLikeToArray$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray$1(e)}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _unsupportedIterableToArray$1(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray$1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray$1(e,t):void 0}}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray$1(e)||_nonIterableSpread()}function asyncGeneratorStep(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){asyncGeneratorStep(a,r,o,i,l,"next",e)}function l(e){asyncGeneratorStep(a,r,o,i,l,"throw",e)}i(void 0)}))}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Op=Object.prototype,hasOwn=Op.hasOwnProperty,undefined$1,$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";function wrap(e,t,n,r){var o=t&&t.prototype instanceof Generator?t:Generator,a=Object.create(o.prototype),i=new Context(r||[]);return a._invoke=makeInvokeMethod(e,n,i),a}function tryCatch(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}var GenStateSuspendedStart="suspendedStart",GenStateSuspendedYield="suspendedYield",GenStateExecuting="executing",GenStateCompleted="completed",ContinueSentinel={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var IteratorPrototype={};IteratorPrototype[iteratorSymbol]=function(){return this};var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);function defineIteratorMethods(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function isGeneratorFunction(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===GeneratorFunction||"GeneratorFunction"===(t.displayName||t.name))}function mark(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,toStringTagSymbol in e||(e[toStringTagSymbol]="GeneratorFunction")),e.prototype=Object.create(Gp),e}function awrap(e){return{__await:e}}function AsyncIterator(e,t){function n(r,o,a,i){var l=tryCatch(e[r],e,o);if("throw"!==l.type){var s=l.arg,p=s.value;return p&&"object"===_typeof(p)&&hasOwn.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,a,i)}),(function(e){n("throw",e,a,i)})):t.resolve(p).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,i)}))}i(l.arg)}var r;this._invoke=function(e,o){function a(){return new t((function(t,r){n(e,o,t,r)}))}return r=r?r.then(a,a):a()}}function async(e,t,n,r,o){void 0===o&&(o=Promise);var a=new AsyncIterator(wrap(e,t,n,r),o);return isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))}function makeInvokeMethod(e,t,n){var r=GenStateSuspendedStart;return function(o,a){if(r===GenStateExecuting)throw new Error("Generator is already running");if(r===GenStateCompleted){if("throw"===o)throw a;return doneResult()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var l=maybeInvokeDelegate(i,n);if(l){if(l===ContinueSentinel)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===GenStateSuspendedStart)throw r=GenStateCompleted,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=GenStateExecuting;var s=tryCatch(e,t,n);if("normal"===s.type){if(r=n.done?GenStateCompleted:GenStateSuspendedYield,s.arg===ContinueSentinel)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=GenStateCompleted,n.method="throw",n.arg=s.arg)}}}function maybeInvokeDelegate(e,t){var n=e.iterator[t.method];if(n===undefined$1){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=undefined$1,maybeInvokeDelegate(e,t),"throw"===t.method))return ContinueSentinel;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return ContinueSentinel}var r=tryCatch(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,ContinueSentinel;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=undefined$1),t.delegate=null,ContinueSentinel):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,ContinueSentinel)}function pushTryEntry(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function resetTryEntry(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Context(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(pushTryEntry,this),this.reset(!0)}function keys(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}}function values(e){if(e){var t=e[iteratorSymbol];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(hasOwn.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=undefined$1,t.done=!0,t};return r.next=r}}return{next:doneResult}}function doneResult(){return{value:undefined$1,done:!0}}GeneratorFunction.prototype=Gp.constructor=GeneratorFunctionPrototype,GeneratorFunctionPrototype.constructor=GeneratorFunction,GeneratorFunctionPrototype[toStringTagSymbol]=GeneratorFunction.displayName="GeneratorFunction",defineIteratorMethods(AsyncIterator.prototype),AsyncIterator.prototype[asyncIteratorSymbol]=function(){return this},defineIteratorMethods(Gp),Gp[toStringTagSymbol]="Generator",Gp[iteratorSymbol]=function(){return this},Gp.toString=function(){return"[object Generator]"},Context.prototype={constructor:Context,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined$1,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined$1,this.tryEntries.forEach(resetTryEntry),!e)for(var t in this)"t"===t.charAt(0)&&hasOwn.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=undefined$1)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=undefined$1),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var i=hasOwn.call(o,"catchLoc"),l=hasOwn.call(o,"finallyLoc");if(i&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(i){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&hasOwn.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,ContinueSentinel):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),ContinueSentinel},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),resetTryEntry(n),ContinueSentinel}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;resetTryEntry(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:values(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=undefined$1),ContinueSentinel}};var _regeneratorRuntime={wrap:wrap,isGeneratorFunction:isGeneratorFunction,AsyncIterator:AsyncIterator,mark:mark,awrap:awrap,async:async,keys:keys,values:values};function HMAC(e,t){return _HMAC.apply(this,arguments)}function _HMAC(){return(_HMAC=_asyncToGenerator(_regeneratorRuntime.mark((function e(t,n){var r,o,a,i,l;return _regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=(r=function(e){return new Uint8Array(_toConsumableArray(unescape(encodeURIComponent(e))).map((function(e){return e.charCodeAt(0)})))})(n),a=r(t),e.next=5,crypto.subtle.importKey("raw",o,{name:"HMAC",hash:"SHA-256"},!0,["sign"]);case 5:return i=e.sent,e.next=8,crypto.subtle.sign("HMAC",i,a);case 8:return l=e.sent,e.abrupt("return",_toConsumableArray(new Uint8Array(l)).map((function(e){return e.toString(16).padStart(2,"0")})).join(""));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var n$2,l,u$1,t$2,i$1,o$1,r$1,f$1={},e$2=[],c$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function s(e,t){for(var n in t)e[n]=t[n];return e}function a$1(e){var t=e.parentNode;t&&t.removeChild(e)}function h(e,t,n){var r,o=arguments,a={};for(r in t)"key"!==r&&"ref"!==r&&(a[r]=t[r]);if(arguments.length>3)for(n=[n],r=3;r<arguments.length;r++)n.push(o[r]);if(null!=n&&(a.children=n),"function"==typeof e&&null!=e.defaultProps)for(r in e.defaultProps)void 0===a[r]&&(a[r]=e.defaultProps[r]);return v$1(e,a,t&&t.key,t&&t.ref)}function v$1(e,t,n,r){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:null,__c:null,constructor:void 0};return n$2.vnode&&n$2.vnode(o),o}function p$1(){return{}}function y$1(e){return e.children}function d$1(e,t){this.props=e,this.context=t}function m$2(e,t){if(null==t)return e.__?m$2(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?m$2(e):null}function w$1(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return w$1(e)}}function g$1(e){(!e.__d&&(e.__d=!0)&&1===u$1.push(e)||i$1!==n$2.debounceRendering)&&((i$1=n$2.debounceRendering)||t$2)(k)}function k(){var e,t,n,r,o,a,i;for(u$1.sort((function(e,t){return t.__v.__b-e.__v.__b}));e=u$1.pop();)e.__d&&(n=void 0,r=void 0,a=(o=(t=e).__v).__e,(i=t.__P)&&(n=[],r=T$1(i,o,s({},o),t.__n,void 0!==i.ownerSVGElement,null,n,null==a?m$2(o):a),$(n,o),r!=a&&w$1(o)))}function _$1(e,t,n,r,o,a,i,l,s){var p,c,d,u,_,m,f,y=n&&n.__k||e$2,g=y.length;if(l==f$1&&(l=null!=a?a[0]:g?m$2(n,0):null),p=0,t.__k=b(t.__k,(function(n){if(null!=n){if(n.__=t,n.__b=t.__b+1,null===(d=y[p])||d&&n.key==d.key&&n.type===d.type)y[p]=void 0;else for(c=0;c<g;c++){if((d=y[c])&&n.key==d.key&&n.type===d.type){y[c]=void 0;break}d=null}if(u=T$1(e,n,d=d||f$1,r,o,a,i,l,s),(c=n.ref)&&d.ref!=c&&(f||(f=[]),d.ref&&f.push(d.ref,null,n),f.push(c,n.__c||u,n)),null!=u){if(null==m&&(m=u),null!=n.__d)u=n.__d,n.__d=null;else if(a==d||u!=l||null==u.parentNode){e:if(null==l||l.parentNode!==e)e.appendChild(u);else{for(_=l,c=0;(_=_.nextSibling)&&c<g;c+=2)if(_==u)break e;e.insertBefore(u,l)}"option"==t.type&&(e.value="")}l=u.nextSibling,"function"==typeof t.type&&(t.__d=u)}}return p++,n})),t.__e=m,null!=a&&"function"!=typeof t.type)for(p=a.length;p--;)null!=a[p]&&a$1(a[p]);for(p=g;p--;)null!=y[p]&&A(y[p],y[p]);if(f)for(p=0;p<f.length;p++)z(f[p],f[++p],f[++p])}function b(e,t,n){if(null==n&&(n=[]),null==e||"boolean"==typeof e)t&&n.push(t(null));else if(Array.isArray(e))for(var r=0;r<e.length;r++)b(e[r],t,n);else n.push(t?t("string"==typeof e||"number"==typeof e?v$1(null,e,null,null):null!=e.__e||null!=e.__c?v$1(e.type,e.props,e.key,null):e):e);return n}function x$1(e,t,n,r,o){var a;for(a in n)a in t||P(e,a,null,n[a],r);for(a in t)o&&"function"!=typeof t[a]||"value"===a||"checked"===a||n[a]===t[a]||P(e,a,t[a],n[a],r)}function C(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]="number"==typeof n&&!1===c$1.test(t)?n+"px":null==n?"":n}function P(e,t,n,r,o){var a,i,l,s,p;if(o?"className"===t&&(t="class"):"class"===t&&(t="className"),"key"===t||"children"===t);else if("style"===t)if(a=e.style,"string"==typeof n)a.cssText=n;else{if("string"==typeof r&&(a.cssText="",r=null),r)for(i in r)n&&i in n||C(a,i,"");if(n)for(l in n)r&&n[l]===r[l]||C(a,l,n[l])}else"o"===t[0]&&"n"===t[1]?(s=t!==(t=t.replace(/Capture$/,"")),p=t.toLowerCase(),t=(p in e?p:t).slice(2),n?(r||e.addEventListener(t,N,s),(e.l||(e.l={}))[t]=n):e.removeEventListener(t,N,s)):"list"!==t&&"tagName"!==t&&"form"!==t&&"type"!==t&&!o&&t in e?e[t]=null==n?"":n:"function"!=typeof n&&"dangerouslySetInnerHTML"!==t&&(t!==(t=t.replace(/^xlink:?/,""))?null==n||!1===n?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),n):null==n||!1===n?e.removeAttribute(t):e.setAttribute(t,n))}function N(e){this.l[e.type](n$2.event?n$2.event(e):e)}function T$1(e,t,n,r,o,a,i,l,p){var c,d,u,_,m,f,y,g,h,v,$=t.type;if(void 0!==t.constructor)return null;(c=n$2.__b)&&c(t);try{e:if("function"==typeof $){if(g=t.props,h=(c=$.contextType)&&r[c.__c],v=c?h?h.props.value:c.__:r,n.__c?y=(d=t.__c=n.__c).__=d.__E:("prototype"in $&&$.prototype.render?t.__c=d=new $(g,v):(t.__c=d=new d$1(g,v),d.constructor=$,d.render=D),h&&h.sub(d),d.props=g,d.state||(d.state={}),d.context=v,d.__n=r,u=d.__d=!0,d.__h=[]),null==d.__s&&(d.__s=d.state),null!=$.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=s({},d.__s)),s(d.__s,$.getDerivedStateFromProps(g,d.__s))),_=d.props,m=d.state,u)null==$.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==$.getDerivedStateFromProps&&g!==_&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(g,v),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(g,d.__s,v)){for(d.props=g,d.state=d.__s,d.__d=!1,d.__v=t,t.__e=n.__e,t.__k=n.__k,d.__h.length&&i.push(d),c=0;c<t.__k.length;c++)t.__k[c]&&(t.__k[c].__=t);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(g,d.__s,v),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(_,m,f)}))}d.context=v,d.props=g,d.state=d.__s,(c=n$2.__r)&&c(t),d.__d=!1,d.__v=t,d.__P=e,c=d.render(d.props,d.state,d.context),t.__k=b(null!=c&&c.type==y$1&&null==c.key?c.props.children:c),null!=d.getChildContext&&(r=s(s({},r),d.getChildContext())),u||null==d.getSnapshotBeforeUpdate||(f=d.getSnapshotBeforeUpdate(_,m)),_$1(e,t,n,r,o,a,i,l,p),d.base=t.__e,d.__h.length&&i.push(d),y&&(d.__E=d.__=null),d.__e=null}else t.__e=j(n.__e,t,n,r,o,a,i,p);(c=n$2.diffed)&&c(t)}catch(e){n$2.__e(e,t,n)}return t.__e}function $(e,t){n$2.__c&&n$2.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){n$2.__e(e,t.__v)}}))}function j(e,t,n,r,o,a,i,l){var s,p,c,d,u,_=n.props,m=t.props;if(o="svg"===t.type||o,null==e&&null!=a)for(s=0;s<a.length;s++)if(null!=(p=a[s])&&(null===t.type?3===p.nodeType:p.localName===t.type)){e=p,a[s]=null;break}if(null==e){if(null===t.type)return document.createTextNode(m);e=o?document.createElementNS("http://www.w3.org/2000/svg",t.type):document.createElement(t.type),a=null}if(null===t.type)null!=a&&(a[a.indexOf(e)]=null),_===m||l||e.data==m||(e.data=m);else if(t!==n){if(null!=a&&(a=e$2.slice.call(e.childNodes)),c=(_=n.props||f$1).dangerouslySetInnerHTML,d=m.dangerouslySetInnerHTML,!l){if(_===f$1)for(_={},u=0;u<e.attributes.length;u++)_[e.attributes[u].name]=e.attributes[u].value;(d||c)&&(d&&c&&d.__html==c.__html||(e.innerHTML=d&&d.__html||""))}x$1(e,m,_,o,l),t.__k=t.props.children,d||_$1(e,t,n,r,"foreignObject"!==t.type&&o,a,i,f$1,l),l||("value"in m&&void 0!==m.value&&m.value!==e.value&&(e.value=null==m.value?"":m.value),"checked"in m&&void 0!==m.checked&&m.checked!==e.checked&&(e.checked=m.checked))}return e}function z(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){n$2.__e(e,n)}}function A(e,t,n){var r,o,a;if(n$2.unmount&&n$2.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||z(r,null,t)),n||"function"==typeof e.type||(n=null!=(o=e.__e)),e.__e=e.__d=null,null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){n$2.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(a=0;a<r.length;a++)r[a]&&A(r[a],t,n);null!=o&&a$1(o)}function D(e,t,n){return this.constructor(e,n)}function E$1(e,t,n){var r,o,a;n$2.__&&n$2.__(e,t),o=(r=n===o$1)?null:n&&n.__k||t.__k,e=h(y$1,null,[e]),a=[],T$1(t,(r?t:n||t).__k=e,o||f$1,f$1,void 0!==t.ownerSVGElement,n&&!r?[n]:o?null:e$2.slice.call(t.childNodes),a,n||f$1,r),$(a,e)}function H(e,t){E$1(e,t,o$1)}function I(e,t){return t=s(s({},e.props),t),arguments.length>2&&(t.children=e$2.slice.call(arguments,2)),v$1(e.type,t,t.key||e.key,t.ref||e.ref)}function L(e){var t={},n={__c:"__cC"+r$1++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,o=this;return this.getChildContext||(r=[],this.getChildContext=function(){return t[n.__c]=o,t},this.shouldComponentUpdate=function(t){e.value!==t.value&&r.some((function(e){e.context=t.value,g$1(e)}))},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Consumer.contextType=n,n}n$2={__e:function(e,t){for(var n,r;t=t.__;)if((n=t.__c)&&!n.__)try{if(n.constructor&&null!=n.constructor.getDerivedStateFromError&&(r=!0,n.setState(n.constructor.getDerivedStateFromError(e))),null!=n.componentDidCatch&&(r=!0,n.componentDidCatch(e)),r)return g$1(n.__E=n)}catch(t){e=t}throw e}},l=function(e){return null!=e&&void 0===e.constructor},d$1.prototype.setState=function(e,t){var n;n=this.__s!==this.state?this.__s:this.__s=s({},this.state),"function"==typeof e&&(e=e(n,this.props)),e&&s(n,e),null!=e&&this.__v&&(this.__e=!1,t&&this.__h.push(t),g$1(this))},d$1.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),g$1(this))},d$1.prototype.render=y$1,u$1=[],t$2="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,o$1=f$1,r$1=0;var preact_module=Object.freeze({__proto__:null,render:E$1,hydrate:H,createElement:h,h:h,Fragment:y$1,createRef:p$1,get isValidElement(){return l},Component:d$1,cloneElement:I,createContext:L,toChildArray:b,_unmount:A,get options(){return n$2}}),n$1=function e(t,n,r,o){var a;n[0]=0;for(var i=1;i<n.length;i++){var l=n[i++],s=n[i]?(n[0]|=l?1:2,r[n[i++]]):n[++i];3===l?o[0]=s:4===l?o[1]=Object.assign(o[1]||{},s):5===l?(o[1]=o[1]||{})[n[++i]]=s:6===l?o[1][n[++i]]+=s+"":l?(a=t.apply(s,e(t,s,r,["",null])),o.push(a),s[0]?n[0]|=2:(n[i-2]=0,n[i]=a)):o.push(s)}return o},t$1=new Map;function e$1(e){var t=t$1.get(this);return t||(t=new Map,t$1.set(this,t)),(t=n$1(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,r=1,o="",a="",i=[0],l=function(e){1===r&&(e||(o=o.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?i.push(0,e,o):3===r&&(e||o)?(i.push(3,e,o),r=2):2===r&&"..."===o&&e?i.push(4,e,0):2===r&&o&&!e?i.push(5,0,!0,o):r>=5&&((o||!e&&5===r)&&(i.push(r,0,o,n),r=6),e&&(i.push(r,e,0,n),r=6)),o=""},s=0;s<e.length;s++){s&&(1===r&&l(),l(s));for(var p=0;p<e[s].length;p++)t=e[s][p],1===r?"<"===t?(l(),i=[i],r=3):o+=t:4===r?"--"===o&&">"===t?(r=1,o=""):o=t+o[0]:a?t===a?a="":o+=t:'"'===t||"'"===t?a=t:">"===t?(l(),r=1):r&&("="===t?(r=5,n=o,o=""):"/"===t&&(r<5||">"===e[s][p+1])?(l(),3===r&&(i=i[0]),r=i,(i=i[0]).push(2,0,r),r=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(l(),r=2):o+=t),3===r&&"!--"===o&&(r=4,i=i[0])}return l(),i}(e)),t),arguments,[])).length>1?t:t[0]}var m$1=e$1.bind(h),commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getAugmentedNamespace(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}function createCommonjsModule(e){var t={exports:{}};return e(t,t.exports),t.exports}function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var require$$0=getAugmentedNamespace(preact_module),preact=createCommonjsModule((function(e,t){var n=require$$0;function r(e,t){for(var n in t)e[n]=t[n];return e}function o(e){this.getChildContext=function(){return{store:e.store}}}o.prototype.render=function(e){return e.children&&e.children[0]||e.children},t.connect=function(e,t){var o;return"function"!=typeof e&&("string"==typeof(o=e||{})&&(o=o.split(/\s*,\s*/)),e=function(e){for(var t={},n=0;n<o.length;n++)t[o[n]]=e[o[n]];return t}),function(o){function a(a,i){var l=this,s=i.store,p=e(s?s.getState():{},a),c=t?function(e,t){"function"==typeof e&&(e=e(t));var n={};for(var r in e)n[r]=t.action(e[r]);return n}(t,s):{store:s},d=function(){var t=e(s?s.getState():{},a);for(var n in t)if(t[n]!==p[n])return p=t,l.setState({});for(var r in p)if(!(r in t))return p=t,l.setState({})};this.componentWillReceiveProps=function(e){a=e,d()},this.componentDidMount=function(){s.subscribe(d)},this.componentWillUnmount=function(){s.unsubscribe(d)},this.render=function(e){return n.h(o,r(r(r({},c),e),p))}}return(a.prototype=new n.Component).constructor=a}},t.Provider=o}));function fetch(e,t){return t=t||{},new Promise((function(n,r){var o=new XMLHttpRequest,a=[],i=[],l={},s=function e(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:e,headers:{keys:function(){return a},entries:function(){return i},get:function(e){return l[e.toLowerCase()]},has:function(e){return e.toLowerCase()in l}}}};for(var p in o.open(t.method||"get",e,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){a.push(t=t.toLowerCase()),i.push([t,n]),l[t]=l[t]?l[t]+","+n:n})),n(s())},o.onerror=r,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(p,t.headers[p]);o.send(t.body||null)}))}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _isNativeFunction(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _isNativeReflectConstruct$i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _construct(e,t,n){return(_construct=_isNativeReflectConstruct$i()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&_setPrototypeOf(o,n.prototype),o}).apply(null,arguments)}function _wrapNativeSuper(e){var t="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function(e){if(null===e||!_isNativeFunction(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(n,e)})(e)}function _createSuper$h(e){var t=_isNativeReflectConstruct$h();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var IntegryAPIError=function(e){_inherits(n,e);var t=_createSuper$h(n);function n(e,r){var o;return _classCallCheck(this,n),_defineProperty(_assertThisInitialized(o=t.call(this,e)),"statusCode",void 0),_defineProperty(_assertThisInitialized(o),"response",void 0),o.name=o.constructor.name,o.statusCode=null==r?void 0:r.status,o.response=r,o}return n}(_wrapNativeSuper(Error)),ResponseHandler=function(){var e=_asyncToGenerator(_regeneratorRuntime.mark((function e(t){var n,r,o;return _regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!1,!t.ok){e.next=16;break}return e.prev=2,e.next=5,t.json();case 5:return r=e.sent,n&&console.log(r),e.abrupt("return",{data:r,status:t.status});case 10:return e.prev=10,e.t0=e.catch(2),n&&console.log("Response is not in json"),e.abrupt("return",{data:null,status:t.status});case 14:e.next=22;break;case 16:if(405!==t.status){e.next=22;break}return e.next=19,t.json();case 19:return e.t1=e.sent,e.t2=t.status,e.abrupt("return",{data:e.t1,status:e.t2});case 22:return n&&console.log("Received a non-2xx status code"),o=new IntegryAPIError(t.statusText,t),e.abrupt("return",Promise.reject(o));case 25:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t){return e.apply(this,arguments)}}();function ownKeys$9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread$9(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$9(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$9(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var IntegryAPI=function e(t){var n=this;_classCallCheck(this,e),_defineProperty(this,"config",void 0),_defineProperty(this,"getTemplate",function(){var t=_asyncToGenerator(_regeneratorRuntime.mark((function t(r){var o,a;return _regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new URL("".concat(n.config.baseUrlv2,"/template/").concat(r,"/")),e.addUrlSearchParams(o,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId,self_api_key:n.config.apiKey||null}),t.prev=2,t.next=5,fetch(o.toString()).then((function(e){return ResponseHandler(e)}));case 5:return a=t.sent,t.abrupt("return",a.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),_defineProperty(this,"getAuthUrl",(function(t){var r=new URL("".concat(n.config.baseUrl,"/auth/login/").concat(t,"/"));return e.addUrlSearchParams(r,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId}),r.toString()})),_defineProperty(this,"getTemplateStep",function(){var t=_asyncToGenerator(_regeneratorRuntime.mark((function t(r){var o,a;return _regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new URL("".concat(n.config.baseUrl,"/template_step/").concat(r,"/")),e.addUrlSearchParams(o,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId,self_api_key:n.config.apiKey||null}),t.prev=2,t.next=5,fetch(o.toString()).then((function(e){return ResponseHandler(e)}));case 5:return a=t.sent,t.abrupt("return",a.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),_defineProperty(this,"verifyOAuth",function(){var t=_asyncToGenerator(_regeneratorRuntime.mark((function t(r){var o,a;return _regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new URL("".concat(n.config.baseUrl,"/").concat(n.config.oauthVerifyPath)),e.addUrlSearchParams(o,{authorization_id:"".concat(r),app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId}),t.prev=2,t.next=5,fetch(o.toString(),{method:"POST"}).then(ResponseHandler);case 5:return a=t.sent,t.abrupt("return",!!a.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),_defineProperty(this,"deleteAuth",function(){var t=_asyncToGenerator(_regeneratorRuntime.mark((function t(r){var o,a;return _regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new URL("".concat(n.config.baseUrl,"/connected-accounts/").concat(r)),e.addUrlSearchParams(o,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId}),t.prev=2,t.next=5,fetch(o.toString(),{method:"DELETE"}).then((function(e){return ResponseHandler(e)}));case 5:return a=t.sent,t.abrupt("return",{status:a.status,data:a.data});case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),_defineProperty(this,"callDynamicDataEndpoint",function(){var t=_asyncToGenerator(_regeneratorRuntime.mark((function t(r){var o,a,i=arguments;return _regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=i.length>1&&void 0!==i[1]?i[1]:{},e.addUrlSearchParams(r,_objectSpread$9({app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId},o)),t.prev=2,t.next=5,fetch(r.toString()).then((function(e){return ResponseHandler(e)}));case 5:return a=t.sent,t.abrupt("return",a.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),_defineProperty(this,"getTemplateListing",function(){var t=_asyncToGenerator(_regeneratorRuntime.mark((function t(r){var o,a;return _regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new URL("".concat(n.config.baseUrl,"/bundle/").concat(r,"/")),e.addUrlSearchParams(o,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId}),t.prev=2,t.next=5,fetch(o.toString()).then((function(e){return ResponseHandler(e)}));case 5:return a=t.sent,t.abrupt("return",a.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),_defineProperty(this,"saveIntegration",function(){var t=_asyncToGenerator(_regeneratorRuntime.mark((function t(r){var o,a;return _regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new URL("".concat(n.config.baseUrlv2,"/integration/")),e.addUrlSearchParams(o,{async:!1,app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId,activate:!0}),t.prev=2,t.next=5,fetch(o.toString(),{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}}).then((function(e){return ResponseHandler(e)}));case 5:return a=t.sent,t.abrupt("return",a.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),_defineProperty(this,"updateIntegration",function(){var t=_asyncToGenerator(_regeneratorRuntime.mark((function t(r,o){var a,i;return _regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=new URL("".concat(n.config.baseUrlv2,"/integration/").concat(r,"/")),e.addUrlSearchParams(a,{async:!1,app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId,activate:!0}),t.prev=2,t.next=5,fetch(a.toString(),{method:"PUT",body:JSON.stringify(o),headers:{"Content-Type":"application/json"}}).then((function(e){return ResponseHandler(e)}));case 5:return i=t.sent,t.abrupt("return",i.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()),_defineProperty(this,"deleteIntegration",function(){var t=_asyncToGenerator(_regeneratorRuntime.mark((function t(r){var o,a;return _regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new URL("".concat(n.config.baseUrl,"/setup/template/").concat(r,"/")),e.addUrlSearchParams(o,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId}),t.prev=2,t.next=5,fetch(o.toString(),{method:"DELETE"}).then((function(e){return ResponseHandler(e)}));case 5:return a=t.sent,t.abrupt("return",a.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),_defineProperty(this,"toggleIntegration",function(){var t=_asyncToGenerator(_regeneratorRuntime.mark((function t(r,o){var a,i;return _regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=new URL("".concat(n.config.baseUrlv2,"/integration/").concat(r,"/").concat(o?"enable":"disable","/")),e.addUrlSearchParams(a,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId}),t.prev=2,t.next=5,fetch(a.toString(),{method:"PUT"}).then((function(e){return ResponseHandler(e)}));case 5:return i=t.sent,t.abrupt("return",i.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e,n){return t.apply(this,arguments)}}()),_defineProperty(this,"getIntegrationById",function(){var t=_asyncToGenerator(_regeneratorRuntime.mark((function t(r){var o,a;return _regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new URL("".concat(n.config.baseUrlv2,"/integration/").concat(r)),e.addUrlSearchParams(o,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId}),t.prev=2,t.next=5,fetch(o.toString(),{method:"GET"}).then((function(e){return ResponseHandler(e)}));case 5:return a=t.sent,t.abrupt("return",a.data);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),_defineProperty(this,"getIntegrationStatuses",function(){var t=_asyncToGenerator(_regeneratorRuntime.mark((function t(r){var o,a;return _regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new URL("".concat(n.config.baseUrlv2,"/integration_status/")),e.addUrlSearchParams(o,{app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId}),t.prev=2,t.next=5,fetch(o.toString(),{method:"PUT",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}}).then(ResponseHandler);case 5:return a=t.sent,t.abrupt("return",a);case 9:return t.prev=9,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",null);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}()),this.config=t};function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function _objectWithoutProperties(e,t){if(null==e)return{};var n,r,o=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray$1(e,t)||_nonIterableRest()}_defineProperty(IntegryAPI,"addUrlSearchParams",(function(e,t){return Object.keys(t).map((function(n){return void 0!==t[n]&&e.searchParams.append(n,"".concat(t[n]))}))}));var t,u,r,i=[],o=n$2.__r,f=n$2.diffed,c=n$2.__c,e=n$2.unmount;function a(e){n$2.__h&&n$2.__h(u);var t=u.__H||(u.__H={t:[],u:[]});return e>=t.t.length&&t.t.push({}),t.t[e]}function v(e){return m(E,e)}function m(e,n,r){var o=a(t++);return o.__c||(o.__c=u,o.i=[r?r(n):E(void 0,n),function(t){var n=e(o.i[0],t);o.i[0]!==n&&(o.i[0]=n,o.__c.setState({}))}]),o.i}function p(e,n){var r=a(t++);x(r.o,n)&&(r.i=e,r.o=n,u.__H.u.push(r))}function d(e){return y((function(){return{current:e}}),[])}function y(e,n){var r=a(t++);return x(r.o,n)?(r.o=n,r.v=e,r.i=e()):r.i}function T(e,t){return y((function(){return e}),t)}function w(e){var n=u.context[e.__c];if(!n)return e.__;var r=a(t++);return null==r.i&&(r.i=!0,n.sub(u)),n.props.value}function F(e){var n=a(t++),r=v();return n.i=e,u.componentDidCatch||(u.componentDidCatch=function(e){n.i&&n.i(e),r[1](e)}),[r[0],function(){r[1](void 0)}]}function _(){i.some((function(e){e.__P&&(e.__H.u.forEach(g),e.__H.u.forEach(q),e.__H.u=[])})),i=[]}function g(e){e.m&&e.m()}function q(e){var t=e.i();"function"==typeof t&&(e.m=t)}function x(e,t){return!e||t.some((function(t,n){return t!==e[n]}))}function E(e,t){return"function"==typeof t?t(e):t}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}n$2.__r=function(e){o&&o(e),t=0,(u=e.__c).__H&&(u.__H.u.forEach(g),u.__H.u.forEach(q),u.__H.u=[])},n$2.diffed=function(e){f&&f(e);var t=e.__c;if(t){var n=t.__H;n&&n.u.length&&(1!==i.push(t)&&r===n$2.requestAnimationFrame||((r=n$2.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);"undefined"!=typeof window&&(t=requestAnimationFrame(n))})(_))}},n$2.__c=function(e,t){t.some((function(e){e.__h.forEach(g),e.__h=e.__h.filter((function(e){return!e.i||q(e)}))})),c&&c(e,t)},n$2.unmount=function(t){e&&e(t);var n=t.__c;if(n){var r=n.__H;r&&r.t.forEach((function(e){return e.m&&e.m()}))}};var _excluded$2=["message"],_marked=_regeneratorRuntime.mark(toFailures),_marked2=_regeneratorRuntime.mark(run);function _createForOfIteratorHelper(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},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 a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ownKeys$8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread$8(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$8(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$8(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _createSuper$g(e){var t=_isNativeReflectConstruct$g();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$g(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var StructError=function(e){_inherits(n,e);var t=_createSuper$g(n);function n(e,r){var o,a;_classCallCheck(this,n);var i=e.message,l=_objectWithoutProperties(e,_excluded$2),s=e.path,p=0===s.length?i:"At path: "+s.join(".")+" -- "+i;return o=t.call(this,p),Object.assign(_assertThisInitialized(o),l),o.name=o.constructor.name,o.failures=function(){var t;return null!=(t=a)?t:a=[e].concat(_toConsumableArray(r()))},o}return n}(_wrapNativeSuper(TypeError));function isIterable(e){return isObject(e)&&"function"==typeof e[Symbol.iterator]}function isObject(e){return"object"===_typeof(e)&&null!=e}function print(e){return"string"==typeof e?JSON.stringify(e):""+e}function shiftIterator(e){var t=e.next(),n=t.done,r=t.value;return n?void 0:r}function toFailure(e,t,n,r){if(!0!==e){!1===e?e={}:"string"==typeof e&&(e={message:e});var o=t.path,a=t.branch,i=n.type,l=e,s=l.refinement,p=l.message,c=void 0===p?"Expected a value of type `"+i+"`"+(s?" with refinement `"+s+"`":"")+", but received: `"+print(r)+"`":p;return _objectSpread$8(_objectSpread$8({value:r,type:i,refinement:s,key:o[o.length-1],path:o,branch:a},e),{},{message:c})}}function toFailures(e,t,n,r){var o,a,i,l;return _regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:isIterable(e)||(e=[e]),o=_createForOfIteratorHelper(e),s.prev=2,o.s();case 4:if((a=o.n()).done){s.next=12;break}if(i=a.value,!(l=toFailure(i,t,n,r))){s.next=10;break}return s.next=10,l;case 10:s.next=4;break;case 12:s.next=17;break;case 14:s.prev=14,s.t0=s.catch(2),o.e(s.t0);case 17:return s.prev=17,o.f(),s.finish(17);case 20:case"end":return s.stop()}}),_marked,null,[[2,14,17,20]])}function run(e,t){var n,r,o,a,i,l,s,p,c,d,u,_,m,f,y,g,h,v,b,$,w,j,x,O,S,I,C,T,k=arguments;return _regeneratorRuntime.wrap((function(L){for(;;)switch(L.prev=L.next){case 0:if(n=k.length>2&&void 0!==k[2]?k[2]:{},r=n.path,o=void 0===r?[]:r,a=n.branch,i=void 0===a?[e]:a,l=n.coerce,s=void 0!==l&&l,p=n.mask,c=void 0!==p&&p,d={path:o,branch:i},s&&(e=t.coercer(e,d),c&&"type"!==t.type&&isObject(t.schema)&&isObject(e)&&!Array.isArray(e)))for(u in e)void 0===t.schema[u]&&delete e[u];_=!0,m=_createForOfIteratorHelper(t.validator(e,d)),L.prev=6,m.s();case 8:if((f=m.n()).done){L.next=15;break}return y=f.value,_=!1,L.next=13,[y,void 0];case 13:L.next=8;break;case 15:L.next=20;break;case 17:L.prev=17,L.t0=L.catch(6),m.e(L.t0);case 20:return L.prev=20,m.f(),L.finish(20);case 23:g=_createForOfIteratorHelper(t.entries(e,d)),L.prev=24,g.s();case 26:if((h=g.n()).done){L.next=53;break}v=_slicedToArray(h.value,3),b=v[0],$=v[1],w=v[2],j=run($,w,{path:void 0===b?o:[].concat(_toConsumableArray(o),[b]),branch:void 0===b?i:[].concat(_toConsumableArray(i),[$]),coerce:s,mask:c}),x=_createForOfIteratorHelper(j),L.prev=30,x.s();case 32:if((O=x.n()).done){L.next=43;break}if(!(S=O.value)[0]){L.next=40;break}return _=!1,L.next=38,[S[0],void 0];case 38:L.next=41;break;case 40:s&&($=S[1],void 0===b?e=$:e instanceof Map?e.set(b,$):e instanceof Set?e.add($):isObject(e)&&(e[b]=$));case 41:L.next=32;break;case 43:L.next=48;break;case 45:L.prev=45,L.t1=L.catch(30),x.e(L.t1);case 48:return L.prev=48,x.f(),L.finish(48);case 51:L.next=26;break;case 53:L.next=58;break;case 55:L.prev=55,L.t2=L.catch(24),g.e(L.t2);case 58:return L.prev=58,g.f(),L.finish(58);case 61:if(!_){L.next=80;break}I=_createForOfIteratorHelper(t.refiner(e,d)),L.prev=63,I.s();case 65:if((C=I.n()).done){L.next=72;break}return T=C.value,_=!1,L.next=70,[T,void 0];case 70:L.next=65;break;case 72:L.next=77;break;case 74:L.prev=74,L.t3=L.catch(63),I.e(L.t3);case 77:return L.prev=77,I.f(),L.finish(77);case 80:if(!_){L.next=83;break}return L.next=83,[void 0,e];case 83:case"end":return L.stop()}}),_marked2,null,[[6,17,20,23],[24,55,58,61],[30,45,48,51],[63,74,77,80]])}var Struct=function(){function e(t){var n=this;_classCallCheck(this,e);var r=t.type,o=t.schema,a=t.validator,i=t.refiner,l=t.coercer,s=void 0===l?function(e){return e}:l,p=t.entries,c=void 0===p?_regeneratorRuntime.mark((function e(){return _regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})):p;this.type=r,this.schema=o,this.entries=c,this.coercer=s,this.validator=a?function(e,t){return toFailures(a(e,t),t,n,e)}:function(){return[]},this.refiner=i?function(e,t){return toFailures(i(e,t),t,n,e)}:function(){return[]}}return _createClass(e,[{key:"assert",value:function(e){return _assert(e,this)}},{key:"create",value:function(e){return _create(e,this)}},{key:"is",value:function(e){return _is(e,this)}},{key:"mask",value:function(e){return _mask(e,this)}},{key:"validate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _validate(e,this,t)}}]),e}();function _assert(e,t){var n=_validate(e,t);if(n[0])throw n[0]}function _create(e,t){var n=_validate(e,t,{coerce:!0});if(n[0])throw n[0];return n[1]}function _mask(e,t){var n=_validate(e,t,{coerce:!0,mask:!0});if(n[0])throw n[0];return n[1]}function _is(e,t){return!_validate(e,t)[0]}function _validate(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=run(e,t,n),o=shiftIterator(r);if(o[0]){var a=new StructError(o[0],_regeneratorRuntime.mark((function e(){var t,n,o;return _regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=_createForOfIteratorHelper(r),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=10;break}if(!(o=n.value)[0]){e.next=8;break}return e.next=8,o[0];case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),t.e(e.t0);case 15:return e.prev=15,t.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[1,12,15,18]])})));return[a,void 0]}var i=o[1];return[void 0,i]}function define(e,t){return new Struct({type:e,schema:null,validator:t})}function array(e){return new Struct({type:"array",schema:e,entries:_regeneratorRuntime.mark((function t(n){var r,o,a,i,l;return _regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e||!Array.isArray(n)){t.next=18;break}r=_createForOfIteratorHelper(n.entries()),t.prev=2,r.s();case 4:if((o=r.n()).done){t.next=10;break}return a=_slicedToArray(o.value,2),i=a[0],l=a[1],t.next=8,[i,l,e];case 8:t.next=4;break;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(2),r.e(t.t0);case 15:return t.prev=15,r.f(),t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[2,12,15,18]])})),coercer:function(e){return Array.isArray(e)?e.slice():e},validator:function(e){return Array.isArray(e)||"Expected an array value, but received: "+print(e)}})}function boolean(){return define("boolean",(function(e){return"boolean"==typeof e}))}function date(){return define("date",(function(e){return e instanceof Date&&!isNaN(e.getTime())||"Expected a valid `Date` object, but received: "+print(e)}))}function never(){return define("never",(function(){return!1}))}function nullable(e){return new Struct(_objectSpread$8(_objectSpread$8({},e),{},{validator:function(t,n){return null===t||e.validator(t,n)},refiner:function(t,n){return null===t||e.refiner(t,n)}}))}function number(){return define("number",(function(e){return"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+print(e)}))}function object(e){var t=e?Object.keys(e):[],n=never();return new Struct({type:"object",schema:e||null,entries:_regeneratorRuntime.mark((function r(o){var a,i,l,s,p,c,d;return _regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e||!isObject(o)){r.next=37;break}a=new Set(Object.keys(o)),i=_createForOfIteratorHelper(t),r.prev=3,i.s();case 5:if((l=i.n()).done){r.next=12;break}return s=l.value,a.delete(s),r.next=10,[s,o[s],e[s]];case 10:r.next=5;break;case 12:r.next=17;break;case 14:r.prev=14,r.t0=r.catch(3),i.e(r.t0);case 17:return r.prev=17,i.f(),r.finish(17);case 20:p=_createForOfIteratorHelper(a),r.prev=21,p.s();case 23:if((c=p.n()).done){r.next=29;break}return d=c.value,r.next=27,[d,o[d],n];case 27:r.next=23;break;case 29:r.next=34;break;case 31:r.prev=31,r.t1=r.catch(21),p.e(r.t1);case 34:return r.prev=34,p.f(),r.finish(34);case 37:case"end":return r.stop()}}),r,null,[[3,14,17,20],[21,31,34,37]])})),validator:function(e){return isObject(e)||"Expected an object, but received: "+print(e)},coercer:function(e){return isObject(e)?_objectSpread$8({},e):e}})}function optional(e){return new Struct(_objectSpread$8(_objectSpread$8({},e),{},{validator:function(t,n){return void 0===t||e.validator(t,n)},refiner:function(t,n){return void 0===t||e.refiner(t,n)}}))}function string(){return define("string",(function(e){return"string"==typeof e||"Expected a string, but received: "+print(e)}))}function size(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r="Expected a "+e.type,o=t===n?"of `"+t+"`":"between `"+t+"` and `"+n+"`";return refine(e,"size",(function(e){if("number"==typeof e||e instanceof Date)return t<=e&&e<=n||r+" "+o+" but received `"+e+"`";if(e instanceof Map||e instanceof Set){var a=e.size;return t<=a&&a<=n||r+" with a size "+o+" but received one with a size of `"+a+"`"}var i=e.length;return t<=i&&i<=n||r+" with a length "+o+" but received one with a length of `"+i+"`"}))}function refine(e,t,n){return new Struct(_objectSpread$8(_objectSpread$8({},e),{},{refiner:function(e){var t=_regeneratorRuntime.mark(n);function n(n,r){var o=arguments;return _regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(e.apply(this,o),"t0",1);case 1:return t.abrupt("return",t.t0);case 2:case"end":return t.stop()}}),t,this)}return n.toString=function(){return e.toString()},n}(_regeneratorRuntime.mark((function r(o,a){var i,l,s,p,c;return _regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.delegateYield(e.refiner(o,a),"t0",1);case 1:i=n(o,a),l=toFailures(i,a,e,o),s=_createForOfIteratorHelper(l),r.prev=4,s.s();case 6:if((p=s.n()).done){r.next=12;break}return c=p.value,r.next=10,_objectSpread$8(_objectSpread$8({},c),{},{refinement:t});case 10:r.next=6;break;case 12:r.next=17;break;case 14:r.prev=14,r.t1=r.catch(4),s.e(r.t1);case 17:return r.prev=17,s.f(),r.finish(17);case 20:case"end":return r.stop()}}),r,null,[[4,14,17,20]])})))}))}var AppContext=L(null);function n(e,t){for(var n in t)e[n]=t[n];return e}function createStore(e){var t=[];function r(e){for(var n=[],r=0;r<t.length;r++)t[r]===e?e=null:n.push(t[r]);t=n}function o(r,o,a){e=o?r:n(n({},e),r);for(var i=t,l=0;l<i.length;l++)i[l](e,a)}return e=e||{},{action:function(t){function n(e){o(e,!1,t)}return function(){for(var r=arguments,o=[e],a=0;a<arguments.length;a++)o.push(r[a]);var i=t.apply(this,o);if(null!=i)return i.then?i.then(n):n(i)}},setState:o,subscribe:function(e){return t.push(e),function(){r(e)}},unsubscribe:r,getState:function(){return e}}}var devtools=function(e){var t=window.__REDUX_DEVTOOLS_EXTENSION__||window.top.__REDUX_DEVTOOLS_EXTENSION__,n=!1;return t?(e.devtools||(e.devtools=t.connect(),e.devtools.subscribe((function(t){"DISPATCH"===t.type&&t.state&&(n="JUMP_TO_ACTION"===t.payload.type||"JUMP_TO_STATE"===t.payload.type,e.setState(JSON.parse(t.state),!0))})),e.devtools.init(e.getState()),e.subscribe((function(t,r){var o=r&&r.name||"setState";n?n=!1:e.devtools.send(o,t)}))),e):(console.warn("Please install/enable Redux devtools extension"),e.devtools=null,e)},initialState={stepState:{steps:[],currentStep:{type:"CONFIRMATION"},stepIndex:0,showValidation:!1,allStepsCompleted:!1},genericData:{bundleId:null,templateId:null,templateApp:null,isPreviewMode:!1},stepMapping:{},stepDataMapping:{},parentChildMapping:{}};function ownKeys$7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread$7(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$7(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$7(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var actionFunctions=function(e){return{setSteps:function(e,t){var n=[],r=-1;return t.forEach((function(e){if(e.activity.auth_required&&!e.hide_authorization&&(r+=1,n.push({stepId:e.id,title:"Connect ".concat(e.activity.app.name),iconUrl:e.activity.app.icon_url,isCompleted:!1,isCurrentlyOpen:!1,type:"AUTH",requiredFields:[e.id],invalidFields:_defineProperty({},e.id,""),isValid:!1,itemIndex:r})),e.is_visible&&e.template_fields.length>0){var t=e.template_fields.filter((function(e){return e.is_visible})).length>0,o=e.template_fields.filter((function(e){return e.is_required&&e.is_visible})).map((function(e){return e.id})),a=e.template_fields.filter((function(e){return e.is_required&&!e.default_value})).reduce((function(e,t){return _objectSpread$7(_objectSpread$7({},e),{},_defineProperty({},t.id,""))}),{}),i=!(Object.keys(a).length>0);t&&(r+=1,n.push({stepId:e.id,title:e.title,iconUrl:e.activity.app.icon_url,isCompleted:!1,isCurrentlyOpen:!1,type:"CONFIGURATION",requiredFields:o,invalidFields:a,isValid:i,itemIndex:r}))}})),_objectSpread$7(_objectSpread$7({},e),{},{stepState:{steps:n,currentStep:n[0],stepIndex:0,showValidation:!1,allStepsCompleted:!1}})},setIntegrationData:function(e,t){var n=e.stepDataMapping,r=e.stepMapping,o=t.steps.reduce((function(e,t){return r[t.template_step]&&t.authorization?_objectSpread$7(_objectSpread$7({},e),{},_defineProperty({},t.template_step,{authId:Number(t.authorization),stepId:t.id})):e}),{}),a=t.steps.reduce((function(e,t){return n[t.template_step]?_objectSpread$7(_objectSpread$7({},e),{},_defineProperty({},t.template_step,t.app_user_data)):e}),{}),i=_objectSpread$7({},r),l=_objectSpread$7({},n),s=e.stepState.steps.map((function(e){return _objectSpread$7(_objectSpread$7({},e),{},{isCompleted:!0})}));return Object.keys(a).forEach((function(e){l[Number(e)]=_objectSpread$7(_objectSpread$7({},n[Number(e)]),a[Number(e)].reduce((function(t,r){return n[Number(e)]?_objectSpread$7(_objectSpread$7({},t),{},_defineProperty({},r.template_field,_objectSpread$7(_objectSpread$7({},n[Number(e)][r.template_field]),{},{integrationFieldId:r.id,value:n[Number(e)][r.template_field].isDynamic?null:r.value,objectValue:n[Number(e)][r.template_field].isDynamic?JSON.parse(r.value||"{}"):null}))):t}),{}))})),Object.keys(o).forEach((function(e){i[Number(e)]=_objectSpread$7(_objectSpread$7({},i[Number(e)]),{},{integrationStepId:o[Number(e)].stepId,isAuthVerified:!0,selectedAuthId:o[Number(e)].authId})})),_objectSpread$7(_objectSpread$7({},e),{},{stepMapping:i,stepDataMapping:l,stepState:_objectSpread$7(_objectSpread$7({},e.stepState),{},{steps:s,currentStep:s[0],stepIndex:0,showValidation:!1,allStepsCompleted:!0})})},showStepValidationState:function(e){return{stepState:_objectSpread$7(_objectSpread$7({},e.stepState),{},{showValidation:!0})}},hideStepValidationState:function(e){return{stepState:_objectSpread$7(_objectSpread$7({},e.stepState),{},{showValidation:!1})}},gotoNextStep:function(e){var t=e.stepState;if(t){var n=Number(t.stepIndex)+1,r=t.steps[Number(t.stepIndex)+1],o=_objectSpread$7(_objectSpread$7({},t.steps[e.stepState.stepIndex]),{},{isCompleted:!0});return r?{stepState:_objectSpread$7(_objectSpread$7({},t),{},{steps:[].concat(_toConsumableArray(t.steps.slice(0,t.stepIndex)),[o],_toConsumableArray(t.steps.slice(t.stepIndex+1))),currentStep:_objectSpread$7({},r),stepIndex:n,showValidation:!1})}:{stepState:_objectSpread$7(_objectSpread$7({},t),{},{steps:[].concat(_toConsumableArray(t.steps.slice(0,t.stepIndex)),[o],_toConsumableArray(t.steps.slice(t.stepIndex+1))),currentStep:{type:"CONFIRMATION"},stepIndex:n,allStepsCompleted:!0,showValidation:!1})}}return e},gotoPreviousStep:function(e){if(e.stepState){var t=Number(e.stepState.stepIndex)-1,n=e.stepState.steps[Number(e.stepState.stepIndex)-1];return{stepState:_objectSpread$7(_objectSpread$7({},e.stepState),{},{currentStep:n,stepIndex:t,showValidation:!n.isValid})}}return e},gotoStepInPreview:function(e,t){var n=e.stepState,r=t.stepId,o=t.type;if(r&&"CONFIRMATION"!==o){var a=n.steps.findIndex((function(e){return e.stepId===r&&e.type===o}));if(a>-1)return{stepState:_objectSpread$7(_objectSpread$7({},e.stepState),{},{currentStep:n.steps[a],stepIndex:a,allStepsCompleted:!1})}}return r||"CONFIRMATION"!==o?e:{stepState:_objectSpread$7(_objectSpread$7({},n),{},{currentStep:{type:"CONFIRMATION"},stepIndex:n.steps.length,allStepsCompleted:!0})}},gotoStep:function(e,t){var n=e.stepState,r=n.stepIndex;if(n){var o=n.steps[r],a=n.steps[t];if(e.genericData.isPreviewMode)return t===n.steps.length?{stepState:_objectSpread$7(_objectSpread$7({},n),{},{currentStep:{type:"CONFIRMATION"},stepIndex:n.steps.length,allStepsCompleted:!0})}:{stepState:_objectSpread$7(_objectSpread$7({},e.stepState),{},{currentStep:_objectSpread$7({},a),stepIndex:t,allStepsCompleted:!1})};if(n.allStepsCompleted&&t===n.steps.length)return{stepState:_objectSpread$7(_objectSpread$7({},n),{},{currentStep:{type:"CONFIRMATION"},stepIndex:n.steps.length,allStepsCompleted:!0})};if(o&&o.isValid&&r===n.steps.length-1&&t===n.steps.length){var i=_objectSpread$7(_objectSpread$7({},n.steps[r]),{},{isCompleted:!0});return{stepState:_objectSpread$7(_objectSpread$7({},n),{},{steps:[].concat(_toConsumableArray(n.steps.slice(0,r)),[i],_toConsumableArray(n.steps.slice(r+1))),currentStep:{type:"CONFIRMATION"},stepIndex:t,allStepsCompleted:!0})}}if(a&&a.isCompleted)return{stepState:_objectSpread$7(_objectSpread$7({},e.stepState),{},{currentStep:_objectSpread$7({},a),stepIndex:t,showValidation:!a.isValid})};if(o&&o.isValid&&t===r+1){var l=_objectSpread$7(_objectSpread$7({},n.steps[r]),{},{isCompleted:!0});return{stepState:_objectSpread$7(_objectSpread$7({},e.stepState),{},{steps:[].concat(_toConsumableArray(n.steps.slice(0,r)),[l],_toConsumableArray(n.steps.slice(r+1))),currentStep:_objectSpread$7({},a),stepIndex:t})}}}return e},verifyStepValidity:function(e,t){var n=e.stepDataMapping[t],r=!(Object.keys(n).map((function(e){return n[Number(e)]})).filter((function(e){return e.isRequired&&!e.value&&!e.objectValue})).length>0);return{stepState:_objectSpread$7(_objectSpread$7({},e.stepState),{},{currentStep:_objectSpread$7(_objectSpread$7({},e.stepState.currentStep),{},{isValid:r})})}},getStepState:function(){return e.getState().stepState},setGenericData:function(e,t){return{genericData:_objectSpread$7(_objectSpread$7({},e.genericData),t)}},setTemplateApp:function(e,t){return{genericData:_objectSpread$7(_objectSpread$7({},e.genericData),{},{templateApp:{name:t.name,iconUrl:t.iconUrl}})}},setStepMapping:function(e,t){var n=t.reduce((function(t,n){var r,o,a,i,l=null,s=!1;n.hide_authorization||e.genericData.isPreviewMode?(s=!0,l=null!==(a=null===(i=n.authorization_type.authorizations[0])||void 0===i?void 0:i.id)&&void 0!==a?a:null):(n.step_authorization||e.stepMapping[n.id])&&(l=e.stepMapping[n.id].selectedAuthId);return _objectSpread$7(_objectSpread$7({},t),{},_defineProperty({},n.id,{step:n,authorizations:null!==(r=null===(o=n.authorization_type.authorizations)||void 0===o?void 0:o.map((function(e){return{authorizationId:e.id,userIdentity:e.user_identity,authType:e.authorization_type,disableLink:e.disable_link,isErrored:!1,isVerified:s}})))&&void 0!==r?r:[],isAuthVerified:s,selectedAuthId:l}))}),{}),r=t.reduce((function(t,n){return _objectSpread$7(_objectSpread$7({},t),{},_defineProperty({},n.id,_objectSpread$7(_objectSpread$7({},e.stepDataMapping[n.id]),n.template_fields.reduce((function(t,r){var o,a;return _objectSpread$7(_objectSpread$7({},t),{},_defineProperty({},r.id,{fieldId:r.id,value:!r.is_visible||r.default_value?r.default_value:e.stepDataMapping[n.id]&&e.stepDataMapping[n.id][r.id]&&e.stepDataMapping[n.id][r.id].value||"",machineName:null===(o=r.activity_field)||void 0===o?void 0:o.machine_name,isRequired:r.is_required,isVisible:r.is_visible,isDynamic:"DYNAMIC"===(null===(a=r.activity_field)||void 0===a?void 0:a.type)}))}),{}))))}),{});return{stepMapping:_objectSpread$7(_objectSpread$7({},e.stepMapping),n),stepDataMapping:_objectSpread$7(_objectSpread$7({},e.stepDataMapping),r),genericData:_objectSpread$7(_objectSpread$7({},e.genericData),{},{templateApp:{name:t.length>0?t[0].activity.app.name:"",iconUrl:t.length>0?t[0].activity.app.icon_url:""}})}},setActivityOutputData:function(e,t){return _objectSpread$7(_objectSpread$7({},e),{},{activityOutputData:t.activityOutputData})},setDynamicFieldData:function(e,t){return _objectSpread$7(_objectSpread$7({},e),{},{dynamicFieldData:Object.keys(t.dynamicFieldData).reduce((function(e,n){return _objectSpread$7(_objectSpread$7({},e),{},_defineProperty({},"{".concat(n,"}"),t.dynamicFieldData[n]))}),{})})},setParentChildMapping:function(e,t){var n=t.reduce((function(t,n){return _objectSpread$7(_objectSpread$7({},t),{},_defineProperty({},n.id,_objectSpread$7(_objectSpread$7({},e.parentChildMapping[n.id]),n.template_fields.reduce((function(e,t){var n,r,o,a,i,l,s;return t.activity_field?_objectSpread$7(_objectSpread$7({},e),{},_defineProperty({},null===(n=t.activity_field)||void 0===n?void 0:n.machine_name,{fieldId:t.id,childFields:null!==(r=t.activity_field)&&void 0!==r&&r.child_fields?JSON.parse(null!==(o=null===(a=t.activity_field)||void 0===a?void 0:a.child_fields)&&void 0!==o?o:"[]"):null,parentFields:null!==(i=t.activity_field)&&void 0!==i&&i.parent_fields?JSON.parse(null!==(l=null===(s=t.activity_field)||void 0===s?void 0:s.parent_fields)&&void 0!==l?l:"[]"):null})):e}),{}))))}),{});return{parentChildMapping:_objectSpread$7(_objectSpread$7({},e.parentChildMapping),n)}},addAuthorization:function(e,t){var n=t.stepId,r=t.authData;return{stepMapping:_objectSpread$7(_objectSpread$7({},e.stepMapping),{},_defineProperty({},n,_objectSpread$7(_objectSpread$7({},e.stepMapping[n]),{},{authorizations:[].concat(_toConsumableArray(e.stepMapping[n].authorizations),[r])})))}},removeAuthorization:function(e,t){var n=t.stepId,r=t.authId;return{stepMapping:_objectSpread$7(_objectSpread$7({},e.stepMapping),{},_defineProperty({},n,_objectSpread$7(_objectSpread$7({},e.stepMapping[n]),{},{authorizations:e.stepMapping[n].authorizations.filter((function(e){return e.authorizationId!==r}))})))}},toggleVerifyAuthorizationFlag:function(e,t){var n=t.stepId,r=t.authId,o=t.isVerifying,a=e.stepMapping[n].authorizations.findIndex((function(e){return e.authorizationId===r}));return{stepMapping:_objectSpread$7(_objectSpread$7({},e.stepMapping),{},_defineProperty({},n,_objectSpread$7(_objectSpread$7({},e.stepMapping[n]),{},{authorizations:[].concat(_toConsumableArray(e.stepMapping[n].authorizations.slice(0,a)),[_objectSpread$7(_objectSpread$7({},e.stepMapping[n].authorizations[a]),{},{isVerifying:o})],_toConsumableArray(e.stepMapping[n].authorizations.slice(a+1)))})))}},toggleDeleteAuthorizationFlag:function(e,t){var n=t.stepId,r=t.authId,o=t.isDeleting,a=t.error,i=e.stepMapping[n].authorizations.findIndex((function(e){return e.authorizationId===r}));return{stepMapping:_objectSpread$7(_objectSpread$7({},e.stepMapping),{},_defineProperty({},n,_objectSpread$7(_objectSpread$7({},e.stepMapping[n]),{},{authorizations:[].concat(_toConsumableArray(e.stepMapping[n].authorizations.slice(0,i)),[_objectSpread$7(_objectSpread$7({},e.stepMapping[n].authorizations[i]),{},{isDeleting:o,error:a})],_toConsumableArray(e.stepMapping[n].authorizations.slice(i+1)))})))}},setStepAuthId:function(e,t){var n=t.stepId,r=t.authId;return{stepMapping:_objectSpread$7(_objectSpread$7({},e.stepMapping),{},_defineProperty({},n,_objectSpread$7(_objectSpread$7({},e.stepMapping[n]),{},{selectedAuthId:r})))}},setStepAuthorization:function(t,n,r,o,a,i){var l,s,p=t.stepState.steps[t.stepState.stepIndex],c=t.stepMapping[n],d=e.getState().stepState;if("CONFIRMATION"!==p.type&&"CONFIRMATION"!==(null===(l=d.currentStep)||void 0===l?void 0:l.type)&&(null===(s=d.currentStep)||void 0===s?void 0:s.stepId)===n){var u=p.invalidFields;o&&delete u[n];var _=_objectSpread$7(_objectSpread$7({},t.stepState.steps[t.stepState.stepIndex]),{},{invalidFields:u,isValid:Object.keys(u).length<1,isCompleted:null!==c.selectedAuthId||o}),m=t.stepMapping[n].authorizations.findIndex((function(e){return e.authorizationId===r}));return{stepState:_objectSpread$7(_objectSpread$7({},t.stepState),{},{steps:[].concat(_toConsumableArray(t.stepState.steps.slice(0,t.stepState.stepIndex)),[_],_toConsumableArray(t.stepState.steps.slice(t.stepState.stepIndex+1))),currentStep:_,showValidation:!o&&!c.selectedAuthId}),stepMapping:_objectSpread$7(_objectSpread$7({},t.stepMapping),{},_defineProperty({},n,_objectSpread$7(_objectSpread$7({},t.stepMapping[n]),{},{selectedAuthId:o?r:t.stepMapping[n].selectedAuthId,authorizations:[].concat(_toConsumableArray(t.stepMapping[n].authorizations.slice(0,m)),[_objectSpread$7(_objectSpread$7({},t.stepMapping[n].authorizations[m]),{},{isVerified:o,isVerifying:!1,didFetchStatus:!0,error:""})],_toConsumableArray(t.stepMapping[n].authorizations.slice(m+1)))}))),stepDataMapping:i?t.stepDataMapping:_objectSpread$7(_objectSpread$7({},t.stepDataMapping),{},_defineProperty({},n,_objectSpread$7(_objectSpread$7({},t.stepDataMapping[n]),a.reduce((function(e,r){return _objectSpread$7(_objectSpread$7({},e),{},_defineProperty({},r,_objectSpread$7(_objectSpread$7({},t.stepDataMapping[n][r]),{},{value:""})))}),{}))))}}return t},resetCustomMappingData:function(e,t){var n,r=null===(n=e.stepMapping[t].step.template_fields.filter((function(e){var t;return"DYNAMIC"===(null===(t=e.activity_field)||void 0===t?void 0:t.type)}))[0])||void 0===n?void 0:n.id;if(r){var o=e.stepDataMapping[t][r];return o&&(o.objectValue={}),{stepDataMapping:_objectSpread$7(_objectSpread$7({},e.stepDataMapping),{},_defineProperty({},t,_objectSpread$7(_objectSpread$7({},e.stepDataMapping[t]),{},_defineProperty({},r,o))))}}return e},setStepFieldData:function(e,t){var n=t.stepId,r=t.fieldId,o=t.value,a=t.isRequired,i=e.stepState.steps[e.stepState.stepIndex];if("CONFIRMATION"!==i.type){var l=i.invalidFields;o?delete l[r]:a&&(l[r]=null);var s=_objectSpread$7(_objectSpread$7({},e.stepState.steps[e.stepState.stepIndex]),{},{invalidFields:l,isValid:Object.keys(l).length<1});return{stepState:_objectSpread$7(_objectSpread$7({},e.stepState),{},{steps:[].concat(_toConsumableArray(e.stepState.steps.slice(0,e.stepState.stepIndex)),[s],_toConsumableArray(e.stepState.steps.slice(e.stepState.stepIndex+1))),currentStep:s,allStepsCompleted:!1}),stepDataMapping:_objectSpread$7(_objectSpread$7({},e.stepDataMapping),{},_defineProperty({},n,_objectSpread$7(_objectSpread$7({},e.stepDataMapping[n]),{},_defineProperty({},r,_objectSpread$7(_objectSpread$7({},e.stepDataMapping[n][r]),{},{value:o})))))}}return e},setStepMappingData:function(e,t){var n,r,o,a,i=null===(n=e.stepDataMapping[t.stepId][t.fieldId])||void 0===n?void 0:n.objectValue;t.value?r=_objectSpread$7(_objectSpread$7({},null!==(o=null===(a=e.stepDataMapping[t.stepId][t.fieldId])||void 0===a?void 0:a.objectValue)&&void 0!==o?o:{}),_defineProperty({},t.id,t.value)):i&&(delete i[t.id],r=i,0===Object.keys(r).length&&(r=null));return r?{stepDataMapping:_objectSpread$7(_objectSpread$7({},e.stepDataMapping),{},_defineProperty({},t.stepId,_objectSpread$7(_objectSpread$7({},e.stepDataMapping[t.stepId]),{},_defineProperty({},t.fieldId,_objectSpread$7(_objectSpread$7({},e.stepDataMapping[t.stepId][t.fieldId]),{},{objectValue:r})))))}:e},reset:function(){return initialState}}},createSDKStore=function(){return devtools(createStore(initialState))},TemplatePreviewDataType=object({id:number(),name:string(),description:string(),app:object({id:number(),name:string(),description:string(),icon_url:string(),color:string(),publishing_status:string(),category:array(string()),app_type:optional(string()),action_url:nullable(optional(string())),created_at:optional(date()),tags:string()}),branding_app:object({id:number(),name:string(),description:string(),icon_url:string(),color:string(),publishing_status:string(),category:array(string()),app_type:optional(string()),action_url:nullable(optional(string())),created_at:optional(date()),tags:string()}),button_text:nullable(string()),is_wizard:boolean(),publishing_status:string(),steps:size(array(object({id:number(),weight:number(),title:string(),is_visible:boolean(),activity:object({id:number(),name:string(),type:string(),endpoint:string(),auth_required:boolean(),total_fields:number(),app:object({id:number(),name:string(),description:string(),icon_url:string(),color:string(),publishing_status:string(),category:array(string()),app_type:optional(string()),action_url:nullable(optional(string())),created_at:optional(date()),tags:string()}),activity_output:nullable(string()),activity_output_url:nullable(string()),dynamic_field_data_endpoint:nullable(string())}),authorization_type:object({id:number(),type:string(),authorizations:array(object({id:number(),authorization_type:string(),app_user:optional(number()),app_user_id:optional(number()),disable_link:optional(string()),integration_count:optional(number()),user_identity:string()})),provider:string(),is_sandbox_enabled:boolean(),authorization_url_sandbox:string()}),template_fields:array(object({id:number(),is_required:boolean(),is_hidden:boolean(),default_value:nullable(string()),weight:number(),description:string(),summary:nullable(string()),placeholder:nullable(string()),activity_field:nullable(object({id:number(),machine_name:string(),type:string(),title:string(),description:string(),weight:number(),is_required:boolean(),child_fields:nullable(string()),is_dynamic:boolean(),data_src:nullable(string()),data_src_endpoint:nullable(number()),parent_fields:nullable(string()),dynamic_field_src:nullable(string()),default_value:nullable(string()),auto_machine_name:string(),dynamic_field_src_endpoint:nullable(number()),regex:nullable(string()),is_searchable:boolean()})),title:nullable(string()),type:string(),child_field:nullable(string()),child_field_value:nullable(string()),button_text:nullable(string()),icon_url:nullable(string()),long_description:nullable(string()),regex:nullable(string()),regex_msg:nullable(string()),is_visible:boolean()})),allow_multiple_authorizations:boolean(),step_authorization:nullable(number()),button_text:nullable(string()),is_self_step:boolean(),summary:nullable(string()),auth_description:nullable(string()),hide_authorization:boolean(),machine_name:nullable(string()),is_custom_machine_name:boolean()})),0,Number.POSITIVE_INFINITY)});function styleInject(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var css_248z$x=".styles-module_loader__2ufbr {\n animation-name: styles-module_ckw__1aYrI;\n animation-duration: 1s;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n transform-origin: 50% 50%; }\n\n@keyframes styles-module_ckw__1aYrI {\n 0% {\n transform: rotate(0deg); }\n 100% {\n transform: rotate(360deg); } }\n",styles$u={loader:"styles-module_loader__2ufbr",ckw:"styles-module_ckw__1aYrI"},_templateObject$D;styleInject(css_248z$x);var Loader=function(){return m$1(_templateObject$D||(_templateObject$D=_taggedTemplateLiteral(["\n <svg\n class=",'\n width="15"\n height="15"\n viewBox="0 0 15 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M9.13037 0.179352C7.57047 -0.168051 5.94039 -0.00810102 4.47777 0.635883C3.01515 1.27987 1.79647 2.37421 0.999409 3.75937C0.202348 5.14453 -0.131421 6.74808 0.0467641 8.33623C0.224949 9.92438 0.90577 11.4141 1.98997 12.5882C3.07417 13.7623 4.50506 14.5593 6.07402 14.8632C7.64298 15.167 9.26799 14.9618 10.7121 14.2773C12.1562 13.5929 13.344 12.4651 14.1022 11.0582C14.8604 9.65144 15.1494 8.03922 14.9271 6.45665L14.1844 6.56098C14.3845 7.9853 14.1243 9.43629 13.442 10.7024C12.7596 11.9685 11.6906 12.9836 10.3909 13.5996C9.09119 14.2156 7.62869 14.4003 6.21662 14.1269C4.80455 13.8534 3.51675 13.136 2.54097 12.0794C1.56519 11.0227 0.952454 9.68194 0.792088 8.2526C0.631721 6.82327 0.932113 5.38008 1.64947 4.13343C2.36682 2.88679 3.46363 1.90188 4.77999 1.32229C6.09635 0.742709 7.56343 0.598754 8.96733 0.911417L9.13037 0.179352Z"\n fill="#E0E0E0"\n />\n <path\n d="M14.93 6.47755C14.7207 4.95709 14.0501 3.53742 13.0085 2.41017C11.9669 1.28292 10.6046 0.50235 9.10537 0.173829L8.94483 0.906446C10.2941 1.20212 11.5202 1.90462 12.4577 2.91915C13.3951 3.93368 13.9987 5.21138 14.187 6.57979L14.93 6.47755Z"\n fill="#ADADAD"\n />\n </svg>\n'])),styles$u.loader)};function notEmpty(e){return null!=e}var classnames=createCommonjsModule((function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var a=_typeof(o);if("string"===a||"number"===a)e.push(o);else if(Array.isArray(o)){if(o.length){var i=n.apply(null,o);i&&e.push(i)}}else if("object"===a)if(o.toString===Object.prototype.toString)for(var l in o)t.call(o,l)&&o[l]&&e.push(l);else e.push(o.toString())}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()})),css_248z$w=".styles-module_preact-hint__2fj-j {\n position: absolute;\n z-index: 9999;\n cursor: default; }\n .styles-module_preact-hint__2fj-j::after {\n content: '';\n width: 0;\n height: 0;\n margin: auto;\n display: block;\n position: absolute;\n border: 4px solid transparent; }\n .styles-module_preact-hint__2fj-j.styles-module_preact-hint__top__eUj7n {\n padding-bottom: 4px; }\n .styles-module_preact-hint__2fj-j.styles-module_preact-hint__top__eUj7n::after {\n top: auto;\n left: 0;\n right: 0;\n bottom: 0;\n border-bottom: none;\n border-top-color: #000; }\n .styles-module_preact-hint__2fj-j.styles-module_preact-hint__bottom__2goUI {\n padding-top: 4px; }\n .styles-module_preact-hint__2fj-j.styles-module_preact-hint__bottom__2goUI::after {\n top: 0;\n left: 0;\n right: 0;\n bottom: auto;\n border-top: none;\n border-bottom-color: #000; }\n\n.styles-module_preact-hint__content__23OpK {\n font-family: inherit;\n background: #000000;\n box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.062132);\n padding: 8px;\n margin: 0;\n border-radius: 2px;\n font-style: normal;\n margin: 0;\n line-height: 12px;\n font-weight: normal;\n font-size: 10px;\n color: #ffffff;\n display: block; }\n",styles$t={"preact-hint":"styles-module_preact-hint__2fj-j","preact-hint__top":"styles-module_preact-hint__top__eUj7n","preact-hint__bottom":"styles-module_preact-hint__bottom__2goUI","preact-hint__content":"styles-module_preact-hint__content__23OpK"},_templateObject$C,_templateObject2$w,_templateObject3$o;function ownKeys$6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread$6(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$6(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$6(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function HintWrap(e){var t=d(null),n=_slicedToArray(v(1e4),2),r=n[0],o=n[1],a=e.position;return p((function(){t.current&&o(t.current.getBoundingClientRect().width)}),[t]),m$1(_templateObject$C||(_templateObject$C=_taggedTemplateLiteral(['\n <div\n class="','"\n style=',"\n >\n <pre class="," ref=",">\n ","\n </pre\n >\n </div>\n "])),"".concat(styles$t["preact-hint"]," ").concat("top"===a?styles$t["preact-hint__top"]:styles$t["preact-hint__bottom"]),_objectSpread$6(_objectSpread$6({},{left:e.targetBoundingRect.left-e.rootBoundingRect.left-r/2+e.targetBoundingRect.width/2}),"top"===a?{bottom:e.rootBoundingRect.height-e.targetBoundingRect.top+e.rootBoundingRect.top+2}:{top:e.rootBoundingRect.height-e.targetBoundingRect.top+e.rootBoundingRect.top+2}),styles$t["preact-hint__content"],t,e.template?e.template(e.content):e.content)}styleInject(css_248z$w);var Hint=function(e){var t=e.position,n=void 0===t?"bottom":t,r=e.attribute,o=void 0===r?"data-hint":r,a=_slicedToArray(v(""),2),i=a[0],l=a[1],s=_slicedToArray(v(null),2),p=s[0],c=s[1],d=_slicedToArray(v(null),2),u=d[0],_=d[1],m=T((function(t){c(t),p&&(p.addEventListener("mouseover",(function(e){e.target instanceof Element&&e.target.hasAttribute(o)&&(l(e.target.getAttribute(o)||""),_(e.target.getBoundingClientRect()))})),p.addEventListener("mouseout",(function(e){e.target instanceof Element&&e.target.hasAttribute(o)&&(l(""),_(null))})),e.dismissOnClick&&p.addEventListener("click",(function(){l(""),_(null)})))}),[p]);return m$1(_templateObject2$w||(_templateObject2$w=_taggedTemplateLiteral(["\n <div ref=",' style="position: relative">\n ',"\n ","\n </div>\n "])),m,i&&p&&u&&m$1(_templateObject3$o||(_templateObject3$o=_taggedTemplateLiteral([" <","\n content=","\n position=","\n template=","\n rootBoundingRect=","\n targetBoundingRect=","\n />"])),HintWrap,i,n,e.template,null==p?void 0:p.getBoundingClientRect(),u),e.children)},css_248z$v=".styles-module_loader__2AOKp {\n display: flex; }\n .styles-module_loader__2AOKp svg {\n animation-name: styles-module_fadeInOut__eKHQq;\n animation-duration: 1s;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n animation-delay: 0;\n margin: 0px 2px; }\n .styles-module_loader__2AOKp svg:nth-child(2) {\n animation-delay: 0.3s; }\n .styles-module_loader__2AOKp svg:nth-child(3) {\n animation-delay: 0.6s; }\n\n@keyframes styles-module_fadeInOut__eKHQq {\n 0% {\n opacity: 0.3; }\n 50% {\n opacity: 1; }\n 100% {\n opacity: 0.3; } }\n",styles$s={loader:"styles-module_loader__2AOKp",fadeInOut:"styles-module_fadeInOut__eKHQq"},_templateObject$B,_templateObject2$v;styleInject(css_248z$v);var LoaderDot=function(e){return m$1(_templateObject$B||(_templateObject$B=_taggedTemplateLiteral(["\n <svg\n width=","\n height=",'\n viewBox="0 0 '," ",'"\n fill=','\n xmlns="http://www.w3.org/2000/svg"\n >\n <circle\n cx="','"\n cy=',"\n r=","\n fill=","\n />\n </svg>\n"])),e.size,e.size,e.size,e.size,e.color,e.size/2,e.size/2,e.size/2,e.color)},ThreeDotLoader=function(e){var t=e.size,n=void 0===t?6:t,r=e.color,o=void 0===r?"#fff":r;return m$1(_templateObject2$v||(_templateObject2$v=_taggedTemplateLiteral(["\n <div class=",">\n <"," size="," color="," />\n <"," size="," color="," />\n <"," size="," color="," />\n </div>\n "])),styles$s.loader,LoaderDot,n,o,LoaderDot,n,o,LoaderDot,n,o)},css_248z$u=".styles-module_button__osBYJ {\n outline: none;\n cursor: pointer;\n -webkit-appearance: none;\n appearance: none;\n font-size: 12px;\n padding: 0px 15px;\n height: 30px; }\n .styles-module_button__osBYJ.styles-module_buttonPrimary__1u5p2 {\n border: 1px solid #5f4d86;\n background: #5f4d86;\n border-radius: 4px;\n font-size: 12px;\n color: #ffffff; }\n .styles-module_button__osBYJ.styles-module_buttonPrimary__1u5p2:not(.styles-module_disabled__CiT_f):hover {\n background-color: #473a64; }\n .styles-module_button__osBYJ.styles-module_buttonSecondary__2HV1m {\n border: 1px solid #5f4d86;\n background: transparent;\n text-align: center;\n font-size: 12px;\n color: #5f4d86;\n border-radius: 4px; }\n .styles-module_button__osBYJ.styles-module_buttonSecondary__2HV1m:not(.styles-module_disabled__CiT_f):hover {\n background: #5f4d86;\n color: white; }\n .styles-module_button__osBYJ.styles-module_buttonLink__39jcU {\n border: none;\n color: #5f4d86;\n font-weight: 500;\n font-size: 12px;\n background: transparent;\n padding: 0;\n margin: 0; }\n .styles-module_button__osBYJ.styles-module_buttonLink__39jcU:not(.styles-module_disabled__CiT_f):hover {\n color: #473a64; }\n .styles-module_button__osBYJ.styles-module_disabled__CiT_f {\n opacity: 0.5;\n cursor: not-allowed; }\n",styles$r={button:"styles-module_button__osBYJ",buttonPrimary:"styles-module_buttonPrimary__1u5p2",disabled:"styles-module_disabled__CiT_f",buttonSecondary:"styles-module_buttonSecondary__2HV1m",buttonLink:"styles-module_buttonLink__39jcU"},_templateObject$A,_templateObject2$u;styleInject(css_248z$u);var _excluded$1=["label","type","color","backgroundColor","disabled","tooltip","dismissOnClick","isLoading","position","onClick"],ButtonTypes;function ownKeys$5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread$5(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$5(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$5(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}!function(e){e.PRIMARY="primary",e.SECONDARY="secondary",e.LINK="link"}(ButtonTypes||(ButtonTypes={}));var Button=function(e){var t,n=e.label,r=e.type,o=void 0===r?ButtonTypes.PRIMARY:r,a=e.color,i=void 0===a?null:a,l=e.backgroundColor,s=void 0===l?null:l,p=e.disabled,c=void 0!==p&&p,d=e.tooltip,u=e.dismissOnClick,_=void 0===u||u,m=e.isLoading,f=void 0!==m&&m,y=e.position,g=void 0===y?"bottom":y,h=e.onClick,v=void 0===h?void 0:h,b=_objectWithoutProperties(e,_excluded$1);return m$1(_templateObject$A||(_templateObject$A=_taggedTemplateLiteral(["\n <"," dismissOnClick="," position=",'>\n <button\n type="button"\n onclick=',"\n data-hint=","\n class=","\n style=","\n ","\n >\n ","\n </button>\n <//>\n "])),Hint,_,g,v,d||null,classnames(styles$r.button,(_defineProperty(t={},styles$r.buttonPrimary,o===ButtonTypes.PRIMARY),_defineProperty(t,styles$r.buttonSecondary,o===ButtonTypes.SECONDARY),_defineProperty(t,styles$r.buttonLink,o===ButtonTypes.LINK),_defineProperty(t,styles$r.disabled,c),t)),{backgroundColor:o===ButtonTypes.PRIMARY?s:null,borderColor:o===ButtonTypes.PRIMARY?s:i,color:i},_objectSpread$5({},b),f?m$1(_templateObject2$u||(_templateObject2$u=_taggedTemplateLiteral(["<"," />"])),ThreeDotLoader):n)},css_248z$t=".styles-module_errorPageWrapper__BMBHQ {\n font-family: monospace;\n border: 1px solid red;\n padding: 30px; }\n .styles-module_errorPageWrapper__BMBHQ .styles-module_errorTitle__1baLE {\n color: #b61717;\n font-weight: bold;\n font-size: 16px;\n line-height: 20px;\n margin-bottom: 8px; }\n .styles-module_errorPageWrapper__BMBHQ .styles-module_errorDescription__1dTc9 {\n font-size: 14px;\n margin-bottom: 18px; }\n .styles-module_errorPageWrapper__BMBHQ .styles-module_errorContainer__3WprN {\n overflow: hidden;\n background: #ffebeb;\n padding: 4px;\n margin-bottom: 20px; }\n .styles-module_errorPageWrapper__BMBHQ .styles-module_errorPayload__OjsC- {\n margin: 0;\n padding: 8px 12px; }\n",styles$q={errorPageWrapper:"styles-module_errorPageWrapper__BMBHQ",errorTitle:"styles-module_errorTitle__1baLE",errorDescription:"styles-module_errorDescription__1dTc9",errorContainer:"styles-module_errorContainer__3WprN",errorPayload:"styles-module_errorPayload__OjsC-"},_templateObject$z,_templateObject2$t,_templateObject3$n;styleInject(css_248z$t);var ErrorPage=function(e){var t=e.title,n=e.description,r=e.errorPayload,o=e.onDismiss,a=void 0===o?null:o;return m$1(_templateObject$z||(_templateObject$z=_taggedTemplateLiteral(['\n <div class="','">\n <div class=',">","</div>\n <div class=",">","</div>\n ","\n ","\n </div>\n "])),styles$q.errorPageWrapper,styles$q.errorTitle,t,styles$q.errorDescription,n,r&&m$1(_templateObject2$t||(_templateObject2$t=_taggedTemplateLiteral(["\n <div class=",">\n <pre class=",">","</pre>\n <pre class=",">","</pre>\n </div>\n "])),styles$q.errorContainer,styles$q.errorPayload,r.message,styles$q.errorPayload,r.stack),a&&m$1(_templateObject3$n||(_templateObject3$n=_taggedTemplateLiteral(["\n <div>\n <",' label="Dismiss" onClick='," />\n </div>\n "])),Button,a))};function useEventListener(e,t,n){var r=d();p((function(){var o=(null==n?void 0:n.current)||window;if(o&&o.addEventListener){r.current!==t&&(r.current=t);var a=function(e){null!=r&&r.current&&r.current(e)};return o.addEventListener(e,a),function(){o.removeEventListener(e,a)}}}),[e,n,t])}function useElementSize(e){var t=_slicedToArray(v({width:0,height:0}),2),n=t[0],r=t[1],o=T((function(){var t=null==e?void 0:e.current;t&&r({width:t.offsetWidth||0,height:t.offsetHeight||0})}),[e]);return p((function(){o()}),[]),useEventListener("resize",o),n}function useDebounce(e,t){var n=_slicedToArray(v(e),2),r=n[0],o=n[1];return p((function(){var n=setTimeout((function(){return o(e)}),t||500);return function(){clearTimeout(n)}}),[e,t]),r}var css_248z$s=".styles-module_navigation__2IuNI {\n margin-bottom: 45px;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center; }\n\n.styles-module_collapse__G_01I {\n display: flex;\n width: 30px;\n height: 22px;\n padding-top: 2px;\n align-items: center;\n margin-right: 20px; }\n .styles-module_collapse__G_01I .styles-module_dots__3ItWV {\n cursor: pointer;\n height: 16px;\n padding-right: 10px; }\n .styles-module_collapse__G_01I .styles-module_popup__39sdx {\n position: absolute;\n display: none;\n padding: 0 10px;\n background: #ffffff;\n border: 1px solid #f3f3f3;\n box-shadow: 0px 2px 7px rgba(162, 162, 162, 0.25);\n border-radius: 4px;\n top: 28px;\n z-index: 100; }\n .styles-module_collapse__G_01I .styles-module_popup__39sdx.styles-module_show__L1e5K {\n display: block; }\n .styles-module_collapse__G_01I .styles-module_popup__39sdx .styles-module_stepItem__NPXF_ {\n padding: 10px 0px; }\n .styles-module_collapse__G_01I .styles-module_popup__39sdx .styles-module_stepItem__NPXF_:not(:last-child) {\n border-bottom: 1px solid #f3f3f3; }\n .styles-module_collapse__G_01I .styles-module_arrow__3C8To svg {\n opacity: 0.5; }\n\n.styles-module_navItem__1kxtL {\n cursor: pointer;\n color: #1f2937; }\n .styles-module_navItem__1kxtL .styles-module_navItemContent__28oLq {\n display: flex;\n align-items: center;\n padding-right: 0.25rem; }\n .styles-module_navItem__1kxtL .styles-module_navItemContent__28oLq p {\n margin: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n font-weight: 400;\n color: #333333; }\n .styles-module_navItem__1kxtL .styles-module_navItemContent__28oLq .styles-module_imgContainer__wbjM4 {\n position: relative;\n margin-right: 0.5rem;\n height: 15px;\n width: 15px;\n overflow: hidden;\n border-radius: 9999px; }\n .styles-module_navItem__1kxtL .styles-module_navItemContent__28oLq .styles-module_imgContainer__wbjM4 img,\n .styles-module_navItem__1kxtL .styles-module_navItemContent__28oLq .styles-module_imgContainer__wbjM4 svg {\n position: absolute;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n object-fit: cover; }\n .styles-module_navItem__1kxtL .styles-module_arrow__3C8To {\n margin-top: 2px;\n margin-left: 0.75rem;\n margin-right: 0.5rem; }\n .styles-module_navItem__1kxtL.styles-module_active__28cMj {\n opacity: 1; }\n .styles-module_navItem__1kxtL.styles-module_active__28cMj p {\n font-weight: 500; }\n .styles-module_navItem__1kxtL.styles-module_disabled__1Ltqi {\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n opacity: 0.5; }\n .styles-module_navItem__1kxtL.styles-module_disabled__1Ltqi p {\n font-weight: 400; }\n",styles$p={navigation:"styles-module_navigation__2IuNI",collapse:"styles-module_collapse__G_01I",dots:"styles-module_dots__3ItWV",popup:"styles-module_popup__39sdx",show:"styles-module_show__L1e5K",stepItem:"styles-module_stepItem__NPXF_",arrow:"styles-module_arrow__3C8To",navItem:"styles-module_navItem__1kxtL",navItemContent:"styles-module_navItemContent__28oLq",imgContainer:"styles-module_imgContainer__wbjM4",active:"styles-module_active__28cMj",disabled:"styles-module_disabled__1Ltqi"},_templateObject$y,_templateObject2$s,_templateObject3$m,_templateObject4$g,_templateObject5$e;function _createSuper$f(e){var t=_isNativeReflectConstruct$f();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}styleInject(css_248z$s);var TickMark$1=m$1(_templateObject$y||(_templateObject$y=_taggedTemplateLiteral([' <svg\n width="15"\n height="15"\n viewBox="0 0 15 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n>\n <rect opacity="0.7" width="15" height="15" rx="7.5" fill="#2ECC71" />\n <path\n d="M9.23107 6.34619L6.96066 8.94234L5.76953 7.58033"\n stroke="white"\n stroke-width="1.2"\n stroke-linecap="round"\n />\n</svg>']))),FinalTickMark$1=m$1(_templateObject2$s||(_templateObject2$s=_taggedTemplateLiteral(['\n <svg\n width="15"\n height="15"\n viewBox="0 0 15 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <circle\n cx="7.5"\n cy="7.5"\n r="6.75"\n fill="white"\n stroke="#2ECC71"\n stroke-width="1.5"\n />\n <path\n d="M10.3333 5.5L6.83522 9.5L5 7.40148"\n stroke="#2ECC71"\n stroke-width="1.5"\n stroke-linecap="round"\n />\n </svg>\n']))),NavItem$1=function(e){_inherits(n,e);var t=_createSuper$f(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n,[{key:"render",value:function(){var e=this.props,t=e.logoUrl,n=e.isActive,r=void 0!==n&&n,o=e.isCompleted,a=void 0!==o&&o,i=e.isDisabled,l=void 0!==i&&i,s=e.isLastStep,p=void 0!==s&&s,c=e.onClick,d=void 0===c?function(){return null}:c,u=e.showArrow,_=void 0===u||u;return m$1(_templateObject3$m||(_templateObject3$m=_taggedTemplateLiteral(["\n <div\n class=","\n onclick=",'\n tabindex="-1"\n role="button"\n >\n <div class=',">\n <div class=",">\n ","\n ","\n </div>\n <p>","</p>\n ","\n </div>\n </div>\n "])),"".concat(styles$p.navItem," ").concat(l?styles$p.disabled:""," ").concat(r?styles$p.active:""),d,styles$p.navItemContent,styles$p.imgContainer,!a||r?m$1(_templateObject4$g||(_templateObject4$g=_taggedTemplateLiteral(["<img src="," />"])),t):TickMark$1,p&&FinalTickMark$1,this.props.label,!p&&_&&m$1(_templateObject5$e||(_templateObject5$e=_taggedTemplateLiteral(["\n <div class=",'>\n <svg\n width="6"\n height="11"\n viewBox="0 0 6 11"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M0.917969 1.33366L5.08464 5.50033L0.917969 9.66699"\n stroke="#999999"\n stroke-linecap="round"\n />\n </svg>\n </div>\n '])),styles$p.arrow))}}]),n}(d$1),_templateObject$x,_templateObject2$r;function useOnClickOutside(e,t){p((function(){var n=function(n){n.target instanceof HTMLElement&&(!e.current||e.current.contains(n.target))||t(n)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),function(){document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}}),[e,t])}var CollapsedSteps=function(e){var t=e.steps,n=e.currentStepIndex,r=e.isPreviewMode,o=e.changeStep,a=d(),i=d(),l=_slicedToArray(v(!1),2),s=l[0],p=l[1];return useOnClickOutside(a,(function(){return s?p(!1):null})),m$1(_templateObject$x||(_templateObject$x=_taggedTemplateLiteral(["\n <div class=",">\n <div\n class=","\n ref=","\n onclick=",'\n >\n <svg\n width="16"\n height="17"\n viewBox="0 0 16 17"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M3.60039 9.83213C4.26313 9.83213 4.80039 9.29487 4.80039 8.63213C4.80039 7.96939 4.26313 7.43213 3.60039 7.43213C2.93765 7.43213 2.40039 7.96939 2.40039 8.63213C2.40039 9.29487 2.93765 9.83213 3.60039 9.83213Z"\n fill="#333333"\n />\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M7.60039 9.83213C8.26313 9.83213 8.80039 9.29487 8.80039 8.63213C8.80039 7.96939 8.26313 7.43213 7.60039 7.43213C6.93765 7.43213 6.40039 7.96939 6.40039 8.63213C6.40039 9.29487 6.93765 9.83213 7.60039 9.83213Z"\n fill="#333333"\n />\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M11.6004 9.83213C12.2631 9.83213 12.8004 9.29487 12.8004 8.63213C12.8004 7.96939 12.2631 7.43213 11.6004 7.43213C10.9376 7.43213 10.4004 7.96939 10.4004 8.63213C10.4004 9.29487 10.9376 9.83213 11.6004 9.83213Z"\n fill="#333333"\n />\n </svg>\n </div>\n <div\n ref=','\n class="'," ",'"\n >\n ',"\n </div>\n <div class=",'>\n <svg\n width="6"\n height="11"\n viewBox="0 0 6 11"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M0.917969 1.33366L5.08464 5.50033L0.917969 9.66699"\n stroke="#999999"\n stroke-linecap="round"\n />\n </svg>\n </div>\n </div>\n '])),styles$p.collapse,styles$p.dots,i,(function(){return p(!0)}),a,styles$p.popup,s?styles$p.show:"",t.map((function(e){return m$1(_templateObject2$r||(_templateObject2$r=_taggedTemplateLiteral(["<div class=",">\n <","\n label=","\n logoUrl=","\n isCompleted=","\n isActive=","\n isDisabled=","\n isLastStep=","\n showArrow=","\n onClick=","\n />\n </div>"])),styles$p.stepItem,NavItem$1,"CONFIRMATION"!==e.type?e.title:"Confirmation","CONFIRMATION"!==e.type&&e.iconUrl,!r&&e.isCompleted,"CONFIRMATION"!==e.type&&n===e.itemIndex,r&&Number(n)!==e.itemIndex||Number(n)<e.itemIndex,!1,!1,(function(){p(!1),o(e.itemIndex)}))})),styles$p.arrow)},_templateObject$w,_templateObject2$q,_templateObject3$l,_templateObject4$f,_templateObject5$d;function ownKeys$4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread$4(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$4(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$4(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var StepNavigation$2=function(e){var t=d(),n=e.gotoStep,r=e.stepState,o=r.stepIndex,a=r.steps,i=r.currentStep,l=r.allStepsCompleted,s=w(AppContext),c=useElementSize(t).width,u=useDebounce(c,150),_=_slicedToArray(v([]),2),m=_[0],f=_[1];p((function(){var e=0;e=0===u?c:u;var n=[];if(t.current){var r=-1;e/220<=a.length?a.length<=2?n.push({type:"VISIBLE",steps:a.map((function(e){return r+=1,_objectSpread$4(_objectSpread$4({},e),{},{itemIndex:r})}))}):a.length>2&&(r+=1,n.push({type:"VISIBLE",steps:[_objectSpread$4(_objectSpread$4({},a[0]),{},{itemIndex:r})]}),0!==o&&o!==a.length?(o>1&&n.push({type:"COLLAPSED",steps:a.slice(1,o).map((function(e){return r+=1,_objectSpread$4(_objectSpread$4({},e),{},{itemIndex:r})}))}),n.push({type:"VISIBLE",steps:[_objectSpread$4(_objectSpread$4({},a[o]),{},{itemIndex:o})]}),r+=1,a.length-o>1&&n.push({type:"COLLAPSED",steps:a.slice(o+1,a.length).map((function(e){return r+=1,_objectSpread$4(_objectSpread$4({},e),{},{itemIndex:r})}))})):n.push({type:"COLLAPSED",steps:a.slice(1,a.length).map((function(e){return r+=1,_objectSpread$4(_objectSpread$4({},e),{},{itemIndex:r})}))})):n=[{type:"VISIBLE",steps:a.map((function(e,t){return _objectSpread$4(_objectSpread$4({},e),{},{itemIndex:t})}))}]}f(n)}),[a,c,u,o]);var y=function(e){n(e)};return m$1(_templateObject$w||(_templateObject$w=_taggedTemplateLiteral(["\n <div class="," ref=",">\n ","\n ","\n </div>\n "])),styles$p.navigation,t,m.map((function(e){return"VISIBLE"===e.type?e.steps.map((function(e){return m$1(_templateObject2$q||(_templateObject2$q=_taggedTemplateLiteral(["\n <div\n class=","\n style=","\n >\n <","\n label=","\n logoUrl=","\n isCompleted=","\n isActive=","\n isDisabled=","\n isLastStep=","\n onClick=","\n />\n </div>\n "])),styles$p.stepItem,{maxWidth:220},NavItem$1,"CONFIRMATION"!==e.type?e.title:"Confirmation","CONFIRMATION"!==e.type&&e.iconUrl,!(null!=s&&s.isPreviewMode)&&e.isCompleted,"CONFIRMATION"!==(null==i?void 0:i.type)&&"CONFIRMATION"!==e.type&&o===e.itemIndex,!l&&((null==s?void 0:s.isPreviewMode)&&Number(o)!==e.itemIndex||Number(o)<e.itemIndex),e.itemIndex===a.length,(function(){return y(e.itemIndex)}))})):"COLLAPSED"===e.type?m$1(_templateObject3$l||(_templateObject3$l=_taggedTemplateLiteral(["\n <","\n isPreviewMode=","\n currentStepIndex=","\n changeStep=","\n steps=","\n />\n "])),CollapsedSteps,null==s?void 0:s.isPreviewMode,o,y,e.steps):m$1(_templateObject4$f||(_templateObject4$f=_taggedTemplateLiteral(["<></>"])))})),m.length>0&&m$1(_templateObject5$d||(_templateObject5$d=_taggedTemplateLiteral(["\n <",'\n label="Confirmation"\n logoUrl=""\n isCompleted=',"\n isActive=","\n isDisabled=","\n isLastStep=","\n onClick=","\n />\n "])),NavItem$1,!0,void 0!==i&&o===a.length,!l&&void 0!==i&&o!==a.length,!0,(function(){var e;return y(null!==(e=a.length)&&void 0!==e?e:0)})))},StepNavigation$3=preact.connect("stepState",actionFunctions)(StepNavigation$2),css_248z$r=".styles-module_radioGroup__1aPpR fieldset {\n border: none;\n padding: 0; }\n\n.styles-module_radio__1wJfU {\n position: relative;\n display: flex;\n align-items: center;\n margin: 10px 0; }\n .styles-module_radio__1wJfU .styles-module_button__3PLW1 {\n position: absolute;\n width: 15px;\n height: 15px;\n left: 0;\n display: inline-block;\n border-radius: 9999px;\n background: transparent; }\n .styles-module_radio__1wJfU .styles-module_button__3PLW1 svg {\n width: 100%;\n height: 100%; }\n .styles-module_radio__1wJfU input[type='radio'] {\n opacity: 0;\n margin: 0; }\n .styles-module_radio__1wJfU label {\n display: flex;\n margin-left: 15px;\n align-items: center;\n cursor: pointer; }\n .styles-module_radio__1wJfU .styles-module_text__Jq7I0 {\n font-style: normal;\n font-weight: normal;\n font-size: 14px;\n margin: 2px 0;\n color: #333333; }\n .styles-module_radio__1wJfU .styles-module_description__2UsHV {\n font-size: 12px;\n line-height: 15px;\n color: #999999; }\n",styles$o={radioGroup:"styles-module_radioGroup__1aPpR",radio:"styles-module_radio__1wJfU",button:"styles-module_button__3PLW1",text:"styles-module_text__Jq7I0",description:"styles-module_description__2UsHV"},_templateObject$v,_templateObject2$p,_templateObject3$k,_templateObject4$e;styleInject(css_248z$r);var Radio=function(e){var t=e.label,n=e.name,r=e.description,o=void 0===r?null:r,a=e.value,i=e.isChecked,l=void 0!==i&&i,s=e.handleChange,p=void 0===s?function(){return null}:s;return m$1(_templateObject$v||(_templateObject$v=_taggedTemplateLiteral(["\n <div class=",">\n <input\n id=",'\n type="radio"\n name=',"\n value=","\n checked=","\n onclick=","\n />\n <div>\n <label for=",">\n <div class=",">\n ","\n </div>\n <div>\n <div class=",">","</div>\n ","\n </div>\n </label>\n </div>\n </div>\n "])),styles$o.radio,a,n,a,l,(function(e){if(e.currentTarget instanceof HTMLInputElement){var t=e.currentTarget.value;p(t)}}),a,styles$o.button,m$1(l?_templateObject2$p||(_templateObject2$p=_taggedTemplateLiteral(['\n <svg\n width="15"\n height="15"\n viewBox="0 0 15 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M14 7.5C14 11.0899 11.0899 14 7.5 14C3.91015 14 1 11.0899 1 7.5C1 3.91015 3.91015 1 7.5 1C11.0899 1 14 3.91015 14 7.5Z"\n fill="white"\n stroke="#5F4D86"\n stroke-width="2"\n />\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M7.5 11C9.433 11 11 9.433 11 7.5C11 5.567 9.433 4 7.5 4C5.567 4 4 5.567 4 7.5C4 9.433 5.567 11 7.5 11Z"\n fill="#5F4D86"\n />\n </svg>\n '])):_templateObject3$k||(_templateObject3$k=_taggedTemplateLiteral(['\n <svg\n width="15"\n height="15"\n viewBox="0 0 15 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M14 7.5C14 11.0899 11.0899 14 7.5 14C3.91015 14 1 11.0899 1 7.5C1 3.91015 3.91015 1 7.5 1C11.0899 1 14 3.91015 14 7.5Z"\n fill="white"\n stroke="#E2E0DB"\n stroke-width="2"\n />\n </svg>\n ']))),styles$o.text,t,o&&m$1(_templateObject4$e||(_templateObject4$e=_taggedTemplateLiteral(["<div class=",">","</div>"])),styles$o.description,o))},css_248z$q=".styles-module_errorMessage__2b8A_ {\n margin-top: 4px;\n font-size: 12px;\n color: #f05c42; }\n",styles$n={errorMessage:"styles-module_errorMessage__2b8A_"},_templateObject$u;styleInject(css_248z$q);var ErrorMessage=function(e){var t=e.children;return m$1(_templateObject$u||(_templateObject$u=_taggedTemplateLiteral([" <div class=",">","</div> "])),styles$n.errorMessage,t)},css_248z$p=".styles-module_label__PbFlo label > div:first-child {\n font-style: normal;\n font-weight: 500;\n font-size: 14px;\n line-height: 17px;\n color: #333333;\n margin-bottom: 5px; }\n\n.styles-module_label__PbFlo label > div:nth-child(2) {\n font-size: 14px;\n line-height: 17px;\n letter-spacing: -0.2px;\n color: #8c8c8c; }\n\n.styles-module_label__PbFlo .styles-module_required__1XFqi {\n color: red;\n font-size: 16px;\n margin-left: 2px; }\n",styles$m={label:"styles-module_label__PbFlo",required:"styles-module_required__1XFqi"},_templateObject$t,_templateObject2$o,_templateObject3$j;styleInject(css_248z$p);var Label=function(e){var t=e.title,n=e.description,r=e.isRequired,o=void 0!==r&&r;return m$1(_templateObject$t||(_templateObject$t=_taggedTemplateLiteral(["\n <div class=",">\n <label>\n <div>\n ","\n ","\n </div>\n ","\n </label>\n </div>\n "])),styles$m.label,t,o&&m$1(_templateObject2$o||(_templateObject2$o=_taggedTemplateLiteral(["<span class=",">*</span>"])),styles$m.required),n&&m$1(_templateObject3$j||(_templateObject3$j=_taggedTemplateLiteral(["<div>","</div>"])),n))},isBrowser=function(){return!["undefined"==typeof window?"undefined":_typeof(window),"undefined"==typeof document?"undefined":_typeof(document)].includes("undefined")};function openPopupWindow(e,t,n,r,o){if(n.top){var a=n.top.outerHeight/2+n.top.screenY-o/2,i=n.top.outerWidth/2+n.top.screenX-r/2;return n.open(e,t,"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=".concat(r,", height=").concat(o,", top=").concat(a,", left=").concat(i))}return null}function isAuthMessage(e){return void 0!==e}var css_248z$o=".styles-module_authSelectorWrap__34g8J .styles-module_label__19jW8 {\n font-weight: 800;\n font-size: 14px;\n color: #333333;\n line-height: 20px;\n margin-bottom: 5px; }\n .styles-module_authSelectorWrap__34g8J .styles-module_label__19jW8 span {\n color: #ff4d34;\n margin-left: 2px;\n font-size: 16px; }\n\n.styles-module_authSelectorWrap__34g8J .styles-module_rows__1gpAK {\n margin-top: 10px;\n margin-bottom: 20px; }\n\n.styles-module_authSelectorWrap__34g8J .styles-module_error__aL4zj {\n color: #f05c42; }\n .styles-module_authSelectorWrap__34g8J .styles-module_error__aL4zj button {\n color: #f05c42;\n border-color: #f05c42; }\n\n.styles-module_authSelectorWrap__34g8J .styles-module_errorMessage__3YjSh {\n margin-top: 4px;\n font-size: 12px;\n line-height: 15px;\n letter-spacing: -0.197647px;\n color: #f05c42; }\n\n.styles-module_authSelectorWrap__34g8J .styles-module_description__2c5sj {\n font-size: 14px;\n line-height: 20px;\n color: #8c8c8c;\n margin-bottom: 10px; }\n\n.styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t {\n display: flex;\n align-items: center;\n justify-content: space-between;\n color: #333;\n font-size: 14px;\n min-width: 380px;\n padding-right: 8px; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr {\n display: flex;\n align-items: center;\n font-size: 12px;\n margin-left: 20px; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_deleteIcon__1mAJb {\n padding-left: 8px;\n padding-right: 8px;\n display: flex;\n align-items: center;\n cursor: pointer; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_deleteIcon__1mAJb svg {\n cursor: pointer;\n visibility: hidden;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa {\n position: relative; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa div {\n display: flex;\n align-items: center; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa svg {\n margin-left: 8px; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa .styles-module_statusRed__1FG13,\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa .styles-module_statusOrange__1FNhi,\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa .styles-module_statusGreen__1OD_4 {\n width: 5px;\n height: 5px;\n border-radius: 9999px;\n margin: 0 8px; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa .styles-module_statusRed__1FG13 {\n background: #e26154; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa .styles-module_statusOrange__1FNhi {\n background: #fcc700; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa .styles-module_statusGreen__1OD_4 {\n background: #2ecc71; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa span {\n margin-left: 10px; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t .styles-module_statusWrap__3amIr .styles-module_status__OwFQa .styles-module_resend__To8qG {\n cursor: pointer; }\n .styles-module_authSelectorWrap__34g8J .styles-module_checkboxRow__3Q67t:hover .styles-module_statusWrap__3amIr svg {\n visibility: visible;\n -webkit-user-select: auto;\n -ms-user-select: auto;\n user-select: auto; }\n",styles$l={authSelectorWrap:"styles-module_authSelectorWrap__34g8J",label:"styles-module_label__19jW8",rows:"styles-module_rows__1gpAK",error:"styles-module_error__aL4zj",errorMessage:"styles-module_errorMessage__3YjSh",description:"styles-module_description__2c5sj",checkboxRow:"styles-module_checkboxRow__3Q67t",statusWrap:"styles-module_statusWrap__3amIr",deleteIcon:"styles-module_deleteIcon__1mAJb",status:"styles-module_status__OwFQa",statusRed:"styles-module_statusRed__1FG13",statusOrange:"styles-module_statusOrange__1FNhi",statusGreen:"styles-module_statusGreen__1OD_4",resend:"styles-module_resend__To8qG"},_templateObject$s,_templateObject2$n,_templateObject3$i,_templateObject4$d,_templateObject5$c,_templateObject6$7,_templateObject7$6,_templateObject8$4,_templateObject9$4,_templateObject10$4,_templateObject11$4;function _createSuper$e(e){var t=_isNativeReflectConstruct$e();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$e(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}styleInject(css_248z$o);var Resend=function(){return m$1(_templateObject$s||(_templateObject$s=_taggedTemplateLiteral(["\n <svg\n class=",'\n width="13"\n height="15"\n viewBox="0 0 13 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M11.8403 5.34L10.1453 6.345C10.5053 6.96 10.7003 7.68 10.7003 8.445C10.7003 10.77 8.81031 12.645 6.50031 12.645C4.19031 12.645 2.30031 10.755 2.30031 8.445C2.30031 6.135 4.19031 4.245 6.50031 4.245V6.15L11.1053 3.27L6.50031 0.375V2.28C3.09531 2.28 0.320312 5.055 0.320312 8.46C0.320313 11.85 3.09531 14.625 6.50031 14.625C9.90531 14.625 12.6803 11.85 12.6803 8.445C12.6803 7.32 12.3653 6.255 11.8403 5.34Z"\n fill="#8D8D8D"\n />\n </svg>\n'])),styles$l.resend)},AuthorizationRow=function(e){var t=e.label,n=e.name,r=e.value,o=e.isChecked,a=e.status,i=void 0===a?"IDLE":a,l=e.isDeleting,s=void 0!==l&&l,p=e.handleChange,c=e.handleReverify,d=e.handleDelete,u=void 0===d?function(){return null}:d,_=e.error;return m$1(_templateObject2$n||(_templateObject2$n=_taggedTemplateLiteral(["\n <div class=",">\n <","\n label=","\n name=","\n value=","\n isChecked=","\n handleChange=","\n />\n <div class=",">\n <div class=",">\n <div>\n ","\n </div>\n <div>\n ","\n </div>\n <div>\n ","\n </div>\n ","\n ","\n </div>\n <div class="," onclick=",">\n ","\n </div>\n </div>\n </div>\n "])),styles$l.checkboxRow,Radio,t,n,r,o,p,styles$l.statusWrap,styles$l.status,"VERIFYING"===i&&!s&&m$1(_templateObject3$i||(_templateObject3$i=_taggedTemplateLiteral(["<div class="," />\n Verifying <"," /> "])),styles$l.statusOrange,Loader),"CONNECTED"===i&&!_&&!s&&m$1(_templateObject4$d||(_templateObject4$d=_taggedTemplateLiteral(["<div class="," />\n Connected"])),styles$l.statusGreen),"ERROR"===i&&!s&&m$1(_templateObject5$c||(_templateObject5$c=_taggedTemplateLiteral(["<div class="," />\n Failed\n <div onclick=","><"," /></div>"])),styles$l.statusRed,c,Resend),s&&m$1(_templateObject6$7||(_templateObject6$7=_taggedTemplateLiteral(["<"," />"])),Loader),_&&!s&&!("VERIFYING"===i)&&m$1(_templateObject7$6||(_templateObject7$6=_taggedTemplateLiteral(["<div class=",">","</div>"])),styles$l.error,_),styles$l.deleteIcon,u,!("VERIFYING"===i||s)&&m$1(_templateObject8$4||(_templateObject8$4=_taggedTemplateLiteral(['\n <svg\n width="15"\n height="15"\n viewBox="0 0 15 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path d="M1.5 4.1999H13.65" stroke="#F05C42" />\n <path\n d="M11.6254 5.5498V6.2248L10.9504 13.6498H4.20039L3.52539 6.2248V5.5498"\n stroke="#F05C42"\n stroke-linejoin="round"\n />\n <path\n d="M5.55078 3.525V2.175C5.55078 1.80221 5.85299 1.5 6.22578 1.5H8.92578C9.29857 1.5 9.60078 1.80221 9.60078 2.175V3.525"\n stroke="#F05C42"\n />\n </svg>\n ']))))},AuthSelector=function(e){_inherits(n,e);var t=_createSuper$e(n);function n(e){var r;return _classCallCheck(this,n),_defineProperty(_assertThisInitialized(r=t.call(this,e)),"verifyAuth",(function(e,t){var n=r.props.stepId,o=r.props.stepMapping[n].authorizations[e];o&&(o.isVerified?r.props.onAuthSelected(o.authorizationId,!0,!!t):(r.props.toggleVerifyAuthorizationFlag({stepId:n,authId:o.authorizationId,isVerifying:!0}),r.setState({isLoading:!0}),r.props.apiHandler.verifyOAuth(o.authorizationId).then((function(e){e?r.props.onAuthSelected(o.authorizationId,!0,!!t):r.props.onAuthSelected(o.authorizationId,!1,!!t)})).catch((function(e){return console.error(e)})).finally((function(){r.props.toggleVerifyAuthorizationFlag({stepId:n,authId:o.authorizationId,isVerifying:!1}),r.setState({isLoading:!1})}))))})),_defineProperty(_assertThisInitialized(r),"deleteAuth",(function(e){var t=r.props.stepId,n=r.props.stepMapping[t].authorizations[e];r.props.toggleDeleteAuthorizationFlag({stepId:t,authId:n.authorizationId,isDeleting:!0,error:""}),r.props.apiHandler.deleteAuth(n.authorizationId).then((function(e){200===(null==e?void 0:e.status)?r.props.removeAuthorization({stepId:t,authId:n.authorizationId}):405===(null==e?void 0:e.status)?r.props.toggleDeleteAuthorizationFlag({stepId:t,authId:n.authorizationId,isDeleting:!1,error:"".concat(e.data)}):r.props.toggleDeleteAuthorizationFlag({stepId:t,authId:n.authorizationId,isDeleting:!1,error:"An unexpected error occurred"})})).catch((function(e){console.error(e)}))})),_defineProperty(_assertThisInitialized(r),"onAuthResponseReceived",(function(e){isAuthMessage(e)&&e.data.activity_name&&(console.info(e.data),r.props.stepId&&(e.data.already_exists?r.props.setStepAuthId({stepId:r.props.stepId,authId:Number(e.data.authorization_id)}):r.props.addAuthorization({stepId:r.props.stepId,authData:{authorizationId:e.data.authorization_id,userIdentity:e.data.user_identity,disableLink:"",authType:"",isVerified:!1,didFetchStatus:!1,isVerifying:!1,isDeleting:!1,error:""}})))})),_defineProperty(_assertThisInitialized(r),"getAuthStatus",(function(e){if(!e)return null;var t="IDLE";return e.isVerified&&e.didFetchStatus&&(t="CONNECTED"),!e.isVerified&&e.didFetchStatus&&(t="ERROR"),e.isVerifying&&(t="VERIFYING"),t})),_defineProperty(_assertThisInitialized(r),"getError",(function(){var e=r.props.stepId,t=r.props.stepMapping[e];return t.authorizations?"Please select a valid ".concat(t.step.activity.app.name," account"):"Please add a valid ".concat(t.step.activity.app.name," account")})),_defineProperty(_assertThisInitialized(r),"openAuthWindow",(function(){var e=r.props,t=e.stepMapping[e.stepId].step;t&&openPopupWindow(r.context.apiHandler.getAuthUrl(t.authorization_type.id),"Auth Window",window,800,600)})),r.state={isLoading:!1,fetched:!1},r}return _createClass(n,[{key:"componentDidMount",value:function(){isBrowser()&&window.addEventListener("message",this.onAuthResponseReceived);var e=this.props,t=e.stepId,n=e.stepMapping,r=n[t].selectedAuthId,o=n[t].authorizations.findIndex((function(e){return e.authorizationId===r}));n[t].selectedAuthId&&"IDLE"===this.getAuthStatus(n[t].authorizations[o])&&this.verifyAuth(o,!0)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.stepId,r=t.stepMapping,o=r[n],a=o.selectedAuthId,i=r[n].authorizations.findIndex((function(e){return e.authorizationId===a}));a!==e.stepMapping[n].selectedAuthId&&i&&this.verifyAuth(i),o.authorizations.length===e.stepMapping[n].authorizations.length+1&&this.verifyAuth(o.authorizations.length-1)}},{key:"componentWillUnmount",value:function(){isBrowser()&&window.removeEventListener("message",this.onAuthResponseReceived)}},{key:"render",value:function(){var e=this,t=this.props,n=t.stepId,r=t.showErrors,o=void 0!==r&&r,a=this.props.stepMapping[n],i=a.authorizations;return m$1(_templateObject9$4||(_templateObject9$4=_taggedTemplateLiteral(["\n <div class=",">\n <",'\n title="Connect account"\n description=',"\n isRequired=","\n />\n <div class=",">\n ","\n </div>\n <div class=",">\n <","\n onClick=","\n label=","\n type=","\n disabled=","\n >\n <//>\n </div>\n ","\n </div>\n "])),styles$l.authSelectorWrap,Label,"Select your ".concat(a.step.activity.app.name," account"),!0,styles$l.rows,i.map((function(t,n){return m$1(_templateObject10$4||(_templateObject10$4=_taggedTemplateLiteral(["<","\n label=","\n value=","\n status=","\n isChecked=","\n isDeleting=","\n error=","\n handleChange=","\n handleReverify=","\n handleDelete=","\n />"])),AuthorizationRow,t.userIdentity,t.authorizationId,e.getAuthStatus(t),t.authorizationId===a.selectedAuthId,t.isDeleting,t.error,(function(){return e.verifyAuth(n)}),(function(){return e.verifyAuth(n)}),(function(){return e.deleteAuth(n)}))})),o?"".concat(styles$l.error):"",Button,(function(){return e.openAuthWindow()}),"Add ".concat(a.step.activity.app.name," account"),ButtonTypes.SECONDARY,this.state.isLoading,o&&m$1(_templateObject11$4||(_templateObject11$4=_taggedTemplateLiteral(["<",">","<//>"])),ErrorMessage,this.getError()))}}]),n}(d$1);_defineProperty(AuthSelector,"contextType",AppContext);var AuthSelector$1=preact.connect(["stepMapping"],actionFunctions)(AuthSelector),purify=createCommonjsModule((function(e,t){e.exports=function(){function e(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var t=Object.hasOwnProperty,n=Object.setPrototypeOf,r=Object.isFrozen,o=Object.getPrototypeOf,a=Object.getOwnPropertyDescriptor,i=Object.freeze,l=Object.seal,s=Object.create,p="undefined"!=typeof Reflect&&Reflect,c=p.apply,d=p.construct;c||(c=function(e,t,n){return e.apply(t,n)}),i||(i=function(e){return e}),l||(l=function(e){return e}),d||(d=function(t,n){return new(Function.prototype.bind.apply(t,[null].concat(e(n))))});var u=w(Array.prototype.forEach),_=w(Array.prototype.pop),m=w(Array.prototype.push),f=w(String.prototype.toLowerCase),y=w(String.prototype.match),g=w(String.prototype.replace),h=w(String.prototype.indexOf),v=w(String.prototype.trim),b=w(RegExp.prototype.test),$=j(TypeError);function w(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return c(e,t,r)}}function j(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return d(e,n)}}function x(e,t){n&&n(e,null);for(var o=t.length;o--;){var a=t[o];if("string"==typeof a){var i=f(a);i!==a&&(r(t)||(t[o]=i),a=i)}e[a]=!0}return e}function O(e){var n=s(null),r=void 0;for(r in e)c(t,e,[r])&&(n[r]=e[r]);return n}function S(e,t){for(;null!==e;){var n=a(e,t);if(n){if(n.get)return w(n.get);if("function"==typeof n.value)return w(n.value)}e=o(e)}function r(e){return console.warn("fallback value for",e),null}return r}var I=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),T=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),k=i(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),L=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),P=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),M=i(["#text"]),R=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),A=i(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),D=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),N=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),E=l(/\{\{[\s\S]*|[\s\S]*\}\}/gm),z=l(/<%[\s\S]*|[\s\S]*%>/gm),F=l(/^data-[\-\w.\u00B7-\uFFFF]/),B=l(/^aria-[\-\w]+$/),H=l(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),W=l(/^(?:\w+script|data):/i),V=l(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),U="function"==typeof Symbol&&"symbol"===_typeof(Symbol.iterator)?function(e){return _typeof(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof(e)};function G(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var q=function(){return"undefined"==typeof window?null:window},K=function(e,t){if("object"!==(void 0===e?"undefined":U(e))||"function"!=typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(r)&&(n=t.currentScript.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function J(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:q(),t=function(e){return J(e)};if(t.version="2.3.1",t.removed=[],!e||!e.document||9!==e.document.nodeType)return t.isSupported=!1,t;var n=e.document,r=e.document,o=e.DocumentFragment,a=e.HTMLTemplateElement,l=e.Node,s=e.Element,p=e.NodeFilter,c=e.NamedNodeMap,d=void 0===c?e.NamedNodeMap||e.MozNamedAttrMap:c,w=e.Text,j=e.Comment,Z=e.DOMParser,Y=e.trustedTypes,Q=s.prototype,X=S(Q,"cloneNode"),ee=S(Q,"nextSibling"),te=S(Q,"childNodes"),ne=S(Q,"parentNode");if("function"==typeof a){var re=r.createElement("template");re.content&&re.content.ownerDocument&&(r=re.content.ownerDocument)}var oe=K(Y,n),ae=oe&&Ne?oe.createHTML(""):"",ie=r,le=ie.implementation,se=ie.createNodeIterator,pe=ie.createDocumentFragment,ce=ie.getElementsByTagName,de=n.importNode,ue={};try{ue=O(r).documentMode?r.documentMode:{}}catch(e){}var _e={};t.isSupported="function"==typeof ne&&le&&void 0!==le.createHTMLDocument&&9!==ue;var me=E,fe=z,ye=F,ge=B,he=W,ve=V,be=H,$e=null,we=x({},[].concat(G(I),G(C),G(T),G(L),G(M))),je=null,xe=x({},[].concat(G(R),G(A),G(D),G(N))),Oe=null,Se=null,Ie=!0,Ce=!0,Te=!1,ke=!1,Le=!1,Pe=!1,Me=!1,Re=!1,Ae=!1,De=!0,Ne=!1,Ee=!0,ze=!0,Fe=!1,Be={},He=null,We=x({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ve=null,Ue=x({},["audio","video","img","source","image","track"]),Ge=null,qe=x({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ke="http://www.w3.org/1998/Math/MathML",Je="http://www.w3.org/2000/svg",Ze="http://www.w3.org/1999/xhtml",Ye=Ze,Qe=!1,Xe=null,et=r.createElement("form"),tt=function(e){Xe&&Xe===e||(e&&"object"===(void 0===e?"undefined":U(e))||(e={}),e=O(e),$e="ALLOWED_TAGS"in e?x({},e.ALLOWED_TAGS):we,je="ALLOWED_ATTR"in e?x({},e.ALLOWED_ATTR):xe,Ge="ADD_URI_SAFE_ATTR"in e?x(O(qe),e.ADD_URI_SAFE_ATTR):qe,Ve="ADD_DATA_URI_TAGS"in e?x(O(Ue),e.ADD_DATA_URI_TAGS):Ue,He="FORBID_CONTENTS"in e?x({},e.FORBID_CONTENTS):We,Oe="FORBID_TAGS"in e?x({},e.FORBID_TAGS):{},Se="FORBID_ATTR"in e?x({},e.FORBID_ATTR):{},Be="USE_PROFILES"in e&&e.USE_PROFILES,Ie=!1!==e.ALLOW_ARIA_ATTR,Ce=!1!==e.ALLOW_DATA_ATTR,Te=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=e.SAFE_FOR_TEMPLATES||!1,Le=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,Ae=e.RETURN_DOM_FRAGMENT||!1,De=!1!==e.RETURN_DOM_IMPORT,Ne=e.RETURN_TRUSTED_TYPE||!1,Me=e.FORCE_BODY||!1,Ee=!1!==e.SANITIZE_DOM,ze=!1!==e.KEEP_CONTENT,Fe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||be,Ye=e.NAMESPACE||Ze,ke&&(Ce=!1),Ae&&(Re=!0),Be&&($e=x({},[].concat(G(M))),je=[],!0===Be.html&&(x($e,I),x(je,R)),!0===Be.svg&&(x($e,C),x(je,A),x(je,N)),!0===Be.svgFilters&&(x($e,T),x(je,A),x(je,N)),!0===Be.mathMl&&(x($e,L),x(je,D),x(je,N))),e.ADD_TAGS&&($e===we&&($e=O($e)),x($e,e.ADD_TAGS)),e.ADD_ATTR&&(je===xe&&(je=O(je)),x(je,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&x(Ge,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(He===We&&(He=O(He)),x(He,e.FORBID_CONTENTS)),ze&&($e["#text"]=!0),Le&&x($e,["html","head","body"]),$e.table&&(x($e,["tbody"]),delete Oe.tbody),i&&i(e),Xe=e)},nt=x({},["mi","mo","mn","ms","mtext"]),rt=x({},["foreignobject","desc","title","annotation-xml"]),ot=x({},C);x(ot,T),x(ot,k);var at=x({},L);x(at,P);var it=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:Ze,tagName:"template"});var n=f(e.tagName),r=f(t.tagName);if(e.namespaceURI===Je)return t.namespaceURI===Ze?"svg"===n:t.namespaceURI===Ke?"svg"===n&&("annotation-xml"===r||nt[r]):Boolean(ot[n]);if(e.namespaceURI===Ke)return t.namespaceURI===Ze?"math"===n:t.namespaceURI===Je?"math"===n&&rt[r]:Boolean(at[n]);if(e.namespaceURI===Ze){if(t.namespaceURI===Je&&!rt[r])return!1;if(t.namespaceURI===Ke&&!nt[r])return!1;var o=x({},["title","style","font","a","script"]);return!at[n]&&(o[n]||!ot[n])}return!1},lt=function(e){m(t.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ae}catch(t){e.remove()}}},st=function(e,n){try{m(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch(e){m(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),"is"===e&&!je[e])if(Re||Ae)try{lt(n)}catch(e){}else try{n.setAttribute(e,"")}catch(e){}},pt=function(e){var t=void 0,n=void 0;if(Me)e="<remove></remove>"+e;else{var o=y(e,/^[\r\n\t ]+/);n=o&&o[0]}var a=oe?oe.createHTML(e):e;if(Ye===Ze)try{t=(new Z).parseFromString(a,"text/html")}catch(e){}if(!t||!t.documentElement){t=le.createDocument(Ye,"template",null);try{t.documentElement.innerHTML=Qe?"":a}catch(e){}}var i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Ye===Ze?ce.call(t,Le?"html":"body")[0]:Le?t.documentElement:i},ct=function(e){return se.call(e.ownerDocument||e,e,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT,null,!1)},dt=function(e){return!(e instanceof w||e instanceof j||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof d&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},ut=function(e){return"object"===(void 0===l?"undefined":U(l))?e instanceof l:e&&"object"===(void 0===e?"undefined":U(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},_t=function(e,n,r){_e[e]&&u(_e[e],(function(e){e.call(t,n,r,Xe)}))},mt=function(e){var n=void 0;if(_t("beforeSanitizeElements",e,null),dt(e))return lt(e),!0;if(y(e.nodeName,/[\u0080-\uFFFF]/))return lt(e),!0;var r=f(e.nodeName);if(_t("uponSanitizeElement",e,{tagName:r,allowedTags:$e}),!ut(e.firstElementChild)&&(!ut(e.content)||!ut(e.content.firstElementChild))&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return lt(e),!0;if("select"===r&&b(/<template/i,e.innerHTML))return lt(e),!0;if(!$e[r]||Oe[r]){if(ze&&!He[r]){var o=ne(e)||e.parentNode,a=te(e)||e.childNodes;if(a&&o)for(var i=a.length-1;i>=0;--i)o.insertBefore(X(a[i],!0),ee(e))}return lt(e),!0}return e instanceof s&&!it(e)?(lt(e),!0):"noscript"!==r&&"noembed"!==r||!b(/<\/no(script|embed)/i,e.innerHTML)?(ke&&3===e.nodeType&&(n=e.textContent,n=g(n,me," "),n=g(n,fe," "),e.textContent!==n&&(m(t.removed,{element:e.cloneNode()}),e.textContent=n)),_t("afterSanitizeElements",e,null),!1):(lt(e),!0)},ft=function(e,t,n){if(Ee&&("id"===t||"name"===t)&&(n in r||n in et))return!1;if(Ce&&!Se[t]&&b(ye,t));else if(Ie&&b(ge,t));else{if(!je[t]||Se[t])return!1;if(Ge[t]);else if(b(be,g(n,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==h(n,"data:")||!Ve[e])if(Te&&!b(he,g(n,ve,"")));else if(n)return!1}return!0},yt=function(e){var n=void 0,r=void 0,o=void 0,a=void 0;_t("beforeSanitizeAttributes",e,null);var i=e.attributes;if(i){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:je};for(a=i.length;a--;){var s=n=i[a],p=s.name,c=s.namespaceURI;if(r=v(n.value),o=f(p),l.attrName=o,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,_t("uponSanitizeAttribute",e,l),r=l.attrValue,!l.forceKeepAttr&&(st(p,e),l.keepAttr))if(b(/\/>/i,r))st(p,e);else{ke&&(r=g(r,me," "),r=g(r,fe," "));var d=e.nodeName.toLowerCase();if(ft(d,o,r))try{c?e.setAttributeNS(c,p,r):e.setAttribute(p,r),_(t.removed)}catch(e){}}}_t("afterSanitizeAttributes",e,null)}},gt=function e(t){var n=void 0,r=ct(t);for(_t("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)_t("uponSanitizeShadowNode",n,null),mt(n)||(n.content instanceof o&&e(n.content),yt(n));_t("afterSanitizeShadowDOM",t,null)};return t.sanitize=function(r,a){var i=void 0,s=void 0,p=void 0,c=void 0,d=void 0;if((Qe=!r)&&(r="\x3c!--\x3e"),"string"!=typeof r&&!ut(r)){if("function"!=typeof r.toString)throw $("toString is not a function");if("string"!=typeof(r=r.toString()))throw $("dirty is not a string, aborting")}if(!t.isSupported){if("object"===U(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof r)return e.toStaticHTML(r);if(ut(r))return e.toStaticHTML(r.outerHTML)}return r}if(Pe||tt(a),t.removed=[],"string"==typeof r&&(Fe=!1),Fe);else if(r instanceof l)1===(s=(i=pt("\x3c!----\x3e")).ownerDocument.importNode(r,!0)).nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?i=s:i.appendChild(s);else{if(!Re&&!ke&&!Le&&-1===r.indexOf("<"))return oe&&Ne?oe.createHTML(r):r;if(!(i=pt(r)))return Re?null:ae}i&&Me&&lt(i.firstChild);for(var u=ct(Fe?r:i);p=u.nextNode();)3===p.nodeType&&p===c||mt(p)||(p.content instanceof o&&gt(p.content),yt(p),c=p);if(c=null,Fe)return r;if(Re){if(Ae)for(d=pe.call(i.ownerDocument);i.firstChild;)d.appendChild(i.firstChild);else d=i;return De&&(d=de.call(n,d,!0)),d}var _=Le?i.outerHTML:i.innerHTML;return ke&&(_=g(_,me," "),_=g(_,fe," ")),oe&&Ne?oe.createHTML(_):_},t.setConfig=function(e){tt(e),Pe=!0},t.clearConfig=function(){Xe=null,Pe=!1},t.isValidAttribute=function(e,t,n){Xe||tt({});var r=f(e),o=f(t);return ft(r,o,n)},t.addHook=function(e,t){"function"==typeof t&&(_e[e]=_e[e]||[],m(_e[e],t))},t.removeHook=function(e){_e[e]&&_(_e[e])},t.removeHooks=function(e){_e[e]&&(_e[e]=[])},t.removeAllHooks=function(){_e={}},t}return J()}()})),css_248z$n=".styles-module_listboxGroupWrapper__1Kt5M fieldset {\n margin: 0;\n padding: 0;\n border: none; }\n\n.styles-module_listbox__2x2uP {\n position: relative;\n max-width: 285px;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n padding-top: 10px; }\n .styles-module_listbox__2x2uP .styles-module_customSelect__3d-hM {\n position: relative;\n display: flex;\n flex-direction: column;\n font-size: 14px;\n letter-spacing: -0.197647px;\n color: #999999; }\n .styles-module_listbox__2x2uP .styles-module_customSelect__3d-hM.styles-module_open__2fBAx .styles-module_customOptions__3iNrM {\n opacity: 1;\n visibility: visible;\n pointer-events: auto; }\n .styles-module_listbox__2x2uP .styles-module_customSelectTrigger__2MlIG {\n position: relative;\n display: flex;\n align-items: center;\n box-sizing: border-box;\n height: 35px;\n padding: 0 10px;\n justify-content: space-between;\n cursor: pointer;\n font-size: 14px;\n border: 1px solid #e2e0db;\n border-radius: 4px; }\n .styles-module_listbox__2x2uP .styles-module_customSelectTrigger__2MlIG span {\n display: flex;\n align-items: center;\n height: 100%;\n padding-right: 10px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis; }\n .styles-module_listbox__2x2uP .styles-module_customSelectTrigger__2MlIG span.styles-module_selected__nLzUy {\n color: #333333; }\n .styles-module_listbox__2x2uP .styles-module_customSelectTrigger__2MlIG:focus {\n outline: none; }\n .styles-module_listbox__2x2uP .styles-module_customSelectTrigger__2MlIG.styles-module_error__2KcSW {\n border-color: #f05c42; }\n .styles-module_listbox__2x2uP .styles-module_customSelectTrigger__2MlIG .styles-module_arrow__TPQOZ {\n transform: rotate(0);\n transition-property: transform;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms; }\n .styles-module_listbox__2x2uP .styles-module_customSelectTrigger__2MlIG .styles-module_arrow__TPQOZ.styles-module_close__3wlz1 {\n transform: rotate(180deg); }\n .styles-module_listbox__2x2uP .styles-module_customOptions__3iNrM {\n position: absolute;\n top: 100%;\n left: 0px;\n right: 0px;\n z-index: 10;\n margin-top: 0.5rem;\n display: block;\n overflow: hidden;\n background-color: #fff;\n font-size: 0.875rem;\n line-height: 1.25rem;\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n pointer-events: none;\n visibility: hidden;\n max-height: 12rem;\n min-height: 100%;\n overflow: auto;\n border-width: 1px;\n border-style: solid;\n border-color: #e2e0db;\n opacity: 0;\n border-radius: 4px; }\n\n.styles-module_listboxItem__2jMpi {\n position: relative;\n display: block;\n cursor: pointer;\n border-width: 0px;\n border-bottom-width: 1px;\n border-style: solid;\n border-color: #e2e0db;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n padding-left: 2.5rem;\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n padding-right: 10px; }\n .styles-module_listboxItem__2jMpi svg {\n position: absolute;\n height: 100%;\n width: 12px;\n left: 16px;\n top: 0; }\n .styles-module_listboxItem__2jMpi:last-child {\n border: none; }\n .styles-module_listboxItem__2jMpi:hover {\n color: #333;\n background: #ececec; }\n .styles-module_listboxItem__2jMpi.styles-module_selected__nLzUy {\n color: #333;\n font-weight: 500; }\n",styles$k={listboxGroupWrapper:"styles-module_listboxGroupWrapper__1Kt5M",listbox:"styles-module_listbox__2x2uP",customSelect:"styles-module_customSelect__3d-hM",open:"styles-module_open__2fBAx",customOptions:"styles-module_customOptions__3iNrM",customSelectTrigger:"styles-module_customSelectTrigger__2MlIG",selected:"styles-module_selected__nLzUy",error:"styles-module_error__2KcSW",arrow:"styles-module_arrow__TPQOZ",close:"styles-module_close__3wlz1",listboxItem:"styles-module_listboxItem__2jMpi"},_templateObject$r,_templateObject2$m;styleInject(css_248z$n);var ListBoxItem=function(e){var t=e.id,n=e.value,r=e.isSelected,o=e.onClick;return m$1(_templateObject$r||(_templateObject$r=_taggedTemplateLiteral(["\n <span\n class=","\n data-value=","\n onclick=","\n >\n ","\n ","\n </span>\n "])),"".concat(styles$k.listboxItem," ").concat(r?styles$k.selected:""),t,o,r&&m$1(_templateObject2$m||(_templateObject2$m=_taggedTemplateLiteral(['\n <svg\n width="7"\n height="7"\n viewBox="0 0 7 7"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n stroke="#333"\n >\n <path\n d="M6.33333 1.5L2.83522 5.5L1 3.40148"\n stroke-width="1.2"\n stroke-linecap="round"\n />\n </svg>\n ']))),n)},_templateObject$q,_templateObject2$l,_templateObject3$h,_templateObject4$c,_templateObject5$b,_templateObject6$6,_templateObject7$5,_templateObject8$3,_templateObject9$3,_templateObject10$3,_templateObject11$3,_templateObject12$2,_templateObject13$2,ListBox=function(e){var t=e.title,n=e.description,r=e.items,o=void 0===r?[]:r,a=e.value,i=void 0===a?null:a,l=e.isOpen,s=void 0!==l&&l,c=e.isDynamic,u=void 0!==c&&c,_=e.endpointData,m=e.isRequired,f=void 0!==m&&m,g=e.placeholder,h=e.onChange,b=void 0===h?function(){return null}:h,$=e.showStepValidation,w=void 0!==$&&$,j=e.responseMapper,x=void 0===j?function(e){return e}:j,O=_slicedToArray(v(o),2),S=O[0],I=O[1],C=_slicedToArray(v(u&&!o.length&&!i),2),T=C[0],k=C[1],L=_slicedToArray(v(s),2),P=L[0],M=L[1],R=d();useOnClickOutside(R,(function(){return P&&M(!1)})),p((function(){var t=e.apiHandler,n=e.isDynamic,r=e.endpointUrl;if(n&&r){var o;k(!0);try{o=JSON.parse(_)}catch(e){o=""}t.callDynamicDataEndpoint(new URL(r),o).then((function(e){k(!1),e&&I(x(e))}))}}),[_]);var A=function(){M((function(e){return!e}))},D=y((function(){var e=S.findIndex((function(e){return e.id===i}));return e>-1?S[e].value:"Please Select..."}),[S,i]);return m$1(_templateObject$q||(_templateObject$q=_taggedTemplateLiteral(["\n <div ref=",' class="','">\n <fieldset>\n ',"\n <div class=",">\n <div\n class=","\n >\n <div\n class=",'\n role="button"\n tabindex=',"\n onclick=","\n onkeyup=","\n >\n <span class=",">\n ","\n </span>\n\n <div ref=",' style="display: flex;">\n ',"\n </div>\n </div>\n <div class=",">\n ","\n </div>\n </div>\n ","\n </div>\n </fieldset>\n </div>\n "])),R,styles$k.listboxGroupWrapper,t&&m$1(_templateObject2$l||(_templateObject2$l=_taggedTemplateLiteral(["\n <","\n title=","\n description=","\n isRequired=","\n />\n "])),Label,t,n,f),styles$k.listbox,"".concat(styles$k.customSelect," ").concat(P?styles$k.open:""),"".concat(styles$k.customSelectTrigger," ").concat(w&&!i&&f&&!P&&styles$k.error),0,A,(function(e){"Enter"===e.key&&A()}),i&&styles$k.selected,T?m$1(_templateObject3$h||(_templateObject3$h=_taggedTemplateLiteral(["Loading"]))):m$1(_templateObject4$c||(_templateObject4$c=_taggedTemplateLiteral(["\n ","\n "])),S.length>0?m$1(_templateObject5$b||(_templateObject5$b=_taggedTemplateLiteral(["\n ","\n "])),i?m$1(_templateObject6$6||(_templateObject6$6=_taggedTemplateLiteral(["",""])),D):m$1(_templateObject7$5||(_templateObject7$5=_taggedTemplateLiteral(["",""])),g||"Please Select...")):m$1(_templateObject8$3||(_templateObject8$3=_taggedTemplateLiteral(["No options"])))),R,T?m$1(_templateObject9$3||(_templateObject9$3=_taggedTemplateLiteral(["<",' color="#ababab"><//>'])),ThreeDotLoader):m$1(_templateObject10$3||(_templateObject10$3=_taggedTemplateLiteral(["\n <div\n class=",'\n >\n <svg\n width="12"\n height="8"\n viewBox="0 0 12 8"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M11 1.5L6 6.5L1 1.5"\n stroke="#999999"\n stroke-width="2"\n stroke-linecap="round"\n />\n </svg>\n </div>\n '])),"".concat(styles$k.arrow," ").concat(P?styles$k.close:"")),styles$k.customOptions,S.length>0&&!T&&m$1(_templateObject11$3||(_templateObject11$3=_taggedTemplateLiteral(["\n ","\n "])),S.map((function(e){return m$1(_templateObject12$2||(_templateObject12$2=_taggedTemplateLiteral(["\n <","\n key=","\n id=","\n value=","\n isSelected=","\n onClick=","\n ><//>\n "])),ListBoxItem,e.id,e.id,e.value,i===e.id,(function(){b(e.id),M(!1)}))}))),w&&!i&&!P&&f&&m$1(_templateObject13$2||(_templateObject13$2=_taggedTemplateLiteral([" <",">Please select an option</",">"])),ErrorMessage,ErrorMessage))},css_248z$m=".styles-module_checkboxGroup__2u-bL fieldset {\n border: none;\n padding: 0; }\n\n.styles-module_checkboxWrap__JzZMA {\n margin-bottom: 22px; }\n\n.styles-module_checkbox__3mvqm {\n position: relative;\n display: flex;\n margon-bottom: 2px;\n align-items: center;\n margin-top: 12px; }\n .styles-module_checkbox__3mvqm .styles-module_button__2oPQ0 {\n display: block;\n height: 20px;\n width: 20px;\n background-color: transparent; }\n .styles-module_checkbox__3mvqm input[type='checkbox'] {\n opacity: 0;\n margin: 0;\n display: none; }\n .styles-module_checkbox__3mvqm label {\n display: flex;\n flex: 1;\n cursor: pointer;\n font-size: 14px;\n color: #333333; }\n .styles-module_checkbox__3mvqm .styles-module_text__1AHNH {\n display: flex;\n color: #333;\n font-size: 14px;\n padding-left: 10px;\n font-weight: 400;\n line-height: 26px;\n margin-top: -2px; }\n .styles-module_checkbox__3mvqm .styles-module_description__3Ox13 {\n font-size: 12px;\n color: #222; }\n",styles$j={checkboxGroup:"styles-module_checkboxGroup__2u-bL",checkboxWrap:"styles-module_checkboxWrap__JzZMA",checkbox:"styles-module_checkbox__3mvqm",button:"styles-module_button__2oPQ0",text:"styles-module_text__1AHNH",description:"styles-module_description__3Ox13"},_templateObject$p,_templateObject2$k,_templateObject3$g,_templateObject4$b,_templateObject5$a,_templateObject6$5;styleInject(css_248z$m);var Checkbox=function(e){var t=e.label,n=e.name,r=e.description,o=void 0===r?null:r,a=e.value,i=e.isRequired,l=void 0!==i&&i,s=e.isChecked,p=void 0!==s&&s,c=e.showStepValidation,d=void 0!==c&&c,u=e.handleChange,_=void 0===u?function(){return null}:u;return m$1(_templateObject$p||(_templateObject$p=_taggedTemplateLiteral(["\n <div class=",">\n <div class=",">\n <label for=",">\n <input\n id=",'\n type="checkbox"\n name=',"\n value=","\n checked=","\n onclick=","\n />\n <div class=",">\n ","\n </div>\n <div>\n <div class=",">\n ","\n </div>\n ","\n </div>\n </label>\n </div>\n ","\n </div>\n "])),styles$j.checkboxWrap,styles$j.checkbox,n,n,n,a,p,(function(e){if(e.target instanceof HTMLInputElement){var t=e.target,n=t.id,r=t.checked;_(n,r)}}),styles$j.button,m$1(p?_templateObject2$k||(_templateObject2$k=_taggedTemplateLiteral(['\n <svg\n width="20"\n height="20"\n viewBox="0 0 20 20"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M7.86364 15.5L10 13.4923L17.5 6.49357L15.3485 4.5L7.86364 11.4987L4.63636 8.50129L2.5 10.4949L5.71212 13.4923L7.86364 15.5Z"\n fill="#5F4D86"\n />\n <path\n d="M0 0V-2H-2V0H0ZM20 0H22V-2H20V0ZM20 20V22H22V20H20ZM0 20H-2V22H0V20ZM0 2H20V-2H0V2ZM18 0V20H22V0H18ZM20 18H0V22H20V18ZM2 20V0H-2V20H2Z"\n fill="#5F4D86"\n />\n </svg>\n '])):_templateObject3$g||(_templateObject3$g=_taggedTemplateLiteral(['\n <svg\n width="20"\n height="20"\n viewBox="0 0 20 20"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M0 0V-2H-2V0H0ZM20 0H22V-2H20V0ZM20 20V22H22V20H20ZM0 20H-2V22H0V20ZM0 2H20V-2H0V2ZM18 0V20H22V0H18ZM20 18H0V22H20V18ZM2 20V0H-2V20H2Z"\n fill="#5F4D86"\n />\n </svg>\n ']))),styles$j.text,t.map((function(e){return m$1(_templateObject4$b||(_templateObject4$b=_taggedTemplateLiteral(["",""])),e.value)})),o&&m$1(_templateObject5$a||(_templateObject5$a=_taggedTemplateLiteral(["<div class=",">","</div>"])),styles$j.description,o),d&&!a&&l&&m$1(_templateObject6$5||(_templateObject6$5=_taggedTemplateLiteral([" <",">Please select an option</",">"])),ErrorMessage,ErrorMessage))},css_248z$l=".styles-module_loader__1RKKC {\n animation-name: styles-module_ckw__i9e23;\n animation-duration: 1s;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n transform-origin: 50% 50%; }\n\n@keyframes styles-module_ckw__i9e23 {\n 0% {\n transform: rotate(0deg); }\n 100% {\n transform: rotate(360deg); } }\n",styles$i={loader:"styles-module_loader__1RKKC",ckw:"styles-module_ckw__i9e23"},_templateObject$o;styleInject(css_248z$l);var LargeLoader=function(){return m$1(_templateObject$o||(_templateObject$o=_taggedTemplateLiteral(["\n <svg\n class=",'\n width="26"\n height="25"\n viewBox="0 0 26 25"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M15.7173 0.29892C13.1175 -0.280085 10.4006 -0.0135017 7.96294 1.0598C5.52524 2.13311 3.49412 3.95702 2.16568 6.26562C0.837246 8.57421 0.280965 11.2468 0.57794 13.8937C0.874915 16.5406 2.00962 19.0235 3.81662 20.9803C5.62362 22.9371 8.00843 24.2656 10.6234 24.772C13.2383 25.2784 15.9466 24.9363 18.3535 23.7956C20.7604 22.6548 22.74 20.7751 24.0036 18.4304C25.2673 16.0857 25.749 13.3987 25.3785 10.7611L24.1406 10.935C24.4741 13.3088 24.0406 15.7272 22.9033 17.8374C21.766 19.9476 19.9844 21.6393 17.8182 22.666C15.652 23.6927 13.2145 24.0006 10.861 23.5448C8.50758 23.089 6.36125 21.8934 4.73495 20.1323C3.10866 18.3711 2.08742 16.1366 1.82015 13.7543C1.55287 11.3721 2.05352 8.96679 3.24911 6.88905C4.44471 4.81132 6.27272 3.1698 8.46665 2.20382C10.6606 1.23785 13.1057 0.997923 15.4456 1.51903L15.7173 0.29892Z"\n fill="#EFEFEF"\n />\n <path\n d="M25.3833 10.7959C25.0346 8.26181 23.9168 5.8957 22.1808 4.01695C20.4449 2.13819 18.1743 0.83725 15.6756 0.289715L15.4081 1.51074C17.6569 2.00353 19.7004 3.17437 21.2628 4.86525C22.8251 6.55613 23.8311 8.68563 24.145 10.9663L25.3833 10.7959Z"\n fill="#C4C4C4"\n />\n </svg>\n'])),styles$i.loader)},css_248z$k=".styles-module_selectWrapper__wU7p8 {\n position: relative;\n width: 100%; }\n .styles-module_selectWrapper__wU7p8 fieldset {\n padding: 0;\n margin: 0;\n border: none; }\n .styles-module_selectWrapper__wU7p8 select {\n width: 100%;\n color: #999999;\n position: relative;\n font-size: 14px;\n -webkit-appearance: none;\n appearance: none;\n padding: 8.5px 14px;\n padding-right: 28px;\n border-radius: 4px;\n border: 1px solid #e2e0db;\n outline: none;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis; }\n .styles-module_selectWrapper__wU7p8 select:focus {\n outline: none; }\n .styles-module_selectWrapper__wU7p8 select.styles-module_selectedVal__11vC7 {\n color: #333; }\n .styles-module_selectWrapper__wU7p8 svg {\n position: absolute;\n right: 10px;\n top: 13px; }\n",styles$h={selectWrapper:"styles-module_selectWrapper__wU7p8",selectedVal:"styles-module_selectedVal__11vC7"},_templateObject$n,_templateObject2$j,_templateObject3$f,_templateObject4$a,_templateObject5$9;styleInject(css_248z$k);var Select=function(e){var t=e.placeholder,n=e.ariaLabel,r=e.value,o=e.options,a=void 0===o?[]:o,i=e.showUnselectedValue,l=void 0!==i&&i,s=e.unselectedText,p=void 0===s?"Select a value":s,c=e.isRequired,d=void 0!==c&&c,u=e.showStepValidation,_=void 0!==u&&u,m=e.onChange,f=void 0===m?function(){return null}:m;return m$1(_templateObject$n||(_templateObject$n=_taggedTemplateLiteral(["\n <div class=",">\n <select\n aria-label=","\n onchange=","\n class=","\n >\n ","\n ","\n ",'\n </select>\n <svg\n width="12"\n height="8"\n viewBox="0 0 12 8"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M11 1.5L6 6.5L1 1.5"\n stroke="#999999"\n stroke-width="2"\n stroke-linecap="round"\n />\n </svg>\n </div>\n ',"\n "])),styles$h.selectWrapper,n,(function(e){if(e.currentTarget instanceof HTMLSelectElement){var t=e.currentTarget.value,n=a.findIndex((function(e){return"".concat(e.key)==="".concat(t)}));f(n)}}),r&&styles$h.selectedVal,l&&m$1(_templateObject2$j||(_templateObject2$j=_taggedTemplateLiteral([' <option value="">',"</option> "])),p),void 0===r&&m$1(_templateObject3$f||(_templateObject3$f=_taggedTemplateLiteral(['\n <option value="" disabled selected hidden>',"</option>\n "])),t),a.map((function(e){return m$1(_templateObject4$a||(_templateObject4$a=_taggedTemplateLiteral(["\n <option value="," selected=",">\n ","\n </option>\n "])),e.key,r===e.key,e.label)})),d&&!r&&_&&m$1(_templateObject5$9||(_templateObject5$9=_taggedTemplateLiteral(["<",">Please map this required field<//>"])),ErrorMessage))},css_248z$j=".styles-module_mappingWrap__cU3_M .styles-module_mappingInfo__2Nvsw {\n margin-top: 20px;\n display: flex;\n justify-content: flex-end;\n font-size: 10px;\n line-height: 12px;\n display: flex;\n align-items: center;\n letter-spacing: 0.1px;\n color: #999999; }\n .styles-module_mappingWrap__cU3_M .styles-module_mappingInfo__2Nvsw > :not(:last-child) {\n margin-right: 20px; }\n .styles-module_mappingWrap__cU3_M .styles-module_mappingInfo__2Nvsw > div {\n margin-right: 7px; }\n .styles-module_mappingWrap__cU3_M .styles-module_mappingInfo__2Nvsw > div > span:first-child {\n color: #333333;\n margin: 0;\n margin-right: 3px; }\n\n.styles-module_mappingWrap__cU3_M .styles-module_mappingRow__LbAkF:first-child {\n padding-top: 0;\n padding-bottom: 5px;\n height: 60px;\n font-style: normal;\n font-weight: normal;\n font-size: 14px;\n letter-spacing: 0.1px;\n color: #333333; }\n\n.styles-module_loader__3uPJj {\n margin-top: 35px;\n margin-bottom: -60px;\n display: flex;\n justify-content: center; }\n\n.styles-module_mappingRow__LbAkF {\n display: flex;\n box-sizing: content-box;\n align-items: center;\n justify-content: space-between;\n background-color: #fff;\n padding-left: 10px;\n padding-right: 10px;\n height: 90px; }\n .styles-module_mappingRow__LbAkF .styles-module_title__3EC37 {\n width: 40%;\n padding-right: 4px;\n font-weight: 500;\n font-size: 14px;\n color: #333333;\n padding-right: 10px;\n line-height: 18px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis; }\n .styles-module_mappingRow__LbAkF .styles-module_title__3EC37 span {\n color: red;\n font-size: 16px;\n margin-left: 2px; }\n .styles-module_mappingRow__LbAkF .styles-module_sampleData__ZpCR2 {\n display: flex;\n flex-direction: column;\n width: 40%;\n overflow: hidden;\n word-break: break-word;\n padding-right: 20px; }\n .styles-module_mappingRow__LbAkF .styles-module_selectBox__2gn7w {\n width: 40%;\n font-size: 14px; }\n .styles-module_mappingRow__LbAkF:nth-child(even) {\n background: #f8f8f880; }\n .styles-module_mappingRow__LbAkF:first-child {\n color: #333333; }\n .styles-module_mappingRow__LbAkF .styles-module_mappingHeaderItem__3Ue0A {\n display: flex;\n align-items: center;\n width: 40%; }\n .styles-module_mappingRow__LbAkF .styles-module_mappingHeaderItem__3Ue0A:first-child {\n padding-right: 4px; }\n .styles-module_mappingRow__LbAkF .styles-module_mappingHeaderItem__3Ue0A img {\n height: 25px;\n width: 25px;\n padding: 2px;\n object-fit: contain;\n border-radius: 9999px;\n margin-right: 5px; }\n .styles-module_mappingRow__LbAkF pre {\n margin: 0;\n padding: 0;\n color: #7d7d7d;\n height: 20px;\n font-size: 14px;\n line-height: 20px;\n overflow: hidden;\n text-overflow: ellipsis; }\n",styles$g={mappingWrap:"styles-module_mappingWrap__cU3_M",mappingInfo:"styles-module_mappingInfo__2Nvsw",mappingRow:"styles-module_mappingRow__LbAkF",loader:"styles-module_loader__3uPJj",title:"styles-module_title__3EC37",sampleData:"styles-module_sampleData__ZpCR2",selectBox:"styles-module_selectBox__2gn7w",mappingHeaderItem:"styles-module_mappingHeaderItem__3Ue0A"},_templateObject$m,_templateObject2$i,_templateObject3$e,_templateObject4$9,_templateObject5$8,_templateObject6$4,_templateObject7$4;function ownKeys$3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread$3(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$3(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$3(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}styleInject(css_248z$j);var MappingUI=function(e){var t,n,r=_slicedToArray(v(!0),2),o=r[0],a=r[1],i=_slicedToArray(v(!1),2),l=i[0],s=i[1],c=_slicedToArray(v(!1),2),u=c[0],_=c[1],m=_slicedToArray(v([]),2),f=m[0],y=m[1],g=_slicedToArray(v(""),2),h=g[0],b=g[1],$=w(AppContext),j=d(""),x=d([]);p((function(){f.length>0&&f.map((function(t,n){var r=e.stepDataMapping[e.stepId][t.fieldId];if(!r.isDynamic&&r.value)r.value.slice(1,-1)&&(x.current=[].concat(_toConsumableArray(x.current),[n]));else if(r.isDynamic&&r.value&&t.id){JSON.parse(r.value||"{}")[t.id]&&(x.current=[].concat(_toConsumableArray(x.current),[n]))}}))}),[f]),p((function(){var t=e.templateFields.filter((function(e){return e.activity_field&&"DYNAMIC"===e.activity_field.type}))[0];t&&b("".concat(t.id));var n=e.templateFields.filter((function(e){return e.activity_field&&"TEXTFIELD"===e.activity_field.type&&e.is_visible})).map((function(e){return{fieldId:e.id,id:e.activity_field&&e.activity_field.machine_name,title:e.activity_field&&e.activity_field.title,type:"text",isNotDynamic:!0}}));if(t.activity_field){var r,o=e.parentChildMapping[e.stepId][t.activity_field.machine_name],i="";if(o){var l,p=null===(l=o.parentFields)||void 0===l?void 0:l.reduce((function(t,n){var r=e.parentChildMapping[e.stepId][n].fieldId;return _objectSpread$3(_objectSpread$3({},t),{},_defineProperty({},r,e.stepDataMapping[e.stepId][r].value))}),{});i=JSON.stringify(p)}if(i!==j.current)a(!0),s(!0),_(!0),S(),null===(r=I(t))||void 0===r||r.then((function(e){a(!1),x.current=[],j.current=i,Array.isArray(e)?y([].concat(_toConsumableArray(n),_toConsumableArray(e.map((function(e){return _objectSpread$3(_objectSpread$3({},e),{},{fieldId:t.id})}))))):y(n)})).catch((function(e){return console.error(e)}))}}),[e.stepDataMapping[e.stepId]]);var O=function(t){var n=e.stepDataMapping[t];return Object.keys(n).filter((function(e){return n[Number(e)].value})).reduce((function(e,t){var r=n[Number(t)];return _objectSpread$3(_objectSpread$3({},e),{},_defineProperty({},r.machineName,r.value))}),{})},S=function(){var t=_asyncToGenerator(_regeneratorRuntime.mark((function t(){var n,r,o;return _regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.stepState.steps[0].stepId,r=O(n),n&&("TRIGGER"!==(o=e.stepMapping[n].step).activity.type&&"QUERY"!==o.activity.type||(o.activity.activity_output_url?(s(!0),null==$||$.apiHandler.callDynamicDataEndpoint(new URL(o.activity.activity_output_url),_objectSpread$3({authorization_id:"".concat(e.stepMapping[n].selectedAuthId)},r)).then((function(t){s(!1),t&&e.setActivityOutputData({activityOutputData:t})}))):s(!1),o.activity.dynamic_field_data_endpoint?(_(!0),null==$||$.apiHandler.callDynamicDataEndpoint(new URL(o.activity.dynamic_field_data_endpoint),_objectSpread$3({authorization_id:"".concat(e.stepMapping[n].selectedAuthId)},r)).then((function(t){_(!1),t&&e.setDynamicFieldData({dynamicFieldData:t})}))):_(!1)));case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),I=function(t){var n,r="".concat(null===(n=t.activity_field)||void 0===n?void 0:n.dynamic_field_src);return null==$?void 0:$.apiHandler.callDynamicDataEndpoint(new URL(r),_objectSpread$3({authorization_id:"".concat(e.endpointData.authId)},e.endpointData.fieldsData))};return m$1(_templateObject$m||(_templateObject$m=_taggedTemplateLiteral(["\n <div>\n <",'\n title="Map data"\n description="Please map fields you want to use from both apps"\n />\n <div>\n ',"\n </div>\n </div>\n "])),Label,o||l||u?m$1(_templateObject2$i||(_templateObject2$i=_taggedTemplateLiteral(["<div class=","><"," /></div>"])),styles$g.loader,LargeLoader):m$1(_templateObject3$e||(_templateObject3$e=_taggedTemplateLiteral(["\n <div class=",">\n <div class=",">\n <div class=",">\n <img\n src=","\n />\n <div>\n ","\n </div>\n </div>\n <div class=",">Sample Data</div>\n <div class=",">\n <img src="," />\n <div>"," Field</div>\n </div>\n </div>\n ","\n <div class=",">\n <div>\n <span>Mapped</span>\n <span\n >","","\n field","</span\n >\n </div>\n <div>\n <span>Ignored</span>\n <span\n >","","\n field","</span\n >\n </div>\n </div>\n </div>\n "])),styles$g.mappingWrap,styles$g.mappingRow,styles$g.mappingHeaderItem,e.stepMapping[e.stepId].step.activity.app.icon_url,"".concat(e.stepMapping[e.stepId].step.activity.app.name," Field"),styles$g.sampleData,styles$g.mappingHeaderItem,null===(t=e.genericData.templateApp)||void 0===t?void 0:t.iconUrl,null===(n=e.genericData.templateApp)||void 0===n?void 0:n.name,f.map((function(t,n){var r,o,a,i,l,s=t.id||"",p=e.stepDataMapping[e.stepId][t.fieldId];p.isDynamic?i=p.objectValue:i=null===(l=p.value)||void 0===l?void 0:l.slice(1,-1);return!p.isDynamic&&i?a=i:t.id&&p.isDynamic&&p.objectValue&&i[s]&&(a="".concat(i[s]).slice(1,-1)),m$1(_templateObject4$9||(_templateObject4$9=_taggedTemplateLiteral(["\n <div class=",">\n <div class=",">\n ","","\n </div>\n <div class=",">\n ","\n </div>\n <div class=",">\n <",'\n ariaLabel="Map a value"\n placeholder="Please map a value"\n options=',"\n value=","\n isRequired=","\n showStepValidation=","\n showUnselectedValue=",'\n unselectedText="Skip"\n onChange=',"\n ><//>\n </div>\n </div>\n "])),styles$g.mappingRow,styles$g.title,t.title,(null==p?void 0:p.isRequired)&&m$1(_templateObject5$8||(_templateObject5$8=_taggedTemplateLiteral(["<span>*</span>"]))),styles$g.sampleData,e.dynamicFieldData&&a&&(null===(r=e.dynamicFieldData["{".concat(a,"}")])||void 0===r?void 0:r.map((function(e){return e?m$1(_templateObject6$4||(_templateObject6$4=_taggedTemplateLiteral(["<pre>","</pre>"])),e):m$1(_templateObject7$4||(_templateObject7$4=_taggedTemplateLiteral([""])))}))),styles$g.selectBox,Select,null===(o=e.activityOutputData)||void 0===o?void 0:o.map((function(e){return{key:e.value,label:e.text}})),a,null==p?void 0:p.isRequired,e.showStepValidation,!0,(function(r){var o;return function(t,n,r,o){var a,i=null===(a=e.activityOutputData)||void 0===a?void 0:a[t],l=x.current.findIndex((function(e){return e===o}));t<0?(x.current=x.current.filter((function(e){return e!==o})),n.isNotDynamic?e.setStepFieldData({stepId:"".concat(e.stepId),fieldId:"".concat(n.fieldId),value:"",isRequired:r}):h&&e.setStepMappingData({stepId:e.stepId,fieldId:Number(h),id:"".concat(n.id),value:null})):i&&(l<0&&(x.current=[].concat(_toConsumableArray(x.current),[o])),n.isNotDynamic?e.setStepFieldData({stepId:"".concat(e.stepId),fieldId:"".concat(n.fieldId),value:"{".concat(i.value,"}"),isRequired:r}):h&&e.setStepMappingData({stepId:e.stepId,fieldId:Number(h),id:"".concat(n.id),value:"{".concat(i.value,"}")}))}(r,t,null!==(o=null==p?void 0:p.isRequired)&&void 0!==o&&o,n)}))})),styles$g.mappingInfo,x.current.length," ",1!==x.current.length?"s":"",f.length-x.current.length," ",f.length-x.current.length!=1?"s":""))},MappingUI$1=preact.connect(["stepState","genericData","stepMapping","activityOutputData","dynamicFieldData","stepDataMapping","parentChildMapping"],actionFunctions)(MappingUI),css_248z$i=".styles-module_inputWrapper__1XBHY {\n position: relative;\n width: 100%;\n margin-top: 10px; }\n .styles-module_inputWrapper__1XBHY input {\n width: 100%;\n color: #333;\n display: block;\n box-sizing: border-box;\n -webkit-appearance: none;\n appearance: none;\n padding: 8.5px 14px;\n border-radius: 4px;\n border: 1px solid #e2e0db;\n font-size: 14px;\n outline: none; }\n .styles-module_inputWrapper__1XBHY input:focus {\n outline: none; }\n .styles-module_inputWrapper__1XBHY input:-ms-input-placeholder {\n color: #999999; }\n .styles-module_inputWrapper__1XBHY input::placeholder {\n color: #999999; }\n",styles$f={inputWrapper:"styles-module_inputWrapper__1XBHY"},_templateObject$l,_templateObject2$h;styleInject(css_248z$i);var BaseInput=function(e){var t=e.placeholder,n=e.value,r=e.type,o=void 0===r?"text":r,a=e.control,i=e.handleChange,l=void 0===i?function(){return null}:i;return m$1(_templateObject$l||(_templateObject$l=_taggedTemplateLiteral(["\n <div class=",">\n <input\n type=","\n placeholder=","\n value=","\n onkeyup=","\n onchange=","\n />\n ","\n </div>\n "])),styles$f.inputWrapper,o,t,n,(function(e){if(e.currentTarget instanceof HTMLInputElement){var t=e.currentTarget.value;l(t)}}),(function(e){if(e.currentTarget instanceof HTMLInputElement&&"date"===e.currentTarget.type){var t=e.currentTarget.value;l(t)}}),a&&m$1(_templateObject2$h||(_templateObject2$h=_taggedTemplateLiteral(["<"," //>"])),a))},css_248z$h=".styles-module_inputGroupWrapper__FJc-g fieldset {\n padding: 0;\n margin: 0;\n border: none; }\n",styles$e={inputGroupWrapper:"styles-module_inputGroupWrapper__FJc-g"},_templateObject$k,_templateObject2$g;styleInject(css_248z$h);var Input=function(e){var t=e.title,n=e.description,r=e.placeholder,o=e.value,a=e.showStepValidation,i=void 0!==a&&a,l=e.isRequired,s=void 0!==l&&l,p=e.onChange,c=void 0===p?function(){return null}:p;return m$1(_templateObject$k||(_templateObject$k=_taggedTemplateLiteral(['\n <div class="','">\n <fieldset>\n <'," title="," description="," //>\n <",'\n type="text"\n placeholder=',"\n handleChange=","\n value=","\n ><//>\n </fieldset>\n ","\n </div>\n "])),styles$e.inputGroupWrapper,Label,t,n,BaseInput,r,(function(e){c(e)}),o,i&&s&&m$1(_templateObject2$g||(_templateObject2$g=_taggedTemplateLiteral(["",">Please enter a value<//>"])),ErrorMessage))},css_248z$g=".styles-module_dateGroupWrapper__cV-ne fieldset {\n border: none;\n padding: 0;\n margin: 0; }\n\n.styles-module_dateGroupWrapper__cV-ne input[type='date'] {\n position: relative;\n cursor: pointer; }\n\n.styles-module_dateGroupWrapper__cV-ne input[type='date']::-webkit-calendar-picker-indicator {\n position: absolute;\n top: 0;\n right: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n color: transparent;\n background: transparent; }\n\n.styles-module_dateGroupWrapper__cV-ne .styles-module_visibilityToggle__1l7Vl {\n display: flex;\n align-items: center;\n position: absolute;\n top: 0;\n right: 10px;\n bottom: 0;\n margin: 0 auto; }\n .styles-module_dateGroupWrapper__cV-ne .styles-module_visibilityToggle__1l7Vl svg {\n cursor: pointer;\n width: 20px; }\n .styles-module_dateGroupWrapper__cV-ne .styles-module_visibilityToggle__1l7Vl svg:hover {\n opacity: 0.5; }\n",styles$d={dateGroupWrapper:"styles-module_dateGroupWrapper__cV-ne",visibilityToggle:"styles-module_visibilityToggle__1l7Vl"},_templateObject$j,_templateObject2$f,_templateObject3$d,_templateObject4$8,_templateObject5$7;styleInject(css_248z$g);var DateInput=function(e){var t=e.title,n=e.description,r=e.placeholder,o=e.value,a=e.showStepValidation,i=void 0!==a&&a,l=e.isRequired,s=void 0!==l&&l,p=e.onChange,c=void 0===p?function(){return null}:p;return m$1(_templateObject$j||(_templateObject$j=_taggedTemplateLiteral(['\n <div class="','">\n <fieldset>\n <'," title="," description="," //>\n <",'\n type="date"\n placeholder=',"\n handleChange=","\n value=","\n control=","\n ><//>\n </fieldset>\n ","\n </div>\n "])),styles$d.dateGroupWrapper,Label,t,n,BaseInput,r,c,o,(function(){return m$1(_templateObject2$f||(_templateObject2$f=_taggedTemplateLiteral([' <div\n role="button"\n class=',"\n onclick=","\n >\n ","\n </div>"])),styles$d.visibilityToggle,(function(){o&&c("")}),m$1(o?_templateObject4$8||(_templateObject4$8=_taggedTemplateLiteral(['\n <svg\n width="18"\n height="18"\n viewBox="0 0 18 18"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M9 0C13.9673 0 18 4.03275 18 9C18 13.9673 13.9673 18 9 18C4.03275 18 0 13.9673 0 9C0 4.03275 4.03275 0 9 0ZM9 0.75C13.5533 0.75 17.25 4.44675 17.25 9C17.25 13.5533 13.5533 17.25 9 17.25C4.44675 17.25 0.75 13.5533 0.75 9C0.75 4.44675 4.44675 0.75 9 0.75ZM9 8.46975L12.9697 4.5L13.5 5.03025L9.53025 9L13.5 12.9697L12.9697 13.5L9 9.53025L5.03025 13.5L4.5 12.9697L8.46975 9L4.5 5.03025L5.03025 4.5L9 8.46975Z"\n fill="black"\n />\n </svg>\n '])):_templateObject3$d||(_templateObject3$d=_taggedTemplateLiteral(['\n <svg\n width="25"\n height="26"\n viewBox="0 0 25 26"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M16.9543 5.5464H19.335L19.3349 5.54639C20.6491 5.54639 21.7156 6.61204 21.7156 7.92812L21.7147 19.8323C21.7147 21.1466 20.6482 22.2131 19.334 22.2131H5.04866C3.73449 22.2131 2.66797 21.1466 2.66797 19.8323V7.92719C2.66797 6.61296 3.73444 5.54639 5.04866 5.54639L7.42936 5.5473V4.35641C7.42936 3.69791 7.96262 3.16553 8.62019 3.16553C9.27777 3.16553 9.81102 3.69791 9.81102 4.35641V5.5464L14.5717 5.5473V4.35641C14.5717 3.69791 15.105 3.16553 15.7626 3.16553C16.4201 3.16553 16.9534 3.69791 16.9534 4.35641L16.9543 5.5464ZM4.04688 20.8324H20.3369L20.3358 8.7124H4.04688V20.8324Z"\n fill="#999999"\n />\n </svg>\n ']))))}),i&&s&&m$1(_templateObject5$7||(_templateObject5$7=_taggedTemplateLiteral(["",">Please enter a date<//>"])),ErrorMessage))},css_248z$f=".styles-module_passwordInputWrapper__1rzRX fieldset {\n padding: 0;\n margin: 0;\n border: none; }\n\n.styles-module_passwordInputWrapper__1rzRX .styles-module_innerWrap__2CRI3 {\n position: relative; }\n\n.styles-module_passwordInputWrapper__1rzRX input {\n padding-right: 36px; }\n\n.styles-module_visibilityToggle__3_Kyp {\n display: flex;\n align-items: center;\n position: absolute;\n top: 0;\n right: 10px;\n bottom: 0;\n margin: 0 auto; }\n .styles-module_visibilityToggle__3_Kyp svg {\n cursor: pointer;\n width: 20px; }\n .styles-module_visibilityToggle__3_Kyp svg:hover {\n opacity: 0.5; }\n",styles$c={passwordInputWrapper:"styles-module_passwordInputWrapper__1rzRX",innerWrap:"styles-module_innerWrap__2CRI3",visibilityToggle:"styles-module_visibilityToggle__3_Kyp"},_templateObject$i,_templateObject2$e,_templateObject3$c,_templateObject4$7,_templateObject5$6;styleInject(css_248z$f);var PasswordInput=function(e){var t=e.title,n=e.description,r=e.placeholder,o=e.value,a=e.showStepValidation,i=void 0!==a&&a,l=e.isRequired,s=void 0!==l&&l,p=e.onChange,c=void 0===p?function(){return null}:p,d=_slicedToArray(v(!1),2),u=d[0],_=d[1],m=function(){_((function(e){return!e}))};return m$1(_templateObject$i||(_templateObject$i=_taggedTemplateLiteral(['\n <div class="','">\n <fieldset>\n <'," title="," description="," //>\n <","\n type=","\n placeholder=","\n handleChange=","\n value=","\n control=","\n ><//>\n ","\n </fieldset>\n </div>\n "])),styles$c.passwordInputWrapper,Label,t,n,BaseInput,u?"text":"password",r,c,o,(function(){return m$1(_templateObject2$e||(_templateObject2$e=_taggedTemplateLiteral(["\n <div\n class=","\n onclick=","\n >\n ","\n </div>\n "])),styles$c.visibilityToggle,m,m$1(u?_templateObject4$7||(_templateObject4$7=_taggedTemplateLiteral([' <svg\n width="20"\n height="12"\n viewBox="0 0 20 12"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M0.183387 6.51359C0.35582 6.72918 4.47535 11.6704 9.71968 11.6704V11.6704C14.964 11.6704 19.0836 6.72924 19.256 6.51357C19.5005 6.21515 19.5005 5.78535 19.256 5.48691V5.48615C19.0835 5.27523 14.964 0.330078 9.71968 0.330078C4.47535 0.330078 0.355766 5.27507 0.183387 5.48693C-0.0611291 5.78535 -0.0611291 6.21515 0.183387 6.51359ZM9.71968 10.0499C6.1643 10.0499 3.04855 7.1924 1.90266 6.00018C3.04632 4.80579 6.1643 1.95044 9.71968 1.95044C13.2751 1.95044 16.3908 4.80797 17.5367 6.00018C16.393 7.19458 13.2751 10.0499 9.71968 10.0499Z"\n fill="#333333"\n />\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.94922 8.29099C7.55668 8.89849 8.3806 9.24021 9.24022 9.24021C10.0998 9.24021 10.9237 8.89845 11.5312 8.29099C12.1387 7.68353 12.4804 6.85956 12.4804 5.99999C12.4804 5.14041 12.1387 4.31648 11.5312 3.70898C10.9238 3.10148 10.0998 2.75977 9.24022 2.75977C8.38064 2.75977 7.55672 3.10152 6.94922 3.70898C6.34172 4.31644 6 5.14041 6 5.99999C6 6.85956 6.34176 7.68349 6.94922 8.29099ZM7.7435 5.3803C7.99408 4.77431 8.58488 4.38021 9.24022 4.38021C9.67002 4.38021 10.0816 4.55031 10.3854 4.85481C10.6899 5.15856 10.86 5.57015 10.86 5.99995C10.86 6.65529 10.4659 7.24607 9.85987 7.49667C9.25464 7.74727 8.5583 7.60905 8.09509 7.14508C7.63111 6.68186 7.49289 5.98552 7.7435 5.3803Z"\n fill="#333333"\n />\n </svg>'])):_templateObject3$c||(_templateObject3$c=_taggedTemplateLiteral([' <svg\n width="20"\n height="12"\n viewBox="0 0 20 12"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M0.183387 6.51359C0.35582 6.72918 4.47535 11.6704 9.71968 11.6704V11.6704C14.964 11.6704 19.0836 6.72924 19.256 6.51357C19.5005 6.21515 19.5005 5.78535 19.256 5.48691V5.48615C19.0835 5.27523 14.964 0.330078 9.71968 0.330078C4.47535 0.330078 0.355766 5.27507 0.183387 5.48693C-0.0611291 5.78535 -0.0611291 6.21515 0.183387 6.51359ZM9.71968 10.0499C6.1643 10.0499 3.04855 7.1924 1.90266 6.00018C3.04632 4.80579 6.1643 1.95044 9.71968 1.95044C13.2751 1.95044 16.3908 4.80797 17.5367 6.00018C16.393 7.19458 13.2751 10.0499 9.71968 10.0499Z"\n fill="#999999"\n />\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.94922 8.29099C7.55668 8.89849 8.3806 9.24021 9.24022 9.24021C10.0998 9.24021 10.9237 8.89845 11.5312 8.29099C12.1387 7.68353 12.4804 6.85956 12.4804 5.99999C12.4804 5.14041 12.1387 4.31648 11.5312 3.70898C10.9238 3.10148 10.0998 2.75977 9.24022 2.75977C8.38064 2.75977 7.55672 3.10152 6.94922 3.70898C6.34172 4.31644 6 5.14041 6 5.99999C6 6.85956 6.34176 7.68349 6.94922 8.29099ZM7.7435 5.3803C7.99408 4.77431 8.58488 4.38021 9.24022 4.38021C9.67002 4.38021 10.0816 4.55031 10.3854 4.85481C10.6899 5.15856 10.86 5.57015 10.86 5.99995C10.86 6.65529 10.4659 7.24607 9.85987 7.49667C9.25464 7.74727 8.5583 7.60905 8.09509 7.14508C7.63111 6.68186 7.49289 5.98552 7.7435 5.3803Z"\n fill="#999999"\n />\n </svg>']))))}),i&&s&&m$1(_templateObject5$6||(_templateObject5$6=_taggedTemplateLiteral(["",">Please enter a value<//>"])),ErrorMessage))},copyStringToClipboard=function(e){if(navigator.clipboard)navigator.clipboard.writeText(e).catch((function(){console.error("Could not copy to clipboard")}));else{var t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}},css_248z$e=".styles-module_textareaInputWrapper__mJffr {\n position: relative; }\n .styles-module_textareaInputWrapper__mJffr fieldset {\n padding: 0;\n margin: 0;\n border: none; }\n .styles-module_textareaInputWrapper__mJffr textarea {\n margin-top: 10px;\n font-family: inherit;\n box-sizing: border-box;\n display: block;\n height: 6rem;\n width: 100%;\n resize: none;\n color: #333;\n -webkit-appearance: none;\n appearance: none;\n border-radius: 0.25rem;\n border-width: 1px;\n border-style: solid;\n border: 1px solid #e2e0db;\n padding: 8.5px 14px; }\n .styles-module_textareaInputWrapper__mJffr textarea:focus {\n outline: none; }\n .styles-module_textareaInputWrapper__mJffr textarea:-ms-input-placeholder {\n color: #999; }\n .styles-module_textareaInputWrapper__mJffr textarea::placeholder {\n color: #999; }\n .styles-module_textareaInputWrapper__mJffr .styles-module_copyButton__1D43d {\n position: absolute;\n cursor: pointer;\n right: 0px;\n top: 16px;\n padding: 8px; }\n .styles-module_textareaInputWrapper__mJffr .styles-module_copyButton__1D43d:hover {\n opacity: 0.75; }\n",styles$b={textareaInputWrapper:"styles-module_textareaInputWrapper__mJffr",copyButton:"styles-module_copyButton__1D43d"},_templateObject$h,_templateObject2$d,_templateObject3$b;styleInject(css_248z$e);var TextArea=function(e){var t=e.title,n=e.description,r=e.value,o=e.placeholder,a=e.onChange,i=void 0===a?function(){return null}:a,l=e.showStepValidation,s=void 0!==l&&l,p=e.showCopyButton,c=void 0!==p&&p,d=e.isRequired,u=void 0!==d&&d;return m$1(_templateObject$h||(_templateObject$h=_taggedTemplateLiteral(['\n <div class="','">\n <fieldset>\n <'," title="," description="," //>\n <textarea\n placeholder=","\n value=","\n oninput=","\n />\n ","\n </fieldset>\n ","\n </div>\n "])),styles$b.textareaInputWrapper,Label,t,n,o,r,(function(e){if(e.currentTarget instanceof HTMLTextAreaElement){var t=e.currentTarget.value;i(t)}}),c&&m$1(_templateObject2$d||(_templateObject2$d=_taggedTemplateLiteral(["\n <div onclick="," class=",'>\n <svg\n width="12"\n height="15"\n viewBox="0 0 12 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <rect\n x="0.75"\n y="1"\n width="7.5"\n height="9.5"\n rx="0.75"\n stroke="#999999"\n stroke-width="1.5"\n />\n <rect\n x="3.75"\n y="4.5"\n width="7.5"\n height="9.5"\n rx="0.75"\n fill="#E4E4E4"\n stroke="#999999"\n stroke-width="1.5"\n />\n </svg>\n </div>\n '])),(function(){copyStringToClipboard(r||"")}),styles$b.copyButton),s&&u&&m$1(_templateObject3$b||(_templateObject3$b=_taggedTemplateLiteral(["",">Please enter a value<//>"])),ErrorMessage))},css_248z$d=".styles-module_stepsWrap__1Yzhl {\n width: 100%; }\n\n.styles-module_stepWrap__eLO77 {\n margin-bottom: 30px; }\n\n.styles-module_unsupported__eCxdG {\n font-size: 12px;\n color: #ca8c1b; }\n",styles$a={stepsWrap:"styles-module_stepsWrap__1Yzhl",stepWrap:"styles-module_stepWrap__eLO77",unsupported:"styles-module_unsupported__eCxdG"},_templateObject$g,_templateObject2$c,_templateObject3$a,_templateObject4$6,_templateObject5$5,_templateObject6$3,_templateObject7$3,_templateObject8$2,_templateObject9$2,_templateObject10$2,_templateObject11$2,_templateObject12$1,_templateObject13$1,_templateObject14$1,_templateObject15$1,_templateObject16$1,_templateObject17$1,_templateObject18$1;function ownKeys$2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread$2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$2(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$2(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _createSuper$d(e){var t=_isNativeReflectConstruct$d();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}styleInject(css_248z$d);var Step=function(_Component){_inherits(Step,_Component);var _super=_createSuper$d(Step);function Step(e){var t;return _classCallCheck(this,Step),_defineProperty(_assertThisInitialized(t=_super.call(this,e)),"getVisibleFieldsDataOnRootStep",(function(){var e=t.props.stepDataMapping[t.props.step.id];return Object.keys(e).filter((function(t){return e[Number(t)].value})).reduce((function(t,n){var r=e[Number(n)];return _objectSpread$2(_objectSpread$2({},t),{},_defineProperty({},r.machineName,r.value))}),{})})),_defineProperty(_assertThisInitialized(t),"areParentValuesFilled",(function(e,n){for(var r=!0,o=0;o<n.length;o+=1){var a=n[o],i=t.props.parentChildMapping[e][a].fieldId,l=t.props.stepDataMapping[e]&&t.props.stepDataMapping[e][i];if(!l||!l.value){r=!1;break}}return r})),_defineProperty(_assertThisInitialized(t),"doParentFieldsHaveValues",(function(e,n){var r=!0,o=t.props.parentChildMapping[e][n];if(o&&o.parentFields)for(var a=0;a<o.parentFields.length;a+=1){var i=t.props.parentChildMapping[e][o.parentFields[a]],l=t.props.stepDataMapping[e]&&t.props.stepDataMapping[e][i.fieldId];if(!l||!l.value){r=!1;break}}return r})),_defineProperty(_assertThisInitialized(t),"shouldShowStep",(function(e){var n=t.props.step.id,r=t.props.stepMapping&&t.props.stepMapping[n];if("BUTTON"===e.type||"HTML"===e.type)return!0;if(r&&e.activity_field){var o=!e.is_hidden,a=t.props.parentChildMapping[n][e.activity_field.machine_name].parentFields,i=!0;return a&&(i=t.areParentValuesFilled(n,a)),o&&i}return!1})),_defineProperty(_assertThisInitialized(t),"stepIsOfType",(function(e){var n=t.props.step.id,r=t.props.stepMapping&&t.props.stepMapping[n];return e.indexOf(r.step.activity.type)>-1})),_defineProperty(_assertThisInitialized(t),"textFieldParentHasValues",(function(){var e=t.props.step.id,n=t.props.stepMapping&&t.props.stepMapping[e],r=n.step.template_fields.filter((function(e){return e.is_visible})),o=n.selectedAuthId,a=r.filter((function(e){return e.activity_field&&"DYNAMIC"===e.activity_field.type}))[0];return!a||!!(r.length>0&&a&&a.activity_field&&o&&t.doParentFieldsHaveValues(e,a.activity_field.machine_name))})),_defineProperty(_assertThisInitialized(t),"shouldShowMapping",(function(){var e=t.props.step.id,n=t.props.stepMapping&&t.props.stepMapping[e];if(t.stepIsOfType(["ADAPTER","ACTION"])){var r=n.step.template_fields.filter((function(e){return e.is_visible})),o=n.selectedAuthId,a=r.filter((function(e){return e.activity_field&&"DYNAMIC"===e.activity_field.type}))[0];if(!a)return!1;if(r.length>0&&o&&a&&a.activity_field&&t.doParentFieldsHaveValues(e,a.activity_field.machine_name))return!0}return!1})),_defineProperty(_assertThisInitialized(t),"getMappingDataInput",(function(){var e=t.props.step.id;return{authId:(t.props.stepMapping&&t.props.stepMapping[e]).selectedAuthId,fieldsData:t.getVisibleFieldsDataOnRootStep()}})),_defineProperty(_assertThisInitialized(t),"fieldDynamicData",(function(e){var n=t.props.step.id;if(t.props.stepMapping&&t.props.stepMapping[n]&&e.activity_field){var r=t.props.parentChildMapping[n][e.activity_field.machine_name].parentFields;if(r){var o=t.props.parentChildMapping[n][r[0]].fieldId;if(o)return _defineProperty({},r[0],t.props.stepDataMapping[n][o].value)}}return null})),t.state={loading:!1},t}return _createClass(Step,[{key:"componentDidMount",value:function(){this.props.verifyStepValidity(this.props.step.id)}},{key:"render",value:function render(){var _this2=this,_this$props=this.props,step=_this$props.step,stepMapping=_this$props.stepMapping,stepDataMapping=_this$props.stepDataMapping,setStepFieldData=_this$props.setStepFieldData,showStepValidation=_this$props.showStepValidation,selectedStep=stepMapping[step.id]&&stepMapping[step.id].step,selectedStepData=stepDataMapping&&stepDataMapping[step.id];return m$1(_templateObject$g||(_templateObject$g=_taggedTemplateLiteral(["\n ","\n "])),this.state.loading?m$1(_templateObject2$c||(_templateObject2$c=_taggedTemplateLiteral(["<"," //>"])),Loader):m$1(_templateObject3$a||(_templateObject3$a=_taggedTemplateLiteral(["\n ","\n "])),selectedStep?m$1(_templateObject4$6||(_templateObject4$6=_taggedTemplateLiteral(["\n <div class=",">\n ","\n ","\n </div>\n "])),styles$a.stepsWrap,selectedStep.template_fields.map((function(el){var _this2$props$stepMapp;if(_this2.shouldShowStep(el)&&el.activity_field)switch(el.activity_field.type){case"SELECT":return m$1(_templateObject5$5||(_templateObject5$5=_taggedTemplateLiteral(["\n <div class=",">\n <","\n key=","\n apiHandler=","\n title=","\n description=","\n showStepValidation=","\n placeholder=","\n isRequired=","\n value=","\n onChange=","\n endpointUrl=","\n isDynamic=","\n endpointData=","\n ><//>\n </div>\n "])),styles$a.stepWrap,ListBox,el.activity_field.id,_this2.props.apiHandler,el.title||el.activity_field.title,el.description||el.activity_field.description,showStepValidation,el.placeholder,el.is_required,selectedStepData&&selectedStepData[el.id]&&selectedStepData[el.id].value||"",(function(e){setStepFieldData({stepId:"".concat(step.id),fieldId:"".concat(el.id),value:e,isRequired:el.is_required}),_this2.props.verifyStepValidity(step.id)}),el.activity_field.data_src,el.activity_field.is_dynamic,JSON.stringify(_objectSpread$2({authorization_id:_this2.props.stepMapping&&(null===(_this2$props$stepMapp=_this2.props.stepMapping[_this2.props.step.id])||void 0===_this2$props$stepMapp?void 0:_this2$props$stepMapp.selectedAuthId)},_this2.fieldDynamicData(el))));case"TEXTFIELD":return!_this2.shouldShowMapping()&&_this2.textFieldParentHasValues()&&m$1(_templateObject6$3||(_templateObject6$3=_taggedTemplateLiteral(["\n <div class=",">\n <","\n id=","\n title=","\n description=","\n value=","\n placeholder=","\n showStepValidation=","\n isRequired=","\n onChange=","\n ><//>\n </div>\n "])),styles$a.stepWrap,Input,el.activity_field.id,el.title||el.activity_field.title,el.description||el.activity_field.description,selectedStepData&&selectedStepData[el.id]&&selectedStepData[el.id].value||"",el.placeholder||"Please enter a value",showStepValidation,el.is_required,(function(e){setStepFieldData({stepId:"".concat(step.id),fieldId:"".concat(el.id),value:e,isRequired:el.is_required}),_this2.props.verifyStepValidity(step.id)}));case"CHECKBOX":var _el$activity_field$da,_el$activity_field;return m$1(_templateObject7$3||(_templateObject7$3=_taggedTemplateLiteral(["\n <div class=",">\n <","\n title=","\n description=","\n isRequired=","\n />\n <","\n label=","\n name=","\n value=","\n isChecked=","\n isRequired=","\n showStepValidation=","\n handleChange=","\n />\n </div>\n "])),styles$a.stepWrap,Label,el.title||el.activity_field.title,el.description||el.activity_field.description,el.is_required,Checkbox,eval(null!==(_el$activity_field$da=null===(_el$activity_field=el.activity_field)||void 0===_el$activity_field?void 0:_el$activity_field.data_src)&&void 0!==_el$activity_field$da?_el$activity_field$da:"")||[],el.activity_field.machine_name,selectedStepData&&selectedStepData[el.id]&&"1"===selectedStepData[el.id].value,selectedStepData&&selectedStepData[el.id]&&"1"===selectedStepData[el.id].value,el.is_required,showStepValidation,(function(e,t){setStepFieldData({stepId:"".concat(step.id),fieldId:"".concat(el.id),value:t?"1":"0",isRequired:el.is_required}),_this2.props.verifyStepValidity(step.id)}));case"DYNAMIC":return m$1(_templateObject8$2||(_templateObject8$2=_taggedTemplateLiteral([""])));case"PASSWORD":return m$1(_templateObject9$2||(_templateObject9$2=_taggedTemplateLiteral(["\n <div class=",">\n <","\n title=","\n description=","\n value=","\n placeholder=","\n showStepValidation=","\n isRequired=","\n onChange=","\n />\n </div>\n "])),styles$a.stepWrap,PasswordInput,el.title||el.activity_field.title,el.description||el.activity_field.description,selectedStepData&&selectedStepData[el.id]&&selectedStepData[el.id].value||"",el.placeholder||"Please enter a value",showStepValidation,el.is_required,(function(e){setStepFieldData({stepId:"".concat(step.id),fieldId:"".concat(el.id),value:e,isRequired:el.is_required}),_this2.props.verifyStepValidity(step.id)}));case"TEXTAREA":return m$1(_templateObject10$2||(_templateObject10$2=_taggedTemplateLiteral(["\n <div class=",">\n <","\n title=","\n description=","\n value=","\n placeholder=","\n showStepValidation=","\n isRequired=","\n onChange=","\n />\n </div>\n "])),styles$a.stepWrap,TextArea,el.title||el.activity_field.title,el.description||el.activity_field.description,selectedStepData&&selectedStepData[el.id]&&selectedStepData[el.id].value||"",el.placeholder||"Please enter a value",showStepValidation,el.is_required,(function(e){setStepFieldData({stepId:"".concat(step.id),fieldId:"".concat(el.id),value:e,isRequired:el.is_required}),_this2.props.verifyStepValidity(step.id)}));case"DATE":return m$1(_templateObject11$2||(_templateObject11$2=_taggedTemplateLiteral(["\n <div class=",">\n <","\n title=","\n description=","\n value=","\n placeholder=","\n showStepValidation=","\n isRequired=","\n onChange=","\n />\n </div>\n "])),styles$a.stepWrap,DateInput,el.title||el.activity_field.title,el.description||el.activity_field.description,selectedStepData&&selectedStepData[el.id]&&selectedStepData[el.id].value||"",el.placeholder||"Please enter a value",showStepValidation,el.is_required,(function(e){setStepFieldData({stepId:"".concat(step.id),fieldId:"".concat(el.id),value:e,isRequired:el.is_required}),_this2.props.verifyStepValidity(step.id)}));case"RADIO":return m$1(_templateObject12$1||(_templateObject12$1=_taggedTemplateLiteral(["\n <div class=",">\n <","\n name=","\n label=","\n description=","\n />\n </div>\n "])),styles$a.stepWrap,Radio,el.title||el.activity_field.title,el.title||el.activity_field.title,el.description||el.activity_field.description);default:return m$1(_templateObject13$1||(_templateObject13$1=_taggedTemplateLiteral([" <div\n class=","\n >\n Field: "," is currently not\n supported\n </div>"])),"".concat(styles$a.stepWrap," ").concat(styles$a.unsupported),el.activity_field.type)}else switch(el.type){case"HTML":return m$1(_templateObject14$1||(_templateObject14$1=_taggedTemplateLiteral(['\n <div\n style="margin-bottom: 2rem;"\n dangerouslySetInnerHTML=',"\n />\n "])),{__html:purify(window).sanitize(el.default_value)});case"BUTTON":return m$1(_templateObject15$1||(_templateObject15$1=_taggedTemplateLiteral(['\n <div style="margin-bottom: 2rem;">\n <'," label="," />\n </div>\n "])),Button,el.title)}return m$1(_templateObject16$1||(_templateObject16$1=_taggedTemplateLiteral([""])))})),this.shouldShowMapping()&&m$1(_templateObject17$1||(_templateObject17$1=_taggedTemplateLiteral(["\n <div class=",">\n <","\n stepId=","\n templateFields=","\n showStepValidation=","\n endpointData=","\n ><//>\n </div>\n "])),styles$a.stepWrap,MappingUI$1,selectedStep.id,selectedStep.template_fields,showStepValidation,this.getMappingDataInput())):m$1(_templateObject18$1||(_templateObject18$1=_taggedTemplateLiteral(["Step data could not be loaded"])))))}}]),Step}(d$1),Step$1=preact.connect(["stepMapping","stepDataMapping","parentChildMapping"],actionFunctions)(Step),css_248z$c=".styles-module_stepsWrap__3VIDN {\n display: flex;\n border: 1px solid #d7d7d7;\n box-sizing: border-box;\n box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.04);\n border-radius: 4px;\n width: 100%;\n box-sizing: border-box;\n padding: 30px; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepInfo__nU7A7 .styles-module_header__2GDea {\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: space-between; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepInfo__nU7A7 .styles-module_header__2GDea .styles-module_name__h_9E1 {\n display: flex;\n align-items: center;\n font-weight: 500;\n font-size: 20px;\n color: #333333; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepInfo__nU7A7 .styles-module_header__2GDea .styles-module_steps__1tZbw {\n font-size: 12px;\n font-weight: 400;\n color: #8c8c8c; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepInfo__nU7A7 img,\n .styles-module_stepsWrap__3VIDN .styles-module_stepInfo__nU7A7 svg {\n margin-right: 10px;\n height: 25px;\n width: 25px;\n border-radius: 9999px;\n object-fit: contain; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepContainer__1DBMw {\n display: flex;\n width: 100%;\n flex-direction: column; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepContainer__1DBMw .styles-module_top__JXVEL {\n display: flex;\n flex: 1 1 0%;\n padding-top: 50px;\n padding-left: 35px;\n padding-right: 35px;\n width: 100%; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepContainer__1DBMw .styles-module_bottom__2g7TT {\n display: flex;\n height: 2rem;\n align-items: center;\n justify-content: flex-end;\n box-sizing: initial;\n border-width: 0px;\n border-top-width: 1px;\n border-style: solid;\n border-color: #d7d7d7;\n margin-top: 55px;\n padding-top: 20px; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepContainer__1DBMw .styles-module_bottom__2g7TT .styles-module_buttons__2hBh9 {\n display: flex; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepContainer__1DBMw .styles-module_bottom__2g7TT .styles-module_buttons__2hBh9 div:not(:last-child) {\n margin-right: 20px; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepContainer__1DBMw .styles-module_save__1LVOi {\n font-style: normal;\n font-weight: normal;\n margin-top: -30px;\n font-size: 14px;\n color: #8c8c8c;\n padding-bottom: 30px; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepContainer__1DBMw .styles-module_postSave__3EhMs {\n width: 100%; }\n .styles-module_stepsWrap__3VIDN .styles-module_stepContainer__1DBMw .styles-module_postSave__3EhMs textarea {\n font-family: monospace;\n line-height: 18px; }\n\n.styles-module_authWrap__em0DI {\n margin-bottom: 30px;\n width: 100%;\n max-width: 75%; }\n",styles$9={stepsWrap:"styles-module_stepsWrap__3VIDN",stepInfo:"styles-module_stepInfo__nU7A7",header:"styles-module_header__2GDea",name:"styles-module_name__h_9E1",steps:"styles-module_steps__1tZbw",stepContainer:"styles-module_stepContainer__1DBMw",top:"styles-module_top__JXVEL",bottom:"styles-module_bottom__2g7TT",buttons:"styles-module_buttons__2hBh9",save:"styles-module_save__1LVOi",postSave:"styles-module_postSave__3EhMs",authWrap:"styles-module_authWrap__em0DI"},_templateObject$f,_templateObject2$b,_templateObject3$9,_templateObject4$5,_templateObject5$4,_templateObject6$2,_templateObject7$2,_templateObject8$1,_templateObject9$1,_templateObject10$1,_templateObject11$1,_templateObject12,_templateObject13,_templateObject14,_templateObject15,_templateObject16,_templateObject17,_templateObject18,_templateObject19,_templateObject20,_templateObject21;function ownKeys$1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread$1(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$1(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$1(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _createSuper$c(e){var t=_isNativeReflectConstruct$c();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}styleInject(css_248z$c);var Steps$2=function(e){_inherits(n,e);var t=_createSuper$c(n);function n(e){var r;return _classCallCheck(this,n),_defineProperty(_assertThisInitialized(r=t.call(this,e)),"getPayload",(function(){var e,t,n=r.props,o=n.stepMapping,a=n.stepDataMapping;return r.context.isPreviewMode?null:(r.setState({loading:!0}),{name:null!==(e=null===(t=r.props.genericData.templateApp)||void 0===t?void 0:t.name)&&void 0!==e?e:"My new flow",notification_email:"",template:Number(r.props.genericData.templateId),bundle_id:Number(r.props.genericData.bundleId),steps:Object.keys(o).map((function(e){return{id:o[e].integrationStepId||o[e].step.id,authorization:Number(o[e].selectedAuthId)||null,template_step:o[e].step.id,app_user_data:o[e].step.template_fields.map((function(t){return{id:a[o[e].step.id][t.id].integrationFieldId||t.id,value:!a[o[e].step.id][t.id].value&&""!==a[o[e].step.id][t.id].value||a[o[e].step.id][t.id].objectValue?JSON.stringify(a[o[e].step.id][t.id].objectValue):"".concat(a[o[e].step.id][t.id].value),template_field:t.id}}))}}))})})),_defineProperty(_assertThisInitialized(r),"createIntegration",(function(){var e=r.getPayload();e&&r.context.apiHandler.saveIntegration(e).then((function(e){r.postSaveOrCreate(e)})).catch((function(e){return console.error(e)}))})),_defineProperty(_assertThisInitialized(r),"postSaveOrCreate",(function(e){var t=r.props.stepMapping,n=Object.keys(t).map((function(e){return t[e]})).filter((function(e){return e&&e.step&&e.step.activity&&"TRIGGER"===e.step.activity.type}))[0],o=e.steps.filter((function(e){var t;return e.template_step===(null==n||null===(t=n.step)||void 0===t?void 0:t.id)}))[0];if(o&&o.returned_data)try{var a=JSON.parse(o.returned_data);a.is_webhook_url&&a.endpoint&&r.setState({postSave:!0,postSaveData:a,integrationData:e})}catch(e){console.error(e)}else r.setState({integrationData:e},(function(){r.dismiss()}));r.setState({loading:!1})})),_defineProperty(_assertThisInitialized(r),"updateIntegration",(function(){var e=r.getPayload();e&&r.context.apiHandler.updateIntegration(r.context.integrationId,_objectSpread$1(_objectSpread$1({},e),{},{id:"".concat(r.context.integrationId)})).then((function(e){r.postSaveOrCreate(e)})).catch((function(e){return console.error(e)}))})),_defineProperty(_assertThisInitialized(r),"dismiss",(function(){var e=r.state.integrationData;e&&r.context.eventEmitter.emit("did-save-integration",{integrationId:e.id,name:e.name,templateId:e.template,status:e.status})})),_defineProperty(_assertThisInitialized(r),"handleAuthSelected",(function(e,t,n,o){var a=r.props.stepMapping[t].step.template_fields.filter((function(e){return e.activity_field&&e.activity_field.is_dynamic})).map((function(e){return e.id}));r.props.setStepAuthorization(t,e,n,a,o)})),r.state={loading:!1,selectedAuthStep:null,postSave:!1,postSaveData:null,integrationData:null},r}return _createClass(n,[{key:"componentDidUpdate",value:function(e){var t,n,r,o,a=e.stepState,i=this.props.stepState;a.stepIndex!==i.stepIndex&&this.context.eventEmitter.emit("did-change-step",{stepId:null!==(t=null===(n=i.steps[i.stepIndex])||void 0===n?void 0:n.stepId)&&void 0!==t?t:null,stepType:null!==(r=null===(o=i.steps[i.stepIndex])||void 0===o?void 0:o.type)&&void 0!==r?r:"CONFIRMATION"})}},{key:"render",value:function(){var e,t,n,r,o,a,i,l,s,p,c,d=this,u=null,_=this.props,m=_.stepState,f=_.stepMapping,y=this.state,g=y.postSave,h=y.postSaveData,v=m.currentStep,b=m.stepIndex,$=m.steps,w=!1,j=!1,x=!1,O=!1;b>-1&&"CONFIRMATION"!==(null==v?void 0:v.type)?(u=f[Number(null==v?void 0:v.stepId)],w=!1,j=m.stepIndex>0,x=null!==(c=null==v?void 0:v.isValid)&&void 0!==c&&c,O=m.showValidation):"CONFIRMATION"===(null==v?void 0:v.type)&&b===$.length&&(j=!0,w=!0);return m$1(_templateObject$f||(_templateObject$f=_taggedTemplateLiteral(["\n <div class=",">\n <div class=",">\n <div class=",">\n ","\n </div>\n\n <div class=",">\n ","\n </div>\n ","\n </div>\n </div>\n "])),styles$9.stepsWrap,styles$9.stepContainer,styles$9.stepInfo,v&&m$1(_templateObject2$b||(_templateObject2$b=_taggedTemplateLiteral(["\n ","\n "])),w?m$1(_templateObject3$9||(_templateObject3$9=_taggedTemplateLiteral(["\n <div class=",">\n <div class=",'>\n <svg\n width="25"\n height="25"\n viewBox="0 0 25 25"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <circle\n cx="12.5"\n cy="12.5"\n r="11.75"\n fill="white"\n stroke="#2ECC71"\n stroke-width="1.5"\n />\n <path\n d="M17.2209 9.16699L11.3907 15.8337L8.33203 12.3361"\n stroke="#2ECC71"\n stroke-width="1.5"\n stroke-linecap="round"\n />\n </svg>\n <div>\n ',"\n </div>\n </div>\n <div class=",">\n ","\n </div>\n </div>\n "])),styles$9.header,styles$9.name,h&&g?"Flow created successfully":"Confirm and activate",styles$9.steps,"Step ".concat((null!==(e=null===(t=this.props.stepState)||void 0===t?void 0:t.stepIndex)&&void 0!==e?e:0)+1," / ").concat((null!==(n=null===(r=this.props.stepState)||void 0===r?void 0:r.steps.length)&&void 0!==n?n:0)+1)):m$1(_templateObject4$5||(_templateObject4$5=_taggedTemplateLiteral(["\n <div class=",">\n <div class=",">\n <img src="," />\n <div>\n ","\n </div>\n </div>\n <div class=",">\n ","\n </div>\n </div>\n "])),styles$9.header,styles$9.name,null===(o=u)||void 0===o?void 0:o.step.activity.app.icon_url,"CONFIRMATION"!==(null==v?void 0:v.type)&&(null==v?void 0:v.title),styles$9.steps,"Step ".concat((null!==(a=null===(i=this.props.stepState)||void 0===i?void 0:i.stepIndex)&&void 0!==a?a:0)+1," / ").concat((null!==(l=null===(s=this.props.stepState)||void 0===s?void 0:s.steps.length)&&void 0!==l?l:0)+1))),styles$9.top,v?m$1(_templateObject5$4||(_templateObject5$4=_taggedTemplateLiteral(["\n ","\n "])),w?m$1(_templateObject6$2||(_templateObject6$2=_taggedTemplateLiteral(["\n ","\n "])),g||h?m$1(_templateObject8$1||(_templateObject8$1=_taggedTemplateLiteral(["\n <div class=",">\n <",'\n title="Webhook URL"\n description="Please use the following webhook url to send data"\n value=',"\n showCopyButton=","\n />\n </div>\n "])),styles$9.postSave,TextArea,null==h?void 0:h.endpoint,!0):m$1(_templateObject7$2||(_templateObject7$2=_taggedTemplateLiteral(["\n <div class=",">\n ","\n </div>\n "])),styles$9.save,this.context.isEditMode?"Your integration is ready to be updated. Click “Update” to continue.":"Your integration is ready to be enabled. Click “Save” to continue.")):m$1(_templateObject9$1||(_templateObject9$1=_taggedTemplateLiteral(["\n ","\n "])),u&&m$1(_templateObject10$1||(_templateObject10$1=_taggedTemplateLiteral(["\n ","\n "])),"AUTH"===(null==v?void 0:v.type)?m$1(_templateObject11$1||(_templateObject11$1=_taggedTemplateLiteral(["\n <div class=",">\n <","\n stepId=","\n apiHandler=","\n showErrors=","\n onAuthSelected=","\n >\n <//>\n </div>\n "])),styles$9.authWrap,AuthSelector$1,u.step.id,this.context.apiHandler,O,(function(e,t,n){var r;return d.handleAuthSelected(e,Number(null===(r=u)||void 0===r?void 0:r.step.id),t,n)})):m$1(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n <","\n step=","\n stepType=","\n showStepValidation=","\n apiHandler=","\n eventEmitter=","\n />\n "])),Step$1,null===(p=u)||void 0===p?void 0:p.step,null==v?void 0:v.type,O,this.context.apiHandler,this.context.eventEmitter)))):m$1(_templateObject13||(_templateObject13=_taggedTemplateLiteral(["This template has no configured steps"]))),v&&m$1(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["\n <div class=",">\n <div class=",">\n ","\n ","\n </div>\n </div>\n "])),styles$9.bottom,styles$9.buttons,j&&!g&&!h&&m$1(_templateObject15||(_templateObject15=_taggedTemplateLiteral(["\n <",'\n label="Back"\n onClick=',"\n type=","\n ><//>\n "])),Button,(function(){return d.props.gotoPreviousStep()}),ButtonTypes.SECONDARY),w?m$1(_templateObject16||(_templateObject16=_taggedTemplateLiteral(["\n ","\n "])),g||h?m$1(_templateObject20||(_templateObject20=_taggedTemplateLiteral(["\n <",'\n label="Continue"\n onClick=',"\n ><//>\n "])),Button,(function(){return d.dismiss()})):m$1(_templateObject17||(_templateObject17=_taggedTemplateLiteral(["\n ","\n "])),this.context.isEditMode?m$1(_templateObject18||(_templateObject18=_taggedTemplateLiteral(["\n <",'\n label="Update"\n isLoading=',"\n onClick=","\n ><//>\n "])),Button,this.state.loading,(function(){return d.updateIntegration()})):m$1(_templateObject19||(_templateObject19=_taggedTemplateLiteral(["\n <",'\n label="Save"\n disabled=',"\n tooltip=","\n isLoading=","\n onClick=","\n ><//>\n "])),Button,this.context.isPreviewMode,this.context.isPreviewMode?'Integration setup will have to be\ndone in "Live View"':null,this.state.loading,(function(){return d.createIntegration()})))):m$1(_templateObject21||(_templateObject21=_taggedTemplateLiteral(["\n <",'\n label="Next"\n disabled=',"\n onClick=","\n ><//>\n "])),Button,!x,(function(){return x?d.props.gotoNextStep():d.props.showStepValidationState()}))))}}]),n}(d$1);_defineProperty(Steps$2,"contextType",AppContext);var Steps$3=preact.connect(["stepState","genericData","stepMapping","stepDataMapping"],actionFunctions)(Steps$2),css_248z$b=".styles-module_wrap__2ZgZ0 {\n position: relative;\n width: 100%;\n max-width: 730px; }\n .styles-module_wrap__2ZgZ0 *,\n .styles-module_wrap__2ZgZ0 *::before,\n .styles-module_wrap__2ZgZ0 *::after {\n box-sizing: border-box; }\n\n.styles-module_main__11gFF {\n width: 100%;\n line-height: 1; }\n",styles$8={wrap:"styles-module_wrap__2ZgZ0",main:"styles-module_main__11gFF"},_templateObject$e,_templateObject2$a,_templateObject3$8,_templateObject4$4,_templateObject5$3,_templateObject6$1,_templateObject7$1;styleInject(css_248z$b);var _excluded=["steps"],Wrapper=function(e){var t,n=_slicedToArray(v(!1),2),r=n[0],o=n[1],a=_slicedToArray(v(null),2),i=a[0],l=a[1],s=e.templateId,c=e.bundleId,d=e.customWrapper,u=e.templatePreviewData,_=e.previewMetadata,m=_slicedToArray(v(null),2),f=m[0],y=m[1],g=_slicedToArray(F((function(){})),2),h=g[0],b=g[1],$=w(AppContext);return p((function(){return function(){e.reset()}}),[]),p((function(){h&&console.error(h)}),[h]),p((function(){if(o(!0),null!=$&&$.isPreviewMode&&_){if(!u)throw new Error("Preview data was not provided");try{_assert(u,TemplatePreviewDataType)}catch(e){return console.error(e),o(!1),void y(e)}var t=u.steps,n=_objectWithoutProperties(u,_excluded);return l(u),e.setGenericData({templateId:Number(n.id),bundleId:Number(c),isPreviewMode:$.isPreviewMode}),e.setSteps(t.filter(notEmpty)),e.setStepMapping(t.filter(notEmpty)),e.setParentChildMapping(t.filter(notEmpty)),e.gotoStepInPreview(_),$.eventEmitter.emit("did-load-preview",{templateId:Number(n.id),templateTitle:n.name,templateDescription:n.description}),void o(!1)}if(!s)throw new Error("Template ID not found");null==$||$.apiHandler.getTemplate(Number(s)).then((function(t){l(t),t&&Promise.all(t.steps.map((function(e){return $.apiHandler.getTemplateStep(Number(e.id))}))).then(function(){var n=_asyncToGenerator(_regeneratorRuntime.mark((function n(r){var a;return _regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!r){n.next=16;break}if(e.setGenericData({templateId:Number(s),bundleId:Number(c)}),e.setSteps(r.filter(notEmpty)),e.setStepMapping(r.filter(notEmpty)),e.setParentChildMapping(r.filter(notEmpty)),!$.integrationId){n.next=14;break}return n.next=8,$.apiHandler.getIntegrationById($.integrationId);case 8:if(!(a=n.sent)){n.next=13;break}e.setIntegrationData(a),n.next=14;break;case 13:throw new Error("Error fetching integration data for ID ".concat($.integrationId));case 14:$.eventEmitter.emit("did-load-template",{templateId:Number(s),templateTitle:t.name,templateDescription:t.description}),o(!1);case 16:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()).catch((function(e){return console.error(e)}))}))}),[s]),d?m$1(_templateObject$e||(_templateObject$e=_taggedTemplateLiteral(["",""])),d):m$1(_templateObject2$a||(_templateObject2$a=_taggedTemplateLiteral(['\n <div class="'," ",'">\n ',"\n </div>\n "])),styles$8.wrap,"integry-container",h||f?m$1(_templateObject3$8||(_templateObject3$8=_taggedTemplateLiteral(["\n <","\n title=","\n description=","\n errorPayload=","\n onDismiss=","\n />\n "])),ErrorPage,f?"Validation error":"An unexpected error occurred",f?"There was an error validating the preview payload:":"Please review the following stacktrace:",f||h,f?null:b):m$1(_templateObject4$4||(_templateObject4$4=_taggedTemplateLiteral(["\n <div>\n ","\n </div>\n <div class=",">\n ","\n ","\n </div>\n "])),!r&&i&&m$1(_templateObject5$3||(_templateObject5$3=_taggedTemplateLiteral(["\n <","\n steps=","\n ><//>\n "])),StepNavigation$3,null===(t=i.steps)||void 0===t?void 0:t.map((function(e){return{label:e.title,logoUrl:e.activity.app.icon_url}}))),styles$8.main,r&&m$1(_templateObject6$1||(_templateObject6$1=_taggedTemplateLiteral(['<div style="display: flex; justify-content: center;">\n <'," />\n </div>"])),Loader),!r&&i&&m$1(_templateObject7$1||(_templateObject7$1=_taggedTemplateLiteral([" <"," steps=","><//> "])),Steps$3,i.steps)))},Wrapper$1=preact.connect([""],actionFunctions)(Wrapper),fuzzysort=createCommonjsModule((function(e){var t,n;t=commonjsGlobal,n=function(){var e=void 0!==commonjsRequire&&"undefined"==typeof window,t=new Map,n=new Map,r=[];r.total=0;var o=[],a=[];function i(){t.clear(),n.clear(),o=[],a=[]}function l(e){for(var t=-9007199254740991,n=e.length-1;n>=0;--n){var r=e[n];if(null!==r){var o=r.score;o>t&&(t=o)}}return-9007199254740991===t?null:t}function s(e,t){var n=e[t];if(void 0!==n)return n;var r=t;Array.isArray(t)||(r=t.split("."));for(var o=r.length,a=-1;e&&++a<o;)e=e[r[a]];return e}function p(e){return"object"===_typeof(e)}var c=function(){var e=[],t=0,n={};function r(){for(var n=0,r=e[n],o=1;o<t;){var a=o+1;n=o,a<t&&e[a].score<e[o].score&&(n=a),e[n-1>>1]=e[n],o=1+(n<<1)}for(var i=n-1>>1;n>0&&r.score<e[i].score;i=(n=i)-1>>1)e[n]=e[i];e[n]=r}return n.add=function(n){var r=t;e[t++]=n;for(var o=r-1>>1;r>0&&n.score<e[o].score;o=(r=o)-1>>1)e[r]=e[o];e[r]=n},n.poll=function(){if(0!==t){var n=e[0];return e[0]=e[--t],r(),n}},n.peek=function(n){if(0!==t)return e[0]},n.replaceTop=function(t){e[0]=t,r()},n},d=c();return function u(_){var m={single:function(e,t,n){return e?(p(e)||(e=m.getPreparedSearch(e)),t?(p(t)||(t=m.getPrepared(t)),((n&&void 0!==n.allowTypo?n.allowTypo:!_||void 0===_.allowTypo||_.allowTypo)?m.algorithm:m.algorithmNoTypo)(e,t,e[0])):null):null},go:function(e,t,n){if(!e)return r;var o=(e=m.prepareSearch(e))[0],a=n&&n.threshold||_&&_.threshold||-9007199254740991,i=n&&n.limit||_&&_.limit||9007199254740991,c=(n&&void 0!==n.allowTypo?n.allowTypo:!_||void 0===_.allowTypo||_.allowTypo)?m.algorithm:m.algorithmNoTypo,u=0,f=0,y=t.length;if(n&&n.keys)for(var g=n.scoreFn||l,h=n.keys,v=h.length,b=y-1;b>=0;--b){for(var $=t[b],w=new Array(v),j=v-1;j>=0;--j)(S=s($,O=h[j]))?(p(S)||(S=m.getPrepared(S)),w[j]=c(e,S,o)):w[j]=null;w.obj=$;var x=g(w);null!==x&&(x<a||(w.score=x,u<i?(d.add(w),++u):(++f,x>d.peek().score&&d.replaceTop(w))))}else if(n&&n.key){var O=n.key;for(b=y-1;b>=0;--b)(S=s($=t[b],O))&&(p(S)||(S=m.getPrepared(S)),null!==(I=c(e,S,o))&&(I.score<a||(I={target:I.target,_targetLowerCodes:null,_nextBeginningIndexes:null,score:I.score,indexes:I.indexes,obj:$},u<i?(d.add(I),++u):(++f,I.score>d.peek().score&&d.replaceTop(I)))))}else for(b=y-1;b>=0;--b){var S,I;(S=t[b])&&(p(S)||(S=m.getPrepared(S)),null!==(I=c(e,S,o))&&(I.score<a||(u<i?(d.add(I),++u):(++f,I.score>d.peek().score&&d.replaceTop(I)))))}if(0===u)return r;var C=new Array(u);for(b=u-1;b>=0;--b)C[b]=d.poll();return C.total=u+f,C},goAsync:function(t,n,o){var a=!1,i=new Promise((function(i,d){if(!t)return i(r);var u=(t=m.prepareSearch(t))[0],f=c(),y=n.length-1,g=o&&o.threshold||_&&_.threshold||-9007199254740991,h=o&&o.limit||_&&_.limit||9007199254740991,v=(o&&void 0!==o.allowTypo?o.allowTypo:!_||void 0===_.allowTypo||_.allowTypo)?m.algorithm:m.algorithmNoTypo,b=0,$=0;function w(){if(a)return d("canceled");var c=Date.now();if(o&&o.keys)for(var _=o.scoreFn||l,j=o.keys,x=j.length;y>=0;--y){for(var O=n[y],S=new Array(x),I=x-1;I>=0;--I)(k=s(O,T=j[I]))?(p(k)||(k=m.getPrepared(k)),S[I]=v(t,k,u)):S[I]=null;S.obj=O;var C=_(S);if(null!==C&&!(C<g)&&(S.score=C,b<h?(f.add(S),++b):(++$,C>f.peek().score&&f.replaceTop(S)),y%1e3==0&&Date.now()-c>=10))return void(e?setImmediate(w):setTimeout(w))}else if(o&&o.key){for(var T=o.key;y>=0;--y)if((k=s(O=n[y],T))&&(p(k)||(k=m.getPrepared(k)),null!==(L=v(t,k,u))&&!(L.score<g)&&(L={target:L.target,_targetLowerCodes:null,_nextBeginningIndexes:null,score:L.score,indexes:L.indexes,obj:O},b<h?(f.add(L),++b):(++$,L.score>f.peek().score&&f.replaceTop(L)),y%1e3==0&&Date.now()-c>=10)))return void(e?setImmediate(w):setTimeout(w))}else for(;y>=0;--y){var k,L;if((k=n[y])&&(p(k)||(k=m.getPrepared(k)),null!==(L=v(t,k,u))&&!(L.score<g)&&(b<h?(f.add(L),++b):(++$,L.score>f.peek().score&&f.replaceTop(L)),y%1e3==0&&Date.now()-c>=10)))return void(e?setImmediate(w):setTimeout(w))}if(0===b)return i(r);for(var P=new Array(b),M=b-1;M>=0;--M)P[M]=f.poll();P.total=b+$,i(P)}e?setImmediate(w):w()}));return i.cancel=function(){a=!0},i},highlight:function(e,t,n){if(null===e)return null;void 0===t&&(t="<b>"),void 0===n&&(n="</b>");for(var r="",o=0,a=!1,i=e.target,l=i.length,s=e.indexes,p=0;p<l;++p){var c=i[p];if(s[o]===p){if(a||(a=!0,r+=t),++o===s.length){r+=c+n+i.substr(p+1);break}}else a&&(a=!1,r+=n);r+=c}return r},prepare:function(e){if(e)return{target:e,_targetLowerCodes:m.prepareLowerCodes(e),_nextBeginningIndexes:null,score:null,indexes:null,obj:null}},prepareSlow:function(e){if(e)return{target:e,_targetLowerCodes:m.prepareLowerCodes(e),_nextBeginningIndexes:m.prepareNextBeginningIndexes(e),score:null,indexes:null,obj:null}},prepareSearch:function(e){if(e)return m.prepareLowerCodes(e)},getPrepared:function(e){if(e.length>999)return m.prepare(e);var n=t.get(e);return void 0!==n||(n=m.prepare(e),t.set(e,n)),n},getPreparedSearch:function(e){if(e.length>999)return m.prepareSearch(e);var t=n.get(e);return void 0!==t||(t=m.prepareSearch(e),n.set(e,t)),t},algorithm:function(e,t,n){for(var r=t._targetLowerCodes,i=e.length,l=r.length,s=0,p=0,c=0,d=0;;){if(n===r[p]){if(o[d++]=p,++s===i)break;n=e[0===c?s:c===s?s+1:c===s-1?s-1:s]}if(++p>=l)for(;;){if(s<=1)return null;if(0===c){if(n===e[--s])continue;c=s}else{if(1===c)return null;if((n=e[1+(s=--c)])===e[s])continue}p=o[(d=s)-1]+1;break}}s=0;var u=0,_=!1,f=0,y=t._nextBeginningIndexes;null===y&&(y=t._nextBeginningIndexes=m.prepareNextBeginningIndexes(t.target));var g=p=0===o[0]?0:y[o[0]-1];if(p!==l)for(;;)if(p>=l){if(s<=0){if(++u>i-2)break;if(e[u]===e[u+1])continue;p=g;continue}--s,p=y[a[--f]]}else if(e[0===u?s:u===s?s+1:u===s-1?s-1:s]===r[p]){if(a[f++]=p,++s===i){_=!0;break}++p}else p=y[p];if(_)var h=a,v=f;else h=o,v=d;for(var b=0,$=-1,w=0;w<i;++w)$!==(p=h[w])-1&&(b-=p),$=p;for(_?0!==u&&(b+=-20):(b*=1e3,0!==c&&(b+=-20)),b-=l-i,t.score=b,t.indexes=new Array(v),w=v-1;w>=0;--w)t.indexes[w]=h[w];return t},algorithmNoTypo:function(e,t,n){for(var r=t._targetLowerCodes,i=e.length,l=r.length,s=0,p=0,c=0;;){if(n===r[p]){if(o[c++]=p,++s===i)break;n=e[s]}if(++p>=l)return null}s=0;var d=!1,u=0,_=t._nextBeginningIndexes;if(null===_&&(_=t._nextBeginningIndexes=m.prepareNextBeginningIndexes(t.target)),(p=0===o[0]?0:_[o[0]-1])!==l)for(;;)if(p>=l){if(s<=0)break;--s,p=_[a[--u]]}else if(e[s]===r[p]){if(a[u++]=p,++s===i){d=!0;break}++p}else p=_[p];if(d)var f=a,y=u;else f=o,y=c;for(var g=0,h=-1,v=0;v<i;++v)h!==(p=f[v])-1&&(g-=p),h=p;for(d||(g*=1e3),g-=l-i,t.score=g,t.indexes=new Array(y),v=y-1;v>=0;--v)t.indexes[v]=f[v];return t},prepareLowerCodes:function(e){for(var t=e.length,n=[],r=e.toLowerCase(),o=0;o<t;++o)n[o]=r.charCodeAt(o);return n},prepareBeginningIndexes:function(e){for(var t=e.length,n=[],r=0,o=!1,a=!1,i=0;i<t;++i){var l=e.charCodeAt(i),s=l>=65&&l<=90,p=s||l>=97&&l<=122||l>=48&&l<=57,c=s&&!o||!a||!p;o=s,a=p,c&&(n[r++]=i)}return n},prepareNextBeginningIndexes:function(e){for(var t=e.length,n=m.prepareBeginningIndexes(e),r=[],o=n[0],a=0,i=0;i<t;++i)o>i?r[i]=o:(o=n[++a],r[i]=void 0===o?t:o);return r},cleanup:i,new:u};return m}()},e.exports?e.exports=n():t.fuzzysort=n()})),css_248z$a=".styles-module_search__2j0G1 {\n margin-top: 1rem;\n margin-bottom: 0.5rem;\n display: flex;\n width: 100%;\n flex: 1 1 0%;\n overflow: hidden;\n border-radius: 0.25rem;\n border-width: 1px;\n border-style: solid;\n --tw-border-opacity: 1;\n border-color: rgba(229, 231, 235, var(--tw-border-opacity)); }\n .styles-module_search__2j0G1 input {\n margin: 0.25rem;\n height: 100%;\n width: 100%;\n flex: 1 1 0%;\n border-style: none;\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem; }\n\n.styles-module_resultCount__12RMZ {\n display: flex;\n align-items: center;\n justify-content: center;\n border-left-width: 1px;\n border-top-width: 0px;\n border-right-width: 0px;\n border-bottom-width: 0px;\n border-style: solid;\n --tw-border-opacity: 1;\n border-color: rgba(229, 231, 235, var(--tw-border-opacity));\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n font-size: 0.875rem;\n line-height: 1.25rem;\n font-weight: 700;\n --tw-text-opacity: 1;\n color: rgba(156, 163, 175, var(--tw-text-opacity)); }\n",styles$7={search:"styles-module_search__2j0G1",resultCount:"styles-module_resultCount__12RMZ"},_templateObject$d;function _createSuper$b(e){var t=_isNativeReflectConstruct$b();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$b(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}styleInject(css_248z$a);var TemplateSearch=function(e){_inherits(n,e);var t=_createSuper$b(n);function n(e){var r;return _classCallCheck(this,n),_defineProperty(_assertThisInitialized(r=t.call(this,e)),"onInput",(function(e){if(e.target instanceof HTMLInputElement){var t=e.target.value;r.setState({value:t}),r.props.onChange(t)}})),r.state={value:r.props.initialValue||""},r}return _createClass(n,[{key:"render",value:function(){return m$1(_templateObject$d||(_templateObject$d=_taggedTemplateLiteral(["\n <div class="," ",">\n <input\n placeholder=","\n value=","\n oninput=","\n />\n <div class=",">"," results</div>\n </div>\n "])),styles$7.search,"integry-search",this.props.placeholder||"Search...",this.state.value,this.onInput,styles$7.resultCount,this.props.resultCount)}}]),n}(d$1),css_248z$9=".styles-module_nav__bKw4L {\n margin-bottom: 0px;\n margin-top: 0px;\n padding: 0px;\n border-top-width: 0px;\n border-right-width: 0px;\n border-left-width: 0px;\n border-bottom-width: 1px;\n border-style: solid;\n border-color: rgba(107, 114, 128, 0.25); }\n\n.styles-module_tab__3xQCg {\n display: inline-block;\n cursor: pointer;\n list-style-type: none;\n border-bottom-width: 2px;\n border-color: transparent;\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n padding-bottom: 0.25rem;\n line-height: 2rem;\n color: #9ca3af;\n transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n margin-bottom: -1px; }\n .styles-module_tab__3xQCg:hover {\n border-width: 0px;\n border-bottom-width: 2px;\n border-style: solid;\n border-color: #509cf6; }\n\n.styles-module_tabactive__2JeoG {\n border-width: 0px;\n border-bottom-width: 2px;\n border-style: solid;\n border-color: #509cf6;\n color: #374151; }\n",styles$6={nav:"styles-module_nav__bKw4L",tab:"styles-module_tab__3xQCg",tabactive:"styles-module_tabactive__2JeoG"},_templateObject$c;styleInject(css_248z$9);var Tab=function(e){var t=e.label,n=e.activeTab,r=e.onClick;return m$1(_templateObject$c||(_templateObject$c=_taggedTemplateLiteral(["\n <li\n class=","\n onclick=","\n >\n ","\n </li>\n "])),"".concat(styles$6.tab," ").concat(n===t?styles$6.tabactive:""),(function(){r(t)}),t)},_templateObject$b,_templateObject2$9,TabBar=function(e){var t=e.preSelectedTab,n=e.children;if(!Array.isArray(n)||n.length<2)throw new Error("Tab Bar must have at least two children");var r=_slicedToArray(v(t||n[0].props.label),2),o=r[0],a=r[1],i=function(e){a(e)};return m$1(_templateObject$b||(_templateObject$b=_taggedTemplateLiteral(["\n <div>\n <ol class=",">\n ",'\n </ol>\n <div className="tab-content">\n ',"\n </div>\n </div>\n "])),styles$6.nav,n.map((function(e){var t=e.props.label;return m$1(_templateObject2$9||(_templateObject2$9=_taggedTemplateLiteral(["\n <","\n activeTab=","\n key=","\n label=","\n onClick=","\n >\n <//>\n "])),Tab,o,t,t,i)})),n.map((function(e){if(e.props.label===o)return e.props.children})))},timeAgo=function(e){var t=Math.floor((Date.now()-e.getTime())/1e3),n=[{label:"year",seconds:31536e3},{label:"month",seconds:2592e3},{label:"day",seconds:86400},{label:"hour",seconds:3600},{label:"minute",seconds:60},{label:"A few second",seconds:0}].find((function(e){return e.seconds<t}));if(n){var r=Math.floor(t/n.seconds);return Number.isInteger(r)||(r=0),"".concat(r>0?r:""," ").concat(n.label).concat(1!==r?"s":""," ago")}return"Cannot be formatted with interval ".concat(n)},css_248z$8=".styles-module_toggle__2c6vj {\n position: relative; }\n .styles-module_toggle__2c6vj .styles-module_inner__2w3FN {\n position: relative;\n border-radius: 9999px;\n background-color: #9ca3af;\n transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n transition-timing-function: linear;\n position: relative;\n height: 20px;\n width: 40px; }\n .styles-module_toggle__2c6vj .styles-module_inner__2w3FN.styles-module_toggled__3gmsw {\n background: #39d239; }\n .styles-module_toggle__2c6vj .styles-module_inner__2w3FN label {\n position: absolute;\n left: 0px;\n margin-bottom: 0.5rem;\n transform: translateX(0px);\n cursor: pointer;\n border-radius: 9999px;\n border-width: 2px;\n border-style: solid;\n border-color: #9ca3af;\n background-color: white;\n transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n transition-duration: 300ms;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n height: 16px;\n width: 16px; }\n .styles-module_toggle__2c6vj .styles-module_inner__2w3FN label.styles-module_toggled__3gmsw {\n border-color: #39d239;\n transform: translateX(100%); }\n .styles-module_toggle__2c6vj .styles-module_inner__2w3FN input {\n -webkit-appearance: none;\n appearance: none;\n width: 100%;\n height: 100%; }\n .styles-module_toggle__2c6vj .styles-module_inner__2w3FN input:active {\n outline: none; }\n .styles-module_toggle__2c6vj .styles-module_inner__2w3FN input:focus {\n outline: none; }\n",styles$5={toggle:"styles-module_toggle__2c6vj",inner:"styles-module_inner__2w3FN",toggled:"styles-module_toggled__3gmsw"},_templateObject$a;styleInject(css_248z$8);var Toggle=function(e){var t=e.id,n=e.value,r=e.onChange;return m$1(_templateObject$a||(_templateObject$a=_taggedTemplateLiteral(["\n <div class=",">\n <div class=",">\n <label for="," class=",'></label>\n <input type="checkbox" id='," onclick="," />\n </div>\n </div>\n "])),styles$5.toggle,"".concat(styles$5.inner," ").concat(n?styles$5.toggled:""," "),t,"".concat(n?styles$5.toggled:""," "),t,(function(){r(!n)}))},css_248z$7=".styles-module_integrations__2vJT8 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n display: flex;\n flex-direction: column; }\n .styles-module_integrations__2vJT8 .styles-module_integration__MtN8C {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem; }\n .styles-module_integrations__2vJT8 .styles-module_integration__MtN8C img {\n height: 3rem;\n width: 3rem; }\n\n.styles-module_header__1d_zB {\n margin-bottom: 0.75rem;\n margin-top: 1.5rem;\n letter-spacing: 0.025em;\n --tw-text-opacity: 1;\n color: rgba(80, 156, 246, var(--tw-text-opacity)); }\n\n.styles-module_row__1UAlk {\n display: flex;\n align-items: center;\n justify-content: space-between;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n border-radius: 0.25rem;\n cursor: pointer;\n border-width: 1px;\n border-style: solid;\n --tw-border-opacity: 1;\n border-color: rgba(229, 231, 235, var(--tw-border-opacity));\n padding-left: 1.25rem;\n padding-right: 1.25rem;\n padding-top: 1rem;\n padding-bottom: 1rem;\n font-size: 0.875rem;\n line-height: 1.25rem;\n --tw-text-opacity: 1;\n color: rgba(55, 65, 81, var(--tw-text-opacity));\n transition: border-color 0.2s; }\n .styles-module_row__1UAlk:hover {\n border-color: #a8a8a8; }\n\n.styles-module_topbar__3TTLr {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-top: 1rem; }\n",style$2={integrations:"styles-module_integrations__2vJT8",integration:"styles-module_integration__MtN8C",header:"styles-module_header__1d_zB",row:"styles-module_row__1UAlk",topbar:"styles-module_topbar__3TTLr"},_templateObject$9,_templateObject2$8,_templateObject3$7,_templateObject4$3,_templateObject5$2;function _createSuper$a(e){var t=_isNativeReflectConstruct$a();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}styleInject(css_248z$7);var IntegrationsList=function(e){_inherits(n,e);var t=_createSuper$a(n);function n(){var e;_classCallCheck(this,n);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return _defineProperty(_assertThisInitialized(e=t.call.apply(t,[this].concat(o))),"toggleIntegration",(function(t,n){e.props.apiHandler.toggleIntegration(t,n).then((function(e){console.info(e)})).catch((function(e){return console.error(e)}))})),_defineProperty(_assertThisInitialized(e),"onIntegrationDelete",(function(t){e.props.apiHandler.deleteIntegration(t).then((function(e){console.info(e)})).catch((function(e){return console.error(e)}))})),e}return _createClass(n,[{key:"render",value:function(){var e=this;return m$1(_templateObject$9||(_templateObject$9=_taggedTemplateLiteral(["\n <div>\n <div class=",">\n \x3c!-- <h2 class=",">My Flows</h2> --\x3e\n \x3c!-- <"," items=",' value="sort" //> --\x3e\n </div>\n <div class=','>\n <div class="flex w-12">Status</div>\n <div class="flex w-12"></div>\n <div class="flex-1 pl-4">Integration Name</div>\n <div class="w-24">Runs</div>\n <div class="w-40">Last Activity</div>\n <div class="w-16"></div>\n <div class="flex w-6"></div>\n </div>\n <div class=',">\n ","\n ","\n </div>\n </div>\n "])),style$2.topbar,style$2.header,ListBox,[{id:"sort",value:"Sort"}],style$2.row,style$2.integrations,this.props.integrations.length<1&&m$1(_templateObject2$8||(_templateObject2$8=_taggedTemplateLiteral(["No integrations"]))),this.props.integrations.map((function(t){return m$1(_templateObject3$7||(_templateObject3$7=_taggedTemplateLiteral(['\n <div\n class="'," ",'"\n >\n <div class=','>\n <div class="flex w-12">\n ','\n </div>\n <div class="flex w-12">\n <img src=',' />\n </div>\n <div class="flex-1 pl-4">','</div>\n <div class="w-24">','</div>\n <div class="w-40">\n ','\n </div>\n <div class="w-16">\n <',"\n id=","\n value=","\n onChange=",'\n >\n <//>\n </div>\n <div\n class="flex w-6 cursor-pointer"\n onclick=','\n >\n <svg\n width="12"\n height="15"\n viewBox="0 0 12 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M0 4.16667H12"\n stroke="#F05C42"\n stroke-width="1.2"\n />\n <path\n d="M10 5.5V6.16667L9.33333 13.5H2.66667L2 6.16667V5.5"\n stroke="#F05C42"\n stroke-width="1.2"\n stroke-linejoin="round"\n />\n <path\n d="M4 3.5V2.16667C4 1.79848 4.29848 1.5 4.66667 1.5H7.33333C7.70152 1.5 8 1.79848 8 2.16667V3.5"\n stroke="#F05C42"\n stroke-width="1.2"\n />\n </svg>\n </div>\n </div>\n </div>\n '])),style$2.integration,"integry_container_Integration",style$2.row,"fail"!==t.task_execution.status?m$1(_templateObject4$3||(_templateObject4$3=_taggedTemplateLiteral(['\n <svg\n width="22"\n height="22"\n viewBox="0 0 25 25"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <circle\n cx="12.5"\n cy="12.5"\n r="12.5"\n fill="#2ECC71"\n />\n <path\n d="M17.2209 9.16699L11.3907 15.8337L8.33203 12.3361"\n stroke="white"\n stroke-width="1.2"\n stroke-linecap="round"\n />\n </svg>\n ']))):m$1(_templateObject5$2||(_templateObject5$2=_taggedTemplateLiteral(['<svg\n width="22"\n height="25"\n viewBox="0 0 25 27"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <circle cx="12.5" cy="12.5" r="12.5" fill="#E26154" />\n <g filter="url(#filter0_d)">\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M11.1886 8.05792C11.1209 7.32574 11.7556 6.61621 12.4701 6.61621C13.2413 6.61621 13.8535 7.32568 13.7963 8.05792L13.3542 13.5234C13.3206 14.0117 12.8896 14.3955 12.4019 14.3605C11.9713 14.3255 11.6422 13.9535 11.6196 13.5234L11.1886 8.05792ZM11.1836 16.9743C11.1836 16.3124 11.7654 15.7737 12.4835 15.7737C13.2189 15.7737 13.8007 16.3124 13.8 16.9743V17.2052C13.8 17.8671 13.2015 18.3902 12.4835 18.3902C11.7647 18.3902 11.1836 17.8671 11.1836 17.2052V16.9743Z"\n fill="white"\n />\n </g>\n <defs>\n <filter\n id="filter0_d"\n x="7.18359"\n y="6.61621"\n width="10.6164"\n height="19.7739"\n filterUnits="userSpaceOnUse"\n color-interpolation-filters="sRGB"\n >\n <feFlood\n flood-opacity="0"\n result="BackgroundImageFix"\n />\n <feColorMatrix\n in="SourceAlpha"\n type="matrix"\n values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"\n result="hardAlpha"\n />\n <feOffset dy="4" />\n <feGaussianBlur stdDeviation="2" />\n <feColorMatrix\n type="matrix"\n values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"\n />\n <feBlend\n mode="normal"\n in2="BackgroundImageFix"\n result="effect1_dropShadow"\n />\n <feBlend\n mode="normal"\n in="SourceGraphic"\n in2="effect1_dropShadow"\n result="shape"\n />\n </filter>\n </defs>\n </svg> ']))),t.icon_url,t.name,t.runs_count,t.task_execution.last_execution_at?timeAgo(new Date("".concat(t.task_execution.last_execution_at.date," ").concat(t.task_execution.last_execution_at.timezone))):"Never run",Toggle,t.id,"ACTIVE"===t.status,(function(n){return e.toggleIntegration(t.id,n)}),(function(){return e.onIntegrationDelete(t.id)}))})))}}]),n}(d$1),TemplateFormRenderModes,TemplateListingRenderModes;!function(e){e.MODAL="MODAL",e.INLINE="INLINE",e.DETACHED="DETACHED",e.CUSTOM="CUSTOM"}(TemplateFormRenderModes||(TemplateFormRenderModes={})),function(e){e.GRID="GRID",e.LIST="LIST"}(TemplateListingRenderModes||(TemplateListingRenderModes={}));var css_248z$6=".styles-module_template_list__3HABS {\n display: grid;\n grid-template-columns: repeat(1, minmax(0, 1fr));\n gap: 0.5rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem; }\n\n.styles-module_template_grid__mH7-0 {\n display: grid;\n grid-template-columns: repeat(1, minmax(0, 1fr));\n gap: 0.5rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem; }\n @media (min-width: 768px) {\n .styles-module_template_grid__mH7-0 {\n grid-template-columns: repeat(3, minmax(0, 1fr)); } }\n @media (min-width: 1280px) {\n .styles-module_template_grid__mH7-0 {\n grid-template-columns: repeat(5, minmax(0, 1fr)); } }\n\n.styles-module_header__cdTrS {\n margin-bottom: 0.75rem;\n margin-top: 1.5rem;\n letter-spacing: 0.025em;\n --tw-text-opacity: 1;\n color: rgba(80, 156, 246, var(--tw-text-opacity)); }\n",style$1={template_list:"styles-module_template_list__3HABS",template_grid:"styles-module_template_grid__mH7-0",header:"styles-module_header__cdTrS"},_templateObject$8,_templateObject2$7,_templateObject3$6,_templateObject4$2;function _createSuper$9(e){var t=_isNativeReflectConstruct$9();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$9(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}styleInject(css_248z$6);var TemplatesView=function(e){_inherits(n,e);var t=_createSuper$9(n);function n(){var e;return _classCallCheck(this,n),_defineProperty(_assertThisInitialized(e=t.call(this)),"filterTemplates",(function(t){t?e.setState({filteredTemplates:fuzzysort.go(t,e.state.templates,{keys:["name","branding_app.tags"],scoreFn:function(e){var t=e[0],n=e[1];return Math.max(t?t.score+100:-1/0,n?n.score:-1/0)}}).map((function(e){return e.obj}))}):e.setState({filteredTemplates:e.state.templates})})),_defineProperty(_assertThisInitialized(e),"onTemplateClick",(function(t){e.props.setGenericData({templateId:t}),e.props.onTemplateClick&&e.props.onTemplateClick(t)})),e.state={loading:!1,integrations:[],templates:[],filteredTemplates:[]},e}return _createClass(n,[{key:"componentDidMount",value:function(){var e=this;this.setState({loading:!0}),this.props.apiHandler.getTemplateListing(this.props.bundleId).then((function(t){t&&e.setState({integrations:t.integrations,templates:t.templates,filteredTemplates:t.templates,loading:!1})}))}},{key:"render",value:function(){var e,t,n=this;return m$1(_templateObject$8||(_templateObject$8=_taggedTemplateLiteral(["\n <div>\n ","\n </div>\n "])),this.state.loading?m$1(_templateObject2$7||(_templateObject2$7=_taggedTemplateLiteral([" <"," //> "])),Loader):m$1(_templateObject3$6||(_templateObject3$6=_taggedTemplateLiteral(["\n <",">\n <div\n label=","\n >\n \x3c!-- <h2 class=",">Available Flows</h2> --\x3e\n <div>\n <","\n resultCount=","\n onChange=",'\n >\n <//>\n </div>\n <div\n class="'," ",'"\n >\n ',"\n </div>\n </div>\n <div label=",">\n <"," apiHandler=","\n integrations="," //>\n </div>\n <//>\n "])),TabBar,(null===(e=this.props.userConfig)||void 0===e?void 0:e.availableFlowsLabel)||"Available Flows",style$1.header,TemplateSearch,this.state.filteredTemplates.length,(function(e){return n.filterTemplates(e)}),this.props.layout===TemplateListingRenderModes.LIST?style$1.template_list:style$1.template_grid,"integry-container_TemplatesView",this.state.filteredTemplates.map((function(e){return m$1(_templateObject4$2||(_templateObject4$2=_taggedTemplateLiteral(["\n <","\n name=","\n description=","\n layout=","\n tags=","\n imgUrl=","\n onClick=","\n >\n <//>\n "])),n.props.templateContainerTemplate,e.name,e.description,n.props.layout,e.branding_app.tags,e.branding_app.icon_url,(function(){return n.onTemplateClick(e.id)}))})),(null===(t=this.props.userConfig)||void 0===t?void 0:t.myFlowsLabel)||"My Flows",IntegrationsList,this.props.apiHandler,this.state.integrations))}}],[{key:"handleClick",value:function(e){e.preventDefault(),e.target instanceof HTMLElement&&console.info(e.target.localName)}}]),n}(d$1),TemplatesView$1=preact.connect("userConfig",actionFunctions)(TemplatesView),css_248z$5=".styles-module_navigation__2nFX8 {\n width: 12rem; }\n\n.styles-module_navItem__ozaSU {\n margin-bottom: 0.5rem;\n cursor: pointer;\n --tw-text-opacity: 1;\n color: rgba(31, 41, 55, var(--tw-text-opacity)); }\n .styles-module_navItem__ozaSU .styles-module_navItemContent__3UHl8 {\n display: flex;\n height: 2.5rem;\n align-items: center;\n font-size: 0.875rem;\n line-height: 1.25rem; }\n .styles-module_navItem__ozaSU .styles-module_navItemContent__3UHl8 .styles-module_imgContainer__c7lfR {\n margin-right: 0.75rem;\n height: 1.5rem;\n width: 1.5rem;\n overflow: hidden;\n border-radius: 9999px; }\n .styles-module_navItem__ozaSU .styles-module_navItemContent__3UHl8 .styles-module_imgContainer__c7lfR img,\n .styles-module_navItem__ozaSU .styles-module_navItemContent__3UHl8 .styles-module_imgContainer__c7lfR svg {\n height: 100%;\n width: 100%;\n object-fit: cover; }\n .styles-module_navItem__ozaSU.styles-module_active__1nm22 {\n opacity: 1; }\n .styles-module_navItem__ozaSU.styles-module_disabled__1JpJ1 {\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n opacity: 0.5; }\n",styles$4={navigation:"styles-module_navigation__2nFX8",navItem:"styles-module_navItem__ozaSU",navItemContent:"styles-module_navItemContent__3UHl8",imgContainer:"styles-module_imgContainer__c7lfR",active:"styles-module_active__1nm22",disabled:"styles-module_disabled__1JpJ1"},_templateObject$7,_templateObject2$6,_templateObject3$5,_templateObject4$1,_templateObject5$1;function _createSuper$8(e){var t=_isNativeReflectConstruct$8();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$8(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}styleInject(css_248z$5);var TickMark=m$1(_templateObject$7||(_templateObject$7=_taggedTemplateLiteral([' <svg\n width="15"\n height="15"\n viewBox="0 0 15 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n>\n <rect opacity="0.7" width="15" height="15" rx="7.5" fill="#2ECC71" />\n <path\n d="M9.23107 6.34619L6.96066 8.94234L5.76953 7.58033"\n stroke="white"\n stroke-width="1.2"\n stroke-linecap="round"\n />\n</svg>']))),FinalTickMark=m$1(_templateObject2$6||(_templateObject2$6=_taggedTemplateLiteral(['\n <svg\n width="15"\n height="15"\n viewBox="0 0 15 15"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <circle\n cx="7.5"\n cy="7.5"\n r="6.75"\n fill="white"\n stroke="#2ECC71"\n stroke-width="1.5"\n />\n <path\n d="M10.3333 5.5L6.83522 9.5L5 7.40148"\n stroke="#2ECC71"\n stroke-width="1.5"\n stroke-linecap="round"\n />\n </svg>\n']))),NavItem=function(e){_inherits(n,e);var t=_createSuper$8(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n,[{key:"render",value:function(){var e=this.props,t=e.logoUrl,n=e.isActive,r=void 0!==n&&n,o=e.isCompleted,a=void 0!==o&&o,i=e.isDisabled,l=void 0!==i&&i,s=e.isLastStep,p=void 0!==s&&s,c=e.onClick,d=void 0===c?function(){return null}:c;return m$1(_templateObject3$5||(_templateObject3$5=_taggedTemplateLiteral(["\n <div\n class=","\n onclick=",'\n tabindex="-1"\n role="button"\n >\n <div class=',">\n <div class=",">\n ","\n </div>\n <div>","</div>\n </div>\n </div>\n "])),"".concat(styles$4.navItem," ").concat(l?styles$4.disabled:""," ").concat(r?styles$4.active:""),d,styles$4.navItemContent,styles$4.imgContainer,p?FinalTickMark:m$1(_templateObject4$1||(_templateObject4$1=_taggedTemplateLiteral(["\n ","\n "])),!a||r?m$1(_templateObject5$1||(_templateObject5$1=_taggedTemplateLiteral(["<img src="," />"])),t):TickMark),this.props.label)}}]),n}(d$1),_templateObject$6,_templateObject2$5,_templateObject3$4;function _createSuper$7(e){var t=_isNativeReflectConstruct$7();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$7(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var StepNavigation=function(e){_inherits(n,e);var t=_createSuper$7(n);function n(){var e;_classCallCheck(this,n);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return _defineProperty(_assertThisInitialized(e=t.call.apply(t,[this].concat(o))),"changeStep",(function(t){e.props.gotoStep(t)})),e}return _createClass(n,[{key:"render",value:function(){var e,t=this,n=this.props.stepState,r=null==n?void 0:n.currentStep;return m$1(_templateObject$6||(_templateObject$6=_taggedTemplateLiteral(["\n <div class=",">\n <div>\n ","\n <",'\n label="Confirmation"\n isCompleted=',"\n isActive=","\n isDisabled=","\n isLastStep=","\n onClick=","\n />\n </div>\n </div>\n "])),styles$4.navigation,this.props.stepState&&m$1(_templateObject2$5||(_templateObject2$5=_taggedTemplateLiteral(["\n ","\n "])),null===(e=this.props.stepState)||void 0===e?void 0:e.steps.map((function(e,o){return m$1(_templateObject3$4||(_templateObject3$4=_taggedTemplateLiteral([" <","\n label=","\n logoUrl=","\n isCompleted=","\n isActive=","\n isDisabled=","\n isLastStep=","\n onClick=","\n />"])),NavItem,"CONFIRMATION"!==e.type?e.title:"Confirmation","CONFIRMATION"!==e.type&&e.iconUrl,e.isCompleted,"CONFIRMATION"!==(null==r?void 0:r.type)&&"CONFIRMATION"!==e.type&&n.stepIndex===o,Number(null==n?void 0:n.stepIndex)<o,!1,(function(){return t.changeStep(o)}))}))),NavItem,!0,void 0!==r&&(null==n?void 0:n.stepIndex)===(null==n?void 0:n.steps.length),void 0!==r&&(null==n?void 0:n.stepIndex)!==(null==n?void 0:n.steps.length),!0,(function(){var e;return t.changeStep(null!==(e=null==n?void 0:n.steps.length)&&void 0!==e?e:0)}))}}]),n}(d$1);StepNavigation.defaultProps={currentStepIndex:-1,completedTillIndex:-1};var StepNavigation$1=preact.connect("stepState",actionFunctions)(StepNavigation),css_248z$4=".styles-module_stepsWrap__axf95 {\n min-height: 400px;\n margin-top: 1rem;\n display: flex;\n min-height: 400px; }\n .styles-module_stepsWrap__axf95 .styles-module_stepsContainer__1vEyC {\n border-width: 0px;\n border-right-width: 1px;\n border-style: solid;\n --tw-border-opacity: 1;\n border-color: rgba(209, 213, 219, var(--tw-border-opacity));\n padding-right: 1rem; }\n .styles-module_stepsWrap__axf95 .styles-module_stepContainer__1u05c {\n display: flex;\n width: 100%;\n flex-direction: column;\n padding-left: 1rem; }\n .styles-module_stepsWrap__axf95 .styles-module_stepContainer__1u05c .styles-module_top__1EhEd {\n display: flex;\n width: 100%;\n flex: 1 1 0%; }\n .styles-module_stepsWrap__axf95 .styles-module_stepContainer__1u05c .styles-module_bottom__3dACP {\n display: flex;\n justify-content: flex-end; }\n .styles-module_stepsWrap__axf95 .styles-module_stepContainer__1u05c .styles-module_bottom__3dACP .styles-module_buttons__LDv9h {\n display: flex; }\n .styles-module_stepsWrap__axf95 .styles-module_stepContainer__1u05c .styles-module_bottom__3dACP .styles-module_buttons__LDv9h button:not(:last-child) {\n margin-right: 14px; }\n",styles$3={stepsWrap:"styles-module_stepsWrap__axf95",stepsContainer:"styles-module_stepsContainer__1vEyC",stepContainer:"styles-module_stepContainer__1u05c",top:"styles-module_top__1EhEd",bottom:"styles-module_bottom__3dACP",buttons:"styles-module_buttons__LDv9h"},_templateObject$5,_templateObject2$4,_templateObject3$3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11;function _createSuper$6(e){var t=_isNativeReflectConstruct$6();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$6(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}styleInject(css_248z$4);var Steps=function(e){_inherits(n,e);var t=_createSuper$6(n);function n(e){var r;return _classCallCheck(this,n),_defineProperty(_assertThisInitialized(r=t.call(this,e)),"createIntegration",(function(){var e,t,n=r.props,o=n.stepMapping,a=n.stepDataMapping;console.info(o),r.setState({loading:!0});var i={name:null!==(e=null===(t=r.props.genericData.templateApp)||void 0===t?void 0:t.name)&&void 0!==e?e:"My new flow",notification_email:"",template:Number(r.props.genericData.templateId),bundle_id:Number(r.props.genericData.bundleId),steps:Object.keys(o).map((function(e){return{id:o[e].step.id,authorization:Number(o[e].selectedAuthId),template_step:o[e].step.id,app_user_data:o[e].step.template_fields.map((function(t){return{id:t.id,value:!a[o[e].step.id][t.id].value&&""!==a[o[e].step.id][t.id].value||a[o[e].step.id][t.id].objectValue?JSON.stringify(a[o[e].step.id][t.id].objectValue):"".concat(a[o[e].step.id][t.id].value),template_field:t.id}}))}}))};console.info(i),r.context.apiHandler.saveIntegration(i).then((function(e){console.info(e),r.setState({loading:!1})})).catch((function(e){return console.error(e)}))})),_defineProperty(_assertThisInitialized(r),"handleAuthSelected",(function(e,t,n,o){var a=r.props.stepMapping[t].step.template_fields.filter((function(e){return e.activity_field&&e.activity_field.is_dynamic})).map((function(e){return e.id}));r.props.setStepAuthorization(t,e,n,a,o)})),r.state={loading:!1,selectedAuthStep:null},r}return _createClass(n,[{key:"render",value:function(){var e,t,n,r,o,a=this,i=null,l=this.props.stepState,s=l.currentStep,p=l.stepIndex,c=l.steps,d=!1,u=!1,_=!1,m=!1;p>-1&&"CONFIRMATION"!==(null==s?void 0:s.type)?(i=this.props.stepMapping[Number(null==s?void 0:s.stepId)],d=!1,u=this.props.stepState.stepIndex>0,_=null!==(o=null==s?void 0:s.isValid)&&void 0!==o&&o,m=l.showValidation):"CONFIRMATION"===(null==s?void 0:s.type)&&p===c.length&&(d=!0);return m$1(_templateObject$5||(_templateObject$5=_taggedTemplateLiteral(["\n <div class=",">\n <div class=",">\n <","\n steps=","\n currentStepIndex=","\n completedTillIndex=","\n ><//>\n </div>\n <div class=",">\n <div class=",">\n ","\n </div>\n\n <div class=",">\n ","\n </div>\n <div class=",">\n <div class=",">\n ","\n ","\n </div>\n </div>\n </div>\n </div>\n "])),styles$3.stepsWrap,styles$3.stepsContainer,StepNavigation$1,null===(e=this.props.steps)||void 0===e?void 0:e.map((function(e){return{label:e.title,logoUrl:e.activity.app.icon_url}})),-1,-1,styles$3.stepContainer,styles$3.stepInfo,d?m$1(_templateObject2$4||(_templateObject2$4=_taggedTemplateLiteral(['\n <svg\n width="25"\n height="25"\n viewBox="0 0 25 25"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <circle\n cx="12.5"\n cy="12.5"\n r="11.75"\n fill="white"\n stroke="#2ECC71"\n stroke-width="1.5"\n />\n <path\n d="M17.2209 9.16699L11.3907 15.8337L8.33203 12.3361"\n stroke="#2ECC71"\n stroke-width="1.5"\n stroke-linecap="round"\n />\n </svg>\n <div>Confirmation</div>\n ']))):m$1(_templateObject3$3||(_templateObject3$3=_taggedTemplateLiteral(["\n \x3c!-- <img src="," />\n <div>","</div> --\x3e\n "])),null===(t=i)||void 0===t?void 0:t.step.activity.app.icon_url,null===(n=i)||void 0===n?void 0:n.step.title),styles$3.top,d?m$1(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <div class=",">\n Your integration is ready to be enabled. Click “Save” to\n continue.\n </div>\n "])),styles$3.save):m$1(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n ","\n "])),i&&m$1(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n ","\n "])),"AUTH"===(null==s?void 0:s.type)?m$1(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <div class=",">\n <","\n stepId=","\n apiHandler=","\n showErrors=","\n onAuthSelected=","\n >\n <//>\n </div>\n "])),styles$3.stepWrap,AuthSelector$1,i.step.id,this.context.apiHandler,m,(function(e,t,n){var r;return a.handleAuthSelected(e,Number(null===(r=i)||void 0===r?void 0:r.step.id),t,n)})):m$1(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n <","\n step=","\n stepType=","\n showStepValidation=","\n apiHandler=","\n eventEmitter=","\n />\n "])),Step$1,null===(r=i)||void 0===r?void 0:r.step,null==s?void 0:s.type,m,this.context.apiHandler,this.context.eventEmitter))),styles$3.bottom,styles$3.buttons,u&&m$1(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n <",'\n label="Back"\n onClick=',"\n type=","\n ><//>\n "])),Button,(function(){return a.props.gotoPreviousStep()}),ButtonTypes.SECONDARY),d?m$1(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["\n <",'\n label="Save"\n isLoading=',"\n onClick=","\n ><//>\n "])),Button,this.state.loading,(function(){return a.createIntegration()})):m$1(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["\n <",'\n label="Next"\n disabled=',"\n onClick=","\n ><//>\n "])),Button,!_,(function(){return _?a.props.gotoNextStep():a.props.showStepValidationState()})))}}]),n}(d$1);_defineProperty(Steps,"contextType",AppContext);var Steps$1=preact.connect(["stepState","genericData","stepMapping","stepDataMapping"],actionFunctions)(Steps),css_248z$3=".styles-module_header__3p3k1 {\n width: 100%;\n align-items: center;\n display: flex;\n height: 100%;\n margin-bottom: 1rem; }\n .styles-module_header__3p3k1 img {\n border-radius: 9999px;\n margin-right: 0.5rem; }\n .styles-module_header__3p3k1 .styles-module_name__2PDqJ {\n font-weight: 700;\n line-height: 1.625; }\n .styles-module_header__3p3k1 .styles-module_description__39K41 {\n font-weight: 300;\n font-size: 0.875rem;\n line-height: 1.25rem; }\n",styles$2={header:"styles-module_header__3p3k1",name:"styles-module_name__2PDqJ",description:"styles-module_description__39K41"},_templateObject$4,_templateObject2$3,_templateObject3$2;function _createSuper$5(e){var t=_isNativeReflectConstruct$5();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$5(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}styleInject(css_248z$3);var TemplateForm=function(e){_inherits(n,e);var t=_createSuper$5(n);function n(){var e;return _classCallCheck(this,n),(e=t.call(this)).state={loading:!0,template:null},e}return _createClass(n,[{key:"componentDidMount",value:function(){var e=this;this.props.apiHandler.getTemplate(this.props.templateId).then((function(t){t&&Promise.all(t.steps.map((function(t){return e.props.apiHandler.getTemplateStep(Number(t.id))}))).then((function(n){e.setState({template:t,loading:!1}),e.props.setSteps(n.filter(notEmpty)),e.props.setStepMapping(n.filter(notEmpty)),e.props.setParentChildMapping(n.filter(notEmpty)),e.props.setGenericData({templateId:Number(e.props.templateId),bundleId:Number(e.props.bundleId)})})).catch((function(e){return console.error(e)}))})).catch((function(e){throw new Error(e)}))}},{key:"render",value:function(){var e=this.state.template;return m$1(_templateObject$4||(_templateObject$4=_taggedTemplateLiteral(["\n <div>\n ","\n </div>\n "])),this.state.loading?m$1(_templateObject2$3||(_templateObject2$3=_taggedTemplateLiteral(["<"," //>"])),Loader):m$1(_templateObject3$2||(_templateObject3$2=_taggedTemplateLiteral(["\n <div class=",">\n <img src=",' width="40" />\n <div>\n <div class=',">","</div>\n <div class=",">\n ","\n </div>\n </div>\n </div>\n\n <","\n steps=","\n apiHandler=","\n eventEmitter=","\n />\n "])),styles$2.header,null==e?void 0:e.branding_app.icon_url,styles$2.name,null==e?void 0:e.name,styles$2.description,null==e?void 0:e.description,Steps$1,null==e?void 0:e.steps,this.props.apiHandler,this.props.eventEmitter))}}]),n}(d$1),TemplateForm$1=preact.connect("",actionFunctions)(TemplateForm),css_248z$2=".styles-module_name__3qMVY {\n margin-bottom: 0.5rem;\n --tw-text-opacity: 1;\n color: rgba(31, 41, 55, var(--tw-text-opacity)); }\n\n.styles-module_description__2S97K {\n font-size: 0.875rem;\n line-height: 1.25rem;\n --tw-text-opacity: 1;\n color: rgba(107, 114, 128, var(--tw-text-opacity)); }\n\n.styles-module_tags__2fhyE {\n margin-top: 0.5rem;\n margin-bottom: -0.5rem;\n display: flex;\n flex-wrap: wrap; }\n .styles-module_tags__2fhyE .styles-module_tag__26APx {\n margin-right: 0.5rem;\n margin-bottom: 0.5rem;\n border-radius: 0.75rem;\n --tw-bg-opacity: 1;\n background-color: rgba(229, 231, 235, var(--tw-bg-opacity));\n padding: 0.25rem;\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n font-size: 0.75rem;\n line-height: 1rem;\n --tw-text-opacity: 1;\n color: rgba(107, 114, 128, var(--tw-text-opacity)); }\n\n.styles-module_template_list_view__jxmde {\n display: flex;\n cursor: pointer;\n flex-direction: column;\n justify-content: space-between;\n border-radius: 0.25rem;\n border-width: 1px;\n border-style: solid;\n --tw-border-opacity: 1;\n border-color: rgba(229, 231, 235, var(--tw-border-opacity));\n padding-left: 1rem;\n padding-right: 1rem;\n padding-top: 1.25rem;\n padding-bottom: 1.25rem;\n transition: border-color 0.2s; }\n .styles-module_template_list_view__jxmde img {\n margin-bottom: 0.75rem;\n height: 2.5rem;\n width: 2.5rem; }\n .styles-module_template_list_view__jxmde:hover {\n border-color: #a8a8a8; }\n\n.styles-module_template_grid_view__WmHjg {\n display: flex;\n cursor: pointer;\n flex-direction: column;\n justify-content: space-between;\n border-radius: 0.25rem;\n border-width: 1px;\n border-style: solid;\n --tw-border-opacity: 1;\n border-color: rgba(229, 231, 235, var(--tw-border-opacity));\n padding-left: 1rem;\n padding-right: 1rem;\n padding-top: 1.25rem;\n padding-bottom: 1.25rem;\n transition: border-color 0.2s; }\n .styles-module_template_grid_view__WmHjg img {\n margin-bottom: 0.75rem;\n height: 2.5rem;\n width: 2.5rem; }\n .styles-module_template_grid_view__WmHjg:hover {\n border-color: #a8a8a8; }\n",style={name:"styles-module_name__3qMVY",description:"styles-module_description__2S97K",tags:"styles-module_tags__2fhyE",tag:"styles-module_tag__26APx",template_list_view:"styles-module_template_list_view__jxmde",template_grid_view:"styles-module_template_grid_view__WmHjg"},_templateObject$3,_templateObject2$2,_templateObject3$1;function _createSuper$4(e){var t=_isNativeReflectConstruct$4();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$4(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}styleInject(css_248z$2);var Template=function(e){_inherits(n,e);var t=_createSuper$4(n);function n(e){var r;return _classCallCheck(this,n),_defineProperty(_assertThisInitialized(r=t.call(this,e)),"handleClick",(function(){console.info(r.props.name)})),r.state={templateName:r.props.name},r}return _createClass(n,[{key:"render",value:function(){return m$1(_templateObject$3||(_templateObject$3=_taggedTemplateLiteral(["\n <div\n onclick=",'\n class="'," ",'"\n >\n <div>\n <img src='," />\n <p class=",">","</p>\n <p class=",">","</p>\n </div>\n ","\n </div>\n "])),this.props.onClick,this.props.layout===TemplateListingRenderModes.LIST?style.template_list_view:style.template_grid_view,"integry-container_Template",this.props.imgUrl,style.name,this.state.templateName,style.description,this.props.description,this.props.tags.length>0&&m$1(_templateObject2$2||(_templateObject2$2=_taggedTemplateLiteral(["\n <div class=",">\n ","\n </div>\n "])),style.tags,this.props.tags.split(",").map((function(e){return m$1(_templateObject3$1||(_templateObject3$1=_taggedTemplateLiteral([" <div class=",">","</div> "])),style.tag,e)}))))}}],[{key:"handleClick",value:function(e){e.preventDefault(),e.target instanceof HTMLElement&&console.info(e.target.localName)}}]),n}(d$1),css_248z$1=".styles-module_modal__3ImBF {\n display: none;\n z-index: 99;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n overflow-y: auto; }\n .styles-module_modal__3ImBF.styles-module_open__AAUJ5 {\n position: fixed;\n display: block; }\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt {\n display: flex;\n min-height: 100vh;\n align-items: flex-end;\n justify-content: center;\n text-align: center; }\n @media (min-width: 640px) {\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt {\n display: block;\n padding: 0; } }\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt .styles-module_inset__-NimT {\n position: fixed;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n transition-property: opacity;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n opacity: 0.75;\n background-color: #111827; }\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt .styles-module_span__3nIVQ {\n display: none; }\n @media (min-width: 640px) {\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt .styles-module_span__3nIVQ {\n display: inline-block;\n height: 100vh;\n vertical-align: middle; } }\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt .styles-module_contentWrap__2QGtd {\n display: none;\n position: relative;\n vertical-align: bottom;\n background: white;\n border-radius: 4px;\n text-align: left;\n overflow: hidden;\n box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt .styles-module_contentWrap__2QGtd.styles-module_open__AAUJ5 {\n display: inline-block; }\n @media (min-width: 640px) {\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt .styles-module_contentWrap__2QGtd {\n width: 100%;\n max-width: 48rem;\n margin-top: 2rem;\n margin-bottom: 2rem;\n vertical-align: middle; } }\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt .styles-module_contentWrap__2QGtd .styles-module_content__3wdFn {\n position: relative;\n background: white;\n padding: 30px; }\n .styles-module_modal__3ImBF .styles-module_modalContainer__o6TKt .styles-module_contentWrap__2QGtd .styles-module_close__2IqHP {\n position: absolute;\n cursor: pointer;\n top: 10px;\n right: 10px; }\n",styles$1={modal:"styles-module_modal__3ImBF",open:"styles-module_open__AAUJ5",modalContainer:"styles-module_modalContainer__o6TKt",inset:"styles-module_inset__-NimT",span:"styles-module_span__3nIVQ",contentWrap:"styles-module_contentWrap__2QGtd",content:"styles-module_content__3wdFn",close:"styles-module_close__2IqHP"},_templateObject$2,_templateObject2$1;function _createSuper$3(e){var t=_isNativeReflectConstruct$3();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$3(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}styleInject(css_248z$1);var Modal=function(e){_inherits(n,e);var t=_createSuper$3(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n,[{key:"render",value:function(){var e=this.props.isOpen;return m$1(_templateObject$2||(_templateObject$2=_taggedTemplateLiteral(["\n <div\n class=",'\n aria-labelledby="modal-title"\n role="dialog"\n aria-modal="true"\n >\n <div class=',">\n <div class=",' aria-hidden="true"></div>\n\n <span class=',' aria-hidden="true"></span>\n\n <div\n class=',"\n >\n <div class=",">\n <div\n onclick=","\n class=",'\n >\n <svg\n width="20"\n height="22"\n viewBox="0 0 20 22"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M14.2426 16.1822L5.75732 6.86328"\n stroke="#999999"\n stroke-width="2"\n stroke-linecap="round"\n />\n <path\n d="M14.2426 6.86328L5.75732 16.1822"\n stroke="#999999"\n stroke-width="2"\n stroke-linecap="round"\n />\n </svg>\n </div>\n ',"\n </div>\n </div>\n </div>\n </div>\n "])),"".concat(styles$1.modal," ").concat(e?"".concat(styles$1.open):""),styles$1.modalContainer,styles$1.inset,styles$1.span,"".concat(styles$1.contentWrap," ").concat(e?"".concat(styles$1.open):""),styles$1.content,this.props.onClose,styles$1.close,this.props.isOpen&&m$1(_templateObject2$1||(_templateObject2$1=_taggedTemplateLiteral([" "," "])),this.props.children))}}]),n}(d$1),css_248z=".styles-module_integry-container__3nnxM {\n margin-bottom: 0.5rem; }\n\n.styles-module_modal__3R9nC {\n position: fixed;\n z-index: 10;\n overflow-y: auto;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px; }\n",styles={"integry-container":"styles-module_integry-container__3nnxM",modal:"styles-module_modal__3R9nC"},_templateObject$1;function _createSuper$2(e){var t=_isNativeReflectConstruct$2();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$2(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}styleInject(css_248z);var Container=function(e){_inherits(n,e);var t=_createSuper$2(n);function n(e){var r;return _classCallCheck(this,n),_defineProperty(_assertThisInitialized(r=t.call(this,e)),"templateComponent",void 0),_defineProperty(_assertThisInitialized(r),"templateListComponent",void 0),_defineProperty(_assertThisInitialized(r),"store",void 0),_defineProperty(_assertThisInitialized(r),"onTemplateClick",(function(e){r.setState({isModalOpen:!0,templateId:e})})),r.state={isModalOpen:!1,templateId:null},r.store=createSDKStore(),r.store.setState({userConfig:e.userConfig}),r}return _createClass(n,[{key:"componentWillMount",value:function(){this.templateComponent=Template,this.templateListComponent=TemplatesView$1}},{key:"render",value:function(){var e=this;return m$1(_templateObject$1||(_templateObject$1=_taggedTemplateLiteral(["\n <>\n <"," store=",'>\n <div class="'," ",'">\n <',"\n layout=","\n bundleId=","\n templateContainerTemplate=","\n apiHandler=","\n eventEmitter=","\n onTemplateClick=","\n >\n </div>\n <"," \n isOpen="," \n onClose=","\n > \n <"," \n apiHandler=","\n templateId=","\n bundleId="," \n />\n <//>\n <//>\n </>\n "])),preact.Provider,this.store,styles["integry-container"],"integry-container",this.templateListComponent,this.props.layout,this.props.bundleId,this.templateComponent,this.context.apiHandler,this.context.eventEmitter,this.onTemplateClick,Modal,this.state.isModalOpen,(function(){e.store.setState(initialState),e.setState({isModalOpen:!1,templateId:null})}),TemplateForm$1,this.context.apiHandler,this.state.templateId,this.props.bundleId)}}]),n}(d$1);_defineProperty(Container,"contextType",AppContext);var EventRunnerAbstract=function(){function e(t,n){_classCallCheck(this,e),_defineProperty(this,"emitter",void 0),_defineProperty(this,"handler",void 0),this.emitter=t,this.handler=n}return _createClass(e,[{key:"getHandler",value:function(){return this.handler}}]),e}();function _createSuper$1(e){var t=_isNativeReflectConstruct$1();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$1(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var EventRunnerDefault=function(e){_inherits(n,e);var t=_createSuper$1(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n,[{key:"run",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.handler.apply(null,n)}}]),n}(EventRunnerAbstract);function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _get(e,t,n){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=_superPropBase(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var n,r=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var EventRunnerNTimes=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,r){var o,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(_classCallCheck(this,n),_defineProperty(_assertThisInitialized(o=t.call(this,e,r)),"total",void 0),_defineProperty(_assertThisInitialized(o),"i",0),o.total=a,o.total<1)throw new Error("{total} can not be less than 1");return o}return _createClass(n,[{key:"run",value:function(e){for(var t,r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];(t=_get(_getPrototypeOf(n.prototype),"run",this)).call.apply(t,[this,e].concat(o)),++this.i>=this.total&&this.emitter.off(e,this.handler)}}]),n}(EventRunnerDefault),EventEmitter=function(){function e(){_classCallCheck(this,e),_defineProperty(this,"events",Object.create(null))}return _createClass(e,[{key:"on",value:function(e,t){this.addEventListener(e,new EventRunnerDefault(this,t))}},{key:"once",value:function(e,t){this.addEventListener(e,new EventRunnerNTimes(this,t,1))}},{key:"off",value:function(e,t){var n=this.events[e];null!=n&&n.length&&(this.events[e]=n.filter((function(e){return e.getHandler()!==t})))}},{key:"offAll",value:function(){var e=this;Object.keys(this.events).forEach((function(t){var n=e.events[t];n&&(n.length=0)})),this.events=Object.create(null)}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=this.events[e];o&&o.forEach((function(t){return t.run.apply(t,[e].concat(n))}))}},{key:"addEventListener",value:function(e,t){var n=this.events[e];Array.isArray(n)?n.push(t):this.events[e]=[t]}}]),e}(),_templateObject,_templateObject2,_templateObject3;function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var IntegryJS=function e(t){var n,r,o,a,i=this;(_classCallCheck(this,e),_defineProperty(this,"config",void 0),_defineProperty(this,"apiHandler",void 0),_defineProperty(this,"eventEmitter",new EventEmitter),_defineProperty(this,"getRandomTemplateId",(function(e){for(var t=[],n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",r=n.length,o=0;o<e;o+=1)t.push(n.charAt(Math.floor(Math.random()*r)));return"x-integry-modal-".concat(t.join(""))})),_defineProperty(this,"getAuthParamsFromUrl",(function(){var e=isBrowser()&&new URLSearchParams(window.location.search);if(e){var t=e.get("user_id"),n=e.get("app_key"),r=e.get("hash"),o=e.get("bundle_id");if(!(t&&n&&r&&o))throw new Error("The following auth variables are undefined: ".concat(t?"":"userId"," ").concat(n?"":"appKey"," ").concat(r?"":"hash"," ").concat(o?"":"bundleId"));return{userId:t,appKey:n,hash:r,bundleId:o}}return{userId:"",appKey:"",hash:"",bundleId:""}})),_defineProperty(this,"printVersion",(function(){console.info("@integry/sdk@".concat(e.SDK_VERSION))})),_defineProperty(this,"getTemplatesList",_asyncToGenerator(_regeneratorRuntime.mark((function e(){return _regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",i.apiHandler.getTemplateListing(i.config.bundleId));case 1:case"end":return e.stop()}}),e)})))),_defineProperty(this,"setupTemplateFormDestination",(function(e,t){var n=null;if(t){if(e===TemplateFormRenderModes.MODAL||e===TemplateFormRenderModes.INLINE)throw new Error('The `templateContainerId` property is unsupported when render mode is set to "MODAL" or "INLINE"');(n=document.getElementById(t))||console.warn("The template form render target with id ".concat(t," was not found"))}switch(e){case TemplateFormRenderModes.MODAL:return(n=document.createElement("div")).id=i.getRandomTemplateId(8),document.body.appendChild(n),n;case TemplateFormRenderModes.INLINE:return null;case TemplateFormRenderModes.DETACHED:case TemplateFormRenderModes.CUSTOM:return n;default:throw new Error("Unsupported renderMode ".concat(e," configuration, please provide one of ").concat(JSON.stringify(Object.keys(TemplateFormRenderModes))))}})),_defineProperty(this,"renderTemplateForm",(function(e,t){var n=document.getElementById(t);if(n){var r=createSDKStore();E$1(m$1(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <","\n value=","\n >\n <"," store=",">\n <","\n bundleId=","\n templateId=","\n >\n <//>\n <//>\n <//>\n "])),AppContext.Provider,{apiHandler:i.apiHandler,eventEmitter:i.eventEmitter,integrationId:i.config.integrationId,isPreviewMode:!1,isEditMode:!!i.config.integrationId},preact.Provider,r,Wrapper$1,i.config.bundleId,e),n)}else console.warn("Integry template form render target with id ".concat(t," was not found"))})),_defineProperty(this,"renderPreview",(function(e){var t=e.templateData,n=e.metadata,r=e.previewContainerId,o=document.getElementById(r);if(o){var a=createSDKStore();E$1(m$1(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <","\n value=","\n >\n <"," store=",">\n <","\n bundleId=","\n isPreviewMode=","\n templatePreviewData=","\n previewMetadata=","\n >\n <//>\n <//>\n <//>\n "])),AppContext.Provider,{apiHandler:i.apiHandler,eventEmitter:i.eventEmitter,isPreviewMode:!0},preact.Provider,a,Wrapper$1,i.config.bundleId,!0,t,n),o)}else console.warn("Integry template form render target with id ".concat(r," was not found"))})),_defineProperty(this,"init",(function(e){var t=e.containerId,n=e.templateContainerId,r=e.renderMode,o=document.getElementById(t);if(!r)throw new Error("Template form render mode needs to be defined");if(i.setupTemplateFormDestination(r,n),o){var a=o.getAttribute("x-integry-layout")||TemplateListingRenderModes.LIST;E$1(m$1(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <","\n value=","\n >\n <","\n bundleId=","\n userConfig=","\n layout=","\n >\n <//>\n <//>\n "])),AppContext.Provider,{apiHandler:i.apiHandler,eventEmitter:i.eventEmitter,isPreviewMode:!1},Container,i.config.bundleId,i.config.userConfig,a),o)}else console.warn("Integry SDK render target with id ".concat(t," was not found"))})),_defineProperty(this,"destroy",(function(){try{i.eventEmitter.offAll()}catch(e){console.error("There was an error unsubscribing from all events")}})),"staging"===t.env)?r={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:"https://beta.integry.io",baseUrlv2:"https://beta.integry.io/v2",apiKey:null===(o=t.xIntegryConfig)||void 0===o?void 0:o.appAuth.apiKey}:r={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:"https://app.integry.io",baseUrlv2:"https://app.integry.io/v2",apiKey:null===(a=t.xIntegryConfig)||void 0===a?void 0:a.appAuth.apiKey};if("appKey"in t)n=_objectSpread(_objectSpread(_objectSpread({},t),r),{},{appKey:t.appKey,hash:t.hash,userId:t.userId}),this.config=_objectSpread(_objectSpread(_objectSpread({},t),r),{},{appKey:t.appKey,hash:t.hash,userId:t.userId,bundleId:t.bundleId,userConfig:t.userConfig});else{var l=this.getAuthParamsFromUrl()||{};n=_objectSpread(_objectSpread({},r),l),this.config=_objectSpread(_objectSpread(_objectSpread({},r),l),{},{userConfig:t.userConfig})}this.apiHandler=new IntegryAPI(n)};return _defineProperty(IntegryJS,"SDK_VERSION","0.0.73"),_defineProperty(IntegryJS,"RenderModes",TemplateFormRenderModes),_defineProperty(IntegryJS,"Helpers",void 0),IntegryJS.Helpers={getAuthHash:HMAC},IntegryJS}));
18
18
  //# sourceMappingURL=index.umd.js.map