@integry/sdk 0.0.55 → 0.0.59

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(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function n(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 r(e){return function(){var t=this,r=arguments;return new Promise((function(i,o){var a=e.apply(t,r);function s(e){n(a,i,o,s,l,"next",e)}function l(e){n(a,i,o,s,l,"throw",e)}s(void 0)}))}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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=Object.prototype,s=a.hasOwnProperty,l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",p=l.toStringTag||"@@toStringTag";function d(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),a=new M(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return D()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===_)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=f(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===_)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,a),o}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}var _={};function m(){}function h(){}function v(){}var y={};y[u]=function(){return this};var g=Object.getPrototypeOf,b=g&&g(g(A([])));b&&b!==a&&s.call(b,u)&&(y=b);var w=v.prototype=m.prototype=Object.create(y);function x(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function I(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))}function k(e,t){function n(r,i,a,l){var u=f(e[r],e,i);if("throw"!==u.type){var c=u.arg,p=c.value;return p&&"object"===o(p)&&s.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,a,l)}),(function(e){n("throw",e,a,l)})):t.resolve(p).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,l)}))}l(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 S(e,t){var n=e.iterator[t.method];if(undefined===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=undefined,S(e,t),"throw"===t.method))return _;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return _}var r=f(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,_;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=undefined),t.delegate=null,_):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,_)}function C(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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function A(e){if(e){var t=e[u];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(s.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=undefined,t.done=!0,t};return r.next=r}}return{next:D}}function D(){return{value:undefined,done:!0}}h.prototype=w.constructor=v,v.constructor=h,v[p]=h.displayName="GeneratorFunction",x(k.prototype),k.prototype[c]=function(){return this},x(w),w[p]="Generator",w[u]=function(){return this},w.toString=function(){return"[object Generator]"},M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=undefined)},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=undefined),!!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 a=s.call(i,"catchLoc"),l=s.call(i,"finallyLoc");if(a&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)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&&s.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,_):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),_},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),O(n),_}},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;O(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:A(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=undefined),_}};var T,R,N,E,L,P,j,F={wrap:d,isGeneratorFunction:I,AsyncIterator:k,mark:function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,p in e||(e[p]="GeneratorFunction")),e.prototype=Object.create(w),e},awrap:function(e){return{__await:e}},async:function(e,t,n,r,i){void 0===i&&(i=Promise);var o=new k(d(e,t,n,r),i);return I(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:A},z={},U=[],H=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function V(e,t){for(var n in t)e[n]=t[n];return e}function B(e){var t=e.parentNode;t&&t.removeChild(e)}function W(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 J(e,o,t&&t.key,t&&t.ref)}function J(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 T.vnode&&T.vnode(i),i}function G(e){return e.children}function q(e,t){this.props=e,this.context=t}function K(e,t){if(null==t)return e.__?K(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?K(e):null}function Q(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 Q(e)}}function Y(e){(!e.__d&&(e.__d=!0)&&1===N.push(e)||L!==T.debounceRendering)&&((L=T.debounceRendering)||E)(Z)}function Z(){var e,t,n,r,i,o,a;for(N.sort((function(e,t){return t.__v.__b-e.__v.__b}));e=N.pop();)e.__d&&(n=void 0,r=void 0,o=(i=(t=e).__v).__e,(a=t.__P)&&(n=[],r=ie(a,i,V({},i),t.__n,void 0!==a.ownerSVGElement,null,n,null==o?K(i):o),oe(n,i),r!=o&&Q(i)))}function X(e,t,n,r,i,o,a,s,l){var u,c,p,d,f,_,m,h=n&&n.__k||U,v=h.length;if(s==z&&(s=null!=o?o[0]:v?K(n,0):null),u=0,t.__k=$(t.__k,(function(n){if(null!=n){if(n.__=t,n.__b=t.__b+1,null===(p=h[u])||p&&n.key==p.key&&n.type===p.type)h[u]=void 0;else for(c=0;c<v;c++){if((p=h[c])&&n.key==p.key&&n.type===p.type){h[c]=void 0;break}p=null}if(d=ie(e,n,p=p||z,r,i,o,a,s,l),(c=n.ref)&&p.ref!=c&&(m||(m=[]),p.ref&&m.push(p.ref,null,n),m.push(c,n.__c||d,n)),null!=d){if(null==_&&(_=d),null!=n.__d)d=n.__d,n.__d=null;else if(o==p||d!=s||null==d.parentNode){e:if(null==s||s.parentNode!==e)e.appendChild(d);else{for(f=s,c=0;(f=f.nextSibling)&&c<v;c+=2)if(f==d)break e;e.insertBefore(d,s)}"option"==t.type&&(e.value="")}s=d.nextSibling,"function"==typeof t.type&&(t.__d=d)}}return u++,n})),t.__e=_,null!=o&&"function"!=typeof t.type)for(u=o.length;u--;)null!=o[u]&&B(o[u]);for(u=v;u--;)null!=h[u]&&se(h[u],h[u]);if(m)for(u=0;u<m.length;u++)ae(m[u],m[++u],m[++u])}function $(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++)$(e[r],t,n);else n.push(t?t("string"==typeof e||"number"==typeof e?J(null,e,null,null):null!=e.__e||null!=e.__c?J(e.type,e.props,e.key,null):e):e);return n}function ee(e,t,n,r,i){var o;for(o in n)o in t||ne(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"value"===o||"checked"===o||n[o]===t[o]||ne(e,o,t[o],n[o],r)}function te(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]="number"==typeof n&&!1===H.test(t)?n+"px":null==n?"":n}function ne(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||te(o,a,"");if(n)for(s in n)r&&n[s]===r[s]||te(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,re,l),(e.l||(e.l={}))[t]=n):e.removeEventListener(t,re,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 re(e){this.l[e.type](T.event?T.event(e):e)}function ie(e,t,n,r,i,o,a,s,l){var u,c,p,d,f,_,m,h,v,y,g=t.type;if(void 0!==t.constructor)return null;(u=T.__b)&&u(t);try{e:if("function"==typeof g){if(h=t.props,v=(u=g.contextType)&&r[u.__c],y=u?v?v.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(h,y):(t.__c=c=new q(h,y),c.constructor=g,c.render=le),v&&v.sub(c),c.props=h,c.state||(c.state={}),c.context=y,c.__n=r,p=c.__d=!0,c.__h=[]),null==c.__s&&(c.__s=c.state),null!=g.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=V({},c.__s)),V(c.__s,g.getDerivedStateFromProps(h,c.__s))),d=c.props,f=c.state,p)null==g.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==g.getDerivedStateFromProps&&h!==d&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(h,y),!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(h,c.__s,y)){for(c.props=h,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(h,c.__s,y),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(d,f,_)}))}c.context=y,c.props=h,c.state=c.__s,(u=T.__r)&&u(t),c.__d=!1,c.__v=t,c.__P=e,u=c.render(c.props,c.state,c.context),t.__k=$(null!=u&&u.type==G&&null==u.key?u.props.children:u),null!=c.getChildContext&&(r=V(V({},r),c.getChildContext())),p||null==c.getSnapshotBeforeUpdate||(_=c.getSnapshotBeforeUpdate(d,f)),X(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,p,d,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=U.slice.call(e.childNodes)),c=(f=n.props||z).dangerouslySetInnerHTML,p=_.dangerouslySetInnerHTML,!s){if(f===z)for(f={},d=0;d<e.attributes.length;d++)f[e.attributes[d].name]=e.attributes[d].value;(p||c)&&(p&&c&&p.__html==c.__html||(e.innerHTML=p&&p.__html||""))}ee(e,_,f,i,s),t.__k=t.props.children,p||X(e,t,n,r,"foreignObject"!==t.type&&i,o,a,z,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=T.diffed)&&u(t)}catch(e){T.__e(e,t,n)}return t.__e}function oe(e,t){T.__c&&T.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){T.__e(e,t.__v)}}))}function ae(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){T.__e(e,n)}}function se(e,t,n){var r,i,o;if(T.unmount&&T.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||ae(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){T.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&se(r[o],t,n);null!=i&&B(i)}function le(e,t,n){return this.constructor(e,n)}function ue(e,t,n){var r,i,o;T.__&&T.__(e,t),i=(r=n===P)?null:n&&n.__k||t.__k,e=W(G,null,[e]),o=[],ie(t,(r?t:n||t).__k=e,i||z,z,void 0!==t.ownerSVGElement,n&&!r?[n]:i?null:U.slice.call(t.childNodes),o,n||z,r),oe(o,e)}function ce(e){var t={},n={__c:"__cC"+j++,__: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,Y(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}T={__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 Y(n.__E=n)}catch(t){e=t}throw e}},R=function(e){return null!=e&&void 0===e.constructor},q.prototype.setState=function(e,t){var n;n=this.__s!==this.state?this.__s:this.__s=V({},this.state),"function"==typeof e&&(e=e(n,this.props)),e&&V(n,e),null!=e&&this.__v&&(this.__e=!1,t&&this.__h.push(t),Y(this))},q.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Y(this))},q.prototype.render=G,N=[],E="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,P=z,j=0;var pe=Object.freeze({__proto__:null,render:ue,hydrate:function(e,t){ue(e,t,P)},createElement:W,h:W,Fragment:G,createRef:function(){return{}},get isValidElement(){return R},Component:q,cloneElement:function(e,t){return t=V(V({},e.props),t),arguments.length>2&&(t.children=U.slice.call(arguments,2)),J(e.type,t,t.key||e.key,t.ref||e.ref)},createContext:ce,toChildArray:$,_unmount:se,get options(){return T}}),de=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},fe=new Map;var _e=function(e){var t=fe.get(this);return t||(t=new Map,fe.set(this,t)),(t=de(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(W),me="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function he(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 ve(e){var t={exports:{}};return e(t,t.exports),t.exports}var ye=he(pe),ge=ve((function(e,t){var n=ye;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},p=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,p()},this.componentDidMount=function(){l.subscribe(p)},this.componentWillUnmount=function(){l.unsubscribe(p)},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 be(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 we(e,t){return(we=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function xe(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&&we(e,t)}function Ie(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ke(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?Ie(e):t}function Se(e){return(Se=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ce(){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 Oe(e,t,n){return(Oe=Ce()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&we(i,n.prototype),i}).apply(null,arguments)}function Me(e){var t="function"==typeof Map?new Map:void 0;return(Me=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 Oe(e,arguments,Se(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),we(r,e)})(e)}function Ae(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}var De=function(e){xe(n,Me(Error));var t=Ae(n);function n(e,r){var o;return i(this,n),(o=t.call(this,e)).name=o.constructor.name,o.statusCode=null==r?void 0:r.status,o.response=r,o}return n}(),Te=function(){var e=r(F.mark((function e(t){var n,r,i;return F.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 De(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 Re(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 Ne(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Re(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Re(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Ee=function e(t){var n=this;i(this,e),this.getTemplate=function(){var t=r(F.mark((function t(r){var i,o;return F.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,be(i.toString()).then((function(e){return Te(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)}}(),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()},this.getTemplateStep=function(){var t=r(F.mark((function t(r){var i,o;return F.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,be(i.toString()).then((function(e){return Te(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)}}(),this.verifyOAuth=function(){var t=r(F.mark((function t(r){var i,o;return F.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,be(i.toString(),{method:"POST"}).then(Te);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)}}(),this.deleteAuth=function(){var t=r(F.mark((function t(r){var i,o;return F.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,be(i.toString(),{method:"DELETE"}).then((function(e){return Te(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)}}(),this.callDynamicDataEndpoint=function(){var t=r(F.mark((function t(r){var i,o,a=arguments;return F.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,Ne({app_key:n.config.appKey,hash:n.config.hash,user_id:n.config.userId},i)),t.prev=2,t.next=5,be(r.toString()).then((function(e){return Te(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)}}(),this.getTemplateListing=function(){var t=r(F.mark((function t(r){var i,o;return F.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,be(i.toString()).then((function(e){return Te(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)}}(),this.saveIntegration=function(){var t=r(F.mark((function t(r){var i,o;return F.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,be(i.toString(),{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}}).then((function(e){return Te(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)}}(),this.updateIntegration=function(){var t=r(F.mark((function t(r,i){var o,a;return F.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,be(o.toString(),{method:"PUT",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}).then((function(e){return Te(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)}}(),this.deleteIntegration=function(){var t=r(F.mark((function t(r){var i,o;return F.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,be(i.toString(),{method:"DELETE"}).then((function(e){return Te(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)}}(),this.toggleIntegration=function(){var t=r(F.mark((function t(r,i){var o,a;return F.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,be(o.toString(),{method:"PUT"}).then((function(e){return Te(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)}}(),this.getIntegrationStatuses=function(){var t=r(F.mark((function t(r){var i,o;return F.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,be(i.toString(),{method:"PUT",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}}).then(Te);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 Le(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 Pe(e,t){if(e){if("string"==typeof e)return Le(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)?Le(e,t):void 0}}function je(e){return function(e){if(Array.isArray(e))return Le(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Pe(e)||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 Fe(){return(Fe=r(F.mark((function e(t,n){var r,i,o,a,s;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(r=function(e){return new Uint8Array(je(unescape(encodeURIComponent(e))).map((function(e){return e.charCodeAt(0)})))})(n),o=r(t),e.next=5,crypto.subtle.importKey("raw",i,{name:"HMAC",hash:"SHA-256"},!0,["sign"]);case 5:return a=e.sent,e.next=8,crypto.subtle.sign("HMAC",a,o);case 8:return s=e.sent,e.abrupt("return",je(new Uint8Array(s)).map((function(e){return e.toString(16).padStart(2,"0")})).join(""));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ze(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 Ue(e,t){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,t)||Pe(e,t)||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.")}()}Ee.addUrlSearchParams=function(e,t){return Object.keys(t).map((function(n){return t[n]&&e.searchParams.append(n,"".concat(t[n]))}))};var He,Ve,Be,We=[],Je=T.__r,Ge=T.diffed,qe=T.__c,Ke=T.unmount;function Qe(e){T.__h&&T.__h(Ve);var t=Ve.__H||(Ve.__H={t:[],u:[]});return e>=t.t.length&&t.t.push({}),t.t[e]}function Ye(e){return function(e,t,n){var r=Qe(He++);return r.__c||(r.__c=Ve,r.i=[n?n(t):ot(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}(ot,e)}function Ze(e,t){var n=Qe(He++);it(n.o,t)&&(n.i=e,n.o=t,Ve.__H.u.push(n))}function Xe(e){return $e((function(){return{current:e}}),[])}function $e(e,t){var n=Qe(He++);return it(n.o,t)?(n.o=t,n.v=e,n.i=e()):n.i}function et(e){var t=Ve.context[e.__c];if(!t)return e.__;var n=Qe(He++);return null==n.i&&(n.i=!0,t.sub(Ve)),t.props.value}function tt(){We.some((function(e){e.__P&&(e.__H.u.forEach(nt),e.__H.u.forEach(rt),e.__H.u=[])})),We=[]}function nt(e){e.m&&e.m()}function rt(e){var t=e.i();"function"==typeof t&&(e.m=t)}function it(e,t){return!e||t.some((function(t,n){return t!==e[n]}))}function ot(e,t){return"function"==typeof t?t(e):t}function at(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 st(e,t,n){return t&&at(e.prototype,t),n&&at(e,n),e}T.__r=function(e){Je&&Je(e),He=0,(Ve=e.__c).__H&&(Ve.__H.u.forEach(nt),Ve.__H.u.forEach(rt),Ve.__H.u=[])},T.diffed=function(e){Ge&&Ge(e);var t=e.__c;if(t){var n=t.__H;n&&n.u.length&&(1!==We.push(t)&&Be===T.requestAnimationFrame||((Be=T.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);"undefined"!=typeof window&&(t=requestAnimationFrame(n))})(tt))}},T.__c=function(e,t){t.some((function(e){e.__h.forEach(nt),e.__h=e.__h.filter((function(e){return!e.i||rt(e)}))})),qe&&qe(e,t)},T.unmount=function(e){Ke&&Ke(e);var t=e.__c;if(t){var n=t.__H;n&&n.t.forEach((function(e){return e.m&&e.m()}))}};var lt=["message"],ut=F.mark(xt),ct=F.mark(It);function pt(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 dt(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 dt(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 dt(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 ft(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 _t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?ft(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ft(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function mt(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}var ht=function(e){xe(n,Me(TypeError));var t=mt(n);function n(e,r){var o,a;i(this,n);var s=e.message,l=ze(e,lt),u=e.path,c=0===u.length?s:"At path: "+u.join(".")+" -- "+s;return o=t.call(this,c),Object.assign(Ie(o),l),o.name=o.constructor.name,o.failures=function(){var t;return null!=(t=a)?t:a=[e].concat(je(r()))},o}return n}();function vt(e){return yt(e)&&"function"==typeof e[Symbol.iterator]}function yt(e){return"object"===o(e)&&null!=e}function gt(e){return"string"==typeof e?JSON.stringify(e):""+e}function bt(e){var t=e.next(),n=t.done,r=t.value;return n?void 0:r}function wt(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: `"+gt(r)+"`":u;return _t(_t({value:r,type:a,refinement:l,key:i[i.length-1],path:i,branch:o},e),{},{message:c})}}function xt(e,t,n,r){var i,o,a,s;return F.wrap((function(l){for(;;)switch(l.prev=l.next){case 0:vt(e)||(e=[e]),i=pt(e),l.prev=2,i.s();case 4:if((o=i.n()).done){l.next=12;break}if(a=o.value,!(s=wt(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()}}),ut,null,[[2,14,17,20]])}function It(e,t){var n,r,i,o,a,s,l,u,c,p,d,f,_,m,h,v,y,g,b,w,x,I,k,S,C,O,M,A,D=arguments;return F.wrap((function(T){for(;;)switch(T.prev=T.next){case 0:if(n=D.length>2&&void 0!==D[2]?D[2]:{},r=n.path,i=void 0===r?[]:r,o=n.branch,a=void 0===o?[e]:o,s=n.coerce,l=void 0!==s&&s,u=n.mask,c=void 0!==u&&u,p={path:i,branch:a},l&&(e=t.coercer(e,p),c&&"type"!==t.type&&yt(t.schema)&&yt(e)&&!Array.isArray(e)))for(d in e)void 0===t.schema[d]&&delete e[d];f=!0,_=pt(t.validator(e,p)),T.prev=6,_.s();case 8:if((m=_.n()).done){T.next=15;break}return h=m.value,f=!1,T.next=13,[h,void 0];case 13:T.next=8;break;case 15:T.next=20;break;case 17:T.prev=17,T.t0=T.catch(6),_.e(T.t0);case 20:return T.prev=20,_.f(),T.finish(20);case 23:v=pt(t.entries(e,p)),T.prev=24,v.s();case 26:if((y=v.n()).done){T.next=53;break}g=Ue(y.value,3),b=g[0],w=g[1],x=g[2],I=It(w,x,{path:void 0===b?i:[].concat(je(i),[b]),branch:void 0===b?a:[].concat(je(a),[w]),coerce:l,mask:c}),k=pt(I),T.prev=30,k.s();case 32:if((S=k.n()).done){T.next=43;break}if(!(C=S.value)[0]){T.next=40;break}return f=!1,T.next=38,[C[0],void 0];case 38:T.next=41;break;case 40:l&&(w=C[1],void 0===b?e=w:e instanceof Map?e.set(b,w):e instanceof Set?e.add(w):yt(e)&&(e[b]=w));case 41:T.next=32;break;case 43:T.next=48;break;case 45:T.prev=45,T.t1=T.catch(30),k.e(T.t1);case 48:return T.prev=48,k.f(),T.finish(48);case 51:T.next=26;break;case 53:T.next=58;break;case 55:T.prev=55,T.t2=T.catch(24),v.e(T.t2);case 58:return T.prev=58,v.f(),T.finish(58);case 61:if(!f){T.next=80;break}O=pt(t.refiner(e,p)),T.prev=63,O.s();case 65:if((M=O.n()).done){T.next=72;break}return A=M.value,f=!1,T.next=70,[A,void 0];case 70:T.next=65;break;case 72:T.next=77;break;case 74:T.prev=74,T.t3=T.catch(63),O.e(T.t3);case 77:return T.prev=77,O.f(),T.finish(77);case 80:if(!f){T.next=83;break}return T.next=83,[void 0,e];case 83:case"end":return T.stop()}}),ct,null,[[6,17,20,23],[24,55,58,61],[30,45,48,51],[63,74,77,80]])}var kt=function(){function e(t){var n=this;i(this,e);var r=t.type,o=t.schema,a=t.validator,s=t.refiner,l=t.coercer,u=void 0===l?function(e){return e}:l,c=t.entries,p=void 0===c?F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})):c;this.type=r,this.schema=o,this.entries=p,this.coercer=u,this.validator=a?function(e,t){return xt(a(e,t),t,n,e)}:function(){return[]},this.refiner=s?function(e,t){return xt(s(e,t),t,n,e)}:function(){return[]}}return st(e,[{key:"assert",value:function(e){return St(e,this)}},{key:"create",value:function(e){return function(e,t){var n=Ct(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!Ct(e,t)[0]}(e,this)}},{key:"mask",value:function(e){return function(e,t){var n=Ct(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 Ct(e,this,t)}}]),e}();function St(e,t){var n=Ct(e,t);if(n[0])throw n[0]}function Ct(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=It(e,t,n),i=bt(r);if(i[0]){var o=new ht(i[0],F.mark((function e(){var t,n,i;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=pt(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 Ot(e,t){return new kt({type:e,schema:null,validator:t})}function Mt(e){return new kt({type:"array",schema:e,entries:F.mark((function t(n){var r,i,o,a,s;return F.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e||!Array.isArray(n)){t.next=18;break}r=pt(n.entries()),t.prev=2,r.s();case 4:if((i=r.n()).done){t.next=10;break}return o=Ue(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: "+gt(e)}})}function At(){return Ot("boolean",(function(e){return"boolean"==typeof e}))}function Dt(){return Ot("date",(function(e){return e instanceof Date&&!isNaN(e.getTime())||"Expected a valid `Date` object, but received: "+gt(e)}))}function Tt(e){return new kt(_t(_t({},e),{},{validator:function(t,n){return null===t||e.validator(t,n)},refiner:function(t,n){return null===t||e.refiner(t,n)}}))}function Rt(){return Ot("number",(function(e){return"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+gt(e)}))}function Nt(e){var t=e?Object.keys(e):[],n=Ot("never",(function(){return!1}));return new kt({type:"object",schema:e||null,entries:F.mark((function r(i){var o,a,s,l,u,c,p;return F.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e||!yt(i)){r.next=37;break}o=new Set(Object.keys(i)),a=pt(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=pt(o),r.prev=21,u.s();case 23:if((c=u.n()).done){r.next=29;break}return p=c.value,r.next=27,[p,i[p],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 yt(e)||"Expected an object, but received: "+gt(e)},coercer:function(e){return yt(e)?_t({},e):e}})}function Et(e){return new kt(_t(_t({},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 Lt(){return Ot("string",(function(e){return"string"==typeof e||"Expected a string, but received: "+gt(e)}))}function Pt(e,t,n){return new kt(_t(_t({},e),{},{refiner:function(e){var t=F.mark(n);function n(n,r){var i=arguments;return F.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}(F.mark((function r(i,o){var a,s,l,u,c;return F.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=xt(a,o,e,i),l=pt(s),r.prev=4,l.s();case 6:if((u=l.n()).done){r.next=12;break}return c=u.value,r.next=10,_t(_t({},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 jt=ce(null);function Ft(e,t){for(var n in t)e[n]=t[n];return e}var zt={stepState:{steps:[],currentStep:{type:"CONFIRMATION"},stepIndex:0,showValidation:!1,allStepsCompleted:!1},genericData:{bundleId:null,templateId:null,templateApp:null,isPreviewMode:!1},stepMapping:{},stepDataMapping:{},parentChildMapping:{}};function Ut(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 Ht(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Ut(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ut(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Vt=function(t){return{setSteps:function(t,n){var r=[];return n.forEach((function(t){if(t.hide_authorization||r.push({stepId:t.id,title:"Connect ".concat(t.activity.app.name),iconUrl:t.activity.app.icon_url,isCompleted:!1,isCurrentlyOpen:!1,type:"AUTH",requiredFields:[t.id],invalidFields:e({},t.id,""),isValid:!1}),t.is_visible&&t.template_fields.length>0){var n=t.template_fields.filter((function(e){return e.is_visible})).length>0,i=t.template_fields.filter((function(e){return e.is_required&&e.is_visible})).map((function(e){return e.id})),o=t.template_fields.filter((function(e){return e.is_required&&!e.default_value})).reduce((function(t,n){return Ht(Ht({},t),{},e({},n.id,""))}),{}),a=!(Object.keys(o).length>0);n&&r.push({stepId:t.id,title:t.title,iconUrl:t.activity.app.icon_url,isCompleted:!1,isCurrentlyOpen:!1,type:"CONFIGURATION",requiredFields:i,invalidFields:o,isValid:a})}})),Ht(Ht({},t),{},{stepState:{steps:r,currentStep:r[0],stepIndex:0,showValidation:!1,allStepsCompleted:!1}})},showStepValidationState:function(e){return{stepState:Ht(Ht({},e.stepState),{},{showValidation:!0})}},hideStepValidationState:function(e){return{stepState:Ht(Ht({},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],i=Ht(Ht({},t.steps[e.stepState.stepIndex]),{},{isCompleted:!0});return r?{stepState:Ht(Ht({},t),{},{steps:[].concat(je(t.steps.slice(0,t.stepIndex)),[i],je(t.steps.slice(t.stepIndex+1))),currentStep:Ht({},r),stepIndex:n,showValidation:!1})}:{stepState:Ht(Ht({},t),{},{steps:[].concat(je(t.steps.slice(0,t.stepIndex)),[i],je(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:Ht(Ht({},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:Ht(Ht({},e.stepState),{},{currentStep:n.steps[o],stepIndex:o,allStepsCompleted:!1})}}return r||"CONFIRMATION"!==i?e:{stepState:Ht(Ht({},n),{},{currentStep:{type:"CONFIRMATION"},stepIndex:n.steps.length,allStepsCompleted:!0})}},gotoStep:function(e,t){var n=e.stepState,r=n.stepIndex;if(n){var i=n.steps[r],o=n.steps[t];if(e.genericData.isPreviewMode)return t===n.steps.length?{stepState:Ht(Ht({},n),{},{currentStep:{type:"CONFIRMATION"},stepIndex:n.steps.length,allStepsCompleted:!0})}:{stepState:Ht(Ht({},e.stepState),{},{currentStep:Ht({},o),stepIndex:t,allStepsCompleted:!1})};if(n.allStepsCompleted&&t===n.steps.length)return{stepState:Ht(Ht({},n),{},{currentStep:{type:"CONFIRMATION"},stepIndex:n.steps.length,allStepsCompleted:!0})};if(i&&i.isValid&&r===n.steps.length-1&&t===n.steps.length){var a=Ht(Ht({},n.steps[r]),{},{isCompleted:!0});return{stepState:Ht(Ht({},n),{},{steps:[].concat(je(n.steps.slice(0,r)),[a],je(n.steps.slice(r+1))),currentStep:{type:"CONFIRMATION"},stepIndex:t,allStepsCompleted:!0})}}if(o&&o.isCompleted)return{stepState:Ht(Ht({},e.stepState),{},{currentStep:Ht({},o),stepIndex:t,showValidation:!o.isValid})};if(i&&i.isValid&&t===r+1){var s=Ht(Ht({},n.steps[r]),{},{isCompleted:!0});return{stepState:Ht(Ht({},e.stepState),{},{steps:[].concat(je(n.steps.slice(0,r)),[s],je(n.steps.slice(r+1))),currentStep:Ht({},o),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:Ht(Ht({},e.stepState),{},{currentStep:Ht(Ht({},e.stepState.currentStep),{},{isValid:r})})}},getStepState:function(){return t.getState().stepState},setGenericData:function(e,t){return{genericData:Ht(Ht({},e.genericData),t)}},setTemplateApp:function(e,t){return{genericData:Ht(Ht({},e.genericData),{},{templateApp:{name:t.name,iconUrl:t.iconUrl}})}},setStepMapping:function(t,n){var r=n.reduce((function(n,r){var i,o,a,s;return Ht(Ht({},n),{},e({},r.id,{step:r,authorizations:null!==(i=null===(o=r.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:!1}})))&&void 0!==i?i:[],isAuthVerified:!1,selectedAuthId:r.hide_authorization||t.genericData.isPreviewMode?null!==(a=null===(s=r.authorization_type.authorizations[0])||void 0===s?void 0:s.id)&&void 0!==a?a:"":r.step_authorization||t.stepMapping[r.id]?t.stepMapping[r.id].selectedAuthId:""}))}),{}),i=n.reduce((function(n,r){return Ht(Ht({},n),{},e({},r.id,Ht(Ht({},t.stepDataMapping[r.id]),r.template_fields.reduce((function(n,i){var o;return Ht(Ht({},n),{},e({},i.id,{fieldId:i.id,value:!i.is_visible||i.default_value?i.default_value:t.stepDataMapping[r.id]&&t.stepDataMapping[r.id][i.id]&&t.stepDataMapping[r.id][i.id].value||"",machineName:null===(o=i.activity_field)||void 0===o?void 0:o.machine_name,isRequired:i.is_required,isVisible:i.is_visible}))}),{}))))}),{});return{stepMapping:Ht(Ht({},t.stepMapping),r),stepDataMapping:Ht(Ht({},t.stepDataMapping),i),genericData:Ht(Ht({},t.genericData),{},{templateApp:{name:n.length>0?n[0].activity.app.name:"",iconUrl:n.length>0?n[0].activity.app.icon_url:""}})}},setActivityOutputData:function(e,t){return Ht(Ht({},e),{},{activityOutputData:t.activityOutputData})},setDynamicFieldData:function(t,n){return Ht(Ht({},t),{},{dynamicFieldData:Object.keys(n.dynamicFieldData).reduce((function(t,r){return Ht(Ht({},t),{},e({},"{".concat(r,"}"),n.dynamicFieldData[r]))}),{})})},setParentChildMapping:function(t,n){var r=n.reduce((function(n,r){return Ht(Ht({},n),{},e({},r.id,Ht(Ht({},t.parentChildMapping[r.id]),r.template_fields.reduce((function(t,n){var r,i,o,a,s;return n.activity_field?Ht(Ht({},t),{},e({},null===(r=n.activity_field)||void 0===r?void 0:r.machine_name,{fieldId:n.id,childFields:null!==(i=n.activity_field)&&void 0!==i&&i.child_fields?JSON.parse(null===(o=n.activity_field)||void 0===o?void 0:o.child_fields):null,parentFields:null!==(a=n.activity_field)&&void 0!==a&&a.parent_fields?JSON.parse(null===(s=n.activity_field)||void 0===s?void 0:s.parent_fields):null})):t}),{}))))}),{});return{parentChildMapping:Ht(Ht({},t.parentChildMapping),r)}},addAuthorization:function(t,n){var r=n.stepId,i=n.authData;return{stepMapping:Ht(Ht({},t.stepMapping),{},e({},r,Ht(Ht({},t.stepMapping[r]),{},{authorizations:[].concat(je(t.stepMapping[r].authorizations),[i])})))}},removeAuthorization:function(t,n){var r=n.stepId,i=n.authId;return{stepMapping:Ht(Ht({},t.stepMapping),{},e({},r,Ht(Ht({},t.stepMapping[r]),{},{authorizations:t.stepMapping[r].authorizations.filter((function(e){return e.authorizationId!==i}))})))}},toggleVerifyAuthorizationFlag:function(t,n){var r=n.stepId,i=n.authId,o=n.isVerifying,a=t.stepMapping[r].authorizations.findIndex((function(e){return e.authorizationId===i}));return{stepMapping:Ht(Ht({},t.stepMapping),{},e({},r,Ht(Ht({},t.stepMapping[r]),{},{authorizations:[].concat(je(t.stepMapping[r].authorizations.slice(0,a)),[Ht(Ht({},t.stepMapping[r].authorizations[a]),{},{isVerifying:o})],je(t.stepMapping[r].authorizations.slice(a+1)))})))}},toggleDeleteAuthorizationFlag:function(t,n){var r=n.stepId,i=n.authId,o=n.isDeleting,a=n.error,s=t.stepMapping[r].authorizations.findIndex((function(e){return e.authorizationId===i}));return{stepMapping:Ht(Ht({},t.stepMapping),{},e({},r,Ht(Ht({},t.stepMapping[r]),{},{authorizations:[].concat(je(t.stepMapping[r].authorizations.slice(0,s)),[Ht(Ht({},t.stepMapping[r].authorizations[s]),{},{isDeleting:o,error:a})],je(t.stepMapping[r].authorizations.slice(s+1)))})))}},setStepAuthId:function(t,n){var r=n.stepId,i=n.authId;return{stepMapping:Ht(Ht({},t.stepMapping),{},e({},r,Ht(Ht({},t.stepMapping[r]),{},{selectedAuthId:i})))}},setStepAuthorization:function(n,r,i,o,a){var s,l,u=n.stepState.steps[n.stepState.stepIndex],c=n.stepMapping[r],p=t.getState().stepState;if("CONFIRMATION"!==u.type&&"CONFIRMATION"!==(null===(s=p.currentStep)||void 0===s?void 0:s.type)&&(null===(l=p.currentStep)||void 0===l?void 0:l.stepId)===r){var d=u.invalidFields;o&&delete d[r];var f=Ht(Ht({},n.stepState.steps[n.stepState.stepIndex]),{},{invalidFields:d,isValid:Object.keys(d).length<1,isCompleted:null!==c.selectedAuthId||o}),_=n.stepMapping[r].authorizations.findIndex((function(e){return e.authorizationId===i}));return{stepState:Ht(Ht({},n.stepState),{},{steps:[].concat(je(n.stepState.steps.slice(0,n.stepState.stepIndex)),[f],je(n.stepState.steps.slice(n.stepState.stepIndex+1))),currentStep:f,showValidation:!o&&!c.selectedAuthId}),stepMapping:Ht(Ht({},n.stepMapping),{},e({},r,Ht(Ht({},n.stepMapping[r]),{},{selectedAuthId:o?i:n.stepMapping[r].selectedAuthId,authorizations:[].concat(je(n.stepMapping[r].authorizations.slice(0,_)),[Ht(Ht({},n.stepMapping[r].authorizations[_]),{},{isVerified:o,isVerifying:!1,didFetchStatus:!0,error:""})],je(n.stepMapping[r].authorizations.slice(_+1)))}))),stepDataMapping:Ht(Ht({},n.stepDataMapping),{},e({},r,Ht(Ht({},n.stepDataMapping[r]),a?a.reduce((function(t,i){return Ht(Ht({},t),{},e({},i,Ht(Ht({},n.stepDataMapping[r][i]),{},{value:""})))}),{}):{})))}}return n},resetCustomMappingData:function(t,n){var r,i=null===(r=t.stepMapping[n].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===r?void 0:r.id;if(i){var o=t.stepDataMapping[n][i];return o&&(o.objectValue={}),{stepDataMapping:Ht(Ht({},t.stepDataMapping),{},e({},n,Ht(Ht({},t.stepDataMapping[n]),{},e({},i,o))))}}return t},setStepFieldData:function(t,n){var r=n.stepId,i=n.fieldId,o=n.value,a=t.stepState.steps[t.stepState.stepIndex];if("CONFIRMATION"!==a.type){var s=a.invalidFields;delete s[i];var l=Ht(Ht({},t.stepState.steps[t.stepState.stepIndex]),{},{invalidFields:s,isValid:Object.keys(s).length<1});return{stepState:Ht(Ht({},t.stepState),{},{steps:[].concat(je(t.stepState.steps.slice(0,t.stepState.stepIndex)),[l],je(t.stepState.steps.slice(t.stepState.stepIndex+1))),currentStep:l}),stepDataMapping:Ht(Ht({},t.stepDataMapping),{},e({},r,Ht(Ht({},t.stepDataMapping[r]),{},e({},i,Ht(Ht({},t.stepDataMapping[r][i]),{},{value:o})))))}}return t},setStepMappingData:function(t,n){var r,i,o,a,s=null===(r=t.stepDataMapping[n.stepId][n.fieldId])||void 0===r?void 0:r.objectValue;n.value?i=Ht(Ht({},null!==(o=null===(a=t.stepDataMapping[n.stepId][n.fieldId])||void 0===a?void 0:a.objectValue)&&void 0!==o?o:{}),e({},n.id,n.value)):s&&(delete s[n.id],i=s,0===Object.keys(i).length&&(i=null));return{stepDataMapping:Ht(Ht({},t.stepDataMapping),{},e({},n.stepId,Ht(Ht({},t.stepDataMapping[n.stepId]),{},e({},n.fieldId,Ht(Ht({},t.stepDataMapping[n.stepId][n.fieldId]),{},{objectValue:i})))))}},reset:function(){return zt}}},Bt=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:Ft(Ft({},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}}}(zt))},Wt=Nt({id:Rt(),name:Lt(),description:Lt(),app:Nt({id:Rt(),name:Lt(),description:Lt(),icon_url:Lt(),color:Lt(),publishing_status:Lt(),category:Mt(Lt()),app_type:Et(Lt()),action_url:Tt(Et(Lt())),created_at:Et(Dt()),tags:Lt()}),branding_app:Nt({id:Rt(),name:Lt(),description:Lt(),icon_url:Lt(),color:Lt(),publishing_status:Lt(),category:Mt(Lt()),app_type:Et(Lt()),action_url:Tt(Et(Lt())),created_at:Et(Dt()),tags:Lt()}),button_text:Tt(Lt()),is_wizard:At(),publishing_status:Lt(),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 Pt(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+"`"}))}(Mt(Nt({id:Rt(),weight:Rt(),title:Lt(),is_visible:At(),activity:Nt({id:Rt(),name:Lt(),type:Lt(),endpoint:Lt(),auth_required:At(),total_fields:Rt(),app:Nt({id:Rt(),name:Lt(),description:Lt(),icon_url:Lt(),color:Lt(),publishing_status:Lt(),category:Mt(Lt()),app_type:Et(Lt()),action_url:Tt(Et(Lt())),created_at:Et(Dt()),tags:Lt()}),activity_output:Tt(Lt()),activity_output_url:Tt(Lt()),dynamic_field_data_endpoint:Tt(Lt())}),authorization_type:Nt({id:Rt(),type:Lt(),authorizations:Mt(Nt({id:Rt(),authorization_type:Lt(),app_user:Et(Rt()),app_user_id:Et(Rt()),disable_link:Et(Lt()),integration_count:Et(Rt()),user_identity:Lt()})),provider:Lt(),is_sandbox_enabled:At(),authorization_url_sandbox:Lt()}),template_fields:Mt(Nt({id:Rt(),is_required:At(),is_hidden:At(),default_value:Tt(Lt()),weight:Rt(),description:Lt(),summary:Tt(Lt()),placeholder:Tt(Lt()),activity_field:Tt(Nt({id:Rt(),machine_name:Lt(),type:Lt(),title:Lt(),description:Lt(),weight:Rt(),is_required:At(),child_fields:Tt(Lt()),is_dynamic:At(),data_src:Tt(Lt()),data_src_endpoint:Tt(Rt()),parent_fields:Tt(Lt()),dynamic_field_src:Tt(Lt()),default_value:Tt(Lt()),auto_machine_name:Lt(),dynamic_field_src_endpoint:Tt(Rt()),regex:Tt(Lt()),is_searchable:At()})),title:Tt(Lt()),type:Lt(),child_field:Tt(Lt()),child_field_value:Tt(Lt()),button_text:Tt(Lt()),icon_url:Tt(Lt()),long_description:Tt(Lt()),regex:Tt(Lt()),regex_msg:Tt(Lt()),is_visible:At()})),allow_multiple_authorizations:At(),step_authorization:Tt(Rt()),button_text:Tt(Lt()),is_self_step:At(),summary:Tt(Lt()),auth_description:Tt(Lt()),hide_authorization:At(),machine_name:Tt(Lt()),is_custom_machine_name:At()})),0,Number.POSITIVE_INFINITY)});function Jt(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 Gt,qt="styles-module_loader__2ufbr";Jt(".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 Kt=function(){return _e(Gt||(Gt=t(["\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'])),qt)};function Qt(e){return null!=e}var Yt,Zt,Xt,$t=ve((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}()})),en="styles-module_preact-hint__2fj-j",tn="styles-module_preact-hint__top__eUj7n",nn="styles-module_preact-hint__bottom__2goUI",rn="styles-module_preact-hint__content__23OpK";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 an(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?on(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):on(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function sn(e){var n=Xe(null),r=Ue(Ye(1e4),2),i=r[0],o=r[1],a=e.position;return Ze((function(){n.current&&o(n.current.getBoundingClientRect().width)}),[n]),_e(Yt||(Yt=t(['\n <div\n class="','"\n style=',"\n >\n <pre class="," ref=",">\n ","\n </pre\n >\n </div>\n "])),"".concat(en," ").concat("top"===a?tn:nn),an(an({},{left:e.targetBoundingRect.left-e.rootBoundingRect.left-i/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}),rn,n,e.template?e.template(e.content):e.content)}Jt(".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 ln,un=function(e){var n=e.position,r=void 0===n?"bottom":n,i=e.attribute,o=void 0===i?"data-hint":i,a=Ue(Ye(""),2),s=a[0],l=a[1],u=Ue(Ye(null),2),c=u[0],p=u[1],d=Ue(Ye(null),2),f=d[0],_=d[1],m=function(e,t){return $e((function(){return e}),t)}((function(t){p(t),c&&(c.addEventListener("mouseover",(function(e){e.target instanceof Element&&e.target.hasAttribute(o)&&(l(e.target.getAttribute(o)||""),_(e.target.getBoundingClientRect()))})),c.addEventListener("mouseout",(function(e){e.target instanceof Element&&e.target.hasAttribute(o)&&(l(""),_(null))})),e.dismissOnClick&&c.addEventListener("click",(function(){l(""),_(null)})))}),[c]);return _e(Zt||(Zt=t(["\n <div ref=",' style="position: relative">\n ',"\n ","\n </div>\n "])),m,s&&c&&f&&_e(Xt||(Xt=t([" <","\n content=","\n position=","\n template=","\n rootBoundingRect=","\n targetBoundingRect=","\n />"])),sn,s,r,e.template,null==c?void 0:c.getBoundingClientRect(),f),e.children)},cn="styles-module_button__osBYJ",pn="styles-module_buttonPrimary__1u5p2",dn="styles-module_disabled__CiT_f",fn="styles-module_buttonSecondary__2HV1m",_n="styles-module_buttonLink__39jcU";Jt(".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");var mn,hn=["label","type","color","backgroundColor","disabled","tooltip","dismissOnClick","position","onClick"];function vn(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"}(mn||(mn={}));var yn,gn,bn,wn=function(n){var r,i=n.label,o=n.type,a=void 0===o?mn.PRIMARY:o,s=n.color,l=void 0===s?null:s,u=n.backgroundColor,c=void 0===u?null:u,p=n.disabled,d=void 0!==p&&p,f=n.tooltip,_=n.dismissOnClick,m=void 0===_||_,h=n.position,v=void 0===h?"bottom":h,y=n.onClick,g=void 0===y?void 0:y,b=ze(n,hn);return _e(ln||(ln=t(["\n <"," dismissOnClick="," position=",'>\n <button\n type="button"\n onclick=',"\n data-hint=","\n class=","\n style=","\n ","\n >\n ","\n </button>\n <//>\n "])),un,m,v,g,f||null,$t(cn,(e(r={},pn,a===mn.PRIMARY),e(r,fn,a===mn.SECONDARY),e(r,_n,a===mn.LINK),e(r,dn,d),r)),{backgroundColor:a===mn.PRIMARY?c:null,borderColor:a===mn.PRIMARY?c:l,color:l},function(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?vn(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},b),i)},xn="styles-module_errorPageWrapper__BMBHQ",In="styles-module_errorTitle__1baLE",kn="styles-module_errorDescription__1dTc9",Sn="styles-module_errorContainer__3WprN",Cn="styles-module_errorPayload__OjsC-";Jt(".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 overflow-x: scroll;\n padding: 4px; }\n .styles-module_errorPageWrapper__BMBHQ .styles-module_errorPayload__OjsC- {\n margin: 0;\n padding: 8px 12px; }\n");var On,Mn,An,Dn,Tn,Rn=function(e){var n=e.title,r=e.description,i=e.errorPayload,o=e.onDismiss,a=void 0===o?null:o;return _e(yn||(yn=t(['\n <div class="','">\n <div class=',">","</div>\n <div class=",">","</div>\n ","\n ","\n </div>\n "])),xn,In,n,kn,r,i&&_e(gn||(gn=t(["\n <div class=",">\n <pre class=",">","</pre>\n <pre class=",">","</pre>\n </div>\n "])),Sn,Cn,i.message,Cn,i.stack),a&&_e(bn||(bn=t(["\n <div>\n <",' label="Dismiss" onClick='," />\n </div>\n "])),wn,a))},Nn="styles-module_navigation__2IuNI",En="styles-module_navItem__1kxtL",Ln="styles-module_navItemContent__28oLq",Pn="styles-module_imgContainer__wbjM4",jn="styles-module_arrow__3C8To",Fn="styles-module_active__28cMj",zn="styles-module_disabled__1Ltqi";function Un(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".styles-module_navigation__2IuNI {\n margin-bottom: 45px;\n display: flex;\n align-items: center;\n justify-content: center; }\n\n.styles-module_navItem__1kxtL {\n cursor: pointer;\n --tw-text-opacity: 1;\n color: rgba(31, 41, 55, var(--tw-text-opacity)); }\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: 500;\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: contain; }\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_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 Hn,Vn,Bn,Wn,Jn,Gn,qn,Kn,Qn=_e(On||(On=t([' <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>']))),Yn=_e(Mn||(Mn=t(['\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']))),Zn=function(e){xe(r,q);var n=Un(r);function r(){return i(this,r),n.apply(this,arguments)}return st(r,[{key:"render",value:function(){var e=this.props,n=e.logoUrl,r=e.isActive,i=void 0!==r&&r,o=e.isCompleted,a=void 0!==o&&o,s=e.isDisabled,l=void 0!==s&&s,u=e.isLastStep,c=void 0!==u&&u,p=e.onClick,d=void 0===p?function(){return null}:p;return _e(An||(An=t(["\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(En," ").concat(l?zn:""," ").concat(i?Fn:""),d,Ln,Pn,!a||i?_e(Dn||(Dn=t(["<img src="," />"])),n):Qn,c&&Yn,this.props.label,!c&&_e(Tn||(Tn=t(["\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 '])),jn))}}]),r}(),Xn=ge.connect("stepState",Vt)((function(e){var n=e.gotoStep,r=e.stepState,i=et(jt),o=function(e){n(e)},a=null==r?void 0:r.currentStep;return _e(Hn||(Hn=t(["\n <div class=",">\n ","\n ","\n </div>\n "])),Nn,r&&_e(Vn||(Vn=t(["\n ","\n "])),r.steps.map((function(e,n){return _e(Bn||(Bn=t([" <","\n label=","\n logoUrl=","\n isCompleted=","\n isActive=","\n isDisabled=","\n isLastStep=","\n onClick=","\n />"])),Zn,"CONFIRMATION"!==e.type?e.title:"Confirmation","CONFIRMATION"!==e.type&&e.iconUrl,!(null!=i&&i.isPreviewMode)&&e.isCompleted,"CONFIRMATION"!==(null==a?void 0:a.type)&&"CONFIRMATION"!==e.type&&r.stepIndex===n,(null==i?void 0:i.isPreviewMode)&&Number(null==r?void 0:r.stepIndex)!==n||Number(null==r?void 0:r.stepIndex)<n,n===(null==r?void 0:r.steps.length),(function(){return o(n)}))}))),r.steps.length>0&&_e(Wn||(Wn=t(["\n <",'\n label="Confirmation"\n logoUrl=""\n isCompleted=',"\n isActive=","\n isDisabled=","\n isLastStep=","\n onClick=","\n />\n "])),Zn,!0,void 0!==a&&(null==r?void 0:r.stepIndex)===(null==r?void 0:r.steps.length),void 0!==a&&(null==r?void 0:r.stepIndex)!==(null==r?void 0:r.steps.length),!0,(function(){var e;return o(null!==(e=null==r?void 0:r.steps.length)&&void 0!==e?e:0)})))})),$n="styles-module_radio__1wJfU",er="styles-module_button__3PLW1",tr="styles-module_text__Jq7I0",nr="styles-module_description__2UsHV";Jt(".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 rr,ir=function(e){var n=e.label,r=e.name,i=e.description,o=void 0===i?null:i,a=e.value,s=e.isChecked,l=void 0!==s&&s,u=e.handleChange,c=void 0===u?function(){return null}:u;return _e(Jn||(Jn=t(["\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 "])),$n,a,r,a,l,(function(e){if(e.currentTarget instanceof HTMLInputElement){var t=e.currentTarget.value;c(t)}}),a,er,_e(l?Gn||(Gn=t(['\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 '])):qn||(qn=t(['\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 ']))),tr,n,o&&_e(Kn||(Kn=t(["<div class=",">","</div>"])),nr,o))},or="styles-module_errorMessage__2b8A_";Jt(".styles-module_errorMessage__2b8A_ {\n margin-top: 4px;\n font-size: 12px;\n color: #f05c42; }\n");var ar,sr,lr,ur=function(e){var n=e.children;return _e(rr||(rr=t([" <div class=",">","</div> "])),or,n)},cr="styles-module_label__PbFlo",pr="styles-module_required__1XFqi";Jt(".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 dr=function(e){var n=e.title,r=e.description,i=e.isRequired,o=void 0!==i&&i;return _e(ar||(ar=t(["\n <div class=",">\n <label>\n <div>\n ","\n ","\n </div>\n ","\n </label>\n </div>\n "])),cr,n,o&&_e(sr||(sr=t(["<span class=",">*</span>"])),pr),r&&_e(lr||(lr=t(["<div>","</div>"])),r))},fr=function(){return!["undefined"==typeof window?"undefined":o(window),"undefined"==typeof document?"undefined":o(document)].includes("undefined")};var _r,mr,hr,vr,yr,gr,br,wr,xr,Ir,kr,Sr="styles-module_authSelectorWrap__34g8J",Cr="styles-module_rows__1gpAK",Or="styles-module_error__aL4zj",Mr="styles-module_checkboxRow__3Q67t",Ar="styles-module_statusWrap__3amIr",Dr="styles-module_deleteIcon__1mAJb",Tr="styles-module_status__OwFQa",Rr="styles-module_statusRed__1FG13",Nr="styles-module_statusOrange__1FNhi",Er="styles-module_statusGreen__1OD_4",Lr="styles-module_resend__To8qG";function Pr(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 jr=function(){return _e(_r||(_r=t(["\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'])),Lr)},Fr=function(e){var n=e.label,r=e.name,i=e.value,o=e.isChecked,a=e.status,s=void 0===a?"IDLE":a,l=e.isDeleting,u=void 0!==l&&l,c=e.handleChange,p=e.handleReverify,d=e.handleDelete,f=void 0===d?function(){return null}:d,_=e.error;return _e(mr||(mr=t(["\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 "])),Mr,ir,n,r,i,o,c,Ar,Tr,"VERIFYING"===s&&!u&&_e(hr||(hr=t(["<div class="," />\n Verifying <"," /> "])),Nr,Kt),"CONNECTED"===s&&!_&&!u&&_e(vr||(vr=t(["<div class="," />\n Connected"])),Er),"ERROR"===s&&!u&&_e(yr||(yr=t(["<div class="," />\n Failed\n <div onclick=","><"," /></div>"])),Rr,p,jr),u&&_e(gr||(gr=t(["<"," />"])),Kt),_&&!u&&!("VERIFYING"===s)&&_e(br||(br=t(["<div class=",">","</div>"])),Or,_),Dr,f,!("VERIFYING"===s||u)&&_e(wr||(wr=t(['\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 ']))))},zr=function(e){xe(r,q);var n=Pr(r);function r(e){var t;return i(this,r),(t=n.call(this,e)).verifyAuth=function(e){var n=t.props.stepId,r=t.props.stepMapping[n].authorizations[e];r&&(r.isVerified?t.props.onAuthSelected(r.authorizationId,!0):(t.props.toggleVerifyAuthorizationFlag({stepId:n,authId:r.authorizationId,isVerifying:!0}),t.setState({isLoading:!0}),t.props.apiHandler.verifyOAuth(r.authorizationId).then((function(e){e?t.props.onAuthSelected(r.authorizationId,!0):t.props.onAuthSelected(r.authorizationId,!1)})).catch((function(e){return console.error(e)})).finally((function(){t.props.toggleVerifyAuthorizationFlag({stepId:n,authId:r.authorizationId,isVerifying:!1}),t.setState({isLoading:!1})}))))},t.deleteAuth=function(e){var n=t.props.stepId,r=t.props.stepMapping[n].authorizations[e];t.props.toggleDeleteAuthorizationFlag({stepId:n,authId:r.authorizationId,isDeleting:!0,error:""}),t.props.apiHandler.deleteAuth(r.authorizationId).then((function(e){200===(null==e?void 0:e.status)?t.props.removeAuthorization({stepId:n,authId:r.authorizationId}):405===(null==e?void 0:e.status)?t.props.toggleDeleteAuthorizationFlag({stepId:n,authId:r.authorizationId,isDeleting:!1,error:"".concat(e.data)}):t.props.toggleDeleteAuthorizationFlag({stepId:n,authId:r.authorizationId,isDeleting:!1,error:"An unexpected error occurred"})})).catch((function(e){console.error(e)}))},t.onAuthResponseReceived=function(e){void 0!==e&&e.data.activity_name&&(console.info(e.data),t.props.stepId&&(e.data.already_exists?t.props.setStepAuthId({stepId:t.props.stepId,authId:Number(e.data.authorization_id)}):t.props.addAuthorization({stepId:t.props.stepId,authData:{authorizationId:e.data.authorization_id,userIdentity:e.data.user_identity,disableLink:"",authType:"",isVerified:!1,didFetchStatus:!1,isVerifying:!1,isDeleting:!1,error:""}})))},t.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},t.getError=function(){var e=t.props.stepId,n=t.props.stepMapping[e];return n.authorizations?"Please select a valid ".concat(n.step.activity.app.name," account"):"Please add a valid ".concat(n.step.activity.app.name," account")},t.openAuthWindow=function(){var e=t.props,n=e.stepMapping[e.stepId].step;n&&function(e,t,n,r,i){var o=n.top.outerHeight/2+n.top.screenY-i/2,a=n.top.outerWidth/2+n.top.screenX-r/2;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))}(t.context.apiHandler.getAuthUrl(n.authorization_type.id),"Auth Window",window,800,600)},t.state={isLoading:!1,fetched:!1},t}return st(r,[{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)}},{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,n=this.props,r=n.stepId,i=n.showErrors,o=void 0!==i&&i,a=this.props.stepMapping[r],s=a.authorizations;return _e(xr||(xr=t(["\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 "])),Sr,dr,"Select your ".concat(a.step.activity.app.name," account"),!0,Cr,s.map((function(n,r){return _e(Ir||(Ir=t(["<","\n label=","\n value=","\n status=","\n isChecked=","\n isDeleting=","\n error=","\n handleChange=","\n handleReverify=","\n handleDelete=","\n />"])),Fr,n.userIdentity,n.authorizationId,e.getAuthStatus(n),n.authorizationId===a.selectedAuthId,n.isDeleting,n.error,(function(){return e.verifyAuth(r)}),(function(){return e.verifyAuth(r)}),(function(){return e.deleteAuth(r)}))})),o?"".concat(Or):"",wn,(function(){return e.openAuthWindow()}),"Add ".concat(a.step.activity.app.name," account"),mn.SECONDARY,this.state.isLoading,o&&_e(kr||(kr=t(["<",">","<//>"])),ur,this.getError()))}}]),r}();zr.contextType=jt;var Ur=ge.connect(["stepMapping"],Vt)(zr);var Hr,Vr,Br="styles-module_listboxGroupWrapper__1Kt5M",Wr="styles-module_listbox__2x2uP",Jr="styles-module_customSelect__3d-hM",Gr="styles-module_open__2fBAx",qr="styles-module_customOptions__3iNrM",Kr="styles-module_customSelectTrigger__2MlIG",Qr="styles-module_selected__nLzUy",Yr="styles-module_error__2KcSW",Zr="styles-module_arrow__TPQOZ",Xr="styles-module_close__3wlz1",$r="styles-module_listboxItem__2jMpi";Jt(".styles-module_listboxGroupWrapper__1Kt5M fieldset {\n margin: 0;\n padding: 0;\n border: none; }\n\n.styles-module_listbox__2x2uP {\n position: relative;\n 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 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 ei,ti,ni,ri,ii,oi,ai,si,li,ui,ci,pi,di,fi,_i,mi,hi,vi,yi=function(e){var n=e.id,r=e.value,i=e.isSelected,o=e.onClick;return _e(Hr||(Hr=t(["\n <span\n class=","\n data-value=","\n onclick=","\n >\n ","\n ","\n </span>\n "])),"".concat($r," ").concat(i?Qr:""),n,o,i&&_e(Vr||(Vr=t(['\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 ']))),r)},gi=function(e){var n,r,i=e.title,o=e.description,a=e.items,s=void 0===a?[]:a,l=e.value,u=void 0===l?null:l,c=e.isOpen,p=void 0!==c&&c,d=e.isDynamic,f=void 0!==d&&d,_=e.endpointData,m=e.isRequired,h=void 0!==m&&m,v=e.placeholder,y=e.onChange,g=void 0===y?function(){return null}:y,b=e.showStepValidation,w=void 0!==b&&b,x=e.responseMapper,I=void 0===x?function(e){return e}:x,k=Ue(Ye(s),2),S=k[0],C=k[1],O=Ue(Ye(f&&!s.length&&!u),2),M=O[0],A=O[1],D=Ue(Ye(p),2),T=D[0],R=D[1],N=Xe();Ze((function(){var e=function(e){e.target instanceof HTMLElement&&(!n.current||n.current.contains(e.target))||r(e)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),function(){document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[n=N,r=function(){return T&&R(!1)}]),Ze((function(){var t=e.apiHandler,n=e.isDynamic,r=e.endpointUrl;if(n&&r){var i;A(!0);try{i=JSON.parse(_)}catch(e){i=""}t.callDynamicDataEndpoint(new URL(r),i).then((function(e){A(!1),e&&C(I(e))}))}}),[_]);var E=function(){R((function(e){return!e}))},L=$e((function(){var e=S.findIndex((function(e){return e.id===u}));return e>-1?S[e].value:""}),[S,u]);return _e(ei||(ei=t(["\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 "])),N,Br,i&&_e(ti||(ti=t(["\n <","\n title=","\n description=","\n isRequired=","\n />\n "])),dr,i,o,h),Wr,"".concat(Jr," ").concat(T?Gr:""),"".concat(Kr," ").concat(w&&!u&&h&&!T&&Yr),0,E,(function(e){"Enter"===e.key&&E()}),u&&Qr,M?_e(ni||(ni=t(["Loading"]))):_e(ri||(ri=t(["\n ","\n "])),S.length>0?_e(ii||(ii=t(["\n ","\n "])),u?_e(oi||(oi=t(["",""])),L):_e(ai||(ai=t(["",""])),v||"Please Select...")):_e(si||(si=t(["No options"])))),N,M?_e(li||(li=t(["<","><//>"])),Kt):_e(ui||(ui=t(["\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(Zr," ").concat(T?Xr:"")),qr,S.length>0&&!M&&_e(ci||(ci=t(["\n ","\n "])),S.map((function(e){return _e(pi||(pi=t(["\n <","\n key=","\n id=","\n value=","\n isSelected=","\n onClick=","\n ><//>\n "])),yi,e.id,e.id,e.value,u===e.id,(function(){g(e.id),R(!1)}))}))),w&&!u&&!T&&h&&_e(di||(di=t([" <",">Please select an option</",">"])),ur,ur))},bi="styles-module_checkboxWrap__JzZMA",wi="styles-module_checkbox__3mvqm",xi="styles-module_button__2oPQ0",Ii="styles-module_text__1AHNH",ki="styles-module_description__3Ox13";Jt(".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 Si,Ci=function(e){var n=e.label,r=e.name,i=e.description,o=void 0===i?null:i,a=e.value,s=e.isRequired,l=void 0!==s&&s,u=e.isChecked,c=void 0!==u&&u,p=e.showStepValidation,d=void 0!==p&&p,f=e.handleChange,_=void 0===f?function(){return null}:f;return _e(fi||(fi=t(["\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=",">","</div>\n ","\n </div>\n </label>\n </div>\n ","\n </div>\n "])),bi,wi,r,r,r,a,c,(function(e){if(e.target instanceof HTMLInputElement){var t=e.target,n=t.id,r=t.checked;_(n,r)}}),xi,_e(c?_i||(_i=t(['\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 '])):mi||(mi=t(['\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 ']))),Ii,n,o&&_e(hi||(hi=t(["<div class=",">","</div>"])),ki,o),d&&!a&&l&&_e(vi||(vi=t([" <",">Please select an option</",">"])),ur,ur))},Oi="styles-module_loader__1RKKC";Jt(".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 Mi,Ai,Di,Ti,Ri,Ni=function(){return _e(Si||(Si=t(["\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'])),Oi)},Ei="styles-module_selectWrapper__wU7p8";Jt(".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 box-sizing: border-box;\n padding-right: 10px;\n font-size: 12px;\n -webkit-appearance: none;\n appearance: none;\n padding: 8.5px 14px;\n border-radius: 4px;\n border: 1px solid #e2e0db;\n outline: none; }\n .styles-module_selectWrapper__wU7p8 select:focus {\n outline: none; }\n .styles-module_selectWrapper__wU7p8 svg {\n position: absolute;\n right: 10px;\n top: 13px; }\n");var Li,Pi,ji,Fi,zi,Ui,Hi,Vi=function(e){var n=e.placeholder,r=e.ariaLabel,i=e.value,o=e.options,a=void 0===o?[]:o,s=e.showUnselectedValue,l=void 0!==s&&s,u=e.unselectedText,c=void 0===u?"Select a value":u,p=e.isRequired,d=void 0!==p&&p,f=e.showStepValidation,_=void 0!==f&&f,m=e.onChange,h=void 0===m?function(){return null}:m;return _e(Mi||(Mi=t(["\n <div class=",">\n <select aria-label="," onchange=",">\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 "])),Ei,r,(function(e){if(e.currentTarget instanceof HTMLSelectElement){var t=e.currentTarget.value,n=a.findIndex((function(e){return"".concat(e.key)==="".concat(t)}));h(n)}}),l&&_e(Ai||(Ai=t([' <option value="">',"</option> "])),c),void 0===i&&_e(Di||(Di=t(['\n <option value="" disabled selected hidden>',"</option>\n "])),n),a.map((function(e){return _e(Ti||(Ti=t(["\n <option value="," selected=",">\n ","\n </option>\n "])),e.key,i===e.key,e.label)})),d&&!i&&_&&_e(Ri||(Ri=t(["<",">Please map this required field<//>"])),ur))},Bi="styles-module_mappingWrap__cU3_M",Wi="styles-module_mappingInfo__2Nvsw",Ji="styles-module_loader__3uPJj",Gi="styles-module_mappingRow__LbAkF",qi="styles-module_title__3EC37",Ki="styles-module_sampleData__ZpCR2",Qi="styles-module_selectBox__2gn7w",Yi="styles-module_mappingHeaderItem__3Ue0A";function Zi(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 Xi(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Zi(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zi(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}Jt(".styles-module_mappingWrap__cU3_M {\n margin-top: 1rem; }\n .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_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 padding-top: 15px;\n padding-bottom: 15px;\n font-size: 0.875rem;\n line-height: 1.25rem;\n height: 60px; }\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 .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 .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 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 overflow: hidden;\n text-overflow: ellipsis; }\n");var $i,eo,to=ge.connect(["stepState","genericData","stepMapping","activityOutputData","dynamicFieldData","stepDataMapping","parentChildMapping"],Vt)((function(n){var i,o,a=Ue(Ye(!1),2),s=a[0],l=a[1],u=Ue(Ye(!1),2),c=u[0],p=u[1],d=Ue(Ye(!1),2),f=d[0],_=d[1],m=Ue(Ye([]),2),h=m[0],v=m[1],y=Ue(Ye(""),2),g=y[0],b=y[1],w=et(jt),x=Xe(""),I=Xe([]);Ze((function(){h.length>0&&h.map((function(e){var t=n.stepDataMapping[n.stepId][e.fieldId];null!=t&&t.value&&(I.current=[].concat(je(I.current),[e.fieldId])),null!=t&&t.objectValue&&(I.current=[].concat(je(I.current),je(Array(Object.keys(t.objectValue).length).map((function(){return e.fieldId})))))}))}),[h]),Ze((function(){var t=n.templateFields.filter((function(e){return e.activity_field&&"DYNAMIC"===e.activity_field.type}))[0];t&&b("".concat(t.id));var r=n.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=n.parentChildMapping[n.stepId][t.activity_field.machine_name],a="";if(o){var s,u=null===(s=o.parentFields)||void 0===s?void 0:s.reduce((function(t,r){var i=n.parentChildMapping[n.stepId][r].fieldId;return Xi(Xi({},t),{},e({},i,n.stepDataMapping[n.stepId][i].value))}),{});a=JSON.stringify(u)}if(a!==x.current)l(!0),p(!0),_(!0),S(),null===(i=C(t))||void 0===i||i.then((function(e){l(!1),n.resetCustomMappingData(n.stepId),I.current=[],x.current=a,Array.isArray(e)&&v([].concat(je(r),je(e)))})).catch((function(e){return console.error(e)}))}}),[n.stepDataMapping[n.stepId]]);var k=function(t){var r=n.stepDataMapping[t];return Object.keys(r).filter((function(e){return r[Number(e)].value})).reduce((function(t,n){var i=r[Number(n)];return Xi(Xi({},t),{},e({},i.machineName,i.value))}),{})},S=function(){var e=r(F.mark((function e(){var t,r,i;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=n.stepState.steps[0].stepId,r=k(t),t&&("TRIGGER"!==(i=n.stepMapping[t].step).activity.type&&"QUERY"!==i.activity.type||(i.activity.activity_output_url?(p(!0),null==w||w.apiHandler.callDynamicDataEndpoint(new URL(i.activity.activity_output_url),Xi({authorization_id:"".concat(n.stepMapping[t].selectedAuthId)},r)).then((function(e){p(!1),e&&n.setActivityOutputData({activityOutputData:e})}))):p(!1),i.activity.dynamic_field_data_endpoint?(_(!0),null==w||w.apiHandler.callDynamicDataEndpoint(new URL(i.activity.dynamic_field_data_endpoint),Xi({authorization_id:"".concat(n.stepMapping[t].selectedAuthId)},r)).then((function(e){_(!1),e&&n.setDynamicFieldData({dynamicFieldData:e})}))):_(!1)));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),C=function(e){var t,r="".concat(null===(t=e.activity_field)||void 0===t?void 0:t.dynamic_field_src);return null==w?void 0:w.apiHandler.callDynamicDataEndpoint(new URL(r),Xi({authorization_id:"".concat(n.endpointData.authId)},n.endpointData.fieldsData))};return _e(Li||(Li=t(["\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 "])),dr,s||c||f?_e(Pi||(Pi=t(["<div class=","><"," /></div>"])),Ji,Ni):_e(ji||(ji=t(["\n <div class=",">\n <div class=",">\n <div class=",">\n <img src="," />\n <div>"," Field</div>\n </div>\n <div class=",">Sample Data</div>\n <div class=",">\n <img\n src=","\n />\n <div>\n ","\n </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 "])),Bi,Gi,Yi,null===(i=n.genericData.templateApp)||void 0===i?void 0:i.iconUrl,null===(o=n.genericData.templateApp)||void 0===o?void 0:o.name,Ki,Yi,n.stepMapping[n.stepId].step.activity.app.icon_url,"".concat(n.stepMapping[n.stepId].step.activity.app.name," Field"),h.map((function(e){var r,i,o,a=n.stepDataMapping[n.stepId][e.fieldId];return null!=a&&a.value&&(o=a.value.slice(1,-1)),_e(Fi||(Fi=t(["\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 "])),Gi,qi,e.title,(null==a?void 0:a.isRequired)&&_e(zi||(zi=t(["<span>*</span>"]))),Ki,n.dynamicFieldData&&(null==a?void 0:a.value)&&(null===(r=n.dynamicFieldData[null==a?void 0:a.value])||void 0===r?void 0:r.map((function(e){return e?_e(Ui||(Ui=t(["<pre>","</pre>"])),e):_e(Hi||(Hi=t([""])))}))),Qi,Vi,null===(i=n.activityOutputData)||void 0===i?void 0:i.map((function(e){return{key:e.value,label:e.text}})),o,null==a?void 0:a.isRequired,n.showStepValidation,!0,(function(t){return function(e,t){var r,i=null===(r=n.activityOutputData)||void 0===r?void 0:r[e];e<0?t.isNotDynamic?(I.current=I.current.filter((function(e){return e!==t.fieldId})),n.setStepFieldData({stepId:"".concat(n.stepId),fieldId:"".concat(t.fieldId),value:""})):g&&n.setStepMappingData({stepId:n.stepId,fieldId:Number(g),id:"".concat(t.id),value:null}):i&&(t.isNotDynamic?(I.current=[].concat(je(I.current),[t.fieldId]),n.setStepFieldData({stepId:"".concat(n.stepId),fieldId:"".concat(t.fieldId),value:"{".concat(i.value,"}")})):g&&(I.current=[].concat(je(I.current),[Number(g)]),n.setStepMappingData({stepId:n.stepId,fieldId:Number(g),id:"".concat(t.id),value:"{".concat(i.value,"}")})))}(t,e)}))})),Wi,I.current.length," ",1!==I.current.length?"s":"",h.length-I.current.length," ",h.length-I.current.length!=1?"s":""))})),no="styles-module_inputWrapper__1XBHY";Jt(".styles-module_inputWrapper__1XBHY {\n position: relative;\n width: 100%;\n padding-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,io,oo=function(e){var n=e.placeholder,r=e.value,i=e.type,o=void 0===i?"text":i,a=e.control,s=e.handleChange,l=void 0===s?function(){return null}:s;return _e($i||($i=t(["\n <div class=",">\n <input\n type=","\n placeholder=","\n value=","\n onkeyup=","\n />\n ","\n </div>\n "])),no,o,n,r,(function(e){if(e.currentTarget instanceof HTMLInputElement){var t=e.currentTarget.value;l(t)}}),a&&_e(eo||(eo=t(["<"," //>"])),a))},ao="styles-module_inputGroupWrapper__FJc-g";Jt(".styles-module_inputGroupWrapper__FJc-g fieldset {\n padding: 0;\n margin: 0;\n border: none; }\n");var so=function(e){var n=e.title,r=e.description,i=e.placeholder,o=e.value,a=e.showStepValidation,s=void 0!==a&&a,l=e.isRequired,u=void 0!==l&&l,c=e.onChange,p=void 0===c?function(){return null}:c;return _e(ro||(ro=t(['\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 "])),ao,dr,n,r,oo,i,(function(e){p(e)}),o,s&&u&&_e(io||(io=t(["",">Please enter a value<//>"])),ur))};Jt(".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 width: 20px;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n margin: 0 auto; }\n .styles-module_dateGroupWrapper__cV-ne .styles-module_visibilityToggle__1l7Vl svg {\n cursor: pointer; }\n .styles-module_dateGroupWrapper__cV-ne .styles-module_visibilityToggle__1l7Vl svg:hover {\n opacity: 0.5; }\n");Jt(".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: 18px; }\n\n.styles-module_visibilityToggle__3_Kyp {\n display: flex;\n align-items: center;\n width: 10px;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n margin: 0 auto; }\n .styles-module_visibilityToggle__3_Kyp svg {\n cursor: pointer; }\n");var lo,uo,co,po,fo,_o,mo,ho,vo,yo,go,bo,wo,xo,Io=ve((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,p=c.apply,d=c.construct;p||(p=function(e,t,n){return e.apply(t,n)}),s||(s=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 f=I(Array.prototype.forEach),_=I(Array.prototype.pop),m=I(Array.prototype.push),h=I(String.prototype.toLowerCase),v=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 p(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 d(e,n)}}function S(e,t){n&&n(e,null);for(var i=t.length;i--;){var o=t[i];if("string"==typeof o){var a=h(o);a!==o&&(r(t)||(t[i]=a),o=a)}e[o]=!0}return e}function C(e){var n=u(null),r=void 0;for(r in e)p(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"]),A=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"]),D=s(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),T=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"]),N=s(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),E=s(["#text"]),L=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"]),P=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),U=l(/<%[\s\S]*|[\s\S]*%>/gm),H=l(/^data-[\-\w.\u00B7-\uFFFF]/),V=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),G="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 q(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},Q=function(e,t){if("object"!==(void 0===e?"undefined":G(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,p=void 0===c?e.NamedNodeMap||e.MozNamedAttrMap:c,d=e.Text,I=e.Comment,k=e.DOMParser,Z=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=Q(Z,n),oe=ie&&je?ie.createHTML(""):"",ae=r,se=ae.implementation,le=ae.createNodeIterator,ue=ae.createDocumentFragment,ce=ae.getElementsByTagName,pe=n.importNode,de={};try{de=C(r).documentMode?r.documentMode:{}}catch(e){}var fe={};t.isSupported="function"==typeof ne&&se&&void 0!==se.createHTMLDocument&&9!==de;var _e=z,me=U,he=H,ve=V,ye=W,ge=J,be=B,we=null,xe=S({},[].concat(q(M),q(A),q(D),q(R),q(E))),Ie=null,ke=S({},[].concat(q(L),q(P),q(j),q(F))),Se=null,Ce=null,Oe=!0,Me=!0,Ae=!1,De=!1,Te=!1,Re=!1,Ne=!1,Ee=!1,Le=!1,Pe=!0,je=!1,Fe=!0,ze=!0,Ue=!1,He={},Ve=null,Be=S({},["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=S({},["audio","video","img","source","image","track"]),Ge=null,qe=S({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ke="http://www.w3.org/1998/Math/MathML",Qe="http://www.w3.org/2000/svg",Ye="http://www.w3.org/1999/xhtml",Ze=Ye,Xe=!1,$e=null,et=r.createElement("form"),tt=function(e){$e&&$e===e||(e&&"object"===(void 0===e?"undefined":G(e))||(e={}),e=C(e),we="ALLOWED_TAGS"in e?S({},e.ALLOWED_TAGS):xe,Ie="ALLOWED_ATTR"in e?S({},e.ALLOWED_ATTR):ke,Ge="ADD_URI_SAFE_ATTR"in e?S(C(qe),e.ADD_URI_SAFE_ATTR):qe,We="ADD_DATA_URI_TAGS"in e?S(C(Je),e.ADD_DATA_URI_TAGS):Je,Ve="FORBID_CONTENTS"in e?S({},e.FORBID_CONTENTS):Be,Se="FORBID_TAGS"in e?S({},e.FORBID_TAGS):{},Ce="FORBID_ATTR"in e?S({},e.FORBID_ATTR):{},He="USE_PROFILES"in e&&e.USE_PROFILES,Oe=!1!==e.ALLOW_ARIA_ATTR,Me=!1!==e.ALLOW_DATA_ATTR,Ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=e.SAFE_FOR_TEMPLATES||!1,Te=e.WHOLE_DOCUMENT||!1,Ee=e.RETURN_DOM||!1,Le=e.RETURN_DOM_FRAGMENT||!1,Pe=!1!==e.RETURN_DOM_IMPORT,je=e.RETURN_TRUSTED_TYPE||!1,Ne=e.FORCE_BODY||!1,Fe=!1!==e.SANITIZE_DOM,ze=!1!==e.KEEP_CONTENT,Ue=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||be,Ze=e.NAMESPACE||Ye,De&&(Me=!1),Le&&(Ee=!0),He&&(we=S({},[].concat(q(E))),Ie=[],!0===He.html&&(S(we,M),S(Ie,L)),!0===He.svg&&(S(we,A),S(Ie,P),S(Ie,F)),!0===He.svgFilters&&(S(we,D),S(Ie,P),S(Ie,F)),!0===He.mathMl&&(S(we,R),S(Ie,j),S(Ie,F))),e.ADD_TAGS&&(we===xe&&(we=C(we)),S(we,e.ADD_TAGS)),e.ADD_ATTR&&(Ie===ke&&(Ie=C(Ie)),S(Ie,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&S(Ge,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(Ve===Be&&(Ve=C(Ve)),S(Ve,e.FORBID_CONTENTS)),ze&&(we["#text"]=!0),Te&&S(we,["html","head","body"]),we.table&&(S(we,["tbody"]),delete Se.tbody),s&&s(e),$e=e)},nt=S({},["mi","mo","mn","ms","mtext"]),rt=S({},["foreignobject","desc","title","annotation-xml"]),it=S({},A);S(it,D),S(it,T);var ot=S({},R);S(ot,N);var at=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:Ye,tagName:"template"});var n=h(e.tagName),r=h(t.tagName);if(e.namespaceURI===Qe)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===Qe?"math"===n&&rt[r]:Boolean(ot[n]);if(e.namespaceURI===Ye){if(t.namespaceURI===Qe&&!rt[r])return!1;if(t.namespaceURI===Ke&&!nt[r])return!1;var i=S({},["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(Ee||Le)try{st(n)}catch(e){}else try{n.setAttribute(e,"")}catch(e){}},ut=function(e){var t=void 0,n=void 0;if(Ne)e="<remove></remove>"+e;else{var i=v(e,/^[\r\n\t ]+/);n=i&&i[0]}var o=ie?ie.createHTML(e):e;if(Ze===Ye)try{t=(new k).parseFromString(o,"text/html")}catch(e){}if(!t||!t.documentElement){t=se.createDocument(Ze,"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),Ze===Ye?ce.call(t,Te?"html":"body")[0]:Te?t.documentElement:a},ct=function(e){return le.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},pt=function(e){return!(e instanceof d||e instanceof I||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof p&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},dt=function(e){return"object"===(void 0===a?"undefined":G(a))?e instanceof a:e&&"object"===(void 0===e?"undefined":G(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),pt(e))return st(e),!0;if(v(e.nodeName,/[\u0080-\uFFFF]/))return st(e),!0;var r=h(e.nodeName);if(ft("uponSanitizeElement",e,{tagName:r,allowedTags:we}),!dt(e.firstElementChild)&&(!dt(e.content)||!dt(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]||Se[r]){if(ze&&!Ve[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)?(De&&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&&!Ce[t]&&w(he,t));else if(Oe&&w(ve,t));else{if(!Ie[t]||Ce[t])return!1;if(Ge[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(Ae&&!w(ye,y(n,ge,"")));else if(n)return!1}return!0},ht=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=h(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{De&&(r=y(r,_e," "),r=y(r,me," "));var p=e.nodeName.toLowerCase();if(mt(p,i,r))try{c?e.setAttributeNS(c,u,r):e.setAttribute(u,r),_(t.removed)}catch(e){}}}ft("afterSanitizeAttributes",e,null)}},vt=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),ht(n));ft("afterSanitizeShadowDOM",t,null)};return t.sanitize=function(r,o){var s=void 0,l=void 0,u=void 0,c=void 0,p=void 0;if((Xe=!r)&&(r="\x3c!--\x3e"),"string"!=typeof r&&!dt(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"===G(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof r)return e.toStaticHTML(r);if(dt(r))return e.toStaticHTML(r.outerHTML)}return r}if(Re||tt(o),t.removed=[],"string"==typeof r&&(Ue=!1),Ue);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(!Ee&&!De&&!Te&&-1===r.indexOf("<"))return ie&&je?ie.createHTML(r):r;if(!(s=ut(r)))return Ee?null:oe}s&&Ne&&st(s.firstChild);for(var d=ct(Ue?r:s);u=d.nextNode();)3===u.nodeType&&u===c||_t(u)||(u.content instanceof i&&vt(u.content),ht(u),c=u);if(c=null,Ue)return r;if(Ee){if(Le)for(p=ue.call(s.ownerDocument);s.firstChild;)p.appendChild(s.firstChild);else p=s;return Pe&&(p=pe.call(n,p,!0)),p}var f=Te?s.outerHTML:s.innerHTML;return De&&(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=h(e),i=h(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()}()})),ko="styles-module_stepsWrap__1Yzhl",So="styles-module_stepWrap__eLO77";function Co(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(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Co(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Co(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Mo(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".styles-module_stepsWrap__1Yzhl {\n width: 100%; }\n\n.styles-module_stepWrap__eLO77 {\n margin-bottom: 30px; }\n");var Ao,Do,To,Ro,No,Eo,Lo,Po,jo,Fo,zo,Uo,Ho,Vo,Bo,Wo,Jo,Go=function(n){xe(o,q);var r=Mo(o);function o(t){var n;return i(this,o),(n=r.call(this,t)).getVisibleFieldsDataOnRootStep=function(){var t=n.props.stepDataMapping[n.props.step.id];return Object.keys(t).filter((function(e){return t[Number(e)].value})).reduce((function(n,r){var i=t[Number(r)];return Oo(Oo({},n),{},e({},i.machineName,i.value))}),{})},n.areParentValuesFilled=function(e,t){for(var r=!0,i=0;i<t.length;i+=1){var o=t[i],a=n.props.parentChildMapping[e][o].fieldId,s=n.props.stepDataMapping[e]&&n.props.stepDataMapping[e][a];if(!s||!s.value){r=!1;break}}return r},n.doParentFieldsHaveValues=function(e,t){var r=!0,i=n.props.parentChildMapping[e][t];if(i&&i.parentFields)for(var o=0;o<i.parentFields.length;o+=1){var a=n.props.parentChildMapping[e][i.parentFields[o]],s=n.props.stepDataMapping[e]&&n.props.stepDataMapping[e][a.fieldId];if(!s||!s.value){r=!1;break}}return r},n.shouldShowStep=function(e){var t=n.props.step.id,r=n.props.stepMapping&&n.props.stepMapping[t];if("BUTTON"===e.type||"HTML"===e.type)return!0;if(r&&e.activity_field){var i=!e.is_hidden,o=r.selectedAuthId,a=n.props.parentChildMapping[t][e.activity_field.machine_name].parentFields,s=!0;return a&&(s=n.areParentValuesFilled(t,a)),i&&o&&s}return!1},n.stepIsOfType=function(e){var t=n.props.step.id,r=n.props.stepMapping&&n.props.stepMapping[t];return e.indexOf(r.step.activity.type)>-1},n.textFieldParentHasValues=function(){var e=n.props.step.id,t=n.props.stepMapping&&n.props.stepMapping[e],r=t.step.template_fields.filter((function(e){return e.is_visible})),i=t.selectedAuthId,o=r.filter((function(e){return e.activity_field&&"DYNAMIC"===e.activity_field.type}))[0];return!o||!!(r.length>0&&o&&o.activity_field&&i&&n.doParentFieldsHaveValues(e,o.activity_field.machine_name))},n.shouldShowMapping=function(){var e=n.props.step.id,t=n.props.stepMapping&&n.props.stepMapping[e];if(n.stepIsOfType(["ADAPTER","ACTION"])){var r=t.step.template_fields.filter((function(e){return e.is_visible})),i=t.selectedAuthId,o=r.filter((function(e){return e.activity_field&&"DYNAMIC"===e.activity_field.type}))[0];if(!o)return!1;if(r.length>0&&i&&o&&o.activity_field&&n.doParentFieldsHaveValues(e,o.activity_field.machine_name))return!0}return!1},n.getMappingDataInput=function(){var e=n.props.step.id;return{authId:(n.props.stepMapping&&n.props.stepMapping[e]).selectedAuthId,fieldsData:n.getVisibleFieldsDataOnRootStep()}},n.fieldDynamicData=function(t){var r=n.props.step.id;if(n.props.stepMapping&&n.props.stepMapping[r]&&t.activity_field){var i=n.props.parentChildMapping[r][t.activity_field.machine_name].parentFields;if(i){var o=n.props.parentChildMapping[r][i[0]].fieldId;if(o)return e({},i[0],n.props.stepDataMapping[r][o].value)}}return null},n.state={loading:!1},n}return st(o,[{key:"componentDidMount",value:function(){this.props.verifyStepValidity(this.props.step.id)}},{key:"render",value:function(){var e=this,n=this.props,r=n.step,i=n.stepMapping,o=n.stepDataMapping,a=n.setStepFieldData,s=n.showStepValidation,l=i[r.id]&&i[r.id].step,u=o&&o[r.id];return _e(lo||(lo=t(["\n ","\n "])),this.state.loading?_e(uo||(uo=t(["<"," //>"])),Kt):_e(co||(co=t(["\n ","\n "])),l?_e(po||(po=t(["\n <div class=",">\n ","\n ","\n </div>\n "])),ko,l.template_fields.map((function(n){var i;if(e.shouldShowStep(n)&&n.activity_field)switch(n.activity_field.type){case"SELECT":return _e(fo||(fo=t(["\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 "])),So,gi,n.activity_field.id,e.props.apiHandler,n.title||n.activity_field.title,n.description||n.activity_field.description,s,n.placeholder,n.is_required,u&&u[n.id]&&u[n.id].value||"",(function(t){a({stepId:"".concat(r.id),fieldId:"".concat(n.id),value:t}),e.props.verifyStepValidity(r.id)}),n.activity_field.data_src,n.activity_field.is_dynamic,JSON.stringify(Oo({authorization_id:e.props.stepMapping&&(null===(i=e.props.stepMapping[e.props.step.id])||void 0===i?void 0:i.selectedAuthId)},e.fieldDynamicData(n))));case"TEXTFIELD":return!e.shouldShowMapping()&&e.textFieldParentHasValues()&&_e(_o||(_o=t(["\n <div class=",">\n <","\n id=","\n title=","\n description=","\n value=","\n placeholder=","\n showStepValidation=","\n isRequired=","\n onChange=","\n ><//>\n </div>\n "])),So,so,n.activity_field.id,n.title||n.activity_field.title,n.description||n.activity_field.description,u&&u[n.id]&&u[n.id].value||"",n.placeholder||"Please enter a value",s,n.is_required,(function(t){a({stepId:"".concat(r.id),fieldId:"".concat(n.id),value:t}),e.props.verifyStepValidity(r.id)}));case"CHECKBOX":return _e(mo||(mo=t(["\n <","\n title=","\n isRequired=","\n />\n <","\n label=","\n name=","\n value=","\n isChecked=","\n isRequired=","\n showStepValidation=","\n handleChange=","\n />\n "])),dr,n.title||n.activity_field.title,n.is_required,Ci,n.activity_field.description,n.activity_field.machine_name,u&&u[n.id]&&u[n.id].value,u&&u[n.id]&&u[n.id].value,n.is_required,s,(function(t,i){a({stepId:"".concat(r.id),fieldId:"".concat(n.id),value:i}),e.props.verifyStepValidity(r.id)}));case"DYNAMIC":return _e(ho||(ho=t([""])));default:return _e(vo||(vo=t(["<div>\n Field: "," is currently not\n supported\n </div>"])),n.activity_field.type)}else switch(n.type){case"HTML":return _e(yo||(yo=t(['\n <div\n style="margin-bottom: 2rem;"\n dangerouslySetInnerHTML=',"\n />\n "])),{__html:Io(window).sanitize(n.default_value)});case"BUTTON":return _e(go||(go=t(['\n <div style="margin-bottom: 2rem;">\n <'," label="," />\n </div>\n "])),wn,n.title)}return _e(bo||(bo=t([""])))})),this.shouldShowMapping()&&_e(wo||(wo=t(["\n <div class=",">\n <","\n stepId=","\n templateFields=","\n showStepValidation=","\n endpointData=","\n ><//>\n </div>\n "])),So,to,l.id,l.template_fields,s,this.getMappingDataInput())):_e(xo||(xo=t(["Step data could not be loaded"])))))}}]),o}(),qo=ge.connect(["stepMapping","stepDataMapping","parentChildMapping"],Vt)(Go),Ko="styles-module_stepsWrap__3VIDN",Qo="styles-module_stepInfo__nU7A7",Yo="styles-module_header__2GDea",Zo="styles-module_name__h_9E1",Xo="styles-module_steps__1tZbw",$o="styles-module_stepContainer__1DBMw",ea="styles-module_top__JXVEL",ta="styles-module_bottom__2g7TT",na="styles-module_buttons__2hBh9",ra="styles-module_save__1LVOi",ia="styles-module_authWrap__em0DI";function oa(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 width: 100%;\n flex: 1 1 0%;\n padding-top: 50px; }\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 font-size: 14px;\n color: #8c8c8c;\n padding-bottom: 30px; }\n\n.styles-module_authWrap__em0DI {\n margin-bottom: 30px;\n width: 100%;\n max-width: 75%; }\n");var aa=function(e){xe(r,q);var n=oa(r);function r(e){var t;return i(this,r),(t=n.call(this,e)).createIntegration=function(){var e=t.props,n=e.stepMapping,r=e.stepDataMapping;if(!t.context.isPreviewMode){t.setState({loading:!0});var i={name:"My new integration",notification_email:"",template:Number(t.props.genericData.templateId),bundle_id:Number(t.props.genericData.bundleId),steps:Object.keys(n).map((function(e){return{id:n[e].step.id,authorization:Number(n[e].selectedAuthId),template_step:n[e].step.id,app_user_data:n[e].step.template_fields.map((function(t){return{id:t.id,value:!r[n[e].step.id][t.id].value&&""!==r[n[e].step.id][t.id].value||r[n[e].step.id][t.id].objectValue?JSON.stringify(r[n[e].step.id][t.id].objectValue):"".concat(r[n[e].step.id][t.id].value),template_field:t.id}}))}}))};t.context.apiHandler.saveIntegration(i).then((function(e){t.setState({loading:!1}),t.context.eventEmitter.emit("did-save-integration",{integrationId:e.id,name:e.name,templateId:e.template,status:e.status})})).catch((function(e){return console.error(e)}))}},t.handleAuthSelected=function(e,n,r){var i=t.props.stepMapping[n].step.template_fields.filter((function(e){return e.activity_field&&e.activity_field.is_dynamic})).map((function(e){return e.id}));t.props.setStepAuthorization(n,e,r,i)},t.state={loading:!1,selectedAuthStep:null},t}return st(r,[{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,n,r,i,o,a,s,l,u,c,p,d=this,f=null,_=this.props,m=_.stepState,h=_.stepMapping,v=m.currentStep,y=m.stepIndex,g=m.steps,b=!1,w=!1,x=!1,I=!1;y>-1&&"CONFIRMATION"!==(null==v?void 0:v.type)?(f=h[Number(null==v?void 0:v.stepId)],b=!1,w=m.stepIndex>0,x=null!==(p=null==v?void 0:v.isValid)&&void 0!==p&&p,I=m.showValidation):"CONFIRMATION"===(null==v?void 0:v.type)&&y===g.length&&(b=!0);return _e(Ao||(Ao=t(["\n <div class=",">\n <div class=",">\n <div class=",">\n ","\n </div>\n\n <div class=",'>\n <div style="padding-left: 35px; padding-right: 35px; width: 100%;">\n ',"\n </div>\n </div>\n ","\n </div>\n </div>\n "])),Ko,$o,Qo,v&&_e(Do||(Do=t(["\n ","\n "])),b?_e(To||(To=t(["\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>Confirmation</div>\n </div>\n <div class=',">\n ","\n </div>\n </div>\n "])),Yo,Zo,Xo,"Step ".concat((null!==(e=null===(n=this.props.stepState)||void 0===n?void 0:n.stepIndex)&&void 0!==e?e:0)+1," / ").concat((null!==(r=null===(i=this.props.stepState)||void 0===i?void 0:i.steps.length)&&void 0!==r?r:0)+1)):_e(Ro||(Ro=t(["\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 "])),Yo,Zo,null===(o=f)||void 0===o?void 0:o.step.activity.app.icon_url,"CONFIRMATION"!==(null==v?void 0:v.type)&&(null==v?void 0:v.title),Xo,"Step ".concat((null!==(a=null===(s=this.props.stepState)||void 0===s?void 0:s.stepIndex)&&void 0!==a?a:0)+1," / ").concat((null!==(l=null===(u=this.props.stepState)||void 0===u?void 0:u.steps.length)&&void 0!==l?l:0)+1))),ea,v?_e(No||(No=t(["\n ","\n "])),b?_e(Eo||(Eo=t(["\n <div class=",">\n Your integration is ready to be enabled. Click\n “Save” to continue.\n </div>\n "])),ra):_e(Lo||(Lo=t(["\n ","\n "])),f&&_e(Po||(Po=t(["\n ","\n "])),"AUTH"===(null==v?void 0:v.type)?_e(jo||(jo=t(["\n <div class=",">\n <","\n stepId=","\n apiHandler=","\n showErrors=","\n onAuthSelected=","\n >\n <//>\n </div>\n "])),ia,Ur,f.step.id,this.context.apiHandler,I,(function(e,t){var n;return d.handleAuthSelected(e,Number(null===(n=f)||void 0===n?void 0:n.step.id),t)})):_e(Fo||(Fo=t(["\n <","\n step=","\n stepType=","\n showStepValidation=","\n apiHandler=","\n eventEmitter=","\n />\n "])),qo,null===(c=f)||void 0===c?void 0:c.step,null==v?void 0:v.type,I,this.context.apiHandler,this.context.eventEmitter)))):_e(zo||(zo=t(["This template has no configured steps"]))),v&&_e(Uo||(Uo=t(["\n <div class=",">\n <div class=",">\n ","\n ","\n </div>\n </div>\n "])),ta,na,w&&_e(Ho||(Ho=t(["\n <",'\n label="Back"\n onClick=',"\n type=","\n ><//>\n "])),wn,(function(){return d.props.gotoPreviousStep()}),mn.SECONDARY),b?_e(Vo||(Vo=t(["\n ","\n "])),this.state.loading?_e(Bo||(Bo=t(["<"," />"])),Kt):_e(Wo||(Wo=t(["\n <",'\n label="Save"\n disabled=',"\n tooltip=","\n onClick=","\n ><//>\n "])),wn,this.context.isPreviewMode,this.context.isPreviewMode?'Integration setup will have to be\ndone in "Live View"':null,(function(){return d.createIntegration()}))):_e(Jo||(Jo=t(["\n <",'\n label="Next"\n disabled=',"\n onClick=","\n ><//>\n "])),wn,!x,(function(){return x?d.props.gotoNextStep():d.props.showStepValidationState()}))))}}]),r}();aa.contextType=jt;var sa,la,ua,ca,pa,da,fa,_a=ge.connect(["stepState","genericData","stepMapping","stepDataMapping"],Vt)(aa),ma="styles-module_wrap__2ZgZ0",ha="styles-module_main__11gFF";Jt(".styles-module_wrap__2ZgZ0 {\n position: relative;\n width: 100%;\n max-width: 730px; }\n\n.styles-module_main__11gFF {\n width: 100%;\n line-height: 1; }\n");var va,ya=["steps"],ga=ge.connect([""],Vt)((function(e){var n,r=Ue(Ye(!1),2),i=r[0],o=r[1],a=Ue(Ye(null),2),s=a[0],l=a[1],u=e.templateId,c=e.bundleId,p=e.customWrapper,d=e.templatePreviewData,f=e.previewMetadata,_=Ue(Ye(null),2),m=_[0],h=_[1],v=Ue(function(e){var t=Qe(He++),n=Ye();return t.i=e,Ve.componentDidCatch||(Ve.componentDidCatch=function(e){t.i&&t.i(e),n[1](e)}),[n[0],function(){n[1](void 0)}]}((function(){})),2),y=v[0],g=v[1],b=et(jt);return Ze((function(){return function(){e.reset()}}),[]),Ze((function(){y&&console.error(y)}),[y]),Ze((function(){if(o(!0),null!=b&&b.isPreviewMode&&f){if(!d)throw new Error("Preview data was not provided");try{St(d,Wt)}catch(e){return console.error(e),o(!1),void h(e)}var t=d.steps,n=ze(d,ya);return l(d),e.setGenericData({templateId:Number(n.id),bundleId:Number(c),isPreviewMode:b.isPreviewMode}),e.setSteps(t.filter(Qt)),e.setStepMapping(t.filter(Qt)),e.setParentChildMapping(t.filter(Qt)),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(n){n&&(o(!1),e.setSteps(n.filter(Qt)),e.setStepMapping(n.filter(Qt)),e.setParentChildMapping(n.filter(Qt)),e.setGenericData({templateId:Number(u),bundleId:Number(c)}),b.eventEmitter.emit("did-load-template",{templateId:Number(u),templateTitle:t.name,templateDescription:t.description}))})).catch((function(e){return console.error(e)}))}))}),[u]),p?_e(sa||(sa=t(["",""])),p):_e(la||(la=t(['\n <div class="'," ",'">\n ',"\n </div>\n "])),ma,"integry-container",y||m?_e(ua||(ua=t(["\n <","\n title=","\n description=","\n errorPayload=","\n onDismiss=","\n />\n "])),Rn,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):_e(ca||(ca=t(["\n <div>\n ","\n </div>\n <div class=",">\n ","\n ","\n </div>\n "])),!i&&s&&_e(pa||(pa=t(["\n <","\n steps=","\n ><//>\n "])),Xn,null===(n=s.steps)||void 0===n?void 0:n.map((function(e){return{label:e.title,logoUrl:e.activity.app.icon_url}}))),ha,i&&_e(da||(da=t(['<div style="display: flex; justify-content: center;">\n <'," />\n </div>"])),Kt),!i&&s&&_e(fa||(fa=t([" <"," steps=","><//> "])),_a,s.steps)))})),ba=ve((function(e){var t,n;t=me,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 p=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},d=p();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,p=0,m=0,h=t.length;if(n&&n.keys)for(var v=n.scoreFn||l,y=n.keys,g=y.length,b=h-1;b>=0;--b){for(var w=t[b],x=new Array(g),I=g-1;I>=0;--I)(C=u(w,S=y[I]))?(c(C)||(C=_.getPrepared(C)),x[I]=s(e,C,i)):x[I]=null;x.obj=w;var k=v(x);null!==k&&(k<o||(x.score=k,p<a?(d.add(x),++p):(++m,k>d.peek().score&&d.replaceTop(x))))}else if(n&&n.key){var S=n.key;for(b=h-1;b>=0;--b)(C=u(w=t[b],S))&&(c(C)||(C=_.getPrepared(C)),null!==(O=s(e,C,i))&&(O.score<o||(O={target:O.target,_targetLowerCodes:null,_nextBeginningIndexes:null,score:O.score,indexes:O.indexes,obj:w},p<a?(d.add(O),++p):(++m,O.score>d.peek().score&&d.replaceTop(O)))))}else for(b=h-1;b>=0;--b){var C,O;(C=t[b])&&(c(C)||(C=_.getPrepared(C)),null!==(O=s(e,C,i))&&(O.score<o||(p<a?(d.add(O),++p):(++m,O.score>d.peek().score&&d.replaceTop(O)))))}if(0===p)return r;var M=new Array(p);for(b=p-1;b>=0;--b)M[b]=d.poll();return M.total=p+m,M},goAsync:function(t,n,i){var o=!1,a=new Promise((function(a,s){if(!t)return a(r);var d=(t=_.prepareSearch(t))[0],m=p(),h=n.length-1,v=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 p=Date.now();if(i&&i.keys)for(var f=i.scoreFn||l,I=i.keys,k=I.length;h>=0;--h){for(var S=n[h],C=new Array(k),O=k-1;O>=0;--O)(D=u(S,A=I[O]))?(c(D)||(D=_.getPrepared(D)),C[O]=g(t,D,d)):C[O]=null;C.obj=S;var M=f(C);if(null!==M&&!(M<v)&&(C.score=M,b<y?(m.add(C),++b):(++w,M>m.peek().score&&m.replaceTop(C)),h%1e3==0&&Date.now()-p>=10))return void(e?setImmediate(x):setTimeout(x))}else if(i&&i.key){for(var A=i.key;h>=0;--h)if((D=u(S=n[h],A))&&(c(D)||(D=_.getPrepared(D)),null!==(T=g(t,D,d))&&!(T.score<v)&&(T={target:T.target,_targetLowerCodes:null,_nextBeginningIndexes:null,score:T.score,indexes:T.indexes,obj:S},b<y?(m.add(T),++b):(++w,T.score>m.peek().score&&m.replaceTop(T)),h%1e3==0&&Date.now()-p>=10)))return void(e?setImmediate(x):setTimeout(x))}else for(;h>=0;--h){var D,T;if((D=n[h])&&(c(D)||(D=_.getPrepared(D)),null!==(T=g(t,D,d))&&!(T.score<v)&&(b<y?(m.add(T),++b):(++w,T.score>m.peek().score&&m.replaceTop(T)),h%1e3==0&&Date.now()-p>=10)))return void(e?setImmediate(x):setTimeout(x))}if(0===b)return a(r);for(var R=new Array(b),N=b-1;N>=0;--N)R[N]=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,p=0;;){if(n===r[u]){if(i[p++]=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[(p=l)-1]+1;break}}l=0;var d=0,f=!1,m=0,h=t._nextBeginningIndexes;null===h&&(h=t._nextBeginningIndexes=_.prepareNextBeginningIndexes(t.target));var v=u=0===i[0]?0:h[i[0]-1];if(u!==s)for(;;)if(u>=s){if(l<=0){if(++d>o-2)break;if(e[d]===e[d+1])continue;u=v;continue}--l,u=h[a[--m]]}else if(e[0===d?l:d===l?l+1:d===l-1?l-1:l]===r[u]){if(a[m++]=u,++l===o){f=!0;break}++u}else u=h[u];if(f)var y=a,g=m;else y=i,g=p;for(var b=0,w=-1,x=0;x<o;++x)w!==(u=y[x])-1&&(b-=u),w=u;for(f?0!==d&&(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 p=!1,d=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[--d]]}else if(e[l]===r[u]){if(a[d++]=u,++l===o){p=!0;break}++u}else u=f[u];if(p)var m=a,h=d;else m=i,h=c;for(var v=0,y=-1,g=0;g<o;++g)y!==(u=m[g])-1&&(v-=u),y=u;for(p||(v*=1e3),v-=s-o,t.score=v,t.indexes=new Array(h),g=h-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()})),wa="styles-module_search__2j0G1",xa="styles-module_resultCount__12RMZ";function Ia(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 ka,Sa=function(e){xe(r,q);var n=Ia(r);function r(e){var t;return i(this,r),(t=n.call(this,e)).onInput=function(e){if(e.target instanceof HTMLInputElement){var n=e.target.value;t.setState({value:n}),t.props.onChange(n)}},t.state={value:t.props.initialValue||""},t}return st(r,[{key:"render",value:function(){return _e(va||(va=t(["\n <div class="," ",">\n <input\n placeholder=","\n value=","\n oninput=","\n />\n <div class=",">"," results</div>\n </div>\n "])),wa,"integry-search",this.props.placeholder||"Search...",this.state.value,this.onInput,xa,this.props.resultCount)}}]),r}(),Ca="styles-module_nav__bKw4L",Oa="styles-module_tab__3xQCg",Ma="styles-module_tabactive__2JeoG";Jt(".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 Aa,Da,Ta,Ra=function(e){var n=e.label,r=e.activeTab,i=e.onClick;return _e(ka||(ka=t(["\n <li\n class=","\n onclick=","\n >\n ","\n </li>\n "])),"".concat(Oa," ").concat(r===n?Ma:""),(function(){i(n)}),n)},Na=function(e){var n=e.preSelectedTab,r=e.children;if(!Array.isArray(r)||r.length<2)throw new Error("Tab Bar must have at least two children");var i=Ue(Ye(n||r[0].props.label),2),o=i[0],a=i[1],s=function(e){a(e)};return _e(Aa||(Aa=t(["\n <div>\n <ol class=",">\n ",'\n </ol>\n <div className="tab-content">\n ',"\n </div>\n </div>\n "])),Ca,r.map((function(e){var n=e.props.label;return _e(Da||(Da=t(["\n <","\n activeTab=","\n key=","\n label=","\n onClick=","\n >\n <//>\n "])),Ra,o,n,n,s)})),r.map((function(e){if(e.props.label===o)return e.props.children})))},Ea="styles-module_toggle__2c6vj",La="styles-module_inner__2w3FN",Pa="styles-module_toggled__3gmsw";Jt(".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 ja,Fa,za,Ua,Ha,Va=function(e){var n=e.id,r=e.value,i=e.onChange;return _e(Ta||(Ta=t(["\n <div class=",">\n <div class=",">\n <label for="," class=",'></label>\n <input type="checkbox" id='," onclick="," />\n </div>\n </div>\n "])),Ea,"".concat(La," ").concat(r?Pa:""," "),n,"".concat(r?Pa:""," "),n,(function(){i(!r)}))},Ba="styles-module_integrations__2vJT8",Wa="styles-module_integration__MtN8C",Ja="styles-module_header__1d_zB",Ga="styles-module_row__1UAlk",qa="styles-module_topbar__3TTLr";function Ka(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 Qa,Ya,Za=function(e){xe(r,q);var n=Ka(r);function r(){var e;return i(this,r),(e=n.apply(this,arguments)).toggleIntegration=function(t,n){e.props.apiHandler.toggleIntegration(t,n).then((function(e){console.info(e)})).catch((function(e){return console.error(e)}))},e.onIntegrationDelete=function(t){e.props.apiHandler.deleteIntegration(t).then((function(e){console.info(e)})).catch((function(e){return console.error(e)}))},e}return st(r,[{key:"render",value:function(){var e=this;return _e(ja||(ja=t(["\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 "])),qa,Ja,gi,[{id:"sort",value:"Sort"}],Ga,Ba,this.props.integrations.length<1&&_e(Fa||(Fa=t(["No integrations"]))),this.props.integrations.map((function(n){return _e(za||(za=t(['\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 '])),Wa,"integry_container_Integration",Ga,"fail"!==n.task_execution.status?_e(Ua||(Ua=t(['\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 ']))):_e(Ha||(Ha=t(['<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> ']))),n.icon_url,n.name,n.runs_count,n.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(n.task_execution.last_execution_at.date," ").concat(n.task_execution.last_execution_at.timezone))):"Never run",Va,n.id,"ACTIVE"===n.status,(function(t){return e.toggleIntegration(n.id,t)}),(function(){return e.onIntegrationDelete(n.id)}))})))}}]),r}();!function(e){e.MODAL="MODAL",e.INLINE="INLINE",e.DETACHED="DETACHED",e.CUSTOM="CUSTOM"}(Qa||(Qa={})),function(e){e.GRID="GRID",e.LIST="LIST"}(Ya||(Ya={}));var Xa,$a,es,ts,ns="styles-module_template_list__3HABS",rs="styles-module_template_grid__mH7-0",is="styles-module_header__cdTrS";function os(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 as,ss,ls,us,cs,ps=function(e){xe(r,q);var n=os(r);function r(){var e;return i(this,r),(e=n.call(this)).filterTemplates=function(t){t?e.setState({filteredTemplates:ba.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})},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 st(r,[{key:"componentDidMount",value:function(){var e=this;this.setState({loading:!0}),this.props.setGenericData({bundleId:Number(this.props.bundleId)}),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=this;return _e(Xa||(Xa=t(["\n <div>\n ","\n </div>\n "])),this.state.loading?_e($a||($a=t([" <"," //> "])),Kt):_e(es||(es=t(["\n <",'>\n <div label="Available Flows">\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="My Flows">\n <'," apiHandler=","\n integrations="," //>\n </div>\n <//>\n "])),Na,is,Sa,this.state.filteredTemplates.length,(function(t){return e.filterTemplates(t)}),this.props.layout===Ya.LIST?ns:rs,"integry-container_TemplatesView",this.state.filteredTemplates.map((function(n){return _e(ts||(ts=t(["\n <","\n name=","\n description=","\n layout=","\n tags=","\n imgUrl=","\n onClick=","\n >\n <//>\n "])),e.props.templateContainerTemplate,n.name,n.description,e.props.layout,n.branding_app.tags,n.branding_app.icon_url,(function(){return e.onTemplateClick(n.id)}))})),Za,this.props.apiHandler,this.state.integrations))}}],[{key:"handleClick",value:function(e){e.preventDefault(),e.target instanceof HTMLElement&&console.info(e.target.localName)}}]),r}(),ds=ge.connect("",Vt)(ps),fs="styles-module_navigation__2nFX8",_s="styles-module_navItem__ozaSU",ms="styles-module_navItemContent__3UHl8",hs="styles-module_imgContainer__c7lfR",vs="styles-module_active__1nm22",ys="styles-module_disabled__1JpJ1";function gs(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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: contain; }\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 bs,ws,xs,Is=_e(as||(as=t([' <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>']))),ks=_e(ss||(ss=t(['\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']))),Ss=function(e){xe(r,q);var n=gs(r);function r(){return i(this,r),n.apply(this,arguments)}return st(r,[{key:"render",value:function(){var e=this.props,n=e.logoUrl,r=e.isActive,i=void 0!==r&&r,o=e.isCompleted,a=void 0!==o&&o,s=e.isDisabled,l=void 0!==s&&s,u=e.isLastStep,c=void 0!==u&&u,p=e.onClick,d=void 0===p?function(){return null}:p;return _e(ls||(ls=t(["\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(_s," ").concat(l?ys:""," ").concat(i?vs:""),d,ms,hs,c?ks:_e(us||(us=t(["\n ","\n "])),!a||i?_e(cs||(cs=t(["<img src="," />"])),n):Is),this.props.label)}}]),r}();function Cs(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}var Os=function(e){xe(r,q);var n=Cs(r);function r(){var e;return i(this,r),(e=n.apply(this,arguments)).changeStep=function(t){e.props.gotoStep(t)},e}return st(r,[{key:"render",value:function(){var e,n=this,r=this.props.stepState,i=null==r?void 0:r.currentStep;return _e(bs||(bs=t(["\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 "])),fs,this.props.stepState&&_e(ws||(ws=t(["\n ","\n "])),null===(e=this.props.stepState)||void 0===e?void 0:e.steps.map((function(e,o){return _e(xs||(xs=t([" <","\n label=","\n logoUrl=","\n isCompleted=","\n isActive=","\n isDisabled=","\n isLastStep=","\n onClick=","\n />"])),Ss,"CONFIRMATION"!==e.type?e.title:"Confirmation","CONFIRMATION"!==e.type&&e.iconUrl,e.isCompleted,"CONFIRMATION"!==(null==i?void 0:i.type)&&"CONFIRMATION"!==e.type&&r.stepIndex===o,Number(null==r?void 0:r.stepIndex)<o,!1,(function(){return n.changeStep(o)}))}))),Ss,!0,void 0!==i&&(null==r?void 0:r.stepIndex)===(null==r?void 0:r.steps.length),void 0!==i&&(null==r?void 0:r.stepIndex)!==(null==r?void 0:r.steps.length),!0,(function(){var e;return n.changeStep(null!==(e=null==r?void 0:r.steps.length)&&void 0!==e?e:0)}))}}]),r}();Os.defaultProps={currentStepIndex:-1,completedTillIndex:-1};var Ms,As,Ds,Ts,Rs,Ns,Es,Ls,Ps,js,Fs,zs,Us,Hs=ge.connect("stepState",Vt)(Os),Vs={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 Bs(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 Ws=function(e){xe(r,q);var n=Bs(r);function r(e){var t;return i(this,r),(t=n.call(this,e)).createIntegration=function(){var e=t.props,n=e.stepMapping,r=e.stepDataMapping;console.info(n),t.setState({loading:!0});var i={name:"My new integration",notification_email:"",template:Number(t.props.genericData.templateId),bundle_id:Number(t.props.genericData.bundleId),steps:Object.keys(n).map((function(e){return{id:n[e].step.id,authorization:Number(n[e].selectedAuthId),template_step:n[e].step.id,app_user_data:n[e].step.template_fields.map((function(t){return{id:t.id,value:!r[n[e].step.id][t.id].value&&""!==r[n[e].step.id][t.id].value||r[n[e].step.id][t.id].objectValue?JSON.stringify(r[n[e].step.id][t.id].objectValue):"".concat(r[n[e].step.id][t.id].value),template_field:t.id}}))}}))};console.info(i),t.context.apiHandler.saveIntegration(i).then((function(e){console.info(e),t.setState({loading:!1})})).catch((function(e){return console.error(e)}))},t.handleAuthSelected=function(e,n,r){var i=t.props.stepMapping[n].step.template_fields.filter((function(e){return e.activity_field&&e.activity_field.is_dynamic})).map((function(e){return e.id}));t.props.setStepAuthorization(n,e,r,i)},t.state={loading:!1,selectedAuthStep:null},t}return st(r,[{key:"render",value:function(){var e,n,r,i,o,a=this,s=null,l=this.props.stepState,u=l.currentStep,c=l.stepIndex,p=l.steps,d=!1,f=!1,_=!1,m=!1;c>-1&&"CONFIRMATION"!==(null==u?void 0:u.type)?(s=this.props.stepMapping[Number(null==u?void 0:u.stepId)],d=!1,f=this.props.stepState.stepIndex>0,_=null!==(o=null==u?void 0:u.isValid)&&void 0!==o&&o,m=l.showValidation):"CONFIRMATION"===(null==u?void 0:u.type)&&c===p.length&&(d=!0);return _e(Ms||(Ms=t(["\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 "])),Vs.stepsWrap,Vs.stepsContainer,Hs,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,Vs.stepContainer,Vs.stepInfo,d?_e(As||(As=t(['\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 ']))):_e(Ds||(Ds=t(["\n \x3c!-- <img src="," />\n <div>","</div> --\x3e\n "])),null===(n=s)||void 0===n?void 0:n.step.activity.app.icon_url,null===(r=s)||void 0===r?void 0:r.step.title),Vs.top,d?_e(Ts||(Ts=t(["\n <div class=",">\n Your integration is ready to be enabled. Click “Save” to\n continue.\n </div>\n "])),Vs.save):_e(Rs||(Rs=t(["\n ","\n "])),s&&_e(Ns||(Ns=t(["\n ","\n "])),"AUTH"===(null==u?void 0:u.type)?_e(Es||(Es=t(["\n <div class=",">\n <","\n stepId=","\n apiHandler=","\n showErrors=","\n onAuthSelected=","\n >\n <//>\n </div>\n "])),Vs.stepWrap,Ur,s.step.id,this.context.apiHandler,m,(function(e,t){var n;return a.handleAuthSelected(e,Number(null===(n=s)||void 0===n?void 0:n.step.id),t)})):_e(Ls||(Ls=t(["\n <","\n step=","\n stepType=","\n showStepValidation=","\n apiHandler=","\n eventEmitter=","\n />\n "])),qo,null===(i=s)||void 0===i?void 0:i.step,null==u?void 0:u.type,m,this.context.apiHandler,this.context.eventEmitter))),Vs.bottom,Vs.buttons,f&&_e(Ps||(Ps=t(["\n <",'\n label="Back"\n onClick=',"\n type=","\n ><//>\n "])),wn,(function(){return a.props.gotoPreviousStep()}),mn.SECONDARY),d?_e(js||(js=t(["\n ","\n "])),this.state.loading?_e(Fs||(Fs=t(["<"," />"])),Kt):_e(zs||(zs=t(["\n <",'\n label="Save"\n onClick=',"\n ><//>\n "])),wn,(function(){return a.createIntegration()}))):_e(Us||(Us=t(["\n <",'\n label="Next"\n disabled=',"\n onClick=","\n ><//>\n "])),wn,!_,(function(){return _?a.props.gotoNextStep():a.props.showStepValidationState()})))}}]),r}();Ws.contextType=jt;var Js,Gs,qs,Ks=ge.connect(["stepState","genericData","stepMapping","stepDataMapping"],Vt)(Ws),Qs="styles-module_header__3p3k1",Ys="styles-module_name__2PDqJ",Zs="styles-module_description__39K41";function Xs(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 $s,el,tl,nl=function(e){xe(r,q);var n=Xs(r);function r(){var e;return i(this,r),(e=n.call(this)).state={loading:!0,template:null},e}return st(r,[{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(Qt)),e.props.setStepMapping(n.filter(Qt)),e.props.setParentChildMapping(n.filter(Qt)),e.props.setGenericData({templateId:Number(e.props.templateId)})})).catch((function(e){return console.error(e)}))})).catch((function(e){throw new Error(e)}))}},{key:"render",value:function(){var e=this.state.template;return _e(Js||(Js=t(["\n <div>\n ","\n </div>\n "])),this.state.loading?_e(Gs||(Gs=t(["<"," //>"])),Kt):_e(qs||(qs=t(["\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 "])),Qs,null==e?void 0:e.branding_app.icon_url,Ys,null==e?void 0:e.name,Zs,null==e?void 0:e.description,Ks,null==e?void 0:e.steps,this.props.apiHandler,this.props.eventEmitter))}}]),r}(),rl=ge.connect("",Vt)(nl),il="styles-module_name__3qMVY",ol="styles-module_description__2S97K",al="styles-module_tags__2fhyE",sl="styles-module_tag__26APx",ll="styles-module_template_list_view__jxmde",ul="styles-module_template_grid_view__WmHjg";function cl(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 pl,dl,fl=function(e){xe(r,q);var n=cl(r);function r(e){var t;return i(this,r),(t=n.call(this,e)).handleClick=function(){console.info(t.props.name)},t.state={templateName:t.props.name},t}return st(r,[{key:"render",value:function(){return _e($s||($s=t(["\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===Ya.LIST?ll:ul,"integry-container_Template",this.props.imgUrl,il,this.state.templateName,ol,this.props.description,this.props.tags.length>0&&_e(el||(el=t(["\n <div class=",">\n ","\n </div>\n "])),al,this.props.tags.split(",").map((function(e){return _e(tl||(tl=t([" <div class=",">","</div> "])),sl,e)}))))}}],[{key:"handleClick",value:function(e){e.preventDefault(),e.target instanceof HTMLElement&&console.info(e.target.localName)}}]),r}(),_l="styles-module_modal__3ImBF",ml="styles-module_open__AAUJ5",hl="styles-module_modalContainer__o6TKt",vl="styles-module_inset__-NimT",yl="styles-module_span__3nIVQ",gl="styles-module_contentWrap__2QGtd",bl="styles-module_content__3wdFn",wl="styles-module_close__2IqHP";function xl(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 Il,kl=function(e){xe(r,q);var n=xl(r);function r(){return i(this,r),n.apply(this,arguments)}return st(r,[{key:"render",value:function(){var e=this.props.isOpen;return _e(pl||(pl=t(["\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(_l," ").concat(e?"".concat(ml):""),hl,vl,yl,"".concat(gl," ").concat(e?"".concat(ml):""),bl,this.props.onClose,wl,this.props.isOpen&&_e(dl||(dl=t([" "," "])),this.props.children))}}]),r}(),Sl="styles-module_integry-container__3nnxM";function Cl(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 Ol=function(e){xe(r,q);var n=Cl(r);function r(){var e;return i(this,r),(e=n.call(this)).onTemplateClick=function(t){e.setState({isModalOpen:!0,templateId:t})},e.state={isModalOpen:!1,templateId:null},e.store=Bt(),e}return st(r,[{key:"componentWillMount",value:function(){this.templateComponent=fl,this.templateListComponent=ds}},{key:"render",value:function(){var e=this;return _e(Il||(Il=t(["\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 />\n <//>\n <//>\n </>\n "])),ge.Provider,this.store,Sl,"integry-container",this.templateListComponent,this.props.layout,this.props.bundleId,this.templateComponent,this.context.apiHandler,this.context.eventEmitter,this.onTemplateClick,kl,this.state.isModalOpen,(function(){return e.setState({isModalOpen:!1,templateId:null})}),rl,this.context.apiHandler,this.state.templateId)}}]),r}();Ol.contextType=jt;var Ml=function(){function e(t,n){i(this,e),this.emitter=t,this.handler=n}return st(e,[{key:"getHandler",value:function(){return this.handler}}]),e}();function Al(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}var Dl=function(e){xe(n,Ml);var t=Al(n);function n(){return i(this,n),t.apply(this,arguments)}return st(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 Tl(e,t,n){return(Tl="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=Se(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 Rl(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}var Nl,El,Ll,Pl=function(e){xe(n,Dl);var t=Rl(n);function n(e,r){var o,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(i(this,n),(o=t.call(this,e,r)).total=a,o.i=0,o.total<1)throw new Error("{total} can not be less than 1");return o}return st(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=Tl(Se(n.prototype),"run",this)).call.apply(t,[this,e].concat(i)),++this.i>=this.total&&this.emitter.off(e,this.handler)}}]),n}(),jl=function(){function e(){i(this,e),this.events=Object.create(null)}return st(e,[{key:"on",value:function(e,t){this.addEventListener(e,new Dl(this,t))}},{key:"once",value:function(e,t){this.addEventListener(e,new Pl(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 Fl(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 zl(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Fl(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fl(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Ul={getAuthHash:function(e,t){return Fe.apply(this,arguments)}},Hl=function e(n){var o,a,s,l,u=this;(i(this,e),this.eventEmitter=new jl,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(""))},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:""}},this.printVersion=function(){console.info("@integry/sdk@".concat(e.SDK_VERSION))},this.getTemplatesList=r(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",u.apiHandler.getTemplateListing(u.config.bundleId));case 1:case"end":return e.stop()}}),e)}))),this.setupTemplateFormDestination=function(e,t){var n=null;if(t){if(e===Qa.MODAL||e===Qa.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 Qa.MODAL:return(n=document.createElement("div")).id=u.getRandomTemplateId(8),document.body.appendChild(n),n;case Qa.INLINE:return null;case Qa.DETACHED:case Qa.CUSTOM:return n;default:throw new Error("Unsupported renderMode ".concat(e," configuration, please provide one of ").concat(JSON.stringify(Object.keys(Qa))))}},this.renderTemplateForm=function(e,n){var r=document.getElementById(n);if(r){var i=Bt();ue(_e(Nl||(Nl=t(["\n <","\n value=","\n >\n <"," store=",">\n <","\n bundleId=","\n templateId=","\n >\n <//>\n <//>\n <//>\n "])),jt.Provider,{apiHandler:u.apiHandler,eventEmitter:u.eventEmitter,isPreviewMode:!1},ge.Provider,i,ga,u.config.bundleId,e),r)}else console.warn("Integry template form render target with id ".concat(n," was not found"))},this.renderPreview=function(e){var n=e.templateData,r=e.metadata,i=e.previewContainerId,o=document.getElementById(i);if(o){var a=Bt();ue(_e(El||(El=t(["\n <","\n value=","\n >\n <"," store=",">\n <","\n bundleId=","\n isPreviewMode=","\n templatePreviewData=","\n previewMetadata=","\n >\n <//>\n <//>\n <//>\n "])),jt.Provider,{apiHandler:u.apiHandler,eventEmitter:u.eventEmitter,isPreviewMode:!0},ge.Provider,a,ga,u.config.bundleId,!0,n,r),o)}else console.warn("Integry template form render target with id ".concat(i," was not found"))},this.init=function(e){var n=e.containerId,r=e.templateContainerId,i=e.renderMode,o=document.getElementById(n);if(!i)throw new Error("Template form render mode needs to be defined");if(u.setupTemplateFormDestination(i,r),o){var a=o.getAttribute("x-integry-layout")||Ya.LIST,s=Bt();ue(_e(Ll||(Ll=t(["\n <","\n value=","\n >\n <"," store=",">\n <"," bundleId="," layout=",">\n <//>\n <//>\n <//>\n "])),jt.Provider,{apiHandler:u.apiHandler,eventEmitter:u.eventEmitter,isPreviewMode:!1},ge.Provider,s,Ol,u.config.bundleId,a),o)}else console.warn("Integry SDK render target with id ".concat(n," was not found"))},this.destroy=function(){try{u.eventEmitter.offAll()}catch(e){console.error("There was an error unsubscribing from all events")}},"staging"===n.env)?a={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:"https://beta.integry.io",baseUrlv2:"https://beta.integry.io/v2",apiKey:null===(s=n.xIntegryConfig)||void 0===s?void 0:s.appAuth.apiKey}:a={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:"https://app.integry.io",baseUrlv2:"https://app.integry.io/v2",apiKey:null===(l=n.xIntegryConfig)||void 0===l?void 0:l.appAuth.apiKey};if("appKey"in n)o=zl(zl({},a),{},{appKey:n.appKey,hash:n.hash,userId:n.userId}),this.config=zl(zl({},a),{},{appKey:n.appKey,hash:n.hash,userId:n.userId,bundleId:n.bundleId});else{var c=this.getAuthParamsFromUrl()||{};o=zl(zl({},a),c),this.config=zl(zl({},a),c)}this.apiHandler=new Ee(o)};Hl.SDK_VERSION="0.0.55",Hl.RenderModes=Qa;export{Ul as Helpers,Hl as IntegryJS};
17
+ function e(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function t(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 n(e){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=e.apply(n,r);function s(e){t(a,i,o,s,l,"next",e)}function l(e){t(a,i,o,s,l,"throw",e)}s(void 0)}))}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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=Object.prototype,s=a.hasOwnProperty,l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",p=l.toStringTag||"@@toStringTag";function d(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),a=new M(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return D()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===_)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=f(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===_)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,a),o}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}var _={};function m(){}function h(){}function v(){}var y={};y[u]=function(){return this};var g=Object.getPrototypeOf,b=g&&g(g(A([])));b&&b!==a&&s.call(b,u)&&(y=b);var w=v.prototype=m.prototype=Object.create(y);function x(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function I(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))}function k(e,t){function n(r,i,a,l){var u=f(e[r],e,i);if("throw"!==u.type){var c=u.arg,p=c.value;return p&&"object"===o(p)&&s.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,a,l)}),(function(e){n("throw",e,a,l)})):t.resolve(p).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,l)}))}l(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 S(e,t){var n=e.iterator[t.method];if(undefined===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=undefined,S(e,t),"throw"===t.method))return _;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return _}var r=f(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,_;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=undefined),t.delegate=null,_):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,_)}function C(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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function A(e){if(e){var t=e[u];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(s.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=undefined,t.done=!0,t};return r.next=r}}return{next:D}}function D(){return{value:undefined,done:!0}}h.prototype=w.constructor=v,v.constructor=h,v[p]=h.displayName="GeneratorFunction",x(k.prototype),k.prototype[c]=function(){return this},x(w),w[p]="Generator",w[u]=function(){return this},w.toString=function(){return"[object Generator]"},M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=undefined)},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=undefined),!!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 a=s.call(i,"catchLoc"),l=s.call(i,"finallyLoc");if(a&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)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&&s.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,_):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),_},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),O(n),_}},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;O(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:A(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=undefined),_}};var T,R,L,N,E,P,j,F={wrap:d,isGeneratorFunction:I,AsyncIterator:k,mark:function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,p in e||(e[p]="GeneratorFunction")),e.prototype=Object.create(w),e},awrap:function(e){return{__await:e}},async:function(e,t,n,r,i){void 0===i&&(i=Promise);var o=new k(d(e,t,n,r),i);return I(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:A},z={},U=[],H=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function B(e,t){for(var n in t)e[n]=t[n];return e}function V(e){var t=e.parentNode;t&&t.removeChild(e)}function W(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 G(e,o,t&&t.key,t&&t.ref)}function G(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 T.vnode&&T.vnode(i),i}function J(e){return e.children}function q(e,t){this.props=e,this.context=t}function K(e,t){if(null==t)return e.__?K(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?K(e):null}function Q(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 Q(e)}}function Y(e){(!e.__d&&(e.__d=!0)&&1===L.push(e)||E!==T.debounceRendering)&&((E=T.debounceRendering)||N)(Z)}function Z(){var e,t,n,r,i,o,a;for(L.sort((function(e,t){return t.__v.__b-e.__v.__b}));e=L.pop();)e.__d&&(n=void 0,r=void 0,o=(i=(t=e).__v).__e,(a=t.__P)&&(n=[],r=ie(a,i,B({},i),t.__n,void 0!==a.ownerSVGElement,null,n,null==o?K(i):o),oe(n,i),r!=o&&Q(i)))}function X(e,t,n,r,i,o,a,s,l){var u,c,p,d,f,_,m,h=n&&n.__k||U,v=h.length;if(s==z&&(s=null!=o?o[0]:v?K(n,0):null),u=0,t.__k=$(t.__k,(function(n){if(null!=n){if(n.__=t,n.__b=t.__b+1,null===(p=h[u])||p&&n.key==p.key&&n.type===p.type)h[u]=void 0;else for(c=0;c<v;c++){if((p=h[c])&&n.key==p.key&&n.type===p.type){h[c]=void 0;break}p=null}if(d=ie(e,n,p=p||z,r,i,o,a,s,l),(c=n.ref)&&p.ref!=c&&(m||(m=[]),p.ref&&m.push(p.ref,null,n),m.push(c,n.__c||d,n)),null!=d){if(null==_&&(_=d),null!=n.__d)d=n.__d,n.__d=null;else if(o==p||d!=s||null==d.parentNode){e:if(null==s||s.parentNode!==e)e.appendChild(d);else{for(f=s,c=0;(f=f.nextSibling)&&c<v;c+=2)if(f==d)break e;e.insertBefore(d,s)}"option"==t.type&&(e.value="")}s=d.nextSibling,"function"==typeof t.type&&(t.__d=d)}}return u++,n})),t.__e=_,null!=o&&"function"!=typeof t.type)for(u=o.length;u--;)null!=o[u]&&V(o[u]);for(u=v;u--;)null!=h[u]&&se(h[u],h[u]);if(m)for(u=0;u<m.length;u++)ae(m[u],m[++u],m[++u])}function $(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++)$(e[r],t,n);else n.push(t?t("string"==typeof e||"number"==typeof e?G(null,e,null,null):null!=e.__e||null!=e.__c?G(e.type,e.props,e.key,null):e):e);return n}function ee(e,t,n,r,i){var o;for(o in n)o in t||ne(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"value"===o||"checked"===o||n[o]===t[o]||ne(e,o,t[o],n[o],r)}function te(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]="number"==typeof n&&!1===H.test(t)?n+"px":null==n?"":n}function ne(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||te(o,a,"");if(n)for(s in n)r&&n[s]===r[s]||te(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,re,l),(e.l||(e.l={}))[t]=n):e.removeEventListener(t,re,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 re(e){this.l[e.type](T.event?T.event(e):e)}function ie(e,t,n,r,i,o,a,s,l){var u,c,p,d,f,_,m,h,v,y,g=t.type;if(void 0!==t.constructor)return null;(u=T.__b)&&u(t);try{e:if("function"==typeof g){if(h=t.props,v=(u=g.contextType)&&r[u.__c],y=u?v?v.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(h,y):(t.__c=c=new q(h,y),c.constructor=g,c.render=le),v&&v.sub(c),c.props=h,c.state||(c.state={}),c.context=y,c.__n=r,p=c.__d=!0,c.__h=[]),null==c.__s&&(c.__s=c.state),null!=g.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=B({},c.__s)),B(c.__s,g.getDerivedStateFromProps(h,c.__s))),d=c.props,f=c.state,p)null==g.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==g.getDerivedStateFromProps&&h!==d&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(h,y),!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(h,c.__s,y)){for(c.props=h,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(h,c.__s,y),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(d,f,_)}))}c.context=y,c.props=h,c.state=c.__s,(u=T.__r)&&u(t),c.__d=!1,c.__v=t,c.__P=e,u=c.render(c.props,c.state,c.context),t.__k=$(null!=u&&u.type==J&&null==u.key?u.props.children:u),null!=c.getChildContext&&(r=B(B({},r),c.getChildContext())),p||null==c.getSnapshotBeforeUpdate||(_=c.getSnapshotBeforeUpdate(d,f)),X(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,p,d,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=U.slice.call(e.childNodes)),c=(f=n.props||z).dangerouslySetInnerHTML,p=_.dangerouslySetInnerHTML,!s){if(f===z)for(f={},d=0;d<e.attributes.length;d++)f[e.attributes[d].name]=e.attributes[d].value;(p||c)&&(p&&c&&p.__html==c.__html||(e.innerHTML=p&&p.__html||""))}ee(e,_,f,i,s),t.__k=t.props.children,p||X(e,t,n,r,"foreignObject"!==t.type&&i,o,a,z,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=T.diffed)&&u(t)}catch(e){T.__e(e,t,n)}return t.__e}function oe(e,t){T.__c&&T.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){T.__e(e,t.__v)}}))}function ae(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){T.__e(e,n)}}function se(e,t,n){var r,i,o;if(T.unmount&&T.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||ae(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){T.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&se(r[o],t,n);null!=i&&V(i)}function le(e,t,n){return this.constructor(e,n)}function ue(e,t,n){var r,i,o;T.__&&T.__(e,t),i=(r=n===P)?null:n&&n.__k||t.__k,e=W(J,null,[e]),o=[],ie(t,(r?t:n||t).__k=e,i||z,z,void 0!==t.ownerSVGElement,n&&!r?[n]:i?null:U.slice.call(t.childNodes),o,n||z,r),oe(o,e)}function ce(e){var t={},n={__c:"__cC"+j++,__: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,Y(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}T={__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 Y(n.__E=n)}catch(t){e=t}throw e}},R=function(e){return null!=e&&void 0===e.constructor},q.prototype.setState=function(e,t){var n;n=this.__s!==this.state?this.__s:this.__s=B({},this.state),"function"==typeof e&&(e=e(n,this.props)),e&&B(n,e),null!=e&&this.__v&&(this.__e=!1,t&&this.__h.push(t),Y(this))},q.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Y(this))},q.prototype.render=J,L=[],N="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,P=z,j=0;var pe=Object.freeze({__proto__:null,render:ue,hydrate:function(e,t){ue(e,t,P)},createElement:W,h:W,Fragment:J,createRef:function(){return{}},get isValidElement(){return R},Component:q,cloneElement:function(e,t){return t=B(B({},e.props),t),arguments.length>2&&(t.children=U.slice.call(arguments,2)),G(e.type,t,t.key||e.key,t.ref||e.ref)},createContext:ce,toChildArray:$,_unmount:se,get options(){return T}}),de=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},fe=new Map;var _e=function(e){var t=fe.get(this);return t||(t=new Map,fe.set(this,t)),(t=de(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(W),me="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function he(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 ve(e){var t={exports:{}};return e(t,t.exports),t.exports}var ye=he(pe),ge=ve((function(e,t){var n=ye;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},p=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,p()},this.componentDidMount=function(){l.subscribe(p)},this.componentWillUnmount=function(){l.unsubscribe(p)},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 be(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 we(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xe(e,t){return(xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ie(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&&xe(e,t)}function ke(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?we(e):t}function Se(e){return(Se=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ce(){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 Oe(e,t,n){return(Oe=Ce()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&xe(i,n.prototype),i}).apply(null,arguments)}function Me(e){var t="function"==typeof Map?new Map:void 0;return(Me=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 Oe(e,arguments,Se(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),xe(r,e)})(e)}function Ae(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}var De=function(e){Ie(n,Me(Error));var t=Ae(n);function n(e,o){var a;return r(this,n),i(we(a=t.call(this,e)),"statusCode",void 0),i(we(a),"response",void 0),a.name=a.constructor.name,a.statusCode=null==o?void 0:o.status,a.response=o,a}return n}(),Te=function(){var e=n(F.mark((function e(t){var n,r,i;return F.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 De(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 Re(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 Le(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ne=function e(t){var o=this;r(this,e),i(this,"config",void 0),i(this,"getTemplate",function(){var t=n(F.mark((function t(n){var r,i;return F.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new URL("".concat(o.config.baseUrlv2,"/template/").concat(n,"/")),e.addUrlSearchParams(r,{app_key:o.config.appKey,hash:o.config.hash,user_id:o.config.userId,self_api_key:o.config.apiKey||null}),t.prev=2,t.next=5,be(r.toString()).then((function(e){return Te(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){return t.apply(this,arguments)}}()),i(this,"getAuthUrl",(function(t){var n=new URL("".concat(o.config.baseUrl,"/auth/login/").concat(t,"/"));return e.addUrlSearchParams(n,{app_key:o.config.appKey,hash:o.config.hash,user_id:o.config.userId}),n.toString()})),i(this,"getTemplateStep",function(){var t=n(F.mark((function t(n){var r,i;return F.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new URL("".concat(o.config.baseUrl,"/template_step/").concat(n,"/")),e.addUrlSearchParams(r,{app_key:o.config.appKey,hash:o.config.hash,user_id:o.config.userId,self_api_key:o.config.apiKey||null}),t.prev=2,t.next=5,be(r.toString()).then((function(e){return Te(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){return t.apply(this,arguments)}}()),i(this,"verifyOAuth",function(){var t=n(F.mark((function t(n){var r,i;return F.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new URL("".concat(o.config.baseUrl,"/").concat(o.config.oauthVerifyPath)),e.addUrlSearchParams(r,{authorization_id:"".concat(n),app_key:o.config.appKey,hash:o.config.hash,user_id:o.config.userId}),t.prev=2,t.next=5,be(r.toString(),{method:"POST"}).then(Te);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){return t.apply(this,arguments)}}()),i(this,"deleteAuth",function(){var t=n(F.mark((function t(n){var r,i;return F.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new URL("".concat(o.config.baseUrl,"/connected-accounts/").concat(n)),e.addUrlSearchParams(r,{app_key:o.config.appKey,hash:o.config.hash,user_id:o.config.userId}),t.prev=2,t.next=5,be(r.toString(),{method:"DELETE"}).then((function(e){return Te(e)}));case 5:return i=t.sent,t.abrupt("return",{status:i.status,data: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){return t.apply(this,arguments)}}()),i(this,"callDynamicDataEndpoint",function(){var t=n(F.mark((function t(n){var r,i,a=arguments;return F.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},e.addUrlSearchParams(n,Le({app_key:o.config.appKey,hash:o.config.hash,user_id:o.config.userId},r)),t.prev=2,t.next=5,be(n.toString()).then((function(e){return Te(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){return t.apply(this,arguments)}}()),i(this,"getTemplateListing",function(){var t=n(F.mark((function t(n){var r,i;return F.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new URL("".concat(o.config.baseUrl,"/bundle/").concat(n,"/")),e.addUrlSearchParams(r,{app_key:o.config.appKey,hash:o.config.hash,user_id:o.config.userId}),t.prev=2,t.next=5,be(r.toString()).then((function(e){return Te(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){return t.apply(this,arguments)}}()),i(this,"saveIntegration",function(){var t=n(F.mark((function t(n){var r,i;return F.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new URL("".concat(o.config.baseUrlv2,"/integration/")),e.addUrlSearchParams(r,{async:!1,app_key:o.config.appKey,hash:o.config.hash,user_id:o.config.userId,activate:!0}),t.prev=2,t.next=5,be(r.toString(),{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}).then((function(e){return Te(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){return t.apply(this,arguments)}}()),i(this,"updateIntegration",function(){var t=n(F.mark((function t(n,r){var i,a;return F.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new URL("".concat(o.config.baseUrlv2,"/integration/").concat(n,"/")),e.addUrlSearchParams(i,{async:!1,app_key:o.config.appKey,hash:o.config.hash,user_id:o.config.userId,activate:!0}),t.prev=2,t.next=5,be(i.toString(),{method:"PUT",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}}).then((function(e){return Te(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)}}()),i(this,"deleteIntegration",function(){var t=n(F.mark((function t(n){var r,i;return F.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new URL("".concat(o.config.baseUrl,"/setup/template/").concat(n,"/")),e.addUrlSearchParams(r,{app_key:o.config.appKey,hash:o.config.hash,user_id:o.config.userId}),t.prev=2,t.next=5,be(r.toString(),{method:"DELETE"}).then((function(e){return Te(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){return t.apply(this,arguments)}}()),i(this,"toggleIntegration",function(){var t=n(F.mark((function t(n,r){var i,a;return F.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new URL("".concat(o.config.baseUrlv2,"/integration/").concat(n,"/").concat(r?"enable":"disable","/")),e.addUrlSearchParams(i,{app_key:o.config.appKey,hash:o.config.hash,user_id:o.config.userId}),t.prev=2,t.next=5,be(i.toString(),{method:"PUT"}).then((function(e){return Te(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)}}()),i(this,"getIntegrationStatuses",function(){var t=n(F.mark((function t(n){var r,i;return F.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new URL("".concat(o.config.baseUrlv2,"/integration_status/")),e.addUrlSearchParams(r,{app_key:o.config.appKey,hash:o.config.hash,user_id:o.config.userId}),t.prev=2,t.next=5,be(r.toString(),{method:"PUT",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}).then(Te);case 5:return i=t.sent,t.abrupt("return",i);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 Ee(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 Pe(e,t){if(e){if("string"==typeof e)return Ee(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)?Ee(e,t):void 0}}function je(e){return function(e){if(Array.isArray(e))return Ee(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Pe(e)||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 Fe(){return(Fe=n(F.mark((function e(t,n){var r,i,o,a,s;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(r=function(e){return new Uint8Array(je(unescape(encodeURIComponent(e))).map((function(e){return e.charCodeAt(0)})))})(n),o=r(t),e.next=5,crypto.subtle.importKey("raw",i,{name:"HMAC",hash:"SHA-256"},!0,["sign"]);case 5:return a=e.sent,e.next=8,crypto.subtle.sign("HMAC",a,o);case 8:return s=e.sent,e.abrupt("return",je(new Uint8Array(s)).map((function(e){return e.toString(16).padStart(2,"0")})).join(""));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ze(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 Ue(e,t){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,t)||Pe(e,t)||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.")}()}i(Ne,"addUrlSearchParams",(function(e,t){return Object.keys(t).map((function(n){return t[n]&&e.searchParams.append(n,"".concat(t[n]))}))}));var He,Be,Ve,We=[],Ge=T.__r,Je=T.diffed,qe=T.__c,Ke=T.unmount;function Qe(e){T.__h&&T.__h(Be);var t=Be.__H||(Be.__H={t:[],u:[]});return e>=t.t.length&&t.t.push({}),t.t[e]}function Ye(e){return function(e,t,n){var r=Qe(He++);return r.__c||(r.__c=Be,r.i=[n?n(t):at(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}(at,e)}function Ze(e,t){var n=Qe(He++);ot(n.o,t)&&(n.i=e,n.o=t,Be.__H.u.push(n))}function Xe(e){return $e((function(){return{current:e}}),[])}function $e(e,t){var n=Qe(He++);return ot(n.o,t)?(n.o=t,n.v=e,n.i=e()):n.i}function et(e,t){return $e((function(){return e}),t)}function tt(e){var t=Be.context[e.__c];if(!t)return e.__;var n=Qe(He++);return null==n.i&&(n.i=!0,t.sub(Be)),t.props.value}function nt(){We.some((function(e){e.__P&&(e.__H.u.forEach(rt),e.__H.u.forEach(it),e.__H.u=[])})),We=[]}function rt(e){e.m&&e.m()}function it(e){var t=e.i();"function"==typeof t&&(e.m=t)}function ot(e,t){return!e||t.some((function(t,n){return t!==e[n]}))}function at(e,t){return"function"==typeof t?t(e):t}function st(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 lt(e,t,n){return t&&st(e.prototype,t),n&&st(e,n),e}T.__r=function(e){Ge&&Ge(e),He=0,(Be=e.__c).__H&&(Be.__H.u.forEach(rt),Be.__H.u.forEach(it),Be.__H.u=[])},T.diffed=function(e){Je&&Je(e);var t=e.__c;if(t){var n=t.__H;n&&n.u.length&&(1!==We.push(t)&&Ve===T.requestAnimationFrame||((Ve=T.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);"undefined"!=typeof window&&(t=requestAnimationFrame(n))})(nt))}},T.__c=function(e,t){t.some((function(e){e.__h.forEach(rt),e.__h=e.__h.filter((function(e){return!e.i||it(e)}))})),qe&&qe(e,t)},T.unmount=function(e){Ke&&Ke(e);var t=e.__c;if(t){var n=t.__H;n&&n.t.forEach((function(e){return e.m&&e.m()}))}};var ut=["message"],ct=F.mark(It),pt=F.mark(kt);function dt(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 ft(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 ft(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 ft(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(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 mt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_t(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ht(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}var vt=function(e){Ie(n,Me(TypeError));var t=ht(n);function n(e,i){var o,a;r(this,n);var s=e.message,l=ze(e,ut),u=e.path,c=0===u.length?s:"At path: "+u.join(".")+" -- "+s;return o=t.call(this,c),Object.assign(we(o),l),o.name=o.constructor.name,o.failures=function(){var t;return null!=(t=a)?t:a=[e].concat(je(i()))},o}return n}();function yt(e){return gt(e)&&"function"==typeof e[Symbol.iterator]}function gt(e){return"object"===o(e)&&null!=e}function bt(e){return"string"==typeof e?JSON.stringify(e):""+e}function wt(e){var t=e.next(),n=t.done,r=t.value;return n?void 0:r}function xt(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: `"+bt(r)+"`":u;return mt(mt({value:r,type:a,refinement:l,key:i[i.length-1],path:i,branch:o},e),{},{message:c})}}function It(e,t,n,r){var i,o,a,s;return F.wrap((function(l){for(;;)switch(l.prev=l.next){case 0:yt(e)||(e=[e]),i=dt(e),l.prev=2,i.s();case 4:if((o=i.n()).done){l.next=12;break}if(a=o.value,!(s=xt(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()}}),ct,null,[[2,14,17,20]])}function kt(e,t){var n,r,i,o,a,s,l,u,c,p,d,f,_,m,h,v,y,g,b,w,x,I,k,S,C,O,M,A,D=arguments;return F.wrap((function(T){for(;;)switch(T.prev=T.next){case 0:if(n=D.length>2&&void 0!==D[2]?D[2]:{},r=n.path,i=void 0===r?[]:r,o=n.branch,a=void 0===o?[e]:o,s=n.coerce,l=void 0!==s&&s,u=n.mask,c=void 0!==u&&u,p={path:i,branch:a},l&&(e=t.coercer(e,p),c&&"type"!==t.type&&gt(t.schema)&&gt(e)&&!Array.isArray(e)))for(d in e)void 0===t.schema[d]&&delete e[d];f=!0,_=dt(t.validator(e,p)),T.prev=6,_.s();case 8:if((m=_.n()).done){T.next=15;break}return h=m.value,f=!1,T.next=13,[h,void 0];case 13:T.next=8;break;case 15:T.next=20;break;case 17:T.prev=17,T.t0=T.catch(6),_.e(T.t0);case 20:return T.prev=20,_.f(),T.finish(20);case 23:v=dt(t.entries(e,p)),T.prev=24,v.s();case 26:if((y=v.n()).done){T.next=53;break}g=Ue(y.value,3),b=g[0],w=g[1],x=g[2],I=kt(w,x,{path:void 0===b?i:[].concat(je(i),[b]),branch:void 0===b?a:[].concat(je(a),[w]),coerce:l,mask:c}),k=dt(I),T.prev=30,k.s();case 32:if((S=k.n()).done){T.next=43;break}if(!(C=S.value)[0]){T.next=40;break}return f=!1,T.next=38,[C[0],void 0];case 38:T.next=41;break;case 40:l&&(w=C[1],void 0===b?e=w:e instanceof Map?e.set(b,w):e instanceof Set?e.add(w):gt(e)&&(e[b]=w));case 41:T.next=32;break;case 43:T.next=48;break;case 45:T.prev=45,T.t1=T.catch(30),k.e(T.t1);case 48:return T.prev=48,k.f(),T.finish(48);case 51:T.next=26;break;case 53:T.next=58;break;case 55:T.prev=55,T.t2=T.catch(24),v.e(T.t2);case 58:return T.prev=58,v.f(),T.finish(58);case 61:if(!f){T.next=80;break}O=dt(t.refiner(e,p)),T.prev=63,O.s();case 65:if((M=O.n()).done){T.next=72;break}return A=M.value,f=!1,T.next=70,[A,void 0];case 70:T.next=65;break;case 72:T.next=77;break;case 74:T.prev=74,T.t3=T.catch(63),O.e(T.t3);case 77:return T.prev=77,O.f(),T.finish(77);case 80:if(!f){T.next=83;break}return T.next=83,[void 0,e];case 83:case"end":return T.stop()}}),pt,null,[[6,17,20,23],[24,55,58,61],[30,45,48,51],[63,74,77,80]])}var St=function(){function e(t){var n=this;r(this,e);var i=t.type,o=t.schema,a=t.validator,s=t.refiner,l=t.coercer,u=void 0===l?function(e){return e}:l,c=t.entries,p=void 0===c?F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})):c;this.type=i,this.schema=o,this.entries=p,this.coercer=u,this.validator=a?function(e,t){return It(a(e,t),t,n,e)}:function(){return[]},this.refiner=s?function(e,t){return It(s(e,t),t,n,e)}:function(){return[]}}return lt(e,[{key:"assert",value:function(e){return Ct(e,this)}},{key:"create",value:function(e){return function(e,t){var n=Ot(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!Ot(e,t)[0]}(e,this)}},{key:"mask",value:function(e){return function(e,t){var n=Ot(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 Ot(e,this,t)}}]),e}();function Ct(e,t){var n=Ot(e,t);if(n[0])throw n[0]}function Ot(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=kt(e,t,n),i=wt(r);if(i[0]){var o=new vt(i[0],F.mark((function e(){var t,n,i;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=dt(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 Mt(e,t){return new St({type:e,schema:null,validator:t})}function At(e){return new St({type:"array",schema:e,entries:F.mark((function t(n){var r,i,o,a,s;return F.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e||!Array.isArray(n)){t.next=18;break}r=dt(n.entries()),t.prev=2,r.s();case 4:if((i=r.n()).done){t.next=10;break}return o=Ue(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: "+bt(e)}})}function Dt(){return Mt("boolean",(function(e){return"boolean"==typeof e}))}function Tt(){return Mt("date",(function(e){return e instanceof Date&&!isNaN(e.getTime())||"Expected a valid `Date` object, but received: "+bt(e)}))}function Rt(e){return new St(mt(mt({},e),{},{validator:function(t,n){return null===t||e.validator(t,n)},refiner:function(t,n){return null===t||e.refiner(t,n)}}))}function Lt(){return Mt("number",(function(e){return"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+bt(e)}))}function Nt(e){var t=e?Object.keys(e):[],n=Mt("never",(function(){return!1}));return new St({type:"object",schema:e||null,entries:F.mark((function r(i){var o,a,s,l,u,c,p;return F.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e||!gt(i)){r.next=37;break}o=new Set(Object.keys(i)),a=dt(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=dt(o),r.prev=21,u.s();case 23:if((c=u.n()).done){r.next=29;break}return p=c.value,r.next=27,[p,i[p],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 gt(e)||"Expected an object, but received: "+bt(e)},coercer:function(e){return gt(e)?mt({},e):e}})}function Et(e){return new St(mt(mt({},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 Pt(){return Mt("string",(function(e){return"string"==typeof e||"Expected a string, but received: "+bt(e)}))}function jt(e,t,n){return new St(mt(mt({},e),{},{refiner:function(e){var t=F.mark(n);function n(n,r){var i=arguments;return F.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}(F.mark((function r(i,o){var a,s,l,u,c;return F.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=It(a,o,e,i),l=dt(s),r.prev=4,l.s();case 6:if((u=l.n()).done){r.next=12;break}return c=u.value,r.next=10,mt(mt({},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 Ft=ce(null);function zt(e,t){for(var n in t)e[n]=t[n];return e}var Ut={stepState:{steps:[],currentStep:{type:"CONFIRMATION"},stepIndex:0,showValidation:!1,allStepsCompleted:!1},genericData:{bundleId:null,templateId:null,templateApp:null,isPreviewMode:!1},stepMapping:{},stepDataMapping:{},parentChildMapping:{}};function Ht(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?Ht(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ht(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Vt=function(e){return{setSteps:function(e,t){var n=[];return t.forEach((function(e,t){if(e.activity.auth_required&&!e.hide_authorization&&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:i({},e.id,""),isValid:!1,itemIndex:t}),e.is_visible&&e.template_fields.length>0){var r=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 Bt(Bt({},e),{},i({},t.id,""))}),{}),s=!(Object.keys(a).length>0);r&&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:s,itemIndex:n.length})}})),Bt(Bt({},e),{},{stepState:{steps:n,currentStep:n[0],stepIndex:0,showValidation:!1,allStepsCompleted:!1}})},showStepValidationState:function(e){return{stepState:Bt(Bt({},e.stepState),{},{showValidation:!0})}},hideStepValidationState:function(e){return{stepState:Bt(Bt({},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],i=Bt(Bt({},t.steps[e.stepState.stepIndex]),{},{isCompleted:!0});return r?{stepState:Bt(Bt({},t),{},{steps:[].concat(je(t.steps.slice(0,t.stepIndex)),[i],je(t.steps.slice(t.stepIndex+1))),currentStep:Bt({},r),stepIndex:n,showValidation:!1})}:{stepState:Bt(Bt({},t),{},{steps:[].concat(je(t.steps.slice(0,t.stepIndex)),[i],je(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:Bt(Bt({},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:Bt(Bt({},e.stepState),{},{currentStep:n.steps[o],stepIndex:o,allStepsCompleted:!1})}}return r||"CONFIRMATION"!==i?e:{stepState:Bt(Bt({},n),{},{currentStep:{type:"CONFIRMATION"},stepIndex:n.steps.length,allStepsCompleted:!0})}},gotoStep:function(e,t){var n=e.stepState,r=n.stepIndex;if(n){var i=n.steps[r],o=n.steps[t];if(e.genericData.isPreviewMode)return t===n.steps.length?{stepState:Bt(Bt({},n),{},{currentStep:{type:"CONFIRMATION"},stepIndex:n.steps.length,allStepsCompleted:!0})}:{stepState:Bt(Bt({},e.stepState),{},{currentStep:Bt({},o),stepIndex:t,allStepsCompleted:!1})};if(n.allStepsCompleted&&t===n.steps.length)return{stepState:Bt(Bt({},n),{},{currentStep:{type:"CONFIRMATION"},stepIndex:n.steps.length,allStepsCompleted:!0})};if(i&&i.isValid&&r===n.steps.length-1&&t===n.steps.length){var a=Bt(Bt({},n.steps[r]),{},{isCompleted:!0});return{stepState:Bt(Bt({},n),{},{steps:[].concat(je(n.steps.slice(0,r)),[a],je(n.steps.slice(r+1))),currentStep:{type:"CONFIRMATION"},stepIndex:t,allStepsCompleted:!0})}}if(o&&o.isCompleted)return{stepState:Bt(Bt({},e.stepState),{},{currentStep:Bt({},o),stepIndex:t,showValidation:!o.isValid})};if(i&&i.isValid&&t===r+1){var s=Bt(Bt({},n.steps[r]),{},{isCompleted:!0});return{stepState:Bt(Bt({},e.stepState),{},{steps:[].concat(je(n.steps.slice(0,r)),[s],je(n.steps.slice(r+1))),currentStep:Bt({},o),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:Bt(Bt({},e.stepState),{},{currentStep:Bt(Bt({},e.stepState.currentStep),{},{isValid:r})})}},getStepState:function(){return e.getState().stepState},setGenericData:function(e,t){return{genericData:Bt(Bt({},e.genericData),t)}},setTemplateApp:function(e,t){return{genericData:Bt(Bt({},e.genericData),{},{templateApp:{name:t.name,iconUrl:t.iconUrl}})}},setStepMapping:function(e,t){var n=t.reduce((function(t,n){var r,o,a,s,l=null,u=!1;n.hide_authorization||e.genericData.isPreviewMode?(u=!0,l=null!==(a=null===(s=n.authorization_type.authorizations[0])||void 0===s?void 0:s.id)&&void 0!==a?a:null):(n.step_authorization||e.stepMapping[n.id])&&(l=e.stepMapping[n.id].selectedAuthId);return Bt(Bt({},t),{},i({},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:u}})))&&void 0!==r?r:[],isAuthVerified:u,selectedAuthId:l}))}),{}),r=t.reduce((function(t,n){return Bt(Bt({},t),{},i({},n.id,Bt(Bt({},e.stepDataMapping[n.id]),n.template_fields.reduce((function(t,r){var o;return Bt(Bt({},t),{},i({},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}))}),{}))))}),{});return{stepMapping:Bt(Bt({},e.stepMapping),n),stepDataMapping:Bt(Bt({},e.stepDataMapping),r),genericData:Bt(Bt({},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 Bt(Bt({},e),{},{activityOutputData:t.activityOutputData})},setDynamicFieldData:function(e,t){return Bt(Bt({},e),{},{dynamicFieldData:Object.keys(t.dynamicFieldData).reduce((function(e,n){return Bt(Bt({},e),{},i({},"{".concat(n,"}"),t.dynamicFieldData[n]))}),{})})},setParentChildMapping:function(e,t){var n=t.reduce((function(t,n){return Bt(Bt({},t),{},i({},n.id,Bt(Bt({},e.parentChildMapping[n.id]),n.template_fields.reduce((function(e,t){var n,r,o,a,s;return t.activity_field?Bt(Bt({},e),{},i({},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=t.activity_field)||void 0===o?void 0:o.child_fields):null,parentFields:null!==(a=t.activity_field)&&void 0!==a&&a.parent_fields?JSON.parse(null===(s=t.activity_field)||void 0===s?void 0:s.parent_fields):null})):e}),{}))))}),{});return{parentChildMapping:Bt(Bt({},e.parentChildMapping),n)}},addAuthorization:function(e,t){var n=t.stepId,r=t.authData;return{stepMapping:Bt(Bt({},e.stepMapping),{},i({},n,Bt(Bt({},e.stepMapping[n]),{},{authorizations:[].concat(je(e.stepMapping[n].authorizations),[r])})))}},removeAuthorization:function(e,t){var n=t.stepId,r=t.authId;return{stepMapping:Bt(Bt({},e.stepMapping),{},i({},n,Bt(Bt({},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:Bt(Bt({},e.stepMapping),{},i({},n,Bt(Bt({},e.stepMapping[n]),{},{authorizations:[].concat(je(e.stepMapping[n].authorizations.slice(0,a)),[Bt(Bt({},e.stepMapping[n].authorizations[a]),{},{isVerifying:o})],je(e.stepMapping[n].authorizations.slice(a+1)))})))}},toggleDeleteAuthorizationFlag:function(e,t){var n=t.stepId,r=t.authId,o=t.isDeleting,a=t.error,s=e.stepMapping[n].authorizations.findIndex((function(e){return e.authorizationId===r}));return{stepMapping:Bt(Bt({},e.stepMapping),{},i({},n,Bt(Bt({},e.stepMapping[n]),{},{authorizations:[].concat(je(e.stepMapping[n].authorizations.slice(0,s)),[Bt(Bt({},e.stepMapping[n].authorizations[s]),{},{isDeleting:o,error:a})],je(e.stepMapping[n].authorizations.slice(s+1)))})))}},setStepAuthId:function(e,t){var n=t.stepId,r=t.authId;return{stepMapping:Bt(Bt({},e.stepMapping),{},i({},n,Bt(Bt({},e.stepMapping[n]),{},{selectedAuthId:r})))}},setStepAuthorization:function(t,n,r,o,a){var s,l,u=t.stepState.steps[t.stepState.stepIndex],c=t.stepMapping[n],p=e.getState().stepState;if("CONFIRMATION"!==u.type&&"CONFIRMATION"!==(null===(s=p.currentStep)||void 0===s?void 0:s.type)&&(null===(l=p.currentStep)||void 0===l?void 0:l.stepId)===n){var d=u.invalidFields;o&&delete d[n];var f=Bt(Bt({},t.stepState.steps[t.stepState.stepIndex]),{},{invalidFields:d,isValid:Object.keys(d).length<1,isCompleted:null!==c.selectedAuthId||o}),_=t.stepMapping[n].authorizations.findIndex((function(e){return e.authorizationId===r}));return{stepState:Bt(Bt({},t.stepState),{},{steps:[].concat(je(t.stepState.steps.slice(0,t.stepState.stepIndex)),[f],je(t.stepState.steps.slice(t.stepState.stepIndex+1))),currentStep:f,showValidation:!o&&!c.selectedAuthId}),stepMapping:Bt(Bt({},t.stepMapping),{},i({},n,Bt(Bt({},t.stepMapping[n]),{},{selectedAuthId:o?r:t.stepMapping[n].selectedAuthId,authorizations:[].concat(je(t.stepMapping[n].authorizations.slice(0,_)),[Bt(Bt({},t.stepMapping[n].authorizations[_]),{},{isVerified:o,isVerifying:!1,didFetchStatus:!0,error:""})],je(t.stepMapping[n].authorizations.slice(_+1)))}))),stepDataMapping:Bt(Bt({},t.stepDataMapping),{},i({},n,Bt(Bt({},t.stepDataMapping[n]),a?a.reduce((function(e,r){return Bt(Bt({},e),{},i({},r,Bt(Bt({},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:Bt(Bt({},e.stepDataMapping),{},i({},t,Bt(Bt({},e.stepDataMapping[t]),{},i({},r,o))))}}return e},setStepFieldData:function(e,t){var n=t.stepId,r=t.fieldId,o=t.value,a=e.stepState.steps[e.stepState.stepIndex];if("CONFIRMATION"!==a.type){var s=a.invalidFields;delete s[r];var l=Bt(Bt({},e.stepState.steps[e.stepState.stepIndex]),{},{invalidFields:s,isValid:Object.keys(s).length<1});return{stepState:Bt(Bt({},e.stepState),{},{steps:[].concat(je(e.stepState.steps.slice(0,e.stepState.stepIndex)),[l],je(e.stepState.steps.slice(e.stepState.stepIndex+1))),currentStep:l}),stepDataMapping:Bt(Bt({},e.stepDataMapping),{},i({},n,Bt(Bt({},e.stepDataMapping[n]),{},i({},r,Bt(Bt({},e.stepDataMapping[n][r]),{},{value:o})))))}}return e},setStepMappingData:function(e,t){var n,r,o,a,s=null===(n=e.stepDataMapping[t.stepId][t.fieldId])||void 0===n?void 0:n.objectValue;t.value?r=Bt(Bt({},null!==(o=null===(a=e.stepDataMapping[t.stepId][t.fieldId])||void 0===a?void 0:a.objectValue)&&void 0!==o?o:{}),i({},t.id,t.value)):s&&(delete s[t.id],r=s,0===Object.keys(r).length&&(r=null));return{stepDataMapping:Bt(Bt({},e.stepDataMapping),{},i({},t.stepId,Bt(Bt({},e.stepDataMapping[t.stepId]),{},i({},t.fieldId,Bt(Bt({},e.stepDataMapping[t.stepId][t.fieldId]),{},{objectValue:r})))))}},reset:function(){return Ut}}},Wt=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:zt(zt({},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}}}(Ut))},Gt=Nt({id:Lt(),name:Pt(),description:Pt(),app:Nt({id:Lt(),name:Pt(),description:Pt(),icon_url:Pt(),color:Pt(),publishing_status:Pt(),category:At(Pt()),app_type:Et(Pt()),action_url:Rt(Et(Pt())),created_at:Et(Tt()),tags:Pt()}),branding_app:Nt({id:Lt(),name:Pt(),description:Pt(),icon_url:Pt(),color:Pt(),publishing_status:Pt(),category:At(Pt()),app_type:Et(Pt()),action_url:Rt(Et(Pt())),created_at:Et(Tt()),tags:Pt()}),button_text:Rt(Pt()),is_wizard:Dt(),publishing_status:Pt(),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 jt(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+"`"}))}(At(Nt({id:Lt(),weight:Lt(),title:Pt(),is_visible:Dt(),activity:Nt({id:Lt(),name:Pt(),type:Pt(),endpoint:Pt(),auth_required:Dt(),total_fields:Lt(),app:Nt({id:Lt(),name:Pt(),description:Pt(),icon_url:Pt(),color:Pt(),publishing_status:Pt(),category:At(Pt()),app_type:Et(Pt()),action_url:Rt(Et(Pt())),created_at:Et(Tt()),tags:Pt()}),activity_output:Rt(Pt()),activity_output_url:Rt(Pt()),dynamic_field_data_endpoint:Rt(Pt())}),authorization_type:Nt({id:Lt(),type:Pt(),authorizations:At(Nt({id:Lt(),authorization_type:Pt(),app_user:Et(Lt()),app_user_id:Et(Lt()),disable_link:Et(Pt()),integration_count:Et(Lt()),user_identity:Pt()})),provider:Pt(),is_sandbox_enabled:Dt(),authorization_url_sandbox:Pt()}),template_fields:At(Nt({id:Lt(),is_required:Dt(),is_hidden:Dt(),default_value:Rt(Pt()),weight:Lt(),description:Pt(),summary:Rt(Pt()),placeholder:Rt(Pt()),activity_field:Rt(Nt({id:Lt(),machine_name:Pt(),type:Pt(),title:Pt(),description:Pt(),weight:Lt(),is_required:Dt(),child_fields:Rt(Pt()),is_dynamic:Dt(),data_src:Rt(Pt()),data_src_endpoint:Rt(Lt()),parent_fields:Rt(Pt()),dynamic_field_src:Rt(Pt()),default_value:Rt(Pt()),auto_machine_name:Pt(),dynamic_field_src_endpoint:Rt(Lt()),regex:Rt(Pt()),is_searchable:Dt()})),title:Rt(Pt()),type:Pt(),child_field:Rt(Pt()),child_field_value:Rt(Pt()),button_text:Rt(Pt()),icon_url:Rt(Pt()),long_description:Rt(Pt()),regex:Rt(Pt()),regex_msg:Rt(Pt()),is_visible:Dt()})),allow_multiple_authorizations:Dt(),step_authorization:Rt(Lt()),button_text:Rt(Pt()),is_self_step:Dt(),summary:Rt(Pt()),auth_description:Rt(Pt()),hide_authorization:Dt(),machine_name:Rt(Pt()),is_custom_machine_name:Dt()})),0,Number.POSITIVE_INFINITY)});function Jt(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 qt,Kt="styles-module_loader__2ufbr";Jt(".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 Qt=function(){return _e(qt||(qt=e(["\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'])),Kt)};function Yt(e){return null!=e}var Zt,Xt,$t,en=ve((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}()})),tn="styles-module_preact-hint__2fj-j",nn="styles-module_preact-hint__top__eUj7n",rn="styles-module_preact-hint__bottom__2goUI",on="styles-module_preact-hint__content__23OpK";function an(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 sn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?an(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):an(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ln(t){var n=Xe(null),r=Ue(Ye(1e4),2),i=r[0],o=r[1],a=t.position;return Ze((function(){n.current&&o(n.current.getBoundingClientRect().width)}),[n]),_e(Zt||(Zt=e(['\n <div\n class="','"\n style=',"\n >\n <pre class="," ref=",">\n ","\n </pre\n >\n </div>\n "])),"".concat(tn," ").concat("top"===a?nn:rn),sn(sn({},{left:t.targetBoundingRect.left-t.rootBoundingRect.left-i/2+t.targetBoundingRect.width/2}),"top"===a?{bottom:t.rootBoundingRect.height-t.targetBoundingRect.top+t.rootBoundingRect.top+2}:{top:t.rootBoundingRect.height-t.targetBoundingRect.top+t.rootBoundingRect.top+2}),on,n,t.template?t.template(t.content):t.content)}Jt(".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 un=function(t){var n=t.position,r=void 0===n?"bottom":n,i=t.attribute,o=void 0===i?"data-hint":i,a=Ue(Ye(""),2),s=a[0],l=a[1],u=Ue(Ye(null),2),c=u[0],p=u[1],d=Ue(Ye(null),2),f=d[0],_=d[1],m=et((function(e){p(e),c&&(c.addEventListener("mouseover",(function(e){e.target instanceof Element&&e.target.hasAttribute(o)&&(l(e.target.getAttribute(o)||""),_(e.target.getBoundingClientRect()))})),c.addEventListener("mouseout",(function(e){e.target instanceof Element&&e.target.hasAttribute(o)&&(l(""),_(null))})),t.dismissOnClick&&c.addEventListener("click",(function(){l(""),_(null)})))}),[c]);return _e(Xt||(Xt=e(["\n <div ref=",' style="position: relative">\n ',"\n ","\n </div>\n "])),m,s&&c&&f&&_e($t||($t=e([" <","\n content=","\n position=","\n template=","\n rootBoundingRect=","\n targetBoundingRect=","\n />"])),ln,s,r,t.template,null==c?void 0:c.getBoundingClientRect(),f),t.children)},cn="styles-module_button__osBYJ",pn="styles-module_buttonPrimary__1u5p2",dn="styles-module_disabled__CiT_f",fn="styles-module_buttonSecondary__2HV1m",_n="styles-module_buttonLink__39jcU",mn="styles-module_loader__3dlUQ";Jt(".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 hn,vn,yn,gn,bn,wn=["label","type","color","backgroundColor","disabled","tooltip","dismissOnClick","isLoading","position","onClick"];function xn(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"}(bn||(bn={}));var In,kn,Sn,Cn=function(){return _e(hn||(hn=e(['\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'])))},On=function(){return _e(vn||(vn=e(["\n <div class=",">\n <"," />\n <"," />\n <"," />\n </div>\n"])),mn,Cn,Cn,Cn)},Mn=function(t){var n,r=t.label,o=t.type,a=void 0===o?bn.PRIMARY:o,s=t.color,l=void 0===s?null:s,u=t.backgroundColor,c=void 0===u?null:u,p=t.disabled,d=void 0!==p&&p,f=t.tooltip,_=t.dismissOnClick,m=void 0===_||_,h=t.isLoading,v=void 0!==h&&h,y=t.position,g=void 0===y?"bottom":y,b=t.onClick,w=void 0===b?void 0:b,x=ze(t,wn);return _e(yn||(yn=e(["\n <"," dismissOnClick="," position=",'>\n <button\n type="button"\n onclick=',"\n data-hint=","\n class=","\n style=","\n ","\n >\n ","\n </button>\n <//>\n "])),un,m,g,w,f||null,en(cn,(i(n={},pn,a===bn.PRIMARY),i(n,fn,a===bn.SECONDARY),i(n,_n,a===bn.LINK),i(n,dn,d),n)),{backgroundColor:a===bn.PRIMARY?c:null,borderColor:a===bn.PRIMARY?c:l,color:l},function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xn(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},x),v?_e(gn||(gn=e(["<"," />"])),On):r)},An="styles-module_errorPageWrapper__BMBHQ",Dn="styles-module_errorTitle__1baLE",Tn="styles-module_errorDescription__1dTc9",Rn="styles-module_errorContainer__3WprN",Ln="styles-module_errorPayload__OjsC-";Jt(".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 overflow-x: scroll;\n padding: 4px; }\n .styles-module_errorPageWrapper__BMBHQ .styles-module_errorPayload__OjsC- {\n margin: 0;\n padding: 8px 12px; }\n");var Nn=function(t){var n=t.title,r=t.description,i=t.errorPayload,o=t.onDismiss,a=void 0===o?null:o;return _e(In||(In=e(['\n <div class="','">\n <div class=',">","</div>\n <div class=",">","</div>\n ","\n ","\n </div>\n "])),An,Dn,n,Tn,r,i&&_e(kn||(kn=e(["\n <div class=",">\n <pre class=",">","</pre>\n <pre class=",">","</pre>\n </div>\n "])),Rn,Ln,i.message,Ln,i.stack),a&&_e(Sn||(Sn=e(["\n <div>\n <",' label="Dismiss" onClick='," />\n </div>\n "])),Mn,a))};function En(e){var t,n,r,i,o=Ue(Ye({width:0,height:0}),2),a=o[0],s=o[1],l=et((function(){var t=null==e?void 0:e.current;t&&s({width:t.offsetWidth||0,height:t.offsetHeight||0})}),[e]);return Ze((function(){l()}),[]),t="resize",n=l,i=Xe(),Ze((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 Pn,jn,Fn,zn,Un,Hn="styles-module_navigation__2IuNI",Bn="styles-module_collapse__G_01I",Vn="styles-module_dots__3ItWV",Wn="styles-module_popup__39sdx",Gn="styles-module_show__L1e5K",Jn="styles-module_stepItem__NPXF_",qn="styles-module_arrow__3C8To",Kn="styles-module_navItem__1kxtL",Qn="styles-module_navItemContent__28oLq",Yn="styles-module_imgContainer__wbjM4",Zn="styles-module_active__28cMj",Xn="styles-module_disabled__1Ltqi";function $n(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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: contain; }\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 er,tr,nr=_e(Pn||(Pn=e([' <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>']))),rr=_e(jn||(jn=e(['\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']))),ir=function(t){Ie(i,q);var n=$n(i);function i(){return r(this,i),n.apply(this,arguments)}return lt(i,[{key:"render",value:function(){var t=this.props,n=t.logoUrl,r=t.isActive,i=void 0!==r&&r,o=t.isCompleted,a=void 0!==o&&o,s=t.isDisabled,l=void 0!==s&&s,u=t.isLastStep,c=void 0!==u&&u,p=t.onClick,d=void 0===p?function(){return null}:p,f=t.showArrow,_=void 0===f||f;return _e(Fn||(Fn=e(["\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(Kn," ").concat(l?Xn:""," ").concat(i?Zn:""),d,Qn,Yn,!a||i?_e(zn||(zn=e(["<img src="," />"])),n):nr,c&&rr,this.props.label,!c&&_&&_e(Un||(Un=e(["\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 '])),qn))}}]),i}();function or(e,t){Ze((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 ar,sr,lr,ur,cr,pr=function(t){var n=t.steps,r=t.currentStepIndex,i=t.isPreviewMode,o=t.changeStep,a=Xe(),s=Xe(),l=Ue(Ye(!1),2),u=l[0],c=l[1];return or(a,(function(){return u?c(!1):null})),_e(er||(er=e(["\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 '])),Bn,Vn,s,(function(){return c(!0)}),a,Wn,u?Gn:"",n.map((function(t){return _e(tr||(tr=e(["<div class=",">\n <","\n label=","\n logoUrl=","\n isCompleted=","\n isActive=","\n isDisabled=","\n isLastStep=","\n showArrow=","\n onClick=","\n />\n </div>"])),Jn,ir,"CONFIRMATION"!==t.type?t.title:"Confirmation","CONFIRMATION"!==t.type&&t.iconUrl,!i&&t.isCompleted,"CONFIRMATION"!==t.type&&r===t.itemIndex,i&&Number(r)!==t.itemIndex||Number(r)<t.itemIndex,!1,!1,(function(){c(!1),o(t.itemIndex)}))})),qn)};function dr(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 fr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dr(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _r,mr,hr,vr,yr=ge.connect("stepState",Vt)((function(t){var n=Xe(),r=t.gotoStep,i=t.stepState,o=i.stepIndex,a=i.steps,s=i.currentStep,l=tt(Ft),u=function(e,t){var n=Ue(Ye(e),2),r=n[0],i=n[1];return Ze((function(){var n=setTimeout((function(){return i(e)}),t||500);return function(){clearTimeout(n)}}),[e,t]),r}(En(n).width,250),c=Ue(Ye([]),2),p=c[0],d=c[1];Ze((function(){if(console.log("RENDER",u),0!==u){var e=[];if(n.current){var t=0;console.log("Width of step container:",u),console.log("Max width:",180),console.log("Number of steps:",a.length);var r=u/180;console.log("step_width / MAX_WIDTH:",r),r<=a.length?a.length<=2?e.push({type:"VISIBLE",steps:a.map((function(e,t){return fr(fr({},e),{},{itemIndex:t})}))}):a.length>2&&(e.push({type:"VISIBLE",steps:[fr(fr({},a[0]),{},{itemIndex:t})]}),0!==o&&o!==a.length?(o>1&&e.push({type:"COLLAPSED",steps:a.slice(1,o).map((function(e){return t+=1,fr(fr({},e),{},{itemIndex:t})}))}),e.push({type:"VISIBLE",steps:[fr(fr({},a[o]),{},{itemIndex:o})]}),a.length-o>1&&e.push({type:"COLLAPSED",steps:a.slice(o+1,a.length).map((function(e){return t+=1,fr(fr({},e),{},{itemIndex:t})}))})):(console.log("Show first, last, collapsed steps in middle"),e.push({type:"COLLAPSED",steps:a.slice(1,a.length).map((function(e){return t+=1,fr(fr({},e),{},{itemIndex:t})}))}))):(console.log("Showing all"),e=[{type:"VISIBLE",steps:a.map((function(e,t){return fr(fr({},e),{},{itemIndex:t})}))}])}console.log({composedArray:e}),d(e)}}),[a,u,o]);var f=function(e){r(e)};return _e(ar||(ar=e(["\n <div class="," ref=",">\n ","\n ","\n </div>\n "])),Hn,n,p.map((function(t){return"VISIBLE"===t.type?t.steps.map((function(t){return _e(sr||(sr=e(["\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 "])),Jn,{maxWidth:180},ir,"CONFIRMATION"!==t.type?t.title:"Confirmation","CONFIRMATION"!==t.type&&t.iconUrl,!(null!=l&&l.isPreviewMode)&&t.isCompleted,"CONFIRMATION"!==(null==s?void 0:s.type)&&"CONFIRMATION"!==t.type&&o===t.itemIndex,(null==l?void 0:l.isPreviewMode)&&Number(o)!==t.itemIndex||Number(o)<t.itemIndex,t.itemIndex===a.length,(function(){return f(t.itemIndex)}))})):"COLLAPSED"===t.type?_e(lr||(lr=e(["\n <","\n isPreviewMode=","\n currentStepIndex=","\n changeStep=","\n steps=","\n />\n "])),pr,null==l?void 0:l.isPreviewMode,o,f,t.steps):_e(ur||(ur=e(["<></>"])))})),p.length>0&&_e(cr||(cr=e(["\n <",'\n label="Confirmation"\n logoUrl=""\n isCompleted=',"\n isActive=","\n isDisabled=","\n isLastStep=","\n onClick=","\n />\n "])),ir,!0,void 0!==s&&o===a.length,void 0!==s&&o!==a.length,!0,(function(){var e;return f(null!==(e=a.length)&&void 0!==e?e:0)})))})),gr="styles-module_radio__1wJfU",br="styles-module_button__3PLW1",wr="styles-module_text__Jq7I0",xr="styles-module_description__2UsHV";Jt(".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 Ir,kr=function(t){var n=t.label,r=t.name,i=t.description,o=void 0===i?null:i,a=t.value,s=t.isChecked,l=void 0!==s&&s,u=t.handleChange,c=void 0===u?function(){return null}:u;return _e(_r||(_r=e(["\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 "])),gr,a,r,a,l,(function(e){if(e.currentTarget instanceof HTMLInputElement){var t=e.currentTarget.value;c(t)}}),a,br,_e(l?mr||(mr=e(['\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 '])):hr||(hr=e(['\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 ']))),wr,n,o&&_e(vr||(vr=e(["<div class=",">","</div>"])),xr,o))},Sr="styles-module_errorMessage__2b8A_";Jt(".styles-module_errorMessage__2b8A_ {\n margin-top: 4px;\n font-size: 12px;\n color: #f05c42; }\n");var Cr,Or,Mr,Ar=function(t){var n=t.children;return _e(Ir||(Ir=e([" <div class=",">","</div> "])),Sr,n)},Dr="styles-module_label__PbFlo",Tr="styles-module_required__1XFqi";Jt(".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 Rr=function(t){var n=t.title,r=t.description,i=t.isRequired,o=void 0!==i&&i;return _e(Cr||(Cr=e(["\n <div class=",">\n <label>\n <div>\n ","\n ","\n </div>\n ","\n </label>\n </div>\n "])),Dr,n,o&&_e(Or||(Or=e(["<span class=",">*</span>"])),Tr),r&&_e(Mr||(Mr=e(["<div>","</div>"])),r))},Lr=function(){return!["undefined"==typeof window?"undefined":o(window),"undefined"==typeof document?"undefined":o(document)].includes("undefined")};var Nr,Er,Pr,jr,Fr,zr,Ur,Hr,Br,Vr,Wr,Gr="styles-module_authSelectorWrap__34g8J",Jr="styles-module_rows__1gpAK",qr="styles-module_error__aL4zj",Kr="styles-module_checkboxRow__3Q67t",Qr="styles-module_statusWrap__3amIr",Yr="styles-module_deleteIcon__1mAJb",Zr="styles-module_status__OwFQa",Xr="styles-module_statusRed__1FG13",$r="styles-module_statusOrange__1FNhi",ei="styles-module_statusGreen__1OD_4",ti="styles-module_resend__To8qG";function ni(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 ri=function(){return _e(Nr||(Nr=e(["\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'])),ti)},ii=function(t){var n=t.label,r=t.name,i=t.value,o=t.isChecked,a=t.status,s=void 0===a?"IDLE":a,l=t.isDeleting,u=void 0!==l&&l,c=t.handleChange,p=t.handleReverify,d=t.handleDelete,f=void 0===d?function(){return null}:d,_=t.error;return _e(Er||(Er=e(["\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 "])),Kr,kr,n,r,i,o,c,Qr,Zr,"VERIFYING"===s&&!u&&_e(Pr||(Pr=e(["<div class="," />\n Verifying <"," /> "])),$r,Qt),"CONNECTED"===s&&!_&&!u&&_e(jr||(jr=e(["<div class="," />\n Connected"])),ei),"ERROR"===s&&!u&&_e(Fr||(Fr=e(["<div class="," />\n Failed\n <div onclick=","><"," /></div>"])),Xr,p,ri),u&&_e(zr||(zr=e(["<"," />"])),Qt),_&&!u&&!("VERIFYING"===s)&&_e(Ur||(Ur=e(["<div class=",">","</div>"])),qr,_),Yr,f,!("VERIFYING"===s||u)&&_e(Hr||(Hr=e(['\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 ']))))},oi=function(t){Ie(o,q);var n=ni(o);function o(e){var t;return r(this,o),i(we(t=n.call(this,e)),"verifyAuth",(function(e){var n=t.props.stepId,r=t.props.stepMapping[n].authorizations[e];r&&(r.isVerified?t.props.onAuthSelected(r.authorizationId,!0):(t.props.toggleVerifyAuthorizationFlag({stepId:n,authId:r.authorizationId,isVerifying:!0}),t.setState({isLoading:!0}),t.props.apiHandler.verifyOAuth(r.authorizationId).then((function(e){e?t.props.onAuthSelected(r.authorizationId,!0):t.props.onAuthSelected(r.authorizationId,!1)})).catch((function(e){return console.error(e)})).finally((function(){t.props.toggleVerifyAuthorizationFlag({stepId:n,authId:r.authorizationId,isVerifying:!1}),t.setState({isLoading:!1})}))))})),i(we(t),"deleteAuth",(function(e){var n=t.props.stepId,r=t.props.stepMapping[n].authorizations[e];t.props.toggleDeleteAuthorizationFlag({stepId:n,authId:r.authorizationId,isDeleting:!0,error:""}),t.props.apiHandler.deleteAuth(r.authorizationId).then((function(e){200===(null==e?void 0:e.status)?t.props.removeAuthorization({stepId:n,authId:r.authorizationId}):405===(null==e?void 0:e.status)?t.props.toggleDeleteAuthorizationFlag({stepId:n,authId:r.authorizationId,isDeleting:!1,error:"".concat(e.data)}):t.props.toggleDeleteAuthorizationFlag({stepId:n,authId:r.authorizationId,isDeleting:!1,error:"An unexpected error occurred"})})).catch((function(e){console.error(e)}))})),i(we(t),"onAuthResponseReceived",(function(e){void 0!==e&&e.data.activity_name&&(console.info(e.data),t.props.stepId&&(e.data.already_exists?t.props.setStepAuthId({stepId:t.props.stepId,authId:Number(e.data.authorization_id)}):t.props.addAuthorization({stepId:t.props.stepId,authData:{authorizationId:e.data.authorization_id,userIdentity:e.data.user_identity,disableLink:"",authType:"",isVerified:!1,didFetchStatus:!1,isVerifying:!1,isDeleting:!1,error:""}})))})),i(we(t),"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})),i(we(t),"getError",(function(){var e=t.props.stepId,n=t.props.stepMapping[e];return n.authorizations?"Please select a valid ".concat(n.step.activity.app.name," account"):"Please add a valid ".concat(n.step.activity.app.name," account")})),i(we(t),"openAuthWindow",(function(){var e=t.props,n=e.stepMapping[e.stepId].step;n&&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))}}(t.context.apiHandler.getAuthUrl(n.authorization_type.id),"Auth Window",window,800,600)})),t.state={isLoading:!1,fetched:!1},t}return lt(o,[{key:"componentDidMount",value:function(){Lr()&&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)}},{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(){Lr()&&window.removeEventListener("message",this.onAuthResponseReceived)}},{key:"render",value:function(){var t=this,n=this.props,r=n.stepId,i=n.showErrors,o=void 0!==i&&i,a=this.props.stepMapping[r],s=a.authorizations;return _e(Br||(Br=e(["\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 "])),Gr,Rr,"Select your ".concat(a.step.activity.app.name," account"),!0,Jr,s.map((function(n,r){return _e(Vr||(Vr=e(["<","\n label=","\n value=","\n status=","\n isChecked=","\n isDeleting=","\n error=","\n handleChange=","\n handleReverify=","\n handleDelete=","\n />"])),ii,n.userIdentity,n.authorizationId,t.getAuthStatus(n),n.authorizationId===a.selectedAuthId,n.isDeleting,n.error,(function(){return t.verifyAuth(r)}),(function(){return t.verifyAuth(r)}),(function(){return t.deleteAuth(r)}))})),o?"".concat(qr):"",Mn,(function(){return t.openAuthWindow()}),"Add ".concat(a.step.activity.app.name," account"),bn.SECONDARY,this.state.isLoading,o&&_e(Wr||(Wr=e(["<",">","<//>"])),Ar,this.getError()))}}]),o}();i(oi,"contextType",Ft);var ai,si,li=ge.connect(["stepMapping"],Vt)(oi),ui="styles-module_listboxGroupWrapper__1Kt5M",ci="styles-module_listbox__2x2uP",pi="styles-module_customSelect__3d-hM",di="styles-module_open__2fBAx",fi="styles-module_customOptions__3iNrM",_i="styles-module_customSelectTrigger__2MlIG",mi="styles-module_selected__nLzUy",hi="styles-module_error__2KcSW",vi="styles-module_arrow__TPQOZ",yi="styles-module_close__3wlz1",gi="styles-module_listboxItem__2jMpi";Jt(".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 bi,wi,xi,Ii,ki,Si,Ci,Oi,Mi,Ai,Di,Ti,Ri,Li,Ni,Ei,Pi,ji,Fi=function(t){var n=t.id,r=t.value,i=t.isSelected,o=t.onClick;return _e(ai||(ai=e(["\n <span\n class=","\n data-value=","\n onclick=","\n >\n ","\n ","\n </span>\n "])),"".concat(gi," ").concat(i?mi:""),n,o,i&&_e(si||(si=e(['\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 ']))),r)},zi=function(t){var n=t.title,r=t.description,i=t.items,o=void 0===i?[]:i,a=t.value,s=void 0===a?null:a,l=t.isOpen,u=void 0!==l&&l,c=t.isDynamic,p=void 0!==c&&c,d=t.endpointData,f=t.isRequired,_=void 0!==f&&f,m=t.placeholder,h=t.onChange,v=void 0===h?function(){return null}:h,y=t.showStepValidation,g=void 0!==y&&y,b=t.responseMapper,w=void 0===b?function(e){return e}:b,x=Ue(Ye(o),2),I=x[0],k=x[1],S=Ue(Ye(p&&!o.length&&!s),2),C=S[0],O=S[1],M=Ue(Ye(u),2),A=M[0],D=M[1],T=Xe();or(T,(function(){return A&&D(!1)})),Ze((function(){var e=t.apiHandler,n=t.isDynamic,r=t.endpointUrl;if(n&&r){var i;O(!0);try{i=JSON.parse(d)}catch(e){i=""}e.callDynamicDataEndpoint(new URL(r),i).then((function(e){O(!1),e&&k(w(e))}))}}),[d]);var R=function(){D((function(e){return!e}))},L=$e((function(){var e=I.findIndex((function(e){return e.id===s}));return e>-1?I[e].value:""}),[I,s]);return _e(bi||(bi=e(["\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,ui,n&&_e(wi||(wi=e(["\n <","\n title=","\n description=","\n isRequired=","\n />\n "])),Rr,n,r,_),ci,"".concat(pi," ").concat(A?di:""),"".concat(_i," ").concat(g&&!s&&_&&!A&&hi),0,R,(function(e){"Enter"===e.key&&R()}),s&&mi,C?_e(xi||(xi=e(["Loading"]))):_e(Ii||(Ii=e(["\n ","\n "])),I.length>0?_e(ki||(ki=e(["\n ","\n "])),s?_e(Si||(Si=e(["",""])),L):_e(Ci||(Ci=e(["",""])),m||"Please Select...")):_e(Oi||(Oi=e(["No options"])))),T,C?_e(Mi||(Mi=e(["<","><//>"])),Qt):_e(Ai||(Ai=e(["\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(vi," ").concat(A?yi:"")),fi,I.length>0&&!C&&_e(Di||(Di=e(["\n ","\n "])),I.map((function(t){return _e(Ti||(Ti=e(["\n <","\n key=","\n id=","\n value=","\n isSelected=","\n onClick=","\n ><//>\n "])),Fi,t.id,t.id,t.value,s===t.id,(function(){v(t.id),D(!1)}))}))),g&&!s&&!A&&_&&_e(Ri||(Ri=e([" <",">Please select an option</",">"])),Ar,Ar))},Ui="styles-module_checkboxWrap__JzZMA",Hi="styles-module_checkbox__3mvqm",Bi="styles-module_button__2oPQ0",Vi="styles-module_text__1AHNH",Wi="styles-module_description__3Ox13";Jt(".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 Gi,Ji=function(t){var n=t.label,r=t.name,i=t.description,o=void 0===i?null:i,a=t.value,s=t.isRequired,l=void 0!==s&&s,u=t.isChecked,c=void 0!==u&&u,p=t.showStepValidation,d=void 0!==p&&p,f=t.handleChange,_=void 0===f?function(){return null}:f;return _e(Li||(Li=e(["\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=",">","</div>\n ","\n </div>\n </label>\n </div>\n ","\n </div>\n "])),Ui,Hi,r,r,r,a,c,(function(e){if(e.target instanceof HTMLInputElement){var t=e.target,n=t.id,r=t.checked;_(n,r)}}),Bi,_e(c?Ni||(Ni=e(['\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 '])):Ei||(Ei=e(['\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 ']))),Vi,n,o&&_e(Pi||(Pi=e(["<div class=",">","</div>"])),Wi,o),d&&!a&&l&&_e(ji||(ji=e([" <",">Please select an option</",">"])),Ar,Ar))},qi="styles-module_loader__1RKKC";Jt(".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 Ki,Qi,Yi,Zi,Xi,$i=function(){return _e(Gi||(Gi=e(["\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'])),qi)},eo="styles-module_selectWrapper__wU7p8",to="styles-module_selectedVal__11vC7";Jt(".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 no,ro,io,oo,ao,so,lo,uo=function(t){var n=t.placeholder,r=t.ariaLabel,i=t.value,o=t.options,a=void 0===o?[]:o,s=t.showUnselectedValue,l=void 0!==s&&s,u=t.unselectedText,c=void 0===u?"Select a value":u,p=t.isRequired,d=void 0!==p&&p,f=t.showStepValidation,_=void 0!==f&&f,m=t.onChange,h=void 0===m?function(){return null}:m;return _e(Ki||(Ki=e(["\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 "])),eo,r,(function(e){if(e.currentTarget instanceof HTMLSelectElement){var t=e.currentTarget.value,n=a.findIndex((function(e){return"".concat(e.key)==="".concat(t)}));h(n)}}),i&&to,l&&_e(Qi||(Qi=e([' <option value="">',"</option> "])),c),void 0===i&&_e(Yi||(Yi=e(['\n <option value="" disabled selected hidden>',"</option>\n "])),n),a.map((function(t){return _e(Zi||(Zi=e(["\n <option value="," selected=",">\n ","\n </option>\n "])),t.key,i===t.key,t.label)})),d&&!i&&_&&_e(Xi||(Xi=e(["<",">Please map this required field<//>"])),Ar))},co="styles-module_mappingWrap__cU3_M",po="styles-module_mappingInfo__2Nvsw",fo="styles-module_mappingRow__LbAkF",_o="styles-module_loader__3uPJj",mo="styles-module_title__3EC37",ho="styles-module_sampleData__ZpCR2",vo="styles-module_selectBox__2gn7w",yo="styles-module_mappingHeaderItem__3Ue0A";function go(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 bo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?go(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):go(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Jt(".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 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 wo,xo,Io=ge.connect(["stepState","genericData","stepMapping","activityOutputData","dynamicFieldData","stepDataMapping","parentChildMapping"],Vt)((function(t){var r,o,a=Ue(Ye(!1),2),s=a[0],l=a[1],u=Ue(Ye(!1),2),c=u[0],p=u[1],d=Ue(Ye(!1),2),f=d[0],_=d[1],m=Ue(Ye([]),2),h=m[0],v=m[1],y=Ue(Ye(""),2),g=y[0],b=y[1],w=tt(Ft),x=Xe(""),I=Xe([]);Ze((function(){h.length>0&&h.map((function(e){var n=t.stepDataMapping[t.stepId][e.fieldId];null!=n&&n.value&&(I.current=[].concat(je(I.current),[e.fieldId])),null!=n&&n.objectValue&&(I.current=[].concat(je(I.current),je(Array(Object.keys(n.objectValue).length).map((function(){return e.fieldId})))))}))}),[h]),Ze((function(){var e=t.templateFields.filter((function(e){return e.activity_field&&"DYNAMIC"===e.activity_field.type}))[0];e&&b("".concat(e.id));var n=t.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(e.activity_field){var r,o=t.parentChildMapping[t.stepId][e.activity_field.machine_name],a="";if(o){var s,u=null===(s=o.parentFields)||void 0===s?void 0:s.reduce((function(e,n){var r=t.parentChildMapping[t.stepId][n].fieldId;return bo(bo({},e),{},i({},r,t.stepDataMapping[t.stepId][r].value))}),{});a=JSON.stringify(u)}if(a!==x.current)l(!0),p(!0),_(!0),S(),null===(r=C(e))||void 0===r||r.then((function(e){l(!1),t.resetCustomMappingData(t.stepId),I.current=[],x.current=a,Array.isArray(e)&&v([].concat(je(n),je(e)))})).catch((function(e){return console.error(e)}))}}),[t.stepDataMapping[t.stepId]]);var k=function(e){var n=t.stepDataMapping[e];return Object.keys(n).filter((function(e){return n[Number(e)].value})).reduce((function(e,t){var r=n[Number(t)];return bo(bo({},e),{},i({},r.machineName,r.value))}),{})},S=function(){var e=n(F.mark((function e(){var n,r,i;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.stepState.steps[0].stepId,r=k(n),n&&("TRIGGER"!==(i=t.stepMapping[n].step).activity.type&&"QUERY"!==i.activity.type||(i.activity.activity_output_url?(p(!0),null==w||w.apiHandler.callDynamicDataEndpoint(new URL(i.activity.activity_output_url),bo({authorization_id:"".concat(t.stepMapping[n].selectedAuthId)},r)).then((function(e){p(!1),e&&t.setActivityOutputData({activityOutputData:e})}))):p(!1),i.activity.dynamic_field_data_endpoint?(_(!0),null==w||w.apiHandler.callDynamicDataEndpoint(new URL(i.activity.dynamic_field_data_endpoint),bo({authorization_id:"".concat(t.stepMapping[n].selectedAuthId)},r)).then((function(e){_(!1),e&&t.setDynamicFieldData({dynamicFieldData:e})}))):_(!1)));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),C=function(e){var n,r="".concat(null===(n=e.activity_field)||void 0===n?void 0:n.dynamic_field_src);return null==w?void 0:w.apiHandler.callDynamicDataEndpoint(new URL(r),bo({authorization_id:"".concat(t.endpointData.authId)},t.endpointData.fieldsData))};return _e(no||(no=e(["\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 "])),Rr,s||c||f?_e(ro||(ro=e(["<div class=","><"," /></div>"])),_o,$i):_e(io||(io=e(["\n <div class=",">\n <div class=",">\n <div class=",">\n <img src="," />\n <div>"," Field</div>\n </div>\n <div class=",">Sample Data</div>\n <div class=",">\n <img\n src=","\n />\n <div>\n ","\n </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 "])),co,fo,yo,null===(r=t.genericData.templateApp)||void 0===r?void 0:r.iconUrl,null===(o=t.genericData.templateApp)||void 0===o?void 0:o.name,ho,yo,t.stepMapping[t.stepId].step.activity.app.icon_url,"".concat(t.stepMapping[t.stepId].step.activity.app.name," Field"),h.map((function(n){var r,i,o,a=t.stepDataMapping[t.stepId][n.fieldId];return null!=a&&a.value&&(o=a.value.slice(1,-1)),_e(oo||(oo=e(["\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 "])),fo,mo,n.title,(null==a?void 0:a.isRequired)&&_e(ao||(ao=e(["<span>*</span>"]))),ho,t.dynamicFieldData&&(null==a?void 0:a.value)&&(null===(r=t.dynamicFieldData[null==a?void 0:a.value])||void 0===r?void 0:r.map((function(t){return t?_e(so||(so=e(["<pre>","</pre>"])),t):_e(lo||(lo=e([""])))}))),vo,uo,null===(i=t.activityOutputData)||void 0===i?void 0:i.map((function(e){return{key:e.value,label:e.text}})),o,null==a?void 0:a.isRequired,t.showStepValidation,!0,(function(e){return function(e,n){var r,i=null===(r=t.activityOutputData)||void 0===r?void 0:r[e];if(e<0){if(n.isNotDynamic)I.current=I.current.filter((function(e){return e!==n.fieldId})),t.setStepFieldData({stepId:"".concat(t.stepId),fieldId:"".concat(n.fieldId),value:""});else if(g){var o=I.current.findIndex((function(e){return e===Number(g)}));o>-1&&I.current.splice(o,1),t.setStepMappingData({stepId:t.stepId,fieldId:Number(g),id:"".concat(n.id),value:null})}}else i&&(n.isNotDynamic?(I.current=[].concat(je(I.current),[n.fieldId]),t.setStepFieldData({stepId:"".concat(t.stepId),fieldId:"".concat(n.fieldId),value:"{".concat(i.value,"}")})):g&&(I.current=[].concat(je(I.current),[Number(g)]),t.setStepMappingData({stepId:t.stepId,fieldId:Number(g),id:"".concat(n.id),value:"{".concat(i.value,"}")})))}(e,n)}))})),po,I.current.length," ",1!==I.current.length?"s":"",h.length-I.current.length," ",h.length-I.current.length!=1?"s":""))})),ko="styles-module_inputWrapper__1XBHY";Jt(".styles-module_inputWrapper__1XBHY {\n position: relative;\n width: 100%;\n padding-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 So,Co,Oo=function(t){var n=t.placeholder,r=t.value,i=t.type,o=void 0===i?"text":i,a=t.control,s=t.handleChange,l=void 0===s?function(){return null}:s;return _e(wo||(wo=e(["\n <div class=",">\n <input\n type=","\n placeholder=","\n value=","\n onkeyup=","\n />\n ","\n </div>\n "])),ko,o,n,r,(function(e){if(e.currentTarget instanceof HTMLInputElement){var t=e.currentTarget.value;l(t)}}),a&&_e(xo||(xo=e(["<"," //>"])),a))},Mo="styles-module_inputGroupWrapper__FJc-g";Jt(".styles-module_inputGroupWrapper__FJc-g fieldset {\n padding: 0;\n margin: 0;\n border: none; }\n");var Ao=function(t){var n=t.title,r=t.description,i=t.placeholder,o=t.value,a=t.showStepValidation,s=void 0!==a&&a,l=t.isRequired,u=void 0!==l&&l,c=t.onChange,p=void 0===c?function(){return null}:c;return _e(So||(So=e(['\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 "])),Mo,Rr,n,r,Oo,i,(function(e){p(e)}),o,s&&u&&_e(Co||(Co=e(["",">Please enter a value<//>"])),Ar))};Jt(".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 width: 20px;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n margin: 0 auto; }\n .styles-module_dateGroupWrapper__cV-ne .styles-module_visibilityToggle__1l7Vl svg {\n cursor: pointer; }\n .styles-module_dateGroupWrapper__cV-ne .styles-module_visibilityToggle__1l7Vl svg:hover {\n opacity: 0.5; }\n");Jt(".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: 18px; }\n\n.styles-module_visibilityToggle__3_Kyp {\n display: flex;\n align-items: center;\n width: 10px;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n margin: 0 auto; }\n .styles-module_visibilityToggle__3_Kyp svg {\n cursor: pointer; }\n");var Do,To,Ro,Lo,No,Eo,Po,jo,Fo,zo,Uo,Ho,Bo,Vo,Wo=ve((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,p=c.apply,d=c.construct;p||(p=function(e,t,n){return e.apply(t,n)}),s||(s=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 f=I(Array.prototype.forEach),_=I(Array.prototype.pop),m=I(Array.prototype.push),h=I(String.prototype.toLowerCase),v=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 p(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 d(e,n)}}function S(e,t){n&&n(e,null);for(var i=t.length;i--;){var o=t[i];if("string"==typeof o){var a=h(o);a!==o&&(r(t)||(t[i]=a),o=a)}e[o]=!0}return e}function C(e){var n=u(null),r=void 0;for(r in e)p(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"]),A=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"]),D=s(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),T=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"]),E=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"]),P=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),U=l(/<%[\s\S]*|[\s\S]*%>/gm),H=l(/^data-[\-\w.\u00B7-\uFFFF]/),B=l(/^aria-[\-\w]+$/),V=l(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),W=l(/^(?:\w+script|data):/i),G=l(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),J="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 q(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},Q=function(e,t){if("object"!==(void 0===e?"undefined":J(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,p=void 0===c?e.NamedNodeMap||e.MozNamedAttrMap:c,d=e.Text,I=e.Comment,k=e.DOMParser,Z=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=Q(Z,n),oe=ie&&je?ie.createHTML(""):"",ae=r,se=ae.implementation,le=ae.createNodeIterator,ue=ae.createDocumentFragment,ce=ae.getElementsByTagName,pe=n.importNode,de={};try{de=C(r).documentMode?r.documentMode:{}}catch(e){}var fe={};t.isSupported="function"==typeof ne&&se&&void 0!==se.createHTMLDocument&&9!==de;var _e=z,me=U,he=H,ve=B,ye=W,ge=G,be=V,we=null,xe=S({},[].concat(q(M),q(A),q(D),q(R),q(N))),Ie=null,ke=S({},[].concat(q(E),q(P),q(j),q(F))),Se=null,Ce=null,Oe=!0,Me=!0,Ae=!1,De=!1,Te=!1,Re=!1,Le=!1,Ne=!1,Ee=!1,Pe=!0,je=!1,Fe=!0,ze=!0,Ue=!1,He={},Be=null,Ve=S({},["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,Ge=S({},["audio","video","img","source","image","track"]),Je=null,qe=S({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ke="http://www.w3.org/1998/Math/MathML",Qe="http://www.w3.org/2000/svg",Ye="http://www.w3.org/1999/xhtml",Ze=Ye,Xe=!1,$e=null,et=r.createElement("form"),tt=function(e){$e&&$e===e||(e&&"object"===(void 0===e?"undefined":J(e))||(e={}),e=C(e),we="ALLOWED_TAGS"in e?S({},e.ALLOWED_TAGS):xe,Ie="ALLOWED_ATTR"in e?S({},e.ALLOWED_ATTR):ke,Je="ADD_URI_SAFE_ATTR"in e?S(C(qe),e.ADD_URI_SAFE_ATTR):qe,We="ADD_DATA_URI_TAGS"in e?S(C(Ge),e.ADD_DATA_URI_TAGS):Ge,Be="FORBID_CONTENTS"in e?S({},e.FORBID_CONTENTS):Ve,Se="FORBID_TAGS"in e?S({},e.FORBID_TAGS):{},Ce="FORBID_ATTR"in e?S({},e.FORBID_ATTR):{},He="USE_PROFILES"in e&&e.USE_PROFILES,Oe=!1!==e.ALLOW_ARIA_ATTR,Me=!1!==e.ALLOW_DATA_ATTR,Ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=e.SAFE_FOR_TEMPLATES||!1,Te=e.WHOLE_DOCUMENT||!1,Ne=e.RETURN_DOM||!1,Ee=e.RETURN_DOM_FRAGMENT||!1,Pe=!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,Ue=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||be,Ze=e.NAMESPACE||Ye,De&&(Me=!1),Ee&&(Ne=!0),He&&(we=S({},[].concat(q(N))),Ie=[],!0===He.html&&(S(we,M),S(Ie,E)),!0===He.svg&&(S(we,A),S(Ie,P),S(Ie,F)),!0===He.svgFilters&&(S(we,D),S(Ie,P),S(Ie,F)),!0===He.mathMl&&(S(we,R),S(Ie,j),S(Ie,F))),e.ADD_TAGS&&(we===xe&&(we=C(we)),S(we,e.ADD_TAGS)),e.ADD_ATTR&&(Ie===ke&&(Ie=C(Ie)),S(Ie,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&S(Je,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(Be===Ve&&(Be=C(Be)),S(Be,e.FORBID_CONTENTS)),ze&&(we["#text"]=!0),Te&&S(we,["html","head","body"]),we.table&&(S(we,["tbody"]),delete Se.tbody),s&&s(e),$e=e)},nt=S({},["mi","mo","mn","ms","mtext"]),rt=S({},["foreignobject","desc","title","annotation-xml"]),it=S({},A);S(it,D),S(it,T);var ot=S({},R);S(ot,L);var at=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:Ye,tagName:"template"});var n=h(e.tagName),r=h(t.tagName);if(e.namespaceURI===Qe)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===Qe?"math"===n&&rt[r]:Boolean(ot[n]);if(e.namespaceURI===Ye){if(t.namespaceURI===Qe&&!rt[r])return!1;if(t.namespaceURI===Ke&&!nt[r])return!1;var i=S({},["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||Ee)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=v(e,/^[\r\n\t ]+/);n=i&&i[0]}var o=ie?ie.createHTML(e):e;if(Ze===Ye)try{t=(new k).parseFromString(o,"text/html")}catch(e){}if(!t||!t.documentElement){t=se.createDocument(Ze,"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),Ze===Ye?ce.call(t,Te?"html":"body")[0]:Te?t.documentElement:a},ct=function(e){return le.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},pt=function(e){return!(e instanceof d||e instanceof I||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof p&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},dt=function(e){return"object"===(void 0===a?"undefined":J(a))?e instanceof a:e&&"object"===(void 0===e?"undefined":J(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),pt(e))return st(e),!0;if(v(e.nodeName,/[\u0080-\uFFFF]/))return st(e),!0;var r=h(e.nodeName);if(ft("uponSanitizeElement",e,{tagName:r,allowedTags:we}),!dt(e.firstElementChild)&&(!dt(e.content)||!dt(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]||Se[r]){if(ze&&!Be[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)?(De&&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&&!Ce[t]&&w(he,t));else if(Oe&&w(ve,t));else{if(!Ie[t]||Ce[t])return!1;if(Je[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(Ae&&!w(ye,y(n,ge,"")));else if(n)return!1}return!0},ht=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=h(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{De&&(r=y(r,_e," "),r=y(r,me," "));var p=e.nodeName.toLowerCase();if(mt(p,i,r))try{c?e.setAttributeNS(c,u,r):e.setAttribute(u,r),_(t.removed)}catch(e){}}}ft("afterSanitizeAttributes",e,null)}},vt=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),ht(n));ft("afterSanitizeShadowDOM",t,null)};return t.sanitize=function(r,o){var s=void 0,l=void 0,u=void 0,c=void 0,p=void 0;if((Xe=!r)&&(r="\x3c!--\x3e"),"string"!=typeof r&&!dt(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"===J(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof r)return e.toStaticHTML(r);if(dt(r))return e.toStaticHTML(r.outerHTML)}return r}if(Re||tt(o),t.removed=[],"string"==typeof r&&(Ue=!1),Ue);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&&!De&&!Te&&-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 d=ct(Ue?r:s);u=d.nextNode();)3===u.nodeType&&u===c||_t(u)||(u.content instanceof i&&vt(u.content),ht(u),c=u);if(c=null,Ue)return r;if(Ne){if(Ee)for(p=ue.call(s.ownerDocument);s.firstChild;)p.appendChild(s.firstChild);else p=s;return Pe&&(p=pe.call(n,p,!0)),p}var f=Te?s.outerHTML:s.innerHTML;return De&&(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=h(e),i=h(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()}()})),Go="styles-module_stepsWrap__1Yzhl",Jo="styles-module_stepWrap__eLO77";function qo(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 Ko(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qo(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qo(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".styles-module_stepsWrap__1Yzhl {\n width: 100%; }\n\n.styles-module_stepWrap__eLO77 {\n margin-bottom: 30px; }\n");var Yo,Zo,Xo,$o,ea,ta,na,ra,ia,oa,aa,sa,la,ua,ca,pa=function(t){Ie(o,q);var n=Qo(o);function o(e){var t;return r(this,o),i(we(t=n.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 Ko(Ko({},t),{},i({},r.machineName,r.value))}),{})})),i(we(t),"areParentValuesFilled",(function(e,n){for(var r=!0,i=0;i<n.length;i+=1){var o=n[i],a=t.props.parentChildMapping[e][o].fieldId,s=t.props.stepDataMapping[e]&&t.props.stepDataMapping[e][a];if(!s||!s.value){r=!1;break}}return r})),i(we(t),"doParentFieldsHaveValues",(function(e,n){var r=!0,i=t.props.parentChildMapping[e][n];if(i&&i.parentFields)for(var o=0;o<i.parentFields.length;o+=1){var a=t.props.parentChildMapping[e][i.parentFields[o]],s=t.props.stepDataMapping[e]&&t.props.stepDataMapping[e][a.fieldId];if(!s||!s.value){r=!1;break}}return r})),i(we(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 i=!e.is_hidden,o=r.selectedAuthId,a=t.props.parentChildMapping[n][e.activity_field.machine_name].parentFields,s=!0;return a&&(s=t.areParentValuesFilled(n,a)),i&&o&&s}return!1})),i(we(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})),i(we(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})),i=n.selectedAuthId,o=r.filter((function(e){return e.activity_field&&"DYNAMIC"===e.activity_field.type}))[0];return!o||!!(r.length>0&&o&&o.activity_field&&i&&t.doParentFieldsHaveValues(e,o.activity_field.machine_name))})),i(we(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})),i=n.selectedAuthId,o=r.filter((function(e){return e.activity_field&&"DYNAMIC"===e.activity_field.type}))[0];if(!o)return!1;if(r.length>0&&i&&o&&o.activity_field&&t.doParentFieldsHaveValues(e,o.activity_field.machine_name))return!0}return!1})),i(we(t),"getMappingDataInput",(function(){var e=t.props.step.id;return{authId:(t.props.stepMapping&&t.props.stepMapping[e]).selectedAuthId,fieldsData:t.getVisibleFieldsDataOnRootStep()}})),i(we(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 i({},r[0],t.props.stepDataMapping[n][o].value)}}return null})),t.state={loading:!1},t}return lt(o,[{key:"componentDidMount",value:function(){this.props.verifyStepValidity(this.props.step.id)}},{key:"render",value:function(){var t=this,n=this.props,r=n.step,i=n.stepMapping,o=n.stepDataMapping,a=n.setStepFieldData,s=n.showStepValidation,l=i[r.id]&&i[r.id].step,u=o&&o[r.id];return _e(Do||(Do=e(["\n ","\n "])),this.state.loading?_e(To||(To=e(["<"," //>"])),Qt):_e(Ro||(Ro=e(["\n ","\n "])),l?_e(Lo||(Lo=e(["\n <div class=",">\n ","\n ","\n </div>\n "])),Go,l.template_fields.map((function(n){var i;if(t.shouldShowStep(n)&&n.activity_field)switch(n.activity_field.type){case"SELECT":return _e(No||(No=e(["\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 "])),Jo,zi,n.activity_field.id,t.props.apiHandler,n.title||n.activity_field.title,n.description||n.activity_field.description,s,n.placeholder,n.is_required,u&&u[n.id]&&u[n.id].value||"",(function(e){a({stepId:"".concat(r.id),fieldId:"".concat(n.id),value:e}),t.props.verifyStepValidity(r.id)}),n.activity_field.data_src,n.activity_field.is_dynamic,JSON.stringify(Ko({authorization_id:t.props.stepMapping&&(null===(i=t.props.stepMapping[t.props.step.id])||void 0===i?void 0:i.selectedAuthId)},t.fieldDynamicData(n))));case"TEXTFIELD":return!t.shouldShowMapping()&&t.textFieldParentHasValues()&&_e(Eo||(Eo=e(["\n <div class=",">\n <","\n id=","\n title=","\n description=","\n value=","\n placeholder=","\n showStepValidation=","\n isRequired=","\n onChange=","\n ><//>\n </div>\n "])),Jo,Ao,n.activity_field.id,n.title||n.activity_field.title,n.description||n.activity_field.description,u&&u[n.id]&&u[n.id].value||"",n.placeholder||"Please enter a value",s,n.is_required,(function(e){a({stepId:"".concat(r.id),fieldId:"".concat(n.id),value:e}),t.props.verifyStepValidity(r.id)}));case"CHECKBOX":return _e(Po||(Po=e(["\n <","\n title=","\n isRequired=","\n />\n <","\n label=","\n name=","\n value=","\n isChecked=","\n isRequired=","\n showStepValidation=","\n handleChange=","\n />\n "])),Rr,n.title||n.activity_field.title,n.is_required,Ji,n.activity_field.description,n.activity_field.machine_name,u&&u[n.id]&&u[n.id].value,u&&u[n.id]&&u[n.id].value,n.is_required,s,(function(e,i){a({stepId:"".concat(r.id),fieldId:"".concat(n.id),value:i}),t.props.verifyStepValidity(r.id)}));case"DYNAMIC":return _e(jo||(jo=e([""])));default:return _e(Fo||(Fo=e(["<div>\n Field: "," is currently not\n supported\n </div>"])),n.activity_field.type)}else switch(n.type){case"HTML":return _e(zo||(zo=e(['\n <div\n style="margin-bottom: 2rem;"\n dangerouslySetInnerHTML=',"\n />\n "])),{__html:Wo(window).sanitize(n.default_value)});case"BUTTON":return _e(Uo||(Uo=e(['\n <div style="margin-bottom: 2rem;">\n <'," label="," />\n </div>\n "])),Mn,n.title)}return _e(Ho||(Ho=e([""])))})),this.shouldShowMapping()&&_e(Bo||(Bo=e(["\n <div class=",">\n <","\n stepId=","\n templateFields=","\n showStepValidation=","\n endpointData=","\n ><//>\n </div>\n "])),Jo,Io,l.id,l.template_fields,s,this.getMappingDataInput())):_e(Vo||(Vo=e(["Step data could not be loaded"])))))}}]),o}(),da=ge.connect(["stepMapping","stepDataMapping","parentChildMapping"],Vt)(pa),fa="styles-module_stepsWrap__3VIDN",_a="styles-module_stepInfo__nU7A7",ma="styles-module_header__2GDea",ha="styles-module_name__h_9E1",va="styles-module_steps__1tZbw",ya="styles-module_stepContainer__1DBMw",ga="styles-module_top__JXVEL",ba="styles-module_bottom__2g7TT",wa="styles-module_buttons__2hBh9",xa="styles-module_save__1LVOi",Ia="styles-module_authWrap__em0DI";function ka(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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\n.styles-module_authWrap__em0DI {\n margin-bottom: 30px;\n width: 100%;\n max-width: 75%; }\n");var Sa=function(t){Ie(o,q);var n=ka(o);function o(e){var t;return r(this,o),i(we(t=n.call(this,e)),"createIntegration",(function(){var e,n,r=t.props,i=r.stepMapping,o=r.stepDataMapping;if(!t.context.isPreviewMode){t.setState({loading:!0});var a={name:null!==(e=null===(n=t.props.genericData.templateApp)||void 0===n?void 0:n.name)&&void 0!==e?e:"My new flow",notification_email:"",template:Number(t.props.genericData.templateId),bundle_id:Number(t.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}}))}}))};t.context.apiHandler.saveIntegration(a).then((function(e){t.setState({loading:!1}),t.context.eventEmitter.emit("did-save-integration",{integrationId:e.id,name:e.name,templateId:e.template,status:e.status})})).catch((function(e){return console.error(e)}))}})),i(we(t),"handleAuthSelected",(function(e,n,r){var i=t.props.stepMapping[n].step.template_fields.filter((function(e){return e.activity_field&&e.activity_field.is_dynamic})).map((function(e){return e.id}));t.props.setStepAuthorization(n,e,r,i)})),t.state={loading:!1,selectedAuthStep:null},t}return lt(o,[{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 t,n,r,i,o,a,s,l,u,c,p,d=this,f=null,_=this.props,m=_.stepState,h=_.stepMapping,v=m.currentStep,y=m.stepIndex,g=m.steps,b=!1,w=!1,x=!1,I=!1;y>-1&&"CONFIRMATION"!==(null==v?void 0:v.type)?(f=h[Number(null==v?void 0:v.stepId)],b=!1,w=m.stepIndex>0,x=null!==(p=null==v?void 0:v.isValid)&&void 0!==p&&p,I=m.showValidation):"CONFIRMATION"===(null==v?void 0:v.type)&&y===g.length&&(w=!0,b=!0);return _e(Yo||(Yo=e(["\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 "])),fa,ya,_a,v&&_e(Zo||(Zo=e(["\n ","\n "])),b?_e(Xo||(Xo=e(["\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>Confirm and activate</div>\n </div>\n <div class=',">\n ","\n </div>\n </div>\n "])),ma,ha,va,"Step ".concat((null!==(t=null===(n=this.props.stepState)||void 0===n?void 0:n.stepIndex)&&void 0!==t?t:0)+1," / ").concat((null!==(r=null===(i=this.props.stepState)||void 0===i?void 0:i.steps.length)&&void 0!==r?r:0)+1)):_e($o||($o=e(["\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 "])),ma,ha,null===(o=f)||void 0===o?void 0:o.step.activity.app.icon_url,"CONFIRMATION"!==(null==v?void 0:v.type)&&(null==v?void 0:v.title),va,"Step ".concat((null!==(a=null===(s=this.props.stepState)||void 0===s?void 0:s.stepIndex)&&void 0!==a?a:0)+1," / ").concat((null!==(l=null===(u=this.props.stepState)||void 0===u?void 0:u.steps.length)&&void 0!==l?l:0)+1))),ga,v?_e(ea||(ea=e(["\n ","\n "])),b?_e(ta||(ta=e(["\n <div class=",">\n Your integration is ready to be enabled. Click “Save”\n to continue.\n </div>\n "])),xa):_e(na||(na=e(["\n ","\n "])),f&&_e(ra||(ra=e(["\n ","\n "])),"AUTH"===(null==v?void 0:v.type)?_e(ia||(ia=e(["\n <div class=",">\n <","\n stepId=","\n apiHandler=","\n showErrors=","\n onAuthSelected=","\n >\n <//>\n </div>\n "])),Ia,li,f.step.id,this.context.apiHandler,I,(function(e,t){var n;return d.handleAuthSelected(e,Number(null===(n=f)||void 0===n?void 0:n.step.id),t)})):_e(oa||(oa=e(["\n <","\n step=","\n stepType=","\n showStepValidation=","\n apiHandler=","\n eventEmitter=","\n />\n "])),da,null===(c=f)||void 0===c?void 0:c.step,null==v?void 0:v.type,I,this.context.apiHandler,this.context.eventEmitter)))):_e(aa||(aa=e(["This template has no configured steps"]))),v&&_e(sa||(sa=e(["\n <div class=",">\n <div class=",">\n ","\n ","\n </div>\n </div>\n "])),ba,wa,w&&_e(la||(la=e(["\n <",'\n label="Back"\n onClick=',"\n type=","\n ><//>\n "])),Mn,(function(){return d.props.gotoPreviousStep()}),bn.SECONDARY),b?_e(ua||(ua=e(["\n <",'\n label="Save"\n disabled=',"\n tooltip=","\n isLoading=","\n onClick=","\n ><//>\n "])),Mn,this.context.isPreviewMode,this.context.isPreviewMode?'Integration setup will have to be\ndone in "Live View"':null,this.state.loading,(function(){return d.createIntegration()})):_e(ca||(ca=e(["\n <",'\n label="Next"\n disabled=',"\n onClick=","\n ><//>\n "])),Mn,!x,(function(){return x?d.props.gotoNextStep():d.props.showStepValidationState()}))))}}]),o}();i(Sa,"contextType",Ft);var Ca,Oa,Ma,Aa,Da,Ta,Ra,La=ge.connect(["stepState","genericData","stepMapping","stepDataMapping"],Vt)(Sa),Na="styles-module_wrap__2ZgZ0",Ea="styles-module_main__11gFF";Jt(".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 Pa,ja=["steps"],Fa=ge.connect([""],Vt)((function(t){var n,r=Ue(Ye(!1),2),i=r[0],o=r[1],a=Ue(Ye(null),2),s=a[0],l=a[1],u=t.templateId,c=t.bundleId,p=t.customWrapper,d=t.templatePreviewData,f=t.previewMetadata,_=Ue(Ye(null),2),m=_[0],h=_[1],v=Ue(function(e){var t=Qe(He++),n=Ye();return t.i=e,Be.componentDidCatch||(Be.componentDidCatch=function(e){t.i&&t.i(e),n[1](e)}),[n[0],function(){n[1](void 0)}]}((function(){})),2),y=v[0],g=v[1],b=tt(Ft);return Ze((function(){return function(){t.reset()}}),[]),Ze((function(){y&&console.error(y)}),[y]),Ze((function(){if(o(!0),null!=b&&b.isPreviewMode&&f){if(!d)throw new Error("Preview data was not provided");try{Ct(d,Gt)}catch(e){return console.error(e),o(!1),void h(e)}var e=d.steps,n=ze(d,ja);return l(d),t.setGenericData({templateId:Number(n.id),bundleId:Number(c),isPreviewMode:b.isPreviewMode}),t.setSteps(e.filter(Yt)),t.setStepMapping(e.filter(Yt)),t.setParentChildMapping(e.filter(Yt)),t.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(e){l(e),e&&Promise.all(e.steps.map((function(e){return b.apiHandler.getTemplateStep(Number(e.id))}))).then((function(n){n&&(o(!1),t.setSteps(n.filter(Yt)),t.setStepMapping(n.filter(Yt)),t.setParentChildMapping(n.filter(Yt)),t.setGenericData({templateId:Number(u),bundleId:Number(c)}),b.eventEmitter.emit("did-load-template",{templateId:Number(u),templateTitle:e.name,templateDescription:e.description}))})).catch((function(e){return console.error(e)}))}))}),[u]),p?_e(Ca||(Ca=e(["",""])),p):_e(Oa||(Oa=e(['\n <div class="'," ",'">\n ',"\n </div>\n "])),Na,"integry-container",y||m?_e(Ma||(Ma=e(["\n <","\n title=","\n description=","\n errorPayload=","\n onDismiss=","\n />\n "])),Nn,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):_e(Aa||(Aa=e(["\n <div>\n ","\n </div>\n <div class=",">\n ","\n ","\n </div>\n "])),!i&&s&&_e(Da||(Da=e(["\n <","\n steps=","\n ><//>\n "])),yr,null===(n=s.steps)||void 0===n?void 0:n.map((function(e){return{label:e.title,logoUrl:e.activity.app.icon_url}}))),Ea,i&&_e(Ta||(Ta=e(['<div style="display: flex; justify-content: center;">\n <'," />\n </div>"])),Qt),!i&&s&&_e(Ra||(Ra=e([" <"," steps=","><//> "])),La,s.steps)))})),za=ve((function(e){var t,n;t=me,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 p=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},d=p();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,p=0,m=0,h=t.length;if(n&&n.keys)for(var v=n.scoreFn||l,y=n.keys,g=y.length,b=h-1;b>=0;--b){for(var w=t[b],x=new Array(g),I=g-1;I>=0;--I)(C=u(w,S=y[I]))?(c(C)||(C=_.getPrepared(C)),x[I]=s(e,C,i)):x[I]=null;x.obj=w;var k=v(x);null!==k&&(k<o||(x.score=k,p<a?(d.add(x),++p):(++m,k>d.peek().score&&d.replaceTop(x))))}else if(n&&n.key){var S=n.key;for(b=h-1;b>=0;--b)(C=u(w=t[b],S))&&(c(C)||(C=_.getPrepared(C)),null!==(O=s(e,C,i))&&(O.score<o||(O={target:O.target,_targetLowerCodes:null,_nextBeginningIndexes:null,score:O.score,indexes:O.indexes,obj:w},p<a?(d.add(O),++p):(++m,O.score>d.peek().score&&d.replaceTop(O)))))}else for(b=h-1;b>=0;--b){var C,O;(C=t[b])&&(c(C)||(C=_.getPrepared(C)),null!==(O=s(e,C,i))&&(O.score<o||(p<a?(d.add(O),++p):(++m,O.score>d.peek().score&&d.replaceTop(O)))))}if(0===p)return r;var M=new Array(p);for(b=p-1;b>=0;--b)M[b]=d.poll();return M.total=p+m,M},goAsync:function(t,n,i){var o=!1,a=new Promise((function(a,s){if(!t)return a(r);var d=(t=_.prepareSearch(t))[0],m=p(),h=n.length-1,v=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 p=Date.now();if(i&&i.keys)for(var f=i.scoreFn||l,I=i.keys,k=I.length;h>=0;--h){for(var S=n[h],C=new Array(k),O=k-1;O>=0;--O)(D=u(S,A=I[O]))?(c(D)||(D=_.getPrepared(D)),C[O]=g(t,D,d)):C[O]=null;C.obj=S;var M=f(C);if(null!==M&&!(M<v)&&(C.score=M,b<y?(m.add(C),++b):(++w,M>m.peek().score&&m.replaceTop(C)),h%1e3==0&&Date.now()-p>=10))return void(e?setImmediate(x):setTimeout(x))}else if(i&&i.key){for(var A=i.key;h>=0;--h)if((D=u(S=n[h],A))&&(c(D)||(D=_.getPrepared(D)),null!==(T=g(t,D,d))&&!(T.score<v)&&(T={target:T.target,_targetLowerCodes:null,_nextBeginningIndexes:null,score:T.score,indexes:T.indexes,obj:S},b<y?(m.add(T),++b):(++w,T.score>m.peek().score&&m.replaceTop(T)),h%1e3==0&&Date.now()-p>=10)))return void(e?setImmediate(x):setTimeout(x))}else for(;h>=0;--h){var D,T;if((D=n[h])&&(c(D)||(D=_.getPrepared(D)),null!==(T=g(t,D,d))&&!(T.score<v)&&(b<y?(m.add(T),++b):(++w,T.score>m.peek().score&&m.replaceTop(T)),h%1e3==0&&Date.now()-p>=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,p=0;;){if(n===r[u]){if(i[p++]=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[(p=l)-1]+1;break}}l=0;var d=0,f=!1,m=0,h=t._nextBeginningIndexes;null===h&&(h=t._nextBeginningIndexes=_.prepareNextBeginningIndexes(t.target));var v=u=0===i[0]?0:h[i[0]-1];if(u!==s)for(;;)if(u>=s){if(l<=0){if(++d>o-2)break;if(e[d]===e[d+1])continue;u=v;continue}--l,u=h[a[--m]]}else if(e[0===d?l:d===l?l+1:d===l-1?l-1:l]===r[u]){if(a[m++]=u,++l===o){f=!0;break}++u}else u=h[u];if(f)var y=a,g=m;else y=i,g=p;for(var b=0,w=-1,x=0;x<o;++x)w!==(u=y[x])-1&&(b-=u),w=u;for(f?0!==d&&(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 p=!1,d=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[--d]]}else if(e[l]===r[u]){if(a[d++]=u,++l===o){p=!0;break}++u}else u=f[u];if(p)var m=a,h=d;else m=i,h=c;for(var v=0,y=-1,g=0;g<o;++g)y!==(u=m[g])-1&&(v-=u),y=u;for(p||(v*=1e3),v-=s-o,t.score=v,t.indexes=new Array(h),g=h-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()})),Ua="styles-module_search__2j0G1",Ha="styles-module_resultCount__12RMZ";function Ba(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 Va,Wa=function(t){Ie(o,q);var n=Ba(o);function o(e){var t;return r(this,o),i(we(t=n.call(this,e)),"onInput",(function(e){if(e.target instanceof HTMLInputElement){var n=e.target.value;t.setState({value:n}),t.props.onChange(n)}})),t.state={value:t.props.initialValue||""},t}return lt(o,[{key:"render",value:function(){return _e(Pa||(Pa=e(["\n <div class="," ",">\n <input\n placeholder=","\n value=","\n oninput=","\n />\n <div class=",">"," results</div>\n </div>\n "])),Ua,"integry-search",this.props.placeholder||"Search...",this.state.value,this.onInput,Ha,this.props.resultCount)}}]),o}(),Ga="styles-module_nav__bKw4L",Ja="styles-module_tab__3xQCg",qa="styles-module_tabactive__2JeoG";Jt(".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 Ka,Qa,Ya,Za=function(t){var n=t.label,r=t.activeTab,i=t.onClick;return _e(Va||(Va=e(["\n <li\n class=","\n onclick=","\n >\n ","\n </li>\n "])),"".concat(Ja," ").concat(r===n?qa:""),(function(){i(n)}),n)},Xa=function(t){var n=t.preSelectedTab,r=t.children;if(!Array.isArray(r)||r.length<2)throw new Error("Tab Bar must have at least two children");var i=Ue(Ye(n||r[0].props.label),2),o=i[0],a=i[1],s=function(e){a(e)};return _e(Ka||(Ka=e(["\n <div>\n <ol class=",">\n ",'\n </ol>\n <div className="tab-content">\n ',"\n </div>\n </div>\n "])),Ga,r.map((function(t){var n=t.props.label;return _e(Qa||(Qa=e(["\n <","\n activeTab=","\n key=","\n label=","\n onClick=","\n >\n <//>\n "])),Za,o,n,n,s)})),r.map((function(e){if(e.props.label===o)return e.props.children})))},$a="styles-module_toggle__2c6vj",es="styles-module_inner__2w3FN",ts="styles-module_toggled__3gmsw";Jt(".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 ns,rs,is,os,as,ss=function(t){var n=t.id,r=t.value,i=t.onChange;return _e(Ya||(Ya=e(["\n <div class=",">\n <div class=",">\n <label for="," class=",'></label>\n <input type="checkbox" id='," onclick="," />\n </div>\n </div>\n "])),$a,"".concat(es," ").concat(r?ts:""," "),n,"".concat(r?ts:""," "),n,(function(){i(!r)}))},ls="styles-module_integrations__2vJT8",us="styles-module_integration__MtN8C",cs="styles-module_header__1d_zB",ps="styles-module_row__1UAlk",ds="styles-module_topbar__3TTLr";function fs(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 _s,ms,hs=function(t){Ie(o,q);var n=fs(o);function o(){var e;r(this,o);for(var t=arguments.length,a=new Array(t),s=0;s<t;s++)a[s]=arguments[s];return i(we(e=n.call.apply(n,[this].concat(a))),"toggleIntegration",(function(t,n){e.props.apiHandler.toggleIntegration(t,n).then((function(e){console.info(e)})).catch((function(e){return console.error(e)}))})),i(we(e),"onIntegrationDelete",(function(t){e.props.apiHandler.deleteIntegration(t).then((function(e){console.info(e)})).catch((function(e){return console.error(e)}))})),e}return lt(o,[{key:"render",value:function(){var t=this;return _e(ns||(ns=e(["\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 "])),ds,cs,zi,[{id:"sort",value:"Sort"}],ps,ls,this.props.integrations.length<1&&_e(rs||(rs=e(["No integrations"]))),this.props.integrations.map((function(n){return _e(is||(is=e(['\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 '])),us,"integry_container_Integration",ps,"fail"!==n.task_execution.status?_e(os||(os=e(['\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 ']))):_e(as||(as=e(['<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> ']))),n.icon_url,n.name,n.runs_count,n.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(n.task_execution.last_execution_at.date," ").concat(n.task_execution.last_execution_at.timezone))):"Never run",ss,n.id,"ACTIVE"===n.status,(function(e){return t.toggleIntegration(n.id,e)}),(function(){return t.onIntegrationDelete(n.id)}))})))}}]),o}();!function(e){e.MODAL="MODAL",e.INLINE="INLINE",e.DETACHED="DETACHED",e.CUSTOM="CUSTOM"}(_s||(_s={})),function(e){e.GRID="GRID",e.LIST="LIST"}(ms||(ms={}));var vs,ys,gs,bs,ws="styles-module_template_list__3HABS",xs="styles-module_template_grid__mH7-0",Is="styles-module_header__cdTrS";function ks(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 Ss,Cs,Os,Ms,As,Ds=function(t){Ie(o,q);var n=ks(o);function o(){var e;return r(this,o),i(we(e=n.call(this)),"filterTemplates",(function(t){t?e.setState({filteredTemplates:za.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})})),i(we(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 lt(o,[{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 t,n,r=this;return _e(vs||(vs=e(["\n <div>\n ","\n </div>\n "])),this.state.loading?_e(ys||(ys=e([" <"," //> "])),Qt):_e(gs||(gs=e(["\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 "])),Xa,(null===(t=this.props.userConfig)||void 0===t?void 0:t.availableFlowsLabel)||"Available Flows",Is,Wa,this.state.filteredTemplates.length,(function(e){return r.filterTemplates(e)}),this.props.layout===ms.LIST?ws:xs,"integry-container_TemplatesView",this.state.filteredTemplates.map((function(t){return _e(bs||(bs=e(["\n <","\n name=","\n description=","\n layout=","\n tags=","\n imgUrl=","\n onClick=","\n >\n <//>\n "])),r.props.templateContainerTemplate,t.name,t.description,r.props.layout,t.branding_app.tags,t.branding_app.icon_url,(function(){return r.onTemplateClick(t.id)}))})),(null===(n=this.props.userConfig)||void 0===n?void 0:n.myFlowsLabel)||"My Flows",hs,this.props.apiHandler,this.state.integrations))}}],[{key:"handleClick",value:function(e){e.preventDefault(),e.target instanceof HTMLElement&&console.info(e.target.localName)}}]),o}(),Ts=ge.connect("userConfig",Vt)(Ds),Rs="styles-module_navigation__2nFX8",Ls="styles-module_navItem__ozaSU",Ns="styles-module_navItemContent__3UHl8",Es="styles-module_imgContainer__c7lfR",Ps="styles-module_active__1nm22",js="styles-module_disabled__1JpJ1";function Fs(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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: contain; }\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 zs,Us,Hs,Bs=_e(Ss||(Ss=e([' <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>']))),Vs=_e(Cs||(Cs=e(['\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']))),Ws=function(t){Ie(i,q);var n=Fs(i);function i(){return r(this,i),n.apply(this,arguments)}return lt(i,[{key:"render",value:function(){var t=this.props,n=t.logoUrl,r=t.isActive,i=void 0!==r&&r,o=t.isCompleted,a=void 0!==o&&o,s=t.isDisabled,l=void 0!==s&&s,u=t.isLastStep,c=void 0!==u&&u,p=t.onClick,d=void 0===p?function(){return null}:p;return _e(Os||(Os=e(["\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(Ls," ").concat(l?js:""," ").concat(i?Ps:""),d,Ns,Es,c?Vs:_e(Ms||(Ms=e(["\n ","\n "])),!a||i?_e(As||(As=e(["<img src="," />"])),n):Bs),this.props.label)}}]),i}();function Gs(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}var Js=function(t){Ie(o,q);var n=Gs(o);function o(){var e;r(this,o);for(var t=arguments.length,a=new Array(t),s=0;s<t;s++)a[s]=arguments[s];return i(we(e=n.call.apply(n,[this].concat(a))),"changeStep",(function(t){e.props.gotoStep(t)})),e}return lt(o,[{key:"render",value:function(){var t,n=this,r=this.props.stepState,i=null==r?void 0:r.currentStep;return _e(zs||(zs=e(["\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 "])),Rs,this.props.stepState&&_e(Us||(Us=e(["\n ","\n "])),null===(t=this.props.stepState)||void 0===t?void 0:t.steps.map((function(t,o){return _e(Hs||(Hs=e([" <","\n label=","\n logoUrl=","\n isCompleted=","\n isActive=","\n isDisabled=","\n isLastStep=","\n onClick=","\n />"])),Ws,"CONFIRMATION"!==t.type?t.title:"Confirmation","CONFIRMATION"!==t.type&&t.iconUrl,t.isCompleted,"CONFIRMATION"!==(null==i?void 0:i.type)&&"CONFIRMATION"!==t.type&&r.stepIndex===o,Number(null==r?void 0:r.stepIndex)<o,!1,(function(){return n.changeStep(o)}))}))),Ws,!0,void 0!==i&&(null==r?void 0:r.stepIndex)===(null==r?void 0:r.steps.length),void 0!==i&&(null==r?void 0:r.stepIndex)!==(null==r?void 0:r.steps.length),!0,(function(){var e;return n.changeStep(null!==(e=null==r?void 0:r.steps.length)&&void 0!==e?e:0)}))}}]),o}();Js.defaultProps={currentStepIndex:-1,completedTillIndex:-1};var qs,Ks,Qs,Ys,Zs,Xs,$s,el,tl,nl,rl,il=ge.connect("stepState",Vt)(Js),ol={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 al(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 sl=function(t){Ie(o,q);var n=al(o);function o(e){var t;return r(this,o),i(we(t=n.call(this,e)),"createIntegration",(function(){var e,n,r=t.props,i=r.stepMapping,o=r.stepDataMapping;console.info(i),t.setState({loading:!0});var a={name:null!==(e=null===(n=t.props.genericData.templateApp)||void 0===n?void 0:n.name)&&void 0!==e?e:"My new flow",notification_email:"",template:Number(t.props.genericData.templateId),bundle_id:Number(t.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),t.context.apiHandler.saveIntegration(a).then((function(e){console.info(e),t.setState({loading:!1})})).catch((function(e){return console.error(e)}))})),i(we(t),"handleAuthSelected",(function(e,n,r){var i=t.props.stepMapping[n].step.template_fields.filter((function(e){return e.activity_field&&e.activity_field.is_dynamic})).map((function(e){return e.id}));t.props.setStepAuthorization(n,e,r,i)})),t.state={loading:!1,selectedAuthStep:null},t}return lt(o,[{key:"render",value:function(){var t,n,r,i,o,a=this,s=null,l=this.props.stepState,u=l.currentStep,c=l.stepIndex,p=l.steps,d=!1,f=!1,_=!1,m=!1;c>-1&&"CONFIRMATION"!==(null==u?void 0:u.type)?(s=this.props.stepMapping[Number(null==u?void 0:u.stepId)],d=!1,f=this.props.stepState.stepIndex>0,_=null!==(o=null==u?void 0:u.isValid)&&void 0!==o&&o,m=l.showValidation):"CONFIRMATION"===(null==u?void 0:u.type)&&c===p.length&&(d=!0);return _e(qs||(qs=e(["\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 "])),ol.stepsWrap,ol.stepsContainer,il,null===(t=this.props.steps)||void 0===t?void 0:t.map((function(e){return{label:e.title,logoUrl:e.activity.app.icon_url}})),-1,-1,ol.stepContainer,ol.stepInfo,d?_e(Ks||(Ks=e(['\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 ']))):_e(Qs||(Qs=e(["\n \x3c!-- <img src="," />\n <div>","</div> --\x3e\n "])),null===(n=s)||void 0===n?void 0:n.step.activity.app.icon_url,null===(r=s)||void 0===r?void 0:r.step.title),ol.top,d?_e(Ys||(Ys=e(["\n <div class=",">\n Your integration is ready to be enabled. Click “Save” to\n continue.\n </div>\n "])),ol.save):_e(Zs||(Zs=e(["\n ","\n "])),s&&_e(Xs||(Xs=e(["\n ","\n "])),"AUTH"===(null==u?void 0:u.type)?_e($s||($s=e(["\n <div class=",">\n <","\n stepId=","\n apiHandler=","\n showErrors=","\n onAuthSelected=","\n >\n <//>\n </div>\n "])),ol.stepWrap,li,s.step.id,this.context.apiHandler,m,(function(e,t){var n;return a.handleAuthSelected(e,Number(null===(n=s)||void 0===n?void 0:n.step.id),t)})):_e(el||(el=e(["\n <","\n step=","\n stepType=","\n showStepValidation=","\n apiHandler=","\n eventEmitter=","\n />\n "])),da,null===(i=s)||void 0===i?void 0:i.step,null==u?void 0:u.type,m,this.context.apiHandler,this.context.eventEmitter))),ol.bottom,ol.buttons,f&&_e(tl||(tl=e(["\n <",'\n label="Back"\n onClick=',"\n type=","\n ><//>\n "])),Mn,(function(){return a.props.gotoPreviousStep()}),bn.SECONDARY),d?_e(nl||(nl=e(["\n <",'\n label="Save"\n isLoading=',"\n onClick=","\n ><//>\n "])),Mn,this.state.loading,(function(){return a.createIntegration()})):_e(rl||(rl=e(["\n <",'\n label="Next"\n disabled=',"\n onClick=","\n ><//>\n "])),Mn,!_,(function(){return _?a.props.gotoNextStep():a.props.showStepValidationState()})))}}]),o}();i(sl,"contextType",Ft);var ll,ul,cl,pl=ge.connect(["stepState","genericData","stepMapping","stepDataMapping"],Vt)(sl),dl="styles-module_header__3p3k1",fl="styles-module_name__2PDqJ",_l="styles-module_description__39K41";function ml(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 hl,vl,yl,gl=function(t){Ie(i,q);var n=ml(i);function i(){var e;return r(this,i),(e=n.call(this)).state={loading:!0,template:null},e}return lt(i,[{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(Yt)),e.props.setStepMapping(n.filter(Yt)),e.props.setParentChildMapping(n.filter(Yt)),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 t=this.state.template;return _e(ll||(ll=e(["\n <div>\n ","\n </div>\n "])),this.state.loading?_e(ul||(ul=e(["<"," //>"])),Qt):_e(cl||(cl=e(["\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 "])),dl,null==t?void 0:t.branding_app.icon_url,fl,null==t?void 0:t.name,_l,null==t?void 0:t.description,pl,null==t?void 0:t.steps,this.props.apiHandler,this.props.eventEmitter))}}]),i}(),bl=ge.connect("",Vt)(gl),wl="styles-module_name__3qMVY",xl="styles-module_description__2S97K",Il="styles-module_tags__2fhyE",kl="styles-module_tag__26APx",Sl="styles-module_template_list_view__jxmde",Cl="styles-module_template_grid_view__WmHjg";function Ol(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 Ml,Al,Dl=function(t){Ie(o,q);var n=Ol(o);function o(e){var t;return r(this,o),i(we(t=n.call(this,e)),"handleClick",(function(){console.info(t.props.name)})),t.state={templateName:t.props.name},t}return lt(o,[{key:"render",value:function(){return _e(hl||(hl=e(["\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===ms.LIST?Sl:Cl,"integry-container_Template",this.props.imgUrl,wl,this.state.templateName,xl,this.props.description,this.props.tags.length>0&&_e(vl||(vl=e(["\n <div class=",">\n ","\n </div>\n "])),Il,this.props.tags.split(",").map((function(t){return _e(yl||(yl=e([" <div class=",">","</div> "])),kl,t)}))))}}],[{key:"handleClick",value:function(e){e.preventDefault(),e.target instanceof HTMLElement&&console.info(e.target.localName)}}]),o}(),Tl="styles-module_modal__3ImBF",Rl="styles-module_open__AAUJ5",Ll="styles-module_modalContainer__o6TKt",Nl="styles-module_inset__-NimT",El="styles-module_span__3nIVQ",Pl="styles-module_contentWrap__2QGtd",jl="styles-module_content__3wdFn",Fl="styles-module_close__2IqHP";function zl(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 Ul,Hl=function(t){Ie(i,q);var n=zl(i);function i(){return r(this,i),n.apply(this,arguments)}return lt(i,[{key:"render",value:function(){var t=this.props.isOpen;return _e(Ml||(Ml=e(["\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(Tl," ").concat(t?"".concat(Rl):""),Ll,Nl,El,"".concat(Pl," ").concat(t?"".concat(Rl):""),jl,this.props.onClose,Fl,this.props.isOpen&&_e(Al||(Al=e([" "," "])),this.props.children))}}]),i}(),Bl="styles-module_integry-container__3nnxM";function Vl(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}Jt(".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 Wl=function(t){Ie(o,q);var n=Vl(o);function o(e){var t;return r(this,o),i(we(t=n.call(this,e)),"templateComponent",void 0),i(we(t),"templateListComponent",void 0),i(we(t),"store",void 0),i(we(t),"onTemplateClick",(function(e){t.setState({isModalOpen:!0,templateId:e})})),t.state={isModalOpen:!1,templateId:null},t.store=Wt(),t.store.setState({userConfig:e.userConfig}),t}return lt(o,[{key:"componentWillMount",value:function(){this.templateComponent=Dl,this.templateListComponent=Ts}},{key:"render",value:function(){var t=this;return _e(Ul||(Ul=e(["\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 "])),ge.Provider,this.store,Bl,"integry-container",this.templateListComponent,this.props.layout,this.props.bundleId,this.templateComponent,this.context.apiHandler,this.context.eventEmitter,this.onTemplateClick,Hl,this.state.isModalOpen,(function(){t.store.setState(Ut),t.setState({isModalOpen:!1,templateId:null})}),bl,this.context.apiHandler,this.state.templateId,this.props.bundleId)}}]),o}();i(Wl,"contextType",Ft);var Gl=function(){function e(t,n){r(this,e),i(this,"emitter",void 0),i(this,"handler",void 0),this.emitter=t,this.handler=n}return lt(e,[{key:"getHandler",value:function(){return this.handler}}]),e}();function Jl(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}var ql=function(e){Ie(n,Gl);var t=Jl(n);function n(){return r(this,n),t.apply(this,arguments)}return lt(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 Kl(e,t,n){return(Kl="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=Se(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 Ql(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=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ke(this,n)}}var Yl,Zl,Xl,$l=function(e){Ie(n,ql);var t=Ql(n);function n(e,o){var a,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(r(this,n),i(we(a=t.call(this,e,o)),"total",void 0),i(we(a),"i",0),a.total=s,a.total<1)throw new Error("{total} can not be less than 1");return a}return lt(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=Kl(Se(n.prototype),"run",this)).call.apply(t,[this,e].concat(i)),++this.i>=this.total&&this.emitter.off(e,this.handler)}}]),n}(),eu=function(){function e(){r(this,e),i(this,"events",Object.create(null))}return lt(e,[{key:"on",value:function(e,t){this.addEventListener(e,new ql(this,t))}},{key:"once",value:function(e,t){this.addEventListener(e,new $l(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 tu(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 nu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tu(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ru={getAuthHash:function(e,t){return Fe.apply(this,arguments)}},iu=function t(o){var a,s,l,u,c=this;(r(this,t),i(this,"config",void 0),i(this,"apiHandler",void 0),i(this,"eventEmitter",new eu),i(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(""))})),i(this,"getAuthParamsFromUrl",(function(){var e=Lr()&&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:""}})),i(this,"printVersion",(function(){console.info("@integry/sdk@".concat(t.SDK_VERSION))})),i(this,"getTemplatesList",n(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.apiHandler.getTemplateListing(c.config.bundleId));case 1:case"end":return e.stop()}}),e)})))),i(this,"setupTemplateFormDestination",(function(e,t){var n=null;if(t){if(e===_s.MODAL||e===_s.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 _s.MODAL:return(n=document.createElement("div")).id=c.getRandomTemplateId(8),document.body.appendChild(n),n;case _s.INLINE:return null;case _s.DETACHED:case _s.CUSTOM:return n;default:throw new Error("Unsupported renderMode ".concat(e," configuration, please provide one of ").concat(JSON.stringify(Object.keys(_s))))}})),i(this,"renderTemplateForm",(function(t,n){var r=document.getElementById(n);if(r){var i=Wt();ue(_e(Yl||(Yl=e(["\n <","\n value=","\n >\n <"," store=",">\n <","\n bundleId=","\n templateId=","\n >\n <//>\n <//>\n <//>\n "])),Ft.Provider,{apiHandler:c.apiHandler,eventEmitter:c.eventEmitter,isPreviewMode:!1},ge.Provider,i,Fa,c.config.bundleId,t),r)}else console.warn("Integry template form render target with id ".concat(n," was not found"))})),i(this,"renderPreview",(function(t){var n=t.templateData,r=t.metadata,i=t.previewContainerId,o=document.getElementById(i);if(o){var a=Wt();ue(_e(Zl||(Zl=e(["\n <","\n value=","\n >\n <"," store=",">\n <","\n bundleId=","\n isPreviewMode=","\n templatePreviewData=","\n previewMetadata=","\n >\n <//>\n <//>\n <//>\n "])),Ft.Provider,{apiHandler:c.apiHandler,eventEmitter:c.eventEmitter,isPreviewMode:!0},ge.Provider,a,Fa,c.config.bundleId,!0,n,r),o)}else console.warn("Integry template form render target with id ".concat(i," was not found"))})),i(this,"init",(function(t){var n=t.containerId,r=t.templateContainerId,i=t.renderMode,o=document.getElementById(n);if(!i)throw new Error("Template form render mode needs to be defined");if(c.setupTemplateFormDestination(i,r),o){var a=o.getAttribute("x-integry-layout")||ms.LIST;ue(_e(Xl||(Xl=e(["\n <","\n value=","\n >\n <","\n bundleId=","\n userConfig=","\n layout=","\n >\n <//>\n <//>\n "])),Ft.Provider,{apiHandler:c.apiHandler,eventEmitter:c.eventEmitter,isPreviewMode:!1},Wl,c.config.bundleId,c.config.userConfig,a),o)}else console.warn("Integry SDK render target with id ".concat(n," was not found"))})),i(this,"destroy",(function(){try{c.eventEmitter.offAll()}catch(e){console.error("There was an error unsubscribing from all events")}})),"staging"===o.env)?s={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:"https://beta.integry.io",baseUrlv2:"https://beta.integry.io/v2",apiKey:null===(l=o.xIntegryConfig)||void 0===l?void 0:l.appAuth.apiKey}:s={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:"https://app.integry.io",baseUrlv2:"https://app.integry.io/v2",apiKey:null===(u=o.xIntegryConfig)||void 0===u?void 0:u.appAuth.apiKey};if("appKey"in o)a=nu(nu({},s),{},{appKey:o.appKey,hash:o.hash,userId:o.userId}),this.config=nu(nu({},s),{},{appKey:o.appKey,hash:o.hash,userId:o.userId,bundleId:o.bundleId,userConfig:o.userConfig});else{var p=this.getAuthParamsFromUrl()||{};a=nu(nu({},s),p),this.config=nu(nu(nu({},s),p),{},{userConfig:o.userConfig})}this.apiHandler=new Ne(a)};i(iu,"SDK_VERSION","0.0.59"),i(iu,"RenderModes",_s),i(iu,"Helpers",void 0);export{ru as Helpers,iu as IntegryJS};
18
18
  //# sourceMappingURL=index.csm.js.map