@flarehr/superhero-salpac-profile-admin 1.0.466 → 1.0.467
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
(()=>{"use strict";var e,t,n,r,o,i,c,l={},a=[],u=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function _(e,t){for(var n in t)e[n]=t[n];return e}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function f(t,n,r){var o,i,c,l={};for(c in n)"key"==c?o=n[c]:"ref"==c?i=n[c]:l[c]=n[c];if(arguments.length>2&&(l.children=arguments.length>3?e.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(c in t.defaultProps)void 0===l[c]&&(l[c]=t.defaultProps[c]);return p(t,l,o,i,null)}function p(e,r,o,i,c){var l={type:e,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==c?++n:c};return null==c&&null!=t.vnode&&t.vnode(l),l}function d(e){return e.children}function h(e,t){this.props=e,this.context=t}function v(e,t){if(null==t)return e.__?v(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?v(e):null}function y(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 y(e)}}function m(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!b.__r++||o!==t.debounceRendering)&&((o=t.debounceRendering)||i)(b)}function b(){var e,t,n,o,i,l,a,u;for(r.sort(c);e=r.shift();)e.__d&&(t=r.length,o=void 0,i=void 0,a=(l=(n=e).__v).__e,(u=n.__P)&&(o=[],(i=_({},l)).__v=l.__v+1,N(u,l,i,n.__n,void 0!==u.ownerSVGElement,null!=l.__h?[a]:null,o,null==a?v(l):a,l.__h),T(o,l),l.__e!=a&&y(l)),r.length>t&&r.sort(c));b.__r=0}function g(e,t,n,r,o,i,c,u,_,s){var f,h,y,m,b,g,k,C=r&&r.__k||a,E=C.length;for(n.__k=[],f=0;f<t.length;f++)if(null!=(m=n.__k[f]=null==(m=t[f])||"boolean"==typeof m||"function"==typeof m?null:"string"==typeof m||"number"==typeof m||"bigint"==typeof m?p(null,m,null,null,m):Array.isArray(m)?p(d,{children:m},null,null,null):m.__b>0?p(m.type,m.props,m.key,m.ref?m.ref:null,m.__v):m)){if(m.__=n,m.__b=n.__b+1,null===(y=C[f])||y&&m.key==y.key&&m.type===y.type)C[f]=void 0;else for(h=0;h<E;h++){if((y=C[h])&&m.key==y.key&&m.type===y.type){C[h]=void 0;break}y=null}N(e,m,y=y||l,o,i,c,u,_,s),b=m.__e,(h=m.ref)&&y.ref!=h&&(k||(k=[]),y.ref&&k.push(y.ref,null,m),k.push(h,m.__c||b,m)),null!=b?(null==g&&(g=b),"function"==typeof m.type&&m.__k===y.__k?m.__d=_=w(m,_,e):_=x(e,m,y,C,b,_),"function"==typeof n.type&&(n.__d=_)):_&&y.__e==_&&_.parentNode!=e&&(_=v(y))}for(n.__e=g,f=E;f--;)null!=C[f]&&("function"==typeof n.type&&null!=C[f].__e&&C[f].__e==n.__d&&(n.__d=S(r).nextSibling),H(C[f],C[f]));if(k)for(f=0;f<k.length;f++)U(k[f],k[++f],k[++f])}function w(e,t,n){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,t="function"==typeof r.type?w(r,t,n):x(n,r,r,o,r.__e,t));return t}function k(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){k(e,t)})):t.push(e)),t}function x(e,t,n,r,o,i){var c,l,a;if(void 0!==t.__d)c=t.__d,t.__d=void 0;else if(null==n||o!=i||null==o.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(o),c=null;else{for(l=i,a=0;(l=l.nextSibling)&&a<r.length;a+=1)if(l==o)break e;e.insertBefore(o,i),c=i}return void 0!==c?c:o.nextSibling}function S(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=S(n)))return r;return null}function C(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||u.test(t)?n:n+"px"}function E(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||C(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||C(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?P:O,i):e.removeEventListener(t,i?P:O,i);else if("dangerouslySetInnerHTML"!==t){if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function O(e){return this.l[e.type+!1](t.event?t.event(e):e)}function P(e){return this.l[e.type+!0](t.event?t.event(e):e)}function N(e,n,r,o,i,c,l,a,u){var s,f,p,v,y,m,b,w,k,x,S,C,E,O,P,N=n.type;if(void 0!==n.constructor)return null;null!=r.__h&&(u=r.__h,a=n.__e=r.__e,n.__h=null,c=[a]),(s=t.__b)&&s(n);try{e:if("function"==typeof N){if(w=n.props,k=(s=N.contextType)&&o[s.__c],x=s?k?k.props.value:s.__:o,r.__c?b=(f=n.__c=r.__c).__=f.__E:("prototype"in N&&N.prototype.render?n.__c=f=new N(w,x):(n.__c=f=new h(w,x),f.constructor=N,f.render=j),k&&k.sub(f),f.props=w,f.state||(f.state={}),f.context=x,f.__n=o,p=f.__d=!0,f.__h=[],f._sb=[]),null==f.__s&&(f.__s=f.state),null!=N.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=_({},f.__s)),_(f.__s,N.getDerivedStateFromProps(w,f.__s))),v=f.props,y=f.state,f.__v=n,p)null==N.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(null==N.getDerivedStateFromProps&&w!==v&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(w,x),!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(w,f.__s,x)||n.__v===r.__v){for(n.__v!==r.__v&&(f.props=w,f.state=f.__s,f.__d=!1),f.__e=!1,n.__e=r.__e,n.__k=r.__k,n.__k.forEach((function(e){e&&(e.__=n)})),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&l.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(w,f.__s,x),null!=f.componentDidUpdate&&f.__h.push((function(){f.componentDidUpdate(v,y,m)}))}if(f.context=x,f.props=w,f.__P=e,C=t.__r,E=0,"prototype"in N&&N.prototype.render){for(f.state=f.__s,f.__d=!1,C&&C(n),s=f.render(f.props,f.state,f.context),O=0;O<f._sb.length;O++)f.__h.push(f._sb[O]);f._sb=[]}else do{f.__d=!1,C&&C(n),s=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++E<25);f.state=f.__s,null!=f.getChildContext&&(o=_(_({},o),f.getChildContext())),p||null==f.getSnapshotBeforeUpdate||(m=f.getSnapshotBeforeUpdate(v,y)),P=null!=s&&s.type===d&&null==s.key?s.props.children:s,g(e,Array.isArray(P)?P:[P],n,r,o,i,c,l,a,u),f.base=n.__e,n.__h=null,f.__h.length&&l.push(f),b&&(f.__E=f.__=null),f.__e=!1}else null==c&&n.__v===r.__v?(n.__k=r.__k,n.__e=r.__e):n.__e=A(r.__e,n,r,o,i,c,l,u);(s=t.diffed)&&s(n)}catch(e){n.__v=null,(u||null!=c)&&(n.__e=a,n.__h=!!u,c[c.indexOf(a)]=null),t.__e(e,n,r)}}function T(e,n){t.__c&&t.__c(n,e),e.some((function(n){try{e=n.__h,n.__h=[],e.some((function(e){e.call(n)}))}catch(e){t.__e(e,n.__v)}}))}function A(t,n,r,o,i,c,a,u){var _,f,p,d=r.props,h=n.props,y=n.type,m=0;if("svg"===y&&(i=!0),null!=c)for(;m<c.length;m++)if((_=c[m])&&"setAttribute"in _==!!y&&(y?_.localName===y:3===_.nodeType)){t=_,c[m]=null;break}if(null==t){if(null===y)return document.createTextNode(h);t=i?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,h.is&&h),c=null,u=!1}if(null===y)d===h||u&&t.data===h||(t.data=h);else{if(c=c&&e.call(t.childNodes),f=(d=r.props||l).dangerouslySetInnerHTML,p=h.dangerouslySetInnerHTML,!u){if(null!=c)for(d={},m=0;m<t.attributes.length;m++)d[t.attributes[m].name]=t.attributes[m].value;(p||f)&&(p&&(f&&p.__html==f.__html||p.__html===t.innerHTML)||(t.innerHTML=p&&p.__html||""))}if(function(e,t,n,r,o){var i;for(i in n)"children"===i||"key"===i||i in t||E(e,i,null,n[i],r);for(i in t)o&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===t[i]||E(e,i,t[i],n[i],r)}(t,h,d,i,u),p)n.__k=[];else if(m=n.props.children,g(t,Array.isArray(m)?m:[m],n,r,o,i&&"foreignObject"!==y,c,a,c?c[0]:r.__k&&v(r,0),u),null!=c)for(m=c.length;m--;)null!=c[m]&&s(c[m]);u||("value"in h&&void 0!==(m=h.value)&&(m!==t.value||"progress"===y&&!m||"option"===y&&m!==d.value)&&E(t,"value",m,d.value,!1),"checked"in h&&void 0!==(m=h.checked)&&m!==t.checked&&E(t,"checked",m,d.checked,!1))}return t}function U(e,n,r){try{"function"==typeof e?e(n):e.current=n}catch(e){t.__e(e,r)}}function H(e,n,r){var o,i;if(t.unmount&&t.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||U(o,null,n)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){t.__e(e,n)}o.base=o.__P=null,e.__c=void 0}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&H(o[i],n,r||"function"!=typeof e.type);r||null==e.__e||s(e.__e),e.__=e.__e=e.__d=void 0}function j(e,t,n){return this.constructor(e,n)}function I(n,r,o){var i,c,a;t.__&&t.__(n,r),c=(i="function"==typeof o)?null:o&&o.__k||r.__k,a=[],N(r,n=(!i&&o||r).__k=f(d,null,[n]),c||l,l,void 0!==r.ownerSVGElement,!i&&o?[o]:c?null:r.firstChild?e.call(r.childNodes):null,a,!i&&o?o:c?c.__e:r.firstChild,i),T(a,n)}function D(e,t){I(e,t,D)}function L(t,n,r){var o,i,c,l=_({},t.props);for(c in n)"key"==c?o=n[c]:"ref"==c?i=n[c]:l[c]=n[c];return arguments.length>2&&(l.children=arguments.length>3?e.call(arguments,2):r),p(t.type,l,o||t.key,i||t.ref,null)}function M(){return(M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function R(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}(e,["context","children"]);return L(t,n)}function V(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=f(R,M({},this._props,{context:e.detail.context}),function e(t,n){if(3===t.nodeType)return t.data;if(1!==t.nodeType)return null;var r=[],o={},i=0,c=t.attributes,l=t.childNodes;for(i=c.length;i--;)"slot"!==c[i].name&&(o[c[i].name]=c[i].value,o[W(c[i].name)]=c[i].value);for(i=l.length;i--;){var a=e(l[i],null),u=l[i].slot;u?o[u]=f(B,{name:u},a):r[i]=a}var _=n?f(B,null,r):r;return f(n||t.nodeName.toLowerCase(),o,_)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?D:I)(this._vdom,this._root)}function W(e){return e.replace(/-(\w)/g,(function(e,t){return t?t.toUpperCase():""}))}function F(e,t,n){if(this._vdom){var r={};r[e]=n=null==n?void 0:n,r[W(e)]=n,this._vdom=L(this._vdom,r),I(this._vdom,this._root)}}function z(){I(this._vdom=null,this._root)}function B(e,t){var n=this;return f("slot",M({},e,{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}e=a.slice,t={__e:function(e,t,n,r){for(var o,i,c;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),c=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),c=o.__d),c)return o.__E=o}catch(t){e=t}throw e}},n=0,h.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=_({},this.state),"function"==typeof e&&(e=e(_({},n),this.props)),e&&_(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),m(this))},h.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),m(this))},h.prototype.render=d,r=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},b.__r=0;var G=0;function $(e,n,r,o,i,c){var l,a,u={};for(a in n)"ref"==a?l=n[a]:u[a]=n[a];var _={type:e,props:u,key:r,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--G,__source:i,__self:c};if("function"==typeof e&&(l=e.defaultProps))for(a in l)void 0===u[a]&&(u[a]=l[a]);return t.vnode&&t.vnode(_),_}var q=function(){return q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},q.apply(this,arguments)};const J=function(e){return $("div",q({class:"flex flex-col mt-4"},{children:$("div",q({class:"-my-2 sm:-mx-6 lg:-mx-8"},{children:$("div",q({class:"py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8"},{children:$("div",q({class:"shadow overflow-hidden border-b border-gray-200"},{children:$("table",q({class:"min-w-full divide-y divide-gray-200"},{children:[$("thead",{children:$("tr",{children:[$("th",q({class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"Profile Id"})),$("th",q({class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"Name"})),$("th",q({class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"Email"})),$("th",q({class:"px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"External Id"})),$("th",q({class:"px-6 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"Catch E Id"}))]})}),$("tbody",{children:e.profiles.map((function(e,t){var n="px-6 py-4 whitespace-nowrap text-sm";return $("tr",q({class:t%2==0?"bg-white":"bg-gray-50"},{children:[$("td",q({class:n},{children:e.id})),$("td",q({class:n},{children:e.name})),$("td",q({class:n},{children:e.email})),$("td",q({class:n},{children:e.externalId})),$("td",q({class:n},{children:e.catchEId}))]}),t)}))})]}))}))}))}))}))};var Z,K,Q,X,Y=0,ee=[],te=[],ne=t.__b,re=t.__r,oe=t.diffed,ie=t.__c,ce=t.unmount;function le(e,n){t.__h&&t.__h(K,e,Y||n),Y=0;var r=K.__H||(K.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:te}),r.__[e]}function ae(e){return Y=1,function(e,t,n){var r=le(Z++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ye(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=K,!K.u)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var c=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(c=!0)}})),!(!c&&r.__c.props===e)&&(!i||i.call(this,e,t,n))};K.u=!0;var i=K.shouldComponentUpdate,c=K.componentWillUpdate;K.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}c&&c.call(this,e,t,n)},K.shouldComponentUpdate=o}return r.__N||r.__}(ye,e)}function ue(e,n){var r=le(Z++,3);!t.__s&&ve(r.__H,n)&&(r.__=e,r.i=n,K.__H.__h.push(r))}function _e(e){return Y=5,function(e,t){var n=le(Z++,7);return ve(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}((function(){return{current:e}}),[])}function se(){for(var e;e=ee.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(de),e.__H.__h.forEach(he),e.__H.__h=[]}catch(n){e.__H.__h=[],t.__e(n,e.__v)}}t.__b=function(e){K=null,ne&&ne(e)},t.__r=function(e){re&&re(e),Z=0;var t=(K=e.__c).__H;t&&(Q===K?(t.__h=[],K.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=te,e.__N=e.i=void 0}))):(t.__h.forEach(de),t.__h.forEach(he),t.__h=[])),Q=K},t.diffed=function(e){oe&&oe(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(1!==ee.push(n)&&X===t.requestAnimationFrame||((X=t.requestAnimationFrame)||pe)(se)),n.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==te&&(e.__=e.__V),e.i=void 0,e.__V=te}))),Q=K=null},t.__c=function(e,n){n.some((function(e){try{e.__h.forEach(de),e.__h=e.__h.filter((function(e){return!e.__||he(e)}))}catch(r){n.some((function(e){e.__h&&(e.__h=[])})),n=[],t.__e(r,e.__v)}})),ie&&ie(e,n)},t.unmount=function(e){ce&&ce(e);var n,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{de(e)}catch(e){n=e}})),r.__H=void 0,n&&t.__e(n,r.__v))};var fe="function"==typeof requestAnimationFrame;function pe(e){var t,n=function(){clearTimeout(r),fe&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);fe&&(t=requestAnimationFrame(n))}function de(e){var t=K,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),K=t}function he(e){var t=K;e.__c=e.__(),K=t}function ve(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function ye(e,t){return"function"==typeof t?t(e):t}var me,be=(me=function(e,t){return me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},me(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}me(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ge=function(e){function t(n,r){var o=e.call(this,n)||this;return o._response=r,Object.setPrototypeOf(o,t.prototype),o}return be(t,e),Object.defineProperty(t.prototype,"response",{get:function(){return this._response},enumerable:!1,configurable:!0}),t}(Error),we=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function l(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,l)}a((r=r.apply(e,t||[])).next())}))},ke=function(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(a){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(c=0)),c;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return c.label++,{value:l[1],done:!1};case 5:c.label++,r=l[1],l=[0];continue;case 7:l=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){c=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){c.label=l[1];break}if(6===l[0]&&c.label<o[1]){c.label=o[1],o=l;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(l);break}o[2]&&c.ops.pop(),c.trys.pop();continue}l=t.call(e,c)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,a])}}},xe=function(e,t){return function(n,r,o,i){return function(e,t,n,r,o){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function l(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,l)}a((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function(){var i,c;return function(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(a){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(c=0)),c;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return c.label++,{value:l[1],done:!1};case 5:c.label++,r=l[1],l=[0];continue;case 7:l=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){c=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){c.label=l[1];break}if(6===l[0]&&c.label<o[1]){c.label=o[1],o=l;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(l);break}o[2]&&c.ops.pop(),c.trys.pop();continue}l=t.call(e,c)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,a])}}}(this,(function(l){switch(l.label){case 0:return[4,fetch(e,{method:t,body:r?JSON.stringify(r):void 0,headers:{authorization:"Bearer ".concat(n),"content-type":"application/json"},signal:(null===AbortSignal||void 0===AbortSignal?void 0:AbortSignal.timeout)&&AbortSignal.timeout(15e3)})];case 1:if(!(i=l.sent()).ok)throw new ge("[API] Fetch error: ".concat(i.statusText,". Url: ").concat(t," ").concat(e),i);return o?(c={},[3,4]):[3,2];case 2:return[4,i.json()];case 3:c=l.sent(),l.label=4;case 4:return[2,c]}}))}))}(new URL("".concat(e).concat("/salary-packaging/admin/v1.0").concat(n)),r,t,o,i)}},Se=function(e,t){return we(void 0,void 0,void 0,(function(){return ke(this,(function(n){switch(n.label){case 0:return[4,e("/accounts/".concat(t,"/auth"),"GET")];case 1:return[2,n.sent()]}}))}))},Ce=function(e,t,n){return we(void 0,void 0,void 0,(function(){return ke(this,(function(r){switch(r.label){case 0:return[4,e("/accounts/".concat(t,"/profiles/search?search=").concat(n),"GET")];case 1:return[2,r.sent()]}}))}))},Ee=function(e){return we(void 0,void 0,void 0,(function(){var t,n;return ke(this,(function(r){switch(r.label){case 0:return(t=new Date).setUTCDate((new Date).getUTCDate()-2),(n=new Date).setUTCDate((new Date).getUTCDate()+2),[4,e("/ingest/clients","POST",{startDate:t.toISOString().split("T")[0],endDate:n.toISOString().split("T")[0]},!0)];case 1:return r.sent(),[2]}}))}))},Oe=function(){return Oe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Oe.apply(this,arguments)};const Pe=function(e){return $("button",Oe({},e,{className:"ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 disabled:bg-gray-500 disabled:cursor-not-allowed hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},{children:e.children}))};var Ne=function(){return Ne=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ne.apply(this,arguments)},Te=function(e){var t=ae(""),n=t[0],r=t[1];return $("div",Ne({class:"flex flex-row gap-4 sm:-mr-6 lg:mr-0"},{children:[$("div",Ne({className:"flex-grow max-w-md"},{children:[$("label",Ne({for:"search",class:"block text-sm font-medium text-gray-700"},{children:"Search"})),$("div",Ne({className:"mt-1"},{children:$("input",{class:"py-2 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md",name:"search",id:"search",placeholder:"First Name, Middle Name, Last Name or Email Id.",type:"text",value:n,onChange:function(e){return function(e){r(e)}(e.currentTarget.value)},required:!0})}))]})),$("div",Ne({className:"pt-6"},{children:$("div",Ne({className:"flex justify-end"},{children:$(Pe,Ne({type:"search",onClick:function(){return e.onSearch(n)}},{children:"Search"}))}))})),$("div",Ne({className:"flex-grow max-w-md"},{children:e.error&&$("h3",Ne({className:"text-red-500"},{children:e.error}))}))]}))};function Ae(e){this.message=e}Ae.prototype=new Error,Ae.prototype.name="InvalidCharacterError";var Ue="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Ae("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,o=0,i=0,c="";r=t.charAt(i++);~r&&(n=o%4?64*n+r:r,o++%4)?c+=String.fromCharCode(255&n>>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return c};function He(e){this.message=e}He.prototype=new Error,He.prototype.name="InvalidTokenError";var je=function(){function e(e){this.roles=e,this.isAuthorized=e.includes("SalaryPackaging.Access")}return e.create=function(t){return new e(function(e,t){if("string"!=typeof e)throw new He("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(Ue(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return Ue(t)}}(e.split(".")[n]))}catch(e){throw new He("Invalid token specified: "+e.message)}}(t).roles||[])},e}(),Ie=function(){return Ie=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ie.apply(this,arguments)};const De=function(){return $("svg",Ie({className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},{children:[$("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),$("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}))};function Le(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function Me(e){this.props=e}(Me.prototype=new h).isPureReactComponent=!0,Me.prototype.shouldComponentUpdate=function(e,t){return Le(this.props,e)||Le(this.state,t)};var Re=t.__b;t.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Re&&Re(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Ve=t.__e;t.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);Ve(e,t,n,r)};var We=t.unmount;function Fe(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=function(e,t){for(var n in t)e[n]=t[n];return e}({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return Fe(e,t,n)}))),e}function ze(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return ze(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function Be(){this.__u=0,this.t=null,this.__b=null}function Ge(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function $e(){this.u=null,this.o=null}t.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),We&&We(e)},(Be.prototype=new h).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=Ge(r.__v),i=!1,c=function(){i||(i=!0,n.__R=null,o?o(l):l())};n.__R=c;var l=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=ze(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}},a=!0===t.__h;r.__u++||a||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(c,c)},Be.prototype.componentWillUnmount=function(){this.t=[]},Be.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Fe(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&f(d,null,e.fallback);return o&&(o.__h=null),[f(d,null,t.__a?null:e.children),o]};var qe=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};($e.prototype=new h).__a=function(e){var t=this,n=Ge(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),qe(t,e,r)):o()};n?n(i):i()}},$e.prototype.render=function(e){this.u=null,this.o=new Map;var t=k(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},$e.prototype.componentDidUpdate=$e.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){qe(e,n,t)}))};var Je="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Ze=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ke=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Qe=/[A-Z0-9]/g,Xe="undefined"!=typeof document,Ye=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};h.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(h.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var et=t.event;function tt(){}function nt(){return this.cancelBubble}function rt(){return this.defaultPrevented}t.event=function(e){return et&&(e=et(e)),e.persist=tt,e.isPropagationStopped=nt,e.isDefaultPrevented=rt,e.nativeEvent=e};var ot={enumerable:!1,configurable:!0,get:function(){return this.class}},it=t.vnode;t.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||Xe&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var c=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"ondoubleclick"===c?o="ondblclick":"onchange"!==c||"input"!==n&&"textarea"!==n||Ye(t.type)?"onfocus"===c?o="onfocusin":"onblur"===c?o="onfocusout":Ke.test(o)?o=c:-1===n.indexOf("-")&&Ze.test(o)?o=o.replace(Qe,"-$&").toLowerCase():null===i&&(i=void 0):c=o="oninput","oninput"===c&&r[o=c]&&(o="oninputCapture"),r[o]=i}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=k(t.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=k(t.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",ot)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=Je,it&&it(e)};var ct=t.__r;t.__r=function(e){ct&&ct(e),e.__c};var lt=t.diffed;t.diffed=function(e){lt&<(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};const at=function(e,t){var n=_e();ue((function(){n.current=e}),[e]),ue((function(){if(t){var e=setInterval((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return null===(e=null==n?void 0:n.current)||void 0===e?void 0:e.call.apply(e,function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([n],t,!1))}),t);return function(){return clearInterval(e)}}}),[t])};var ut=function(){return ut=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ut.apply(this,arguments)},_t=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function l(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,l)}a((r=r.apply(e,t||[])).next())}))},st=function(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(a){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(c=0)),c;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return c.label++,{value:l[1],done:!1};case 5:c.label++,r=l[1],l=[0];continue;case 7:l=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){c=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){c.label=l[1];break}if(6===l[0]&&c.label<o[1]){c.label=o[1],o=l;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(l);break}o[2]&&c.ops.pop(),c.trys.pop();continue}l=t.call(e,c)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,a])}}};const ft=function(e){var t=ae(!1),n=t[0],r=t[1];return at((function(){return _t(void 0,void 0,void 0,(function(){return st(this,(function(t){switch(t.label){case 0:return[4,e.onCheck()];case 1:return t.sent()&&r(!1),[2]}}))}))}),n?e.checkInterval:void 0),ue((function(){if(n){var t=setTimeout((function(){n&&e.onTimeout(),r(!1)}),e.timeout);return function(){return clearTimeout(t)}}})),$(Pe,ut({onClick:function(){return _t(void 0,void 0,void 0,(function(){return st(this,(function(t){switch(t.label){case 0:return r(!0),[4,e.onClick()];case 1:return t.sent()||r(!1),[2]}}))}))},disabled:n},{children:$(d,n?{children:[$(De,{}),$("span",{children:e.processingText})]}:{children:e.text})}))};var pt=function(){return pt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},pt.apply(this,arguments)},dt=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function l(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,l)}a((r=r.apply(e,t||[])).next())}))},ht=function(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(a){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(c=0)),c;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return c.label++,{value:l[1],done:!1};case 5:c.label++,r=l[1],l=[0];continue;case 7:l=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){c=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){c.label=l[1];break}if(6===l[0]&&c.label<o[1]){c.label=o[1],o=l;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(l);break}o[2]&&c.ops.pop(),c.trys.pop();continue}l=t.call(e,c)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,a])}}};!function(e,t,n,r){function o(){var t=Reflect.construct(HTMLElement,[],o);return t._vdomComponent=e,t._root=t,t}(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=V,o.prototype.attributeChangedCallback=F,o.prototype.disconnectedCallback=z,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach((function(e){Object.defineProperty(o.prototype,e,{get:function(){return this._vdom.props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t,this.connectedCallback());var n=typeof t;null!=t&&"string"!==n&&"boolean"!==n&&"number"!==n||this.setAttribute(e,t)}})})),customElements.define("superhero-salpac-profile-admin",o)}((function(e){var t=ae([]),n=t[0],r=t[1],o=ae(),i=o[0],c=o[1],l=ae({status:"NotLinked",message:"Access Denied"}),a=l[0],u=l[1],_=ae(je.create(e.accessToken))[0],s=ae("Loading"),f=s[0],p=s[1];ue((function(){dt(void 0,void 0,void 0,(function(){var t,n,r;return ht(this,(function(o){switch(o.label){case 0:if(!(_.isAuthorized&&e.backendUrl&&e.accessToken&&e.accountId))return[3,5];o.label=1;case 1:return o.trys.push([1,3,,5]),t=xe(e.backendUrl,e.accessToken),[4,Se(t,e.accountId)];case 2:return n=o.sent(),u(n),"Linked"===n.status?p("Search"):p("Unlinked"),[3,5];case 3:return r=o.sent(),[4,d(r)];case 4:return o.sent(),p("Error"),[3,5];case 5:return[2]}}))}))}),[e.accessToken,e.accountId,e.backendUrl,_]),ue((function(){_&&!_.isAuthorized&&(c("Access Denied"),p("Error"))}),[_]);var d=function(e){return dt(void 0,void 0,void 0,(function(){var t;return ht(this,(function(n){switch(n.label){case 0:if(!(e instanceof ge))return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.response.json()];case 2:return t=n.sent(),c(t.message||"".concat(e.response.status," error occurred")),[3,4];case 3:return n.sent(),c("".concat(e.response.status," error occurred")),[3,4];case 4:return[3,6];case 5:c("Unexpected error occurred"),n.label=6;case 6:return[2]}}))}))};switch(f){case"Loading":return $("h1",pt({className:"text-gray-500"},{children:"Loading..."}));case"Search":return $("div",{children:[$(Te,{onSearch:function(t){return dt(void 0,void 0,void 0,(function(){var n,o,i;return ht(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,4]),c(void 0),n=xe(e.backendUrl,e.accessToken),[4,Ce(n,e.accountId,t)];case 1:return o=l.sent(),r(o),[3,4];case 2:return i=l.sent(),[4,d(i)];case 3:return l.sent(),[3,4];case 4:return[2]}}))}))}}),$("div",{children:$("h1",pt({className:"text-red-500"},{children:i}))}),$(J,{profiles:n})]});case"Error":return $("h1",pt({className:"text-red-500"},{children:i}));case"Unlinked":return $("div",{children:[$("h1",pt({className:"text-red-500 mb-4 ml-4"},{children:a.message})),$(ft,{onClick:function(){return dt(void 0,void 0,void 0,(function(){var t,n;return ht(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,4]),t=xe(e.backendUrl,e.accessToken),[4,Ee(t)];case 1:return r.sent(),[2,!0];case 2:return n=r.sent(),[4,d(n)];case 3:return r.sent(),p("Error"),[2,!1];case 4:return[2]}}))}))},onCheck:function(){return dt(void 0,void 0,void 0,(function(){var t,n;return ht(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=xe(e.backendUrl,e.accessToken),[4,Se(t,e.accountId)];case 1:return"Linked"===(n=r.sent()).status?(u(n),p("Search"),[2,!0]):a.status!==n.status||a.message!==n.message?(u(n),[2,!0]):[2,!1];case 2:return r.sent(),[2,!1];case 3:return[2]}}))}))},onTimeout:function(){c("Client sync took too long. Please confirm you have updated Catch-E correctly, refresh the page and try again. "),p("Error")},checkInterval:5e3,timeout:3e4,text:"Sync Clients",processingText:"Syncing..."})]})}}),0,["backend-url","access-token"])})();
|
1
|
+
(()=>{"use strict";var e,t,n,r,o,i,l,c={},a=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function u(e,t){for(var n in t)e[n]=t[n];return e}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function f(t,n,r){var o,i,l,c={};for(l in n)"key"==l?o=n[l]:"ref"==l?i=n[l]:c[l]=n[l];if(arguments.length>2&&(c.children=arguments.length>3?e.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(l in t.defaultProps)void 0===c[l]&&(c[l]=t.defaultProps[l]);return p(t,c,o,i,null)}function p(e,r,o,i,l){var c={type:e,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==l?++n:l};return null==l&&null!=t.vnode&&t.vnode(c),c}function d(e){return e.children}function h(e,t){this.props=e,this.context=t}function v(e,t){if(null==t)return e.__?v(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?v(e):null}function y(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 y(e)}}function m(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!b.__r++||o!==t.debounceRendering)&&((o=t.debounceRendering)||i)(b)}function b(){var e,t,n,o,i,c,a,_;for(r.sort(l);e=r.shift();)e.__d&&(t=r.length,o=void 0,i=void 0,a=(c=(n=e).__v).__e,(_=n.__P)&&(o=[],(i=u({},c)).__v=c.__v+1,P(_,c,i,n.__n,void 0!==_.ownerSVGElement,null!=c.__h?[a]:null,o,null==a?v(c):a,c.__h),T(o,c),c.__e!=a&&y(c)),r.length>t&&r.sort(l));b.__r=0}function g(e,t,n,r,o,i,l,_,u,s){var f,h,y,m,b,g,E,C=r&&r.__k||a,S=C.length;for(n.__k=[],f=0;f<t.length;f++)if(null!=(m=n.__k[f]=null==(m=t[f])||"boolean"==typeof m||"function"==typeof m?null:"string"==typeof m||"number"==typeof m||"bigint"==typeof m?p(null,m,null,null,m):Array.isArray(m)?p(d,{children:m},null,null,null):m.__b>0?p(m.type,m.props,m.key,m.ref?m.ref:null,m.__v):m)){if(m.__=n,m.__b=n.__b+1,null===(y=C[f])||y&&m.key==y.key&&m.type===y.type)C[f]=void 0;else for(h=0;h<S;h++){if((y=C[h])&&m.key==y.key&&m.type===y.type){C[h]=void 0;break}y=null}P(e,m,y=y||c,o,i,l,_,u,s),b=m.__e,(h=m.ref)&&y.ref!=h&&(E||(E=[]),y.ref&&E.push(y.ref,null,m),E.push(h,m.__c||b,m)),null!=b?(null==g&&(g=b),"function"==typeof m.type&&m.__k===y.__k?m.__d=u=w(m,u,e):u=k(e,m,y,C,b,u),"function"==typeof n.type&&(n.__d=u)):u&&y.__e==u&&u.parentNode!=e&&(u=v(y))}for(n.__e=g,f=S;f--;)null!=C[f]&&("function"==typeof n.type&&null!=C[f].__e&&C[f].__e==n.__d&&(n.__d=x(r).nextSibling),U(C[f],C[f]));if(E)for(f=0;f<E.length;f++)O(E[f],E[++f],E[++f])}function w(e,t,n){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,t="function"==typeof r.type?w(r,t,n):k(n,r,r,o,r.__e,t));return t}function k(e,t,n,r,o,i){var l,c,a;if(void 0!==t.__d)l=t.__d,t.__d=void 0;else if(null==n||o!=i||null==o.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(o),l=null;else{for(c=i,a=0;(c=c.nextSibling)&&a<r.length;a+=1)if(c==o)break e;e.insertBefore(o,i),l=i}return void 0!==l?l:o.nextSibling}function x(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=x(n)))return r;return null}function E(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||_.test(t)?n:n+"px"}function C(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||E(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||E(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?N:S,i):e.removeEventListener(t,i?N:S,i);else if("dangerouslySetInnerHTML"!==t){if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function S(e){return this.l[e.type+!1](t.event?t.event(e):e)}function N(e){return this.l[e.type+!0](t.event?t.event(e):e)}function P(e,n,r,o,i,l,c,a,_){var s,f,p,v,y,m,b,w,k,x,E,C,S,N,P,T=n.type;if(void 0!==n.constructor)return null;null!=r.__h&&(_=r.__h,a=n.__e=r.__e,n.__h=null,l=[a]),(s=t.__b)&&s(n);try{e:if("function"==typeof T){if(w=n.props,k=(s=T.contextType)&&o[s.__c],x=s?k?k.props.value:s.__:o,r.__c?b=(f=n.__c=r.__c).__=f.__E:("prototype"in T&&T.prototype.render?n.__c=f=new T(w,x):(n.__c=f=new h(w,x),f.constructor=T,f.render=H),k&&k.sub(f),f.props=w,f.state||(f.state={}),f.context=x,f.__n=o,p=f.__d=!0,f.__h=[],f._sb=[]),null==f.__s&&(f.__s=f.state),null!=T.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=u({},f.__s)),u(f.__s,T.getDerivedStateFromProps(w,f.__s))),v=f.props,y=f.state,f.__v=n,p)null==T.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(null==T.getDerivedStateFromProps&&w!==v&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(w,x),!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(w,f.__s,x)||n.__v===r.__v){for(n.__v!==r.__v&&(f.props=w,f.state=f.__s,f.__d=!1),f.__e=!1,n.__e=r.__e,n.__k=r.__k,n.__k.forEach((function(e){e&&(e.__=n)})),E=0;E<f._sb.length;E++)f.__h.push(f._sb[E]);f._sb=[],f.__h.length&&c.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(w,f.__s,x),null!=f.componentDidUpdate&&f.__h.push((function(){f.componentDidUpdate(v,y,m)}))}if(f.context=x,f.props=w,f.__P=e,C=t.__r,S=0,"prototype"in T&&T.prototype.render){for(f.state=f.__s,f.__d=!1,C&&C(n),s=f.render(f.props,f.state,f.context),N=0;N<f._sb.length;N++)f.__h.push(f._sb[N]);f._sb=[]}else do{f.__d=!1,C&&C(n),s=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++S<25);f.state=f.__s,null!=f.getChildContext&&(o=u(u({},o),f.getChildContext())),p||null==f.getSnapshotBeforeUpdate||(m=f.getSnapshotBeforeUpdate(v,y)),P=null!=s&&s.type===d&&null==s.key?s.props.children:s,g(e,Array.isArray(P)?P:[P],n,r,o,i,l,c,a,_),f.base=n.__e,n.__h=null,f.__h.length&&c.push(f),b&&(f.__E=f.__=null),f.__e=!1}else null==l&&n.__v===r.__v?(n.__k=r.__k,n.__e=r.__e):n.__e=A(r.__e,n,r,o,i,l,c,_);(s=t.diffed)&&s(n)}catch(e){n.__v=null,(_||null!=l)&&(n.__e=a,n.__h=!!_,l[l.indexOf(a)]=null),t.__e(e,n,r)}}function T(e,n){t.__c&&t.__c(n,e),e.some((function(n){try{e=n.__h,n.__h=[],e.some((function(e){e.call(n)}))}catch(e){t.__e(e,n.__v)}}))}function A(t,n,r,o,i,l,a,_){var u,f,p,d=r.props,h=n.props,y=n.type,m=0;if("svg"===y&&(i=!0),null!=l)for(;m<l.length;m++)if((u=l[m])&&"setAttribute"in u==!!y&&(y?u.localName===y:3===u.nodeType)){t=u,l[m]=null;break}if(null==t){if(null===y)return document.createTextNode(h);t=i?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,h.is&&h),l=null,_=!1}if(null===y)d===h||_&&t.data===h||(t.data=h);else{if(l=l&&e.call(t.childNodes),f=(d=r.props||c).dangerouslySetInnerHTML,p=h.dangerouslySetInnerHTML,!_){if(null!=l)for(d={},m=0;m<t.attributes.length;m++)d[t.attributes[m].name]=t.attributes[m].value;(p||f)&&(p&&(f&&p.__html==f.__html||p.__html===t.innerHTML)||(t.innerHTML=p&&p.__html||""))}if(function(e,t,n,r,o){var i;for(i in n)"children"===i||"key"===i||i in t||C(e,i,null,n[i],r);for(i in t)o&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===t[i]||C(e,i,t[i],n[i],r)}(t,h,d,i,_),p)n.__k=[];else if(m=n.props.children,g(t,Array.isArray(m)?m:[m],n,r,o,i&&"foreignObject"!==y,l,a,l?l[0]:r.__k&&v(r,0),_),null!=l)for(m=l.length;m--;)null!=l[m]&&s(l[m]);_||("value"in h&&void 0!==(m=h.value)&&(m!==t.value||"progress"===y&&!m||"option"===y&&m!==d.value)&&C(t,"value",m,d.value,!1),"checked"in h&&void 0!==(m=h.checked)&&m!==t.checked&&C(t,"checked",m,d.checked,!1))}return t}function O(e,n,r){try{"function"==typeof e?e(n):e.current=n}catch(e){t.__e(e,r)}}function U(e,n,r){var o,i;if(t.unmount&&t.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||O(o,null,n)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){t.__e(e,n)}o.base=o.__P=null,e.__c=void 0}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&U(o[i],n,r||"function"!=typeof e.type);r||null==e.__e||s(e.__e),e.__=e.__e=e.__d=void 0}function H(e,t,n){return this.constructor(e,n)}function j(n,r,o){var i,l,a;t.__&&t.__(n,r),l=(i="function"==typeof o)?null:o&&o.__k||r.__k,a=[],P(r,n=(!i&&o||r).__k=f(d,null,[n]),l||c,c,void 0!==r.ownerSVGElement,!i&&o?[o]:l?null:r.firstChild?e.call(r.childNodes):null,a,!i&&o?o:l?l.__e:r.firstChild,i),T(a,n)}function I(e,t){j(e,t,I)}function L(t,n,r){var o,i,l,c=u({},t.props);for(l in n)"key"==l?o=n[l]:"ref"==l?i=n[l]:c[l]=n[l];return arguments.length>2&&(c.children=arguments.length>3?e.call(arguments,2):r),p(t.type,c,o||t.key,i||t.ref,null)}function D(){return(D=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function F(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}(e,["context","children"]);return L(t,n)}function M(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=f(F,D({},this._props,{context:e.detail.context}),function e(t,n){if(3===t.nodeType)return t.data;if(1!==t.nodeType)return null;var r=[],o={},i=0,l=t.attributes,c=t.childNodes;for(i=l.length;i--;)"slot"!==l[i].name&&(o[l[i].name]=l[i].value,o[W(l[i].name)]=l[i].value);for(i=c.length;i--;){var a=e(c[i],null),_=c[i].slot;_?o[_]=f(R,{name:_},a):r[i]=a}var u=n?f(R,null,r):r;return f(n||t.nodeName.toLowerCase(),o,u)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?I:j)(this._vdom,this._root)}function W(e){return e.replace(/-(\w)/g,(function(e,t){return t?t.toUpperCase():""}))}function z(e,t,n){if(this._vdom){var r={};r[e]=n=null==n?void 0:n,r[W(e)]=n,this._vdom=L(this._vdom,r),j(this._vdom,this._root)}}function G(){j(this._vdom=null,this._root)}function R(e,t){var n=this;return f("slot",D({},e,{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}e=a.slice,t={__e:function(e,t,n,r){for(var o,i,l;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),l=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),l=o.__d),l)return o.__E=o}catch(t){e=t}throw e}},n=0,h.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=u({},this.state),"function"==typeof e&&(e=e(u({},n),this.props)),e&&u(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),m(this))},h.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),m(this))},h.prototype.render=d,r=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},b.__r=0;var V=0;function q(e,n,r,o,i,l){var c,a,_={};for(a in n)"ref"==a?c=n[a]:_[a]=n[a];var u={type:e,props:_,key:r,ref:c,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--V,__source:i,__self:l};if("function"==typeof e&&(c=e.defaultProps))for(a in c)void 0===_[a]&&(_[a]=c[a]);return t.vnode&&t.vnode(u),u}var B=function(){return B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},B.apply(this,arguments)};const $=function(e){return q("div",B({class:"flex flex-col mt-4"},{children:q("div",B({class:"-my-2 sm:-mx-6 lg:-mx-8"},{children:q("div",B({class:"py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8"},{children:q("div",B({class:"shadow overflow-hidden border-b border-gray-200"},{children:q("table",B({class:"min-w-full divide-y divide-gray-200"},{children:[q("thead",{children:q("tr",{children:[q("th",B({class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"Profile Id"})),q("th",B({class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"Name"})),q("th",B({class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"Email"})),q("th",B({class:"px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"External Id"})),q("th",B({class:"px-6 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap"},{children:"Catch E Id"}))]})}),q("tbody",{children:e.profiles.map((function(e,t){var n="px-6 py-4 whitespace-nowrap text-sm";return q("tr",B({class:t%2==0?"bg-white":"bg-gray-50"},{children:[q("td",B({class:n},{children:e.id})),q("td",B({class:n},{children:e.name})),q("td",B({class:n},{children:e.email})),q("td",B({class:n},{children:e.externalId})),q("td",B({class:n},{children:e.catchEId}))]}),t)}))})]}))}))}))}))}))};var J,K,Q,X,Y=0,Z=[],ee=[],te=t.__b,ne=t.__r,re=t.diffed,oe=t.__c,ie=t.unmount;function le(e,n){t.__h&&t.__h(K,e,Y||n),Y=0;var r=K.__H||(K.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:ee}),r.__[e]}function ce(e){return Y=1,function(e,t,n){var r=le(J++,2);if(r.t=e,!r.__c&&(r.__=[de(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=K,!K.u)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var l=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(l=!0)}})),!(!l&&r.__c.props===e)&&(!i||i.call(this,e,t,n))};K.u=!0;var i=K.shouldComponentUpdate,l=K.componentWillUpdate;K.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}l&&l.call(this,e,t,n)},K.shouldComponentUpdate=o}return r.__N||r.__}(de,e)}function ae(e,n){var r=le(J++,3);!t.__s&&function(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}(r.__H,n)&&(r.__=e,r.i=n,K.__H.__h.push(r))}function _e(){for(var e;e=Z.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(fe),e.__H.__h.forEach(pe),e.__H.__h=[]}catch(n){e.__H.__h=[],t.__e(n,e.__v)}}t.__b=function(e){K=null,te&&te(e)},t.__r=function(e){ne&&ne(e),J=0;var t=(K=e.__c).__H;t&&(Q===K?(t.__h=[],K.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=ee,e.__N=e.i=void 0}))):(t.__h.forEach(fe),t.__h.forEach(pe),t.__h=[])),Q=K},t.diffed=function(e){re&&re(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(1!==Z.push(n)&&X===t.requestAnimationFrame||((X=t.requestAnimationFrame)||se)(_e)),n.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==ee&&(e.__=e.__V),e.i=void 0,e.__V=ee}))),Q=K=null},t.__c=function(e,n){n.some((function(e){try{e.__h.forEach(fe),e.__h=e.__h.filter((function(e){return!e.__||pe(e)}))}catch(r){n.some((function(e){e.__h&&(e.__h=[])})),n=[],t.__e(r,e.__v)}})),oe&&oe(e,n)},t.unmount=function(e){ie&&ie(e);var n,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{fe(e)}catch(e){n=e}})),r.__H=void 0,n&&t.__e(n,r.__v))};var ue="function"==typeof requestAnimationFrame;function se(e){var t,n=function(){clearTimeout(r),ue&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);ue&&(t=requestAnimationFrame(n))}function fe(e){var t=K,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),K=t}function pe(e){var t=K;e.__c=e.__(),K=t}function de(e,t){return"function"==typeof t?t(e):t}var he,ve=(he=function(e,t){return he=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},he(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}he(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ye=function(e){function t(n,r){var o=e.call(this,n)||this;return o._response=r,Object.setPrototypeOf(o,t.prototype),o}return ve(t,e),Object.defineProperty(t.prototype,"response",{get:function(){return this._response},enumerable:!1,configurable:!0}),t}(Error),me=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function l(e){try{a(r.next(e))}catch(e){i(e)}}function c(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(l,c)}a((r=r.apply(e,t||[])).next())}))},be=function(e,t){var n,r,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!((o=(o=l.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}},ge=function(e,t){return function(n,r){return function(e,t,n,r,o){return i=void 0,l=void 0,a=function(){var r,o;return function(e,t){var n,r,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!((o=(o=l.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}(this,(function(i){switch(i.label){case 0:return[4,fetch(e,{method:t,body:void 0,headers:{authorization:"Bearer ".concat(n),"content-type":"application/json"},signal:(null===AbortSignal||void 0===AbortSignal?void 0:AbortSignal.timeout)&&AbortSignal.timeout(15e3)})];case 1:if(!(r=i.sent()).ok)throw new ye("[API] Fetch error: ".concat(r.statusText,". Url: ").concat(t," ").concat(e),r);return[3,2];case 2:return[4,r.json()];case 3:o=i.sent(),i.label=4;case 4:return[2,o]}}))},new((c=void 0)||(c=Promise))((function(e,t){function n(e){try{o(a.next(e))}catch(e){t(e)}}function r(e){try{o(a.throw(e))}catch(e){t(e)}}function o(t){var o;t.done?e(t.value):(o=t.value,o instanceof c?o:new c((function(e){e(o)}))).then(n,r)}o((a=a.apply(i,l||[])).next())}));var i,l,c,a}(new URL("".concat(e).concat("/salary-packaging/admin/v1.0").concat(n)),r,t)}},we=function(e,t){return me(void 0,void 0,void 0,(function(){return be(this,(function(n){switch(n.label){case 0:return[4,e("/accounts/".concat(t,"/auth"),"GET")];case 1:return[2,n.sent()]}}))}))},ke=function(e,t,n){return me(void 0,void 0,void 0,(function(){return be(this,(function(r){switch(r.label){case 0:return[4,e("/accounts/".concat(t,"/profiles/search?search=").concat(n),"GET")];case 1:return[2,r.sent()]}}))}))},xe=function(){return xe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},xe.apply(this,arguments)},Ee=function(e){var t=ce(""),n=t[0],r=t[1];return q("div",xe({class:"flex flex-row gap-4 sm:-mr-6 lg:mr-0"},{children:[q("div",xe({className:"flex-grow max-w-md"},{children:[q("label",xe({for:"search",class:"block text-sm font-medium text-gray-700"},{children:"Search"})),q("div",xe({className:"mt-1"},{children:q("input",{class:"py-2 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md",name:"search",id:"search",placeholder:"First Name, Middle Name, Last Name or Email Id.",type:"text",value:n,onChange:function(e){return function(e){r(e)}(e.currentTarget.value)},required:!0})}))]})),q("div",xe({className:"pt-6"},{children:q("div",xe({className:"flex justify-end"},{children:q("button",xe({class:"ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",type:"search",onClick:function(){return e.onSearch(n)}},{children:"Search"}))}))})),q("div",xe({className:"flex-grow max-w-md"},{children:e.error&&q("h3",xe({className:"text-red-500"},{children:e.error}))}))]}))};function Ce(e){this.message=e}Ce.prototype=new Error,Ce.prototype.name="InvalidCharacterError";var Se="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Ce("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,o=0,i=0,l="";r=t.charAt(i++);~r&&(n=o%4?64*n+r:r,o++%4)?l+=String.fromCharCode(255&n>>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return l};function Ne(e){this.message=e}Ne.prototype=new Error,Ne.prototype.name="InvalidTokenError";var Pe=function(){function e(e){this.roles=e,this.isAuthorized=e.includes("SalaryPackaging.Access")}return e.create=function(t){return new e(function(e,t){if("string"!=typeof e)throw new Ne("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(Se(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return Se(t)}}(e.split(".")[n]))}catch(e){throw new Ne("Invalid token specified: "+e.message)}}(t).roles||[])},e}(),Te=function(){return Te=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Te.apply(this,arguments)},Ae=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function l(e){try{a(r.next(e))}catch(e){i(e)}}function c(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(l,c)}a((r=r.apply(e,t||[])).next())}))},Oe=function(e,t){var n,r,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!((o=(o=l.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}};!function(e,t,n,r){function o(){var t=Reflect.construct(HTMLElement,[],o);return t._vdomComponent=e,t._root=t,t}(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=M,o.prototype.attributeChangedCallback=z,o.prototype.disconnectedCallback=G,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach((function(e){Object.defineProperty(o.prototype,e,{get:function(){return this._vdom.props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t,this.connectedCallback());var n=typeof t;null!=t&&"string"!==n&&"boolean"!==n&&"number"!==n||this.setAttribute(e,t)}})})),customElements.define("superhero-salpac-profile-admin",o)}((function(e){var t=ce([]),n=t[0],r=t[1],o=ce(),i=o[0],l=o[1],c=ce({status:"NotLinked",message:"Access Denied"}),a=c[0],_=c[1],u=ce(Pe.create(e.accessToken))[0],s=ce("Loading"),f=s[0],p=s[1];switch(ae((function(){Ae(void 0,void 0,void 0,(function(){var t,n;return Oe(this,(function(r){switch(r.label){case 0:if(!(u.isAuthorized&&e.backendUrl&&e.accessToken&&e.accountId))return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),t=ge(e.backendUrl,e.accessToken),[4,we(t,e.accountId)];case 2:return n=r.sent(),_(n),"Linked"===n.status?p("Search"):p("Unauthorized"),[3,4];case 3:return r.sent(),p("Unauthorized"),[3,4];case 4:return[2]}}))}))}),[e.accessToken,e.accountId,e.backendUrl,u]),ae((function(){u&&!u.isAuthorized&&p("Unauthorized")}),[u]),f){case"Loading":return q("h1",Te({className:"text-gray-500"},{children:"Loading..."}));case"Search":return q("div",{children:[q(Ee,{onSearch:function(t){return Ae(void 0,void 0,void 0,(function(){var n,o,i,c;return Oe(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,6]),l(void 0),n=ge(e.backendUrl,e.accessToken),[4,ke(n,e.accountId,t)];case 1:return o=a.sent(),r(o),[3,6];case 2:return(i=a.sent())instanceof ye?[4,i.response.json()]:[3,4];case 3:return c=a.sent(),l(c.message||"Unknown error occurred, please try again"),[3,5];case 4:l("Could not contact backend, please refresh the page and try again later"),a.label=5;case 5:return[3,6];case 6:return[2]}}))}))}}),q("div",{children:q("h1",Te({className:"text-red-500"},{children:i}))}),q($,{profiles:n})]});case"Unauthorized":return q("h1",Te({className:"text-red-500"},{children:a.message}))}}),0,["backend-url","access-token"])})();
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@flarehr/superhero-salpac-profile-admin",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.467",
|
4
4
|
"description": "Flare Superhero Profile Admin",
|
5
5
|
"license": "MIT",
|
6
6
|
"files": [
|
@@ -34,7 +34,7 @@
|
|
34
34
|
"@types/preact-custom-element": "^4.0.1",
|
35
35
|
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
36
36
|
"@typescript-eslint/parser": "^5.33.0",
|
37
|
-
"autoprefixer": "^10.4.
|
37
|
+
"autoprefixer": "^10.4.7",
|
38
38
|
"css-loader": "^6.7.1",
|
39
39
|
"cssnano": "^5.1.12",
|
40
40
|
"eslint": "^8.21.0",
|
@@ -45,10 +45,10 @@
|
|
45
45
|
"jest": "^29.7.0",
|
46
46
|
"jest-environment-jsdom": "^29.7.0",
|
47
47
|
"jest-preset-preact": "^4.1.1",
|
48
|
-
"postcss": "^8.4.
|
48
|
+
"postcss": "^8.4.14",
|
49
49
|
"postcss-loader": "^7.0.1",
|
50
50
|
"prettier": "^2.7.1",
|
51
|
-
"tailwindcss": "^3.
|
51
|
+
"tailwindcss": "^3.3.2",
|
52
52
|
"ts-loader": "^9.3.1",
|
53
53
|
"ts-node": "^10.9.2",
|
54
54
|
"typescript": "^4.7.4",
|