@hiver/connector-agent 4.27.0-appWidgets-beta.3 → 4.27.0-appWidgets-beta.4
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.
- package/features/app-widget/model.d.ts.map +1 -1
- package/index.es.js +80 -78
- package/index.umd.js +7 -7
- package/package.json +1 -1
package/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(ge,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react"),require("@hiver/hiver-ui-kit"),require("react-dom"),require("@hiver/hiver-ui-kit-v2/v2"),require("@hiver/hiver-ui-kit-v2/icons"),require("@hiver/hiver-ui-kit-v2")):typeof define=="function"&&define.amd?define(["exports","react","@hiver/hiver-ui-kit","react-dom","@hiver/hiver-ui-kit-v2/v2","@hiver/hiver-ui-kit-v2/icons","@hiver/hiver-ui-kit-v2"],p):(ge=typeof globalThis<"u"?globalThis:ge||self,p(ge["@hiver/connector-agent"]={},ge.React,ge.hiverUiKit,ge.ReactDOM,ge.v2,ge.icons,ge.hiverUiKitV2))})(this,function(ge,p,f,Nt,cr,na,hC){"use strict";var
|
|
1
|
+
(function(ge,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react"),require("@hiver/hiver-ui-kit"),require("react-dom"),require("@hiver/hiver-ui-kit-v2/v2"),require("@hiver/hiver-ui-kit-v2/icons"),require("@hiver/hiver-ui-kit-v2")):typeof define=="function"&&define.amd?define(["exports","react","@hiver/hiver-ui-kit","react-dom","@hiver/hiver-ui-kit-v2/v2","@hiver/hiver-ui-kit-v2/icons","@hiver/hiver-ui-kit-v2"],p):(ge=typeof globalThis<"u"?globalThis:ge||self,p(ge["@hiver/connector-agent"]={},ge.React,ge.hiverUiKit,ge.ReactDOM,ge.v2,ge.icons,ge.hiverUiKitV2))})(this,function(ge,p,f,Nt,cr,na,hC){"use strict";var fY=Object.defineProperty;var pC=ge=>{throw TypeError(ge)};var iY=(ge,p,f)=>p in ge?fY(ge,p,{enumerable:!0,configurable:!0,writable:!0,value:f}):ge[p]=f;var et=(ge,p,f)=>iY(ge,typeof p!="symbol"?p+"":p,f),$l=(ge,p,f)=>p.has(ge)||pC("Cannot "+f);var N=(ge,p,f)=>($l(ge,p,"read from private field"),f?f.call(ge):p.get(ge)),xe=(ge,p,f)=>p.has(ge)?pC("Cannot add the same private member more than once"):p instanceof WeakSet?p.add(ge):p.set(ge,f),ce=(ge,p,f,Nt)=>($l(ge,p,"write to private field"),Nt?Nt.call(ge,f):p.set(ge,f),f),_e=(ge,p,f)=>($l(ge,p,"access private method"),f);var Gi=(ge,p,f,Nt)=>({set _(cr){ce(ge,p,cr,f)},get _(){return N(ge,p,Nt)}});var Jo,$r,Qu,q6,Ru,eo,Hu,U6,Yo,K6,Wu,Gu,Vn,qo,nn,us,Uo,ar,Gr,$6,yr,eC,Br,ln,Ko,vr,lo,tC,Rr,sr,as,nC,It,to,no,Vu,zu,ro,Xu,Zu,rC,bn,Ye,ss,Dn,$o,Ju,oo,wr,fs,Yu,qu,eu,tu,uo,Uu,st,ps,eD,tD,nD,rD,oD,uD,aD,gC,oC,nu,zn,Ku,$u,Xn,ao,is,cs,ls,qt,sD,fD,iD,cD,lD,uC,so,fo,xn,Hr,Wr,Vi,DD,aC;function FC(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const I=FC(p);var Ne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function EC(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var zi={exports:{}},ra={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -1575,7 +1575,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1575
1575
|
*
|
|
1576
1576
|
* This source code is licensed under the MIT license found in the
|
|
1577
1577
|
* LICENSE file in the root directory of this source tree.
|
|
1578
|
-
*/var u2;function pB(){return u2||(u2=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,u=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,D=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,b=e?Symbol.for("react.memo"):60115,C=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,A=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function F(Z){return typeof Z=="string"||typeof Z=="function"||Z===r||Z===l||Z===u||Z===o||Z===d||Z===m||typeof Z=="object"&&Z!==null&&(Z.$$typeof===C||Z.$$typeof===b||Z.$$typeof===s||Z.$$typeof===i||Z.$$typeof===D||Z.$$typeof===A||Z.$$typeof===h||Z.$$typeof===E||Z.$$typeof===g)}function x(Z){if(typeof Z=="object"&&Z!==null){var W=Z.$$typeof;switch(W){case t:var K=Z.type;switch(K){case c:case l:case r:case u:case o:case d:return K;default:var U=K&&K.$$typeof;switch(U){case i:case D:case C:case b:case s:return U;default:return W}}case n:return W}}}var y=c,S=l,v=i,w=s,k=t,O=D,j=r,T=C,L=b,M=n,_=u,P=o,G=d,z=!1;function V(Z){return z||(z=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),H(Z)||x(Z)===c}function H(Z){return x(Z)===l}function J(Z){return x(Z)===i}function X(Z){return x(Z)===s}function te(Z){return typeof Z=="object"&&Z!==null&&Z.$$typeof===t}function ue(Z){return x(Z)===D}function R(Z){return x(Z)===r}function ee(Z){return x(Z)===C}function fe(Z){return x(Z)===b}function Fe(Z){return x(Z)===n}function Oe(Z){return x(Z)===u}function Ce(Z){return x(Z)===o}function re(Z){return x(Z)===d}at.AsyncMode=y,at.ConcurrentMode=S,at.ContextConsumer=v,at.ContextProvider=w,at.Element=k,at.ForwardRef=O,at.Fragment=j,at.Lazy=T,at.Memo=L,at.Portal=M,at.Profiler=_,at.StrictMode=P,at.Suspense=G,at.isAsyncMode=V,at.isConcurrentMode=H,at.isContextConsumer=J,at.isContextProvider=X,at.isElement=te,at.isForwardRef=ue,at.isFragment=R,at.isLazy=ee,at.isMemo=fe,at.isPortal=Fe,at.isProfiler=Oe,at.isStrictMode=Ce,at.isSuspense=re,at.isValidElementType=F,at.typeOf=x}()),at}process.env.NODE_ENV==="production"?Mc.exports=AB():Mc.exports=pB();var gB=Mc.exports,a2=gB,CB={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},hB={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s2={};s2[a2.ForwardRef]=CB,s2[a2.Memo]=hB;var FB=!0;function mB(e,t,n){var r="";return n.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):o&&(r+=o+" ")}),r}var f2=function(t,n,r){var o=t.key+"-"+n.name;(r===!1||FB===!1)&&t.registered[o]===void 0&&(t.registered[o]=n.styles)},EB=function(t,n,r){f2(t,n,r);var o=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var u=n;do t.insert(n===u?"."+o:"",u,t.sheet,!0),u=u.next;while(u!==void 0)}};function bB(e){for(var t=0,n,r=0,o=e.length;o>=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var xB={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},yB=!1,BB=/[A-Z]|^ms/g,vB=/_EMO_([^_]+?)_([^]*?)_EMO_/g,i2=function(t){return t.charCodeAt(1)===45},c2=function(t){return t!=null&&typeof t!="boolean"},_c=uB(function(e){return i2(e)?e:e.replace(BB,"-$&").toLowerCase()}),l2=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(vB,function(r,o,u){return Fr={name:o,styles:u,next:Fr},o})}return xB[t]!==1&&!i2(t)&&typeof n=="number"&&n!==0?n+"px":n},wB="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function Ta(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var o=n;if(o.anim===1)return Fr={name:o.name,styles:o.styles,next:Fr},o.name;var u=n;if(u.styles!==void 0){var s=u.next;if(s!==void 0)for(;s!==void 0;)Fr={name:s.name,styles:s.styles,next:Fr},s=s.next;var i=u.styles+";";return i}return SB(e,t,n)}case"function":{if(e!==void 0){var c=Fr,l=n(e);return Fr=c,Ta(e,t,l)}break}}var D=n;return D}function SB(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=Ta(e,t,n[o])+";";else for(var u in n){var s=n[u];if(typeof s!="object"){var i=s;c2(i)&&(r+=_c(u)+":"+l2(u,i)+";")}else{if(u==="NO_COMPONENT_SELECTOR"&&yB)throw new Error(wB);if(Array.isArray(s)&&typeof s[0]=="string"&&t==null)for(var c=0;c<s.length;c++)c2(s[c])&&(r+=_c(u)+":"+l2(u,s[c])+";");else{var l=Ta(e,t,s);switch(u){case"animation":case"animationName":{r+=_c(u)+":"+l+";";break}default:r+=u+"{"+l+"}"}}}}return r}var D2=/label:\s*([^\s;{]+)\s*(;|$)/g,Fr;function d2(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,o="";Fr=void 0;var u=e[0];if(u==null||u.raw===void 0)r=!1,o+=Ta(n,t,u);else{var s=u;o+=s[0]}for(var i=1;i<e.length;i++)if(o+=Ta(n,t,e[i]),r){var c=u;o+=c[i]}D2.lastIndex=0;for(var l="",D;(D=D2.exec(o))!==null;)l+="-"+D[1];var d=bB(o)+l;return{name:d,styles:o,next:Fr}}var IB=function(t){return t()},kB=I.useInsertionEffect?I.useInsertionEffect:!1,TB=kB||IB,LB=!1,A2=I.createContext(typeof HTMLElement<"u"?dB({key:"css"}):null);A2.Provider;var OB=function(t){return p.forwardRef(function(n,r){var o=p.useContext(A2);return t(n,o,r)})},MB=I.createContext({}),jc={}.hasOwnProperty,Nc="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",_B=function(t,n){var r={};for(var o in n)jc.call(n,o)&&(r[o]=n[o]);return r[Nc]=t,r},jB=function(t){var n=t.cache,r=t.serialized,o=t.isStringTag;return f2(n,r,o),TB(function(){return EB(n,r,o)}),null},NB=OB(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var o=e[Nc],u=[r],s="";typeof e.className=="string"?s=mB(t.registered,u,e.className):e.className!=null&&(s=e.className+" ");var i=d2(u,void 0,I.useContext(MB));s+=t.key+"-"+i.name;var c={};for(var l in e)jc.call(e,l)&&l!=="css"&&l!==Nc&&!LB&&(c[l]=e[l]);return c.className=s,n&&(c.ref=n),I.createElement(I.Fragment,null,I.createElement(jB,{cache:t,serialized:i,isStringTag:typeof o=="string"}),I.createElement(o,c))}),PB=NB,ke=function(t,n){var r=arguments;if(n==null||!jc.call(n,"css"))return I.createElement.apply(void 0,r);var o=r.length,u=new Array(o);u[0]=PB,u[1]=_B(t,n);for(var s=2;s<o;s++)u[s]=r[s];return I.createElement.apply(null,u)};function Pc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d2(t)}var QB=function(){var t=Pc.apply(void 0,arguments),n="animation-"+t.name;return{name:n,styles:"@keyframes "+n+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function RB(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const HB=Math.min,WB=Math.max,bf=Math.round,xf=Math.floor,yf=e=>({x:e,y:e});function GB(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Bf(){return typeof window<"u"}function p2(e){return C2(e)?(e.nodeName||"").toLowerCase():"#document"}function Or(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function g2(e){var t;return(t=(C2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function C2(e){return Bf()?e instanceof Node||e instanceof Or(e).Node:!1}function VB(e){return Bf()?e instanceof Element||e instanceof Or(e).Element:!1}function Qc(e){return Bf()?e instanceof HTMLElement||e instanceof Or(e).HTMLElement:!1}function h2(e){return!Bf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Or(e).ShadowRoot}function F2(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Rc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function zB(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function XB(e){return["html","body","#document"].includes(p2(e))}function Rc(e){return Or(e).getComputedStyle(e)}function ZB(e){if(p2(e)==="html")return e;const t=e.assignedSlot||e.parentNode||h2(e)&&e.host||g2(e);return h2(t)?t.host:t}function m2(e){const t=ZB(e);return XB(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qc(t)&&F2(t)?t:m2(t)}function vf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=m2(e),u=o===((r=e.ownerDocument)==null?void 0:r.body),s=Or(o);if(u){const i=Hc(s);return t.concat(s,s.visualViewport||[],F2(o)?o:[],i&&n?vf(i):[])}return t.concat(o,vf(o,[],n))}function Hc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function JB(e){const t=Rc(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Qc(e),u=o?e.offsetWidth:n,s=o?e.offsetHeight:r,i=bf(n)!==u||bf(r)!==s;return i&&(n=u,r=s),{width:n,height:r,$:i}}function Wc(e){return VB(e)?e:e.contextElement}function E2(e){const t=Wc(e);if(!Qc(t))return yf(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:u}=JB(t);let s=(u?bf(n.width):n.width)/r,i=(u?bf(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}const YB=yf(0);function qB(e){const t=Or(e);return!zB()||!t.visualViewport?YB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function UB(e,t,n){return!1}function b2(e,t,n,r){t===void 0&&(t=!1);const o=e.getBoundingClientRect(),u=Wc(e);let s=yf(1);t&&(s=E2(e));const i=UB()?qB(u):yf(0);let c=(o.left+i.x)/s.x,l=(o.top+i.y)/s.y,D=o.width/s.x,d=o.height/s.y;if(u){const m=Or(u),b=r;let C=m,g=Hc(C);for(;g&&r&&b!==C;){const A=E2(g),h=g.getBoundingClientRect(),E=Rc(g),F=h.left+(g.clientLeft+parseFloat(E.paddingLeft))*A.x,x=h.top+(g.clientTop+parseFloat(E.paddingTop))*A.y;c*=A.x,l*=A.y,D*=A.x,d*=A.y,c+=F,l+=x,C=Or(g),g=Hc(C)}}return GB({width:D,height:d,x:c,y:l})}function KB(e,t){let n=null,r;const o=g2(e);function u(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function s(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),u();const{left:l,top:D,width:d,height:m}=e.getBoundingClientRect();if(i||t(),!d||!m)return;const b=xf(D),C=xf(o.clientWidth-(l+d)),g=xf(o.clientHeight-(D+m)),A=xf(l),E={rootMargin:-b+"px "+-C+"px "+-g+"px "+-A+"px",threshold:WB(0,HB(1,c))||1};let F=!0;function x(y){const S=y[0].intersectionRatio;if(S!==c){if(!F)return s();S?s(!1,S):r=setTimeout(()=>{s(!1,1e-7)},1e3)}F=!1}try{n=new IntersectionObserver(x,{...E,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,E)}n.observe(e)}return s(!0),u}function $B(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:u=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Wc(e),D=o||u?[...l?vf(l):[],...vf(t)]:[];D.forEach(h=>{o&&h.addEventListener("scroll",n,{passive:!0}),u&&h.addEventListener("resize",n)});const d=l&&i?KB(l,n):null;let m=-1,b=null;s&&(b=new ResizeObserver(h=>{let[E]=h;E&&E.target===l&&b&&(b.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var F;(F=b)==null||F.observe(t)})),n()}),l&&!c&&b.observe(l),b.observe(t));let C,g=c?b2(e):null;c&&A();function A(){const h=b2(e);g&&(h.x!==g.x||h.y!==g.y||h.width!==g.width||h.height!==g.height)&&n(),g=h,C=requestAnimationFrame(A)}return n(),()=>{var h;D.forEach(E=>{o&&E.removeEventListener("scroll",n),u&&E.removeEventListener("resize",n)}),d==null||d(),(h=b)==null||h.disconnect(),b=null,c&&cancelAnimationFrame(C)}}var Gc=p.useLayoutEffect,ev=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],wf=function(){};function tv(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function nv(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var u=[].concat(r);if(t&&e)for(var s in t)t.hasOwnProperty(s)&&t[s]&&u.push("".concat(tv(e,s)));return u.filter(function(i){return i}).map(function(i){return String(i).trim()}).join(" ")}var Sf=function(t){return Dv(t)?t.filter(Boolean):Io(t)==="object"&&t!==null?[t]:[]},x2=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=er(t,ev);return we({},n)},St=function(t,n,r){var o=t.cx,u=t.getStyles,s=t.getClassNames,i=t.className;return{css:u(n,t),className:o(r??{},s(n,t),i)}};function rv(e,t,n){if(n){var r=n(e,t);if(typeof r=="string")return r}return e}function If(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function ov(e){return If(e)?window.innerHeight:e.clientHeight}function y2(e){return If(e)?window.pageYOffset:e.scrollTop}function kf(e,t){if(If(e)){window.scrollTo(0,t);return}e.scrollTop=t}function uv(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.documentElement}function av(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Tf(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:wf,o=y2(e),u=t-o,s=10,i=0;function c(){i+=s;var l=av(i,o,u,n);kf(e,l),i<n?window.requestAnimationFrame(c):r(e)}c()}function B2(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?kf(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&kf(e,Math.max(t.offsetTop-o,0))}function sv(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function v2(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function fv(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var w2=!1,iv={get passive(){return w2=!0}},Lf=typeof window<"u"?window:{};Lf.addEventListener&&Lf.removeEventListener&&(Lf.addEventListener("p",wf,iv),Lf.removeEventListener("p",wf,!1));var cv=w2;function lv(e){return e!=null}function Dv(e){return Array.isArray(e)}function La(e,t,n){return e?t:n}function CY(e){return e}function hY(e){return e}var dv=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var u=Object.entries(t).filter(function(s){var i=Wt(s,1),c=i[0];return!r.includes(c)});return u.reduce(function(s,i){var c=Wt(i,2),l=c[0],D=c[1];return s[l]=D,s},{})},Av=["children","innerProps"],pv=["children","innerProps"];function gv(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,u=e.shouldScroll,s=e.isFixedPosition,i=e.controlHeight,c=uv(n),l={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return l;var D=c.getBoundingClientRect(),d=D.height,m=n.getBoundingClientRect(),b=m.bottom,C=m.height,g=m.top,A=n.offsetParent.getBoundingClientRect(),h=A.top,E=s?window.innerHeight:ov(c),F=y2(c),x=parseInt(getComputedStyle(n).marginBottom,10),y=parseInt(getComputedStyle(n).marginTop,10),S=h-y,v=E-g,w=S+F,k=d-F-g,O=b-E+F+x,j=F+g-y,T=160;switch(o){case"auto":case"bottom":if(v>=C)return{placement:"bottom",maxHeight:t};if(k>=C&&!s)return u&&Tf(c,O,T),{placement:"bottom",maxHeight:t};if(!s&&k>=r||s&&v>=r){u&&Tf(c,O,T);var L=s?v-x:k-x;return{placement:"bottom",maxHeight:L}}if(o==="auto"||s){var M=t,_=s?S:w;return _>=r&&(M=Math.min(_-x-i,t)),{placement:"top",maxHeight:M}}if(o==="bottom")return u&&kf(c,O),{placement:"bottom",maxHeight:t};break;case"top":if(S>=C)return{placement:"top",maxHeight:t};if(w>=C&&!s)return u&&Tf(c,j,T),{placement:"top",maxHeight:t};if(!s&&w>=r||s&&S>=r){var P=t;return(!s&&w>=r||s&&S>=r)&&(P=s?S-y:w-y),u&&Tf(c,j,T),{placement:"top",maxHeight:P}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return l}function Cv(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var S2=function(t){return t==="auto"?"bottom":t},hv=function(t,n){var r,o=t.placement,u=t.theme,s=u.borderRadius,i=u.spacing,c=u.colors;return we((r={label:"menu"},hu(r,Cv(o),"100%"),hu(r,"position","absolute"),hu(r,"width","100%"),hu(r,"zIndex",1),r),n?{}:{backgroundColor:c.neutral0,borderRadius:s,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:i.menuGutter,marginTop:i.menuGutter})},I2=p.createContext(null),Fv=function(t){var n=t.children,r=t.minMenuHeight,o=t.maxMenuHeight,u=t.menuPlacement,s=t.menuPosition,i=t.menuShouldScrollIntoView,c=t.theme,l=p.useContext(I2)||{},D=l.setPortalPlacement,d=p.useRef(null),m=p.useState(o),b=Wt(m,2),C=b[0],g=b[1],A=p.useState(null),h=Wt(A,2),E=h[0],F=h[1],x=c.spacing.controlHeight;return Gc(function(){var y=d.current;if(y){var S=s==="fixed",v=i&&!S,w=gv({maxHeight:o,menuEl:y,minHeight:r,placement:u,shouldScroll:v,isFixedPosition:S,controlHeight:x});g(w.maxHeight),F(w.placement),D==null||D(w.placement)}},[o,u,s,i,r,D,x]),n({ref:d,placerProps:we(we({},t),{},{placement:E||S2(u),maxHeight:C})})},mv=function(t){var n=t.children,r=t.innerRef,o=t.innerProps;return ke("div",Te({},St(t,"menu",{menu:!0}),{ref:r},o),n)},Ev=mv,bv=function(t,n){var r=t.maxHeight,o=t.theme.spacing.baseUnit;return we({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:o,paddingTop:o})},xv=function(t){var n=t.children,r=t.innerProps,o=t.innerRef,u=t.isMulti;return ke("div",Te({},St(t,"menuList",{"menu-list":!0,"menu-list--is-multi":u}),{ref:o},r),n)},k2=function(t,n){var r=t.theme,o=r.spacing.baseUnit,u=r.colors;return we({textAlign:"center"},n?{}:{color:u.neutral40,padding:"".concat(o*2,"px ").concat(o*3,"px")})},yv=k2,Bv=k2,vv=function(t){var n=t.children,r=n===void 0?"No options":n,o=t.innerProps,u=er(t,Av);return ke("div",Te({},St(we(we({},u),{},{children:r,innerProps:o}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),o),r)},wv=function(t){var n=t.children,r=n===void 0?"Loading...":n,o=t.innerProps,u=er(t,pv);return ke("div",Te({},St(we(we({},u),{},{children:r,innerProps:o}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),o),r)},Sv=function(t){var n=t.rect,r=t.offset,o=t.position;return{left:n.left,position:o,top:r,width:n.width,zIndex:1}},Iv=function(t){var n=t.appendTo,r=t.children,o=t.controlElement,u=t.innerProps,s=t.menuPlacement,i=t.menuPosition,c=p.useRef(null),l=p.useRef(null),D=p.useState(S2(s)),d=Wt(D,2),m=d[0],b=d[1],C=p.useMemo(function(){return{setPortalPlacement:b}},[]),g=p.useState(null),A=Wt(g,2),h=A[0],E=A[1],F=p.useCallback(function(){if(o){var v=sv(o),w=i==="fixed"?0:window.pageYOffset,k=v[m]+w;(k!==(h==null?void 0:h.offset)||v.left!==(h==null?void 0:h.rect.left)||v.width!==(h==null?void 0:h.rect.width))&&E({offset:k,rect:v})}},[o,i,m,h==null?void 0:h.offset,h==null?void 0:h.rect.left,h==null?void 0:h.rect.width]);Gc(function(){F()},[F]);var x=p.useCallback(function(){typeof l.current=="function"&&(l.current(),l.current=null),o&&c.current&&(l.current=$B(o,c.current,F,{elementResize:"ResizeObserver"in window}))},[o,F]);Gc(function(){x()},[x]);var y=p.useCallback(function(v){c.current=v,x()},[x]);if(!n&&i!=="fixed"||!h)return null;var S=ke("div",Te({ref:y},St(we(we({},t),{},{offset:h.offset,position:i,rect:h.rect}),"menuPortal",{"menu-portal":!0}),u),r);return ke(I2.Provider,{value:C},n?Nt.createPortal(S,n):S)},kv=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},Tv=function(t){var n=t.children,r=t.innerProps,o=t.isDisabled,u=t.isRtl;return ke("div",Te({},St(t,"container",{"--is-disabled":o,"--is-rtl":u}),r),n)},Lv=function(t,n){var r=t.theme.spacing,o=t.isMulti,u=t.hasValue,s=t.selectProps.controlShouldRenderValue;return we({alignItems:"center",display:o&&u&&s?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},Ov=function(t){var n=t.children,r=t.innerProps,o=t.isMulti,u=t.hasValue;return ke("div",Te({},St(t,"valueContainer",{"value-container":!0,"value-container--is-multi":o,"value-container--has-value":u}),r),n)},Mv=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},_v=function(t){var n=t.children,r=t.innerProps;return ke("div",Te({},St(t,"indicatorsContainer",{indicators:!0}),r),n)},T2,jv=["size"],Nv=["innerProps","isRtl","size"];function Pv(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Qv=process.env.NODE_ENV==="production"?{name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"}:{name:"tj5bde-Svg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW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){var n=t.size,r=er(t,jv);return ke("svg",Te({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Qv},r))},Vc=function(t){return ke(L2,Te({size:20},t),ke("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},O2=function(t){return ke(L2,Te({size:20},t),ke("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},M2=function(t,n){var r=t.isFocused,o=t.theme,u=o.spacing.baseUnit,s=o.colors;return we({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?s.neutral60:s.neutral20,padding:u*2,":hover":{color:r?s.neutral80:s.neutral40}})},Rv=M2,Hv=function(t){var n=t.children,r=t.innerProps;return ke("div",Te({},St(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||ke(O2,null))},Wv=M2,Gv=function(t){var n=t.children,r=t.innerProps;return ke("div",Te({},St(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||ke(Vc,null))},Vv=function(t,n){var r=t.isDisabled,o=t.theme,u=o.spacing.baseUnit,s=o.colors;return we({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?s.neutral10:s.neutral20,marginBottom:u*2,marginTop:u*2})},zv=function(t){var n=t.innerProps;return ke("span",Te({},n,St(t,"indicatorSeparator",{"indicator-separator":!0})))},Xv=QB(T2||(T2=RB([`
|
|
1578
|
+
*/var u2;function pB(){return u2||(u2=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,u=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,D=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,b=e?Symbol.for("react.memo"):60115,C=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,A=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function F(Z){return typeof Z=="string"||typeof Z=="function"||Z===r||Z===l||Z===u||Z===o||Z===d||Z===m||typeof Z=="object"&&Z!==null&&(Z.$$typeof===C||Z.$$typeof===b||Z.$$typeof===s||Z.$$typeof===i||Z.$$typeof===D||Z.$$typeof===A||Z.$$typeof===h||Z.$$typeof===E||Z.$$typeof===g)}function x(Z){if(typeof Z=="object"&&Z!==null){var W=Z.$$typeof;switch(W){case t:var K=Z.type;switch(K){case c:case l:case r:case u:case o:case d:return K;default:var U=K&&K.$$typeof;switch(U){case i:case D:case C:case b:case s:return U;default:return W}}case n:return W}}}var y=c,S=l,v=i,w=s,k=t,O=D,j=r,T=C,L=b,M=n,_=u,P=o,G=d,z=!1;function V(Z){return z||(z=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),H(Z)||x(Z)===c}function H(Z){return x(Z)===l}function J(Z){return x(Z)===i}function X(Z){return x(Z)===s}function te(Z){return typeof Z=="object"&&Z!==null&&Z.$$typeof===t}function ue(Z){return x(Z)===D}function R(Z){return x(Z)===r}function ee(Z){return x(Z)===C}function fe(Z){return x(Z)===b}function Fe(Z){return x(Z)===n}function Oe(Z){return x(Z)===u}function Ce(Z){return x(Z)===o}function re(Z){return x(Z)===d}at.AsyncMode=y,at.ConcurrentMode=S,at.ContextConsumer=v,at.ContextProvider=w,at.Element=k,at.ForwardRef=O,at.Fragment=j,at.Lazy=T,at.Memo=L,at.Portal=M,at.Profiler=_,at.StrictMode=P,at.Suspense=G,at.isAsyncMode=V,at.isConcurrentMode=H,at.isContextConsumer=J,at.isContextProvider=X,at.isElement=te,at.isForwardRef=ue,at.isFragment=R,at.isLazy=ee,at.isMemo=fe,at.isPortal=Fe,at.isProfiler=Oe,at.isStrictMode=Ce,at.isSuspense=re,at.isValidElementType=F,at.typeOf=x}()),at}process.env.NODE_ENV==="production"?Mc.exports=AB():Mc.exports=pB();var gB=Mc.exports,a2=gB,CB={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},hB={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s2={};s2[a2.ForwardRef]=CB,s2[a2.Memo]=hB;var FB=!0;function mB(e,t,n){var r="";return n.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):o&&(r+=o+" ")}),r}var f2=function(t,n,r){var o=t.key+"-"+n.name;(r===!1||FB===!1)&&t.registered[o]===void 0&&(t.registered[o]=n.styles)},EB=function(t,n,r){f2(t,n,r);var o=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var u=n;do t.insert(n===u?"."+o:"",u,t.sheet,!0),u=u.next;while(u!==void 0)}};function bB(e){for(var t=0,n,r=0,o=e.length;o>=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var xB={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},yB=!1,BB=/[A-Z]|^ms/g,vB=/_EMO_([^_]+?)_([^]*?)_EMO_/g,i2=function(t){return t.charCodeAt(1)===45},c2=function(t){return t!=null&&typeof t!="boolean"},_c=uB(function(e){return i2(e)?e:e.replace(BB,"-$&").toLowerCase()}),l2=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(vB,function(r,o,u){return Fr={name:o,styles:u,next:Fr},o})}return xB[t]!==1&&!i2(t)&&typeof n=="number"&&n!==0?n+"px":n},wB="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function Ta(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var o=n;if(o.anim===1)return Fr={name:o.name,styles:o.styles,next:Fr},o.name;var u=n;if(u.styles!==void 0){var s=u.next;if(s!==void 0)for(;s!==void 0;)Fr={name:s.name,styles:s.styles,next:Fr},s=s.next;var i=u.styles+";";return i}return SB(e,t,n)}case"function":{if(e!==void 0){var c=Fr,l=n(e);return Fr=c,Ta(e,t,l)}break}}var D=n;return D}function SB(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=Ta(e,t,n[o])+";";else for(var u in n){var s=n[u];if(typeof s!="object"){var i=s;c2(i)&&(r+=_c(u)+":"+l2(u,i)+";")}else{if(u==="NO_COMPONENT_SELECTOR"&&yB)throw new Error(wB);if(Array.isArray(s)&&typeof s[0]=="string"&&t==null)for(var c=0;c<s.length;c++)c2(s[c])&&(r+=_c(u)+":"+l2(u,s[c])+";");else{var l=Ta(e,t,s);switch(u){case"animation":case"animationName":{r+=_c(u)+":"+l+";";break}default:r+=u+"{"+l+"}"}}}}return r}var D2=/label:\s*([^\s;{]+)\s*(;|$)/g,Fr;function d2(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,o="";Fr=void 0;var u=e[0];if(u==null||u.raw===void 0)r=!1,o+=Ta(n,t,u);else{var s=u;o+=s[0]}for(var i=1;i<e.length;i++)if(o+=Ta(n,t,e[i]),r){var c=u;o+=c[i]}D2.lastIndex=0;for(var l="",D;(D=D2.exec(o))!==null;)l+="-"+D[1];var d=bB(o)+l;return{name:d,styles:o,next:Fr}}var IB=function(t){return t()},kB=I.useInsertionEffect?I.useInsertionEffect:!1,TB=kB||IB,LB=!1,A2=I.createContext(typeof HTMLElement<"u"?dB({key:"css"}):null);A2.Provider;var OB=function(t){return p.forwardRef(function(n,r){var o=p.useContext(A2);return t(n,o,r)})},MB=I.createContext({}),jc={}.hasOwnProperty,Nc="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",_B=function(t,n){var r={};for(var o in n)jc.call(n,o)&&(r[o]=n[o]);return r[Nc]=t,r},jB=function(t){var n=t.cache,r=t.serialized,o=t.isStringTag;return f2(n,r,o),TB(function(){return EB(n,r,o)}),null},NB=OB(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var o=e[Nc],u=[r],s="";typeof e.className=="string"?s=mB(t.registered,u,e.className):e.className!=null&&(s=e.className+" ");var i=d2(u,void 0,I.useContext(MB));s+=t.key+"-"+i.name;var c={};for(var l in e)jc.call(e,l)&&l!=="css"&&l!==Nc&&!LB&&(c[l]=e[l]);return c.className=s,n&&(c.ref=n),I.createElement(I.Fragment,null,I.createElement(jB,{cache:t,serialized:i,isStringTag:typeof o=="string"}),I.createElement(o,c))}),PB=NB,ke=function(t,n){var r=arguments;if(n==null||!jc.call(n,"css"))return I.createElement.apply(void 0,r);var o=r.length,u=new Array(o);u[0]=PB,u[1]=_B(t,n);for(var s=2;s<o;s++)u[s]=r[s];return I.createElement.apply(null,u)};function Pc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d2(t)}var QB=function(){var t=Pc.apply(void 0,arguments),n="animation-"+t.name;return{name:n,styles:"@keyframes "+n+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function RB(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const HB=Math.min,WB=Math.max,bf=Math.round,xf=Math.floor,yf=e=>({x:e,y:e});function GB(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Bf(){return typeof window<"u"}function p2(e){return C2(e)?(e.nodeName||"").toLowerCase():"#document"}function Or(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function g2(e){var t;return(t=(C2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function C2(e){return Bf()?e instanceof Node||e instanceof Or(e).Node:!1}function VB(e){return Bf()?e instanceof Element||e instanceof Or(e).Element:!1}function Qc(e){return Bf()?e instanceof HTMLElement||e instanceof Or(e).HTMLElement:!1}function h2(e){return!Bf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Or(e).ShadowRoot}function F2(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Rc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function zB(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function XB(e){return["html","body","#document"].includes(p2(e))}function Rc(e){return Or(e).getComputedStyle(e)}function ZB(e){if(p2(e)==="html")return e;const t=e.assignedSlot||e.parentNode||h2(e)&&e.host||g2(e);return h2(t)?t.host:t}function m2(e){const t=ZB(e);return XB(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qc(t)&&F2(t)?t:m2(t)}function vf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=m2(e),u=o===((r=e.ownerDocument)==null?void 0:r.body),s=Or(o);if(u){const i=Hc(s);return t.concat(s,s.visualViewport||[],F2(o)?o:[],i&&n?vf(i):[])}return t.concat(o,vf(o,[],n))}function Hc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function JB(e){const t=Rc(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Qc(e),u=o?e.offsetWidth:n,s=o?e.offsetHeight:r,i=bf(n)!==u||bf(r)!==s;return i&&(n=u,r=s),{width:n,height:r,$:i}}function Wc(e){return VB(e)?e:e.contextElement}function E2(e){const t=Wc(e);if(!Qc(t))return yf(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:u}=JB(t);let s=(u?bf(n.width):n.width)/r,i=(u?bf(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}const YB=yf(0);function qB(e){const t=Or(e);return!zB()||!t.visualViewport?YB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function UB(e,t,n){return!1}function b2(e,t,n,r){t===void 0&&(t=!1);const o=e.getBoundingClientRect(),u=Wc(e);let s=yf(1);t&&(s=E2(e));const i=UB()?qB(u):yf(0);let c=(o.left+i.x)/s.x,l=(o.top+i.y)/s.y,D=o.width/s.x,d=o.height/s.y;if(u){const m=Or(u),b=r;let C=m,g=Hc(C);for(;g&&r&&b!==C;){const A=E2(g),h=g.getBoundingClientRect(),E=Rc(g),F=h.left+(g.clientLeft+parseFloat(E.paddingLeft))*A.x,x=h.top+(g.clientTop+parseFloat(E.paddingTop))*A.y;c*=A.x,l*=A.y,D*=A.x,d*=A.y,c+=F,l+=x,C=Or(g),g=Hc(C)}}return GB({width:D,height:d,x:c,y:l})}function KB(e,t){let n=null,r;const o=g2(e);function u(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function s(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),u();const{left:l,top:D,width:d,height:m}=e.getBoundingClientRect();if(i||t(),!d||!m)return;const b=xf(D),C=xf(o.clientWidth-(l+d)),g=xf(o.clientHeight-(D+m)),A=xf(l),E={rootMargin:-b+"px "+-C+"px "+-g+"px "+-A+"px",threshold:WB(0,HB(1,c))||1};let F=!0;function x(y){const S=y[0].intersectionRatio;if(S!==c){if(!F)return s();S?s(!1,S):r=setTimeout(()=>{s(!1,1e-7)},1e3)}F=!1}try{n=new IntersectionObserver(x,{...E,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,E)}n.observe(e)}return s(!0),u}function $B(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:u=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Wc(e),D=o||u?[...l?vf(l):[],...vf(t)]:[];D.forEach(h=>{o&&h.addEventListener("scroll",n,{passive:!0}),u&&h.addEventListener("resize",n)});const d=l&&i?KB(l,n):null;let m=-1,b=null;s&&(b=new ResizeObserver(h=>{let[E]=h;E&&E.target===l&&b&&(b.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var F;(F=b)==null||F.observe(t)})),n()}),l&&!c&&b.observe(l),b.observe(t));let C,g=c?b2(e):null;c&&A();function A(){const h=b2(e);g&&(h.x!==g.x||h.y!==g.y||h.width!==g.width||h.height!==g.height)&&n(),g=h,C=requestAnimationFrame(A)}return n(),()=>{var h;D.forEach(E=>{o&&E.removeEventListener("scroll",n),u&&E.removeEventListener("resize",n)}),d==null||d(),(h=b)==null||h.disconnect(),b=null,c&&cancelAnimationFrame(C)}}var Gc=p.useLayoutEffect,ev=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],wf=function(){};function tv(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function nv(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var u=[].concat(r);if(t&&e)for(var s in t)t.hasOwnProperty(s)&&t[s]&&u.push("".concat(tv(e,s)));return u.filter(function(i){return i}).map(function(i){return String(i).trim()}).join(" ")}var Sf=function(t){return Dv(t)?t.filter(Boolean):Io(t)==="object"&&t!==null?[t]:[]},x2=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=er(t,ev);return we({},n)},St=function(t,n,r){var o=t.cx,u=t.getStyles,s=t.getClassNames,i=t.className;return{css:u(n,t),className:o(r??{},s(n,t),i)}};function rv(e,t,n){if(n){var r=n(e,t);if(typeof r=="string")return r}return e}function If(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function ov(e){return If(e)?window.innerHeight:e.clientHeight}function y2(e){return If(e)?window.pageYOffset:e.scrollTop}function kf(e,t){if(If(e)){window.scrollTo(0,t);return}e.scrollTop=t}function uv(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.documentElement}function av(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Tf(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:wf,o=y2(e),u=t-o,s=10,i=0;function c(){i+=s;var l=av(i,o,u,n);kf(e,l),i<n?window.requestAnimationFrame(c):r(e)}c()}function B2(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?kf(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&kf(e,Math.max(t.offsetTop-o,0))}function sv(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function v2(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function fv(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var w2=!1,iv={get passive(){return w2=!0}},Lf=typeof window<"u"?window:{};Lf.addEventListener&&Lf.removeEventListener&&(Lf.addEventListener("p",wf,iv),Lf.removeEventListener("p",wf,!1));var cv=w2;function lv(e){return e!=null}function Dv(e){return Array.isArray(e)}function La(e,t,n){return e?t:n}function hY(e){return e}function FY(e){return e}var dv=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var u=Object.entries(t).filter(function(s){var i=Wt(s,1),c=i[0];return!r.includes(c)});return u.reduce(function(s,i){var c=Wt(i,2),l=c[0],D=c[1];return s[l]=D,s},{})},Av=["children","innerProps"],pv=["children","innerProps"];function gv(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,u=e.shouldScroll,s=e.isFixedPosition,i=e.controlHeight,c=uv(n),l={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return l;var D=c.getBoundingClientRect(),d=D.height,m=n.getBoundingClientRect(),b=m.bottom,C=m.height,g=m.top,A=n.offsetParent.getBoundingClientRect(),h=A.top,E=s?window.innerHeight:ov(c),F=y2(c),x=parseInt(getComputedStyle(n).marginBottom,10),y=parseInt(getComputedStyle(n).marginTop,10),S=h-y,v=E-g,w=S+F,k=d-F-g,O=b-E+F+x,j=F+g-y,T=160;switch(o){case"auto":case"bottom":if(v>=C)return{placement:"bottom",maxHeight:t};if(k>=C&&!s)return u&&Tf(c,O,T),{placement:"bottom",maxHeight:t};if(!s&&k>=r||s&&v>=r){u&&Tf(c,O,T);var L=s?v-x:k-x;return{placement:"bottom",maxHeight:L}}if(o==="auto"||s){var M=t,_=s?S:w;return _>=r&&(M=Math.min(_-x-i,t)),{placement:"top",maxHeight:M}}if(o==="bottom")return u&&kf(c,O),{placement:"bottom",maxHeight:t};break;case"top":if(S>=C)return{placement:"top",maxHeight:t};if(w>=C&&!s)return u&&Tf(c,j,T),{placement:"top",maxHeight:t};if(!s&&w>=r||s&&S>=r){var P=t;return(!s&&w>=r||s&&S>=r)&&(P=s?S-y:w-y),u&&Tf(c,j,T),{placement:"top",maxHeight:P}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return l}function Cv(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var S2=function(t){return t==="auto"?"bottom":t},hv=function(t,n){var r,o=t.placement,u=t.theme,s=u.borderRadius,i=u.spacing,c=u.colors;return we((r={label:"menu"},hu(r,Cv(o),"100%"),hu(r,"position","absolute"),hu(r,"width","100%"),hu(r,"zIndex",1),r),n?{}:{backgroundColor:c.neutral0,borderRadius:s,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:i.menuGutter,marginTop:i.menuGutter})},I2=p.createContext(null),Fv=function(t){var n=t.children,r=t.minMenuHeight,o=t.maxMenuHeight,u=t.menuPlacement,s=t.menuPosition,i=t.menuShouldScrollIntoView,c=t.theme,l=p.useContext(I2)||{},D=l.setPortalPlacement,d=p.useRef(null),m=p.useState(o),b=Wt(m,2),C=b[0],g=b[1],A=p.useState(null),h=Wt(A,2),E=h[0],F=h[1],x=c.spacing.controlHeight;return Gc(function(){var y=d.current;if(y){var S=s==="fixed",v=i&&!S,w=gv({maxHeight:o,menuEl:y,minHeight:r,placement:u,shouldScroll:v,isFixedPosition:S,controlHeight:x});g(w.maxHeight),F(w.placement),D==null||D(w.placement)}},[o,u,s,i,r,D,x]),n({ref:d,placerProps:we(we({},t),{},{placement:E||S2(u),maxHeight:C})})},mv=function(t){var n=t.children,r=t.innerRef,o=t.innerProps;return ke("div",Te({},St(t,"menu",{menu:!0}),{ref:r},o),n)},Ev=mv,bv=function(t,n){var r=t.maxHeight,o=t.theme.spacing.baseUnit;return we({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:o,paddingTop:o})},xv=function(t){var n=t.children,r=t.innerProps,o=t.innerRef,u=t.isMulti;return ke("div",Te({},St(t,"menuList",{"menu-list":!0,"menu-list--is-multi":u}),{ref:o},r),n)},k2=function(t,n){var r=t.theme,o=r.spacing.baseUnit,u=r.colors;return we({textAlign:"center"},n?{}:{color:u.neutral40,padding:"".concat(o*2,"px ").concat(o*3,"px")})},yv=k2,Bv=k2,vv=function(t){var n=t.children,r=n===void 0?"No options":n,o=t.innerProps,u=er(t,Av);return ke("div",Te({},St(we(we({},u),{},{children:r,innerProps:o}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),o),r)},wv=function(t){var n=t.children,r=n===void 0?"Loading...":n,o=t.innerProps,u=er(t,pv);return ke("div",Te({},St(we(we({},u),{},{children:r,innerProps:o}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),o),r)},Sv=function(t){var n=t.rect,r=t.offset,o=t.position;return{left:n.left,position:o,top:r,width:n.width,zIndex:1}},Iv=function(t){var n=t.appendTo,r=t.children,o=t.controlElement,u=t.innerProps,s=t.menuPlacement,i=t.menuPosition,c=p.useRef(null),l=p.useRef(null),D=p.useState(S2(s)),d=Wt(D,2),m=d[0],b=d[1],C=p.useMemo(function(){return{setPortalPlacement:b}},[]),g=p.useState(null),A=Wt(g,2),h=A[0],E=A[1],F=p.useCallback(function(){if(o){var v=sv(o),w=i==="fixed"?0:window.pageYOffset,k=v[m]+w;(k!==(h==null?void 0:h.offset)||v.left!==(h==null?void 0:h.rect.left)||v.width!==(h==null?void 0:h.rect.width))&&E({offset:k,rect:v})}},[o,i,m,h==null?void 0:h.offset,h==null?void 0:h.rect.left,h==null?void 0:h.rect.width]);Gc(function(){F()},[F]);var x=p.useCallback(function(){typeof l.current=="function"&&(l.current(),l.current=null),o&&c.current&&(l.current=$B(o,c.current,F,{elementResize:"ResizeObserver"in window}))},[o,F]);Gc(function(){x()},[x]);var y=p.useCallback(function(v){c.current=v,x()},[x]);if(!n&&i!=="fixed"||!h)return null;var S=ke("div",Te({ref:y},St(we(we({},t),{},{offset:h.offset,position:i,rect:h.rect}),"menuPortal",{"menu-portal":!0}),u),r);return ke(I2.Provider,{value:C},n?Nt.createPortal(S,n):S)},kv=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},Tv=function(t){var n=t.children,r=t.innerProps,o=t.isDisabled,u=t.isRtl;return ke("div",Te({},St(t,"container",{"--is-disabled":o,"--is-rtl":u}),r),n)},Lv=function(t,n){var r=t.theme.spacing,o=t.isMulti,u=t.hasValue,s=t.selectProps.controlShouldRenderValue;return we({alignItems:"center",display:o&&u&&s?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},Ov=function(t){var n=t.children,r=t.innerProps,o=t.isMulti,u=t.hasValue;return ke("div",Te({},St(t,"valueContainer",{"value-container":!0,"value-container--is-multi":o,"value-container--has-value":u}),r),n)},Mv=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},_v=function(t){var n=t.children,r=t.innerProps;return ke("div",Te({},St(t,"indicatorsContainer",{indicators:!0}),r),n)},T2,jv=["size"],Nv=["innerProps","isRtl","size"];function Pv(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Qv=process.env.NODE_ENV==="production"?{name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"}:{name:"tj5bde-Svg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICBDU1NPYmplY3RXaXRoTGFiZWwsXG4gIEdyb3VwQmFzZSxcbn0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgZ2V0U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9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CBjb25zdCBMb2FkaW5nSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KHtcbiAgaW5uZXJQcm9wcyxcbiAgaXNSdGwsXG4gIHNpemUgPSA0LFxuICAuLi5yZXN0UHJvcHNcbn06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPikgPT4ge1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKFxuICAgICAgICB7IC4uLnJlc3RQcm9wcywgaW5uZXJQcm9wcywgaXNSdGwsIHNpemUgfSxcbiAgICAgICAgJ2xvYWRpbmdJbmRpY2F0b3InLFxuICAgICAgICB7XG4gICAgICAgICAgaW5kaWNhdG9yOiB0cnVlLFxuICAgICAgICAgICdsb2FkaW5nLWluZGljYXRvcic6IHRydWUsXG4gICAgICAgIH1cbiAgICAgICl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MH0gb2Zmc2V0PXtpc1J0bH0gLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXsxNjB9IG9mZnNldCAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezMyMH0gb2Zmc2V0PXshaXNSdGx9IC8+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuIl19 */",toString:Pv},L2=function(t){var n=t.size,r=er(t,jv);return ke("svg",Te({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Qv},r))},Vc=function(t){return ke(L2,Te({size:20},t),ke("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},O2=function(t){return ke(L2,Te({size:20},t),ke("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},M2=function(t,n){var r=t.isFocused,o=t.theme,u=o.spacing.baseUnit,s=o.colors;return we({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?s.neutral60:s.neutral20,padding:u*2,":hover":{color:r?s.neutral80:s.neutral40}})},Rv=M2,Hv=function(t){var n=t.children,r=t.innerProps;return ke("div",Te({},St(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||ke(O2,null))},Wv=M2,Gv=function(t){var n=t.children,r=t.innerProps;return ke("div",Te({},St(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||ke(Vc,null))},Vv=function(t,n){var r=t.isDisabled,o=t.theme,u=o.spacing.baseUnit,s=o.colors;return we({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?s.neutral10:s.neutral20,marginBottom:u*2,marginTop:u*2})},zv=function(t){var n=t.innerProps;return ke("span",Te({},n,St(t,"indicatorSeparator",{"indicator-separator":!0})))},Xv=QB(T2||(T2=RB([`
|
|
1579
1579
|
0%, 80%, 100% { opacity: 0; }
|
|
1580
1580
|
40% { opacity: 1; }
|
|
1581
1581
|
`]))),Zv=function(t,n){var r=t.isFocused,o=t.size,u=t.theme,s=u.colors,i=u.spacing.baseUnit;return we({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:o,lineHeight:1,marginRight:o,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?s.neutral60:s.neutral20,padding:i*2})},zc=function(t){var n=t.delay,r=t.offset;return ke("span",{css:Pc({animation:"".concat(Xv," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},process.env.NODE_ENV==="production"?"":";label:LoadingDot;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1RSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICBDU1NPYmplY3RXaXRoTGFiZWwsXG4gIEdyb3VwQmFzZSxcbn0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgZ2V0U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgU3ZnID0gKHtcbiAgc2l6ZSxcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU6IG51bWJlciB9KSA9PiAoXG4gIDxzdmdcbiAgICBoZWlnaHQ9e3NpemV9X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5yZXN0UHJvcHNcbn06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPikgPT4ge1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKFxuICAgICAgICB7IC4uLnJlc3RQcm9wcywgaW5uZXJQcm9wcywgaXNSdGwsIHNpemUgfSxcbiAgICAgICAgJ2xvYWRpbmdJbmRpY2F0b3InLFxuICAgICAgICB7XG4gICAgICAgICAgaW5kaWNhdG9yOiB0cnVlLFxuICAgICAgICAgICdsb2FkaW5nLWluZGljYXRvcic6IHRydWUsXG4gICAgICAgIH1cbiAgICAgICl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MH0gb2Zmc2V0PXtpc1J0bH0gLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXsxNjB9IG9mZnNldCAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezMyMH0gb2Zmc2V0PXshaXNSdGx9IC8+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuIl19 */")})},Jv=function(t){var n=t.innerProps,r=t.isRtl,o=t.size,u=o===void 0?4:o,s=er(t,Nv);return ke("div",Te({},St(we(we({},s),{},{innerProps:n,isRtl:r,size:u}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),ke(zc,{delay:0,offset:r}),ke(zc,{delay:160,offset:!0}),ke(zc,{delay:320,offset:!r}))},Yv=function(t,n){var r=t.isDisabled,o=t.isFocused,u=t.theme,s=u.colors,i=u.borderRadius,c=u.spacing;return we({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?s.neutral5:s.neutral0,borderColor:r?s.neutral10:o?s.primary:s.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:o?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:o?s.primary:s.neutral30}})},qv=function(t){var n=t.children,r=t.isDisabled,o=t.isFocused,u=t.innerRef,s=t.innerProps,i=t.menuIsOpen;return ke("div",Te({ref:u},St(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":o,"control--menu-is-open":i}),s,{"aria-disabled":r||void 0}),n)},Uv=qv,Kv=["data"],$v=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},ew=function(t){var n=t.children,r=t.cx,o=t.getStyles,u=t.getClassNames,s=t.Heading,i=t.headingProps,c=t.innerProps,l=t.label,D=t.theme,d=t.selectProps;return ke("div",Te({},St(t,"group",{group:!0}),c),ke(s,Te({},i,{selectProps:d,theme:D,getStyles:o,getClassNames:u,cx:r}),l),ke("div",null,n))},tw=function(t,n){var r=t.theme,o=r.colors,u=r.spacing;return we({label:"group",cursor:"default",display:"block"},n?{}:{color:o.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:u.baseUnit*3,paddingRight:u.baseUnit*3,textTransform:"uppercase"})},nw=function(t){var n=x2(t);n.data;var r=er(n,Kv);return ke("div",Te({},St(t,"groupHeading",{"group-heading":!0}),r))},rw=ew,ow=["innerRef","isDisabled","isHidden","inputClassName"],uw=function(t,n){var r=t.isDisabled,o=t.value,u=t.theme,s=u.spacing,i=u.colors;return we(we({visibility:r?"hidden":"visible",transform:o?"translateZ(0)":""},aw),n?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:i.neutral80})},_2={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},aw={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":we({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},_2)},sw=function(t){return we({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},_2)},fw=function(t){var n=t.cx,r=t.value,o=x2(t),u=o.innerRef,s=o.isDisabled,i=o.isHidden,c=o.inputClassName,l=er(o,ow);return ke("div",Te({},St(t,"input",{"input-container":!0}),{"data-value":r||""}),ke("input",Te({className:n({input:!0},c),ref:u,style:sw(i),disabled:s},l)))},iw=fw,cw=function(t,n){var r=t.theme,o=r.spacing,u=r.borderRadius,s=r.colors;return we({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:s.neutral10,borderRadius:u/2,margin:o.baseUnit/2})},lw=function(t,n){var r=t.theme,o=r.borderRadius,u=r.colors,s=t.cropWithEllipsis;return we({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:o/2,color:u.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Dw=function(t,n){var r=t.theme,o=r.spacing,u=r.borderRadius,s=r.colors,i=t.isFocused;return we({alignItems:"center",display:"flex"},n?{}:{borderRadius:u/2,backgroundColor:i?s.dangerLight:void 0,paddingLeft:o.baseUnit,paddingRight:o.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},j2=function(t){var n=t.children,r=t.innerProps;return ke("div",r,n)},dw=j2,Aw=j2;function pw(e){var t=e.children,n=e.innerProps;return ke("div",Te({role:"button"},n),t||ke(Vc,{size:14}))}var gw=function(t){var n=t.children,r=t.components,o=t.data,u=t.innerProps,s=t.isDisabled,i=t.removeProps,c=t.selectProps,l=r.Container,D=r.Label,d=r.Remove;return ke(l,{data:o,innerProps:we(we({},St(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),u),selectProps:c},ke(D,{data:o,innerProps:we({},St(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),ke(d,{data:o,innerProps:we(we({},St(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},i),selectProps:c}))},Cw=gw,hw=function(t,n){var r=t.isDisabled,o=t.isFocused,u=t.isSelected,s=t.theme,i=s.spacing,c=s.colors;return we({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:u?c.primary:o?c.primary25:"transparent",color:r?c.neutral20:u?c.neutral0:"inherit",padding:"".concat(i.baseUnit*2,"px ").concat(i.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:u?c.primary:c.primary50}})},Fw=function(t){var n=t.children,r=t.isDisabled,o=t.isFocused,u=t.isSelected,s=t.innerRef,i=t.innerProps;return ke("div",Te({},St(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":o,"option--is-selected":u}),{ref:s,"aria-disabled":r},i),n)},mw=Fw,Ew=function(t,n){var r=t.theme,o=r.spacing,u=r.colors;return we({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:u.neutral50,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},bw=function(t){var n=t.children,r=t.innerProps;return ke("div",Te({},St(t,"placeholder",{placeholder:!0}),r),n)},xw=bw,yw=function(t,n){var r=t.isDisabled,o=t.theme,u=o.spacing,s=o.colors;return we({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?s.neutral40:s.neutral80,marginLeft:u.baseUnit/2,marginRight:u.baseUnit/2})},Bw=function(t){var n=t.children,r=t.isDisabled,o=t.innerProps;return ke("div",Te({},St(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),o),n)},vw=Bw,On={ClearIndicator:Gv,Control:Uv,DropdownIndicator:Hv,DownChevron:O2,CrossIcon:Vc,Group:rw,GroupHeading:nw,IndicatorsContainer:_v,IndicatorSeparator:zv,Input:iw,LoadingIndicator:Jv,Menu:Ev,MenuList:xv,MenuPortal:Iv,LoadingMessage:wv,NoOptionsMessage:vv,MultiValue:Cw,MultiValueContainer:dw,MultiValueLabel:Aw,MultiValueRemove:pw,Option:mw,Placeholder:xw,SelectContainer:Tv,SingleValue:vw,ValueContainer:Ov},ww=function(t){return we(we({},On),t.components)},N2=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Sw(e,t){return!!(e===t||N2(e)&&N2(t))}function Iw(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Sw(e[n],t[n]))return!1;return!0}function kw(e,t){t===void 0&&(t=Iw);var n=null;function r(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;var s=e.apply(this,o);return n={lastResult:s,lastArgs:o,lastThis:this},s}return r.clear=function(){n=null},r}function Tw(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}for(var Lw=process.env.NODE_ENV==="production"?{name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"}:{name:"1f43avz-a11yText-A11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;label:A11yText;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkExMXlUZXh0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNSSIsImZpbGUiOiJBMTF5VGV4dC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKiogQGpzeCBqc3ggKi9cbmltcG9ydCB7IGpzeCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLy8gQXNzaXN0aXZlIHRleHQgdG8gZGVzY3JpYmUgdmlzdWFsIGVsZW1lbnRzLiBIaWRkZW4gZm9yIHNpZ2h0ZWQgdXNlcnMuXG5jb25zdCBBMTF5VGV4dCA9IChwcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ10pID0+IChcbiAgPHNwYW5cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAnYTExeVRleHQnLFxuICAgICAgekluZGV4OiA5OTk5LFxuICAgICAgYm9yZGVyOiAwLFxuICAgICAgY2xpcDogJ3JlY3QoMXB4LCAxcHgsIDFweCwgMXB4KScsXG4gICAgICBoZWlnaHQ6IDEsXG4gICAgICB3aWR0aDogMSxcbiAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nLFxuICAgICAgcGFkZGluZzogMCxcbiAgICAgIHdoaXRlU3BhY2U6ICdub3dyYXAnLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IGRlZmF1bHQgQTExeVRleHQ7XG4iXX0= */",toString:Tw},Ow=function(t){return ke("span",Te({css:Lw},t))},P2=Ow,Mw={guidance:function(t){var n=t.isSearchable,r=t.isMulti,o=t.tabSelectsValue,u=t.context,s=t.isInitialFocus;switch(u){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(o?", press Tab to select the option and exit the menu":"",".");case"input":return s?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,o=r===void 0?"":r,u=t.labels,s=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(o,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(u.length>1?"s":""," ").concat(u.join(","),", selected.");case"select-option":return s?"option ".concat(o," is disabled. Select another option."):"option ".concat(o,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,o=t.options,u=t.label,s=u===void 0?"":u,i=t.selectValue,c=t.isDisabled,l=t.isSelected,D=t.isAppleDevice,d=function(g,A){return g&&g.length?"".concat(g.indexOf(A)+1," of ").concat(g.length):""};if(n==="value"&&i)return"value ".concat(s," focused, ").concat(d(i,r),".");if(n==="menu"&&D){var m=c?" disabled":"",b="".concat(l?" selected":"").concat(m);return"".concat(s).concat(b,", ").concat(d(o,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},_w=function(t){var n=t.ariaSelection,r=t.focusedOption,o=t.focusedValue,u=t.focusableOptions,s=t.isFocused,i=t.selectValue,c=t.selectProps,l=t.id,D=t.isAppleDevice,d=c.ariaLiveMessages,m=c.getOptionLabel,b=c.inputValue,C=c.isMulti,g=c.isOptionDisabled,A=c.isSearchable,h=c.menuIsOpen,E=c.options,F=c.screenReaderStatus,x=c.tabSelectsValue,y=c.isLoading,S=c["aria-label"],v=c["aria-live"],w=p.useMemo(function(){return we(we({},Mw),d||{})},[d]),k=p.useMemo(function(){var _="";if(n&&w.onChange){var P=n.option,G=n.options,z=n.removedValue,V=n.removedValues,H=n.value,J=function(Fe){return Array.isArray(Fe)?null:Fe},X=z||P||J(H),te=X?m(X):"",ue=G||V||void 0,R=ue?ue.map(m):[],ee=we({isDisabled:X&&g(X,i),label:te,labels:R},n);_=w.onChange(ee)}return _},[n,w,g,i,m]),O=p.useMemo(function(){var _="",P=r||o,G=!!(r&&i&&i.includes(r));if(P&&w.onFocus){var z={focused:P,label:m(P),isDisabled:g(P,i),isSelected:G,options:u,context:P===r?"menu":"value",selectValue:i,isAppleDevice:D};_=w.onFocus(z)}return _},[r,o,m,g,w,u,i,D]),j=p.useMemo(function(){var _="";if(h&&E.length&&!y&&w.onFilter){var P=F({count:u.length});_=w.onFilter({inputValue:b,resultsMessage:P})}return _},[u,b,h,w,E,F,y]),T=(n==null?void 0:n.action)==="initial-input-focus",L=p.useMemo(function(){var _="";if(w.guidance){var P=o?"value":h?"menu":"input";_=w.guidance({"aria-label":S,context:P,isDisabled:r&&g(r,i),isMulti:C,isSearchable:A,tabSelectsValue:x,isInitialFocus:T})}return _},[S,r,o,C,g,A,h,w,i,x,T]),M=ke(p.Fragment,null,ke("span",{id:"aria-selection"},k),ke("span",{id:"aria-focused"},O),ke("span",{id:"aria-results"},j),ke("span",{id:"aria-guidance"},L));return ke(p.Fragment,null,ke(P2,{id:l},T&&M),ke(P2,{"aria-live":v,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!T&&M))},jw=_w,Xc=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Nw=new RegExp("["+Xc.map(function(e){return e.letters}).join("")+"]","g"),Q2={},Zc=0;Zc<Xc.length;Zc++)for(var Jc=Xc[Zc],Yc=0;Yc<Jc.letters.length;Yc++)Q2[Jc.letters[Yc]]=Jc.base;var R2=function(t){return t.replace(Nw,function(n){return Q2[n]})},Pw=kw(R2),H2=function(t){return t.replace(/^\s+|\s+$/g,"")},Qw=function(t){return"".concat(t.label," ").concat(t.value)},Rw=function(t){return function(n,r){if(n.data.__isNew__)return!0;var o=we({ignoreCase:!0,ignoreAccents:!0,stringify:Qw,trim:!0,matchFrom:"any"},t),u=o.ignoreCase,s=o.ignoreAccents,i=o.stringify,c=o.trim,l=o.matchFrom,D=c?H2(r):r,d=c?H2(i(n)):i(n);return u&&(D=D.toLowerCase(),d=d.toLowerCase()),s&&(D=Pw(D),d=R2(d)),l==="start"?d.substr(0,D.length)===D:d.indexOf(D)>-1}},Hw=["innerRef"];function Ww(e){var t=e.innerRef,n=er(e,Hw),r=dv(n,"onExited","in","enter","exit","appear");return ke("input",Te({ref:t},r,{css:Pc({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},process.env.NODE_ENV==="production"?"":";label:DummyInput;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkR1bW15SW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCTSIsImZpbGUiOiJEdW1teUlucHV0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1x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3b24ndCBhbGxvdyBmb2N1c1xuICAgICAgICB3aWR0aDogMSxcblxuICAgICAgICAvLyByZW1vdmUgY3Vyc29yIG9uIGRlc2t0b3BcbiAgICAgICAgY29sb3I6ICd0cmFuc3BhcmVudCcsXG5cbiAgICAgICAgLy8gcmVtb3ZlIGN1cnNvciBvbiBtb2JpbGUgd2hpbHN0IG1haW50YWluaW5nIFwic2Nyb2xsIGludG8gdmlld1wiIGJlaGF2aW91clxuICAgICAgICBsZWZ0OiAtMTAwLFxuICAgICAgICBvcGFjaXR5OiAwLFxuICAgICAgICBwb3NpdGlvbjogJ3JlbGF0aXZlJyxcbiAgICAgICAgdHJhbnNmb3JtOiAnc2NhbGUoLjAxKScsXG4gICAgICB9fVxuICAgIC8+XG4gICk7XG59XG4iXX0= */")}))}var Gw=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function Vw(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,o=e.onTopArrive,u=e.onTopLeave,s=p.useRef(!1),i=p.useRef(!1),c=p.useRef(0),l=p.useRef(null),D=p.useCallback(function(A,h){if(l.current!==null){var E=l.current,F=E.scrollTop,x=E.scrollHeight,y=E.clientHeight,S=l.current,v=h>0,w=x-y-F,k=!1;w>h&&s.current&&(r&&r(A),s.current=!1),v&&i.current&&(u&&u(A),i.current=!1),v&&h>w?(n&&!s.current&&n(A),S.scrollTop=x,k=!0,s.current=!0):!v&&-h>F&&(o&&!i.current&&o(A),S.scrollTop=0,k=!0,i.current=!0),k&&Gw(A)}},[n,r,o,u]),d=p.useCallback(function(A){D(A,A.deltaY)},[D]),m=p.useCallback(function(A){c.current=A.changedTouches[0].clientY},[]),b=p.useCallback(function(A){var h=c.current-A.changedTouches[0].clientY;D(A,h)},[D]),C=p.useCallback(function(A){if(A){var h=cv?{passive:!1}:!1;A.addEventListener("wheel",d,h),A.addEventListener("touchstart",m,h),A.addEventListener("touchmove",b,h)}},[b,m,d]),g=p.useCallback(function(A){A&&(A.removeEventListener("wheel",d,!1),A.removeEventListener("touchstart",m,!1),A.removeEventListener("touchmove",b,!1))},[b,m,d]);return p.useEffect(function(){if(t){var A=l.current;return C(A),function(){g(A)}}},[t,C,g]),function(A){l.current=A}}var W2=["boxSizing","height","overflow","paddingRight","position"],G2={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function V2(e){e.preventDefault()}function z2(e){e.stopPropagation()}function X2(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Z2(){return"ontouchstart"in window||navigator.maxTouchPoints}var J2=!!(typeof window<"u"&&window.document&&window.document.createElement),Oa=0,xu={capture:!1,passive:!1};function zw(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,o=p.useRef({}),u=p.useRef(null),s=p.useCallback(function(c){if(J2){var l=document.body,D=l&&l.style;if(r&&W2.forEach(function(C){var g=D&&D[C];o.current[C]=g}),r&&Oa<1){var d=parseInt(o.current.paddingRight,10)||0,m=document.body?document.body.clientWidth:0,b=window.innerWidth-m+d||0;Object.keys(G2).forEach(function(C){var g=G2[C];D&&(D[C]=g)}),D&&(D.paddingRight="".concat(b,"px"))}l&&Z2()&&(l.addEventListener("touchmove",V2,xu),c&&(c.addEventListener("touchstart",X2,xu),c.addEventListener("touchmove",z2,xu))),Oa+=1}},[r]),i=p.useCallback(function(c){if(J2){var l=document.body,D=l&&l.style;Oa=Math.max(Oa-1,0),r&&Oa<1&&W2.forEach(function(d){var m=o.current[d];D&&(D[d]=m)}),l&&Z2()&&(l.removeEventListener("touchmove",V2,xu),c&&(c.removeEventListener("touchstart",X2,xu),c.removeEventListener("touchmove",z2,xu)))}},[r]);return p.useEffect(function(){if(t){var c=u.current;return s(c),function(){i(c)}}},[t,s,i]),function(c){u.current=c}}function Xw(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Zw=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Jw=process.env.NODE_ENV==="production"?{name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"}:{name:"bp8cua-ScrollManager",styles:"position:fixed;left:0;bottom:0;right:0;top:0;label:ScrollManager;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNjcm9sbE1hbmFnZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW9EVSIsImZpbGUiOiJTY3JvbGxNYW5hZ2VyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgRnJhZ21lbnQsIFJlYWN0RWxlbWVudCwgUmVmQ2FsbGJhY2ssIE1vdXNlRXZlbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgdXNlU2Nyb2xsQ2FwdHVyZSBmcm9tICcuL3VzZVNjcm9sbENhcHR1cmUnO1xuaW1wb3J0IHVzZVNjcm9sbExvY2sgZnJvbSAnLi91c2VTY3JvbGxMb2NrJztcblxuaW50ZXJmYWNlIFByb3BzIHtcbiAgcmVhZG9ubHkgY2hpbGRyZW46IChyZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PikgPT4gUmVhY3RFbGVtZW50O1xuICByZWFkb25seSBsb2NrRW5hYmxlZDogYm9vbGVhbjtcbiAgcmVhZG9ubHkgY2FwdHVyZUVuYWJsZWQ6IGJvb2xlYW47XG4gIHJlYWRvbmx5IG9uQm90dG9tQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Cb3R0b21MZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZ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xlZCB9KTtcblxuICBjb25zdCB0YXJnZXRSZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PiA9IChlbGVtZW50KSA9PiB7XG4gICAgc2V0U2Nyb2xsQ2FwdHVyZVRhcmdldChlbGVtZW50KTtcbiAgICBzZXRTY3JvbGxMb2NrVGFyZ2V0KGVsZW1lbnQpO1xuICB9O1xuXG4gIHJldHVybiAoXG4gICAgPEZyYWdtZW50PlxuICAgICAge2xvY2tFbmFibGVkICYmIChcbiAgICAgICAgPGRpdlxuICAgICAgICAgIG9uQ2xpY2s9e2JsdXJTZWxlY3RJbnB1dH1cbiAgICAgICAgICBjc3M9e3sgcG9zaXRpb246ICdmaXhlZCcsIGxlZnQ6IDAsIGJvdHRvbTogMCwgcmlnaHQ6IDAsIHRvcDogMCB9fVxuICAgICAgICAvPlxuICAgICAgKX1cbiAgICAgIHtjaGlsZHJlbih0YXJnZXRSZWYpfVxuICAgIDwvRnJhZ21lbnQ+XG4gICk7XG59XG4iXX0= */",toString:Xw};function Yw(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,o=r===void 0?!0:r,u=e.onBottomArrive,s=e.onBottomLeave,i=e.onTopArrive,c=e.onTopLeave,l=Vw({isEnabled:o,onBottomArrive:u,onBottomLeave:s,onTopArrive:i,onTopLeave:c}),D=zw({isEnabled:n}),d=function(b){l(b),D(b)};return ke(p.Fragment,null,n&&ke("div",{onClick:Zw,css:Jw}),t(d))}function qw(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Uw=process.env.NODE_ENV==="production"?{name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"}:{name:"5kkxb2-requiredInput-RequiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%;label:RequiredInput;",map:"/*# sourceMappingURL=data:application/json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SA9PiB7fX1cbiAgLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IFJlcXVpcmVkSW5wdXQ7XG4iXX0= */",toString:qw},Kw=function(t){var n=t.name,r=t.onFocus;return ke("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:Uw,value:"",onChange:function(){}})},$w=Kw;function qc(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function eS(){return qc(/^iPhone/i)}function Y2(){return qc(/^Mac/i)}function tS(){return qc(/^iPad/i)||Y2()&&navigator.maxTouchPoints>1}function nS(){return eS()||tS()}function rS(){return Y2()||nS()}var oS=function(t){return t.label},q2=function(t){return t.label},U2=function(t){return t.value},uS=function(t){return!!t.isDisabled},aS={clearIndicator:Wv,container:kv,control:Yv,dropdownIndicator:Rv,group:$v,groupHeading:tw,indicatorsContainer:Mv,indicatorSeparator:Vv,input:uw,loadingIndicator:Zv,loadingMessage:Bv,menu:hv,menuList:bv,menuPortal:Sv,multiValue:cw,multiValueLabel:lw,multiValueRemove:Dw,noOptionsMessage:yv,option:hw,placeholder:Ew,singleValue:yw,valueContainer:Lv},sS={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},fS=4,K2=4,iS=38,cS=K2*2,lS={baseUnit:K2,controlHeight:iS,menuGutter:cS},Uc={borderRadius:fS,colors:sS,spacing:lS},DS={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:v2(),captureMenuScroll:!v2(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Rw(),formatGroupLabel:oS,getOptionLabel:q2,getOptionValue:U2,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:uS,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!fv(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function $2(e,t,n,r){var o=o8(e,t,n),u=u8(e,t,n),s=r8(e,t),i=Mf(e,t);return{type:"option",data:t,isDisabled:o,isSelected:u,label:s,value:i,index:r}}function Of(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(s,i){return $2(e,s,t,i)}).filter(function(s){return n8(e,s)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var u=$2(e,n,t,r);return n8(e,u)?u:void 0}).filter(lv)}function e8(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Fu(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function t8(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Fu(r.options.map(function(o){return{data:o.data,id:"".concat(t,"-").concat(r.index,"-").concat(o.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function dS(e,t){return e8(Of(e,t))}function n8(e,t){var n=e.inputValue,r=n===void 0?"":n,o=t.data,u=t.isSelected,s=t.label,i=t.value;return(!s8(e)||!u)&&a8(e,{label:s,value:i,data:o},r)}function AS(e,t){var n=e.focusedValue,r=e.selectValue,o=r.indexOf(n);if(o>-1){var u=t.indexOf(n);if(u>-1)return n;if(o<t.length)return t[o]}return null}function pS(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var Kc=function(t,n){var r,o=(r=t.find(function(u){return u.data===n}))===null||r===void 0?void 0:r.id;return o||null},r8=function(t,n){return t.getOptionLabel(n)},Mf=function(t,n){return t.getOptionValue(n)};function o8(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function u8(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Mf(e,t);return n.some(function(o){return Mf(e,o)===r})}function a8(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var s8=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},gS=1,_f=function(e){ky(n,e);var t=Oy(n);function n(r){var o;if(Sy(this,n),o=t.call(this,r),o.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},o.blockOptionHover=!1,o.isComposing=!1,o.commonProps=void 0,o.initialTouchX=0,o.initialTouchY=0,o.openAfterFocus=!1,o.scrollToFocusedOptionOnUpdate=!1,o.userIsDragging=void 0,o.isAppleDevice=rS(),o.controlRef=null,o.getControlRef=function(c){o.controlRef=c},o.focusedOptionRef=null,o.getFocusedOptionRef=function(c){o.focusedOptionRef=c},o.menuListRef=null,o.getMenuListRef=function(c){o.menuListRef=c},o.inputRef=null,o.getInputRef=function(c){o.inputRef=c},o.focus=o.focusInput,o.blur=o.blurInput,o.onChange=function(c,l){var D=o.props,d=D.onChange,m=D.name;l.name=m,o.ariaOnChange(c,l),d(c,l)},o.setValue=function(c,l,D){var d=o.props,m=d.closeMenuOnSelect,b=d.isMulti,C=d.inputValue;o.onInputChange("",{action:"set-value",prevInputValue:C}),m&&(o.setState({inputIsHiddenAfterUpdate:!b}),o.onMenuClose()),o.setState({clearFocusValueOnUpdate:!0}),o.onChange(c,{action:l,option:D})},o.selectOption=function(c){var l=o.props,D=l.blurInputOnSelect,d=l.isMulti,m=l.name,b=o.state.selectValue,C=d&&o.isOptionSelected(c,b),g=o.isOptionDisabled(c,b);if(C){var A=o.getOptionValue(c);o.setValue(b.filter(function(h){return o.getOptionValue(h)!==A}),"deselect-option",c)}else if(!g)d?o.setValue([].concat(Fu(b),[c]),"select-option",c):o.setValue(c,"select-option");else{o.ariaOnChange(c,{action:"select-option",option:c,name:m});return}D&&o.blurInput()},o.removeValue=function(c){var l=o.props.isMulti,D=o.state.selectValue,d=o.getOptionValue(c),m=D.filter(function(C){return o.getOptionValue(C)!==d}),b=La(l,m,m[0]||null);o.onChange(b,{action:"remove-value",removedValue:c}),o.focusInput()},o.clearValue=function(){var c=o.state.selectValue;o.onChange(La(o.props.isMulti,[],null),{action:"clear",removedValues:c})},o.popValue=function(){var c=o.props.isMulti,l=o.state.selectValue,D=l[l.length-1],d=l.slice(0,l.length-1),m=La(c,d,d[0]||null);D&&o.onChange(m,{action:"pop-value",removedValue:D})},o.getFocusedOptionId=function(c){return Kc(o.state.focusableOptionsWithIds,c)},o.getFocusableOptionsWithIds=function(){return t8(Of(o.props,o.state.selectValue),o.getElementId("option"))},o.getValue=function(){return o.state.selectValue},o.cx=function(){for(var c=arguments.length,l=new Array(c),D=0;D<c;D++)l[D]=arguments[D];return nv.apply(void 0,[o.props.classNamePrefix].concat(l))},o.getOptionLabel=function(c){return r8(o.props,c)},o.getOptionValue=function(c){return Mf(o.props,c)},o.getStyles=function(c,l){var D=o.props.unstyled,d=aS[c](l,D);d.boxSizing="border-box";var m=o.props.styles[c];return m?m(d,l):d},o.getClassNames=function(c,l){var D,d;return(D=(d=o.props.classNames)[c])===null||D===void 0?void 0:D.call(d,l)},o.getElementId=function(c){return"".concat(o.state.instancePrefix,"-").concat(c)},o.getComponents=function(){return ww(o.props)},o.buildCategorizedOptions=function(){return Of(o.props,o.state.selectValue)},o.getCategorizedOptions=function(){return o.props.menuIsOpen?o.buildCategorizedOptions():[]},o.buildFocusableOptions=function(){return e8(o.buildCategorizedOptions())},o.getFocusableOptions=function(){return o.props.menuIsOpen?o.buildFocusableOptions():[]},o.ariaOnChange=function(c,l){o.setState({ariaSelection:we({value:c},l)})},o.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),o.focusInput())},o.onMenuMouseMove=function(c){o.blockOptionHover=!1},o.onControlMouseDown=function(c){if(!c.defaultPrevented){var l=o.props.openMenuOnClick;o.state.isFocused?o.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&o.onMenuClose():l&&o.openMenu("first"):(l&&(o.openAfterFocus=!0),o.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},o.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!o.props.isDisabled){var l=o.props,D=l.isMulti,d=l.menuIsOpen;o.focusInput(),d?(o.setState({inputIsHiddenAfterUpdate:!D}),o.onMenuClose()):o.openMenu("first"),c.preventDefault()}},o.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(o.clearValue(),c.preventDefault(),o.openAfterFocus=!1,c.type==="touchend"?o.focusInput():setTimeout(function(){return o.focusInput()}))},o.onScroll=function(c){typeof o.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&If(c.target)&&o.props.onMenuClose():typeof o.props.closeMenuOnScroll=="function"&&o.props.closeMenuOnScroll(c)&&o.props.onMenuClose()},o.onCompositionStart=function(){o.isComposing=!0},o.onCompositionEnd=function(){o.isComposing=!1},o.onTouchStart=function(c){var l=c.touches,D=l&&l.item(0);D&&(o.initialTouchX=D.clientX,o.initialTouchY=D.clientY,o.userIsDragging=!1)},o.onTouchMove=function(c){var l=c.touches,D=l&&l.item(0);if(D){var d=Math.abs(D.clientX-o.initialTouchX),m=Math.abs(D.clientY-o.initialTouchY),b=5;o.userIsDragging=d>b||m>b}},o.onTouchEnd=function(c){o.userIsDragging||(o.controlRef&&!o.controlRef.contains(c.target)&&o.menuListRef&&!o.menuListRef.contains(c.target)&&o.blurInput(),o.initialTouchX=0,o.initialTouchY=0)},o.onControlTouchEnd=function(c){o.userIsDragging||o.onControlMouseDown(c)},o.onClearIndicatorTouchEnd=function(c){o.userIsDragging||o.onClearIndicatorMouseDown(c)},o.onDropdownIndicatorTouchEnd=function(c){o.userIsDragging||o.onDropdownIndicatorMouseDown(c)},o.handleInputChange=function(c){var l=o.props.inputValue,D=c.currentTarget.value;o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange(D,{action:"input-change",prevInputValue:l}),o.props.menuIsOpen||o.onMenuOpen()},o.onInputFocus=function(c){o.props.onFocus&&o.props.onFocus(c),o.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(o.openAfterFocus||o.props.openMenuOnFocus)&&o.openMenu("first"),o.openAfterFocus=!1},o.onInputBlur=function(c){var l=o.props.inputValue;if(o.menuListRef&&o.menuListRef.contains(document.activeElement)){o.inputRef.focus();return}o.props.onBlur&&o.props.onBlur(c),o.onInputChange("",{action:"input-blur",prevInputValue:l}),o.onMenuClose(),o.setState({focusedValue:null,isFocused:!1})},o.onOptionHover=function(c){if(!(o.blockOptionHover||o.state.focusedOption===c)){var l=o.getFocusableOptions(),D=l.indexOf(c);o.setState({focusedOption:c,focusedOptionId:D>-1?o.getFocusedOptionId(c):null})}},o.shouldHideSelectedOptions=function(){return s8(o.props)},o.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),o.focus()},o.onKeyDown=function(c){var l=o.props,D=l.isMulti,d=l.backspaceRemovesValue,m=l.escapeClearsValue,b=l.inputValue,C=l.isClearable,g=l.isDisabled,A=l.menuIsOpen,h=l.onKeyDown,E=l.tabSelectsValue,F=l.openMenuOnFocus,x=o.state,y=x.focusedOption,S=x.focusedValue,v=x.selectValue;if(!g&&!(typeof h=="function"&&(h(c),c.defaultPrevented))){switch(o.blockOptionHover=!0,c.key){case"ArrowLeft":if(!D||b)return;o.focusValue("previous");break;case"ArrowRight":if(!D||b)return;o.focusValue("next");break;case"Delete":case"Backspace":if(b)return;if(S)o.removeValue(S);else{if(!d)return;D?o.popValue():C&&o.clearValue()}break;case"Tab":if(o.isComposing||c.shiftKey||!A||!E||!y||F&&o.isOptionSelected(y,v))return;o.selectOption(y);break;case"Enter":if(c.keyCode===229)break;if(A){if(!y||o.isComposing)return;o.selectOption(y);break}return;case"Escape":A?(o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange("",{action:"menu-close",prevInputValue:b}),o.onMenuClose()):C&&m&&o.clearValue();break;case" ":if(b)return;if(!A){o.openMenu("first");break}if(!y)return;o.selectOption(y);break;case"ArrowUp":A?o.focusOption("up"):o.openMenu("last");break;case"ArrowDown":A?o.focusOption("down"):o.openMenu("first");break;case"PageUp":if(!A)return;o.focusOption("pageup");break;case"PageDown":if(!A)return;o.focusOption("pagedown");break;case"Home":if(!A)return;o.focusOption("first");break;case"End":if(!A)return;o.focusOption("last");break;default:return}c.preventDefault()}},o.state.instancePrefix="react-select-"+(o.props.instanceId||++gS),o.state.selectValue=Sf(r.value),r.menuIsOpen&&o.state.selectValue.length){var u=o.getFocusableOptionsWithIds(),s=o.buildFocusableOptions(),i=s.indexOf(o.state.selectValue[0]);o.state.focusableOptionsWithIds=u,o.state.focusedOption=s[i],o.state.focusedOptionId=Kc(u,s[i])}return o}return Iy(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&B2(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(o){var u=this.props,s=u.isDisabled,i=u.menuIsOpen,c=this.state.isFocused;(c&&!s&&o.isDisabled||c&&i&&!o.menuIsOpen)&&this.focusInput(),c&&s&&!o.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!s&&o.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(B2(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(o,u){this.props.onInputChange(o,u)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(o){var u=this,s=this.state,i=s.selectValue,c=s.isFocused,l=this.buildFocusableOptions(),D=o==="first"?0:l.length-1;if(!this.props.isMulti){var d=l.indexOf(i[0]);d>-1&&(D=d)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:l[D],focusedOptionId:this.getFocusedOptionId(l[D])},function(){return u.onMenuOpen()})}},{key:"focusValue",value:function(o){var u=this.state,s=u.selectValue,i=u.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=s.indexOf(i);i||(c=-1);var l=s.length-1,D=-1;if(s.length){switch(o){case"previous":c===0?D=0:c===-1?D=l:D=c-1;break;case"next":c>-1&&c<l&&(D=c+1);break}this.setState({inputIsHidden:D!==-1,focusedValue:s[D]})}}}},{key:"focusOption",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",u=this.props.pageSize,s=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var c=0,l=i.indexOf(s);s||(l=-1),o==="up"?c=l>0?l-1:i.length-1:o==="down"?c=(l+1)%i.length:o==="pageup"?(c=l-u,c<0&&(c=0)):o==="pagedown"?(c=l+u,c>i.length-1&&(c=i.length-1)):o==="last"&&(c=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(i[c])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Uc):we(we({},Uc),this.props.theme):Uc}},{key:"getCommonProps",value:function(){var o=this.clearValue,u=this.cx,s=this.getStyles,i=this.getClassNames,c=this.getValue,l=this.selectOption,D=this.setValue,d=this.props,m=d.isMulti,b=d.isRtl,C=d.options,g=this.hasValue();return{clearValue:o,cx:u,getStyles:s,getClassNames:i,getValue:c,hasValue:g,isMulti:m,isRtl:b,options:C,selectOption:l,selectProps:d,setValue:D,theme:this.getTheme()}}},{key:"hasValue",value:function(){var o=this.state.selectValue;return o.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var o=this.props,u=o.isClearable,s=o.isMulti;return u===void 0?s:u}},{key:"isOptionDisabled",value:function(o,u){return o8(this.props,o,u)}},{key:"isOptionSelected",value:function(o,u){return u8(this.props,o,u)}},{key:"filterOption",value:function(o,u){return a8(this.props,o,u)}},{key:"formatOptionLabel",value:function(o,u){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,i=this.state.selectValue;return this.props.formatOptionLabel(o,{context:u,inputValue:s,selectValue:i})}else return this.getOptionLabel(o)}},{key:"formatGroupLabel",value:function(o){return this.props.formatGroupLabel(o)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var o=this.props,u=o.isDisabled,s=o.isSearchable,i=o.inputId,c=o.inputValue,l=o.tabIndex,D=o.form,d=o.menuIsOpen,m=o.required,b=this.getComponents(),C=b.Input,g=this.state,A=g.inputIsHidden,h=g.ariaSelection,E=this.commonProps,F=i||this.getElementId("input"),x=we(we(we({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":m,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?(h==null?void 0:h.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?I.createElement(C,Te({},E,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:F,innerRef:this.getInputRef,isDisabled:u,isHidden:A,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:l,form:D,type:"text",value:c},x)):I.createElement(Ww,Te({id:F,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:wf,onFocus:this.onInputFocus,disabled:u,tabIndex:l,inputMode:"none",form:D,value:""},x))}},{key:"renderPlaceholderOrValue",value:function(){var o=this,u=this.getComponents(),s=u.MultiValue,i=u.MultiValueContainer,c=u.MultiValueLabel,l=u.MultiValueRemove,D=u.SingleValue,d=u.Placeholder,m=this.commonProps,b=this.props,C=b.controlShouldRenderValue,g=b.isDisabled,A=b.isMulti,h=b.inputValue,E=b.placeholder,F=this.state,x=F.selectValue,y=F.focusedValue,S=F.isFocused;if(!this.hasValue()||!C)return h?null:I.createElement(d,Te({},m,{key:"placeholder",isDisabled:g,isFocused:S,innerProps:{id:this.getElementId("placeholder")}}),E);if(A)return x.map(function(w,k){var O=w===y,j="".concat(o.getOptionLabel(w),"-").concat(o.getOptionValue(w));return I.createElement(s,Te({},m,{components:{Container:i,Label:c,Remove:l},isFocused:O,isDisabled:g,key:j,index:k,removeProps:{onClick:function(){return o.removeValue(w)},onTouchEnd:function(){return o.removeValue(w)},onMouseDown:function(L){L.preventDefault()}},data:w}),o.formatOptionLabel(w,"value"))});if(h)return null;var v=x[0];return I.createElement(D,Te({},m,{data:v,isDisabled:g}),this.formatOptionLabel(v,"value"))}},{key:"renderClearIndicator",value:function(){var o=this.getComponents(),u=o.ClearIndicator,s=this.commonProps,i=this.props,c=i.isDisabled,l=i.isLoading,D=this.state.isFocused;if(!this.isClearable()||!u||c||!this.hasValue()||l)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return I.createElement(u,Te({},s,{innerProps:d,isFocused:D}))}},{key:"renderLoadingIndicator",value:function(){var o=this.getComponents(),u=o.LoadingIndicator,s=this.commonProps,i=this.props,c=i.isDisabled,l=i.isLoading,D=this.state.isFocused;if(!u||!l)return null;var d={"aria-hidden":"true"};return I.createElement(u,Te({},s,{innerProps:d,isDisabled:c,isFocused:D}))}},{key:"renderIndicatorSeparator",value:function(){var o=this.getComponents(),u=o.DropdownIndicator,s=o.IndicatorSeparator;if(!u||!s)return null;var i=this.commonProps,c=this.props.isDisabled,l=this.state.isFocused;return I.createElement(s,Te({},i,{isDisabled:c,isFocused:l}))}},{key:"renderDropdownIndicator",value:function(){var o=this.getComponents(),u=o.DropdownIndicator;if(!u)return null;var s=this.commonProps,i=this.props.isDisabled,c=this.state.isFocused,l={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return I.createElement(u,Te({},s,{innerProps:l,isDisabled:i,isFocused:c}))}},{key:"renderMenu",value:function(){var o=this,u=this.getComponents(),s=u.Group,i=u.GroupHeading,c=u.Menu,l=u.MenuList,D=u.MenuPortal,d=u.LoadingMessage,m=u.NoOptionsMessage,b=u.Option,C=this.commonProps,g=this.state.focusedOption,A=this.props,h=A.captureMenuScroll,E=A.inputValue,F=A.isLoading,x=A.loadingMessage,y=A.minMenuHeight,S=A.maxMenuHeight,v=A.menuIsOpen,w=A.menuPlacement,k=A.menuPosition,O=A.menuPortalTarget,j=A.menuShouldBlockScroll,T=A.menuShouldScrollIntoView,L=A.noOptionsMessage,M=A.onMenuScrollToTop,_=A.onMenuScrollToBottom;if(!v)return null;var P=function(te,ue){var R=te.type,ee=te.data,fe=te.isDisabled,Fe=te.isSelected,Oe=te.label,Ce=te.value,re=g===ee,Z=fe?void 0:function(){return o.onOptionHover(ee)},W=fe?void 0:function(){return o.selectOption(ee)},K="".concat(o.getElementId("option"),"-").concat(ue),U={id:K,onClick:W,onMouseMove:Z,onMouseOver:Z,tabIndex:-1,role:"option","aria-selected":o.isAppleDevice?void 0:Fe};return I.createElement(b,Te({},C,{innerProps:U,data:ee,isDisabled:fe,isSelected:Fe,key:K,label:Oe,type:R,value:Ce,isFocused:re,innerRef:re?o.getFocusedOptionRef:void 0}),o.formatOptionLabel(te.data,"menu"))},G;if(this.hasOptions())G=this.getCategorizedOptions().map(function(X){if(X.type==="group"){var te=X.data,ue=X.options,R=X.index,ee="".concat(o.getElementId("group"),"-").concat(R),fe="".concat(ee,"-heading");return I.createElement(s,Te({},C,{key:ee,data:te,options:ue,Heading:i,headingProps:{id:fe,data:X.data},label:o.formatGroupLabel(X.data)}),X.options.map(function(Fe){return P(Fe,"".concat(R,"-").concat(Fe.index))}))}else if(X.type==="option")return P(X,"".concat(X.index))});else if(F){var z=x({inputValue:E});if(z===null)return null;G=I.createElement(d,C,z)}else{var V=L({inputValue:E});if(V===null)return null;G=I.createElement(m,C,V)}var H={minMenuHeight:y,maxMenuHeight:S,menuPlacement:w,menuPosition:k,menuShouldScrollIntoView:T},J=I.createElement(Fv,Te({},C,H),function(X){var te=X.ref,ue=X.placerProps,R=ue.placement,ee=ue.maxHeight;return I.createElement(c,Te({},C,H,{innerRef:te,innerProps:{onMouseDown:o.onMenuMouseDown,onMouseMove:o.onMenuMouseMove},isLoading:F,placement:R}),I.createElement(Yw,{captureEnabled:h,onTopArrive:M,onBottomArrive:_,lockEnabled:j},function(fe){return I.createElement(l,Te({},C,{innerRef:function(Oe){o.getMenuListRef(Oe),fe(Oe)},innerProps:{role:"listbox","aria-multiselectable":C.isMulti,id:o.getElementId("listbox")},isLoading:F,maxHeight:ee,focusedOption:g}),G)}))});return O||k==="fixed"?I.createElement(D,Te({},C,{appendTo:O,controlElement:this.controlRef,menuPlacement:w,menuPosition:k}),J):J}},{key:"renderFormField",value:function(){var o=this,u=this.props,s=u.delimiter,i=u.isDisabled,c=u.isMulti,l=u.name,D=u.required,d=this.state.selectValue;if(D&&!this.hasValue()&&!i)return I.createElement($w,{name:l,onFocus:this.onValueInputFocus});if(!(!l||i))if(c)if(s){var m=d.map(function(g){return o.getOptionValue(g)}).join(s);return I.createElement("input",{name:l,type:"hidden",value:m})}else{var b=d.length>0?d.map(function(g,A){return I.createElement("input",{key:"i-".concat(A),name:l,type:"hidden",value:o.getOptionValue(g)})}):I.createElement("input",{name:l,type:"hidden",value:""});return I.createElement("div",null,b)}else{var C=d[0]?this.getOptionValue(d[0]):"";return I.createElement("input",{name:l,type:"hidden",value:C})}}},{key:"renderLiveRegion",value:function(){var o=this.commonProps,u=this.state,s=u.ariaSelection,i=u.focusedOption,c=u.focusedValue,l=u.isFocused,D=u.selectValue,d=this.getFocusableOptions();return I.createElement(jw,Te({},o,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:i,focusedValue:c,isFocused:l,selectValue:D,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var o=this.getComponents(),u=o.Control,s=o.IndicatorsContainer,i=o.SelectContainer,c=o.ValueContainer,l=this.props,D=l.className,d=l.id,m=l.isDisabled,b=l.menuIsOpen,C=this.state.isFocused,g=this.commonProps=this.getCommonProps();return I.createElement(i,Te({},g,{className:D,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:m,isFocused:C}),this.renderLiveRegion(),I.createElement(u,Te({},g,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:m,isFocused:C,menuIsOpen:b}),I.createElement(c,Te({},g,{isDisabled:m}),this.renderPlaceholderOrValue(),this.renderInput()),I.createElement(s,Te({},g,{isDisabled:m}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(o,u){var s=u.prevProps,i=u.clearFocusValueOnUpdate,c=u.inputIsHiddenAfterUpdate,l=u.ariaSelection,D=u.isFocused,d=u.prevWasFocused,m=u.instancePrefix,b=o.options,C=o.value,g=o.menuIsOpen,A=o.inputValue,h=o.isMulti,E=Sf(C),F={};if(s&&(C!==s.value||b!==s.options||g!==s.menuIsOpen||A!==s.inputValue)){var x=g?dS(o,E):[],y=g?t8(Of(o,E),"".concat(m,"-option")):[],S=i?AS(u,E):null,v=pS(u,x),w=Kc(y,v);F={selectValue:E,focusedOption:v,focusedOptionId:w,focusableOptionsWithIds:y,focusedValue:S,clearFocusValueOnUpdate:!1}}var k=c!=null&&o!==s?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},O=l,j=D&&d;return D&&!j&&(O={value:La(h,E,E[0]||null),options:E,action:"initial-input-focus"},j=!d),(l==null?void 0:l.action)==="initial-input-focus"&&(O=null),we(we(we({},F),k),{},{prevProps:o,ariaSelection:O,prevWasFocused:j})}}]),n}(p.Component);_f.defaultProps=DS;var CS=p.forwardRef(function(e,t){var n=wc(e);return I.createElement(_f,Te({ref:t},n))}),hS=CS;const FS=f.styled(f.Box)`
|
|
@@ -2677,8 +2677,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2677
2677
|
border-radius: 10px;
|
|
2678
2678
|
pointer-events: auto;
|
|
2679
2679
|
box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
|
|
2680
|
-
`,FL=e=>e,mL=({open:e,targetRef:t,endElRef:n,padding:r=8,zIndex:o=1300,renderHighlight:u=FL,onClose:s})=>{const[i,c]=p.useState(null);if(p.useEffect(()=>{if(!e){c(null);return}const D=t.current;if(!D){c(null);return}const d=(n==null?void 0:n.current)||D,m=D.getBoundingClientRect(),b=d.getBoundingClientRect(),C=window.innerWidth,g=window.innerHeight,A=Math.max(0,m.left-r),h=Math.max(0,m.top-r),E=Math.min(g,m.bottom+r),F=Math.min(C,b.right+r),x=Math.max(0,F-A),y=Math.max(0,E-h);if(!x||!y){c(null);return}c({top:h,left:A,width:x,height:y,right:F,bottom:E})},[e,r,t,n]),!e||!i||typeof document>"u")return null;const l=a.jsx(hL,{top:i.top,left:i.left,width:i.width,height:i.height,onClick:D=>D.stopPropagation()});return Nt.createPortal(a.jsx(CL,{zIndex:o,onClick:s,children:u(l)}),document.body)},en="logEmailsAsComments",EL="Log email as a comment",bL="Keep email replies in sync with this monday.com task",xL="Sync conversation is already enabled for :appName",yL=e=>xL.replace(":appName",e),h1=e=>!!(e!=null&&e.some(t=>t.name===en&&t.type==="checkbox")),hp=p.createContext(null),BL=()=>a.jsx(a.Fragment,{children:p.useContext(hp)}),vL=p.memo(function(){return a.jsx(f.HiverCacheProvider,{speedy:!0,children:a.jsx(BL,{})})}),Fp=({children:e,...t})=>a.jsx(hp.Provider,{value:a.jsx(f.HiverThemeProvider,{...t,children:e}),children:a.jsx(vL,{})}),wL={connectorFontFamily:tr,typography:{fontFamily:tr},components:{MuiTypography:{styleOverrides:{root:{fontFamily:`${tr} !important`}}},MuiButton:{styleOverrides:{root:{fontFamily:`${tr} !important`}}},MuiInputBase:{styleOverrides:{root:{fontFamily:`${tr} !important`}}},MuiInputLabel:{styleOverrides:{root:{fontFamily:`${tr} !important`}}},MuiFormLabel:{styleOverrides:{root:{fontFamily:`${tr} !important`}}},MuiMenuItem:{styleOverrides:{root:{fontFamily:`${tr} !important`}}},MuiChip:{styleOverrides:{root:{fontFamily:`${tr} !important`}}},MuiTooltip:{styleOverrides:{tooltip:{fontFamily:`${tr} !important`}}}}},SL=e=>f.createTheme(e,wL),IL={display:"contents",fontFamily:tr},mp=({enabled:e,children:t})=>e?a.jsx(f.ThemeProvider,{theme:SL,children:a.jsx("div",{"data-omni-font":"",style:IL,children:t})}):a.jsx(a.Fragment,{children:t}),Ep="#5B5D60",vu="connector-rich-tooltip",Vf={light:{canvas:"#FFFFFF",surface:"#FFFFFF",surfaceSubtle:"#F6F8FC",surfaceElevated:"#FFFFFF",surfaceHover:"#F6F8FC",surfaceActive:"#ECEFF6",previewHeader:"#FFFFFF",tooltipSurface:"#FFFFFF",tooltipText:"#343C45",border:"#ECEFF6",borderStrong:"#D6DDE8",textPrimary:"#343C45",textSecondary:"#4D596C",textTertiary:"#6F7C90",textMuted:"#97A3B7",textDisabled:"#97A3B7",iconPrimary:"#4D596C",iconSecondary:"#6F7C90",iconTertiary:"#3E4C5A",iconDisabled:"#97A3B7",iconAccent:"#506DFF",accent:"#506DFF",accentHover:"#4763F0",accentSubtle:"#E5EAFF",primaryAction:"#506DFF",primaryActionHover:"#4763F0",primaryActionActive:"#4763F0",inputBackground:"#FFFFFF",inputFilledBackground:"#FFFFFF",inputDisabledBackground:"#ECEFF6",inputBorder:"#D6DDE8",inputBorderHover:"#6F7C90",inputBorderFocus:"#506DFF",inputBorderInvalid:"#CD3746",inputText:"#343C45",inputDisabledText:"#97A3B7",inputPlaceholder:"#97A3B7",inputShadow:"none",shadowSubtle:"rgba(0, 0, 0, 0.12)",shadowStrong:"rgba(0, 0, 0, 0.18)",dropdownShadow:"0px 3px 15px 0px rgba(0, 0, 0, 0.25)",overlayBackdrop:"rgba(15, 23, 42, 0.45)",negative:"#CD3746",success:"#00BC7E",onAccent:"#FFFFFF"},dark:{canvas:"#0B0C0D",surface:"#171819",surfaceSubtle:"#101112",surfaceElevated:"#171819",surfaceHover:"rgba(255, 255, 255, 0.04)",surfaceActive:"rgba(255, 255, 255, 0.07)",previewHeader:"#171819",tooltipSurface:"#DCDDDF",tooltipText:"#0B0C0D",border:"#212224",borderStrong:"#292A2C",textPrimary:"#DCDDDF",textSecondary:"#D1D2D5",textTertiary:"#9FA1A6",textMuted:"#7A7C81",textDisabled:"#5B5D60",iconPrimary:"#D1D2D5",iconSecondary:"#7A7C81",iconTertiary:"#5B5D60",iconDisabled:"#3D3E41",iconAccent:"#6089F4",accent:"#6089F4",accentHover:"#3B6CE8",accentSubtle:"rgba(96, 137, 244, 0.12)",primaryAction:"#2652CC",primaryActionHover:"#143BB5",primaryActionActive:"#0B279C",inputBackground:"#171819",inputFilledBackground:"#1B1C1E",inputDisabledBackground:"#101112",inputBorder:"#212224",inputBorderHover:"#3D3E41",inputBorderFocus:"#5B5D60",inputBorderInvalid:"#E42525",inputText:"#DCDDDF",inputDisabledText:"#7A7C81",inputPlaceholder:"#9FA1A6",inputShadow:"0 1px 2px rgba(0, 0, 0, 0.24)",shadowSubtle:"rgba(0, 0, 0, 0.28)",shadowStrong:"rgba(0, 0, 0, 0.45)",dropdownShadow:"0 6px 14px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.04)",overlayBackdrop:"rgba(23, 24, 25, 0.45)",negative:"#D96D71",success:"#2DBB6D",onAccent:"#FFFFFF"}},F1=({mode:e,tokens:t})=>({...Vf[e],...t}),m1=(e,t)=>({"--connector-canvas":t.canvas,"--connector-map-form-background":e==="light"?t.canvas:t.surfaceElevated,...e==="dark"?{"--connector-map-form-field-background":t.inputFilledBackground,"--connector-map-form-field-border":t.borderStrong,"--connector-map-form-table-border":t.borderStrong,"--connector-map-form-row-border":t.border,"--connector-map-form-header-text-color":t.textSecondary,"--connector-map-form-header-icon-background":t.surfaceActive,"--connector-map-form-header-icon-color":t.iconSecondary,"--connector-map-form-add-icon-color":t.textTertiary,"--connector-map-form-label-color":t.textTertiary,"--connector-map-form-arrow-color":t.textDisabled,"--connector-map-form-dropdown-icon-color":t.iconSecondary}:{},"--connector-surface":t.surface,"--connector-surface-subtle":t.surfaceSubtle,"--connector-surface-elevated":t.surfaceElevated,"--connector-surface-hover":t.surfaceHover,"--connector-surface-active":t.surfaceActive,"--connector-dropdown-option-selected":e==="light"?t.surfaceHover:t.surfaceActive,"--connector-search-option-selected":e==="light"?t.accentSubtle:t.surfaceActive,"--connector-segmented-selected-background":e==="light"?t.accentSubtle:t.surfaceElevated,"--connector-segmented-selected-text":e==="light"?t.accent:t.textPrimary,"--connector-segmented-inactive-text":e==="light"?t.textSecondary:t.textTertiary,"--connector-thread-card-background":e==="light"?t.surfaceSubtle:t.surfaceHover,"--connector-modal-surface":e==="light"?t.surface:t.surfaceSubtle,"--connector-preview-header":t.previewHeader,"--connector-tooltip-surface":t.tooltipSurface,"--connector-tooltip-text":t.tooltipText,"--connector-modal-backdrop":e==="light"?"rgba(0, 0, 0, 0.5)":`color-mix(in srgb, ${t.canvas} 40%, transparent)`,"--connector-border":t.border,"--connector-border-strong":t.borderStrong,"--connector-text-primary":t.textPrimary,"--connector-text-secondary":t.textSecondary,"--connector-slack-message-body-text":e==="light"?t.textPrimary:t.textSecondary,"--connector-text-tertiary":t.textTertiary,"--connector-caption-text":e==="light"?t.textTertiary:t.textSecondary,"--connector-text-muted":t.textMuted,"--connector-text-disabled":t.textDisabled,"--connector-icon-primary":t.iconPrimary,"--connector-icon-secondary":t.iconSecondary,"--connector-icon-tertiary":t.iconTertiary,"--connector-icon-disabled":t.iconDisabled,"--connector-icon-accent":t.iconAccent,...e==="dark"?{"--connector-neutral-icon":t.iconSecondary}:{},"--connector-accent":t.accent,"--connector-accent-hover":t.accentHover,"--connector-accent-subtle":t.accentSubtle,"--connector-autofill-prompt-background":e==="light"?"#FCF4FF":t.accentSubtle,"--connector-autofill-prompt-border":e==="light"?"#E0BCE8":t.borderStrong,...e==="dark"?{"--connector-pill-brand-bg":t.accentSubtle,"--connector-pill-brand-hover-bg":t.surfaceActive,"--connector-pill-neutral-bg":t.surfaceHover,"--connector-pill-neutral-hover-bg":t.surfaceActive,"--connector-pill-success-bg":t.surfaceActive,"--connector-pill-success-hover-bg":t.surfaceHover,"--connector-pill-success-text":t.textPrimary,"--connector-pill-success-count":t.textSecondary,"--connector-pill-danger-bg":`color-mix(in srgb, ${t.negative} 12%, ${t.surface})`,"--connector-pill-danger-hover-bg":`color-mix(in srgb, ${t.negative} 18%, ${t.surface})`,"--connector-pill-danger-text":t.negative,"--connector-pill-primary-text":t.textPrimary,"--connector-pill-secondary-text":t.textSecondary,"--connector-pill-muted-text":t.textMuted}:{},...e==="dark"?{"--connector-unauth-title-text":t.textPrimary,"--connector-unauth-message-text":t.textSecondary}:{},"--connector-primary-action":t.primaryAction,"--connector-primary-action-hover":t.primaryActionHover,"--connector-primary-action-active":t.primaryActionActive,"--connector-input-background":t.inputBackground,"--connector-input-disabled-background":t.inputDisabledBackground,"--connector-input-border":t.inputBorder,"--connector-input-border-hover":t.inputBorderHover,"--connector-input-border-focus":t.inputBorderFocus,"--connector-input-border-invalid":t.inputBorderInvalid,"--connector-input-text":t.inputText,"--connector-input-disabled-text":t.inputDisabledText,"--connector-input-placeholder":t.inputPlaceholder,"--connector-input-shadow":t.inputShadow,"--connector-shadow-subtle":t.shadowSubtle,"--connector-shadow-strong":t.shadowStrong,"--connector-dropdown-shadow":t.dropdownShadow,"--connector-dropdown-border":e==="light"?"transparent":t.border,"--connector-overlay-backdrop":t.overlayBackdrop,"--connector-negative":t.negative,"--connector-success":t.success,"--connector-switch-checked":e==="light"?t.accent:t.success,"--connector-on-accent":t.onAccent,colorScheme:e}),kL=/^(#|rgb|hsl|color\()/i,TL=(e,t)=>{const n=Vf[e],r={...t};return Object.keys(r).forEach(o=>{kL.test(String(r[o]).trim())||(r[o]=n[o])}),r},LL=(e,t)=>{const n={...e,...t};return Object.keys(t).forEach(r=>{const o=e[r],u=t[r];o&&u&&typeof o=="object"&&typeof u=="object"&&!Array.isArray(o)&&!Array.isArray(u)&&(n[r]={...o,...u})}),n},OL=(e,t)=>{var u,s,i;const n=TL(e,t),r=(i=(s=(u=f.theme.components)==null?void 0:u.MuiButton)==null?void 0:s.styleOverrides)==null?void 0:i.root,o={textTransform:"unset","&.MuiButton-outlined":{color:t.textSecondary,borderColor:t.border,backgroundColor:"transparent"},"&.MuiButton-outlined:hover":{color:t.textPrimary,borderColor:t.borderStrong,backgroundColor:t.surfaceHover},"&.MuiButton-outlined:active":{color:t.textPrimary,borderColor:t.borderStrong,backgroundColor:t.surfaceActive},"&.MuiButton-text":{color:t.accent,backgroundColor:"transparent !important"},"&.MuiButton-text:hover":{color:t.accent,backgroundColor:`${t.surfaceHover} !important`},"&.MuiButton-containedPrimary":{color:t.onAccent,backgroundColor:t.primaryAction},"&.MuiButton-containedPrimary:hover":{backgroundColor:t.primaryActionHover},"&.MuiButton-containedPrimary:active":{backgroundColor:t.primaryActionActive},"&.MuiButton-containedError":{color:f.theme.palette.error.contrastText,backgroundColor:f.theme.palette.error.main},"&.MuiButton-containedError:hover, &.MuiButton-containedError.MuiButton-hover":{backgroundColor:f.theme.palette.error.dark},"&.Mui-disabled":{color:t.textMuted,backgroundColor:t.surfaceActive}};return f.createTheme(f.theme,{typography:{...f.theme.typography,fontFamily:"Inter, Roboto, sans-serif"},palette:{mode:e,background:{default:n.canvas,paper:n.surfaceElevated},text:{primary:n.textPrimary,secondary:n.textSecondary,disabled:e==="dark"?n.textDisabled:n.textMuted},divider:n.border,primary:{main:n.primaryAction,dark:n.primaryActionHover,contrastText:n.onAccent},error:{main:n.negative},gray:{...f.theme.palette.gray,white:n.surface,black:n.textPrimary,gray1:n.textPrimary,gray2:n.textSecondary,gray3:e==="dark"?n.textTertiary:n.textSecondary,gray4:n.textMuted,gray5:n.borderStrong,gray6:n.border,gray6a:n.surfaceSubtle,gray7:n.canvas,background:n.canvas},blue:{...f.theme.palette.blue,primary:n.accent,hover:n.accentHover,light:n.accentSubtle},purple:{...f.theme.palette.purple,primary:n.accent,hover:n.accentHover,light:n.accentSubtle}},components:{MuiCssBaseline:{styleOverrides:{body:{color:t.textPrimary,backgroundColor:t.canvas}}},MuiPaper:{styleOverrides:{root:{color:t.textPrimary,backgroundColor:t.surfaceElevated}}},MuiPopover:{styleOverrides:{paper:{boxShadow:t.dropdownShadow}}},MuiMenu:{styleOverrides:{paper:{color:t.textPrimary,backgroundColor:t.surfaceElevated,backgroundImage:"none",boxShadow:t.dropdownShadow}}},MuiMenuItem:{styleOverrides:{root:{color:t.textPrimary,"&:hover":{backgroundColor:t.surfaceHover},"&.Mui-selected, &.Mui-selected:hover":{backgroundColor:t.surfaceActive}}}},...e==="dark"?{MuiAutocomplete:{styleOverrides:{option:{color:t.textPrimary,"&.Mui-focused":{backgroundColor:t.surfaceHover},'&[aria-selected="true"], &[aria-selected="true"].Mui-focused':{backgroundColor:t.surfaceActive}}}}}:{},MuiListItemIcon:{styleOverrides:{root:{color:t.iconSecondary}}},MuiDialog:{styleOverrides:{paper:{color:t.textPrimary,backgroundColor:t.surfaceElevated,backgroundImage:"none",borderColor:t.borderStrong}}},MuiLink:{styleOverrides:{root:{color:t.accent,"&:hover":{color:t.accentHover}}}},MuiInputBase:{styleOverrides:{root:{color:t.inputText,backgroundColor:t.inputBackground},input:{"&::placeholder":{color:t.inputPlaceholder,opacity:1}}}},MuiOutlinedInput:{styleOverrides:{root:{color:t.inputText,backgroundColor:t.inputBackground,boxShadow:t.inputShadow,"& .MuiOutlinedInput-notchedOutline":{borderColor:t.inputBorder},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:t.inputBorderHover},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:t.inputBorderFocus},"&.Mui-disabled":{color:t.inputDisabledText,backgroundColor:t.inputDisabledBackground}},input:{"&::placeholder":{color:t.inputPlaceholder,opacity:1}}}},MuiSelect:{styleOverrides:{icon:{color:t.iconSecondary}}},MuiFormLabel:{styleOverrides:{root:{color:t.textPrimary,"&.Mui-focused":{color:t.accent}}}},MuiFormHelperText:{styleOverrides:{root:{color:t.textMuted}}},MuiButton:{styleOverrides:{root:c=>{const l=typeof r=="function"?r(c):r;return LL(l??{},o)}}},MuiCheckbox:{styleOverrides:{root:{color:t.iconSecondary,"&.Mui-checked":{color:t.accent},"&.Mui-disabled":{color:t.textMuted}}}},MuiSwitch:{styleOverrides:{switchBase:{...e==="dark"&&{color:t.iconSecondary,"&.Mui-checked":{color:t.success},"&.Mui-checked + .MuiSwitch-track":{backgroundColor:t.success,opacity:.5},"&.Mui-disabled":{color:t.textPrimary,opacity:1},"&.Mui-disabled + .MuiSwitch-track":{backgroundColor:Ep,opacity:1},"&.Mui-checked.Mui-disabled":{color:t.success,opacity:1},"&.Mui-checked.Mui-disabled + .MuiSwitch-track":{backgroundColor:t.success,opacity:.5}}},track:{...e==="dark"&&{backgroundColor:t.borderStrong,opacity:1}}}},MuiIconButton:{styleOverrides:{root:{padding:"8px",color:t.iconSecondary,"&:hover":{color:t.iconPrimary,backgroundColor:t.surfaceHover},...e==="dark"&&{"&.Mui-disabled":{color:t.iconDisabled}}}}},MuiTooltip:{styleOverrides:{tooltip:{minHeight:"unset",maxWidth:"320px",padding:"4px 8px",border:0,borderRadius:"4px",color:t.tooltipText,backgroundColor:t.tooltipSurface,boxShadow:`0 4px 12px ${t.shadowStrong}`,fontSize:"12px",fontWeight:400,lineHeight:"16px",whiteSpace:"normal",wordBreak:"break-word"},arrow:{display:"none"}}}}})},E1=p.createContext({mode:"light",tokens:Vf.light}),zf=()=>p.useContext(E1),qr={mode:"light"},wu=(e=qr)=>{const{mode:t,tokens:n}=e;return p.useMemo(()=>m1(t,F1({mode:t,tokens:n})),[t,n])},Mr=({config:e=qr,children:t})=>{const{mode:n,tokens:r}=e,o=p.useMemo(()=>F1({mode:n,tokens:r}),[n,r]),u=p.useMemo(()=>n==="dark"?OL(n,o):void 0,[n,o]),s=p.useMemo(()=>({mode:n,tokens:o}),[n,o]),i=p.useMemo(()=>({":root":m1(n,o)}),[n,o]),c=p.useMemo(()=>n==="dark"?ML(o):void 0,[n,o]);return n==="light"?a.jsx(E1.Provider,{value:s,children:a.jsxs(Fp,{inter:!0,children:[a.jsx(f.GlobalStyles,{styles:i}),t]})}):a.jsx(E1.Provider,{value:s,children:a.jsxs(Fp,{theme:u,children:[a.jsx(f.GlobalStyles,{styles:c}),t]})})},ML=e=>({":root":m1("dark",e),".connector-theme-root":{color:e.textPrimary,backgroundColor:e.canvas},":where(.connector-theme-root) :where(h1, h2, h3, h4, h5, h6)":{color:e.textPrimary},".connector-theme-root a":{color:e.accent},".connector-theme-root a:hover":{color:e.accentHover},".connector-theme-root .MuiDivider-root":{borderColor:e.border},".connector-theme-root .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline, .connector-theme-root .MuiOutlinedInput-root:focus-within .MuiOutlinedInput-notchedOutline":{borderColor:`${e.inputBorderFocus} !important`},".connector-theme-root .MuiSkeleton-root":{backgroundColor:e.surfaceActive},".connector-theme-root .MuiSwitch-switchBase:not(.Mui-checked):not(.Mui-disabled)":{color:`${e.iconSecondary} !important`},".connector-theme-root .MuiSwitch-track":{backgroundColor:`${e.borderStrong} !important`,opacity:"1 !important"},".connector-theme-root .MuiSwitch-switchBase.Mui-checked":{color:`${e.success} !important`},".connector-theme-root .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:`${e.success} !important`,opacity:"0.5 !important"},".connector-theme-root .MuiSwitch-switchBase.Mui-disabled":{color:`${e.textPrimary} !important`,opacity:"1 !important"},".connector-theme-root .MuiSwitch-switchBase.Mui-disabled + .MuiSwitch-track":{backgroundColor:`${Ep} !important`,opacity:"1 !important"},".connector-theme-root .MuiSwitch-switchBase.Mui-checked.Mui-disabled":{color:`${e.success} !important`,opacity:"1 !important"},".connector-theme-root .MuiSwitch-switchBase.Mui-checked.Mui-disabled + .MuiSwitch-track":{backgroundColor:`${e.success} !important`,opacity:"0.5 !important"},[`.MuiTooltip-popper:not(.${vu}) .MuiTooltip-tooltip`]:{width:"auto",height:"auto",minHeight:0,padding:"4px 8px",border:0,borderRadius:"4px",color:e.tooltipText,backgroundColor:e.tooltipSurface,boxShadow:`0 4px 12px ${e.shadowStrong}`,fontSize:"12px",fontWeight:400,lineHeight:"16px"},".MuiTooltip-arrow":{display:"none"},".MuiDialog-paper":{color:`${e.textPrimary} !important`,backgroundColor:`${e.surfaceElevated} !important`,borderColor:`${e.borderStrong} !important`},".MuiDialog-paper .MuiTypography-root":{color:`${e.textPrimary} !important`},".MuiPickersPopper-paper, .MuiCalendarPicker-root, .MuiPickersLayout-root, .MuiDateCalendar-root":{color:`${e.textPrimary} !important`,backgroundColor:`${e.surfaceElevated} !important`},".MuiPickersCalendarHeader-label, .MuiDayCalendar-weekDayLabel":{color:`${e.textSecondary} !important`},".MuiPickersDay-root":{color:`${e.textPrimary} !important`,backgroundColor:"transparent !important",outline:"none !important"},".MuiPickersDay-root:hover, .MuiPickersDay-root:focus":{backgroundColor:`${e.surfaceHover} !important`},".MuiPickersDay-root.MuiPickersDay-today:not(.Mui-selected)":{color:`${e.textPrimary} !important`,backgroundColor:`${e.surfaceActive} !important`,borderColor:"transparent !important"},".MuiPickersDay-root.Mui-selected":{color:`${e.onAccent} !important`,backgroundColor:`${e.accent} !important`}}),b1=new Set;let Pa=null,Qa=!1;const bp=()=>b1.forEach(e=>e()),_L=()=>{Qa||(Qa=!0,bp())},Xf=({zIndex:e})=>{const{mode:t}=zf(),n=p.useId(),[r,o]=p.useState(!1),[u,s]=p.useState(Qa);return p.useEffect(()=>{const i=()=>{Qa&&Pa===null&&(Pa=n),o(Pa===n),s(Qa)};return b1.add(i),i(),()=>{b1.delete(i),Pa===n&&(Pa=null,bp())}},[n]),!u||!r?null:Nt.createPortal(a.jsx(Bc,{id:"toast-message",children:a.jsx(yc,{theme:t,position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0,...e&&{style:{zIndex:e}}})}),document.body)};function Ge(e){const{message:t,type:n,autoClose:r}=e;_L();const o={closeButton:a.jsx(my,{}),autoClose:r??5e3,pauseOnHover:!0,position:"bottom-left",rtl:!1,draggable:!0,closeOnClick:!0,hideProgressBar:!0};let u;switch(n){case"success":{u=ot.success(a.jsx(Df,{message:t}),{...o,icon:!1});break}case"error":{u=ot.error(a.jsx(Df,{message:t}),{...o,icon:!1});break}case"info-dark":{u=ot.info(a.jsx(Df,{message:t}),{...o,icon:!1,className:"toast_dark"});break}default:{u=ot.info(a.jsx(Df,{message:t}),{...o,icon:!1});break}}return setTimeout(()=>{jL(u)},r&&!isNaN(r)?Number(r):5e3),u}function jL(e){ot.dismiss(e)}const xp={updateFormApiStatus:Ae.IDLE,createObjectList:[],createObjectConnectorNamesList:[],linkObjectList:[],editObjectList:[],searchObjectList:[],objectDict:null,formFields:null,objectListApiStatus:Ae.IDLE,unlinkCardApiStatus:Ae.IDLE,linkCardApiStatus:Ae.IDLE,optionsMap:null,dropdownOptionsApis:Ae.IDLE,dependentFieldsMap:{},createFormApiStatus:Ae.IDLE,currentResourceDetailsApiStatus:Ae.IDLE,currentResourceDetails:null,currentCardInEdit:null,hasUnsavedChanges:!1},yp=e=>{if(typeof e.userAuthEnabled=="boolean")return e;const t=e.user_auth_enabled;return typeof t=="boolean"?{...e,userAuthEnabled:t}:e},x1=(e,t,n)=>{let r=`${t}_${n}`;return Object.keys(e).forEach(o=>{r=`${r}_${o}:${e[o]}`}),r},Bp=(e,t)=>t?Object.values(t).filter(r=>{if(e.errors[r])return!1;const o=e.values[r];return Array.isArray(o)?o.length>0:!!o}):[],Ra=(e,t)=>t?Object.keys(t).reduce((r,o)=>{var c;let u="";const s=t[o],i=(c=e.values)==null?void 0:c[s];return Array.isArray(i)?(u=i.filter(l=>!!l&&typeof l=="object"&&"value"in l).map(l=>l.value),u=u.length>0?u:null):i&&typeof i=="object"&&"value"in i?u=i.value:i&&typeof i!="object"?u=i:u=null,{...r,[o]:u}},{}):{},y1=({formFields:e})=>{const t={};return e.forEach(n=>{var r,o,u,s,i,c;if(t[n.name]={},(r=n.validations)!=null&&r.isRequired&&(typeof n.validations.isRequired=="object"?t[n.name].isRequired=SI(n.validations.isRequired.msg):t[n.name].isRequired=!0),n.type==="date"){let l=typeof((o=n.validations)==null?void 0:o.disableFuture)=="object"?n.validations.disableFuture.msg:"";l=typeof((u=n.validations)==null?void 0:u.disablePast)=="object"?n.validations.disablePast.msg:l,t[n.name].validate=II(l);return}if(n.type==="number"&&((s=n.validations)!=null&&s.range)){t[n.name].validate=kI();return}if(n.type==="text"&&n.limit){t[n.name].validate=u1();return}if(n.type==="table"){const l=y1({formFields:n.columns??[]});t[n.name].validations=l}if((i=n.validations)!=null&&i.isUrl){const l=typeof n.validations.isUrl=="object"?n.validations.isUrl.msg:"";t[n.name].validate=vI(l)}else if((c=n.validations)!=null&&c.isEmail){const l=typeof n.validations.isEmail=="object"?n.validations.isEmail.msg:"";t[n.name].validate=wI(l)}}),t},ko={isMultiSelect:e=>Array.isArray(e)?e.every(t=>typeof t=="object"&&"label"in t&&"value"in t):!1,isTable:e=>Array.isArray(e)?e.some(n=>!!n[Bu.ROW_ID]):!1,isSelect:e=>!!e&&typeof e=="object"&&"label"in e,isDate:e=>!!e&&typeof e=="object"&&"toISOString"in e,isBoolean:e=>typeof e=="boolean",isAttachmentCollection:e=>!Array.isArray(e)||e.length===0?!1:e.every(t=>typeof t=="object"&&t!==null&&"tempId"in t&&"status"in t)},NL=/%[HIMSfpzZTXc]/,PL=e=>{if(e.type!=="date")return!1;const t=e.meta??{};if(t.is_epoch===!0)return!1;const n=t.format;return!(typeof n=="string"&&NL.test(n))},Su=(e,t,n,r,o,u)=>Object.keys(t).reduce((s,i)=>{const c=e.values[t[i]];let l;return o!=null&&o.has(t[i])?l=s1(ko.isAttachmentCollection(c)?c:[]):ko.isMultiSelect(c)?l=c.map(D=>D.value):ko.isTable(c)?l=c.map(({...d})=>(delete d[Bu.ROW_ID],d)).filter(d=>Object.keys(d).length>0):ko.isSelect(c)?l=c.value:ko.isDate(c)?l=u!=null&&u.has(t[i])?T8(c):c.toISOString():u!=null&&u.has(t[i])&&typeof c=="string"&&c.trim()!==""?l=T8(c):r!=null&&r.has(t[i])?l=!!c:n!=null&&n.has(t[i])?l=[]:ko.isBoolean(c)?l=c:ko.isAttachmentCollection(c)?l=s1(c):l=c||"",s[i]=l,s},{}),QL=(e,t)=>{const n={},r=new Set;let o="";for(const u of e)u.rowId?(n[u.rowId]||(n[u.rowId]=[]),n[u.rowId].push(u),r.add(u.rowId),o=""):!n[o]||n[o].length>=t?(r.add(u.name),n[u.name]=[u],o=u.name):n[o].push(u);return[...r].map(u=>({id:u,formFields:n[u]}))},vp=(e,t)=>{if(!t||!Array.isArray(e))return 0;let n=0;for(const r of e){const o=t[r.name];if(r.type==="table"&&Array.isArray(o)){let u=0;for(const s of o){const i=vp(r.columns,s);u+=i}u>0&&n++;continue}o===""||o===void 0||o===null||n++}return n},_r="/v1/api",RL=`${_r}/connectors/conversation/:conversationId/metadata`,HL=`${_r}/connectors/forms/:formId/field/:fieldName/data`,WL=`${_r}/connectors/form/:formId`,GL=`${_r}/connectors/forms/:id/link`,VL=`${_r}/connectors/forms/:id/preview`,zL=`${_r}/connectors/forms/:id/link-search`,XL=`${_r}/connectors/conversation/:conversationId/selected-email`,ZL=`${_r}/connectors/app-cf-values`,JL=`${_r}/connectors/deferred-app-cf-values`,wp=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),Ee({url:wt(`${HL}?${r.toString()}`,e),method:ve.POST,data:t})},YL=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),Ee({url:wt(`${WL}?${r.toString()}`,e),method:ve.POST,data:t})},qL=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),Ee({url:`${VL.replace(":id",e)}?${r.toString()}`,method:ve.POST,data:{args:t}})},UL="https://avatars.githubusercontent.com/u/62397590",Sp={optionsMap:null,createOptionApi:Ae.IDLE,dropdownOptionsApis:Ae.IDLE,previewCardData:null,previewCardApiStatus:Ae.IDLE,selectedSuggestionType:"basic"},Ip=rf({name:"commonSlice",initialState:Sp,reducers:{resetState:()=>Sp,resetPreviewCardData:e=>{e.previewCardData=null,e.previewCardApiStatus=Ae.IDLE},setSelectedSuggestionType:(e,t)=>{e.selectedSuggestionType=t.payload},resetDropdownOptionsCache:e=>{e.optionsMap=null,e.dropdownOptionsApis=Ae.IDLE}},extraReducers:e=>{e.addCase(Zf.pending,t=>{t.createOptionApi=Ae.LOADING}).addCase(Zf.fulfilled,(t,n)=>{const r=t.optionsMap||{},{optionsList:o,key:u}=n.payload;t.createOptionApi=Ae.IDLE,t.optionsMap={...r,[u]:{...r[u],options:o}}}).addCase(Zf.rejected,t=>{t.createOptionApi=Ae.FAILED}).addCase(To.pending,t=>{t.dropdownOptionsApis=Ae.LOADING}).addCase(To.fulfilled,(t,n)=>{const r=t.optionsMap||{},{optionsList:o,hasMore:u,currentPage:s,searchTerm:i,key:c}=n.payload;t.dropdownOptionsApis=Ae.IDLE,t.optionsMap={...r,[c]:{options:o,hasMore:u,currentPage:s,searchTerm:i}}}).addCase(To.rejected,t=>{t.dropdownOptionsApis=Ae.FAILED}).addCase(Lo.pending,t=>{t.previewCardApiStatus=Ae.LOADING}).addCase(Lo.fulfilled,(t,n)=>{const{data:r}=n.payload;r&&(t.previewCardData=r),t.previewCardApiStatus=Ae.IDLE}).addCase(Lo.rejected,t=>{t.previewCardApiStatus=Ae.FAILED})}}),Zf=$n("commonSlice/createDropDownOption",async(e,{getState:t,rejectWithValue:n})=>{var g,A,h;const{fieldName:r,label:o,formId:u,interfaceId:s,conversationId:i=null,args:c={},createArgs:l={},callback:D}=e,d=x1(c||{},u,r),{common:m}=t(),{options:b=[],...C}=((g=m.optionsMap)==null?void 0:g[d])||{};try{const E=await YL({fieldName:r,formId:s},{args:l,conversation_id:i});if(!E||!("data"in E)||!("output_variables"in E.data)||!("external_resource_id"in E.data.output_variables))throw E;const F=E.data.output_variables,{external_resource_id:x,...y}=F,v=[{label:o,value:x,prefillValues:y},...b],w=I8(v,k=>k.value);return D==null||D(w),{optionsList:w,key:d,...C}}catch(E){D==null||D(b);const F=E,x=(A=F==null?void 0:F.response)==null?void 0:A.data,y=typeof x=="string"?x:(x==null?void 0:x.message)||Lr;return Ge({message:y,type:dt}),n((h=F==null?void 0:F.response)==null?void 0:h.status)}}),To=$n("commonSlice/fetchDropDownOptions",async(e,{getState:t,rejectWithValue:n})=>{var v,w,k;const{fieldName:r,formId:o,searchTerm:u,fieldConfig:s,callback:i,args:c={},interfaceId:l="",pagination:D={enabled:!1},controller:d}=e,m=x1(c||{},o,r),{common:b}=t();let C=!1;s.meta&&"showAvatar"in s.meta&&typeof s.meta.showAvatar=="boolean"&&(C=s.meta.showAvatar);const g=((v=b.optionsMap)==null?void 0:v[m])||{},A=!e.isScrollToBottomEvent&&(!g||u!==g.searchTerm),h=A?[]:g.options||[],E=A?!0:g.hasMore??!0,F=A?0:g.currentPage??0,{enabled:x,limit:y}=D,S=y||10;try{let O;const j=d==null?void 0:d.signal,T=x?{pageNumber:F+1,searchTerm:u,limit:S,enabled:x}:null;if(E&&(O=await wp({fieldName:r,formId:o},{pagination:T||{},args:c,interfaceId:l})),j!=null&&j.aborted)throw j.reason;if(!O||!O.data||!("data"in O.data)||!Array.isArray(O.data.data)||!O.data.data.length){const{common:z}=t(),V=((w=z.optionsMap)==null?void 0:w[m])||{};return i==null||i(V.options??[]),{...V,optionsList:V.options??[],key:m,hasMore:!1}}const M=O.data.data.map(z=>C?{...z,avatarUrl:z.avatarUrl||UL}:(delete z.avatarUrl,z)),_=[...h,...M],P=x?M.length>=S:!1,G=I8(_,z=>z.value);return i==null||i(G),{optionsList:G,fieldName:r,formId:o,searchTerm:u,currentPage:F+1,hasMore:P,key:m}}catch(O){const{common:j}=t(),T=((k=j.optionsMap)==null?void 0:k[m])||{};return i==null||i(T.options??[],{isError:!0}),n(O)}},{condition:(e,{getState:t})=>{var d;if(e.isScrollToBottomEvent)return!0;const{fieldName:n,formId:r,searchTerm:o,callback:u,args:s}=e,i=x1(s||{},r,n),{common:c}=t(),l=(d=c.optionsMap)==null?void 0:d[i];if((l==null?void 0:l.searchTerm)!==o)return!0;const D=(l==null?void 0:l.options)||[];return D&&D.length?(u==null||u(D),!1):!0}}),Lo=$n("commonSlice/previewCard",async({id:e,args:t,channelType:n,isRefresh:r},{rejectWithValue:o})=>{var u;try{const s=await qL(e,t,n),i=s==null?void 0:s.data;return i?(r&&Ge({message:_A,type:Rn}),{data:U0(i)}):(r&&Ge({message:MA,type:dt}),{data:null})}catch(s){return o({status:(u=s.response)==null?void 0:u.status})}}),{resetState:EY,resetPreviewCardData:jr,setSelectedSuggestionType:KL,resetDropdownOptionsCache:$L}=Ip.actions,eO=Ip.reducer,nr="/v1/api",tO=`${nr}/connectors/forms/list`,nO=`${nr}/connectors/cards/:id/unlink`,rO=`${nr}/connectors/forms/:id/link`,oO=`${nr}/connectors/form/:formId`,uO=`${nr}/connectors/forms/:formId/data`,aO=`${nr}/connectors/forms/:formId/get_forms_custom_fields`,sO=`${nr}/connectors/forms/:formId/field/:fieldName/custom_fields`,kp=`${nr}/connectors/forms/:formId/defaults`,fO=`${nr}/connectors/forms/:formId/default-values`,iO=`${nr}/connectors/conversation-summary`,cO=`${nr}/connectors/attachments`,lO=({inboxIds:e,channelType:t,conversationId:n,connectorId:r})=>{const o=new URLSearchParams;return e.forEach(u=>o.append("inbox_ids",u)),o.append("channel_type",t),o.append("conversation_id",String(n)),r&&o.append("connector_id",String(r)),Ee({url:`${tO}?${o.toString()}`,method:ve.GET})},Tp=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),Ee({url:wt(`${oO}?${r.toString()}`,e),method:ve.POST,data:t})},DO=(e,t="email",n,r)=>{const o=new URLSearchParams;return o.append("channel_type",t),Ee({url:`${nO.replace(":id",e)}?${o.toString()}`,method:ve.POST,data:{externalResourceId:n,conversationId:r}})},dO=(e,t,n="email",r,o)=>{const u=new URLSearchParams;return u.append("channel_type",n),o&&u.append("senderEmail",o),Ee({url:`${rO.replace(":id",e)}?${u.toString()}`,method:ve.POST,data:{externalResourceId:t,conversationId:r}})},AO=(e,t="email",n,r,o)=>{const u=new URLSearchParams;return u.append("channel_type",t),u.append("conversation_id",String(n||"")),u.append("senderEmail",o),u.append("externalResourceId",r),Ee({url:`${uO.replace(":formId",e)}?${u.toString()}`,method:ve.GET})},pO="Error in previewing the card",gO="Object not found",B1="Link format isn't recognized. Please check that you've entered a valid URL",Lp="Item already linked",Op="Card linked successfully",Mp="Error in linking the card",CO="New card created",hO="Created successfully",FO="Card creation failed",mO="Create and link objects from different apps to this conversation",EO="Are you sure you want to change the primary object?",bO="Changing the primary object will reset all the information you’ve entered and all data will be lost and can’t be recovered.",xO="Are you sure you want to leave?",yO=`If you go back now, all the information you’ve entered will be lost and can’t be recovered.
|
|
2681
|
-
Do you want to continue?`,BO="Select an object to create",_p="Select an object to link",v1="Select object",jp="Paste URL or ID",Np="Object ID/Link",vO="Card updated",wO="Card updation failed",SO="These attachments expired and could not be added — please re-upload:",Pp=3,IO="Pre-fill fields",kO="Variables linked to inbox may not be available as conversation is linked to multiple inboxes.",Jf=(e,t)=>{var r,o,u,s,i,c,l,D,d,m,b,C,g,A,h,E,F,x;if(e.fieldAccessMode==="no_access")return{...e,type:"text",disabled:!0,isClearable:!1,placeholder:"No access",validations:{},...t,value:void 0,defaultValue:void 0};let n={};switch(e.type){case"select":case"reference":case"multi-select":{n={...e,defaultOptions:!!e.interfaceDetails,isInfiniteScrollable:((o=(r=e.interfaceDetails)==null?void 0:r.pagination)==null?void 0:o.enabled)||!1,loadOptionsOnFocus:Object.keys(((u=e.interfaceDetails)==null?void 0:u.args)||{}).length>0,isMultiSelect:e.type==="multi-select",isMulti:e.type==="multi-select"&&!!e.interfaceDetails,type:e.interfaceDetails?"async-select":"select",isClearable:((s=e.meta)==null?void 0:s.isClearable)??!0};break}case"date":{n={...e,type:"date",disablePast:!!((i=e.validations)!=null&&i.disablePast)||!1,disableFuture:!!((c=e.validations)!=null&&c.disableFuture)||!1};break}case"number":{n={...e,type:"number",min:((D=(l=e.validations)==null?void 0:l.range)==null?void 0:D.min)||Number.MIN_SAFE_INTEGER,max:((m=(d=e.validations)==null?void 0:d.range)==null?void 0:m.max)||Number.MAX_SAFE_INTEGER};break}case"multiline":{n={...e,type:"text",maxRows:((b=e.validations)==null?void 0:b.maxRows)||5,limit:(C=e.validations)==null?void 0:C.maxCharacters,rows:5,multiline:!0};break}case"text":{n={...e,type:"text",limit:(g=e.validations)==null?void 0:g.maxCharacters};break}case"checkbox":{n={...e,type:"checkbox",value:!!e.value};break}case"attachment":{const y=(A=e.meta)==null?void 0:A.excludedTypes;n={...e,type:"attachment",meta:{...e.meta??{},maxFiles:((h=e.meta)==null?void 0:h.maxFiles)??10,maxFileSizeMb:((E=e.meta)==null?void 0:E.maxFileSizeMb)??25,acceptedTypes:((F=e.meta)==null?void 0:F.acceptedTypes)??"*",excludedTypes:Array.isArray(y)?y.filter(S=>typeof S=="string"):[],fieldKey:e.key??e.name,supportsDelete:((x=e.meta)==null?void 0:x.supportsDelete)??!0},value:e.value??[]};break}default:n={...e}}return"value"in n&&(n.defaultValue=n.value,delete n.value),{...n,...t}},Qp=rf({name:"writeCapability",initialState:xp,reducers:{resetState:()=>xp,resetCurrentResourceDetails:e=>{e.currentResourceDetails=null,e.currentResourceDetailsApiStatus=Ae.IDLE},setCurrentCardInEdit:(e,t)=>{e.currentCardInEdit=t.payload},setHasUnsavedChanges:(e,t)=>{e.hasUnsavedChanges=t.payload}},extraReducers:e=>{e.addCase(Yf.pending,t=>{t.objectListApiStatus=Ae.LOADING}).addCase(Yf.fulfilled,(t,n)=>{const{createObjectList:r,createObjectConnectorNamesList:o,linkObjectList:u,editObjectList:s,searchObjectList:i,formFields:c,objectDict:l,dependentFieldsMap:D}=n.payload;t.objectListApiStatus=Ae.IDLE,t.createObjectList=r,t.createObjectConnectorNamesList=o,t.linkObjectList=u,t.editObjectList=s,t.searchObjectList=i,t.formFields=c,t.objectDict=l,t.dependentFieldsMap=D}).addCase(Yf.rejected,t=>{t.objectListApiStatus=Ae.FAILED}).addCase(To.pending,t=>{t.dropdownOptionsApis=Ae.LOADING}).addCase(To.fulfilled,(t,n)=>{const r=t.optionsMap||{},{optionsList:o,hasMore:u,currentPage:s,key:i}=n.payload;t.dropdownOptionsApis=Ae.IDLE,t.optionsMap={...r,[i]:{options:o,hasMore:u,currentPage:s}}}).addCase(To.rejected,t=>{t.dropdownOptionsApis=Ae.FAILED}).addCase(qf.pending,t=>{t.createFormApiStatus=Ae.LOADING}).addCase(qf.fulfilled,t=>{t.createFormApiStatus=Ae.IDLE}).addCase(qf.rejected,t=>{t.createFormApiStatus=Ae.FAILED}).addCase(Ha.pending,t=>{t.linkCardApiStatus=Ae.LOADING}).addCase(Ha.fulfilled,t=>{t.linkCardApiStatus=Ae.IDLE}).addCase(Ha.rejected,t=>{t.linkCardApiStatus=Ae.FAILED}).addCase(Kf.pending,t=>{t.unlinkCardApiStatus=Ae.LOADING}).addCase(Kf.fulfilled,t=>{t.unlinkCardApiStatus=Ae.IDLE}).addCase(Kf.rejected,t=>{t.unlinkCardApiStatus=Ae.FAILED}).addCase(Uf.pending,t=>{t.updateFormApiStatus=Ae.LOADING}).addCase(Uf.fulfilled,t=>{t.updateFormApiStatus=Ae.IDLE}).addCase(Uf.rejected,t=>{t.updateFormApiStatus=Ae.FAILED}).addCase($f.pending,t=>{t.currentResourceDetailsApiStatus=Ae.LOADING}).addCase($f.fulfilled,(t,n)=>{const{data:r}=n.payload;r&&(t.currentResourceDetails=r),t.currentResourceDetailsApiStatus=Ae.IDLE}).addCase($f.rejected,t=>{t.currentResourceDetailsApiStatus=Ae.FAILED})}}),Yf=$n("writeCapability/fetchObjectList",async e=>{const{inboxIds:t,channelType:n,conversationId:r,isExpandedFormEnabled:o,connectorId:u}=e,s=await lO({inboxIds:t,channelType:n,conversationId:r,connectorId:u});if(!s||!s.data||!("formsList"in s.data)||!Array.isArray(s.data.formsList))return{createObjectList:[],createObjectConnectorNamesList:[],linkObjectList:[],editObjectList:[],searchObjectList:[],formFields:null,objectDict:null,dependentFieldsMap:{}};const i=s.data.formsList,c={},l=[],D=[],d=[],m=[],b=[],C={},g={};return i==null||i.forEach(A=>{var E,F;if(A.expandedView&&!o)return;const h=yp({...A});"fieldList"in h&&delete h.fieldList,g[A.id]=h,c[A.id]||(c[A.id]={}),C[A.id]||(C[A.id]=[]),A.type==="create"&&A.authenticated?(l.push({value:A.id,label:A.name,avatarUrl:A.logoUrl,connectorKey:A.connectorName,connectorId:A.connectorId}),A.connectorName&&!D.includes(A.connectorName)&&D.push(A.connectorName)):A.type==="link"&&A.authenticated?d.push({value:A.id,label:A.name,avatarUrl:A.logoUrl}):A.type==="edit"&&A.authenticated?m.push({value:A.id,label:A.name,avatarUrl:A.logoUrl}):A.type==="search_and_link"&&A.authenticated&&b.push({value:A.id,label:A.name,avatarUrl:A.logoUrl}),(E=A.fieldList)==null||E.sort((x,y)=>x.priority-y.priority),(F=A.fieldList)==null||F.forEach(x=>{const y=Jf(x);if(y.columns&&(y.columns=y.columns.map(S=>Jf(S,{loadOptionsOnFocus:!0,defaultOptions:!1}))),C[A.id]=[...C[A.id],y],x.interfaceDetails&&(x.interfaceDetails.args||x.interfaceDetails.optionalArgs)){const S={...x.interfaceDetails.args,...x.interfaceDetails.optionalArgs};Object.values(S).forEach(v=>{c[A.id][v]?c[A.id][v]=[...c[A.id][v],x.name]:c[A.id][v]=[x.name]})}})}),{createObjectList:l,createObjectConnectorNamesList:D,linkObjectList:d,editObjectList:m,searchObjectList:b,formFields:C,objectDict:g,dependentFieldsMap:c}}),Rp=e=>{var o;const t=(o=e==null?void 0:e.response)==null?void 0:o.data;if(!t)return[];const n=t.error??{},r=[t.failedAttachmentIds,t.invalidAttachmentIds,t.expiredAttachmentIds,t.failedIds,t.attachmentIds,t.attachments,n.attachmentIds,n.attachments];for(const u of r)if(Array.isArray(u)&&u.length>0)return u.map(s=>typeof s=="string"?s:s&&typeof s=="object"&&"attachmentId"in s?String(s.attachmentId):"").filter(Boolean);return[]},Hp=(e,t)=>{const n=e.map(r=>(t==null?void 0:t[r])??r);return`${SO} ${n.join(", ")}`},qf=$n("writeCapability/createForm",async(e,{rejectWithValue:t})=>{var d,m;const{formId:n,successCallback:r,failureCallback:o,args:u={},interfaceId:s,conversationId:i,attachmentIdToName:c,objectName:l,namedToast:D=!1}=e;try{await Tp({formId:n},{args:u,interfaceId:s,conversationId:i}),r==null||r();const b=D?l?`${l} created`:hO:CO;Ge({message:b,type:Rn})}catch(b){const C=b;if(o==null||o(b),((d=C==null?void 0:C.response)==null?void 0:d.status)===422){const h=Rp(C);return Ge({message:Hp(h,c),type:dt}),t(b)}const g=(m=C==null?void 0:C.response)==null?void 0:m.data,A=(g==null?void 0:g.message)??FO;return Ge({message:A,type:dt}),t(b)}}),Uf=$n("writeCapability/updateForm",async(e,{rejectWithValue:t})=>{var d;const{formId:n,successCallback:r,failureCallback:o,args:u={},interfaceId:s,conversationId:i,externalResourceId:c,previousArgs:l={},attachmentIdToName:D}=e;try{await Tp({formId:n},{args:u,interfaceId:s,conversationId:i,externalResourceId:c,previousArgs:l}),r==null||r(),Ge({message:vO,type:Rn})}catch(m){const b=m;if(o==null||o(m),((d=b==null?void 0:b.response)==null?void 0:d.status)===422){const C=Rp(b);return Ge({message:Hp(C,D),type:dt}),t(m)}return Ge({message:wO,type:dt}),t(m)}}),Kf=$n("writeCapability/unlinkCard",async({id:e,channelType:t,externalResourceId:n,conversationId:r})=>{await DO(e,t,n,r)}),Ha=$n("writeCapability/linkCard",async({id:e,externalResourceId:t,channelType:n,conversationId:r,email:o},{rejectWithValue:u})=>{var s;try{await dO(e,t,n,r,o)}catch(i){return u({status:(s=i.response)==null?void 0:s.status})}}),$f=$n("connectorCardLibrary/fetchCurrentResourceDetails",async(e,{rejectWithValue:t})=>{const{id:n,channelType:r,conversationId:o,externalResourceId:u,contactEmail:s}=e;try{const i=await AO(n,r,o,u,s),c=i==null?void 0:i.data,l=i==null?void 0:i.status,D={values:{},errors:{}};return Object.entries(c.formData).forEach(([d,m])=>{if(m.type==="attachment"){const b=Array.isArray(m.value)?m.value:[];D.values[d]=b.map(C=>({tempId:`existing-${C.attachmentId}`,attachmentId:C.attachmentId,filename:C.filename,size:C.size??0,mimeType:C.mimeType??"",url:C.url,status:"done",isExisting:!0}))}else if(m.type==="checkbox")D.values[d]=P8(m.value??m.label);else if("label"in m)if(m.type&&m.type==="date"){const b=Array.isArray(m.label)?m.label[0]:m.label;D.values[d]=b?new Date(parseInt(b)).toISOString():""}else m.type&&m.type==="multi-select"?D.values[d]=N8(m.value,m.label):m.value?D.values[d]={value:m.value,label:m.label}:D.values[d]=m.label}),{data:D,status:l}}catch(i){return Ge({message:Lr,type:dt}),t(i)}}),{resetState:bY,setCurrentCardInEdit:Oo,resetCurrentResourceDetails:TO,setHasUnsavedChanges:Mo}=Qp.actions,LO=Qp.reducer,OO=()=>{const[e,t]=p.useState(null),[n,r]=p.useState({isVertical:!1,isHorizontal:!1,isScrolling:!1}),o=p.useCallback(u=>{t(u)},[]);return p.useEffect(()=>{if(!e)return;e.dataset.prevScrollLeft="0",e.dataset.prevScrollTop="0";let u=null;const s=100;let i=null;const c=150,l=D=>{u||(u=window.setTimeout(()=>{const d=D.target,m=Number(e.dataset.prevScrollLeft)||0,b=Number(e.dataset.prevScrollTop)||0,C=d.scrollLeft,g=d.scrollTop,A=C-m,h=g-b,E=Math.abs(h)>Math.abs(A),F=Math.abs(A)>Math.abs(h);r({isVertical:E,isHorizontal:F,isScrolling:!0}),e.dataset.prevScrollLeft=String(C),e.dataset.prevScrollTop=String(g),u=null},s),i&&window.clearTimeout(i),i=window.setTimeout(()=>{r(d=>({...d,isScrolling:!1})),i=null},c))};return e.addEventListener("scroll",l),()=>{e.removeEventListener("scroll",l),u&&window.clearTimeout(u),i&&window.clearTimeout(i)}},[e]),[n,o]},MO=e=>I.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M5.8016 11.709L12.3416 5.16893L11.4298 4.25712L4.88979 10.7972V11.709H5.8016ZM6.33618 12.9987H3.6001V10.2626L10.9739 2.88875C11.0948 2.76786 11.2588 2.69995 11.4298 2.69995C11.6008 2.69995 11.7648 2.76786 11.8857 2.88875L13.71 4.71302C13.8309 4.83395 13.8988 4.99794 13.8988 5.16893C13.8988 5.33992 13.8309 5.50391 13.71 5.62484L6.33618 12.9987ZM3.6001 14.2884H15.2073V15.578H3.6001V14.2884Z",fill:"var(--connector-neutral-icon, #6C7B94)"})),Wp=/^No\s.+\sfound\sfor\s(email|Email)\s.+@.+\..+$/,_O=e=>!!e&&/^No\s.+\sfound\sfor\s/.test(e),ei=e=>typeof e=="boolean"?e?"Yes":"No":String(e),Gp=e=>{const t=/\(Error code: (.*?)\)$/,n=e.match(t),r=n?n[1]:null,o=n?e.replace(t,"").trim():e;return{error_code:r,error_message:o}},jO=(e,t)=>`${v3} (Error code: ${e})`.replace(/{{connector_name}}/g,(t==null?void 0:t[0])||""),NO=(e,t)=>{const{error_code:n,error_message:r}=Gp(e);return n===zE&&t?XE:r},PO=e=>{var n,r,o,u;const t=e.data;return e.cardType==="flat"?((n=t==null?void 0:t.flatDisplay)==null?void 0:n.data)??[]:((u=(o=(r=t==null?void 0:t.listItems)==null?void 0:r.fields)==null?void 0:o[0])==null?void 0:u.data)??[]},Vp=e=>!!(e!=null&&e.activeLookupParam)&&!e.cardErrorMessage&&!PO(e).length,zp=e=>!!(e!=null&&e.activeLookupParam)&&!!e.cardErrorMessage,QO=(e,t,n)=>{var l,D,d,m,b;const r=e.externalResourceId?`${e.id}_${e.externalResourceId}`:e.id,o=t==null?void 0:t[r];if(!o||Vp(o))return!0;if(zp(o))return!1;const u=o.cardType==="flat",s=(l=t==null?void 0:t[r])==null?void 0:l.data,i=u&&((D=s==null?void 0:s.flatDisplay)!=null&&D.data)?s.flatDisplay.data:!u&&((b=(m=(d=s==null?void 0:s.listItems)==null?void 0:d.fields)==null?void 0:m[0])!=null&&b.data)?s.listItems.fields[0].data:[],c=o.cardErrorMessage;return c&&Wp.test(c)?!0:!Xp(e,t,n)&&!i.length},Xp=(e,t,n)=>{var D,d;const r=e.externalResourceId?`${e.id}_${e.externalResourceId}`:e.id,o=t==null?void 0:t[r];if(!o)return!1;if(zp(o))return!0;const s=o.cardType==="flat"||(d=(D=o.data)==null?void 0:D.listItems)==null?void 0:d.errorMessage,i=(n==null?void 0:n[r])===Ae.FAILED,c=o.cardErrorMessage,l=c&&Wp.test(c);return i||s||c&&!l};function RO(e,t,n){const r={},o={};let u=0,s=0;for(const c of e){const l=c.externalResourceId?`${c.id}_${c.externalResourceId}`:c.id,D=t==null?void 0:t[l],d=(D==null?void 0:D.connectorNames)??[];for(const m of d)r[m]||(r[m]=[],o[m]={cards_visible:0,empty_cards:0,cards_with_error:0,card_key:[],card_title:[]}),r[m].push(c),o[m].cards_visible+=1,o[m].card_key.push(c.id),o[m].card_title.push(c.title),QO(c,t,n)&&(o[m].empty_cards+=1,u+=1),Xp(c,t,n)&&(o[m].cards_with_error+=1,s+=1)}return{cards_per_app:Object.entries(o).map(([c,l])=>({app_name:c,...l})),total_empty_cards:u,total_cards_with_errors:s}}const HO=({data:e,title:t,currentCard:n,setShowModal:r})=>{const o=Zt(),{sendTrackingEvent:u,currentSmIds:s}=p.useContext(Ue),{userGroupId:i}=an()||{},[c,l]=OO(),{isScrolling:D,isVertical:d}=c,m=D&&d,b=p.useMemo(()=>(e==null?void 0:e[0].data.map(h=>h.label))||[],[e]),C=p.useMemo(()=>e.map(h=>{const E={cells:{},externalResourceId:h.externalResourceId};return h.data.forEach((F,x)=>{if(b[x]){let y=F.value==null||F.value===void 0||F.value===""?gr:Array.isArray(F.value)?F.value.map(S=>typeof S=="object"&&S!==null?S.filename:ei(S)).join(", "):ei(F.value);if(y&&y!==gr&&F.type==="date"){const S=new Date(parseInt(y));y=isNaN(S.getTime())?gr:S.toLocaleDateString(navigator.language)}E.cells[b[x]]={label:y,deepLink:F==null?void 0:F.deepLink}}}),E}),[e,b]),g=(h,E)=>a.jsx(zb,{align:"left",children:h.deepLink?a.jsx(f.Link,{target:"_blank",underline:"none",href:h.deepLink,children:h.label}):a.jsx(f.Typography,{variant:"body2",sx:{color:"var(--connector-text-primary)"},children:h.label})},`${E}_${h.label}`),A=h=>{!h||!n||(r(!1),u(f3,{card_title:n.title,connector_name:n.connectorName,ug_id:i,sm_ids:s}),o(Oo({...n,externalResourceId:h})))};return a.jsxs(f.Stack,{maxHeight:"340px",maxWidth:"700px",padding:"32px 0px 32px 32px",overflow:"auto",children:[a.jsx(f.Typography,{variant:"h2",sx:{color:"var(--connector-text-primary)"},marginBottom:"16px",children:t}),a.jsx(f.TableContainer,{ref:l,children:a.jsxs(f.Table,{stickyHeader:!0,children:[a.jsx(Wb,{children:a.jsxs(f.TableRow,{children:[b.map(h=>a.jsx(Gb,{sx:{whiteSpace:"nowrap"},children:a.jsx(f.Typography,{variant:"overline",sx:{color:"var(--connector-caption-text)"},children:h})},h)),a.jsx(Zb,{})]})}),a.jsx(f.TableBody,{children:C.map((h,E)=>a.jsxs(Vb,{children:[Object.values(h.cells).map((F,x)=>g(F,x)),a.jsx(Xb,{children:!m&&h.externalResourceId&&a.jsx(f.Tooltip,{title:y3,placement:"bottom",children:a.jsx(f.IconButton,{className:"row-edit",onClick:()=>A(h.externalResourceId),children:a.jsx(MO,{"aria-hidden":!0})})})})]},`id_${E}`))})]})})]})},Zp=e=>e.cardList.connectorCards,WO=e=>e.cardList.connectorsEnabled,GO=e=>e.cardList.connectorApiStatus,VO=e=>e.cardList.cardSpecificData,zO=e=>e.cardList.specificConnectorApiStatus,XO=e=>e.cardList.specificConnectorErrorCode,ZO=e=>e.cardList.cardLookupKey,JO=e=>e.cardList.prefilledCardKeys,ti=e=>e.cardList.relatedLookup,YO=e=>{const{connectorApiStatus:t,specificConnectorApiStatus:n}=e.cardList;return t!==Ae.IDLE||!n?!1:Object.values(n).every(r=>r===Ae.IDLE||r===Ae.FAILED)},qO="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%204.8675L14.6475%2014.625H3.3525L9%204.8675ZM9%201.875L0.75%2016.125H17.25L9%201.875Z'%20fill='%23F07530'/%3e%3cpath%20d='M9.75%2012.375H8.25V13.875H9.75V12.375Z'%20fill='%23F07530'/%3e%3cpath%20d='M9.75%207.875H8.25V11.625H9.75V7.875Z'%20fill='%23F07530'/%3e%3c/svg%3e",UO=e=>new Promise(t=>setTimeout(t,e)),ni=({apiFn:e,intervalMillis:t,maxRetries:n,increaseIntervalMillis:r=0,intervalsMillis:o,isSatisfied:u,pushIntermediateResults:s=()=>{}})=>(...c)=>{const l=async(D=0)=>{const d=await e(...c);if(u(d))return d;if(s(d),D>=n)throw d;D++;let m;return o&&o.length>0?m=o[Math.min(D-1,o.length-1)]:(t+=r,m=t),UO(m).then(()=>l(D))};return l()},_o="/v1/api",KO=`${_o}/connectors/cards`,$O=`${_o}/connectors/cards/:id/data`,eM=`${_o}/connector/conversation/:conversationId/id_lookup_options`,tM=`${_o}/connectors/cards/:cardId/related-records`,nM=[[1e4,1500],[3e4,3e3],[1/0,1e4]],rM=6e5,oM=2e3,uM=`${_o}/connectors/cards/:cardId/attachment-data`,aM=[2e3,5e3,1e4,15e3,2e4],sM=5,fM=`${_o}/connectors/:connectorId/user-auth/status`,iM=`${_o}/connectors/:connectorId/user-auth/start`,cM=async({cardId:e,key:t,conversationId:n,externalResourceId:r})=>{const o=new URLSearchParams;r&&o.append("externalResourceId",r),o.append("conversation_id",String(n??"")),o.append("key",t);const u=await Ee({url:`${uM.replace(":cardId",e)}?${o.toString()}`,method:ve.GET});return u==null?void 0:u.data},lM=e=>(e==null?void 0:e.completed)===!0,DM=({cardId:e,key:t,conversationId:n,externalResourceId:r,enabled:o=!0,pollIntervals:u=aM,maxCalls:s=sM})=>{const i=vt(),c=o&&!!e&&!!t&&n!=null,{queryKey:l,polledAttachmentData:D}=p.useMemo(()=>{const d=["connector-cards","attachment-data",e,r??"",n,t],m=ni({apiFn:cM,intervalMillis:u[0]??0,intervalsMillis:u,maxRetries:Math.max(0,s-1),isSatisfied:lM,pushIntermediateResults:b=>{b&&i.setQueryData(d,b)}});return{queryKey:d,polledAttachmentData:m}},[i,e,r,n,t,u,s]);return Ct({queryKey:l,queryFn:()=>D({cardId:e,key:t,conversationId:n,externalResourceId:r}),enabled:c,refetchOnWindowFocus:!1,staleTime:1/0,refetchOnMount:"always",retry:!1})},dM=`
|
|
2680
|
+
`,FL=e=>e,mL=({open:e,targetRef:t,endElRef:n,padding:r=8,zIndex:o=1300,renderHighlight:u=FL,onClose:s})=>{const[i,c]=p.useState(null);if(p.useEffect(()=>{if(!e){c(null);return}const D=t.current;if(!D){c(null);return}const d=(n==null?void 0:n.current)||D,m=D.getBoundingClientRect(),b=d.getBoundingClientRect(),C=window.innerWidth,g=window.innerHeight,A=Math.max(0,m.left-r),h=Math.max(0,m.top-r),E=Math.min(g,m.bottom+r),F=Math.min(C,b.right+r),x=Math.max(0,F-A),y=Math.max(0,E-h);if(!x||!y){c(null);return}c({top:h,left:A,width:x,height:y,right:F,bottom:E})},[e,r,t,n]),!e||!i||typeof document>"u")return null;const l=a.jsx(hL,{top:i.top,left:i.left,width:i.width,height:i.height,onClick:D=>D.stopPropagation()});return Nt.createPortal(a.jsx(CL,{zIndex:o,onClick:s,children:u(l)}),document.body)},en="logEmailsAsComments",EL="Log email as a comment",bL="Keep email replies in sync with this monday.com task",xL="Sync conversation is already enabled for :appName",yL=e=>xL.replace(":appName",e),h1=e=>!!(e!=null&&e.some(t=>t.name===en&&t.type==="checkbox")),hp=p.createContext(null),BL=()=>a.jsx(a.Fragment,{children:p.useContext(hp)}),vL=p.memo(function(){return a.jsx(f.HiverCacheProvider,{speedy:!0,children:a.jsx(BL,{})})}),Fp=({children:e,...t})=>a.jsx(hp.Provider,{value:a.jsx(f.HiverThemeProvider,{...t,children:e}),children:a.jsx(vL,{})}),wL={connectorFontFamily:tr,typography:{fontFamily:tr},components:{MuiTypography:{styleOverrides:{root:{fontFamily:`${tr} !important`}}},MuiButton:{styleOverrides:{root:{fontFamily:`${tr} !important`}}},MuiInputBase:{styleOverrides:{root:{fontFamily:`${tr} !important`}}},MuiInputLabel:{styleOverrides:{root:{fontFamily:`${tr} !important`}}},MuiFormLabel:{styleOverrides:{root:{fontFamily:`${tr} !important`}}},MuiMenuItem:{styleOverrides:{root:{fontFamily:`${tr} !important`}}},MuiChip:{styleOverrides:{root:{fontFamily:`${tr} !important`}}},MuiTooltip:{styleOverrides:{tooltip:{fontFamily:`${tr} !important`}}}}},SL=e=>f.createTheme(e,wL),IL={display:"contents",fontFamily:tr},mp=({enabled:e,children:t})=>e?a.jsx(f.ThemeProvider,{theme:SL,children:a.jsx("div",{"data-omni-font":"",style:IL,children:t})}):a.jsx(a.Fragment,{children:t}),Ep="#5B5D60",vu="connector-rich-tooltip",Vf={light:{canvas:"#FFFFFF",surface:"#FFFFFF",surfaceSubtle:"#F6F8FC",surfaceElevated:"#FFFFFF",surfaceHover:"#F6F8FC",surfaceActive:"#ECEFF6",previewHeader:"#FFFFFF",tooltipSurface:"#FFFFFF",tooltipText:"#343C45",border:"#ECEFF6",borderStrong:"#D6DDE8",textPrimary:"#343C45",textSecondary:"#4D596C",textTertiary:"#6F7C90",textMuted:"#97A3B7",textDisabled:"#97A3B7",iconPrimary:"#4D596C",iconSecondary:"#6F7C90",iconTertiary:"#3E4C5A",iconDisabled:"#97A3B7",iconAccent:"#506DFF",accent:"#506DFF",accentHover:"#4763F0",accentSubtle:"#E5EAFF",primaryAction:"#506DFF",primaryActionHover:"#4763F0",primaryActionActive:"#4763F0",inputBackground:"#FFFFFF",inputFilledBackground:"#FFFFFF",inputDisabledBackground:"#ECEFF6",inputBorder:"#D6DDE8",inputBorderHover:"#6F7C90",inputBorderFocus:"#506DFF",inputBorderInvalid:"#CD3746",inputText:"#343C45",inputDisabledText:"#97A3B7",inputPlaceholder:"#97A3B7",inputShadow:"none",shadowSubtle:"rgba(0, 0, 0, 0.12)",shadowStrong:"rgba(0, 0, 0, 0.18)",dropdownShadow:"0px 3px 15px 0px rgba(0, 0, 0, 0.25)",overlayBackdrop:"rgba(15, 23, 42, 0.45)",negative:"#CD3746",success:"#00BC7E",onAccent:"#FFFFFF"},dark:{canvas:"#0B0C0D",surface:"#171819",surfaceSubtle:"#101112",surfaceElevated:"#171819",surfaceHover:"rgba(255, 255, 255, 0.04)",surfaceActive:"rgba(255, 255, 255, 0.07)",previewHeader:"#171819",tooltipSurface:"#DCDDDF",tooltipText:"#0B0C0D",border:"#212224",borderStrong:"#292A2C",textPrimary:"#DCDDDF",textSecondary:"#D1D2D5",textTertiary:"#9FA1A6",textMuted:"#7A7C81",textDisabled:"#5B5D60",iconPrimary:"#D1D2D5",iconSecondary:"#7A7C81",iconTertiary:"#5B5D60",iconDisabled:"#3D3E41",iconAccent:"#6089F4",accent:"#6089F4",accentHover:"#3B6CE8",accentSubtle:"rgba(96, 137, 244, 0.12)",primaryAction:"#2652CC",primaryActionHover:"#143BB5",primaryActionActive:"#0B279C",inputBackground:"#171819",inputFilledBackground:"#1B1C1E",inputDisabledBackground:"#101112",inputBorder:"#212224",inputBorderHover:"#3D3E41",inputBorderFocus:"#5B5D60",inputBorderInvalid:"#E42525",inputText:"#DCDDDF",inputDisabledText:"#7A7C81",inputPlaceholder:"#9FA1A6",inputShadow:"0 1px 2px rgba(0, 0, 0, 0.24)",shadowSubtle:"rgba(0, 0, 0, 0.28)",shadowStrong:"rgba(0, 0, 0, 0.45)",dropdownShadow:"0 6px 14px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.04)",overlayBackdrop:"rgba(23, 24, 25, 0.45)",negative:"#D96D71",success:"#2DBB6D",onAccent:"#FFFFFF"}},F1=({mode:e,tokens:t})=>({...Vf[e],...t}),m1=(e,t)=>({"--connector-canvas":t.canvas,"--connector-map-form-background":e==="light"?t.canvas:t.surfaceElevated,...e==="dark"?{"--connector-map-form-field-background":t.inputFilledBackground,"--connector-map-form-field-border":t.borderStrong,"--connector-map-form-table-border":t.borderStrong,"--connector-map-form-row-border":t.border,"--connector-map-form-header-text-color":t.textSecondary,"--connector-map-form-header-icon-background":t.surfaceActive,"--connector-map-form-header-icon-color":t.iconSecondary,"--connector-map-form-add-icon-color":t.textTertiary,"--connector-map-form-label-color":t.textTertiary,"--connector-map-form-arrow-color":t.textDisabled,"--connector-map-form-dropdown-icon-color":t.iconSecondary}:{},"--connector-surface":t.surface,"--connector-surface-subtle":t.surfaceSubtle,"--connector-surface-elevated":t.surfaceElevated,"--connector-surface-hover":t.surfaceHover,"--connector-surface-active":t.surfaceActive,"--connector-dropdown-option-selected":e==="light"?t.surfaceHover:t.surfaceActive,"--connector-search-option-selected":e==="light"?t.accentSubtle:t.surfaceActive,"--connector-segmented-selected-background":e==="light"?t.accentSubtle:t.surfaceElevated,"--connector-segmented-selected-text":e==="light"?t.accent:t.textPrimary,"--connector-segmented-inactive-text":e==="light"?t.textSecondary:t.textTertiary,"--connector-thread-card-background":e==="light"?t.surfaceSubtle:t.surfaceHover,"--connector-modal-surface":e==="light"?t.surface:t.surfaceSubtle,"--connector-preview-header":t.previewHeader,"--connector-tooltip-surface":t.tooltipSurface,"--connector-tooltip-text":t.tooltipText,"--connector-modal-backdrop":e==="light"?"rgba(0, 0, 0, 0.5)":`color-mix(in srgb, ${t.canvas} 40%, transparent)`,"--connector-border":t.border,"--connector-border-strong":t.borderStrong,"--connector-text-primary":t.textPrimary,"--connector-text-secondary":t.textSecondary,"--connector-slack-message-body-text":e==="light"?t.textPrimary:t.textSecondary,"--connector-text-tertiary":t.textTertiary,"--connector-caption-text":e==="light"?t.textTertiary:t.textSecondary,"--connector-text-muted":t.textMuted,"--connector-text-disabled":t.textDisabled,"--connector-icon-primary":t.iconPrimary,"--connector-icon-secondary":t.iconSecondary,"--connector-icon-tertiary":t.iconTertiary,"--connector-icon-disabled":t.iconDisabled,"--connector-icon-accent":t.iconAccent,...e==="dark"?{"--connector-neutral-icon":t.iconSecondary}:{},"--connector-accent":t.accent,"--connector-accent-hover":t.accentHover,"--connector-accent-subtle":t.accentSubtle,"--connector-autofill-prompt-background":e==="light"?"#FCF4FF":t.accentSubtle,"--connector-autofill-prompt-border":e==="light"?"#E0BCE8":t.borderStrong,...e==="dark"?{"--connector-pill-brand-bg":t.accentSubtle,"--connector-pill-brand-hover-bg":t.surfaceActive,"--connector-pill-neutral-bg":t.surfaceHover,"--connector-pill-neutral-hover-bg":t.surfaceActive,"--connector-pill-success-bg":t.surfaceActive,"--connector-pill-success-hover-bg":t.surfaceHover,"--connector-pill-success-text":t.textPrimary,"--connector-pill-success-count":t.textSecondary,"--connector-pill-danger-bg":`color-mix(in srgb, ${t.negative} 12%, ${t.surface})`,"--connector-pill-danger-hover-bg":`color-mix(in srgb, ${t.negative} 18%, ${t.surface})`,"--connector-pill-danger-text":t.negative,"--connector-pill-primary-text":t.textPrimary,"--connector-pill-secondary-text":t.textSecondary,"--connector-pill-muted-text":t.textMuted}:{},...e==="dark"?{"--connector-unauth-title-text":t.textPrimary,"--connector-unauth-message-text":t.textSecondary}:{},"--connector-primary-action":t.primaryAction,"--connector-primary-action-hover":t.primaryActionHover,"--connector-primary-action-active":t.primaryActionActive,"--connector-input-background":t.inputBackground,"--connector-input-disabled-background":t.inputDisabledBackground,"--connector-input-border":t.inputBorder,"--connector-input-border-hover":t.inputBorderHover,"--connector-input-border-focus":t.inputBorderFocus,"--connector-input-border-invalid":t.inputBorderInvalid,"--connector-input-text":t.inputText,"--connector-input-disabled-text":t.inputDisabledText,"--connector-input-placeholder":t.inputPlaceholder,"--connector-input-shadow":t.inputShadow,"--connector-shadow-subtle":t.shadowSubtle,"--connector-shadow-strong":t.shadowStrong,"--connector-dropdown-shadow":t.dropdownShadow,"--connector-dropdown-border":e==="light"?"transparent":t.border,"--connector-overlay-backdrop":t.overlayBackdrop,"--connector-negative":t.negative,"--connector-success":t.success,"--connector-switch-checked":e==="light"?t.accent:t.success,"--connector-on-accent":t.onAccent,colorScheme:e}),kL=/^(#|rgb|hsl|color\()/i,TL=(e,t)=>{const n=Vf[e],r={...t};return Object.keys(r).forEach(o=>{kL.test(String(r[o]).trim())||(r[o]=n[o])}),r},LL=(e,t)=>{const n={...e,...t};return Object.keys(t).forEach(r=>{const o=e[r],u=t[r];o&&u&&typeof o=="object"&&typeof u=="object"&&!Array.isArray(o)&&!Array.isArray(u)&&(n[r]={...o,...u})}),n},OL=(e,t)=>{var u,s,i;const n=TL(e,t),r=(i=(s=(u=f.theme.components)==null?void 0:u.MuiButton)==null?void 0:s.styleOverrides)==null?void 0:i.root,o={textTransform:"unset","&.MuiButton-outlined":{color:t.textSecondary,borderColor:t.border,backgroundColor:"transparent"},"&.MuiButton-outlined:hover":{color:t.textPrimary,borderColor:t.borderStrong,backgroundColor:t.surfaceHover},"&.MuiButton-outlined:active":{color:t.textPrimary,borderColor:t.borderStrong,backgroundColor:t.surfaceActive},"&.MuiButton-text":{color:t.accent,backgroundColor:"transparent !important"},"&.MuiButton-text:hover":{color:t.accent,backgroundColor:`${t.surfaceHover} !important`},"&.MuiButton-containedPrimary":{color:t.onAccent,backgroundColor:t.primaryAction},"&.MuiButton-containedPrimary:hover":{backgroundColor:t.primaryActionHover},"&.MuiButton-containedPrimary:active":{backgroundColor:t.primaryActionActive},"&.MuiButton-containedError":{color:f.theme.palette.error.contrastText,backgroundColor:f.theme.palette.error.main},"&.MuiButton-containedError:hover, &.MuiButton-containedError.MuiButton-hover":{backgroundColor:f.theme.palette.error.dark},"&.Mui-disabled":{color:t.textMuted,backgroundColor:t.surfaceActive}};return f.createTheme(f.theme,{typography:{...f.theme.typography,fontFamily:"Inter, Roboto, sans-serif"},palette:{mode:e,background:{default:n.canvas,paper:n.surfaceElevated},text:{primary:n.textPrimary,secondary:n.textSecondary,disabled:e==="dark"?n.textDisabled:n.textMuted},divider:n.border,primary:{main:n.primaryAction,dark:n.primaryActionHover,contrastText:n.onAccent},error:{main:n.negative},gray:{...f.theme.palette.gray,white:n.surface,black:n.textPrimary,gray1:n.textPrimary,gray2:n.textSecondary,gray3:e==="dark"?n.textTertiary:n.textSecondary,gray4:n.textMuted,gray5:n.borderStrong,gray6:n.border,gray6a:n.surfaceSubtle,gray7:n.canvas,background:n.canvas},blue:{...f.theme.palette.blue,primary:n.accent,hover:n.accentHover,light:n.accentSubtle},purple:{...f.theme.palette.purple,primary:n.accent,hover:n.accentHover,light:n.accentSubtle}},components:{MuiCssBaseline:{styleOverrides:{body:{color:t.textPrimary,backgroundColor:t.canvas}}},MuiPaper:{styleOverrides:{root:{color:t.textPrimary,backgroundColor:t.surfaceElevated}}},MuiPopover:{styleOverrides:{paper:{boxShadow:t.dropdownShadow}}},MuiMenu:{styleOverrides:{paper:{color:t.textPrimary,backgroundColor:t.surfaceElevated,backgroundImage:"none",boxShadow:t.dropdownShadow}}},MuiMenuItem:{styleOverrides:{root:{color:t.textPrimary,"&:hover":{backgroundColor:t.surfaceHover},"&.Mui-selected, &.Mui-selected:hover":{backgroundColor:t.surfaceActive}}}},...e==="dark"?{MuiAutocomplete:{styleOverrides:{option:{color:t.textPrimary,"&.Mui-focused":{backgroundColor:t.surfaceHover},'&[aria-selected="true"], &[aria-selected="true"].Mui-focused':{backgroundColor:t.surfaceActive}}}}}:{},MuiListItemIcon:{styleOverrides:{root:{color:t.iconSecondary}}},MuiDialog:{styleOverrides:{paper:{color:t.textPrimary,backgroundColor:t.surfaceElevated,backgroundImage:"none",borderColor:t.borderStrong}}},MuiLink:{styleOverrides:{root:{color:t.accent,"&:hover":{color:t.accentHover}}}},MuiInputBase:{styleOverrides:{root:{color:t.inputText,backgroundColor:t.inputBackground},input:{"&::placeholder":{color:t.inputPlaceholder,opacity:1}}}},MuiOutlinedInput:{styleOverrides:{root:{color:t.inputText,backgroundColor:t.inputBackground,boxShadow:t.inputShadow,"& .MuiOutlinedInput-notchedOutline":{borderColor:t.inputBorder},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:t.inputBorderHover},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:t.inputBorderFocus},"&.Mui-disabled":{color:t.inputDisabledText,backgroundColor:t.inputDisabledBackground}},input:{"&::placeholder":{color:t.inputPlaceholder,opacity:1}}}},MuiSelect:{styleOverrides:{icon:{color:t.iconSecondary}}},MuiFormLabel:{styleOverrides:{root:{color:t.textPrimary,"&.Mui-focused":{color:t.accent}}}},MuiFormHelperText:{styleOverrides:{root:{color:t.textMuted}}},MuiButton:{styleOverrides:{root:c=>{const l=typeof r=="function"?r(c):r;return LL(l??{},o)}}},MuiCheckbox:{styleOverrides:{root:{color:t.iconSecondary,"&.Mui-checked":{color:t.accent},"&.Mui-disabled":{color:t.textMuted}}}},MuiSwitch:{styleOverrides:{switchBase:{...e==="dark"&&{color:t.iconSecondary,"&.Mui-checked":{color:t.success},"&.Mui-checked + .MuiSwitch-track":{backgroundColor:t.success,opacity:.5},"&.Mui-disabled":{color:t.textPrimary,opacity:1},"&.Mui-disabled + .MuiSwitch-track":{backgroundColor:Ep,opacity:1},"&.Mui-checked.Mui-disabled":{color:t.success,opacity:1},"&.Mui-checked.Mui-disabled + .MuiSwitch-track":{backgroundColor:t.success,opacity:.5}}},track:{...e==="dark"&&{backgroundColor:t.borderStrong,opacity:1}}}},MuiIconButton:{styleOverrides:{root:{padding:"8px",color:t.iconSecondary,"&:hover":{color:t.iconPrimary,backgroundColor:t.surfaceHover},...e==="dark"&&{"&.Mui-disabled":{color:t.iconDisabled}}}}},MuiTooltip:{styleOverrides:{tooltip:{minHeight:"unset",maxWidth:"320px",padding:"4px 8px",border:0,borderRadius:"4px",color:t.tooltipText,backgroundColor:t.tooltipSurface,boxShadow:`0 4px 12px ${t.shadowStrong}`,fontSize:"12px",fontWeight:400,lineHeight:"16px",whiteSpace:"normal",wordBreak:"break-word"},arrow:{display:"none"}}}}})},E1=p.createContext({mode:"light",tokens:Vf.light}),zf=()=>p.useContext(E1),qr={mode:"light"},wu=(e=qr)=>{const{mode:t,tokens:n}=e;return p.useMemo(()=>m1(t,F1({mode:t,tokens:n})),[t,n])},Mr=({config:e=qr,children:t})=>{const{mode:n,tokens:r}=e,o=p.useMemo(()=>F1({mode:n,tokens:r}),[n,r]),u=p.useMemo(()=>n==="dark"?OL(n,o):void 0,[n,o]),s=p.useMemo(()=>({mode:n,tokens:o}),[n,o]),i=p.useMemo(()=>({":root":m1(n,o)}),[n,o]),c=p.useMemo(()=>n==="dark"?ML(o):void 0,[n,o]);return n==="light"?a.jsx(E1.Provider,{value:s,children:a.jsxs(Fp,{inter:!0,children:[a.jsx(f.GlobalStyles,{styles:i}),t]})}):a.jsx(E1.Provider,{value:s,children:a.jsxs(Fp,{theme:u,children:[a.jsx(f.GlobalStyles,{styles:c}),t]})})},ML=e=>({":root":m1("dark",e),".connector-theme-root":{color:e.textPrimary,backgroundColor:e.canvas},":where(.connector-theme-root) :where(h1, h2, h3, h4, h5, h6)":{color:e.textPrimary},".connector-theme-root a":{color:e.accent},".connector-theme-root a:hover":{color:e.accentHover},".connector-theme-root .MuiDivider-root":{borderColor:e.border},".connector-theme-root .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline, .connector-theme-root .MuiOutlinedInput-root:focus-within .MuiOutlinedInput-notchedOutline":{borderColor:`${e.inputBorderFocus} !important`},".connector-theme-root .MuiSkeleton-root":{backgroundColor:e.surfaceActive},".connector-theme-root .MuiSwitch-switchBase:not(.Mui-checked):not(.Mui-disabled)":{color:`${e.iconSecondary} !important`},".connector-theme-root .MuiSwitch-track":{backgroundColor:`${e.borderStrong} !important`,opacity:"1 !important"},".connector-theme-root .MuiSwitch-switchBase.Mui-checked":{color:`${e.success} !important`},".connector-theme-root .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:`${e.success} !important`,opacity:"0.5 !important"},".connector-theme-root .MuiSwitch-switchBase.Mui-disabled":{color:`${e.textPrimary} !important`,opacity:"1 !important"},".connector-theme-root .MuiSwitch-switchBase.Mui-disabled + .MuiSwitch-track":{backgroundColor:`${Ep} !important`,opacity:"1 !important"},".connector-theme-root .MuiSwitch-switchBase.Mui-checked.Mui-disabled":{color:`${e.success} !important`,opacity:"1 !important"},".connector-theme-root .MuiSwitch-switchBase.Mui-checked.Mui-disabled + .MuiSwitch-track":{backgroundColor:`${e.success} !important`,opacity:"0.5 !important"},[`.MuiTooltip-popper:not(.${vu}) .MuiTooltip-tooltip`]:{width:"auto",height:"auto",minHeight:0,padding:"4px 8px",border:0,borderRadius:"4px",color:e.tooltipText,backgroundColor:e.tooltipSurface,boxShadow:`0 4px 12px ${e.shadowStrong}`,fontSize:"12px",fontWeight:400,lineHeight:"16px"},".MuiTooltip-arrow":{display:"none"},".MuiDialog-paper":{color:`${e.textPrimary} !important`,backgroundColor:`${e.surfaceElevated} !important`,borderColor:`${e.borderStrong} !important`},".MuiDialog-paper .MuiTypography-root":{color:`${e.textPrimary} !important`},".MuiPickersPopper-paper, .MuiCalendarPicker-root, .MuiPickersLayout-root, .MuiDateCalendar-root":{color:`${e.textPrimary} !important`,backgroundColor:`${e.surfaceElevated} !important`},".MuiPickersCalendarHeader-label, .MuiDayCalendar-weekDayLabel":{color:`${e.textSecondary} !important`},".MuiPickersDay-root":{color:`${e.textPrimary} !important`,backgroundColor:"transparent !important",outline:"none !important"},".MuiPickersDay-root:hover, .MuiPickersDay-root:focus":{backgroundColor:`${e.surfaceHover} !important`},".MuiPickersDay-root.MuiPickersDay-today:not(.Mui-selected)":{color:`${e.textPrimary} !important`,backgroundColor:`${e.surfaceActive} !important`,borderColor:"transparent !important"},".MuiPickersDay-root.Mui-selected":{color:`${e.onAccent} !important`,backgroundColor:`${e.accent} !important`}}),b1=new Set;let Pa=null,Qa=!1;const bp=()=>b1.forEach(e=>e()),_L=()=>{Qa||(Qa=!0,bp())},Xf=({zIndex:e})=>{const{mode:t}=zf(),n=p.useId(),[r,o]=p.useState(!1),[u,s]=p.useState(Qa);return p.useEffect(()=>{const i=()=>{Qa&&Pa===null&&(Pa=n),o(Pa===n),s(Qa)};return b1.add(i),i(),()=>{b1.delete(i),Pa===n&&(Pa=null,bp())}},[n]),!u||!r?null:Nt.createPortal(a.jsx(Bc,{id:"toast-message",children:a.jsx(yc,{theme:t,position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0,...e&&{style:{zIndex:e}}})}),document.body)};function Ge(e){const{message:t,type:n,autoClose:r}=e;_L();const o={closeButton:a.jsx(my,{}),autoClose:r??5e3,pauseOnHover:!0,position:"bottom-left",rtl:!1,draggable:!0,closeOnClick:!0,hideProgressBar:!0};let u;switch(n){case"success":{u=ot.success(a.jsx(Df,{message:t}),{...o,icon:!1});break}case"error":{u=ot.error(a.jsx(Df,{message:t}),{...o,icon:!1});break}case"info-dark":{u=ot.info(a.jsx(Df,{message:t}),{...o,icon:!1,className:"toast_dark"});break}default:{u=ot.info(a.jsx(Df,{message:t}),{...o,icon:!1});break}}return setTimeout(()=>{jL(u)},r&&!isNaN(r)?Number(r):5e3),u}function jL(e){ot.dismiss(e)}const xp={updateFormApiStatus:Ae.IDLE,createObjectList:[],createObjectConnectorNamesList:[],linkObjectList:[],editObjectList:[],searchObjectList:[],objectDict:null,formFields:null,objectListApiStatus:Ae.IDLE,unlinkCardApiStatus:Ae.IDLE,linkCardApiStatus:Ae.IDLE,optionsMap:null,dropdownOptionsApis:Ae.IDLE,dependentFieldsMap:{},createFormApiStatus:Ae.IDLE,currentResourceDetailsApiStatus:Ae.IDLE,currentResourceDetails:null,currentCardInEdit:null,hasUnsavedChanges:!1},yp=e=>{if(typeof e.userAuthEnabled=="boolean")return e;const t=e.user_auth_enabled;return typeof t=="boolean"?{...e,userAuthEnabled:t}:e},x1=(e,t,n)=>{let r=`${t}_${n}`;return Object.keys(e).forEach(o=>{r=`${r}_${o}:${e[o]}`}),r},Bp=(e,t)=>t?Object.values(t).filter(r=>{if(e.errors[r])return!1;const o=e.values[r];return Array.isArray(o)?o.length>0:!!o}):[],Ra=(e,t)=>t?Object.keys(t).reduce((r,o)=>{var c;let u="";const s=t[o],i=(c=e.values)==null?void 0:c[s];return Array.isArray(i)?(u=i.filter(l=>!!l&&typeof l=="object"&&"value"in l).map(l=>l.value),u=u.length>0?u:null):i&&typeof i=="object"&&"value"in i?u=i.value:i&&typeof i!="object"?u=i:u=null,{...r,[o]:u}},{}):{},y1=({formFields:e})=>{const t={};return e.forEach(n=>{var r,o,u,s,i,c;if(t[n.name]={},(r=n.validations)!=null&&r.isRequired&&(typeof n.validations.isRequired=="object"?t[n.name].isRequired=SI(n.validations.isRequired.msg):t[n.name].isRequired=!0),n.type==="date"){let l=typeof((o=n.validations)==null?void 0:o.disableFuture)=="object"?n.validations.disableFuture.msg:"";l=typeof((u=n.validations)==null?void 0:u.disablePast)=="object"?n.validations.disablePast.msg:l,t[n.name].validate=II(l);return}if(n.type==="number"&&((s=n.validations)!=null&&s.range)){t[n.name].validate=kI();return}if(n.type==="text"&&n.limit){t[n.name].validate=u1();return}if(n.type==="table"){const l=y1({formFields:n.columns??[]});t[n.name].validations=l}if((i=n.validations)!=null&&i.isUrl){const l=typeof n.validations.isUrl=="object"?n.validations.isUrl.msg:"";t[n.name].validate=vI(l)}else if((c=n.validations)!=null&&c.isEmail){const l=typeof n.validations.isEmail=="object"?n.validations.isEmail.msg:"";t[n.name].validate=wI(l)}}),t},ko={isMultiSelect:e=>Array.isArray(e)?e.every(t=>typeof t=="object"&&"label"in t&&"value"in t):!1,isTable:e=>Array.isArray(e)?e.some(n=>!!n[Bu.ROW_ID]):!1,isSelect:e=>!!e&&typeof e=="object"&&"label"in e,isDate:e=>!!e&&typeof e=="object"&&"toISOString"in e,isBoolean:e=>typeof e=="boolean",isAttachmentCollection:e=>!Array.isArray(e)||e.length===0?!1:e.every(t=>typeof t=="object"&&t!==null&&"tempId"in t&&"status"in t)},NL=/%[HIMSfpzZTXc]/,PL=e=>{if(e.type!=="date")return!1;const t=e.meta??{};if(t.is_epoch===!0)return!1;const n=t.format;return!(typeof n=="string"&&NL.test(n))},Su=(e,t,n,r,o,u)=>Object.keys(t).reduce((s,i)=>{const c=e.values[t[i]];let l;return o!=null&&o.has(t[i])?l=s1(ko.isAttachmentCollection(c)?c:[]):ko.isMultiSelect(c)?l=c.map(D=>D.value):ko.isTable(c)?l=c.map(({...d})=>(delete d[Bu.ROW_ID],d)).filter(d=>Object.keys(d).length>0):ko.isSelect(c)?l=c.value:ko.isDate(c)?l=u!=null&&u.has(t[i])?T8(c):c.toISOString():u!=null&&u.has(t[i])&&typeof c=="string"&&c.trim()!==""?l=T8(c):r!=null&&r.has(t[i])?l=!!c:n!=null&&n.has(t[i])?l=[]:ko.isBoolean(c)?l=c:ko.isAttachmentCollection(c)?l=s1(c):l=c||"",s[i]=l,s},{}),QL=(e,t)=>{const n={},r=new Set;let o="";for(const u of e)u.rowId?(n[u.rowId]||(n[u.rowId]=[]),n[u.rowId].push(u),r.add(u.rowId),o=""):!n[o]||n[o].length>=t?(r.add(u.name),n[u.name]=[u],o=u.name):n[o].push(u);return[...r].map(u=>({id:u,formFields:n[u]}))},vp=(e,t)=>{if(!t||!Array.isArray(e))return 0;let n=0;for(const r of e){const o=t[r.name];if(r.type==="table"&&Array.isArray(o)){let u=0;for(const s of o){const i=vp(r.columns,s);u+=i}u>0&&n++;continue}o===""||o===void 0||o===null||n++}return n},_r="/v1/api",RL=`${_r}/connectors/conversation/:conversationId/metadata`,HL=`${_r}/connectors/forms/:formId/field/:fieldName/data`,WL=`${_r}/connectors/form/:formId`,GL=`${_r}/connectors/forms/:id/link`,VL=`${_r}/connectors/forms/:id/preview`,zL=`${_r}/connectors/forms/:id/link-search`,XL=`${_r}/connectors/conversation/:conversationId/selected-email`,ZL=`${_r}/connectors/app-cf-values`,JL=`${_r}/connectors/deferred-app-cf-values`,wp=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),Ee({url:wt(`${HL}?${r.toString()}`,e),method:ve.POST,data:t})},YL=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),Ee({url:wt(`${WL}?${r.toString()}`,e),method:ve.POST,data:t})},qL=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),Ee({url:`${VL.replace(":id",e)}?${r.toString()}`,method:ve.POST,data:{args:t}})},UL="https://avatars.githubusercontent.com/u/62397590",Sp={optionsMap:null,createOptionApi:Ae.IDLE,dropdownOptionsApis:Ae.IDLE,previewCardData:null,previewCardApiStatus:Ae.IDLE,selectedSuggestionType:"basic"},Ip=rf({name:"commonSlice",initialState:Sp,reducers:{resetState:()=>Sp,resetPreviewCardData:e=>{e.previewCardData=null,e.previewCardApiStatus=Ae.IDLE},setSelectedSuggestionType:(e,t)=>{e.selectedSuggestionType=t.payload},resetDropdownOptionsCache:e=>{e.optionsMap=null,e.dropdownOptionsApis=Ae.IDLE}},extraReducers:e=>{e.addCase(Zf.pending,t=>{t.createOptionApi=Ae.LOADING}).addCase(Zf.fulfilled,(t,n)=>{const r=t.optionsMap||{},{optionsList:o,key:u}=n.payload;t.createOptionApi=Ae.IDLE,t.optionsMap={...r,[u]:{...r[u],options:o}}}).addCase(Zf.rejected,t=>{t.createOptionApi=Ae.FAILED}).addCase(To.pending,t=>{t.dropdownOptionsApis=Ae.LOADING}).addCase(To.fulfilled,(t,n)=>{const r=t.optionsMap||{},{optionsList:o,hasMore:u,currentPage:s,searchTerm:i,key:c}=n.payload;t.dropdownOptionsApis=Ae.IDLE,t.optionsMap={...r,[c]:{options:o,hasMore:u,currentPage:s,searchTerm:i}}}).addCase(To.rejected,t=>{t.dropdownOptionsApis=Ae.FAILED}).addCase(Lo.pending,t=>{t.previewCardApiStatus=Ae.LOADING}).addCase(Lo.fulfilled,(t,n)=>{const{data:r}=n.payload;r&&(t.previewCardData=r),t.previewCardApiStatus=Ae.IDLE}).addCase(Lo.rejected,t=>{t.previewCardApiStatus=Ae.FAILED})}}),Zf=$n("commonSlice/createDropDownOption",async(e,{getState:t,rejectWithValue:n})=>{var g,A,h;const{fieldName:r,label:o,formId:u,interfaceId:s,conversationId:i=null,args:c={},createArgs:l={},callback:D}=e,d=x1(c||{},u,r),{common:m}=t(),{options:b=[],...C}=((g=m.optionsMap)==null?void 0:g[d])||{};try{const E=await YL({fieldName:r,formId:s},{args:l,conversation_id:i});if(!E||!("data"in E)||!("output_variables"in E.data)||!("external_resource_id"in E.data.output_variables))throw E;const F=E.data.output_variables,{external_resource_id:x,...y}=F,v=[{label:o,value:x,prefillValues:y},...b],w=I8(v,k=>k.value);return D==null||D(w),{optionsList:w,key:d,...C}}catch(E){D==null||D(b);const F=E,x=(A=F==null?void 0:F.response)==null?void 0:A.data,y=typeof x=="string"?x:(x==null?void 0:x.message)||Lr;return Ge({message:y,type:dt}),n((h=F==null?void 0:F.response)==null?void 0:h.status)}}),To=$n("commonSlice/fetchDropDownOptions",async(e,{getState:t,rejectWithValue:n})=>{var v,w,k;const{fieldName:r,formId:o,searchTerm:u,fieldConfig:s,callback:i,args:c={},interfaceId:l="",pagination:D={enabled:!1},controller:d}=e,m=x1(c||{},o,r),{common:b}=t();let C=!1;s.meta&&"showAvatar"in s.meta&&typeof s.meta.showAvatar=="boolean"&&(C=s.meta.showAvatar);const g=((v=b.optionsMap)==null?void 0:v[m])||{},A=!e.isScrollToBottomEvent&&(!g||u!==g.searchTerm),h=A?[]:g.options||[],E=A?!0:g.hasMore??!0,F=A?0:g.currentPage??0,{enabled:x,limit:y}=D,S=y||10;try{let O;const j=d==null?void 0:d.signal,T=x?{pageNumber:F+1,searchTerm:u,limit:S,enabled:x}:null;if(E&&(O=await wp({fieldName:r,formId:o},{pagination:T||{},args:c,interfaceId:l})),j!=null&&j.aborted)throw j.reason;if(!O||!O.data||!("data"in O.data)||!Array.isArray(O.data.data)||!O.data.data.length){const{common:z}=t(),V=((w=z.optionsMap)==null?void 0:w[m])||{};return i==null||i(V.options??[]),{...V,optionsList:V.options??[],key:m,hasMore:!1}}const M=O.data.data.map(z=>C?{...z,avatarUrl:z.avatarUrl||UL}:(delete z.avatarUrl,z)),_=[...h,...M],P=x?M.length>=S:!1,G=I8(_,z=>z.value);return i==null||i(G),{optionsList:G,fieldName:r,formId:o,searchTerm:u,currentPage:F+1,hasMore:P,key:m}}catch(O){const{common:j}=t(),T=((k=j.optionsMap)==null?void 0:k[m])||{};return i==null||i(T.options??[],{isError:!0}),n(O)}},{condition:(e,{getState:t})=>{var d;if(e.isScrollToBottomEvent)return!0;const{fieldName:n,formId:r,searchTerm:o,callback:u,args:s}=e,i=x1(s||{},r,n),{common:c}=t(),l=(d=c.optionsMap)==null?void 0:d[i];if((l==null?void 0:l.searchTerm)!==o)return!0;const D=(l==null?void 0:l.options)||[];return D&&D.length?(u==null||u(D),!1):!0}}),Lo=$n("commonSlice/previewCard",async({id:e,args:t,channelType:n,isRefresh:r},{rejectWithValue:o})=>{var u;try{const s=await qL(e,t,n),i=s==null?void 0:s.data;return i?(r&&Ge({message:_A,type:Rn}),{data:U0(i)}):(r&&Ge({message:MA,type:dt}),{data:null})}catch(s){return o({status:(u=s.response)==null?void 0:u.status})}}),{resetState:bY,resetPreviewCardData:jr,setSelectedSuggestionType:KL,resetDropdownOptionsCache:$L}=Ip.actions,eO=Ip.reducer,nr="/v1/api",tO=`${nr}/connectors/forms/list`,nO=`${nr}/connectors/cards/:id/unlink`,rO=`${nr}/connectors/forms/:id/link`,oO=`${nr}/connectors/form/:formId`,uO=`${nr}/connectors/forms/:formId/data`,aO=`${nr}/connectors/forms/:formId/get_forms_custom_fields`,sO=`${nr}/connectors/forms/:formId/field/:fieldName/custom_fields`,kp=`${nr}/connectors/forms/:formId/defaults`,fO=`${nr}/connectors/forms/:formId/default-values`,iO=`${nr}/connectors/conversation-summary`,cO=`${nr}/connectors/attachments`,lO=({inboxIds:e,channelType:t,conversationId:n,connectorId:r})=>{const o=new URLSearchParams;return e.forEach(u=>o.append("inbox_ids",u)),o.append("channel_type",t),o.append("conversation_id",String(n)),r&&o.append("connector_id",String(r)),Ee({url:`${tO}?${o.toString()}`,method:ve.GET})},Tp=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),Ee({url:wt(`${oO}?${r.toString()}`,e),method:ve.POST,data:t})},DO=(e,t="email",n,r)=>{const o=new URLSearchParams;return o.append("channel_type",t),Ee({url:`${nO.replace(":id",e)}?${o.toString()}`,method:ve.POST,data:{externalResourceId:n,conversationId:r}})},dO=(e,t,n="email",r,o)=>{const u=new URLSearchParams;return u.append("channel_type",n),o&&u.append("senderEmail",o),Ee({url:`${rO.replace(":id",e)}?${u.toString()}`,method:ve.POST,data:{externalResourceId:t,conversationId:r}})},AO=(e,t="email",n,r,o)=>{const u=new URLSearchParams;return u.append("channel_type",t),u.append("conversation_id",String(n||"")),u.append("senderEmail",o),u.append("externalResourceId",r),Ee({url:`${uO.replace(":formId",e)}?${u.toString()}`,method:ve.GET})},pO="Error in previewing the card",gO="Object not found",B1="Link format isn't recognized. Please check that you've entered a valid URL",Lp="Item already linked",Op="Card linked successfully",Mp="Error in linking the card",CO="New card created",hO="Created successfully",FO="Card creation failed",mO="Create and link objects from different apps to this conversation",EO="Are you sure you want to change the primary object?",bO="Changing the primary object will reset all the information you’ve entered and all data will be lost and can’t be recovered.",xO="Are you sure you want to leave?",yO=`If you go back now, all the information you’ve entered will be lost and can’t be recovered.
|
|
2681
|
+
Do you want to continue?`,BO="Select an object to create",_p="Select an object to link",v1="Select object",jp="Paste URL or ID",Np="Object ID/Link",vO="Card updated",wO="Card updation failed",SO="These attachments expired and could not be added — please re-upload:",Pp=3,IO="Pre-fill fields",kO="Variables linked to inbox may not be available as conversation is linked to multiple inboxes.",Jf=(e,t)=>{var r,o,u,s,i,c,l,D,d,m,b,C,g,A,h,E,F,x;if(e.fieldAccessMode==="no_access")return{...e,type:"text",disabled:!0,isClearable:!1,placeholder:"No access",validations:{},...t,value:void 0,defaultValue:void 0};let n={};switch(e.type){case"select":case"reference":case"multi-select":{n={...e,defaultOptions:!!e.interfaceDetails,isInfiniteScrollable:((o=(r=e.interfaceDetails)==null?void 0:r.pagination)==null?void 0:o.enabled)||!1,loadOptionsOnFocus:Object.keys(((u=e.interfaceDetails)==null?void 0:u.args)||{}).length>0,isMultiSelect:e.type==="multi-select",isMulti:e.type==="multi-select"&&!!e.interfaceDetails,type:e.interfaceDetails?"async-select":"select",isClearable:((s=e.meta)==null?void 0:s.isClearable)??!0};break}case"date":{n={...e,type:"date",disablePast:!!((i=e.validations)!=null&&i.disablePast)||!1,disableFuture:!!((c=e.validations)!=null&&c.disableFuture)||!1};break}case"number":{n={...e,type:"number",min:((D=(l=e.validations)==null?void 0:l.range)==null?void 0:D.min)||Number.MIN_SAFE_INTEGER,max:((m=(d=e.validations)==null?void 0:d.range)==null?void 0:m.max)||Number.MAX_SAFE_INTEGER};break}case"multiline":{n={...e,type:"text",maxRows:((b=e.validations)==null?void 0:b.maxRows)||5,limit:(C=e.validations)==null?void 0:C.maxCharacters,rows:5,multiline:!0};break}case"text":{n={...e,type:"text",limit:(g=e.validations)==null?void 0:g.maxCharacters};break}case"checkbox":{n={...e,type:"checkbox",value:!!e.value};break}case"attachment":{const y=(A=e.meta)==null?void 0:A.excludedTypes;n={...e,type:"attachment",meta:{...e.meta??{},maxFiles:((h=e.meta)==null?void 0:h.maxFiles)??10,maxFileSizeMb:((E=e.meta)==null?void 0:E.maxFileSizeMb)??25,acceptedTypes:((F=e.meta)==null?void 0:F.acceptedTypes)??"*",excludedTypes:Array.isArray(y)?y.filter(S=>typeof S=="string"):[],fieldKey:e.key??e.name,supportsDelete:((x=e.meta)==null?void 0:x.supportsDelete)??!0},value:e.value??[]};break}default:n={...e}}return"value"in n&&(n.defaultValue=n.value,delete n.value),{...n,...t}},Qp=rf({name:"writeCapability",initialState:xp,reducers:{resetState:()=>xp,resetCurrentResourceDetails:e=>{e.currentResourceDetails=null,e.currentResourceDetailsApiStatus=Ae.IDLE},setCurrentCardInEdit:(e,t)=>{e.currentCardInEdit=t.payload},setHasUnsavedChanges:(e,t)=>{e.hasUnsavedChanges=t.payload}},extraReducers:e=>{e.addCase(Yf.pending,t=>{t.objectListApiStatus=Ae.LOADING}).addCase(Yf.fulfilled,(t,n)=>{const{createObjectList:r,createObjectConnectorNamesList:o,linkObjectList:u,editObjectList:s,searchObjectList:i,formFields:c,objectDict:l,dependentFieldsMap:D}=n.payload;t.objectListApiStatus=Ae.IDLE,t.createObjectList=r,t.createObjectConnectorNamesList=o,t.linkObjectList=u,t.editObjectList=s,t.searchObjectList=i,t.formFields=c,t.objectDict=l,t.dependentFieldsMap=D}).addCase(Yf.rejected,t=>{t.objectListApiStatus=Ae.FAILED}).addCase(To.pending,t=>{t.dropdownOptionsApis=Ae.LOADING}).addCase(To.fulfilled,(t,n)=>{const r=t.optionsMap||{},{optionsList:o,hasMore:u,currentPage:s,key:i}=n.payload;t.dropdownOptionsApis=Ae.IDLE,t.optionsMap={...r,[i]:{options:o,hasMore:u,currentPage:s}}}).addCase(To.rejected,t=>{t.dropdownOptionsApis=Ae.FAILED}).addCase(qf.pending,t=>{t.createFormApiStatus=Ae.LOADING}).addCase(qf.fulfilled,t=>{t.createFormApiStatus=Ae.IDLE}).addCase(qf.rejected,t=>{t.createFormApiStatus=Ae.FAILED}).addCase(Ha.pending,t=>{t.linkCardApiStatus=Ae.LOADING}).addCase(Ha.fulfilled,t=>{t.linkCardApiStatus=Ae.IDLE}).addCase(Ha.rejected,t=>{t.linkCardApiStatus=Ae.FAILED}).addCase(Kf.pending,t=>{t.unlinkCardApiStatus=Ae.LOADING}).addCase(Kf.fulfilled,t=>{t.unlinkCardApiStatus=Ae.IDLE}).addCase(Kf.rejected,t=>{t.unlinkCardApiStatus=Ae.FAILED}).addCase(Uf.pending,t=>{t.updateFormApiStatus=Ae.LOADING}).addCase(Uf.fulfilled,t=>{t.updateFormApiStatus=Ae.IDLE}).addCase(Uf.rejected,t=>{t.updateFormApiStatus=Ae.FAILED}).addCase($f.pending,t=>{t.currentResourceDetailsApiStatus=Ae.LOADING}).addCase($f.fulfilled,(t,n)=>{const{data:r}=n.payload;r&&(t.currentResourceDetails=r),t.currentResourceDetailsApiStatus=Ae.IDLE}).addCase($f.rejected,t=>{t.currentResourceDetailsApiStatus=Ae.FAILED})}}),Yf=$n("writeCapability/fetchObjectList",async e=>{const{inboxIds:t,channelType:n,conversationId:r,isExpandedFormEnabled:o,connectorId:u}=e,s=await lO({inboxIds:t,channelType:n,conversationId:r,connectorId:u});if(!s||!s.data||!("formsList"in s.data)||!Array.isArray(s.data.formsList))return{createObjectList:[],createObjectConnectorNamesList:[],linkObjectList:[],editObjectList:[],searchObjectList:[],formFields:null,objectDict:null,dependentFieldsMap:{}};const i=s.data.formsList,c={},l=[],D=[],d=[],m=[],b=[],C={},g={};return i==null||i.forEach(A=>{var E,F;if(A.expandedView&&!o)return;const h=yp({...A});"fieldList"in h&&delete h.fieldList,g[A.id]=h,c[A.id]||(c[A.id]={}),C[A.id]||(C[A.id]=[]),A.type==="create"&&A.authenticated?(l.push({value:A.id,label:A.name,avatarUrl:A.logoUrl,connectorKey:A.connectorName,connectorId:A.connectorId}),A.connectorName&&!D.includes(A.connectorName)&&D.push(A.connectorName)):A.type==="link"&&A.authenticated?d.push({value:A.id,label:A.name,avatarUrl:A.logoUrl}):A.type==="edit"&&A.authenticated?m.push({value:A.id,label:A.name,avatarUrl:A.logoUrl}):A.type==="search_and_link"&&A.authenticated&&b.push({value:A.id,label:A.name,avatarUrl:A.logoUrl}),(E=A.fieldList)==null||E.sort((x,y)=>x.priority-y.priority),(F=A.fieldList)==null||F.forEach(x=>{const y=Jf(x);if(y.columns&&(y.columns=y.columns.map(S=>Jf(S,{loadOptionsOnFocus:!0,defaultOptions:!1}))),C[A.id]=[...C[A.id],y],x.interfaceDetails&&(x.interfaceDetails.args||x.interfaceDetails.optionalArgs)){const S={...x.interfaceDetails.args,...x.interfaceDetails.optionalArgs};Object.values(S).forEach(v=>{c[A.id][v]?c[A.id][v]=[...c[A.id][v],x.name]:c[A.id][v]=[x.name]})}})}),{createObjectList:l,createObjectConnectorNamesList:D,linkObjectList:d,editObjectList:m,searchObjectList:b,formFields:C,objectDict:g,dependentFieldsMap:c}}),Rp=e=>{var o;const t=(o=e==null?void 0:e.response)==null?void 0:o.data;if(!t)return[];const n=t.error??{},r=[t.failedAttachmentIds,t.invalidAttachmentIds,t.expiredAttachmentIds,t.failedIds,t.attachmentIds,t.attachments,n.attachmentIds,n.attachments];for(const u of r)if(Array.isArray(u)&&u.length>0)return u.map(s=>typeof s=="string"?s:s&&typeof s=="object"&&"attachmentId"in s?String(s.attachmentId):"").filter(Boolean);return[]},Hp=(e,t)=>{const n=e.map(r=>(t==null?void 0:t[r])??r);return`${SO} ${n.join(", ")}`},qf=$n("writeCapability/createForm",async(e,{rejectWithValue:t})=>{var d,m;const{formId:n,successCallback:r,failureCallback:o,args:u={},interfaceId:s,conversationId:i,attachmentIdToName:c,objectName:l,namedToast:D=!1}=e;try{await Tp({formId:n},{args:u,interfaceId:s,conversationId:i}),r==null||r();const b=D?l?`${l} created`:hO:CO;Ge({message:b,type:Rn})}catch(b){const C=b;if(o==null||o(b),((d=C==null?void 0:C.response)==null?void 0:d.status)===422){const h=Rp(C);return Ge({message:Hp(h,c),type:dt}),t(b)}const g=(m=C==null?void 0:C.response)==null?void 0:m.data,A=(g==null?void 0:g.message)??FO;return Ge({message:A,type:dt}),t(b)}}),Uf=$n("writeCapability/updateForm",async(e,{rejectWithValue:t})=>{var d;const{formId:n,successCallback:r,failureCallback:o,args:u={},interfaceId:s,conversationId:i,externalResourceId:c,previousArgs:l={},attachmentIdToName:D}=e;try{await Tp({formId:n},{args:u,interfaceId:s,conversationId:i,externalResourceId:c,previousArgs:l}),r==null||r(),Ge({message:vO,type:Rn})}catch(m){const b=m;if(o==null||o(m),((d=b==null?void 0:b.response)==null?void 0:d.status)===422){const C=Rp(b);return Ge({message:Hp(C,D),type:dt}),t(m)}return Ge({message:wO,type:dt}),t(m)}}),Kf=$n("writeCapability/unlinkCard",async({id:e,channelType:t,externalResourceId:n,conversationId:r})=>{await DO(e,t,n,r)}),Ha=$n("writeCapability/linkCard",async({id:e,externalResourceId:t,channelType:n,conversationId:r,email:o},{rejectWithValue:u})=>{var s;try{await dO(e,t,n,r,o)}catch(i){return u({status:(s=i.response)==null?void 0:s.status})}}),$f=$n("connectorCardLibrary/fetchCurrentResourceDetails",async(e,{rejectWithValue:t})=>{const{id:n,channelType:r,conversationId:o,externalResourceId:u,contactEmail:s}=e;try{const i=await AO(n,r,o,u,s),c=i==null?void 0:i.data,l=i==null?void 0:i.status,D={values:{},errors:{}};return Object.entries(c.formData).forEach(([d,m])=>{if(m.type==="attachment"){const b=Array.isArray(m.value)?m.value:[];D.values[d]=b.map(C=>({tempId:`existing-${C.attachmentId}`,attachmentId:C.attachmentId,filename:C.filename,size:C.size??0,mimeType:C.mimeType??"",url:C.url,status:"done",isExisting:!0}))}else if(m.type==="checkbox")D.values[d]=P8(m.value??m.label);else if("label"in m)if(m.type&&m.type==="date"){const b=Array.isArray(m.label)?m.label[0]:m.label;D.values[d]=b?new Date(parseInt(b)).toISOString():""}else m.type&&m.type==="multi-select"?D.values[d]=N8(m.value,m.label):m.value?D.values[d]={value:m.value,label:m.label}:D.values[d]=m.label}),{data:D,status:l}}catch(i){return Ge({message:Lr,type:dt}),t(i)}}),{resetState:xY,setCurrentCardInEdit:Oo,resetCurrentResourceDetails:TO,setHasUnsavedChanges:Mo}=Qp.actions,LO=Qp.reducer,OO=()=>{const[e,t]=p.useState(null),[n,r]=p.useState({isVertical:!1,isHorizontal:!1,isScrolling:!1}),o=p.useCallback(u=>{t(u)},[]);return p.useEffect(()=>{if(!e)return;e.dataset.prevScrollLeft="0",e.dataset.prevScrollTop="0";let u=null;const s=100;let i=null;const c=150,l=D=>{u||(u=window.setTimeout(()=>{const d=D.target,m=Number(e.dataset.prevScrollLeft)||0,b=Number(e.dataset.prevScrollTop)||0,C=d.scrollLeft,g=d.scrollTop,A=C-m,h=g-b,E=Math.abs(h)>Math.abs(A),F=Math.abs(A)>Math.abs(h);r({isVertical:E,isHorizontal:F,isScrolling:!0}),e.dataset.prevScrollLeft=String(C),e.dataset.prevScrollTop=String(g),u=null},s),i&&window.clearTimeout(i),i=window.setTimeout(()=>{r(d=>({...d,isScrolling:!1})),i=null},c))};return e.addEventListener("scroll",l),()=>{e.removeEventListener("scroll",l),u&&window.clearTimeout(u),i&&window.clearTimeout(i)}},[e]),[n,o]},MO=e=>I.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M5.8016 11.709L12.3416 5.16893L11.4298 4.25712L4.88979 10.7972V11.709H5.8016ZM6.33618 12.9987H3.6001V10.2626L10.9739 2.88875C11.0948 2.76786 11.2588 2.69995 11.4298 2.69995C11.6008 2.69995 11.7648 2.76786 11.8857 2.88875L13.71 4.71302C13.8309 4.83395 13.8988 4.99794 13.8988 5.16893C13.8988 5.33992 13.8309 5.50391 13.71 5.62484L6.33618 12.9987ZM3.6001 14.2884H15.2073V15.578H3.6001V14.2884Z",fill:"var(--connector-neutral-icon, #6C7B94)"})),Wp=/^No\s.+\sfound\sfor\s(email|Email)\s.+@.+\..+$/,_O=e=>!!e&&/^No\s.+\sfound\sfor\s/.test(e),ei=e=>typeof e=="boolean"?e?"Yes":"No":String(e),Gp=e=>{const t=/\(Error code: (.*?)\)$/,n=e.match(t),r=n?n[1]:null,o=n?e.replace(t,"").trim():e;return{error_code:r,error_message:o}},jO=(e,t)=>`${v3} (Error code: ${e})`.replace(/{{connector_name}}/g,(t==null?void 0:t[0])||""),NO=(e,t)=>{const{error_code:n,error_message:r}=Gp(e);return n===zE&&t?XE:r},PO=e=>{var n,r,o,u;const t=e.data;return e.cardType==="flat"?((n=t==null?void 0:t.flatDisplay)==null?void 0:n.data)??[]:((u=(o=(r=t==null?void 0:t.listItems)==null?void 0:r.fields)==null?void 0:o[0])==null?void 0:u.data)??[]},Vp=e=>!!(e!=null&&e.activeLookupParam)&&!e.cardErrorMessage&&!PO(e).length,zp=e=>!!(e!=null&&e.activeLookupParam)&&!!e.cardErrorMessage,QO=(e,t,n)=>{var l,D,d,m,b;const r=e.externalResourceId?`${e.id}_${e.externalResourceId}`:e.id,o=t==null?void 0:t[r];if(!o||Vp(o))return!0;if(zp(o))return!1;const u=o.cardType==="flat",s=(l=t==null?void 0:t[r])==null?void 0:l.data,i=u&&((D=s==null?void 0:s.flatDisplay)!=null&&D.data)?s.flatDisplay.data:!u&&((b=(m=(d=s==null?void 0:s.listItems)==null?void 0:d.fields)==null?void 0:m[0])!=null&&b.data)?s.listItems.fields[0].data:[],c=o.cardErrorMessage;return c&&Wp.test(c)?!0:!Xp(e,t,n)&&!i.length},Xp=(e,t,n)=>{var D,d;const r=e.externalResourceId?`${e.id}_${e.externalResourceId}`:e.id,o=t==null?void 0:t[r];if(!o)return!1;if(zp(o))return!0;const s=o.cardType==="flat"||(d=(D=o.data)==null?void 0:D.listItems)==null?void 0:d.errorMessage,i=(n==null?void 0:n[r])===Ae.FAILED,c=o.cardErrorMessage,l=c&&Wp.test(c);return i||s||c&&!l};function RO(e,t,n){const r={},o={};let u=0,s=0;for(const c of e){const l=c.externalResourceId?`${c.id}_${c.externalResourceId}`:c.id,D=t==null?void 0:t[l],d=(D==null?void 0:D.connectorNames)??[];for(const m of d)r[m]||(r[m]=[],o[m]={cards_visible:0,empty_cards:0,cards_with_error:0,card_key:[],card_title:[]}),r[m].push(c),o[m].cards_visible+=1,o[m].card_key.push(c.id),o[m].card_title.push(c.title),QO(c,t,n)&&(o[m].empty_cards+=1,u+=1),Xp(c,t,n)&&(o[m].cards_with_error+=1,s+=1)}return{cards_per_app:Object.entries(o).map(([c,l])=>({app_name:c,...l})),total_empty_cards:u,total_cards_with_errors:s}}const HO=({data:e,title:t,currentCard:n,setShowModal:r})=>{const o=Zt(),{sendTrackingEvent:u,currentSmIds:s}=p.useContext(Ue),{userGroupId:i}=an()||{},[c,l]=OO(),{isScrolling:D,isVertical:d}=c,m=D&&d,b=p.useMemo(()=>(e==null?void 0:e[0].data.map(h=>h.label))||[],[e]),C=p.useMemo(()=>e.map(h=>{const E={cells:{},externalResourceId:h.externalResourceId};return h.data.forEach((F,x)=>{if(b[x]){let y=F.value==null||F.value===void 0||F.value===""?gr:Array.isArray(F.value)?F.value.map(S=>typeof S=="object"&&S!==null?S.filename:ei(S)).join(", "):ei(F.value);if(y&&y!==gr&&F.type==="date"){const S=new Date(parseInt(y));y=isNaN(S.getTime())?gr:S.toLocaleDateString(navigator.language)}E.cells[b[x]]={label:y,deepLink:F==null?void 0:F.deepLink}}}),E}),[e,b]),g=(h,E)=>a.jsx(zb,{align:"left",children:h.deepLink?a.jsx(f.Link,{target:"_blank",underline:"none",href:h.deepLink,children:h.label}):a.jsx(f.Typography,{variant:"body2",sx:{color:"var(--connector-text-primary)"},children:h.label})},`${E}_${h.label}`),A=h=>{!h||!n||(r(!1),u(f3,{card_title:n.title,connector_name:n.connectorName,ug_id:i,sm_ids:s}),o(Oo({...n,externalResourceId:h})))};return a.jsxs(f.Stack,{maxHeight:"340px",maxWidth:"700px",padding:"32px 0px 32px 32px",overflow:"auto",children:[a.jsx(f.Typography,{variant:"h2",sx:{color:"var(--connector-text-primary)"},marginBottom:"16px",children:t}),a.jsx(f.TableContainer,{ref:l,children:a.jsxs(f.Table,{stickyHeader:!0,children:[a.jsx(Wb,{children:a.jsxs(f.TableRow,{children:[b.map(h=>a.jsx(Gb,{sx:{whiteSpace:"nowrap"},children:a.jsx(f.Typography,{variant:"overline",sx:{color:"var(--connector-caption-text)"},children:h})},h)),a.jsx(Zb,{})]})}),a.jsx(f.TableBody,{children:C.map((h,E)=>a.jsxs(Vb,{children:[Object.values(h.cells).map((F,x)=>g(F,x)),a.jsx(Xb,{children:!m&&h.externalResourceId&&a.jsx(f.Tooltip,{title:y3,placement:"bottom",children:a.jsx(f.IconButton,{className:"row-edit",onClick:()=>A(h.externalResourceId),children:a.jsx(MO,{"aria-hidden":!0})})})})]},`id_${E}`))})]})})]})},Zp=e=>e.cardList.connectorCards,WO=e=>e.cardList.connectorsEnabled,GO=e=>e.cardList.connectorApiStatus,VO=e=>e.cardList.cardSpecificData,zO=e=>e.cardList.specificConnectorApiStatus,XO=e=>e.cardList.specificConnectorErrorCode,ZO=e=>e.cardList.cardLookupKey,JO=e=>e.cardList.prefilledCardKeys,ti=e=>e.cardList.relatedLookup,YO=e=>{const{connectorApiStatus:t,specificConnectorApiStatus:n}=e.cardList;return t!==Ae.IDLE||!n?!1:Object.values(n).every(r=>r===Ae.IDLE||r===Ae.FAILED)},qO="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%204.8675L14.6475%2014.625H3.3525L9%204.8675ZM9%201.875L0.75%2016.125H17.25L9%201.875Z'%20fill='%23F07530'/%3e%3cpath%20d='M9.75%2012.375H8.25V13.875H9.75V12.375Z'%20fill='%23F07530'/%3e%3cpath%20d='M9.75%207.875H8.25V11.625H9.75V7.875Z'%20fill='%23F07530'/%3e%3c/svg%3e",UO=e=>new Promise(t=>setTimeout(t,e)),ni=({apiFn:e,intervalMillis:t,maxRetries:n,increaseIntervalMillis:r=0,intervalsMillis:o,isSatisfied:u,pushIntermediateResults:s=()=>{}})=>(...c)=>{const l=async(D=0)=>{const d=await e(...c);if(u(d))return d;if(s(d),D>=n)throw d;D++;let m;return o&&o.length>0?m=o[Math.min(D-1,o.length-1)]:(t+=r,m=t),UO(m).then(()=>l(D))};return l()},_o="/v1/api",KO=`${_o}/connectors/cards`,$O=`${_o}/connectors/cards/:id/data`,eM=`${_o}/connector/conversation/:conversationId/id_lookup_options`,tM=`${_o}/connectors/cards/:cardId/related-records`,nM=[[1e4,1500],[3e4,3e3],[1/0,1e4]],rM=6e5,oM=2e3,uM=`${_o}/connectors/cards/:cardId/attachment-data`,aM=[2e3,5e3,1e4,15e3,2e4],sM=5,fM=`${_o}/connectors/:connectorId/user-auth/status`,iM=`${_o}/connectors/:connectorId/user-auth/start`,cM=async({cardId:e,key:t,conversationId:n,externalResourceId:r})=>{const o=new URLSearchParams;r&&o.append("externalResourceId",r),o.append("conversation_id",String(n??"")),o.append("key",t);const u=await Ee({url:`${uM.replace(":cardId",e)}?${o.toString()}`,method:ve.GET});return u==null?void 0:u.data},lM=e=>(e==null?void 0:e.completed)===!0,DM=({cardId:e,key:t,conversationId:n,externalResourceId:r,enabled:o=!0,pollIntervals:u=aM,maxCalls:s=sM})=>{const i=vt(),c=o&&!!e&&!!t&&n!=null,{queryKey:l,polledAttachmentData:D}=p.useMemo(()=>{const d=["connector-cards","attachment-data",e,r??"",n,t],m=ni({apiFn:cM,intervalMillis:u[0]??0,intervalsMillis:u,maxRetries:Math.max(0,s-1),isSatisfied:lM,pushIntermediateResults:b=>{b&&i.setQueryData(d,b)}});return{queryKey:d,polledAttachmentData:m}},[i,e,r,n,t,u,s]);return Ct({queryKey:l,queryFn:()=>D({cardId:e,key:t,conversationId:n,externalResourceId:r}),enabled:c,refetchOnWindowFocus:!1,staleTime:1/0,refetchOnMount:"always",retry:!1})},dM=`
|
|
2682
2682
|
display: flex;
|
|
2683
2683
|
align-items: center;
|
|
2684
2684
|
gap: 8px;
|
|
@@ -2757,7 +2757,7 @@ Do you want to continue?`,BO="Select an object to create",_p="Select an object t
|
|
|
2757
2757
|
& svg [stroke]:not([stroke='none']) {
|
|
2758
2758
|
stroke: currentColor;
|
|
2759
2759
|
}
|
|
2760
|
-
`,Jp=()=>a.jsx(hn,{variant:"rounded",width:"100%",height:35,animation:"wave",sx:{borderRadius:"8px"}}),FM=({attachment:e,onPreview:t})=>{const{filename:n,url:r}=e,o=X8(e.mimeType,n,r),u={...e,mimeType:o??""};return a.jsx(f.Tooltip,{title:"Preview",placement:"top",children:a.jsxs(pM,{role:"button",tabIndex:0,onClick:()=>t(u),onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),t(u))},children:[a.jsx(gM,{children:a.jsx(J8,{mimeType:o})}),a.jsx(CM,{title:n,children:n}),a.jsx(f.Tooltip,{title:"Download",placement:"top",children:a.jsx(hM,{className:"attachment-action",href:r,download:n,type:o,target:"_blank",rel:"noopener noreferrer","aria-label":`Download ${n}`,onClick:s=>s.stopPropagation(),children:a.jsx(Z8,{})})})]})})},mM=({attachments:e,isLoading:t=!1,onPreviewError:n})=>{const[r,o]=p.useState(null),[u,s]=p.useState(!1),i=c=>{c.url||n==null||n("missing_url",c.mimeType||void 0),o(c),s(!0)};return e!=null&&e.length?a.jsxs(a.Fragment,{children:[a.jsxs(AM,{children:[e.map((c,l)=>a.jsx(FM,{attachment:c,onPreview:i},`${l}_${c.filename}`)),t&&a.jsx(Jp,{})]}),a.jsx(K8,{attachment:r,open:u,onClose:()=>s(!1),onLoadError:()=>n==null?void 0:n("load_error",(r==null?void 0:r.mimeType)||void 0)})]}):t?a.jsx(Jp,{}):a.jsx(nc,{variant:"caption_regular",children:gr})},EM=({initialAttachments:e,cardId:t,externalResourceId:n,fieldKey:r,cardType:o,appName:u})=>{const{conversationId:s,sendTrackingEvent:i}=p.useContext(Ue),{data:c,isFetching:l}=DM({cardId:t??"",key:r??"",conversationId:s,externalResourceId:n,enabled:!!t&&!!r}),D=Array.isArray(c==null?void 0:c.value)?c.value:e,d=l&&(c==null?void 0:c.completed)!==!0,m=p.useCallback((b,C)=>{i(sE,{card_type:o,app_name:u,attachment_key:r,failure_reason:b,file_type:C})},[i,o,u,r]);return a.jsx(mM,{attachments:D,isLoading:d,onPreviewError:m})},Yp=e=>{const{value:t,error:n,deepLink:r,statusCode:o,isLoading:u,type:s,redirectToAdminTab:i,isFailed:c,connectorNames:l,cardTitle:D,currentCard:d,cardId:m,isCardLevelError:b,fieldName:C,showErrorIcon:g,attachmentKey:A}=e,h=p.useRef(null),E=p.useRef(null),{email:F,currentSmIds:x,conversationId:y,sendTrackingEvent:S,connectorFunctions:v}=p.useContext(Ue),w=Se(XO),k=w==null?void 0:w[m],[O,j]=p.useState(!1),T=p.useMemo(()=>n&&b?NO(n,d==null?void 0:d.userAuthEnabled):c?v3.replace(/{{connector_name}}/g,(l==null?void 0:l[0])||""):F3,[n,c,l,b,d==null?void 0:d.userAuthEnabled]),L=p.useCallback(()=>{const X=n||jO(k,l),{error_code:te,error_message:ue}=Gp(X);S==null||S(Pm,{sm_ids:x,frontend_req_params:{email:F,conversationId:y,externalResourceId:d==null?void 0:d.externalResourceId},card_title:D,connector_name:l!=null&&l.length?l:"",error_code:te,error_message:ue})},[n,k,S,x,F,y,D,l,d==null?void 0:d.externalResourceId]);p.useEffect(()=>{(n&&b||c&&k)&&L()},[L,k,c,n,b]),p.useEffect(()=>{const X=r?E.current:h.current;if(X){const te=X.scrollHeight>X.clientHeight||X.scrollWidth>X.clientWidth;j(te)}},[t,r]);const M=o==G0.NOT_FOUND,_=!M&&(s==="attachment"||Array.isArray(t)&&t.length>0&&t.every(X=>X!==null&&typeof X=="object"&&"filename"in X&&"url"in X)),P=!M&&Array.isArray(t)&&t.every(X=>typeof X=="string"||typeof X=="number"||typeof X=="boolean");let G=M||t==null||t===void 0||Array.isArray(t)?gr:ei(t);if(s==="date"&&G&&G!==gr&&!M){const X=new Date(parseInt(G));G=isNaN(X.getTime())?gr:X.toLocaleDateString(navigator.language)}const z=!!n||c,V=()=>{i?v==null||v.redirectToAdmin():window.open(ZE,"_blank")},H=()=>{S==null||S(Qm,{sm_ids:x,card_title:D,field_name:C})},J=X=>{const te=/<>(.*?)<>/g,ue=X.split(te);return a.jsx(p.Fragment,{children:ue.map((R,ee)=>ee%2===1?a.jsx(Nb,{variant:"body2",onClick:V,children:R},ee):R)})};if(u)return a.jsx(hn,{variant:"rounded",width:"100%",height:16,animation:"wave",margin:"4px 0 0 0"});if(z)return a.jsxs(R3,{gap:"7px",children:[g?a.jsx(f.Stack,{marginTop:"3px",flexShrink:"0",children:a.jsx("img",{src:qO,width:"18px",height:"18px"})}):null,a.jsx(Xs,{variant:"body_sm_regular",children:T?J(T):F3})]});if(_){const X=Array.isArray(t)?t:[];return a.jsx(EM,{initialAttachments:X,cardId:d==null?void 0:d.id,externalResourceId:d==null?void 0:d.externalResourceId,fieldKey:A,cardType:d==null?void 0:d.type,appName:(d==null?void 0:d.connectorName)??(l==null?void 0:l[0])})}else if(P){const X=t;return X.length?a.jsx(Qb,{children:X.map((te,ue)=>a.jsx(Rb,{children:ei(te)},`${ue}_${String(te)}`))}):a.jsx(nc,{variant:"caption_regular",children:gr})}return a.jsx(f.Tooltip,{title:O?G:null,placement:"bottom",children:r?a.jsx(H3,{ref:E,target:"_blank",underline:"none",href:r,fontSize:`${f.theme.typography.body2.fontSize}px`,onClick:H,children:G||gr}):a.jsx(nc,{ref:h,variant:"caption_regular",children:G||gr})})},rr=({shown:e,setShown:t,children:n,showCloseButton:r=!1,borderRadius:o=4,sx:u})=>a.jsx(f.Dialog,{open:e,onClose:()=>t(!1),PaperProps:{style:{borderRadius:o,padding:0,height:"fit-content",width:"fit-content",maxWidth:"none"}},sx:{...u},children:a.jsxs(f.Stack,{direction:"row",children:[r&&a.jsx(f.Box,{position:"absolute",right:10,top:10,children:a.jsx(f.Tooltip,{title:"Close",placement:"bottom",children:a.jsx(f.IconButton,{onClick:()=>t(!1),sx:{color:"var(--connector-icon-secondary)",'& svg [fill]:not([fill="none"])':{fill:"currentColor"}},children:a.jsx(_0,{})})})}),n]})}),qp=e=>{var R,ee,fe;const{id:t,cardTitle:n,specificCardData:r,specificConnectorApiStatus:o,isOpen:u,currentCard:s,isHeld:i,emptyMessage:c,onRetry:l}=e,D=24,d=(o==null?void 0:o[t])===Ae.IDLE,m=(o==null?void 0:o[t])===Ae.LOADING,b=(o==null?void 0:o[t])===Ae.FAILED,{cardType:C,data:g,cardErrorMessage:A,redirectToAdminTab:h,connectorNames:E}=(r==null?void 0:r[t])||{},F=C==="flat",[x,y]=p.useState(!1),[S,v]=p.useState(!1),[w,k]=p.useState(!1),[O,j]=p.useState(!1),T=((R=g==null?void 0:g.listItems)==null?void 0:R.statusCode)!==401,L=p.useMemo(()=>{var Fe,Oe,Ce,re;return F&&((Fe=g==null?void 0:g.flatDisplay)!=null&&Fe.data)?g.flatDisplay.data:!F&&((re=(Ce=(Oe=g==null?void 0:g.listItems)==null?void 0:Oe.fields)==null?void 0:Ce[0])!=null&&re.data)?g.listItems.fields[0].data:[]},[F,g]),M=p.useMemo(()=>L==null?void 0:L.slice(0,5),[L]),[_,P]=p.useState([]),G=p.useRef(null),[z,V]=p.useState(0),H=x?-180:0,J=F?!1:!!((ee=g==null?void 0:g.listItems)!=null&&ee.errorMessage),X=J||b||A,te=d&&!J&&u&&(w||S);p.useLayoutEffect(()=>{const Fe=G.current;if(!Fe)return;const Oe=()=>{Fe.scrollHeight&&V(Fe.scrollHeight+D)};if(Oe(),typeof ResizeObserver>"u")return;const Ce=new ResizeObserver(Oe);return Ce.observe(Fe),()=>Ce.disconnect()},[o==null?void 0:o[t],_]),p.useEffect(()=>{var re,Z;const Fe=((L==null?void 0:L.length)||0)>5,Oe=!F&&(((Z=(re=g==null?void 0:g.listItems)==null?void 0:re.fields)==null?void 0:Z.length)||0)>1;k(Fe&&!Oe),v(Oe)},[g,F,L==null?void 0:L.length]),p.useEffect(()=>{P(x?L:M)},[g,x,M,L]);const ue=()=>{w?y(Fe=>!Fe):j(Fe=>!Fe)};return a.jsxs(a.Fragment,{children:[a.jsx(rr,{shown:O,setShown:j,showCloseButton:!0,borderRadius:12,children:a.jsx(HO,{data:((fe=g==null?void 0:g.listItems)==null?void 0:fe.fields)||[],title:n,currentCard:s,setShowModal:j})}),a.jsx(_b,{className:u?"":"slideUp",height:z,children:a.jsx(f.Stack,{ref:G,gap:1,margin:"12px",children:(m||i)&&!(_!=null&&_.length)?a.jsxs(a.Fragment,{children:[a.jsx(hn,{variant:"rounded",width:"100%",height:20,animation:"wave"}),a.jsx(hn,{variant:"rounded",width:"100%",height:20,animation:"wave"})]}):a.jsx(a.Fragment,{children:X?a.jsxs(f.Box,{margin:"8px 0",children:[a.jsx(Yp,{error:A,isLoading:m,redirectToAdminTab:h,isFailed:b,showErrorIcon:!T,connectorNames:E,cardId:t,cardTitle:n,currentCard:s,isCardLevelError:!0}),l?a.jsx(f.Button,{size:"small",variant:"text",disabled:m,onClick:l,sx:{marginTop:"4px"},children:$3}):null]}):_!=null&&_.length?_==null?void 0:_.map(Fe=>{const{value:Oe,label:Ce,deepLink:re,type:Z,key:W}=Fe,K="errorMessage"in Fe?Fe.errorMessage:null,U="statusCode"in Fe?Fe.statusCode:null;return a.jsxs("div",{children:[a.jsx(jb,{variant:"overline_medium",children:Ce}),a.jsx(Yp,{value:Oe,error:K,deepLink:re,statusCode:U,isLoading:m,type:Z,cardTitle:n,currentCard:s,cardId:t,fieldName:Ce,attachmentKey:W})]},Ce)}):a.jsx(f.Box,{margin:"8px 0",children:a.jsx(Xs,{variant:"body_sm_regular",children:c??OE})})})})}),!A&&te&&a.jsx(Yb,{variant:"body_xs_medium",onClick:ue,children:w?a.jsxs(a.Fragment,{children:[x?T7:U3,a.jsx(Jb,{transformAngle:H})]}):U3})]})},bM={connectorCards:null,cardSpecificData:null,connectorApiStatus:Ae.IDLE,conversationMetaDataApiStatus:Ae.IDLE,specificConnectorApiStatus:null,threadId:null,connectorsEnabled:!1,specificConnectorErrorCode:null,conversationEmailHeaders:null,cardLookupKey:null,prefilledCardKeys:null,keyedCardData:null,freshReadsUntil:null,relatedLookup:null},Up=({inboxIds:e,conversationId:t,channelType:n="email",connectorId:r})=>{const o=new URLSearchParams;return e.forEach(u=>o.append("inbox_ids",u)),o.append("channel_type",n),o.append("conversation_id",String(t||"")),r&&o.append("connector_id",String(r)),Ee({url:`${KO}?${o.toString()}`,method:ve.GET})},Kp=(e,t,n,r,o,u=[],s,i=!1)=>{const c=new URLSearchParams;return c.append("senderEmail",t),c.append("conversation_id",String(n||"")),r&&c.append("externalResourceId",r),o&&c.append("smId",o),u.forEach(l=>c.append("inbox_ids",l)),s&&(c.append("hiverParam",s.hiverParam),c.append("hiverParamValue",s.value)),i&&c.append("isRefresh","true"),Ee({url:`${$O.replace(":id",e)}?${c.toString()}`,method:ve.GET})},ri=(e,t)=>t?`${e}_${t}`:e,xM=6e4,$p=({externalResourceId:e,lookup:t})=>!e&&!!t,Ur=({email:e,externalResourceId:t,lookup:n})=>t?`ext:${t}:${e}`:n?`id:${n.hiverParam}:${n.value}`:`email:${e}`,e5=rf({name:"connectorCardLibrary",initialState:bM,reducers:{updateThreadId(e,t){const{payload:n}=t;e.threadId=n.threadId,e.connectorCards=null},clearConnectorList(e){e.connectorCards=null,e.cardSpecificData=null,e.cardLookupKey=null,e.prefilledCardKeys=null,e.keyedCardData=null,e.relatedLookup=null},requireFreshReads(e){e.freshReadsUntil=Date.now()+xM},consumePrefilledCard(e,t){var r;if(!((r=e.prefilledCardKeys)!=null&&r[t.payload]))return;const n={...e.prefilledCardKeys};delete n[t.payload],e.prefilledCardKeys=n},setRelatedLookupStatus(e,t){const{connectorId:n,...r}=t.payload;e.relatedLookup={...e.relatedLookup??{},[n]:r}},clearRelatedLookup(e,t){var r;if(!((r=e.relatedLookup)!=null&&r[t.payload]))return;const n={...e.relatedLookup};delete n[t.payload],e.relatedLookup=n},replaceAppCards(e,t){const{connectorId:n,pinned:r,cards:o,cardData:u,lookupKey:s}=t.payload,i=e.connectorCards??[],c=i.findIndex(h=>h.connectorId===n),l=i.find(h=>h.id===r.id&&h.externalResourceId===r.externalResourceId),D=i.filter(h=>h.connectorId!==n),d=c===-1?D.length:i.slice(0,c).filter(h=>h.connectorId!==n).length,m=l?[l,...o]:o;e.connectorCards=[...D.slice(0,d),...m,...D.slice(d)];const b={...e.specificConnectorApiStatus??{}},C={...e.cardLookupKey??{}},g={...e.prefilledCardKeys??{}},A={...e.keyedCardData??{}};Object.entries(u).forEach(([h,E])=>{b[h]=Ae.IDLE,C[h]=s,g[h]=s,s&&!E.cardErrorMessage&&(A[h]={...A[h],[s]:E})}),e.keyedCardData=A,e.prefilledCardKeys=g,e.cardSpecificData={...e.cardSpecificData??{},...u},e.specificConnectorApiStatus=b,e.cardLookupKey=C}},extraReducers:e=>{e.addCase(Wa.pending,t=>{t.connectorApiStatus=Ae.LOADING}).addCase(Wa.fulfilled,(t,n)=>{t.connectorApiStatus=Ae.IDLE,t.connectorCards=n.payload.cards,t.connectorsEnabled=n.payload.connectorsEnabled}).addCase(Wa.rejected,t=>{t.connectorApiStatus=Ae.FAILED}).addCase(Ga.pending,(t,n)=>{const{id:r,externalResourceId:o=""}=n.meta.arg,u=ri(r,o);t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[u]:Ae.LOADING},t.cardLookupKey={...t.cardLookupKey??{},[u]:Ur(n.meta.arg)}}).addCase(Ga.fulfilled,(t,n)=>{var c,l;const{id:r,externalResourceId:o=""}=n.meta.arg,u=ri(r,o);if(((c=t.cardLookupKey)==null?void 0:c[u])!==Ur(n.meta.arg))return;const{data:s}=n.payload||{};s&&(t.cardSpecificData={...t.cardSpecificData?t.cardSpecificData:{},[u]:s});const i=Ur(n.meta.arg);$p(n.meta.arg)&&s&&"cardType"in s&&!s.cardErrorMessage&&(t.keyedCardData={...t.keyedCardData??{},[u]:{...(l=t.keyedCardData)==null?void 0:l[u],[i]:s}}),t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[u]:Ae.IDLE}}).addCase(Ga.rejected,(t,n)=>{var i;const{id:r,externalResourceId:o=""}=n.meta.arg,u=ri(r,o);if(((i=t.cardLookupKey)==null?void 0:i[u])!==Ur(n.meta.arg))return;t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[u]:Ae.FAILED};const s=n.payload&&typeof n.payload=="object"&&"code"in n.payload?String(n.payload.code):w3;t.specificConnectorErrorCode={...t.specificConnectorErrorCode??{},[u]:s}})}}),Wa=$n("connectorCardLibrary/fetchAllCard",async({inboxIds:e,channelType:t,conversationId:n,connectorId:r})=>{var c;const o=await Up({inboxIds:e,channelType:t,conversationId:n,connectorId:r});if(!Array.isArray((c=o==null?void 0:o.data)==null?void 0:c.cards))return{cards:[],connectorsEnabled:!1};const{cards:u,connectorsEnabled:s=!1}=o.data;return{cards:u.map(l=>yp(l)).sort((l,D)=>(l==null?void 0:l.priority)-(D==null?void 0:D.priority)),connectorsEnabled:s}}),Ga=$n("connectorCardLibrary/fetchSpecificCard",async({id:e,email:t,conversationId:n,isRefresh:r,externalResourceId:o,smId:u,smIds:s,lookup:i},c)=>{var d,m;const{cardList:l}=c.getState(),D=r||Date.now()<(l.freshReadsUntil??0);if(!D&&$p({externalResourceId:o,lookup:i})){const b=(m=(d=l.keyedCardData)==null?void 0:d[e])==null?void 0:m[Ur({email:t,lookup:i})];if(b)return{data:b,status:200}}try{const b=await Kp(e,t,n,o,u,s,o?void 0:i,D),C=b==null?void 0:b.data,g=b==null?void 0:b.status;return C?(r&&Ge({message:_A,type:Rn}),{data:U0(C),status:g}):(r&&Ge({message:MA,type:dt}),{data:{},status:g})}catch(b){const C=b;return c.rejectWithValue({...C,code:C.code||w3})}},{condition:(e,{getState:t})=>{var o,u;if(e.isRefresh)return!0;const{cardList:n}=t(),r=ri(e.id,e.externalResourceId);return!(((o=n.specificConnectorApiStatus)==null?void 0:o[r])===Ae.LOADING&&((u=n.cardLookupKey)==null?void 0:u[r])===Ur(e))}}),yM=e5.reducer,Nr=e5.actions,t5=p.createContext({isEnabled:!1,heldConnectorIds:new Set,trackIdLookupEvent:()=>{},retryRelatedLookup:()=>{}}),n5=()=>p.useContext(t5),BM=(e,t)=>e==="all"||!!t&&e.has(t),w1={};let Hn={};const S1=new Set,r5=new Set,o5=new Map;let u5,I1=0;const a5=new Set,k1=()=>S1.forEach(e=>e()),oi=(e,t)=>`${e}:${t}`,ui=(e,t,n)=>{Hn={...Hn,[e]:{...Hn[e]??{},[t]:{...n,selectedAt:Date.now()}}},k1()},vM=(e,t)=>{var r;if(!((r=Hn[e])!=null&&r[t]))return;const n={...Hn[e]};delete n[t],Hn={...Hn,[e]:n},k1()},wM=e=>{if(!Hn[e])return;const t={...Hn};delete t[e],Hn=t,k1()},SM=e=>Hn[e]??w1,IM=e=>{e!==u5&&(u5=e,I1+=1)},Va=(e,t)=>r5.add(oi(e,t)),kM=(e,t)=>o5.set(oi(e,t),I1),ai=(e,t)=>{const n=oi(e,t);return r5.has(n)||o5.get(n)===I1},TM=(e,t)=>{const n=oi(e,t);return a5.has(n)?!1:(a5.add(n),!0)},LM=e=>(S1.add(e),()=>S1.delete(e)),s5=e=>{const t=p.useSyncExternalStore(LM,()=>Hn);return e?t[String(e)]??w1:w1},OM=(e,t)=>{const n=s5(e);return t?n[t]:void 0},f5=e=>I.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M9.76618 2.23341C8.79952 1.26675 7.47285 0.666748 5.99952 0.666748C3.05285 0.666748 0.672852 3.05341 0.672852 6.00008C0.672852 8.94675 3.05285 11.3334 5.99952 11.3334C8.48619 11.3334 10.5595 9.63341 11.1529 7.33341H9.76618C9.21952 8.88675 7.73952 10.0001 5.99952 10.0001C3.79285 10.0001 1.99952 8.20675 1.99952 6.00008C1.99952 3.79341 3.79285 2.00008 5.99952 2.00008C7.10618 2.00008 8.09285 2.46008 8.81285 3.18675L6.66618 5.33341H11.3329V0.666748L9.76618 2.23341Z",fill:"var(--connector-neutral-icon, #6C7B94)"})),MM=e=>I.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M11.4587 6.7528C11.2244 6.51848 10.8445 6.51848 10.6102 6.7528C10.3759 6.98711 10.3759 7.36701 10.6102 7.60132L11.4587 6.7528ZM12.1916 8.33414L12.6158 7.90988L12.1916 8.33414ZM8.33462 12.1911L8.75888 11.7668L8.33462 12.1911ZM7.6018 10.6097C7.36748 10.3754 6.98758 10.3754 6.75327 10.6097C6.51895 10.8441 6.51895 11.224 6.75327 11.4583L7.6018 10.6097ZM4.43911 9.14411C4.67343 9.37842 5.05333 9.37842 5.28764 9.14411C5.52196 8.9098 5.52196 8.5299 5.28764 8.29558L4.43911 9.14411ZM3.70629 7.56276L4.13056 7.1385L3.70629 7.56276ZM7.56324 3.70582L7.9875 3.28155L7.56324 3.70582ZM8.29606 5.28716C8.53037 5.52148 8.91027 5.52148 9.14459 5.28716C9.3789 5.05285 9.3789 4.67295 9.14459 4.43864L8.29606 5.28716ZM10.6102 7.60132L11.7673 8.75841L12.6158 7.90988L11.4587 6.7528L10.6102 7.60132ZM11.7673 8.75841C12.1662 9.15735 12.3904 9.69843 12.3904 10.2626L13.5904 10.2626C13.5904 9.38017 13.2398 8.53387 12.6158 7.90988L11.7673 8.75841ZM12.3904 10.2626C12.3904 10.8268 12.1662 11.3679 11.7673 11.7668L12.6158 12.6154C13.2398 11.9914 13.5904 11.1451 13.5904 10.2626L12.3904 10.2626ZM11.7673 11.7668C10.9365 12.5976 9.58963 12.5976 8.75888 11.7668L7.91035 12.6154C9.20973 13.9147 11.3164 13.9147 12.6158 12.6154L11.7673 11.7668ZM8.75888 11.7668L7.6018 10.6097L6.75327 11.4583L7.91035 12.6154L8.75888 11.7668ZM5.28764 8.29558L4.13056 7.1385L3.28203 7.98703L4.43911 9.14411L5.28764 8.29558ZM4.13056 7.1385C3.73162 6.73956 3.50749 6.19848 3.50749 5.63429L2.30749 5.63429C2.30749 6.51674 2.65804 7.36304 3.28203 7.98703L4.13056 7.1385ZM3.50749 5.63429C3.50749 5.0701 3.73162 4.52902 4.13056 4.13008L3.28203 3.28155C2.65804 3.90554 2.30749 4.75184 2.30749 5.63429L3.50749 5.63429ZM4.13056 4.13008C4.96131 3.29933 6.30822 3.29933 7.13897 4.13008L7.9875 3.28155C6.68812 1.98217 4.58141 1.98217 3.28203 3.28155L4.13056 4.13008ZM7.13897 4.13008L8.29606 5.28716L9.14459 4.43864L7.9875 3.28155L7.13897 4.13008Z",fill:"currentColor"}),I.createElement("rect",{x:5.08887,y:6.0791,width:1.33333,height:6.66667,rx:.666667,transform:"rotate(-45 5.08887 6.0791)",fill:"currentColor"}),I.createElement("path",{d:"M5.59961 14.3998V12.7998",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{d:"M12.7998 5.59961H14.3998",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{d:"M2.40039 11.2002H4.00039",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{d:"M11.2002 2.40039V4.00039",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})),_M=e=>I.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("g",{clipPath:"url(#clip0_5908_39767)"},I.createElement("path",{d:"M9.37333 6.01333L9.98667 6.62667L3.94667 12.6667H3.33333V12.0533L9.37333 6.01333ZM11.7733 2C11.6067 2 11.4333 2.06667 11.3067 2.19333L10.0867 3.41333L12.5867 5.91333L13.8067 4.69333C14.0667 4.43333 14.0667 4.01333 13.8067 3.75333L12.2467 2.19333C12.1133 2.06 11.9467 2 11.7733 2ZM9.37333 4.12667L2 11.5V14H4.5L11.8733 6.62667L9.37333 4.12667Z",fill:"var(--connector-neutral-icon, #6C7B94)"})),I.createElement("defs",null,I.createElement("clipPath",{id:"clip0_5908_39767"},I.createElement("rect",{width:16,height:16,fill:"white"})))),fn=p.createContext({}),i5=()=>{const{currentSmIds:e}=p.useContext(Ue),{smIds:t}=p.useContext(fn);return e!=null&&e.length?e:t},za=()=>{const e=i5();return p.useMemo(()=>(e==null?void 0:e.length)===1?String(e[0]):void 0,[e])},Iu=()=>{const e=i5();return p.useMemo(()=>(e??[]).map(t=>String(t)),[e])},T1=(e,t,n=[])=>{const r=new URLSearchParams;t&&r.append("smId",t),n.forEach(u=>r.append("inbox_ids",u));const o=r.toString();return o?`${e}?${o}`:e},c5=e=>e.write.createObjectList,jM=e=>e.write.createObjectConnectorNamesList,l5=e=>e.write.linkObjectList,NM=e=>e.write.editObjectList,si=e=>e.write.objectDict,D5=e=>e.write.formFields,d5=e=>e.write.linkCardApiStatus,PM=e=>e.write.unlinkCardApiStatus,A5=e=>e.write.dependentFieldsMap,QM=e=>e.write.createFormApiStatus,RM=e=>e.write.updateFormApiStatus,HM=e=>e.write.currentResourceDetails,WM=e=>e.write.currentResourceDetailsApiStatus,p5=e=>e.write.currentCardInEdit,g5=e=>e.write.hasUnsavedChanges,GM=e=>Array.isArray(e)&&e.some(t=>!!t&&typeof t=="object"&&Bu.ROW_ID in t),VM=e=>e.map(t=>Object.fromEntries(Object.entries(t).filter(([n,r])=>n!==Bu.ROW_ID&&r!==""&&r!==null&&r!==void 0))).filter(t=>Object.keys(t).length>0),zM=e=>typeof e=="string"?/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/.test(e):typeof e=="object"&&"_isValid"in e,C5=e=>Object.keys(e).sort((n,r)=>r.localeCompare(n)).reduce((n,r)=>{var o;if(GM(e[r])){const u=VM(e[r]);return u.length&&(n[r]=u),n}return(typeof e[r]=="string"||typeof e[r]=="object"&&e[r]!==null)&&zM(e[r])?n[r]=(o=new Date(`${e[r]}`))==null?void 0:o.toString():n[r]=e[r],n},{}),h5=(e,t)=>JSON.stringify(C5(e))===JSON.stringify(C5(t)),XM=e=>QE.replace("{{connectorName}}",e),ZM=({showUnlinkModal:e,setShowUnlinkModal:t,cardId:n,onCardUnlinking:r,externalResourceId:o,conversationId:u,connectorName:s})=>{const i=Zt(),{sendTrackingEvent:c}=p.useContext(Ue),D=Se(PM)===Ae.LOADING,d=()=>{u&&o&&i(Kf({id:n,conversationId:u,externalResourceId:o})).unwrap().then(()=>{c(Sm,{connector_name:s,conversation_id:u}),t(!1),r(),Ge({message:ny,type:Rn})}).catch(()=>{Ge({message:ry,type:Rn})})};return a.jsx(rr,{shown:e,setShown:t,showCloseButton:!0,children:a.jsxs(f.Stack,{width:"400px",padding:"20px",gap:"8px",children:[a.jsx(f.Typography,{variant:"h2",children:PE}),a.jsx(f.Typography,{variant:"body2",children:XM(s)}),a.jsxs(f.Stack,{direction:"row",gap:"8px",marginTop:"20px",justifyContent:"flex-end",children:[a.jsx(f.Button,{variant:"text",onClick:()=>t(!1),children:Z0}),a.jsx(f.Button,{disabled:D,color:"error",onClick:d,children:x3})]})]})})},JM=({actions:e,isHovered:t=!1})=>{const r=e.filter(i=>i.shown);if(r.length===0)return null;const o=r[r.length-1],u=r.slice(0,-1),s=t?(u.length+1)*32:32;return a.jsxs(Hb,{width:s,isHovered:t,children:[a.jsx("div",{className:"hidden-actions",children:u.map(({id:i,disabled:c,label:l,icon:D,action:d})=>a.jsx(f.Tooltip,{title:l,placement:"bottom",children:a.jsx(Au,{onClick:d,disabled:c,children:D})},i))}),o&&a.jsx(f.Tooltip,{title:o.label,placement:"bottom",children:a.jsx(Au,{onClick:o.action,disabled:o.disabled,children:o.icon})},o.id)]})},YM=e=>{var n,r,o,u,s,i;if(!e||!("cardType"in e))return"empty";if(e.cardErrorMessage)return"error";const t=e.cardType==="flat"?(r=(n=e.data)==null?void 0:n.flatDisplay)==null?void 0:r.data:(i=(s=(u=(o=e.data)==null?void 0:o.listItems)==null?void 0:u.fields)==null?void 0:s[0])==null?void 0:i.data;return t!=null&&t.length?"result":"empty"},F5=e=>{const{card:t,specificCardData:n,email:r,specificConnectorApiStatus:o,defaultOpenState:u=!1,onCardUnlinking:s}=e,i=Zt(),{availableFeatures:c,sendTrackingEvent:l,conversationId:D,currentSmIds:d}=p.useContext(Ue),{userGroupId:m}=an()||{},[b,C]=p.useState(!!u),[g,A]=p.useState(!1),[h,E]=p.useState(!1),[F,x]=p.useState(!1),{id:y,title:S,externalResourceId:v="",forms:w=[],logoUrl:k,isIdRecordCard:O=!1}=t;let j=y;v&&(j=`${j}_${v}`);const{data:T,cardType:L,cardErrorMessage:M,connectorNames:_}=(n==null?void 0:n[j])??{},P=(_==null?void 0:_[0])||"",G=(o==null?void 0:o[j])===Ae.LOADING,z=(o==null?void 0:o[j])===Ae.FAILED,V=!!(lt(c,g3)&&v&&!O),{isEnabled:H,heldConnectorIds:J,trackIdLookupEvent:X}=n5(),te=OM(H?D:void 0,t.connectorId),ue=p.useMemo(()=>te&&!v?{hiverParam:te.hiverParam,value:te.value}:void 0,[te,v]),ee=!!ue||O&&!!te?te:void 0,fe=Se(ye=>{var je,Je;return!!t.connectorId&&((Je=(je=ti(ye))==null?void 0:je[t.connectorId])==null?void 0:Je.status)==="loading"}),Fe=H&&!v&&(fe||BM(J,t.connectorId)),Oe=Ur({email:r,externalResourceId:v,lookup:ue}),Ce=Se(ye=>{var je;return(je=ZO(ye))==null?void 0:je[j]}),re=Se(ye=>{var je;return(je=JO(ye))==null?void 0:je[j]}),Z=p.useMemo(()=>{var ye,je;if(O||M||z||!(lt(c,EE)&&w.some(Je=>Je.type==="edit")))return!1;switch(L){case"flat":return!!((T==null?void 0:T.flatDisplay.externalResourceId)??t.externalResourceId);case"flat_with_list":return((ye=T==null?void 0:T.listItems)==null?void 0:ye.fields.length)===1?(je=T==null?void 0:T.listItems)==null?void 0:je.fields.some(Je=>Je.externalResourceId):!1;default:return!1}},[T,L,c,w,t,M,z,O]),W=za(),K=Iu(),U=K.join(","),$=p.useRef({lookup:ue,cardIdKey:ee,trackIdLookupEvent:X,sendTrackingEvent:l,title:S,currentSmIds:d});$.current={lookup:ue,cardIdKey:ee,trackIdLookupEvent:X,sendTrackingEvent:l,title:S,currentSmIds:d};const de=p.useCallback((ye=!1)=>{const je=ye?Tm:km;if(r&&y&&D&&!Fe){const{lookup:Je,cardIdKey:jt,trackIdLookupEvent:zt,sendTrackingEvent:Pt,title:Qt,currentSmIds:At}=$.current,pt=it=>{jt&&t.connectorId&&zt(tE,t.connectorId,{card_id:y,id_field_key:jt.hiverParam,outcome:it})};i(Ga({id:y,email:r,conversationId:D,externalResourceId:v,smId:W,smIds:U?U.split(","):[],lookup:Je})).unwrap().then(it=>{const Ft={...k3(it,Qt,ye,!0),sm_ids:At};Pt(je,Ft),pt(YM(it==null?void 0:it.data))}).catch(it=>{if((it==null?void 0:it.name)==="ConditionError")return;const Ft={...k3(it,Qt,ye,!1),sm_ids:At};Pt(je,Ft),pt("error")})}},[i,Fe,Oe,t.connectorId,r,y,D,v,W,U]);p.useEffect(()=>{if(b){if(re&&re===Oe){i(Nr.consumePrefilledCard(j));return}de(!0)}},[b,de]);const he=(ye,je)=>{ye==null||ye.stopPropagation(),i(Ga({id:je,email:r,conversationId:D,isRefresh:!0,externalResourceId:v,smId:W,smIds:K,lookup:ue})).unwrap().then(()=>{l(Fm,{id:je})});const Je=ye.currentTarget.querySelector("svg");Je==null||Je.classList.remove("selected"),setTimeout(()=>Je==null?void 0:Je.classList.add("selected"),1)},ae=(ye,je)=>{ye.stopPropagation(),(!(n!=null&&n[je])||Ce!==Oe)&&!G&&de(),l(b?hm:Cm,{id:je}),C(Je=>!Je)},le=ye=>{ye.stopPropagation();const je=ye.currentTarget.offsetWidth<ye.currentTarget.scrollWidth;A(!!je)},Me=ye=>{var Je,jt;ye.stopPropagation(),l(f3,{card_title:S,connector_name:P,ug_id:m,sm_ids:d});let je;L==="flat"?je=(T==null?void 0:T.flatDisplay.externalResourceId)??t.externalResourceId:L==="flat_with_list"&&(je=(jt=(Je=T==null?void 0:T.listItems)==null?void 0:Je.fields[0])==null?void 0:jt.externalResourceId),je?i(Oo({...t,externalResourceId:je})):Ge({message:Lr,type:dt})},ze=ye=>{ye.stopPropagation(),E(!0)},rn=()=>{x(!0)},kt=()=>{x(!1)},Ot=[{id:"unlink",label:x3,disabled:G,shown:V,icon:a.jsx(MM,{}),action:ye=>ze(ye)},{id:"refresh",label:m3,shown:!0,icon:a.jsx(f5,{}),action:ye=>he(ye,y),disabled:G||Fe},{id:"edit",label:y3,disabled:G,shown:Z,icon:a.jsx(_M,{}),action:ye=>Me(ye)}];return a.jsxs(Tb,{"data-testid":`test_${y}`,onMouseEnter:rn,onMouseLeave:kt,children:[a.jsxs(Lb,{className:b?"hiver-card-expanded":"",onClick:ye=>ae(ye,j),children:[a.jsxs(Ob,{children:[k&&a.jsx("img",{src:k,alt:S}),a.jsx(f.Tooltip,{title:g?S:"",placement:"bottom",children:a.jsx(Mb,{variant:"body_sm_regular",onMouseOver:ye=>le(ye),onMouseLeave:ye=>le(ye),children:S})})]}),a.jsxs(R3,{children:[a.jsx(JM,{actions:Ot,isHovered:F}),a.jsx(f.Tooltip,{title:b?E3:V0,placement:"bottom",children:a.jsx(Au,{onClick:ye=>ae(ye,j),children:a.jsx(rc,{className:b?"":"hiver-up"})})})]})]}),a.jsx(qp,{id:j,cardTitle:t.title,currentCard:t,specificCardData:n,specificConnectorApiStatus:o,isOpen:b,isHeld:Fe,emptyMessage:ee?P7(S,ee.label,ee.displayValue||ee.value):void 0,onRetry:ee&&!_O(M)?()=>de():void 0}),a.jsx(ZM,{showUnlinkModal:h,setShowUnlinkModal:E,cardId:y,onCardUnlinking:()=>s(t),conversationId:D,externalResourceId:v,connectorName:P})]})},m5="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.86993%200.652446C7.56922%200.248711%208.43078%200.248711%209.13007%200.652446L13.7981%203.34755C14.4974%203.75129%2014.9282%204.49742%2014.9282%205.30489V10.6951C14.9282%2011.5026%2014.4974%2012.2487%2013.7981%2012.6524L9.13007%2015.3476C8.43078%2015.7513%207.56922%2015.7513%206.86993%2015.3476L2.20187%2012.6524C1.50258%2012.2487%201.0718%2011.5026%201.0718%2010.6951V5.30489C1.0718%204.49742%201.50258%203.75129%202.20187%203.34755L6.86993%200.652446Z'%20fill='%23FFD122'/%3e%3cg%20filter='url(%23filter0_d_360_39563)'%3e%3cpath%20d='M5.83154%204.43359V4.43359C6.84296%204.43359%207.66287%205.25351%207.66287%206.26492V11.5179V11.5179C6.65146%2011.5179%205.83154%2010.698%205.83154%209.68661V4.43359Z'%20fill='white'/%3e%3c/g%3e%3cg%20filter='url(%23filter1_d_360_39563)'%3e%3cpath%20d='M8.57812%207.66211V7.66211C9.58954%207.66211%2010.4095%208.48202%2010.4095%209.49343V11.7103V11.7103C9.39804%2011.7103%208.57812%2010.8904%208.57812%209.87898V7.66211Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_360_39563'%20x='4.76488'%20y='3.36693'%20width='3.96488'%20height='9.21732'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='0.533333'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.114019%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_360_39563'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_360_39563'%20result='shape'/%3e%3c/filter%3e%3cfilter%20id='filter1_d_360_39563'%20x='7.51146'%20y='6.59544'%20width='3.96488'%20height='6.18216'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='0.533333'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.114019%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_360_39563'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_360_39563'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",L1=e=>Ee({url:fM.replace(":connectorId",e),method:ve.GET}),qM=e=>Ee({url:iM.replace(":connectorId",e),method:ve.POST}),UM={byConnectorId:{}},KM=new Set(["popup_blocked","in_progress_timeout","start_user_auth_failed","popup_closed","cancelled"]),E5=rf({name:"userAuth",initialState:UM,reducers:{userAuthStatusReceived(e,t){const{connectorId:n,state:r,reason:o,externalUserId:u,authoritative:s}=t.payload,i=e.byConnectorId[n];(i==null?void 0:i.state)==="in_progress"&&r!=="connected"&&!s||(e.byConnectorId[n]={state:r,reason:o,externalUserId:u,connectUrl:i==null?void 0:i.connectUrl,lastChecked:Date.now()})},userAuthRequired(e,t){const{connectorId:n,connectUrl:r,reason:o}=t.payload,u=e.byConnectorId[n];(u==null?void 0:u.state)!=="in_progress"&&(e.byConnectorId[n]={state:"disconnected",reason:o,connectUrl:r,externalUserId:u==null?void 0:u.externalUserId,lastChecked:Date.now()})},userAuthInProgress(e,t){const{connectorId:n}=t.payload,r=e.byConnectorId[n]||{state:"unknown"};e.byConnectorId[n]={...r,state:"in_progress",lastChecked:Date.now()}},userAuthCompleted(e,t){const{connectorId:n,externalUserId:r}=t.payload;e.byConnectorId[n]={state:"connected",externalUserId:r,lastChecked:Date.now()}},userAuthFailed(e,t){const{connectorId:n,reason:r}=t.payload,o=e.byConnectorId[n];e.byConnectorId[n]={...o,state:KM.has(r)?"disconnected":"reauth_required",reason:r,lastChecked:Date.now()}},userAuthReset(e,t){delete e.byConnectorId[t.payload.connectorId]}}}),{userAuthStatusReceived:O1,userAuthRequired:$M,userAuthInProgress:e_,userAuthCompleted:xY,userAuthFailed:ku,userAuthReset:yY}=E5.actions,t_=E5.reducer,n_={state:"unknown"},Xa=(e,t)=>e.userAuth.byConnectorId[t]||n_,r_=new Set(["disconnected","in_progress","reauth_required","workspace_mismatch"]),o_=(e,t)=>r_.has(Xa(e,t).state),u_=e=>{for(const[t,n]of Object.entries(e.userAuth.byConnectorId))if(n.state==="in_progress")return t},a_=2e3,s_=5*60*1e3,M1=new Map;function Tu(e,t={}){const n=Zt(),r=vt(),o=Se(b=>Xa(b,e)),{onConnected:u,onFailed:s}=t,i=p.useRef(u);i.current=u;const c=p.useRef(s);c.current=s;const l=p.useRef(!1),D=p.useRef(null),d=p.useRef(null);p.useEffect(()=>{if(o.state==="in_progress")return;const b=M1.get(e);b&&(M1.delete(e),o.state==="connected"?b.onConnected():b.onFailed(o.reason??o.state))},[e,o]),Ct({queryKey:["userAuthStatus",e],queryFn:async()=>{const b=await L1(e),C=(b==null?void 0:b.data)??b;return C.state==="connected"&&(n(O1({connectorId:e,state:C.state,reason:C.reason,externalUserId:C.external_user_id})),d.current&&!d.current.closed&&d.current.close(),d.current=null),C},enabled:o.state==="in_progress",refetchInterval:o.state==="in_progress"?a_:!1,refetchOnWindowFocus:!1}),p.useEffect(()=>{if(o.state!=="in_progress"){D.current&&(clearTimeout(D.current),D.current=null);return}return D.current=setTimeout(()=>{n(ku({connectorId:e,reason:"in_progress_timeout"}))},s_),()=>{D.current&&(clearTimeout(D.current),D.current=null)}},[o.state,e,n]),p.useEffect(()=>{if(o.state!=="in_progress"){if(d.current&&!d.current.closed)try{d.current.close()}catch{}d.current=null}},[o.state]),p.useEffect(()=>{if(o.state!=="in_progress")return;const b=setInterval(async()=>{const C=d.current;if(!(!C||!C.closed)){clearInterval(b),d.current=null;try{const g=await L1(e),A=(g==null?void 0:g.data)??g,h=A.state==="connected"||A.state==="reauth_required"||A.state==="workspace_mismatch";n(h?O1({connectorId:e,state:A.state,reason:A.reason,externalUserId:A.external_user_id,authoritative:!0}):ku({connectorId:e,reason:"popup_closed"}))}catch{n(ku({connectorId:e,reason:"popup_closed"}))}}},800);return()=>clearInterval(b)},[o.state,e,n]);const m=p.useCallback(async()=>{if(!l.current){l.current=!0,M1.set(e,{onConnected:()=>{var b;return(b=i.current)==null?void 0:b.call(i)},onFailed:b=>{var C;return(C=c.current)==null?void 0:C.call(c,b)}}),n(e_({connectorId:e}));try{const b=await qM(e),C=(b==null?void 0:b.data)??b,g=C==null?void 0:C.auth_url;if(!g)throw new Error("No auth_url returned from /user-auth/start");const A=600,h=700,E=window.screen.width/2-A/2,F=window.screen.height/2-h/2,x=window.open(g,"user_auth_popup",`width=${A},height=${h},left=${E},top=${F},menubar=no,toolbar=no`);d.current=x,x||n(ku({connectorId:e,reason:"popup_blocked"}))}catch(b){He.error("startUserAuth failed: ",b),n(ku({connectorId:e,reason:"start_user_auth_failed"}))}finally{l.current=!1,r.invalidateQueries({queryKey:["userAuthStatus",e]})}}},[e,n,r]);return{entry:o,state:o.state,connect:m,isStarting:l.current}}const b5=(e,t,n)=>({queryKey:["userAuthStatus",e,"initial"],queryFn:async()=>{const r=await L1(e),o=(r==null?void 0:r.data)??r;return t(O1({connectorId:e,state:o.state,reason:o.reason,externalUserId:o.external_user_id})),o},enabled:n,refetchOnWindowFocus:!1,staleTime:3e4});function fi(e,t){const n=Zt(),r=Ct(b5(e,n,t));return{isLoading:t&&r.isLoading}}function f_(e){const t=Zt();return{isResolving:o0({queries:e.map(r=>b5(r,t,!0))}).some(r=>r.isLoading)}}const i_=f.styled(f.Box)`
|
|
2760
|
+
`,Jp=()=>a.jsx(hn,{variant:"rounded",width:"100%",height:35,animation:"wave",sx:{borderRadius:"8px"}}),FM=({attachment:e,onPreview:t})=>{const{filename:n,url:r}=e,o=X8(e.mimeType,n,r),u={...e,mimeType:o??""};return a.jsx(f.Tooltip,{title:"Preview",placement:"top",children:a.jsxs(pM,{role:"button",tabIndex:0,onClick:()=>t(u),onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),t(u))},children:[a.jsx(gM,{children:a.jsx(J8,{mimeType:o})}),a.jsx(CM,{title:n,children:n}),a.jsx(f.Tooltip,{title:"Download",placement:"top",children:a.jsx(hM,{className:"attachment-action",href:r,download:n,type:o,target:"_blank",rel:"noopener noreferrer","aria-label":`Download ${n}`,onClick:s=>s.stopPropagation(),children:a.jsx(Z8,{})})})]})})},mM=({attachments:e,isLoading:t=!1,onPreviewError:n})=>{const[r,o]=p.useState(null),[u,s]=p.useState(!1),i=c=>{c.url||n==null||n("missing_url",c.mimeType||void 0),o(c),s(!0)};return e!=null&&e.length?a.jsxs(a.Fragment,{children:[a.jsxs(AM,{children:[e.map((c,l)=>a.jsx(FM,{attachment:c,onPreview:i},`${l}_${c.filename}`)),t&&a.jsx(Jp,{})]}),a.jsx(K8,{attachment:r,open:u,onClose:()=>s(!1),onLoadError:()=>n==null?void 0:n("load_error",(r==null?void 0:r.mimeType)||void 0)})]}):t?a.jsx(Jp,{}):a.jsx(nc,{variant:"caption_regular",children:gr})},EM=({initialAttachments:e,cardId:t,externalResourceId:n,fieldKey:r,cardType:o,appName:u})=>{const{conversationId:s,sendTrackingEvent:i}=p.useContext(Ue),{data:c,isFetching:l}=DM({cardId:t??"",key:r??"",conversationId:s,externalResourceId:n,enabled:!!t&&!!r}),D=Array.isArray(c==null?void 0:c.value)?c.value:e,d=l&&(c==null?void 0:c.completed)!==!0,m=p.useCallback((b,C)=>{i(sE,{card_type:o,app_name:u,attachment_key:r,failure_reason:b,file_type:C})},[i,o,u,r]);return a.jsx(mM,{attachments:D,isLoading:d,onPreviewError:m})},Yp=e=>{const{value:t,error:n,deepLink:r,statusCode:o,isLoading:u,type:s,redirectToAdminTab:i,isFailed:c,connectorNames:l,cardTitle:D,currentCard:d,cardId:m,isCardLevelError:b,fieldName:C,showErrorIcon:g,attachmentKey:A}=e,h=p.useRef(null),E=p.useRef(null),{email:F,currentSmIds:x,conversationId:y,sendTrackingEvent:S,connectorFunctions:v}=p.useContext(Ue),w=Se(XO),k=w==null?void 0:w[m],[O,j]=p.useState(!1),T=p.useMemo(()=>n&&b?NO(n,d==null?void 0:d.userAuthEnabled):c?v3.replace(/{{connector_name}}/g,(l==null?void 0:l[0])||""):F3,[n,c,l,b,d==null?void 0:d.userAuthEnabled]),L=p.useCallback(()=>{const X=n||jO(k,l),{error_code:te,error_message:ue}=Gp(X);S==null||S(Pm,{sm_ids:x,frontend_req_params:{email:F,conversationId:y,externalResourceId:d==null?void 0:d.externalResourceId},card_title:D,connector_name:l!=null&&l.length?l:"",error_code:te,error_message:ue})},[n,k,S,x,F,y,D,l,d==null?void 0:d.externalResourceId]);p.useEffect(()=>{(n&&b||c&&k)&&L()},[L,k,c,n,b]),p.useEffect(()=>{const X=r?E.current:h.current;if(X){const te=X.scrollHeight>X.clientHeight||X.scrollWidth>X.clientWidth;j(te)}},[t,r]);const M=o==G0.NOT_FOUND,_=!M&&(s==="attachment"||Array.isArray(t)&&t.length>0&&t.every(X=>X!==null&&typeof X=="object"&&"filename"in X&&"url"in X)),P=!M&&Array.isArray(t)&&t.every(X=>typeof X=="string"||typeof X=="number"||typeof X=="boolean");let G=M||t==null||t===void 0||Array.isArray(t)?gr:ei(t);if(s==="date"&&G&&G!==gr&&!M){const X=new Date(parseInt(G));G=isNaN(X.getTime())?gr:X.toLocaleDateString(navigator.language)}const z=!!n||c,V=()=>{i?v==null||v.redirectToAdmin():window.open(ZE,"_blank")},H=()=>{S==null||S(Qm,{sm_ids:x,card_title:D,field_name:C})},J=X=>{const te=/<>(.*?)<>/g,ue=X.split(te);return a.jsx(p.Fragment,{children:ue.map((R,ee)=>ee%2===1?a.jsx(Nb,{variant:"body2",onClick:V,children:R},ee):R)})};if(u)return a.jsx(hn,{variant:"rounded",width:"100%",height:16,animation:"wave",margin:"4px 0 0 0"});if(z)return a.jsxs(R3,{gap:"7px",children:[g?a.jsx(f.Stack,{marginTop:"3px",flexShrink:"0",children:a.jsx("img",{src:qO,width:"18px",height:"18px"})}):null,a.jsx(Xs,{variant:"body_sm_regular",children:T?J(T):F3})]});if(_){const X=Array.isArray(t)?t:[];return a.jsx(EM,{initialAttachments:X,cardId:d==null?void 0:d.id,externalResourceId:d==null?void 0:d.externalResourceId,fieldKey:A,cardType:d==null?void 0:d.type,appName:(d==null?void 0:d.connectorName)??(l==null?void 0:l[0])})}else if(P){const X=t;return X.length?a.jsx(Qb,{children:X.map((te,ue)=>a.jsx(Rb,{children:ei(te)},`${ue}_${String(te)}`))}):a.jsx(nc,{variant:"caption_regular",children:gr})}return a.jsx(f.Tooltip,{title:O?G:null,placement:"bottom",children:r?a.jsx(H3,{ref:E,target:"_blank",underline:"none",href:r,fontSize:`${f.theme.typography.body2.fontSize}px`,onClick:H,children:G||gr}):a.jsx(nc,{ref:h,variant:"caption_regular",children:G||gr})})},rr=({shown:e,setShown:t,children:n,showCloseButton:r=!1,borderRadius:o=4,sx:u})=>a.jsx(f.Dialog,{open:e,onClose:()=>t(!1),PaperProps:{style:{borderRadius:o,padding:0,height:"fit-content",width:"fit-content",maxWidth:"none"}},sx:{...u},children:a.jsxs(f.Stack,{direction:"row",children:[r&&a.jsx(f.Box,{position:"absolute",right:10,top:10,children:a.jsx(f.Tooltip,{title:"Close",placement:"bottom",children:a.jsx(f.IconButton,{onClick:()=>t(!1),sx:{color:"var(--connector-icon-secondary)",'& svg [fill]:not([fill="none"])':{fill:"currentColor"}},children:a.jsx(_0,{})})})}),n]})}),qp=e=>{var R,ee,fe;const{id:t,cardTitle:n,specificCardData:r,specificConnectorApiStatus:o,isOpen:u,currentCard:s,isHeld:i,emptyMessage:c,onRetry:l}=e,D=24,d=(o==null?void 0:o[t])===Ae.IDLE,m=(o==null?void 0:o[t])===Ae.LOADING,b=(o==null?void 0:o[t])===Ae.FAILED,{cardType:C,data:g,cardErrorMessage:A,redirectToAdminTab:h,connectorNames:E}=(r==null?void 0:r[t])||{},F=C==="flat",[x,y]=p.useState(!1),[S,v]=p.useState(!1),[w,k]=p.useState(!1),[O,j]=p.useState(!1),T=((R=g==null?void 0:g.listItems)==null?void 0:R.statusCode)!==401,L=p.useMemo(()=>{var Fe,Oe,Ce,re;return F&&((Fe=g==null?void 0:g.flatDisplay)!=null&&Fe.data)?g.flatDisplay.data:!F&&((re=(Ce=(Oe=g==null?void 0:g.listItems)==null?void 0:Oe.fields)==null?void 0:Ce[0])!=null&&re.data)?g.listItems.fields[0].data:[]},[F,g]),M=p.useMemo(()=>L==null?void 0:L.slice(0,5),[L]),[_,P]=p.useState([]),G=p.useRef(null),[z,V]=p.useState(0),H=x?-180:0,J=F?!1:!!((ee=g==null?void 0:g.listItems)!=null&&ee.errorMessage),X=J||b||A,te=d&&!J&&u&&(w||S);p.useLayoutEffect(()=>{const Fe=G.current;if(!Fe)return;const Oe=()=>{Fe.scrollHeight&&V(Fe.scrollHeight+D)};if(Oe(),typeof ResizeObserver>"u")return;const Ce=new ResizeObserver(Oe);return Ce.observe(Fe),()=>Ce.disconnect()},[o==null?void 0:o[t],_]),p.useEffect(()=>{var re,Z;const Fe=((L==null?void 0:L.length)||0)>5,Oe=!F&&(((Z=(re=g==null?void 0:g.listItems)==null?void 0:re.fields)==null?void 0:Z.length)||0)>1;k(Fe&&!Oe),v(Oe)},[g,F,L==null?void 0:L.length]),p.useEffect(()=>{P(x?L:M)},[g,x,M,L]);const ue=()=>{w?y(Fe=>!Fe):j(Fe=>!Fe)};return a.jsxs(a.Fragment,{children:[a.jsx(rr,{shown:O,setShown:j,showCloseButton:!0,borderRadius:12,children:a.jsx(HO,{data:((fe=g==null?void 0:g.listItems)==null?void 0:fe.fields)||[],title:n,currentCard:s,setShowModal:j})}),a.jsx(_b,{className:u?"":"slideUp",height:z,children:a.jsx(f.Stack,{ref:G,gap:1,margin:"12px",children:(m||i)&&!(_!=null&&_.length)?a.jsxs(a.Fragment,{children:[a.jsx(hn,{variant:"rounded",width:"100%",height:20,animation:"wave"}),a.jsx(hn,{variant:"rounded",width:"100%",height:20,animation:"wave"})]}):a.jsx(a.Fragment,{children:X?a.jsxs(f.Box,{margin:"8px 0",children:[a.jsx(Yp,{error:A,isLoading:m,redirectToAdminTab:h,isFailed:b,showErrorIcon:!T,connectorNames:E,cardId:t,cardTitle:n,currentCard:s,isCardLevelError:!0}),l?a.jsx(f.Button,{size:"small",variant:"text",disabled:m,onClick:l,sx:{marginTop:"4px"},children:$3}):null]}):_!=null&&_.length?_==null?void 0:_.map(Fe=>{const{value:Oe,label:Ce,deepLink:re,type:Z,key:W}=Fe,K="errorMessage"in Fe?Fe.errorMessage:null,U="statusCode"in Fe?Fe.statusCode:null;return a.jsxs("div",{children:[a.jsx(jb,{variant:"overline_medium",children:Ce}),a.jsx(Yp,{value:Oe,error:K,deepLink:re,statusCode:U,isLoading:m,type:Z,cardTitle:n,currentCard:s,cardId:t,fieldName:Ce,attachmentKey:W})]},Ce)}):a.jsx(f.Box,{margin:"8px 0",children:a.jsx(Xs,{variant:"body_sm_regular",children:c??OE})})})})}),!A&&te&&a.jsx(Yb,{variant:"body_xs_medium",onClick:ue,children:w?a.jsxs(a.Fragment,{children:[x?T7:U3,a.jsx(Jb,{transformAngle:H})]}):U3})]})},bM={connectorCards:null,cardSpecificData:null,connectorApiStatus:Ae.IDLE,conversationMetaDataApiStatus:Ae.IDLE,specificConnectorApiStatus:null,threadId:null,connectorsEnabled:!1,specificConnectorErrorCode:null,conversationEmailHeaders:null,cardLookupKey:null,prefilledCardKeys:null,keyedCardData:null,freshReadsUntil:null,relatedLookup:null},Up=({inboxIds:e,conversationId:t,channelType:n="email",connectorId:r})=>{const o=new URLSearchParams;return e.forEach(u=>o.append("inbox_ids",u)),o.append("channel_type",n),o.append("conversation_id",String(t||"")),r&&o.append("connector_id",String(r)),Ee({url:`${KO}?${o.toString()}`,method:ve.GET})},Kp=(e,t,n,r,o,u=[],s,i=!1)=>{const c=new URLSearchParams;return c.append("senderEmail",t),c.append("conversation_id",String(n||"")),r&&c.append("externalResourceId",r),o&&c.append("smId",o),u.forEach(l=>c.append("inbox_ids",l)),s&&(c.append("hiverParam",s.hiverParam),c.append("hiverParamValue",s.value)),i&&c.append("isRefresh","true"),Ee({url:`${$O.replace(":id",e)}?${c.toString()}`,method:ve.GET})},ri=(e,t)=>t?`${e}_${t}`:e,xM=6e4,$p=({externalResourceId:e,lookup:t})=>!e&&!!t,Ur=({email:e,externalResourceId:t,lookup:n})=>t?`ext:${t}:${e}`:n?`id:${n.hiverParam}:${n.value}`:`email:${e}`,e5=rf({name:"connectorCardLibrary",initialState:bM,reducers:{updateThreadId(e,t){const{payload:n}=t;e.threadId=n.threadId,e.connectorCards=null},clearConnectorList(e){e.connectorCards=null,e.cardSpecificData=null,e.cardLookupKey=null,e.prefilledCardKeys=null,e.keyedCardData=null,e.relatedLookup=null},requireFreshReads(e){e.freshReadsUntil=Date.now()+xM},consumePrefilledCard(e,t){var r;if(!((r=e.prefilledCardKeys)!=null&&r[t.payload]))return;const n={...e.prefilledCardKeys};delete n[t.payload],e.prefilledCardKeys=n},setRelatedLookupStatus(e,t){const{connectorId:n,...r}=t.payload;e.relatedLookup={...e.relatedLookup??{},[n]:r}},clearRelatedLookup(e,t){var r;if(!((r=e.relatedLookup)!=null&&r[t.payload]))return;const n={...e.relatedLookup};delete n[t.payload],e.relatedLookup=n},replaceAppCards(e,t){const{connectorId:n,pinned:r,cards:o,cardData:u,lookupKey:s}=t.payload,i=e.connectorCards??[],c=i.findIndex(h=>h.connectorId===n),l=i.find(h=>h.id===r.id&&h.externalResourceId===r.externalResourceId),D=i.filter(h=>h.connectorId!==n),d=c===-1?D.length:i.slice(0,c).filter(h=>h.connectorId!==n).length,m=l?[l,...o]:o;e.connectorCards=[...D.slice(0,d),...m,...D.slice(d)];const b={...e.specificConnectorApiStatus??{}},C={...e.cardLookupKey??{}},g={...e.prefilledCardKeys??{}},A={...e.keyedCardData??{}};Object.entries(u).forEach(([h,E])=>{b[h]=Ae.IDLE,C[h]=s,g[h]=s,s&&!E.cardErrorMessage&&(A[h]={...A[h],[s]:E})}),e.keyedCardData=A,e.prefilledCardKeys=g,e.cardSpecificData={...e.cardSpecificData??{},...u},e.specificConnectorApiStatus=b,e.cardLookupKey=C}},extraReducers:e=>{e.addCase(Wa.pending,t=>{t.connectorApiStatus=Ae.LOADING}).addCase(Wa.fulfilled,(t,n)=>{t.connectorApiStatus=Ae.IDLE,t.connectorCards=n.payload.cards,t.connectorsEnabled=n.payload.connectorsEnabled}).addCase(Wa.rejected,t=>{t.connectorApiStatus=Ae.FAILED}).addCase(Ga.pending,(t,n)=>{const{id:r,externalResourceId:o=""}=n.meta.arg,u=ri(r,o);t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[u]:Ae.LOADING},t.cardLookupKey={...t.cardLookupKey??{},[u]:Ur(n.meta.arg)}}).addCase(Ga.fulfilled,(t,n)=>{var c,l;const{id:r,externalResourceId:o=""}=n.meta.arg,u=ri(r,o);if(((c=t.cardLookupKey)==null?void 0:c[u])!==Ur(n.meta.arg))return;const{data:s}=n.payload||{};s&&(t.cardSpecificData={...t.cardSpecificData?t.cardSpecificData:{},[u]:s});const i=Ur(n.meta.arg);$p(n.meta.arg)&&s&&"cardType"in s&&!s.cardErrorMessage&&(t.keyedCardData={...t.keyedCardData??{},[u]:{...(l=t.keyedCardData)==null?void 0:l[u],[i]:s}}),t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[u]:Ae.IDLE}}).addCase(Ga.rejected,(t,n)=>{var i;const{id:r,externalResourceId:o=""}=n.meta.arg,u=ri(r,o);if(((i=t.cardLookupKey)==null?void 0:i[u])!==Ur(n.meta.arg))return;t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[u]:Ae.FAILED};const s=n.payload&&typeof n.payload=="object"&&"code"in n.payload?String(n.payload.code):w3;t.specificConnectorErrorCode={...t.specificConnectorErrorCode??{},[u]:s}})}}),Wa=$n("connectorCardLibrary/fetchAllCard",async({inboxIds:e,channelType:t,conversationId:n,connectorId:r})=>{var c;const o=await Up({inboxIds:e,channelType:t,conversationId:n,connectorId:r});if(!Array.isArray((c=o==null?void 0:o.data)==null?void 0:c.cards))return{cards:[],connectorsEnabled:!1};const{cards:u,connectorsEnabled:s=!1}=o.data;return{cards:u.map(l=>yp(l)).sort((l,D)=>(l==null?void 0:l.priority)-(D==null?void 0:D.priority)),connectorsEnabled:s}}),Ga=$n("connectorCardLibrary/fetchSpecificCard",async({id:e,email:t,conversationId:n,isRefresh:r,externalResourceId:o,smId:u,smIds:s,lookup:i},c)=>{var d,m;const{cardList:l}=c.getState(),D=r||Date.now()<(l.freshReadsUntil??0);if(!D&&$p({externalResourceId:o,lookup:i})){const b=(m=(d=l.keyedCardData)==null?void 0:d[e])==null?void 0:m[Ur({email:t,lookup:i})];if(b)return{data:b,status:200}}try{const b=await Kp(e,t,n,o,u,s,o?void 0:i,D),C=b==null?void 0:b.data,g=b==null?void 0:b.status;return C?(r&&Ge({message:_A,type:Rn}),{data:U0(C),status:g}):(r&&Ge({message:MA,type:dt}),{data:{},status:g})}catch(b){const C=b;return c.rejectWithValue({...C,code:C.code||w3})}},{condition:(e,{getState:t})=>{var o,u;if(e.isRefresh)return!0;const{cardList:n}=t(),r=ri(e.id,e.externalResourceId);return!(((o=n.specificConnectorApiStatus)==null?void 0:o[r])===Ae.LOADING&&((u=n.cardLookupKey)==null?void 0:u[r])===Ur(e))}}),yM=e5.reducer,Nr=e5.actions,t5=p.createContext({isEnabled:!1,heldConnectorIds:new Set,trackIdLookupEvent:()=>{},retryRelatedLookup:()=>{}}),n5=()=>p.useContext(t5),BM=(e,t)=>e==="all"||!!t&&e.has(t),w1={};let Hn={};const S1=new Set,r5=new Set,o5=new Map;let u5,I1=0;const a5=new Set,k1=()=>S1.forEach(e=>e()),oi=(e,t)=>`${e}:${t}`,ui=(e,t,n)=>{Hn={...Hn,[e]:{...Hn[e]??{},[t]:{...n,selectedAt:Date.now()}}},k1()},vM=(e,t)=>{var r;if(!((r=Hn[e])!=null&&r[t]))return;const n={...Hn[e]};delete n[t],Hn={...Hn,[e]:n},k1()},wM=e=>{if(!Hn[e])return;const t={...Hn};delete t[e],Hn=t,k1()},SM=e=>Hn[e]??w1,IM=e=>{e!==u5&&(u5=e,I1+=1)},Va=(e,t)=>r5.add(oi(e,t)),kM=(e,t)=>o5.set(oi(e,t),I1),ai=(e,t)=>{const n=oi(e,t);return r5.has(n)||o5.get(n)===I1},TM=(e,t)=>{const n=oi(e,t);return a5.has(n)?!1:(a5.add(n),!0)},LM=e=>(S1.add(e),()=>S1.delete(e)),s5=e=>{const t=p.useSyncExternalStore(LM,()=>Hn);return e?t[String(e)]??w1:w1},OM=(e,t)=>{const n=s5(e);return t?n[t]:void 0},f5=e=>I.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M9.76618 2.23341C8.79952 1.26675 7.47285 0.666748 5.99952 0.666748C3.05285 0.666748 0.672852 3.05341 0.672852 6.00008C0.672852 8.94675 3.05285 11.3334 5.99952 11.3334C8.48619 11.3334 10.5595 9.63341 11.1529 7.33341H9.76618C9.21952 8.88675 7.73952 10.0001 5.99952 10.0001C3.79285 10.0001 1.99952 8.20675 1.99952 6.00008C1.99952 3.79341 3.79285 2.00008 5.99952 2.00008C7.10618 2.00008 8.09285 2.46008 8.81285 3.18675L6.66618 5.33341H11.3329V0.666748L9.76618 2.23341Z",fill:"var(--connector-neutral-icon, #6C7B94)"})),MM=e=>I.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M11.4587 6.7528C11.2244 6.51848 10.8445 6.51848 10.6102 6.7528C10.3759 6.98711 10.3759 7.36701 10.6102 7.60132L11.4587 6.7528ZM12.1916 8.33414L12.6158 7.90988L12.1916 8.33414ZM8.33462 12.1911L8.75888 11.7668L8.33462 12.1911ZM7.6018 10.6097C7.36748 10.3754 6.98758 10.3754 6.75327 10.6097C6.51895 10.8441 6.51895 11.224 6.75327 11.4583L7.6018 10.6097ZM4.43911 9.14411C4.67343 9.37842 5.05333 9.37842 5.28764 9.14411C5.52196 8.9098 5.52196 8.5299 5.28764 8.29558L4.43911 9.14411ZM3.70629 7.56276L4.13056 7.1385L3.70629 7.56276ZM7.56324 3.70582L7.9875 3.28155L7.56324 3.70582ZM8.29606 5.28716C8.53037 5.52148 8.91027 5.52148 9.14459 5.28716C9.3789 5.05285 9.3789 4.67295 9.14459 4.43864L8.29606 5.28716ZM10.6102 7.60132L11.7673 8.75841L12.6158 7.90988L11.4587 6.7528L10.6102 7.60132ZM11.7673 8.75841C12.1662 9.15735 12.3904 9.69843 12.3904 10.2626L13.5904 10.2626C13.5904 9.38017 13.2398 8.53387 12.6158 7.90988L11.7673 8.75841ZM12.3904 10.2626C12.3904 10.8268 12.1662 11.3679 11.7673 11.7668L12.6158 12.6154C13.2398 11.9914 13.5904 11.1451 13.5904 10.2626L12.3904 10.2626ZM11.7673 11.7668C10.9365 12.5976 9.58963 12.5976 8.75888 11.7668L7.91035 12.6154C9.20973 13.9147 11.3164 13.9147 12.6158 12.6154L11.7673 11.7668ZM8.75888 11.7668L7.6018 10.6097L6.75327 11.4583L7.91035 12.6154L8.75888 11.7668ZM5.28764 8.29558L4.13056 7.1385L3.28203 7.98703L4.43911 9.14411L5.28764 8.29558ZM4.13056 7.1385C3.73162 6.73956 3.50749 6.19848 3.50749 5.63429L2.30749 5.63429C2.30749 6.51674 2.65804 7.36304 3.28203 7.98703L4.13056 7.1385ZM3.50749 5.63429C3.50749 5.0701 3.73162 4.52902 4.13056 4.13008L3.28203 3.28155C2.65804 3.90554 2.30749 4.75184 2.30749 5.63429L3.50749 5.63429ZM4.13056 4.13008C4.96131 3.29933 6.30822 3.29933 7.13897 4.13008L7.9875 3.28155C6.68812 1.98217 4.58141 1.98217 3.28203 3.28155L4.13056 4.13008ZM7.13897 4.13008L8.29606 5.28716L9.14459 4.43864L7.9875 3.28155L7.13897 4.13008Z",fill:"currentColor"}),I.createElement("rect",{x:5.08887,y:6.0791,width:1.33333,height:6.66667,rx:.666667,transform:"rotate(-45 5.08887 6.0791)",fill:"currentColor"}),I.createElement("path",{d:"M5.59961 14.3998V12.7998",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{d:"M12.7998 5.59961H14.3998",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{d:"M2.40039 11.2002H4.00039",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{d:"M11.2002 2.40039V4.00039",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})),_M=e=>I.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("g",{clipPath:"url(#clip0_5908_39767)"},I.createElement("path",{d:"M9.37333 6.01333L9.98667 6.62667L3.94667 12.6667H3.33333V12.0533L9.37333 6.01333ZM11.7733 2C11.6067 2 11.4333 2.06667 11.3067 2.19333L10.0867 3.41333L12.5867 5.91333L13.8067 4.69333C14.0667 4.43333 14.0667 4.01333 13.8067 3.75333L12.2467 2.19333C12.1133 2.06 11.9467 2 11.7733 2ZM9.37333 4.12667L2 11.5V14H4.5L11.8733 6.62667L9.37333 4.12667Z",fill:"var(--connector-neutral-icon, #6C7B94)"})),I.createElement("defs",null,I.createElement("clipPath",{id:"clip0_5908_39767"},I.createElement("rect",{width:16,height:16,fill:"white"})))),fn=p.createContext({}),i5=()=>{const{currentSmIds:e}=p.useContext(Ue),{smIds:t}=p.useContext(fn);return e!=null&&e.length?e:t},za=()=>{const e=i5();return p.useMemo(()=>(e==null?void 0:e.length)===1?String(e[0]):void 0,[e])},Iu=()=>{const e=i5();return p.useMemo(()=>(e??[]).map(t=>String(t)),[e])},T1=(e,t,n=[])=>{const r=new URLSearchParams;t&&r.append("smId",t),n.forEach(u=>r.append("inbox_ids",u));const o=r.toString();return o?`${e}?${o}`:e},c5=e=>e.write.createObjectList,jM=e=>e.write.createObjectConnectorNamesList,l5=e=>e.write.linkObjectList,NM=e=>e.write.editObjectList,si=e=>e.write.objectDict,D5=e=>e.write.formFields,d5=e=>e.write.linkCardApiStatus,PM=e=>e.write.unlinkCardApiStatus,A5=e=>e.write.dependentFieldsMap,QM=e=>e.write.createFormApiStatus,RM=e=>e.write.updateFormApiStatus,HM=e=>e.write.currentResourceDetails,WM=e=>e.write.currentResourceDetailsApiStatus,p5=e=>e.write.currentCardInEdit,g5=e=>e.write.hasUnsavedChanges,GM=e=>Array.isArray(e)&&e.some(t=>!!t&&typeof t=="object"&&Bu.ROW_ID in t),VM=e=>e.map(t=>Object.fromEntries(Object.entries(t).filter(([n,r])=>n!==Bu.ROW_ID&&r!==""&&r!==null&&r!==void 0))).filter(t=>Object.keys(t).length>0),zM=e=>typeof e=="string"?/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/.test(e):typeof e=="object"&&"_isValid"in e,C5=e=>Object.keys(e).sort((n,r)=>r.localeCompare(n)).reduce((n,r)=>{var o;if(GM(e[r])){const u=VM(e[r]);return u.length&&(n[r]=u),n}return(typeof e[r]=="string"||typeof e[r]=="object"&&e[r]!==null)&&zM(e[r])?n[r]=(o=new Date(`${e[r]}`))==null?void 0:o.toString():n[r]=e[r],n},{}),h5=(e,t)=>JSON.stringify(C5(e))===JSON.stringify(C5(t)),XM=e=>QE.replace("{{connectorName}}",e),ZM=({showUnlinkModal:e,setShowUnlinkModal:t,cardId:n,onCardUnlinking:r,externalResourceId:o,conversationId:u,connectorName:s})=>{const i=Zt(),{sendTrackingEvent:c}=p.useContext(Ue),D=Se(PM)===Ae.LOADING,d=()=>{u&&o&&i(Kf({id:n,conversationId:u,externalResourceId:o})).unwrap().then(()=>{c(Sm,{connector_name:s,conversation_id:u}),t(!1),r(),Ge({message:ny,type:Rn})}).catch(()=>{Ge({message:ry,type:Rn})})};return a.jsx(rr,{shown:e,setShown:t,showCloseButton:!0,children:a.jsxs(f.Stack,{width:"400px",padding:"20px",gap:"8px",children:[a.jsx(f.Typography,{variant:"h2",children:PE}),a.jsx(f.Typography,{variant:"body2",children:XM(s)}),a.jsxs(f.Stack,{direction:"row",gap:"8px",marginTop:"20px",justifyContent:"flex-end",children:[a.jsx(f.Button,{variant:"text",onClick:()=>t(!1),children:Z0}),a.jsx(f.Button,{disabled:D,color:"error",onClick:d,children:x3})]})]})})},JM=({actions:e,isHovered:t=!1})=>{const r=e.filter(i=>i.shown);if(r.length===0)return null;const o=r[r.length-1],u=r.slice(0,-1),s=t?(u.length+1)*32:32;return a.jsxs(Hb,{width:s,isHovered:t,children:[a.jsx("div",{className:"hidden-actions",children:u.map(({id:i,disabled:c,label:l,icon:D,action:d})=>a.jsx(f.Tooltip,{title:l,placement:"bottom",children:a.jsx(Au,{onClick:d,disabled:c,children:D})},i))}),o&&a.jsx(f.Tooltip,{title:o.label,placement:"bottom",children:a.jsx(Au,{onClick:o.action,disabled:o.disabled,children:o.icon})},o.id)]})},YM=e=>{var n,r,o,u,s,i;if(!e||!("cardType"in e))return"empty";if(e.cardErrorMessage)return"error";const t=e.cardType==="flat"?(r=(n=e.data)==null?void 0:n.flatDisplay)==null?void 0:r.data:(i=(s=(u=(o=e.data)==null?void 0:o.listItems)==null?void 0:u.fields)==null?void 0:s[0])==null?void 0:i.data;return t!=null&&t.length?"result":"empty"},F5=e=>{const{card:t,specificCardData:n,email:r,specificConnectorApiStatus:o,defaultOpenState:u=!1,onCardUnlinking:s}=e,i=Zt(),{availableFeatures:c,sendTrackingEvent:l,conversationId:D,currentSmIds:d}=p.useContext(Ue),{userGroupId:m}=an()||{},[b,C]=p.useState(!!u),[g,A]=p.useState(!1),[h,E]=p.useState(!1),[F,x]=p.useState(!1),{id:y,title:S,externalResourceId:v="",forms:w=[],logoUrl:k,isIdRecordCard:O=!1}=t;let j=y;v&&(j=`${j}_${v}`);const{data:T,cardType:L,cardErrorMessage:M,connectorNames:_}=(n==null?void 0:n[j])??{},P=(_==null?void 0:_[0])||"",G=(o==null?void 0:o[j])===Ae.LOADING,z=(o==null?void 0:o[j])===Ae.FAILED,V=!!(lt(c,g3)&&v&&!O),{isEnabled:H,heldConnectorIds:J,trackIdLookupEvent:X}=n5(),te=OM(H?D:void 0,t.connectorId),ue=p.useMemo(()=>te&&!v?{hiverParam:te.hiverParam,value:te.value}:void 0,[te,v]),ee=!!ue||O&&!!te?te:void 0,fe=Se(ye=>{var je,Je;return!!t.connectorId&&((Je=(je=ti(ye))==null?void 0:je[t.connectorId])==null?void 0:Je.status)==="loading"}),Fe=H&&!v&&(fe||BM(J,t.connectorId)),Oe=Ur({email:r,externalResourceId:v,lookup:ue}),Ce=Se(ye=>{var je;return(je=ZO(ye))==null?void 0:je[j]}),re=Se(ye=>{var je;return(je=JO(ye))==null?void 0:je[j]}),Z=p.useMemo(()=>{var ye,je;if(O||M||z||!(lt(c,EE)&&w.some(Je=>Je.type==="edit")))return!1;switch(L){case"flat":return!!((T==null?void 0:T.flatDisplay.externalResourceId)??t.externalResourceId);case"flat_with_list":return((ye=T==null?void 0:T.listItems)==null?void 0:ye.fields.length)===1?(je=T==null?void 0:T.listItems)==null?void 0:je.fields.some(Je=>Je.externalResourceId):!1;default:return!1}},[T,L,c,w,t,M,z,O]),W=za(),K=Iu(),U=K.join(","),$=p.useRef({lookup:ue,cardIdKey:ee,trackIdLookupEvent:X,sendTrackingEvent:l,title:S,currentSmIds:d});$.current={lookup:ue,cardIdKey:ee,trackIdLookupEvent:X,sendTrackingEvent:l,title:S,currentSmIds:d};const de=p.useCallback((ye=!1)=>{const je=ye?Tm:km;if(r&&y&&D&&!Fe){const{lookup:Je,cardIdKey:jt,trackIdLookupEvent:zt,sendTrackingEvent:Pt,title:Qt,currentSmIds:At}=$.current,pt=it=>{jt&&t.connectorId&&zt(tE,t.connectorId,{card_id:y,id_field_key:jt.hiverParam,outcome:it})};i(Ga({id:y,email:r,conversationId:D,externalResourceId:v,smId:W,smIds:U?U.split(","):[],lookup:Je})).unwrap().then(it=>{const Ft={...k3(it,Qt,ye,!0),sm_ids:At};Pt(je,Ft),pt(YM(it==null?void 0:it.data))}).catch(it=>{if((it==null?void 0:it.name)==="ConditionError")return;const Ft={...k3(it,Qt,ye,!1),sm_ids:At};Pt(je,Ft),pt("error")})}},[i,Fe,Oe,t.connectorId,r,y,D,v,W,U]);p.useEffect(()=>{if(b){if(re&&re===Oe){i(Nr.consumePrefilledCard(j));return}de(!0)}},[b,de]);const he=(ye,je)=>{ye==null||ye.stopPropagation(),i(Ga({id:je,email:r,conversationId:D,isRefresh:!0,externalResourceId:v,smId:W,smIds:K,lookup:ue})).unwrap().then(()=>{l(Fm,{id:je})});const Je=ye.currentTarget.querySelector("svg");Je==null||Je.classList.remove("selected"),setTimeout(()=>Je==null?void 0:Je.classList.add("selected"),1)},ae=(ye,je)=>{ye.stopPropagation(),(!(n!=null&&n[je])||Ce!==Oe)&&!G&&de(),l(b?hm:Cm,{id:je}),C(Je=>!Je)},le=ye=>{ye.stopPropagation();const je=ye.currentTarget.offsetWidth<ye.currentTarget.scrollWidth;A(!!je)},Me=ye=>{var Je,jt;ye.stopPropagation(),l(f3,{card_title:S,connector_name:P,ug_id:m,sm_ids:d});let je;L==="flat"?je=(T==null?void 0:T.flatDisplay.externalResourceId)??t.externalResourceId:L==="flat_with_list"&&(je=(jt=(Je=T==null?void 0:T.listItems)==null?void 0:Je.fields[0])==null?void 0:jt.externalResourceId),je?i(Oo({...t,externalResourceId:je})):Ge({message:Lr,type:dt})},ze=ye=>{ye.stopPropagation(),E(!0)},rn=()=>{x(!0)},kt=()=>{x(!1)},Ot=[{id:"unlink",label:x3,disabled:G,shown:V,icon:a.jsx(MM,{}),action:ye=>ze(ye)},{id:"refresh",label:m3,shown:!0,icon:a.jsx(f5,{}),action:ye=>he(ye,y),disabled:G||Fe},{id:"edit",label:y3,disabled:G,shown:Z,icon:a.jsx(_M,{}),action:ye=>Me(ye)}];return a.jsxs(Tb,{"data-testid":`test_${y}`,onMouseEnter:rn,onMouseLeave:kt,children:[a.jsxs(Lb,{className:b?"hiver-card-expanded":"",onClick:ye=>ae(ye,j),children:[a.jsxs(Ob,{children:[k&&a.jsx("img",{src:k,alt:S}),a.jsx(f.Tooltip,{title:g?S:"",placement:"bottom",children:a.jsx(Mb,{variant:"body_sm_regular",onMouseOver:ye=>le(ye),onMouseLeave:ye=>le(ye),children:S})})]}),a.jsxs(R3,{children:[a.jsx(JM,{actions:Ot,isHovered:F}),a.jsx(f.Tooltip,{title:b?E3:V0,placement:"bottom",children:a.jsx(Au,{onClick:ye=>ae(ye,j),children:a.jsx(rc,{className:b?"":"hiver-up"})})})]})]}),a.jsx(qp,{id:j,cardTitle:t.title,currentCard:t,specificCardData:n,specificConnectorApiStatus:o,isOpen:b,isHeld:Fe,emptyMessage:ee?P7(S,ee.label,ee.displayValue||ee.value):void 0,onRetry:ee&&!_O(M)?()=>de():void 0}),a.jsx(ZM,{showUnlinkModal:h,setShowUnlinkModal:E,cardId:y,onCardUnlinking:()=>s(t),conversationId:D,externalResourceId:v,connectorName:P})]})},m5="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.86993%200.652446C7.56922%200.248711%208.43078%200.248711%209.13007%200.652446L13.7981%203.34755C14.4974%203.75129%2014.9282%204.49742%2014.9282%205.30489V10.6951C14.9282%2011.5026%2014.4974%2012.2487%2013.7981%2012.6524L9.13007%2015.3476C8.43078%2015.7513%207.56922%2015.7513%206.86993%2015.3476L2.20187%2012.6524C1.50258%2012.2487%201.0718%2011.5026%201.0718%2010.6951V5.30489C1.0718%204.49742%201.50258%203.75129%202.20187%203.34755L6.86993%200.652446Z'%20fill='%23FFD122'/%3e%3cg%20filter='url(%23filter0_d_360_39563)'%3e%3cpath%20d='M5.83154%204.43359V4.43359C6.84296%204.43359%207.66287%205.25351%207.66287%206.26492V11.5179V11.5179C6.65146%2011.5179%205.83154%2010.698%205.83154%209.68661V4.43359Z'%20fill='white'/%3e%3c/g%3e%3cg%20filter='url(%23filter1_d_360_39563)'%3e%3cpath%20d='M8.57812%207.66211V7.66211C9.58954%207.66211%2010.4095%208.48202%2010.4095%209.49343V11.7103V11.7103C9.39804%2011.7103%208.57812%2010.8904%208.57812%209.87898V7.66211Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_360_39563'%20x='4.76488'%20y='3.36693'%20width='3.96488'%20height='9.21732'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='0.533333'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.114019%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_360_39563'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_360_39563'%20result='shape'/%3e%3c/filter%3e%3cfilter%20id='filter1_d_360_39563'%20x='7.51146'%20y='6.59544'%20width='3.96488'%20height='6.18216'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='0.533333'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.114019%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_360_39563'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_360_39563'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",L1=e=>Ee({url:fM.replace(":connectorId",e),method:ve.GET}),qM=e=>Ee({url:iM.replace(":connectorId",e),method:ve.POST}),UM={byConnectorId:{}},KM=new Set(["popup_blocked","in_progress_timeout","start_user_auth_failed","popup_closed","cancelled"]),E5=rf({name:"userAuth",initialState:UM,reducers:{userAuthStatusReceived(e,t){const{connectorId:n,state:r,reason:o,externalUserId:u,authoritative:s}=t.payload,i=e.byConnectorId[n];(i==null?void 0:i.state)==="in_progress"&&r!=="connected"&&!s||(e.byConnectorId[n]={state:r,reason:o,externalUserId:u,connectUrl:i==null?void 0:i.connectUrl,lastChecked:Date.now()})},userAuthRequired(e,t){const{connectorId:n,connectUrl:r,reason:o}=t.payload,u=e.byConnectorId[n];(u==null?void 0:u.state)!=="in_progress"&&(e.byConnectorId[n]={state:"disconnected",reason:o,connectUrl:r,externalUserId:u==null?void 0:u.externalUserId,lastChecked:Date.now()})},userAuthInProgress(e,t){const{connectorId:n}=t.payload,r=e.byConnectorId[n]||{state:"unknown"};e.byConnectorId[n]={...r,state:"in_progress",lastChecked:Date.now()}},userAuthCompleted(e,t){const{connectorId:n,externalUserId:r}=t.payload;e.byConnectorId[n]={state:"connected",externalUserId:r,lastChecked:Date.now()}},userAuthFailed(e,t){const{connectorId:n,reason:r}=t.payload,o=e.byConnectorId[n];e.byConnectorId[n]={...o,state:KM.has(r)?"disconnected":"reauth_required",reason:r,lastChecked:Date.now()}},userAuthReset(e,t){delete e.byConnectorId[t.payload.connectorId]}}}),{userAuthStatusReceived:O1,userAuthRequired:$M,userAuthInProgress:e_,userAuthCompleted:yY,userAuthFailed:ku,userAuthReset:BY}=E5.actions,t_=E5.reducer,n_={state:"unknown"},Xa=(e,t)=>e.userAuth.byConnectorId[t]||n_,r_=new Set(["disconnected","in_progress","reauth_required","workspace_mismatch"]),o_=(e,t)=>r_.has(Xa(e,t).state),u_=e=>{for(const[t,n]of Object.entries(e.userAuth.byConnectorId))if(n.state==="in_progress")return t},a_=2e3,s_=5*60*1e3,M1=new Map;function Tu(e,t={}){const n=Zt(),r=vt(),o=Se(b=>Xa(b,e)),{onConnected:u,onFailed:s}=t,i=p.useRef(u);i.current=u;const c=p.useRef(s);c.current=s;const l=p.useRef(!1),D=p.useRef(null),d=p.useRef(null);p.useEffect(()=>{if(o.state==="in_progress")return;const b=M1.get(e);b&&(M1.delete(e),o.state==="connected"?b.onConnected():b.onFailed(o.reason??o.state))},[e,o]),Ct({queryKey:["userAuthStatus",e],queryFn:async()=>{const b=await L1(e),C=(b==null?void 0:b.data)??b;return C.state==="connected"&&(n(O1({connectorId:e,state:C.state,reason:C.reason,externalUserId:C.external_user_id})),d.current&&!d.current.closed&&d.current.close(),d.current=null),C},enabled:o.state==="in_progress",refetchInterval:o.state==="in_progress"?a_:!1,refetchOnWindowFocus:!1}),p.useEffect(()=>{if(o.state!=="in_progress"){D.current&&(clearTimeout(D.current),D.current=null);return}return D.current=setTimeout(()=>{n(ku({connectorId:e,reason:"in_progress_timeout"}))},s_),()=>{D.current&&(clearTimeout(D.current),D.current=null)}},[o.state,e,n]),p.useEffect(()=>{if(o.state!=="in_progress"){if(d.current&&!d.current.closed)try{d.current.close()}catch{}d.current=null}},[o.state]),p.useEffect(()=>{if(o.state!=="in_progress")return;const b=setInterval(async()=>{const C=d.current;if(!(!C||!C.closed)){clearInterval(b),d.current=null;try{const g=await L1(e),A=(g==null?void 0:g.data)??g,h=A.state==="connected"||A.state==="reauth_required"||A.state==="workspace_mismatch";n(h?O1({connectorId:e,state:A.state,reason:A.reason,externalUserId:A.external_user_id,authoritative:!0}):ku({connectorId:e,reason:"popup_closed"}))}catch{n(ku({connectorId:e,reason:"popup_closed"}))}}},800);return()=>clearInterval(b)},[o.state,e,n]);const m=p.useCallback(async()=>{if(!l.current){l.current=!0,M1.set(e,{onConnected:()=>{var b;return(b=i.current)==null?void 0:b.call(i)},onFailed:b=>{var C;return(C=c.current)==null?void 0:C.call(c,b)}}),n(e_({connectorId:e}));try{const b=await qM(e),C=(b==null?void 0:b.data)??b,g=C==null?void 0:C.auth_url;if(!g)throw new Error("No auth_url returned from /user-auth/start");const A=600,h=700,E=window.screen.width/2-A/2,F=window.screen.height/2-h/2,x=window.open(g,"user_auth_popup",`width=${A},height=${h},left=${E},top=${F},menubar=no,toolbar=no`);d.current=x,x||n(ku({connectorId:e,reason:"popup_blocked"}))}catch(b){He.error("startUserAuth failed: ",b),n(ku({connectorId:e,reason:"start_user_auth_failed"}))}finally{l.current=!1,r.invalidateQueries({queryKey:["userAuthStatus",e]})}}},[e,n,r]);return{entry:o,state:o.state,connect:m,isStarting:l.current}}const b5=(e,t,n)=>({queryKey:["userAuthStatus",e,"initial"],queryFn:async()=>{const r=await L1(e),o=(r==null?void 0:r.data)??r;return t(O1({connectorId:e,state:o.state,reason:o.reason,externalUserId:o.external_user_id})),o},enabled:n,refetchOnWindowFocus:!1,staleTime:3e4});function fi(e,t){const n=Zt(),r=Ct(b5(e,n,t));return{isLoading:t&&r.isLoading}}function f_(e){const t=Zt();return{isResolving:o0({queries:e.map(r=>b5(r,t,!0))}).some(r=>r.isLoading)}}const i_=f.styled(f.Box)`
|
|
2761
2761
|
display: flex;
|
|
2762
2762
|
flex-direction: column;
|
|
2763
2763
|
align-items: stretch;
|
|
@@ -3317,7 +3317,7 @@ Do you want to continue?`,BO="Select an object to create",_p="Select an object t
|
|
|
3317
3317
|
`,uR="data:image/svg+xml,%3csvg%20width='124'%20height='107'%20viewBox='0%200%20124%20107'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M28.6168%2054.7446C28.6931%2052.5589%2031.0146%2051.1102%2033.0842%2051.8174C35.9985%2052.8133%2040.0375%2053.9024%2044.0621%2054.043C48.0034%2054.1806%2051.968%2053.4097%2054.8762%2052.6339C57.0264%2052.0602%2059.2927%2053.6932%2059.215%2055.9172C59.1742%2057.0856%2058.4742%2058.1269%2057.3723%2058.5178C54.8051%2059.4284%2049.7633%2060.8927%2044.3075%2060.7022C38.7694%2060.5088%2033.1999%2058.6241%2030.4004%2057.5311C29.2637%2057.0873%2028.5742%2055.9641%2028.6168%2054.7446Z'%20fill='url(%23paint0_linear_8481_102191)'/%3e%3cpath%20d='M47.223%2043.6373C44.4928%2030.7926%2052.6922%2018.1666%2065.5368%2015.4364C78.3815%2012.7062%2091.0075%2020.9055%2093.7377%2033.7502L105.079%2087.1053L84.1844%2091.5466C70.0346%2094.5542%2056.1258%2085.5217%2053.1182%2071.3719L47.223%2043.6373Z'%20fill='url(%23paint1_linear_8481_102191)'/%3e%3cmask%20id='mask0_8481_102191'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='46'%20y='14'%20width='60'%20height='79'%3e%3cpath%20d='M47.223%2043.6373C44.4928%2030.7926%2052.6922%2018.1666%2065.5368%2015.4364C78.3815%2012.7062%2091.0075%2020.9055%2093.7377%2033.7502L105.079%2087.1053L84.1844%2091.5466C70.0346%2094.5542%2056.1258%2085.5217%2053.1182%2071.3719L47.223%2043.6373Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_8481_102191)'%3e%3cellipse%20cx='63.7775'%20cy='46.8684'%20rx='1.48152'%20ry='1.39438'%20transform='rotate(-12%2063.7775%2046.8684)'%20fill='%23435C71'/%3e%3crect%20x='47.4368'%20y='59.3203'%20width='53.657'%20height='13.2235'%20transform='rotate(-12%2047.4368%2059.3203)'%20fill='url(%23paint2_linear_8481_102191)'/%3e%3crect%20x='51.1907'%20y='76.9824'%20width='53.657'%20height='10.4263'%20transform='rotate(-12%2051.1907%2076.9824)'%20fill='url(%23paint3_linear_8481_102191)'/%3e%3c/g%3e%3cpath%20opacity='0.883952'%20d='M113.939%2051.0679C114.775%2055%20112.265%2058.865%20108.333%2059.7008L107.842%2059.8052C103.639%2060.6986%2099.5073%2058.0155%2098.6139%2053.8123L97.205%2047.1837L105.307%2045.4616C109.239%2044.6259%20113.104%2047.1359%20113.939%2051.0679Z'%20fill='url(%23paint4_linear_8481_102191)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M68.7215%2066.4138C67.1801%2064.8725%2067.6745%2062.2062%2069.587%2061.1603C72.4457%2059.5969%2076.2861%2057.1773%2079.3785%2054.0849C82.4099%2051.0535%2084.752%2047.3461%2086.2775%2044.5465C87.3388%2042.5989%2090.0598%2042.0819%2091.6282%2043.6503C92.4782%2044.5003%2092.758%2045.7623%2092.2604%2046.8566C91.0829%2049.4466%2088.5191%2054.344%2084.4346%2058.4285C80.2853%2062.5778%2074.8639%2065.591%2072.0553%2066.9952C70.9363%2067.5548%2069.6062%2067.2985%2068.7215%2066.4138Z'%20fill='url(%23paint5_linear_8481_102191)'/%3e%3crect%20x='48.7264'%20y='33.7744'%20width='11.2108'%20height='11.2108'%20rx='5.59457'%20transform='rotate(-12%2048.7264%2033.7744)'%20fill='url(%23paint6_linear_8481_102191)'/%3e%3crect%20x='50.0175'%20y='35.8193'%20width='4.0158'%20height='3.84848'%20rx='1.92424'%20transform='rotate(-12%2050.0175%2035.8193)'%20fill='%23435C71'/%3e%3crect%20x='59.2875'%20y='31.5723'%20width='11.2108'%20height='11.2108'%20rx='5.59457'%20transform='rotate(-12%2059.2875%2031.5723)'%20fill='%23FFFEFE'/%3e%3cpath%20opacity='0.883952'%20d='M111.25%2038.5376C110.415%2034.6055%20106.55%2032.0955%20102.618%2032.9313L102.127%2033.0356C97.9234%2033.9291%2095.2403%2038.0607%2096.1337%2042.2639L97.5426%2048.8925L105.644%2047.1705C109.576%2046.3347%20112.086%2042.4696%20111.25%2038.5376Z'%20fill='url(%23paint7_linear_8481_102191)'/%3e%3crect%20x='60.0181'%20y='33.8037'%20width='3.84848'%20height='3.84848'%20rx='1.90724'%20transform='rotate(-12%2060.0181%2033.8037)'%20fill='%23435C71'/%3e%3cpath%20d='M36.9246%2059.1604C36.4487%2060.717%2034.7371%2061.6271%2033.1805%2061.1512C32.3613%2060.9007%2031.7241%2060.3475%2031.3259%2059.5987L25.2059%2046.7983C24.9784%2046.3703%2025.1286%2045.8788%2025.5566%2045.6513L28.338%2044.1724C28.7659%2043.9449%2029.2574%2044.0951%2029.4849%2044.5231L36.6496%2056.8367C37.0728%2057.5036%2037.15%2058.423%2036.9246%2059.1604Z'%20fill='%23FFDF9F'/%3e%3crect%20x='27.9973'%20y='44.333'%20width='2.39869'%20height='3.59807'%20transform='rotate(152%2027.9973%2044.333)'%20fill='%23FF9090'/%3e%3cpath%20d='M26.6628%2044.3769L26.9472%2044.9118L28.0169%2044.343L26.3106%2041.1338L24.171%2042.2714L25.0243%2043.876C25.6661%2043.5347%2026.3215%2043.7351%2026.6628%2044.3769Z'%20fill='%23FFB19F'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.26386%2027.248C9.3428%2020.4481%2016.5101%2016.6372%2023.31%2018.7161C30.11%2020.7951%2033.9209%2027.9624%2031.8419%2034.7623C29.763%2041.5622%2022.5956%2045.3731%2015.7958%2043.2942C8.99587%2041.2152%205.18493%2034.0479%207.26386%2027.248ZM9.72157%2027.9983C8.06843%2033.4055%2011.1399%2039.1821%2016.5471%2040.8352C21.9543%2042.4884%2027.7309%2039.4168%2029.384%2034.0096C31.0372%2028.6024%2027.9657%2022.8258%2022.5585%2021.1727C17.1513%2019.5196%2011.3747%2022.5911%209.72157%2027.9983Z'%20fill='%23FFE69F'/%3e%3ccircle%20opacity='0.414016'%20cx='19.5529'%20cy='31.0039'%20r='10.2804'%20transform='rotate(17%2019.5529%2031.0039)'%20fill='%23BBDEFC'/%3e%3cpath%20d='M14.3685%2030.6746C15.7299%2027.6867%2018.9391%2025.9803%2022.1776%2026.5225L22.2595%2026.5475C23.7024%2026.8095%2024.3854%2024.8682%2023.1497%2024.2218C22.3806%2023.8074%2021.5613%2023.557%2020.717%2023.3884C17.3715%2022.9031%2014.0553%2024.6664%2012.6939%2027.6543C12.2796%2028.4235%2012.0859%2029.3497%2012.0244%2030.1372C11.8444%2031.6051%2013.8607%2032.0424%2014.4503%2030.6997C14.3434%2030.7566%2014.3685%2030.6746%2014.3685%2030.6746Z'%20fill='%23F6FBFF'/%3e%3cpath%20d='M10.2904%2029.0679C11.9436%2023.6607%2017.7202%2020.5893%2023.1274%2022.2424C25.6671%2023.0189%2027.5785%2024.6783%2028.9301%2026.704C27.7539%2024.1048%2025.508%2022.0744%2022.5586%2021.1727C17.1514%2019.5196%2011.3748%2022.591%209.72165%2027.9982C8.81993%2030.9476%209.32924%2033.97%2010.7444%2036.3735C9.82081%2034.1203%209.51395%2031.6077%2010.2904%2029.0679Z'%20fill='%23ADCBE7'/%3e%3cpath%20opacity='0.406087'%20d='M36.4864%2056.8021L36.1373%2056.2691C36.3845%2056.8563%2036.428%2057.5516%2036.2372%2058.1754C35.9273%2059.189%2034.5593%2059.1971%2034.0713%2058.2806L28.3787%2047.5877C28.0534%2046.9767%2027.3508%2046.7619%2026.7395%2047.0866L25.7206%2047.6277L31.4395%2059.3516C31.7648%2059.9627%2032.27%2060.5434%2032.8706%2060.8123C33.7054%2061.1528%2034.6593%2061.1034%2035.3726%2060.7247C36.0858%2060.3459%2036.6602%2059.5837%2036.8444%2058.7021C37.0351%2058.0783%2036.8117%2057.4132%2036.4864%2056.8021Z'%20fill='white'/%3e%3cpath%20d='M29.8826%2048.4977C29.8006%2048.4726%2029.6368%2048.4225%2029.5799%2048.3155L28.1579%2045.6411C28.0442%2045.4272%2028.1193%2045.1814%2028.3332%2045.0677C28.5472%2044.9539%2028.7929%2045.0291%2028.9067%2045.243L30.3287%2047.9174C30.4424%2048.1313%2030.3673%2048.3771%2030.1534%2048.4908C30.1284%2048.5728%2029.9645%2048.5227%2029.8826%2048.4977Z'%20fill='%23FFF5EB'/%3e%3cellipse%20cx='29.2637'%20cy='54.631'%20rx='1.50593'%20ry='3.17918'%20transform='rotate(-23%2029.2637%2054.631)'%20fill='%23FFC478'/%3e%3cellipse%20cx='34.0592'%20cy='52.4078'%20rx='0.920288'%20ry='1.67325'%20transform='rotate(106%2034.0592%2052.4078)'%20fill='%23FFC478'/%3e%3cpath%20d='M89.1282%2019.2055L68.2257%2026.8725L45.9197%2028.3898L44.4929%2016.4082C44.3371%2013.798%2047.5283%2011.4502%2050.9859%2011.6309L65.1429%2012.369L67.3969%2012.4869C68.5309%2012.5463%2069.7066%2012.3289%2070.7522%2011.8627L78.6899%208.34726C81.725%206.99992%2085.3012%207.87475%2086.2125%2010.1876L89.1282%2019.2055Z'%20fill='url(%23paint8_linear_8481_102191)'/%3e%3cpath%20opacity='0.479771'%20d='M88.6262%2019.0953L68.3101%2026.5288L65.3314%2012.5149L67.5211%2012.6263C68.6228%2012.6824%2069.7652%2012.471%2070.7816%2012.0192L78.4972%208.61266C81.4474%207.30707%2084.9208%208.14856%2085.8036%2010.3829L88.6262%2019.0953Z'%20fill='%23ADCBE7'/%3e%3cpath%20d='M91.6332%2026.6212L46.9517%2036.1186L46.0387%2028.4438L89.2535%2019.2582L91.6332%2026.6212Z'%20fill='%23717DAD'/%3e%3cpath%20d='M102.961%2024.2033C103.125%2024.9722%20102.371%2025.7829%20101.278%2026.015L37.9675%2039.4722C36.8754%2039.7043%2035.8568%2039.2704%2035.6933%2038.5015C35.5301%2037.7336%2036.284%2036.922%2037.3761%2036.6898L100.687%2023.2327C101.779%2023.0005%20102.798%2023.4354%20102.961%2024.2033Z'%20fill='%239ED1FF'/%3e%3cpath%20d='M102.703%2024.1718C102.838%2024.805%20102.067%2025.5045%20100.983%2025.7349L69.5583%2032.4144L69.0712%2030.123L100.496%2023.4436C101.58%2023.2131%20102.569%2023.5394%20102.703%2024.1718Z'%20fill='%2378AFE1'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_8481_102191'%20x1='32.2665'%20y1='59.6553'%20x2='59.0518'%20y2='60.5906'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFFDE0'/%3e%3cstop%20offset='1'%20stop-color='%23FFB362'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_8481_102191'%20x1='67.3434'%20y1='85.966'%20x2='103.216'%20y2='78.3411'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFFABC'/%3e%3cstop%20offset='1'%20stop-color='%23FFA650'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_8481_102191'%20x1='51.4347'%20y1='74.8197'%20x2='91.1539'%20y2='74.8197'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A3C1FF'/%3e%3cstop%20offset='1'%20stop-color='%234243FF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_8481_102191'%20x1='55.1887'%20y1='89.2031'%20x2='94.9078'%20y2='89.2031'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A3C1FF'/%3e%3cstop%20offset='1'%20stop-color='%234243FF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_8481_102191'%20x1='94.5023'%20y1='53.1799'%20x2='106.762'%20y2='58.7056'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF9498'/%3e%3cstop%20offset='1'%20stop-color='%23FFD671'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_8481_102191'%20x1='74.9906'%20y1='66.9871'%20x2='94.9778'%20y2='46.9999'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFFDE0'/%3e%3cstop%20offset='1'%20stop-color='%23FFB362'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint6_linear_8481_102191'%20x1='50.5805'%20y1='44.0581'%20x2='59.9372'%20y2='44.0581'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='white'/%3e%3cstop%20offset='1'%20stop-color='%23E3EEF3'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint7_linear_8481_102191'%20x1='88.4187'%20y1='43.3906'%20x2='99.3981'%20y2='25.1833'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF9498'/%3e%3cstop%20offset='1'%20stop-color='%23FFD671'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint8_linear_8481_102191'%20x1='56.4985'%20y1='29.5482'%20x2='100.532'%20y2='20.1885'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23ECF7FF'/%3e%3cstop%20offset='1'%20stop-color='%23C2E0FF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",aR=()=>a.jsxs(f.Stack,{alignItems:"center",marginTop:"40px",children:[a.jsx("img",{src:uR,width:124,height:107}),a.jsx(f.Typography,{variant:"body2",sx:{color:"var(--connector-caption-text)"},children:SQ})]}),sR=({searchResults:e,selectedObject:t,onReset:n,fetchCards:r,onLinkAllRelated:o,onLinkAllRelatedStart:u})=>{const s=Zt(),{sendTrackingEvent:i,currentSmIds:c}=p.useContext(Ue),[l,D]=p.useState(null),d=wt(vQ,{count:e.length.toString(),countSuffix:e.length>1?"s":"",searchObject:t.objectName,connectorName:t.connectorName}),m=(A,h)=>{i(zm,{search_keyword:t.label,search_result_label:h,sm_ids:c,connector_name:t.connectorName}),D({externalResourceId:A,formId:t.value.toString(),searchKeyword:t.label,searchResultLabel:h})},b=()=>{D(null),s(jr())},C=()=>{n(),r(),b()},g=A=>{n(),b(),o==null||o(A)};return e.length?l?a.jsx(oR,{meta:l,onBack:b,onLink:C,onLinkAllRelated:o?g:void 0,onLinkAllRelatedStart:u}):a.jsxs(f.Stack,{gap:"14px",marginTop:"12px",children:[a.jsx(f.Typography,{variant:"body2",sx:{color:"var(--connector-caption-text)"},children:d}),a.jsx(f.Stack,{gap:"17px",children:e==null?void 0:e.map(({externalResourceId:A,name:h,description:E})=>a.jsxs(k4,{onClick:()=>m(A,h),direction:"row",children:[a.jsxs(f.Stack,{flexGrow:1,children:[a.jsx(f.Typography,{variant:"body2",sx:{color:"var(--connector-text-primary)"},children:h}),a.jsx(f.Typography,{variant:"caption",sx:{color:"var(--connector-caption-text)"},children:E})]}),a.jsx(f.Box,{alignSelf:"center",className:"search-item__chevron",width:"20px",height:"20px",children:a.jsx(ol,{width:"20px",height:"20px","aria-hidden":!0})})]},A))})]}):a.jsx(aR,{})},Ou=f.styled(f.Skeleton)`
|
|
3318
3318
|
display: block;
|
|
3319
3319
|
margin: ${e=>e.margin?e.margin:0};
|
|
3320
|
-
`,fR=()=>a.jsxs(f.Stack,{marginTop:"12px",children:[a.jsx(Ou,{variant:"rounded",width:"50%",height:"16px",animation:"wave",margin:"0 0 18px 0"}),a.jsx(f.Stack,{gap:"17px",children:a.jsxs(k4,{gap:"8px",disableHover:!0,children:[a.jsx(Ou,{variant:"rounded",width:"30%",height:"16px",animation:"wave"}),a.jsx(Ou,{variant:"rounded",width:"70%",height:"16px",animation:"wave"})]})})]});let ul={};const al=new Set,iR=(e,t)=>{ul={...ul,[e]:t},al.forEach(n=>n())},cR=e=>(al.add(e),()=>al.delete(e)),lR=e=>p.useSyncExternalStore(cR,()=>ul)[e],DR=async({id:e,searchString:t,args:n,smId:r,smIds:o})=>{try{if(e===void 0||t===void 0)return[];const u=await Ee({url:T1(XQ.replace(":formId",e.toString()),r,o),method:ve.POST,data:{search_string:t,args:n}});let s=null;return u!=null&&u.data&&"data"in u.data&&(s=u.data.data),s}catch(u){Ge({message:Lr,type:dt}),He.error(u)}},dR=(e,t)=>{const n=za(),r=Iu();return Bn({mutationFn:o=>DR({smId:n,smIds:r,...o}),onMutate:({searchString:o,connectorName:u})=>{e(o,u)},onSuccess:(o,{searchString:u,connectorName:s})=>{t(u,o,s)}})},AR=(e,t={})=>{const{delayAfterLoad:n=1e3}=t,r=p.useRef(!1),o=p.useRef(void 0),u=p.useCallback((c="auto")=>{const l=e.current;l&&l.scrollIntoView({behavior:c})},[e]),s=p.useCallback((c,l="smooth")=>{r.current||(o.current!==void 0&&clearTimeout(o.current),c&&(o.current=setTimeout(()=>{u(l),r.current=!0},n)))},[u,n]),i=p.useCallback(()=>{r.current=!1,o.current!==void 0&&clearTimeout(o.current)},[]);return p.useEffect(()=>()=>{o.current!==void 0&&clearTimeout(o.current)},[]),{scrollOnceAfterLoad:s,resetScrollState:i,hasScrolledOnce:r.current}},pR="/v1/api/connectors/lookup/bulk",gR="/v1/api/connectors/lookup/bulk",CR=async e=>{const t=new URLSearchParams;e.forEach(o=>t.append("connector_ids",o));const n=`${pR}?${t.toString()}`,r=await Ee({url:n,method:ve.GET});return r==null?void 0:r.data},hR=async e=>{const t=await Ee({url:gR,method:ve.PUT,data:{entries:e}});return t==null?void 0:t.data},FR={fontSize:`${f.theme.typography.body1.fontSize}px`,width:"209px",height:"40px",color:"var(--connector-text-primary)",background:"var(--connector-surface)",borderRadius:"8px",fontWeight:f.theme.typography.fontWeightRegular,"& .MuiOutlinedInput-notchedOutline":{borderColor:"var(--connector-border-strong)"}},mR={modifiers:[{name:"offset",options:{offset:[0,3]}}]},ER={border:"1px solid var(--connector-border-strong)",borderRadius:"8px",padding:"12px"},T4={flex:1,height:"1px",backgroundColor:"var(--connector-border)"},bR={flexShrink:0,border:"1px solid var(--connector-border)",borderRadius:"15px"},xR={border:"1px solid var(--connector-border)",backgroundColor:"var(--connector-surface-active)",borderRadius:"8px",padding:"8px 10px"},yR=p.memo(function({connector:t,selectedHiverParam:n,onChange:r,sendTrackingEvent:o}){var i;const u=((i=(t.presets??[]).find(c=>c.hiverParam===n))==null?void 0:i.objectParamLabel)??"",s=p.useCallback(c=>{o(nE,{hiver_param:c.target.value,connector_name:t.connectorName,page:"agent_connector_panel"}),r(t.connectorId,c.target.value)},[t.connectorId,t.connectorName,r,o]);return a.jsxs(f.Stack,{direction:"row",alignItems:"center",gap:"0px",justifyContent:"space-between",children:[a.jsx(f.Select,{value:n,onChange:s,size:"small",variant:"outlined",sx:FR,MenuProps:{sx:{zIndex:1500}},renderValue:c=>{var D;const l=((D=(t.presets??[]).find(d=>d.hiverParam===c))==null?void 0:D.label)??"";return a.jsxs(f.Stack,{direction:"row",alignItems:"center",gap:"8px",children:[a.jsx(v5,{width:18,height:18}),a.jsx("span",{children:l})]})},children:(t.presets??[]).map(c=>a.jsx(f.MenuItem,{value:c.hiverParam,sx:{fontSize:`${f.theme.typography.body1.fontSize}px`},children:c.isIdField?a.jsx(f.Tooltip,{title:`${c.label} extracted from the conversation`,placement:"right",slotProps:{popper:mR},children:a.jsx("span",{style:{width:"100%"},children:c.label})}):c.label},c.hiverParam))}),a.jsx(f.Box,{sx:T4}),a.jsxs(f.Stack,{direction:"row",alignItems:"center",gap:"4px",padding:"4px 12px",sx:bR,children:[t.logo&&a.jsx("img",{src:t.logo,width:16,height:16,alt:t.connectorName}),a.jsxs(f.Typography,{variant:"body2",color:"var(--connector-caption-text)",children:["Matches with ",t.connectorName,"'s"]})]}),a.jsx(f.Box,{sx:T4}),a.jsx(f.Box,{sx:xR,children:a.jsx(f.Typography,{variant:"body2",fontSize:14,children:u})})]})}),BR=p.memo(function({open:t,onClose:n,connectors:r,onSaveSuccess:o}){const{sendTrackingEvent:u}=p.useContext(Ue),[s,i]=p.useState({});p.useEffect(()=>{if(t&&r.length>0){const C={};r.filter(g=>{var A;return((A=g.presets)==null?void 0:A.length)>1}).forEach(g=>{C[g.connectorId]=g.hiverParam}),i(C)}},[t,r]);const c=vt(),{mutate:l,isPending:D}=Bn({mutationFn:hR,onSuccess:C=>{const g={};C.results.forEach(({connectorId:A,hiverParam:h})=>{g[A]=h}),c.setQueriesData({queryKey:["lookup","bulk"]},A=>A&&{...A,connectors:A.connectors.map(h=>g[h.connectorId]!==void 0?{...h,hiverParam:g[h.connectorId]}:h)}),u(rE,{page:"agent_connector_panel"}),Ge({message:"Identity mapping saved successfully",type:"success"}),o==null||o(),n()},onError:()=>{Ge({message:"Failed to save identity mapping",type:"error"})}}),d=p.useCallback(()=>{const C=Object.entries(s).map(([g,A])=>({connector_id:g,hiver_param:A}));l(C)},[s,l]),m=p.useCallback((C,g)=>{i(A=>({...A,[C]:g}))},[]),b=p.useCallback(C=>{C||n()},[n]);return a.jsx(rr,{shown:t,setShown:b,showCloseButton:!0,borderRadius:8,children:a.jsxs(f.Stack,{padding:"24px 20px",gap:"16px",sx:{minWidth:"800px"},children:[a.jsx(f.Typography,{variant:"h2",children:"Customer identity mapping"}),a.jsx(f.Typography,{variant:"body2",children:"Choose how Hiver should match customer details with data in your connected apps."}),r.some(C=>{var g;return((g=C.presets)==null?void 0:g.length)>1})&&a.jsx(f.Stack,{gap:"8px",sx:ER,children:r.filter(C=>{var g;return((g=C.presets)==null?void 0:g.length)>1}).map(C=>a.jsx(yR,{connector:C,selectedHiverParam:s[C.connectorId]??C.hiverParam,onChange:m,sendTrackingEvent:u},C.connectorId))}),a.jsxs(f.Stack,{direction:"row",justifyContent:"flex-end",gap:"8px",children:[a.jsx(f.Button,{variant:"text",onClick:n,children:"Cancel"}),a.jsx(f.Button,{variant:"contained",onClick:d,disabled:D,children:"Save"})]})]})})}),vR=({enabled:e,...t})=>{const{actionQueue:n}=p.useContext(Ue),{connectorId:r,conversationId:o}=t,u=p.useRef(t);u.current=t,p.useEffect(()=>{if(!n||!e)return;const s=n.register(()=>u.current);return()=>n.unregister(s)},[n,e,r,o])},wR=({isAdmin:e=!1})=>{var cC,lC,DC,dC;const{email:t,currentSmIds:n,sendTrackingEvent:r,availableFeatures:o,conversationId:u,connectorId:s,connectorFunctions:i}=p.useContext(Ue),c=Zt(),{userGroupId:l,userId:D}=an()||{},d=p.useRef(!1),m=p.useRef(null),b=p.useRef(null),C=p.useRef(null),[g,A]=p.useState({}),[h,E]=p.useState(!1),[F,x]=p.useState(!1),[y,S]=p.useState(!1),[v,w]=p.useState(!1),[k,O]=p.useState(!1),[j,T]=p.useState(),[L,M]=p.useState(!1),[_,P]=p.useState(null),[G,z]=p.useState(),[V,H]=p.useState(null),[J,X]=p.useState(!1),[te,ue]=p.useState(!1),[R,ee]=p.useState(!1),[fe,Fe]=p.useState(!1),[Oe,Ce]=p.useState(void 0),re=p.useRef(),Z=Se(Zp),W=Se(WO),K=Se(VO),U=Se(zO),$=Se(YO),de=Se(GO),he=Se(c5),ae=Se(jM),le=Se(l5),Me=Se(p5),ze=Se(g5),rn=Se(Ij),kt=lt(o,hE),Ot=lt(o,g3),ye=lt(o,yE),je=lt(o,vE),Je=lt(o,wE),jt=lt(o,SE),zt=lt(o,Fa),Pt=(cC=an())==null?void 0:cC.tenantPlatform,Qt=lt(o,Pt==="HIVERWEB"?`hot-${C3}`:C3),At=lt(o,Pt==="HIVERWEB"?`hot-${h3}`:h3),{data:pt}=Ct({queryKey:["connectors","enabledAuthenticated"],queryFn:()=>n1(),enabled:Qt&&e}),it=p.useMemo(()=>(pt??[]).map(q=>q.id),[pt]),{data:Ft,isSuccess:Sr}=Ct({queryKey:["lookup","bulk",it.join(",")],queryFn:()=>CR(it),enabled:it.length>0&&Qt&&e,refetchOnMount:!1}),Zn=p.useMemo(()=>{const q=(Ft==null?void 0:Ft.connectors)??[];return s?q.filter(se=>se.connectorId===s):q},[Ft,s]),dn=Sr&&Zn.some(q=>{var se;return(((se=q.presets)==null?void 0:se.length)??0)>1});vR({conversationId:u,connectorId:s,openCreateForm:q=>{if(q!=null&&q.selectConnectorForm&&q.connectorId){A({connectorId:q.connectorId});return}S(!0)},openLink:()=>w(!0),enabled:W});const Xt=p.useMemo(()=>!Z||!Z.length?null:RO(Z,K,U),[Z,K,U]),Tt=UE(K),ie=Se(si),Pe=(lC=Me==null?void 0:Me.forms.find(q=>q.type==="edit"))==null?void 0:lC.id,ct=p.useMemo(()=>{if(!ie)return[];const q=new Map;return Object.values(ie).forEach(se=>{se.userAuthEnabled&&se.connectorId&&!q.has(se.connectorId)&&q.set(se.connectorId,{connectorId:se.connectorId,connectorName:se.connectorName??se.name,connectorLogo:se.logoUrl??""})}),Array.from(q.values())},[ie]),Mt=p.useMemo(()=>{const q={};return Object.values(ie??{}).forEach(se=>{se.connectorId&&se.connectorName&&(q[se.connectorId]=se.connectorName)}),(Z??[]).forEach(se=>{se.connectorId&&se.connectorName&&(q[se.connectorId]=se.connectorName)}),JSON.stringify(q)},[ie,Z]),xt=p.useMemo(()=>JSON.parse(Mt),[Mt]),{optionsByConnector:on,keys:mt,heldConnectorIds:yn,selectIdOption:_n,setRelatedKey:jn,handleRecordUnlinked:pe,clearIdKeys:Be,trackIdLookupEvent:ft}=bj({enabled:At,appNames:xt}),Re=Se(ti),{beginRelatedLookup:Ut,lookupRelatedRecords:ru,retryRelatedLookup:Q}=Bj({setRelatedKey:jn,trackIdLookupEvent:ft}),ne=p.useMemo(()=>({isEnabled:At,heldConnectorIds:yn,trackIdLookupEvent:ft,retryRelatedLookup:Q}),[At,yn,ft,Q]),De=p.useMemo(()=>Object.entries(on).map(([q,se])=>({connectorId:q,appName:s?void 0:xt[q]??q,options:se})),[on,s,xt]),Le=De.length>0,qe=p.useMemo(()=>{var se;return(se=Object.entries(mt).map(([Ze,Ir])=>({key:Ir,option:rj(on[Ze],Ir)})).filter(Ze=>!!Ze.option).sort((Ze,Ir)=>Ir.key.selectedAt-Ze.key.selectedAt)[0])==null?void 0:se.option},[mt,on]),$e=p.useMemo(()=>{if(!Z||!At)return Z;const q=s?mt[s]?{[s]:mt[s]}:{}:mt;return uj(oj(Z,q),q)},[Z,At,mt,s]),Qe=Se(q=>ct.some(se=>o_(q,se.connectorId))),Xe=p.useMemo(()=>{const q=new Set;return(Z??[]).forEach(se=>{se.userAuthEnabled&&se.connectorId&&q.add(se.connectorId)}),ct.forEach(se=>q.add(se.connectorId)),Array.from(q)},[Z,ct]),{isResolving:Rt}=f_(Xe),{data:Et,isLoading:gt}=w4({senderEmail:t,conversationId:String(u),enabled:je&&!!t}),{emailHeaders:Kt,selectedEmail:Jn}=Et??{},{scrollOnceAfterLoad:Yn,resetScrollState:Ht}=AR(b),io=de!==Ae.LOADING&&(!U||!Object.values(U).some(q=>q===Ae.LOADING))&&Z&&Z.length>0;p.useLayoutEffect(()=>{var q;J&&!h&&te&&((q=C==null?void 0:C.current)!=null&&q.scrollHeight)&&Yn(!!io,"smooth")},[J,h,te,io,Yn,(DC=C==null?void 0:C.current)==null?void 0:DC.scrollHeight,D]);const Ds=(q,se)=>{r(Wm,{search_keyword:q,sm_ids:n,connector_name:se,suggestion_type:rn})},ds=(q,se,Ze)=>{!Array.isArray(se)||!se.length?r(Gm,{search_keyword:q,sm_ids:n,connector_name:Ze,suggestion_type:rn}):se.length&&r(Vm,{num_of_results:se.length,search_keyword:q,sm_ids:n,connector_name:Ze,suggestion_type:rn})},{mutate:Zl,reset:Qi,data:Ri,isPending:Hi,isIdle:Wi}=dR(Ds,ds),oe=p.useCallback(()=>{Qi(),P(null)},[Qi,P]),me=vt(),be=p.useCallback(()=>{if(t&&n.length&&u){const q=c(Wa({inboxIds:n,conversationId:u,connectorId:s}));return()=>q.abort()}},[c,t,n,u,s]),Ke=p.useCallback(({formId:q,externalResourceId:se})=>{const Ze=ie==null?void 0:ie[q];if(!(!(Ze!=null&&Ze.connectorId)||!Ze.cardId||!u))return{connectorId:Ze.connectorId,cardId:Ze.cardId,externalResourceId:se,fallbackCard:{title:Ze.name,logoUrl:Ze.logoUrl,connectorName:Ze.connectorName}}},[ie,u]),yt=p.useCallback(q=>{const se=Ke(q);return se?Ut(se):void 0},[Ke,Ut]),un=p.useCallback(async q=>{const se=Ke(q);if(!se||!u){be();return}Ut(se),await c(Wa({inboxIds:n,conversationId:u,connectorId:s})).unwrap().catch(()=>{}),ru(se)},[Ke,u,n,s,c,be,Ut,ru]),fr=p.useCallback(q=>Object.entries(mt).some(([se,Ze])=>Ze.related&&(!q||se===q)),[mt]),Nn=p.useCallback(q=>{const se=mt[q.connectorId],Ir=!((se==null?void 0:se.hiverParam)===q.idFieldKey&&(se==null?void 0:se.value)===q.value)&&fr(q.connectorId);_n(q,"manual"),Ir&&be()},[mt,fr,_n,be]),ea=p.useCallback(q=>{if(At&&(q!=null&&q.connectorId)&&q.externalResourceId){const se={cardId:q.id,externalResourceId:q.externalResourceId};pe(q.connectorId,se);const Ze=Re==null?void 0:Re[q.connectorId];(Ze==null?void 0:Ze.cardId)===se.cardId&&Ze.externalResourceId===se.externalResourceId&&c(Nr.clearRelatedLookup(q.connectorId))}be()},[At,pe,Re,c,be]),ou=p.useCallback(()=>{const q=fr();Be(),q&&be()},[fr,Be,be]),ir=p.useCallback(()=>{me.invalidateQueries({queryKey:["lookup","bulk"]}),be()},[me,be]),As=p.useCallback(()=>{me.invalidateQueries({queryKey:["lookup","bulk"]}),be()},[me,be]),ta=p.useCallback((q,se)=>{q&&u&&se&&c($f({id:q,channelType:"email",conversationId:u,externalResourceId:se,contactEmail:t})).unwrap().catch(()=>{c(Oo(null))})},[c,u,t]);p.useEffect(()=>{(async()=>{D&&(X(await A0(D)),ue(await nd(D)))})()},[D]),p.useEffect(()=>{gt||z(Jn||t)},[t,Jn,gt]),p.useEffect(()=>{G&&u&&iR(String(u),G)},[G,u]),p.useEffect(()=>{te&&D&&rd(D)},[te,D]),p.useEffect(()=>{c(Oo(null))},[s,c]),p.useEffect(()=>{var q;if(Me){x(!0);const{externalResourceId:se}=Me,Ze=(q=Me.forms.find(Ir=>Ir.type==="edit"))==null?void 0:q.id;ta(Ze,se)}else x(!1),c(TO())},[Me,ta,c]),p.useEffect(()=>{const q=be();return Ht(),()=>{q==null||q(),c(Nr.clearConnectorList())}},[c,be,Ht]),p.useEffect(()=>{var q;if($&&Z&&Z.length&&Xt&&!d.current){const{cards_per_app:se,total_empty_cards:Ze,total_cards_with_errors:Ir}=Xt,AC=s?(q=se[0])==null?void 0:q.app_name:null;r(mm,{numOfCards:Z.length,total_cards_loaded:Z.length,total_empty_cards:Ze,total_cards_with_errors:Ir,cards_per_app:se,sm_ids:n,...AC?{app_name:AC}:null}),d.current=!0}return()=>{d.current=!1}},[$,Z,Xt,r,n,s]),p.useEffect(()=>{if(u&&n&&n.length){const q=c(Yf({inboxIds:n,conversationId:u,channelType:"email",isExpandedFormEnabled:jt,connectorId:s}));return()=>q.abort()}},[c,n,u,jt,s]),p.useEffect(()=>{if(!(he!=null&&he.length)||!g.connectorId)return;const q=g.connectorId;A({});const se=he.find(Ze=>Ze.connectorId===q);se&&(H(se),S(!0))},[he,g]);const co=(je||At&&Le)&&!!(Z!=null&&Z.length)&&!Qe;p.useEffect(()=>{!co||!u||De.forEach(({connectorId:q,options:se})=>{TM(String(u),q)&&ft($m,q,{count:se.length,related_count:se.filter(Ze=>Ze.isRelated).length,id_field_keys:Array.from(new Set(se.map(Ze=>Ze.idFieldKey)))})})},[co,u,De,ft]);const KJ=At&&Object.entries(Re??{}).some(([q,se])=>se.status==="loading"&&(!s||q===s));if(!t.length||de===Ae.LOADING||Rt)return a.jsx(Y_,{});const $J=q=>{r(Bm,{connector_name:ae,source:q,sm_ids:n})},sC=q=>{S(!0),$J(q)},eY=()=>{y&&Jl(s3),F&&Yl(i3),ze||w(!0),r(vm)},Jl=q=>{var se;r(q,j),ze?M(!0):(S(!1),H(null),(se=i.onFlowEnd)==null||se.call(i,{flow:"create",outcome:"back"}))},Yl=q=>{if(Me){const{connectorName:se,title:Ze}=Me;r(q,{connector_name:se,card_title:Ze,sm_ids:n,ug_id:l})}ze?M(!0):c(Oo(null))},ql=()=>{var q;ze?M(!0):(w(!1),(q=i.onFlowEnd)==null||q.call(i,{flow:"link",outcome:"back"}))},tY=()=>{var q;be(),(q=i.onFlowEnd)==null||q.call(i,{flow:"link",outcome:"success"})},nY=()=>{var q;(y||v)&&((q=i.onFlowEnd)==null||q.call(i,{flow:y?"create":"link",outcome:"back"})),S(!1),w(!1),c(Oo(null)),T(void 0),M(!1)},fC=()=>{var q;y&&((q=i.onFlowEnd)==null||q.call(i,{flow:"create",outcome:"success"})),be(),S(!1),x(!1),c(Nr.clearConnectorList()),c(Nr.requireFreshReads())},rY=[{label:"Go back",variant:"text",action:nY},{label:"Stay",variant:"contained",action:()=>M(!1)}],Ul=he.length>0,Kl=le.length>0,oY=y||F||v,iC=()=>Ul||Kl?a.jsx(hQ,{haveCreateObjects:Ul,haveLinkObjects:Kl,onCreateClick:()=>sC(S3.MAIN_BUTTON),onLinkClick:()=>w(!0)}):a.jsx(S5,{isAdmin:e,hideHeading:!0}),uY=()=>{ee(!0);const q=re.current,se=q==null?void 0:q.connectorName,Ze=q==null?void 0:q.name;r(oE,{entry_point:"agent",app_name:se,object_type:Ze})},aY=q=>{re.current=q};return a.jsxs(Q3,{ref:m,"data-testid":Array.isArray(Z)?"connector-agent":"loading",id:"connector-agent-container",style:v&&k?{padding:0}:void 0,stopOverflow:y||v,children:[a.jsx(b_,{}),a.jsx(h4,{shown:L,setShown:M,title:xO,description:yO,buttons:rY}),a.jsx(kb,{onWheel:()=>E(!0),ref:C,children:W?a.jsxs(a.Fragment,{children:[!Qe&&a.jsx(D7,{connectors:Tt,isWriteFlowEnabled:Ot,haveCreateObjects:Ul,haveLinkObjects:Kl,cards:Z,handleCreateNewObject:()=>sC(S3.ICON),handleLinkNewObject:eY,onBack:v&&k?ql:void 0}),ye&&!oY?a.jsx(UQ,{selectedObject:_,setSelectedObject:P,fetchSearchResults:Zl,onReset:oe,root:m.current}):null,a.jsxs(Lu,{children:[a.jsx(Pr,{condition:ye&&Hi,children:a.jsx(fR,{})},"search"),a.jsx(Pr,{condition:ye&&!!_&&!Wi,children:a.jsx(sR,{searchResults:Ri??[],selectedObject:_,onReset:oe,fetchCards:be,onLinkAllRelated:At?un:void 0,onLinkAllRelatedStart:At?yt:void 0})},"results"),a.jsx(Pr,{condition:y,children:a.jsx(R1,{onClose:()=>Jl(s3),title:J0,rightNode:a.jsx(C4,{formId:Oe,conversationId:u,inboxIds:n,enabled:y&&!!Oe&&!!e,setMapFormOpen:uY}),children:a.jsx(m4,{onClose:()=>Jl(Im),onCreateSuccess:fC,metaData:j,setMetaData:T,defaultOption:V,connectors:Tt,mapFormOpen:R,setMapFormOpen:ee,setCreateFormId:Ce,syncCurrentObject:aY})})},"create-form"),a.jsx(Pr,{condition:F,children:a.jsx(R1,{onClose:()=>Yl(i3),title:zt?HE((dC=ie==null?void 0:ie[Pe??""])==null?void 0:dC.name):RE,backButtonTooltip:"Back",children:a.jsx(m4,{isEdit:!0,onClose:()=>Yl(_m),onCreateSuccess:fC,metaData:j,setMetaData:T,connectors:Tt})})},"edit-form"),a.jsx(Pr,{condition:v,children:a.jsx(R1,{onClose:ql,hideBar:k,children:a.jsx(pQ,{setOpenTaskLinking:w,onCancel:ql,onLinkingSuccess:tY,onSearchViewChange:O})})},"link-form"),a.jsxs(Pr,{fallback:!0,children:[co?a.jsxs(f.Stack,{direction:"row",alignItems:"center",gap:"8px",children:[a.jsx(f.Stack,{sx:{flex:1,minWidth:0},children:a.jsx(gj,{emailHeaders:Kt,selectedEmail:G,root:m.current,isLoading:gt,isKeyLoading:KJ,setSelectedEmail:z,idOptionGroups:At?De:void 0,selectedIdOption:At?qe:void 0,onSelectIdOption:Nn,onSelectEmail:At?ou:void 0,persistEmailSelection:je})}),Qt&&dn&&e&&a.jsx(f.Tooltip,{title:"Update customer identity mapping",placement:"top",children:a.jsx(f.IconButton,{"aria-label":"Open customer identity mapping settings",sx:{height:"32px",width:"32px",marginTop:"12px",flexShrink:0},onClick:()=>{r(c3,{page:"agent_connector_panel"}),Fe(!0)},children:a.jsx(f.icons.SettingsOutlined,{sx:{height:"20px",width:"20px"}})})})]}):null,!co&&Qt&&dn&&e&&(Z!=null&&Z.length)?a.jsx(f.Button,{fullWidth:!0,variant:"contained",startIcon:a.jsx(f.icons.SettingsOutlined,{sx:{height:"14px",width:"14px"}}),sx:{backgroundColor:"var(--connector-surface-active)",color:"var(--connector-text-secondary)",borderRadius:"6px",padding:"9px 12px",marginTop:"12px",textTransform:"none",fontWeight:f.theme.typography.fontWeightMedium,fontSize:`${f.theme.typography.body1.fontSize}px`,lineHeight:"20px",boxShadow:"none","&:hover":{backgroundColor:"var(--connector-surface-hover)",boxShadow:"none"}},onClick:()=>{r(c3,{page:"agent_connector_panel"}),Fe(!0)},children:"Customer identity mapping"}):null,kt?a.jsx(q_,{}):null,a.jsxs(Lu,{children:[a.jsxs(Pr,{condition:!!Z&&Z.length>0,children:[a.jsx(t5.Provider,{value:ne,children:a.jsx(h_,{cards:$e,specificCardData:K,email:G??"",specificConnectorApiStatus:U,onCardUnlinking:ea})}),a.jsx("div",{ref:b,children:Je?a.jsx(ib,{connectors:Tt,expanded:J}):null})]},"cards-list"),a.jsx(Pr,{condition:!(Z!=null&&Z.length)&&Ot,children:ct.length>0?a.jsx(m_,{connectors:ct,onConnected:As,children:iC()}):iC()},"create-banner")]})]},"cards")]})]}):a.jsx(S5,{isAdmin:e})}),!W&&a.jsx(Eb,{}),Qt&&a.jsx(BR,{open:fe,onClose:()=>Fe(!1),connectors:Zn,onSaveSuccess:ir})]})},SR=({children:e,sendTrackingEvent:t,contactEmail:n,baseUrls:r={},currentSmIds:o=[],userEmail:u,metaData:s,availableFeatures:i,conversationId:c,connectorFunctions:l,stackingContext:D,isAdmin:d=!1,actionQueue:m,store:b,connectorId:C,variables:g})=>{const A=p.useMemo(()=>({userEmail:u,email:n,baseUrls:r,currentSmIds:o,metaData:s,conversationId:c,sendTrackingEvent:t||(()=>{}),availableFeatures:i,isAdmin:d,connectorFunctions:l,stackingContext:D,actionQueue:m,store:b,connectorId:C,variables:g}),[u,n,r,t,o,s,i,c,d,l,D,m,b,C,g]);return a.jsx(Ue.Provider,{value:A,children:e})},L4=p.createContext(null),O4=({value:e,children:t})=>a.jsx(L4.Provider,{value:e,children:t}),Wn=()=>{const e=p.useContext(L4);if(!e)throw new Error("useSlackContext must be used inside <SlackContextProvider>");return e},No=e=>{var u;const t=e==null?void 0:e.response;if(!t)return!1;const n=t.status,r=t.data,o=((u=r==null?void 0:r.detail)==null?void 0:u.reason)??(r==null?void 0:r.reason);return n===401&&o==="slack_invalid_auth"||n===412&&o==="user_slack_auth_missing"};function Ja(){const{connectorId:e}=Wn(),t=vt();return p.useCallback(()=>{t.invalidateQueries({queryKey:["userAuthStatus",e]})},[t,e])}const sl=()=>{const e=n=>{No(n)&&t.invalidateQueries({queryKey:["userAuthStatus"]})},t=new NC({queryCache:new vD({onError:e}),mutationCache:new SD({onError:e})});return t},Ya=({children:e})=>{const[t]=p.useState(sl);return a.jsx(n0,{client:t,children:e})},IR=rA({cardList:yM,userAuth:t_,write:LO,common:eO}),Po=Mx({reducer:IR,devTools:!0}),kR=()=>{const e=an();if(!e){He.warn("[connectors-ui] registerUserAuthCallback called before initConnectorsBifrost; user-tier 412 responses will not route through the userAuth slice.");return}e.onUserAuthRequired=t=>{Po.dispatch($M({connectorId:t.connector_id,connectUrl:t.connect_url,reason:t.reason}))}},TR=({children:e,userEmail:t,extraParams:n,contactEmail:r,baseUrls:o,availableFeatures:u,connectorFunctions:s,stackingContext:i,actionQueue:c,store:l,connectorId:D,theme:d})=>{var b;p.useEffect(()=>{kR()},[]);const m=((b=an())==null?void 0:b.tenantPlatform)==="HIVERWEB";return a.jsx(pu,{store:Po,children:a.jsx(Mr,{config:d,children:a.jsx(mp,{enabled:m,children:a.jsx(Ya,{children:a.jsx(SR,{...n,userEmail:t,availableFeatures:u,sendTrackingEvent:n==null?void 0:n.sendTrackingEvent,contactEmail:r,currentSmIds:n==null?void 0:n.currentSmIds,metaData:n==null?void 0:n.metaData,conversationId:n==null?void 0:n.conversationId,baseUrls:o,connectorFunctions:s,stackingContext:i,actionQueue:c,isAdmin:n==null?void 0:n.isAdmin,store:l,connectorId:D,children:a.jsx(p.Suspense,{fallback:a.jsx(a.Fragment,{}),children:e})})})})})})},LR=({userEmail:e="",contactEmail:t="",baseUrls:n={},extraParams:r={},availableFeatures:o={},connectorFunctions:u,stackingContext:s={},actionQueue:i,store:c,theme:l=qr})=>{const D=wu(l),[d,m]=p.useState(()=>{if(c)return c.getData("connectorId")});return p.useEffect(()=>{if(!c)return;const b=c.subscribe(C=>{m(C)},"connectorId");return()=>b()},[c]),a.jsx(Cu,{className:"connector-theme-root","data-color-scheme":l.mode,style:D,children:a.jsxs(TR,{userEmail:e,availableFeatures:o,extraParams:r,contactEmail:t,connectorFunctions:u,stackingContext:s,actionQueue:i,baseUrls:n,store:c,connectorId:d,theme:l,children:[a.jsx(wR,{isAdmin:r==null?void 0:r.isAdmin},d||"root"),a.jsx(Xf,{zIndex:s.toastMessage}),a.jsx("div",{"data-connectorid":"connector-layover-portal"})]})})},OR={OPEN_FORM_VIEW:"connector-agent-open-form-view"},M4="/v1/api",MR=`${M4}/connector/conversation/:conversationId/data`,_R=`${M4}/connector/feedback/conversation/:conversationId`,jR=async(e,t)=>{try{let n=MR.replace(":conversationId",e)+"?channel_type=email";if(t!=null&&t.length){const o=t.map(u=>`inbox_ids=${encodeURIComponent(u)}`).join("&");n+=`&${o}`}const r=await Ee({url:n,method:ve.GET});return r!=null&&r.data&&Array.isArray(r.data)?r.data.reduce((u,s)=>{var i,c;return u[(i=s==null?void 0:s.cardData)==null?void 0:i.textToHighlight]||(u[(c=s==null?void 0:s.cardData)==null?void 0:c.textToHighlight]={...s}),u},{}):null}catch(n){return Promise.reject(n)}};function NR(e,t,n){return Ct({queryKey:["connector-analytics",e,t,n],queryFn:async()=>!t||!e?null:await jR(e,n),enabled:!!t&&!!e})}class PR{constructor(t=[],n=null){et(this,"highlightTerms");et(this,"termPatterns",[]);et(this,"observer");et(this,"isHighlighting");et(this,"debounceTimer");et(this,"debounceDelay");et(this,"onHighlightsUpdated");this.highlightTerms=t,this.observer=null,this.isHighlighting=!1,this.debounceTimer=null,this.debounceDelay=500,this.onHighlightsUpdated=n,this.compileTermPatterns(),this.init()}init(){this.highlightAllEmails(),this.startObserver()}startObserver(){const t=this.findGmailContainer();if(!t){He.warn("Gmail container not found");return}this.observer=new MutationObserver(n=>{if(this.isHighlighting)return;let r=!1;n.forEach(o=>{o.type==="childList"&&Array.from(o.addedNodes).some(i=>{var c,l,D,d;return i.nodeType===1&&i instanceof Element&&(((c=i.classList)==null?void 0:c.contains("a3s"))||((l=i.classList)==null?void 0:l.contains("ii"))||((D=i.querySelector)==null?void 0:D.call(i,".a3s"))||((d=i.querySelector)==null?void 0:d.call(i,"h2.hP")))})&&(r=!0)}),r&&this.debounceHighlight()}),this.observer.observe(t,{childList:!0,subtree:!0})}findGmailContainer(){return document.querySelector('[role="main"]')||document.querySelector(".nH.if")||document.querySelector(".AO")||document.body}debounceHighlight(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.highlightAllEmails()},this.debounceDelay)}highlightAllEmails(){var t;if(this.highlightTerms.length!==0){this.isHighlighting=!0;try{this.clearHighlights();const n=["h2.hP",".ii.gt .a3s",'[data-expanded="true"]'].join(", "),r=new Set(document.querySelectorAll(n)),o=[];if(r.forEach(u=>{this.isElementVisible(u)&&o.push(u)}),o.forEach(u=>this.highlightInElement(u)),this.onHighlightsUpdated){const u=Array.from(document.querySelectorAll(".gmail-highlight"));(t=this.onHighlightsUpdated)==null||t.call(this,u)}}finally{setTimeout(()=>{this.isHighlighting=!1},250)}}}isElementVisible(t){const n=t;return n.offsetParent!==null&&n.offsetWidth>0&&n.offsetHeight>0}highlightInElement(t){if(!t||this.highlightTerms.length===0||t.dataset.highlightProcessed==="true")return;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:s=>s.parentElement&&s.parentElement.classList.contains("gmail-highlight")||s.parentElement&&["SCRIPT","STYLE"].includes(s.parentElement.tagName)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),o=[];let u;for(;u=r.nextNode();)o.push(u);o.forEach(s=>{this.highlightInTextNode(s)}),t.dataset.highlightProcessed="true"}highlightInTextNode(t){let n=t.textContent,r=!1;if(n&&(this.termPatterns.forEach(({term:o,regex:u})=>{u.lastIndex=0;const s=n.replace(u,`<span class="gmail-highlight" data-highlight-term="${o}"><span class="gmail-highlight-inner">${o}</span></span>`);s!==n&&(n=s,r=!0)}),r&&t.parentNode)){const o=document.createElement("span");o.innerHTML=n,t.parentNode.replaceChild(o,t)}}clearHighlights(){document.querySelectorAll(".gmail-highlight").forEach(r=>{const o=r.parentNode;o&&r.textContent&&(o.replaceChild(document.createTextNode(r.textContent),r),o.normalize())}),document.querySelectorAll('[data-highlight-processed="true"]').forEach(r=>{delete r.dataset.highlightProcessed})}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}compileTermPatterns(){this.termPatterns=[...this.highlightTerms].map(t=>t==null?void 0:t.trim()).filter(t=>!!t&&t.length>0).sort((t,n)=>n.length-t.length).map(t=>({term:t,regex:new RegExp(`\\b${this.escapeRegex(t)}\\b`,"gi")}))}refreshHighlights(){this.highlightAllEmails()}updateHighlightTerms(t){this.highlightTerms=t||[],this.compileTermPatterns(),this.highlightAllEmails()}destroy(){this.observer&&(this.observer.disconnect(),this.observer=null),this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.clearHighlights(),this.highlightTerms=[],this.termPatterns=[]}}if(!document.getElementById("gmail-highlighter-styles")){const e=document.createElement("style");e.id="gmail-highlighter-styles",e.textContent=`
|
|
3320
|
+
`,fR=()=>a.jsxs(f.Stack,{marginTop:"12px",children:[a.jsx(Ou,{variant:"rounded",width:"50%",height:"16px",animation:"wave",margin:"0 0 18px 0"}),a.jsx(f.Stack,{gap:"17px",children:a.jsxs(k4,{gap:"8px",disableHover:!0,children:[a.jsx(Ou,{variant:"rounded",width:"30%",height:"16px",animation:"wave"}),a.jsx(Ou,{variant:"rounded",width:"70%",height:"16px",animation:"wave"})]})})]});let ul={};const al=new Set,iR=(e,t)=>{ul={...ul,[e]:t},al.forEach(n=>n())},cR=e=>(al.add(e),()=>al.delete(e)),lR=e=>p.useSyncExternalStore(cR,()=>ul)[e],DR=async({id:e,searchString:t,args:n,smId:r,smIds:o})=>{try{if(e===void 0||t===void 0)return[];const u=await Ee({url:T1(XQ.replace(":formId",e.toString()),r,o),method:ve.POST,data:{search_string:t,args:n}});let s=null;return u!=null&&u.data&&"data"in u.data&&(s=u.data.data),s}catch(u){Ge({message:Lr,type:dt}),He.error(u)}},dR=(e,t)=>{const n=za(),r=Iu();return Bn({mutationFn:o=>DR({smId:n,smIds:r,...o}),onMutate:({searchString:o,connectorName:u})=>{e(o,u)},onSuccess:(o,{searchString:u,connectorName:s})=>{t(u,o,s)}})},AR=(e,t={})=>{const{delayAfterLoad:n=1e3}=t,r=p.useRef(!1),o=p.useRef(void 0),u=p.useCallback((c="auto")=>{const l=e.current;l&&l.scrollIntoView({behavior:c})},[e]),s=p.useCallback((c,l="smooth")=>{r.current||(o.current!==void 0&&clearTimeout(o.current),c&&(o.current=setTimeout(()=>{u(l),r.current=!0},n)))},[u,n]),i=p.useCallback(()=>{r.current=!1,o.current!==void 0&&clearTimeout(o.current)},[]);return p.useEffect(()=>()=>{o.current!==void 0&&clearTimeout(o.current)},[]),{scrollOnceAfterLoad:s,resetScrollState:i,hasScrolledOnce:r.current}},pR="/v1/api/connectors/lookup/bulk",gR="/v1/api/connectors/lookup/bulk",CR=async e=>{const t=new URLSearchParams;e.forEach(o=>t.append("connector_ids",o));const n=`${pR}?${t.toString()}`,r=await Ee({url:n,method:ve.GET});return r==null?void 0:r.data},hR=async e=>{const t=await Ee({url:gR,method:ve.PUT,data:{entries:e}});return t==null?void 0:t.data},FR={fontSize:`${f.theme.typography.body1.fontSize}px`,width:"209px",height:"40px",color:"var(--connector-text-primary)",background:"var(--connector-surface)",borderRadius:"8px",fontWeight:f.theme.typography.fontWeightRegular,"& .MuiOutlinedInput-notchedOutline":{borderColor:"var(--connector-border-strong)"}},mR={modifiers:[{name:"offset",options:{offset:[0,3]}}]},ER={border:"1px solid var(--connector-border-strong)",borderRadius:"8px",padding:"12px"},T4={flex:1,height:"1px",backgroundColor:"var(--connector-border)"},bR={flexShrink:0,border:"1px solid var(--connector-border)",borderRadius:"15px"},xR={border:"1px solid var(--connector-border)",backgroundColor:"var(--connector-surface-active)",borderRadius:"8px",padding:"8px 10px"},yR=p.memo(function({connector:t,selectedHiverParam:n,onChange:r,sendTrackingEvent:o}){var i;const u=((i=(t.presets??[]).find(c=>c.hiverParam===n))==null?void 0:i.objectParamLabel)??"",s=p.useCallback(c=>{o(nE,{hiver_param:c.target.value,connector_name:t.connectorName,page:"agent_connector_panel"}),r(t.connectorId,c.target.value)},[t.connectorId,t.connectorName,r,o]);return a.jsxs(f.Stack,{direction:"row",alignItems:"center",gap:"0px",justifyContent:"space-between",children:[a.jsx(f.Select,{value:n,onChange:s,size:"small",variant:"outlined",sx:FR,MenuProps:{sx:{zIndex:1500}},renderValue:c=>{var D;const l=((D=(t.presets??[]).find(d=>d.hiverParam===c))==null?void 0:D.label)??"";return a.jsxs(f.Stack,{direction:"row",alignItems:"center",gap:"8px",children:[a.jsx(v5,{width:18,height:18}),a.jsx("span",{children:l})]})},children:(t.presets??[]).map(c=>a.jsx(f.MenuItem,{value:c.hiverParam,sx:{fontSize:`${f.theme.typography.body1.fontSize}px`},children:c.isIdField?a.jsx(f.Tooltip,{title:`${c.label} extracted from the conversation`,placement:"right",slotProps:{popper:mR},children:a.jsx("span",{style:{width:"100%"},children:c.label})}):c.label},c.hiverParam))}),a.jsx(f.Box,{sx:T4}),a.jsxs(f.Stack,{direction:"row",alignItems:"center",gap:"4px",padding:"4px 12px",sx:bR,children:[t.logo&&a.jsx("img",{src:t.logo,width:16,height:16,alt:t.connectorName}),a.jsxs(f.Typography,{variant:"body2",color:"var(--connector-caption-text)",children:["Matches with ",t.connectorName,"'s"]})]}),a.jsx(f.Box,{sx:T4}),a.jsx(f.Box,{sx:xR,children:a.jsx(f.Typography,{variant:"body2",fontSize:14,children:u})})]})}),BR=p.memo(function({open:t,onClose:n,connectors:r,onSaveSuccess:o}){const{sendTrackingEvent:u}=p.useContext(Ue),[s,i]=p.useState({});p.useEffect(()=>{if(t&&r.length>0){const C={};r.filter(g=>{var A;return((A=g.presets)==null?void 0:A.length)>1}).forEach(g=>{C[g.connectorId]=g.hiverParam}),i(C)}},[t,r]);const c=vt(),{mutate:l,isPending:D}=Bn({mutationFn:hR,onSuccess:C=>{const g={};C.results.forEach(({connectorId:A,hiverParam:h})=>{g[A]=h}),c.setQueriesData({queryKey:["lookup","bulk"]},A=>A&&{...A,connectors:A.connectors.map(h=>g[h.connectorId]!==void 0?{...h,hiverParam:g[h.connectorId]}:h)}),u(rE,{page:"agent_connector_panel"}),Ge({message:"Identity mapping saved successfully",type:"success"}),o==null||o(),n()},onError:()=>{Ge({message:"Failed to save identity mapping",type:"error"})}}),d=p.useCallback(()=>{const C=Object.entries(s).map(([g,A])=>({connector_id:g,hiver_param:A}));l(C)},[s,l]),m=p.useCallback((C,g)=>{i(A=>({...A,[C]:g}))},[]),b=p.useCallback(C=>{C||n()},[n]);return a.jsx(rr,{shown:t,setShown:b,showCloseButton:!0,borderRadius:8,children:a.jsxs(f.Stack,{padding:"24px 20px",gap:"16px",sx:{minWidth:"800px"},children:[a.jsx(f.Typography,{variant:"h2",children:"Customer identity mapping"}),a.jsx(f.Typography,{variant:"body2",children:"Choose how Hiver should match customer details with data in your connected apps."}),r.some(C=>{var g;return((g=C.presets)==null?void 0:g.length)>1})&&a.jsx(f.Stack,{gap:"8px",sx:ER,children:r.filter(C=>{var g;return((g=C.presets)==null?void 0:g.length)>1}).map(C=>a.jsx(yR,{connector:C,selectedHiverParam:s[C.connectorId]??C.hiverParam,onChange:m,sendTrackingEvent:u},C.connectorId))}),a.jsxs(f.Stack,{direction:"row",justifyContent:"flex-end",gap:"8px",children:[a.jsx(f.Button,{variant:"text",onClick:n,children:"Cancel"}),a.jsx(f.Button,{variant:"contained",onClick:d,disabled:D,children:"Save"})]})]})})}),vR=({enabled:e,...t})=>{const{actionQueue:n}=p.useContext(Ue),{connectorId:r,conversationId:o}=t,u=p.useRef(t);u.current=t,p.useEffect(()=>{if(!n||!e)return;const s=n.register(()=>u.current);return()=>n.unregister(s)},[n,e,r,o])},wR=({isAdmin:e=!1})=>{var cC,lC,DC,dC;const{email:t,currentSmIds:n,sendTrackingEvent:r,availableFeatures:o,conversationId:u,connectorId:s,connectorFunctions:i}=p.useContext(Ue),c=Zt(),{userGroupId:l,userId:D}=an()||{},d=p.useRef(!1),m=p.useRef(null),b=p.useRef(null),C=p.useRef(null),[g,A]=p.useState({}),[h,E]=p.useState(!1),[F,x]=p.useState(!1),[y,S]=p.useState(!1),[v,w]=p.useState(!1),[k,O]=p.useState(!1),[j,T]=p.useState(),[L,M]=p.useState(!1),[_,P]=p.useState(null),[G,z]=p.useState(),[V,H]=p.useState(null),[J,X]=p.useState(!1),[te,ue]=p.useState(!1),[R,ee]=p.useState(!1),[fe,Fe]=p.useState(!1),[Oe,Ce]=p.useState(void 0),re=p.useRef(),Z=Se(Zp),W=Se(WO),K=Se(VO),U=Se(zO),$=Se(YO),de=Se(GO),he=Se(c5),ae=Se(jM),le=Se(l5),Me=Se(p5),ze=Se(g5),rn=Se(Ij),kt=lt(o,hE),Ot=lt(o,g3),ye=lt(o,yE),je=lt(o,vE),Je=lt(o,wE),jt=lt(o,SE),zt=lt(o,Fa),Pt=(cC=an())==null?void 0:cC.tenantPlatform,Qt=lt(o,Pt==="HIVERWEB"?`hot-${C3}`:C3),At=lt(o,Pt==="HIVERWEB"?`hot-${h3}`:h3),{data:pt}=Ct({queryKey:["connectors","enabledAuthenticated"],queryFn:()=>n1(),enabled:Qt&&e}),it=p.useMemo(()=>(pt??[]).map(q=>q.id),[pt]),{data:Ft,isSuccess:Sr}=Ct({queryKey:["lookup","bulk",it.join(",")],queryFn:()=>CR(it),enabled:it.length>0&&Qt&&e,refetchOnMount:!1}),Zn=p.useMemo(()=>{const q=(Ft==null?void 0:Ft.connectors)??[];return s?q.filter(se=>se.connectorId===s):q},[Ft,s]),dn=Sr&&Zn.some(q=>{var se;return(((se=q.presets)==null?void 0:se.length)??0)>1});vR({conversationId:u,connectorId:s,openCreateForm:q=>{if(q!=null&&q.selectConnectorForm&&q.connectorId){A({connectorId:q.connectorId});return}S(!0)},openLink:()=>w(!0),enabled:W});const Xt=p.useMemo(()=>!Z||!Z.length?null:RO(Z,K,U),[Z,K,U]),Tt=UE(K),ie=Se(si),Pe=(lC=Me==null?void 0:Me.forms.find(q=>q.type==="edit"))==null?void 0:lC.id,ct=p.useMemo(()=>{if(!ie)return[];const q=new Map;return Object.values(ie).forEach(se=>{se.userAuthEnabled&&se.connectorId&&!q.has(se.connectorId)&&q.set(se.connectorId,{connectorId:se.connectorId,connectorName:se.connectorName??se.name,connectorLogo:se.logoUrl??""})}),Array.from(q.values())},[ie]),Mt=p.useMemo(()=>{const q={};return Object.values(ie??{}).forEach(se=>{se.connectorId&&se.connectorName&&(q[se.connectorId]=se.connectorName)}),(Z??[]).forEach(se=>{se.connectorId&&se.connectorName&&(q[se.connectorId]=se.connectorName)}),JSON.stringify(q)},[ie,Z]),xt=p.useMemo(()=>JSON.parse(Mt),[Mt]),{optionsByConnector:on,keys:mt,heldConnectorIds:yn,selectIdOption:_n,setRelatedKey:jn,handleRecordUnlinked:pe,clearIdKeys:Be,trackIdLookupEvent:ft}=bj({enabled:At,appNames:xt}),Re=Se(ti),{beginRelatedLookup:Ut,lookupRelatedRecords:ru,retryRelatedLookup:Q}=Bj({setRelatedKey:jn,trackIdLookupEvent:ft}),ne=p.useMemo(()=>({isEnabled:At,heldConnectorIds:yn,trackIdLookupEvent:ft,retryRelatedLookup:Q}),[At,yn,ft,Q]),De=p.useMemo(()=>Object.entries(on).map(([q,se])=>({connectorId:q,appName:s?void 0:xt[q]??q,options:se})),[on,s,xt]),Le=De.length>0,qe=p.useMemo(()=>{var se;return(se=Object.entries(mt).map(([Ze,Ir])=>({key:Ir,option:rj(on[Ze],Ir)})).filter(Ze=>!!Ze.option).sort((Ze,Ir)=>Ir.key.selectedAt-Ze.key.selectedAt)[0])==null?void 0:se.option},[mt,on]),$e=p.useMemo(()=>{if(!Z||!At)return Z;const q=s?mt[s]?{[s]:mt[s]}:{}:mt;return uj(oj(Z,q),q)},[Z,At,mt,s]),Qe=Se(q=>ct.some(se=>o_(q,se.connectorId))),Xe=p.useMemo(()=>{const q=new Set;return(Z??[]).forEach(se=>{se.userAuthEnabled&&se.connectorId&&q.add(se.connectorId)}),ct.forEach(se=>q.add(se.connectorId)),Array.from(q)},[Z,ct]),{isResolving:Rt}=f_(Xe),{data:Et,isLoading:gt}=w4({senderEmail:t,conversationId:String(u),enabled:je&&!!t}),{emailHeaders:Kt,selectedEmail:Jn}=Et??{},{scrollOnceAfterLoad:Yn,resetScrollState:Ht}=AR(b),io=de!==Ae.LOADING&&(!U||!Object.values(U).some(q=>q===Ae.LOADING))&&Z&&Z.length>0;p.useLayoutEffect(()=>{var q;J&&!h&&te&&((q=C==null?void 0:C.current)!=null&&q.scrollHeight)&&Yn(!!io,"smooth")},[J,h,te,io,Yn,(DC=C==null?void 0:C.current)==null?void 0:DC.scrollHeight,D]);const Ds=(q,se)=>{r(Wm,{search_keyword:q,sm_ids:n,connector_name:se,suggestion_type:rn})},ds=(q,se,Ze)=>{!Array.isArray(se)||!se.length?r(Gm,{search_keyword:q,sm_ids:n,connector_name:Ze,suggestion_type:rn}):se.length&&r(Vm,{num_of_results:se.length,search_keyword:q,sm_ids:n,connector_name:Ze,suggestion_type:rn})},{mutate:Zl,reset:Qi,data:Ri,isPending:Hi,isIdle:Wi}=dR(Ds,ds),oe=p.useCallback(()=>{Qi(),P(null)},[Qi,P]),me=vt(),be=p.useCallback(()=>{if(t&&n.length&&u){const q=c(Wa({inboxIds:n,conversationId:u,connectorId:s}));return()=>q.abort()}},[c,t,n,u,s]),Ke=p.useCallback(({formId:q,externalResourceId:se})=>{const Ze=ie==null?void 0:ie[q];if(!(!(Ze!=null&&Ze.connectorId)||!Ze.cardId||!u))return{connectorId:Ze.connectorId,cardId:Ze.cardId,externalResourceId:se,fallbackCard:{title:Ze.name,logoUrl:Ze.logoUrl,connectorName:Ze.connectorName}}},[ie,u]),yt=p.useCallback(q=>{const se=Ke(q);return se?Ut(se):void 0},[Ke,Ut]),un=p.useCallback(async q=>{const se=Ke(q);if(!se||!u){be();return}Ut(se),await c(Wa({inboxIds:n,conversationId:u,connectorId:s})).unwrap().catch(()=>{}),ru(se)},[Ke,u,n,s,c,be,Ut,ru]),fr=p.useCallback(q=>Object.entries(mt).some(([se,Ze])=>Ze.related&&(!q||se===q)),[mt]),Nn=p.useCallback(q=>{const se=mt[q.connectorId],Ir=!((se==null?void 0:se.hiverParam)===q.idFieldKey&&(se==null?void 0:se.value)===q.value)&&fr(q.connectorId);_n(q,"manual"),Ir&&be()},[mt,fr,_n,be]),ea=p.useCallback(q=>{if(At&&(q!=null&&q.connectorId)&&q.externalResourceId){const se={cardId:q.id,externalResourceId:q.externalResourceId};pe(q.connectorId,se);const Ze=Re==null?void 0:Re[q.connectorId];(Ze==null?void 0:Ze.cardId)===se.cardId&&Ze.externalResourceId===se.externalResourceId&&c(Nr.clearRelatedLookup(q.connectorId))}be()},[At,pe,Re,c,be]),ou=p.useCallback(()=>{const q=fr();Be(),q&&be()},[fr,Be,be]),ir=p.useCallback(()=>{me.invalidateQueries({queryKey:["lookup","bulk"]}),be()},[me,be]),As=p.useCallback(()=>{me.invalidateQueries({queryKey:["lookup","bulk"]}),be()},[me,be]),ta=p.useCallback((q,se)=>{q&&u&&se&&c($f({id:q,channelType:"email",conversationId:u,externalResourceId:se,contactEmail:t})).unwrap().catch(()=>{c(Oo(null))})},[c,u,t]);p.useEffect(()=>{(async()=>{D&&(X(await A0(D)),ue(await nd(D)))})()},[D]),p.useEffect(()=>{gt||z(Jn||t)},[t,Jn,gt]),p.useEffect(()=>{G&&u&&iR(String(u),G)},[G,u]),p.useEffect(()=>{te&&D&&rd(D)},[te,D]),p.useEffect(()=>{c(Oo(null))},[s,c]),p.useEffect(()=>{var q;if(Me){x(!0);const{externalResourceId:se}=Me,Ze=(q=Me.forms.find(Ir=>Ir.type==="edit"))==null?void 0:q.id;ta(Ze,se)}else x(!1),c(TO())},[Me,ta,c]),p.useEffect(()=>{const q=be();return Ht(),()=>{q==null||q(),c(Nr.clearConnectorList())}},[c,be,Ht]),p.useEffect(()=>{var q;if($&&Z&&Z.length&&Xt&&!d.current){const{cards_per_app:se,total_empty_cards:Ze,total_cards_with_errors:Ir}=Xt,AC=s?(q=se[0])==null?void 0:q.app_name:null;r(mm,{numOfCards:Z.length,total_cards_loaded:Z.length,total_empty_cards:Ze,total_cards_with_errors:Ir,cards_per_app:se,sm_ids:n,...AC?{app_name:AC}:null}),d.current=!0}return()=>{d.current=!1}},[$,Z,Xt,r,n,s]),p.useEffect(()=>{if(u&&n&&n.length){const q=c(Yf({inboxIds:n,conversationId:u,channelType:"email",isExpandedFormEnabled:jt,connectorId:s}));return()=>q.abort()}},[c,n,u,jt,s]),p.useEffect(()=>{if(!(he!=null&&he.length)||!g.connectorId)return;const q=g.connectorId;A({});const se=he.find(Ze=>Ze.connectorId===q);se&&(H(se),S(!0))},[he,g]);const co=(je||At&&Le)&&!!(Z!=null&&Z.length)&&!Qe;p.useEffect(()=>{!co||!u||De.forEach(({connectorId:q,options:se})=>{TM(String(u),q)&&ft($m,q,{count:se.length,related_count:se.filter(Ze=>Ze.isRelated).length,id_field_keys:Array.from(new Set(se.map(Ze=>Ze.idFieldKey)))})})},[co,u,De,ft]);const $J=At&&Object.entries(Re??{}).some(([q,se])=>se.status==="loading"&&(!s||q===s));if(!t.length||de===Ae.LOADING||Rt)return a.jsx(Y_,{});const eY=q=>{r(Bm,{connector_name:ae,source:q,sm_ids:n})},sC=q=>{S(!0),eY(q)},tY=()=>{y&&Jl(s3),F&&Yl(i3),ze||w(!0),r(vm)},Jl=q=>{var se;r(q,j),ze?M(!0):(S(!1),H(null),(se=i.onFlowEnd)==null||se.call(i,{flow:"create",outcome:"back"}))},Yl=q=>{if(Me){const{connectorName:se,title:Ze}=Me;r(q,{connector_name:se,card_title:Ze,sm_ids:n,ug_id:l})}ze?M(!0):c(Oo(null))},ql=()=>{var q;ze?M(!0):(w(!1),(q=i.onFlowEnd)==null||q.call(i,{flow:"link",outcome:"back"}))},nY=()=>{var q;be(),(q=i.onFlowEnd)==null||q.call(i,{flow:"link",outcome:"success"})},rY=()=>{var q;(y||v)&&((q=i.onFlowEnd)==null||q.call(i,{flow:y?"create":"link",outcome:"back"})),S(!1),w(!1),c(Oo(null)),T(void 0),M(!1)},fC=()=>{var q;y&&((q=i.onFlowEnd)==null||q.call(i,{flow:"create",outcome:"success"})),be(),S(!1),x(!1),c(Nr.clearConnectorList()),c(Nr.requireFreshReads())},oY=[{label:"Go back",variant:"text",action:rY},{label:"Stay",variant:"contained",action:()=>M(!1)}],Ul=he.length>0,Kl=le.length>0,uY=y||F||v,iC=()=>Ul||Kl?a.jsx(hQ,{haveCreateObjects:Ul,haveLinkObjects:Kl,onCreateClick:()=>sC(S3.MAIN_BUTTON),onLinkClick:()=>w(!0)}):a.jsx(S5,{isAdmin:e,hideHeading:!0}),aY=()=>{ee(!0);const q=re.current,se=q==null?void 0:q.connectorName,Ze=q==null?void 0:q.name;r(oE,{entry_point:"agent",app_name:se,object_type:Ze})},sY=q=>{re.current=q};return a.jsxs(Q3,{ref:m,"data-testid":Array.isArray(Z)?"connector-agent":"loading",id:"connector-agent-container",style:v&&k?{padding:0}:void 0,stopOverflow:y||v,children:[a.jsx(b_,{}),a.jsx(h4,{shown:L,setShown:M,title:xO,description:yO,buttons:oY}),a.jsx(kb,{onWheel:()=>E(!0),ref:C,children:W?a.jsxs(a.Fragment,{children:[!Qe&&a.jsx(D7,{connectors:Tt,isWriteFlowEnabled:Ot,haveCreateObjects:Ul,haveLinkObjects:Kl,cards:Z,handleCreateNewObject:()=>sC(S3.ICON),handleLinkNewObject:tY,onBack:v&&k?ql:void 0}),ye&&!uY?a.jsx(UQ,{selectedObject:_,setSelectedObject:P,fetchSearchResults:Zl,onReset:oe,root:m.current}):null,a.jsxs(Lu,{children:[a.jsx(Pr,{condition:ye&&Hi,children:a.jsx(fR,{})},"search"),a.jsx(Pr,{condition:ye&&!!_&&!Wi,children:a.jsx(sR,{searchResults:Ri??[],selectedObject:_,onReset:oe,fetchCards:be,onLinkAllRelated:At?un:void 0,onLinkAllRelatedStart:At?yt:void 0})},"results"),a.jsx(Pr,{condition:y,children:a.jsx(R1,{onClose:()=>Jl(s3),title:J0,rightNode:a.jsx(C4,{formId:Oe,conversationId:u,inboxIds:n,enabled:y&&!!Oe&&!!e,setMapFormOpen:aY}),children:a.jsx(m4,{onClose:()=>Jl(Im),onCreateSuccess:fC,metaData:j,setMetaData:T,defaultOption:V,connectors:Tt,mapFormOpen:R,setMapFormOpen:ee,setCreateFormId:Ce,syncCurrentObject:sY})})},"create-form"),a.jsx(Pr,{condition:F,children:a.jsx(R1,{onClose:()=>Yl(i3),title:zt?HE((dC=ie==null?void 0:ie[Pe??""])==null?void 0:dC.name):RE,backButtonTooltip:"Back",children:a.jsx(m4,{isEdit:!0,onClose:()=>Yl(_m),onCreateSuccess:fC,metaData:j,setMetaData:T,connectors:Tt})})},"edit-form"),a.jsx(Pr,{condition:v,children:a.jsx(R1,{onClose:ql,hideBar:k,children:a.jsx(pQ,{setOpenTaskLinking:w,onCancel:ql,onLinkingSuccess:nY,onSearchViewChange:O})})},"link-form"),a.jsxs(Pr,{fallback:!0,children:[co?a.jsxs(f.Stack,{direction:"row",alignItems:"center",gap:"8px",children:[a.jsx(f.Stack,{sx:{flex:1,minWidth:0},children:a.jsx(gj,{emailHeaders:Kt,selectedEmail:G,root:m.current,isLoading:gt,isKeyLoading:$J,setSelectedEmail:z,idOptionGroups:At?De:void 0,selectedIdOption:At?qe:void 0,onSelectIdOption:Nn,onSelectEmail:At?ou:void 0,persistEmailSelection:je})}),Qt&&dn&&e&&a.jsx(f.Tooltip,{title:"Update customer identity mapping",placement:"top",children:a.jsx(f.IconButton,{"aria-label":"Open customer identity mapping settings",sx:{height:"32px",width:"32px",marginTop:"12px",flexShrink:0},onClick:()=>{r(c3,{page:"agent_connector_panel"}),Fe(!0)},children:a.jsx(f.icons.SettingsOutlined,{sx:{height:"20px",width:"20px"}})})})]}):null,!co&&Qt&&dn&&e&&(Z!=null&&Z.length)?a.jsx(f.Button,{fullWidth:!0,variant:"contained",startIcon:a.jsx(f.icons.SettingsOutlined,{sx:{height:"14px",width:"14px"}}),sx:{backgroundColor:"var(--connector-surface-active)",color:"var(--connector-text-secondary)",borderRadius:"6px",padding:"9px 12px",marginTop:"12px",textTransform:"none",fontWeight:f.theme.typography.fontWeightMedium,fontSize:`${f.theme.typography.body1.fontSize}px`,lineHeight:"20px",boxShadow:"none","&:hover":{backgroundColor:"var(--connector-surface-hover)",boxShadow:"none"}},onClick:()=>{r(c3,{page:"agent_connector_panel"}),Fe(!0)},children:"Customer identity mapping"}):null,kt?a.jsx(q_,{}):null,a.jsxs(Lu,{children:[a.jsxs(Pr,{condition:!!Z&&Z.length>0,children:[a.jsx(t5.Provider,{value:ne,children:a.jsx(h_,{cards:$e,specificCardData:K,email:G??"",specificConnectorApiStatus:U,onCardUnlinking:ea})}),a.jsx("div",{ref:b,children:Je?a.jsx(ib,{connectors:Tt,expanded:J}):null})]},"cards-list"),a.jsx(Pr,{condition:!(Z!=null&&Z.length)&&Ot,children:ct.length>0?a.jsx(m_,{connectors:ct,onConnected:As,children:iC()}):iC()},"create-banner")]})]},"cards")]})]}):a.jsx(S5,{isAdmin:e})}),!W&&a.jsx(Eb,{}),Qt&&a.jsx(BR,{open:fe,onClose:()=>Fe(!1),connectors:Zn,onSaveSuccess:ir})]})},SR=({children:e,sendTrackingEvent:t,contactEmail:n,baseUrls:r={},currentSmIds:o=[],userEmail:u,metaData:s,availableFeatures:i,conversationId:c,connectorFunctions:l,stackingContext:D,isAdmin:d=!1,actionQueue:m,store:b,connectorId:C,variables:g})=>{const A=p.useMemo(()=>({userEmail:u,email:n,baseUrls:r,currentSmIds:o,metaData:s,conversationId:c,sendTrackingEvent:t||(()=>{}),availableFeatures:i,isAdmin:d,connectorFunctions:l,stackingContext:D,actionQueue:m,store:b,connectorId:C,variables:g}),[u,n,r,t,o,s,i,c,d,l,D,m,b,C,g]);return a.jsx(Ue.Provider,{value:A,children:e})},L4=p.createContext(null),O4=({value:e,children:t})=>a.jsx(L4.Provider,{value:e,children:t}),Wn=()=>{const e=p.useContext(L4);if(!e)throw new Error("useSlackContext must be used inside <SlackContextProvider>");return e},No=e=>{var u;const t=e==null?void 0:e.response;if(!t)return!1;const n=t.status,r=t.data,o=((u=r==null?void 0:r.detail)==null?void 0:u.reason)??(r==null?void 0:r.reason);return n===401&&o==="slack_invalid_auth"||n===412&&o==="user_slack_auth_missing"};function Ja(){const{connectorId:e}=Wn(),t=vt();return p.useCallback(()=>{t.invalidateQueries({queryKey:["userAuthStatus",e]})},[t,e])}const sl=()=>{const e=n=>{No(n)&&t.invalidateQueries({queryKey:["userAuthStatus"]})},t=new NC({queryCache:new vD({onError:e}),mutationCache:new SD({onError:e})});return t},Ya=({children:e})=>{const[t]=p.useState(sl);return a.jsx(n0,{client:t,children:e})},IR=rA({cardList:yM,userAuth:t_,write:LO,common:eO}),Po=Mx({reducer:IR,devTools:!0}),kR=()=>{const e=an();if(!e){He.warn("[connectors-ui] registerUserAuthCallback called before initConnectorsBifrost; user-tier 412 responses will not route through the userAuth slice.");return}e.onUserAuthRequired=t=>{Po.dispatch($M({connectorId:t.connector_id,connectUrl:t.connect_url,reason:t.reason}))}},TR=({children:e,userEmail:t,extraParams:n,contactEmail:r,baseUrls:o,availableFeatures:u,connectorFunctions:s,stackingContext:i,actionQueue:c,store:l,connectorId:D,theme:d})=>{var b;p.useEffect(()=>{kR()},[]);const m=((b=an())==null?void 0:b.tenantPlatform)==="HIVERWEB";return a.jsx(pu,{store:Po,children:a.jsx(Mr,{config:d,children:a.jsx(mp,{enabled:m,children:a.jsx(Ya,{children:a.jsx(SR,{...n,userEmail:t,availableFeatures:u,sendTrackingEvent:n==null?void 0:n.sendTrackingEvent,contactEmail:r,currentSmIds:n==null?void 0:n.currentSmIds,metaData:n==null?void 0:n.metaData,conversationId:n==null?void 0:n.conversationId,baseUrls:o,connectorFunctions:s,stackingContext:i,actionQueue:c,isAdmin:n==null?void 0:n.isAdmin,store:l,connectorId:D,children:a.jsx(p.Suspense,{fallback:a.jsx(a.Fragment,{}),children:e})})})})})})},LR=({userEmail:e="",contactEmail:t="",baseUrls:n={},extraParams:r={},availableFeatures:o={},connectorFunctions:u,stackingContext:s={},actionQueue:i,store:c,theme:l=qr})=>{const D=wu(l),[d,m]=p.useState(()=>{if(c)return c.getData("connectorId")});return p.useEffect(()=>{if(!c)return;const b=c.subscribe(C=>{m(C)},"connectorId");return()=>b()},[c]),a.jsx(Cu,{className:"connector-theme-root","data-color-scheme":l.mode,style:D,children:a.jsxs(TR,{userEmail:e,availableFeatures:o,extraParams:r,contactEmail:t,connectorFunctions:u,stackingContext:s,actionQueue:i,baseUrls:n,store:c,connectorId:d,theme:l,children:[a.jsx(wR,{isAdmin:r==null?void 0:r.isAdmin},d||"root"),a.jsx(Xf,{zIndex:s.toastMessage}),a.jsx("div",{"data-connectorid":"connector-layover-portal"})]})})},OR={OPEN_FORM_VIEW:"connector-agent-open-form-view"},M4="/v1/api",MR=`${M4}/connector/conversation/:conversationId/data`,_R=`${M4}/connector/feedback/conversation/:conversationId`,jR=async(e,t)=>{try{let n=MR.replace(":conversationId",e)+"?channel_type=email";if(t!=null&&t.length){const o=t.map(u=>`inbox_ids=${encodeURIComponent(u)}`).join("&");n+=`&${o}`}const r=await Ee({url:n,method:ve.GET});return r!=null&&r.data&&Array.isArray(r.data)?r.data.reduce((u,s)=>{var i,c;return u[(i=s==null?void 0:s.cardData)==null?void 0:i.textToHighlight]||(u[(c=s==null?void 0:s.cardData)==null?void 0:c.textToHighlight]={...s}),u},{}):null}catch(n){return Promise.reject(n)}};function NR(e,t,n){return Ct({queryKey:["connector-analytics",e,t,n],queryFn:async()=>!t||!e?null:await jR(e,n),enabled:!!t&&!!e})}class PR{constructor(t=[],n=null){et(this,"highlightTerms");et(this,"termPatterns",[]);et(this,"observer");et(this,"isHighlighting");et(this,"debounceTimer");et(this,"debounceDelay");et(this,"onHighlightsUpdated");this.highlightTerms=t,this.observer=null,this.isHighlighting=!1,this.debounceTimer=null,this.debounceDelay=500,this.onHighlightsUpdated=n,this.compileTermPatterns(),this.init()}init(){this.highlightAllEmails(),this.startObserver()}startObserver(){const t=this.findGmailContainer();if(!t){He.warn("Gmail container not found");return}this.observer=new MutationObserver(n=>{if(this.isHighlighting)return;let r=!1;n.forEach(o=>{o.type==="childList"&&Array.from(o.addedNodes).some(i=>{var c,l,D,d;return i.nodeType===1&&i instanceof Element&&(((c=i.classList)==null?void 0:c.contains("a3s"))||((l=i.classList)==null?void 0:l.contains("ii"))||((D=i.querySelector)==null?void 0:D.call(i,".a3s"))||((d=i.querySelector)==null?void 0:d.call(i,"h2.hP")))})&&(r=!0)}),r&&this.debounceHighlight()}),this.observer.observe(t,{childList:!0,subtree:!0})}findGmailContainer(){return document.querySelector('[role="main"]')||document.querySelector(".nH.if")||document.querySelector(".AO")||document.body}debounceHighlight(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.highlightAllEmails()},this.debounceDelay)}highlightAllEmails(){var t;if(this.highlightTerms.length!==0){this.isHighlighting=!0;try{this.clearHighlights();const n=["h2.hP",".ii.gt .a3s",'[data-expanded="true"]'].join(", "),r=new Set(document.querySelectorAll(n)),o=[];if(r.forEach(u=>{this.isElementVisible(u)&&o.push(u)}),o.forEach(u=>this.highlightInElement(u)),this.onHighlightsUpdated){const u=Array.from(document.querySelectorAll(".gmail-highlight"));(t=this.onHighlightsUpdated)==null||t.call(this,u)}}finally{setTimeout(()=>{this.isHighlighting=!1},250)}}}isElementVisible(t){const n=t;return n.offsetParent!==null&&n.offsetWidth>0&&n.offsetHeight>0}highlightInElement(t){if(!t||this.highlightTerms.length===0||t.dataset.highlightProcessed==="true")return;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:s=>s.parentElement&&s.parentElement.classList.contains("gmail-highlight")||s.parentElement&&["SCRIPT","STYLE"].includes(s.parentElement.tagName)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),o=[];let u;for(;u=r.nextNode();)o.push(u);o.forEach(s=>{this.highlightInTextNode(s)}),t.dataset.highlightProcessed="true"}highlightInTextNode(t){let n=t.textContent,r=!1;if(n&&(this.termPatterns.forEach(({term:o,regex:u})=>{u.lastIndex=0;const s=n.replace(u,`<span class="gmail-highlight" data-highlight-term="${o}"><span class="gmail-highlight-inner">${o}</span></span>`);s!==n&&(n=s,r=!0)}),r&&t.parentNode)){const o=document.createElement("span");o.innerHTML=n,t.parentNode.replaceChild(o,t)}}clearHighlights(){document.querySelectorAll(".gmail-highlight").forEach(r=>{const o=r.parentNode;o&&r.textContent&&(o.replaceChild(document.createTextNode(r.textContent),r),o.normalize())}),document.querySelectorAll('[data-highlight-processed="true"]').forEach(r=>{delete r.dataset.highlightProcessed})}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}compileTermPatterns(){this.termPatterns=[...this.highlightTerms].map(t=>t==null?void 0:t.trim()).filter(t=>!!t&&t.length>0).sort((t,n)=>n.length-t.length).map(t=>({term:t,regex:new RegExp(`\\b${this.escapeRegex(t)}\\b`,"gi")}))}refreshHighlights(){this.highlightAllEmails()}updateHighlightTerms(t){this.highlightTerms=t||[],this.compileTermPatterns(),this.highlightAllEmails()}destroy(){this.observer&&(this.observer.disconnect(),this.observer=null),this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.clearHighlights(),this.highlightTerms=[],this.termPatterns=[]}}if(!document.getElementById("gmail-highlighter-styles")){const e=document.createElement("style");e.id="gmail-highlighter-styles",e.textContent=`
|
|
3321
3321
|
.gmail-highlight {
|
|
3322
3322
|
background-color: var(--connector-surface-active, ${f.theme.palette.gray.gray6}) !important;
|
|
3323
3323
|
color: var(--connector-text-primary, #2c3e50) !important;
|
|
@@ -5872,4 +5872,4 @@ Do you want to continue?`,BO="Select an object to create",_p="Select an object t
|
|
|
5872
5872
|
letter-spacing: 0.4px;
|
|
5873
5873
|
line-height: 20px;
|
|
5874
5874
|
margin-top: 14px;
|
|
5875
|
-
`,UZ=({children:e,zIndex:t,onClose:n})=>{const r=a.jsxs(ZZ,{children:[a.jsx(JZ,{variant:"h2",color:"text.primary",children:"Split apps view"}),a.jsx(YZ,{variant:"body2",color:"text.secondary",children:"Each connected app now has its own tab, making it easier to view app-specific data"}),a.jsx(qZ,{variant:"contained",color:"primary",onClick:n,children:"Dismiss"})]});return a.jsx(XZ,{open:!0,title:r,placement:"left-start",disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,slotProps:{popper:{sx:{zIndex:t+1},modifiers:[{name:"flip",enabled:!0},{name:"preventOverflow",enabled:!0}]},tooltip:{sx:{pointerEvents:"auto",maxWidth:"min(360px, calc(60vw - 24px))",padding:"12px"},onClick:o=>o.stopPropagation()},arrow:{sx:{fontSize:`${f.theme.typography.caption.fontSize}px`}}},children:e})},M6=ja("LOCAL"),KZ="connector-library-split-apps-nudge",$Z=({open:e,targetRef:t,endElRef:n,zIndex:r,storageKey:o=KZ,onClose:u})=>{const[s,i]=p.useState(()=>M6.getItem(o)==="true"),c=()=>{M6.setItem(o,"true"),i(!0),u()},l=D=>a.jsx(UZ,{zIndex:r,onClose:c,children:D});return s?null:a.jsx(mL,{open:e,targetRef:t,endElRef:n,padding:8,zIndex:r,renderHighlight:l})},eJ=({theme:e,...t})=>a.jsx(zZ,{theme:e,children:a.jsx($Z,{...t})}),tJ=sl(),_6=({children:e})=>a.jsx(n0,{client:tJ,children:e}),nJ=e=>{var t;switch(e.category){case"ecommerce":return"No customer found for this email. Search by email or order ID to link one.";case"crm":return"No contact found for this email.";case"finance":return"No customer or vendor found for this email.";case"pm":return`No ${((t=e.recordWord)==null?void 0:t[1])??"tasks"} linked to this conversation.`;default:return"Nothing found for this email."}},j6=e=>{var t;return e.category==="ecommerce"?"orders":e.category==="pm"?((t=e.recordWord)==null?void 0:t[1])??"tasks":"records"},rJ=(e,t,n)=>n?`${t} is disconnected. Reconnect to see this customer's ${j6(e)} and keep linked records in sync.`:`${t} is disconnected. Only an admin can reconnect it. ${lJ(j6(e))} will show here again once it's back.`,oJ=e=>`Reconnect ${e}`,uJ="Notify admin",aJ="Admin notified",sJ=e=>e?"Reconnect":"Unavailable",fJ=e=>`View all (${e>99?"99+":e})`,iJ="Search & link",cJ=e=>`Showing records for ${e}`,lJ=e=>e.charAt(0).toUpperCase()+e.slice(1),N6=(e,t)=>e?e.connection==="expired"?sJ(t):e.summary:"",xr={RENDERED:"app_widget_rendered",CARD_CLICKED:"app_widget_card_clicked",VIEW_ALL_CLICKED:"app_widget_view_all_clicked",CTA_CLICKED:"app_widget_cta_clicked",REFRESHED:"app_widget_refreshed",AUTH_ACTION:"app_widget_auth_action"},P6=300,Q6={label:"Order",keys:["order_number","name","number","id","tranid"]},DJ={id:"shopify",namePattern:/shopify/i,category:"ecommerce",records:[{recordType:"Customer",cardTitle:/customer/i,title:{label:"Customer",keys:["customer_name","display_name","name"],join:["first_name","last_name"]},fields:[{label:"Orders",keys:["total_orders","orders_count","number_of_orders"],labelPattern:/orders/i},{label:"Amount spent",keys:["total_spent","amount_spent"],labelPattern:/spent/i,format:"money"}]},{recordType:"Order",cardTitle:/order/i,excludeTitle:/line item/i,title:Q6,fields:[{label:"Fulfillment",keys:["fulfillment_status","display_fulfillment_status"],labelPattern:/fulfil/i},{label:"Order date",keys:["created_at","order_date"],labelPattern:/created|date/i,format:"date"}]}]},dJ={id:"woocommerce",namePattern:/woo/i,category:"ecommerce",records:[{recordType:"Customer",cardTitle:/customer/i,title:{label:"Customer",keys:["name","customer_name"],join:["first_name","last_name"]},fields:[{label:"Orders",keys:["orders_count","total_orders"],labelPattern:/orders/i},{label:"Customer since",keys:["date_created","created_at"],labelPattern:/created|since/i,format:"date"}]},{recordType:"Order",cardTitle:/order/i,title:Q6,fields:[{label:"Status",keys:["status","order_status"],labelPattern:/status/i},{label:"Order date",keys:["date_created","created_at"],labelPattern:/created|date/i,format:"date"}]}]},_i={label:"Owner",keys:["owner_name","owner","deal_owner_name","hubspot_owner_id"],labelPattern:/owner/i},AJ={id:"salesforce",namePattern:/salesforce/i,category:"crm",dealWord:["open opp","open opps"],createLabel:"Create",records:[{recordType:"Contact",cardTitle:/contact/i,title:{label:"Contact",keys:["name","contact_name"],join:["first_name","last_name"]},fields:[{label:"Account",keys:["account_name","account"],labelPattern:/^account( name)?$/i},_i]},{recordType:"Opportunity",cardTitle:/opportunit/i,title:{label:"Opportunity",keys:["opportunity_name","name"]},fields:[{label:"Stage",keys:["stage_name","stage"],labelPattern:/stage/i},{label:"Amount",keys:["amount"],labelPattern:/amount/i,format:"money"}]},{recordType:"Case",cardTitle:/case/i,excludeTitle:/automation/i,title:{label:"Case",keys:["subject","case_number"]},fields:[{label:"Status",keys:["status"],labelPattern:/status/i},{label:"Priority",keys:["priority"],labelPattern:/priority/i}]},{recordType:"Account",cardTitle:/account/i,title:{label:"Account",keys:["name","account_name"]},fields:[_i,{label:"Type",keys:["type","account_type"],labelPattern:/^type$/i}]}]},pJ={id:"hubspot",namePattern:/hubspot/i,category:"crm",dealWord:["open deal","open deals"],records:[{recordType:"Contact",cardTitle:/contact/i,title:{label:"Contact",keys:["name"],join:["first_name","last_name"]},fields:[{label:"Company",keys:["company","company_name"],labelPattern:/^company( name)?$/i},_i]},{recordType:"Deal",cardTitle:/deal/i,title:{label:"Deal",keys:["deal_name","dealname","name"]},fields:[{label:"Stage",keys:["deal_stage","dealstage"],labelPattern:/stage/i},{label:"Amount",keys:["amount"],labelPattern:/amount/i,format:"money"}]},{recordType:"Company",cardTitle:/compan/i,title:{label:"Company",keys:["name","company_name"]},fields:[_i,{label:"Lifecycle stage",keys:["lifecycle_stage","lifecyclestage"],labelPattern:/lifecycle/i}]}]},gJ={id:"netsuite",namePattern:/netsuite/i,category:"finance",records:[{recordType:"Customer",cardTitle:/customer/i,title:{label:"Customer",keys:["company_name","customer_name","name"]},fields:[{label:"Overdue",keys:["overdue_balance","overdueBalance","overdue_amount"],labelPattern:/overdue/i,format:"money"},{label:"Balance",keys:["balance"],labelPattern:/^balance$/i,format:"money"}]},{recordType:"Vendor",cardTitle:/vendor/i,title:{label:"Vendor",keys:["company_name","legal_name","name"]},fields:[{label:"Balance",keys:["balance_primary","balance"],labelPattern:/balance/i,format:"money"},{label:"Unbilled orders",keys:["unbilled_orders_primary","unbilled_orders"],labelPattern:/unbilled/i,format:"money"}]},{recordType:"Sales order",cardTitle:/sales order/i,title:{label:"Sales order",keys:["tranid","tran_id","order_number"]},fields:[{label:"Status",keys:["status"],labelPattern:/status/i},{label:"Total",keys:["total"],labelPattern:/^total$/i,format:"money"}]},{recordType:"Purchase order",cardTitle:/pu?rc?hase order/i,title:{label:"PO",keys:["tranid","tran_id","po_number"]},fields:[{label:"Status",keys:["status"],labelPattern:/status/i},{label:"Total",keys:["total"],labelPattern:/^total$/i,format:"money"}]}]},rs=(e,t,n)=>({recordType:e,cardTitle:/./,title:n??{label:e,keys:["title","name","summary"]},fields:t}),R6={label:"Status",keys:["status","status_name"],labelPattern:/status/i},os={label:"Assignee",keys:["assignee","assignees","members","person"],labelPattern:/assign|member|person/i},CJ=[{id:"jira",namePattern:/jira/i,category:"pm",recordWord:["issue","issues"],createLabel:"Create issue",records:[rs("Issue",[R6,os],{label:"Issue",keys:["title","summary"],join:["issue_id","title"]})]},{id:"clickup",namePattern:/clickup/i,category:"pm",recordWord:["task","tasks"],createLabel:"Create task",records:[rs("Task",[R6,os])]},{id:"asana",namePattern:/asana/i,category:"pm",recordWord:["task","tasks"],createLabel:"Create task",records:[rs("Task",[{label:"Status",keys:["section","completed","status"],labelPattern:/section|completed|status/i},os])]},{id:"monday",namePattern:/monday/i,category:"pm",recordWord:["item","items"],createLabel:"Create item",records:[rs("Item",[{label:"Status",keys:["status","group"],labelPattern:/status|group/i},os])]},{id:"trello",namePattern:/trello/i,category:"pm",recordWord:["card","cards"],createLabel:"Create card",records:[rs("Card",[{label:"List",keys:["list","list_name"],labelPattern:/list/i},os])]}],hJ=[DJ,dJ,AJ,pJ,gJ,...CJ],zl=e=>e?hJ.find(t=>t.namePattern.test(e))??null:null,FJ=404,mJ=403,EJ=401,Xl=e=>e==null||e===""||Array.isArray(e)&&e.length===0,H6=(e,t)=>e.priority-t.priority,bJ=e=>{var r;if(!(e!=null&&e.data))return[];if(e.cardErrorMessage||Vp(e))return[];if(e.cardType==="flat_with_list")return(((r=e.data.listItems)==null?void 0:r.fields)??[]).map(o=>({fields:[...(Array.isArray(o)?o:o.data)??[]].sort(H6),externalResourceId:Array.isArray(o)?void 0:o.externalResourceId}));const t=e.data.flatDisplay,n=(Array.isArray(t)?t:(t==null?void 0:t.data)??[]).filter(o=>Number(o.statusCode)!==FJ&&!(Number(o.statusCode)>=400&&Xl(o.value)));return n.length===0?[]:[{fields:[...n].sort(H6),externalResourceId:Array.isArray(t)||t==null?void 0:t.externalResourceId}]},Mn=(e,t)=>Xl(e)?"":typeof e=="boolean"?t==="completed"?e?"Completed":"Not completed":e?"Yes":"No":Array.isArray(e)?e.map(n=>typeof n=="object"&&n!==null?n.filename??"":String(n)).filter(Boolean).join(", "):String(e),zo=e=>{if(Xl(e)||Array.isArray(e)||typeof e=="boolean")return null;const t=typeof e=="number"?e:Number(String(e).replace(/[^0-9.-]/g,""));return Number.isFinite(t)?t:null},W6=e=>{var n;const t=(n=e.fields.find(r=>r.key==="currency"))==null?void 0:n.value;return typeof t=="string"&&/^[A-Z]{3}$/.test(t)?t:void 0},Xo=(e,t)=>{const n={notation:"compact",maximumFractionDigits:1};try{return new Intl.NumberFormat("en-US",t?{...n,style:"currency",currency:t}:n).format(e)}catch{return new Intl.NumberFormat("en-US",n).format(e)}},xJ=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(t)},ji=(e,t)=>t.keys.map(n=>e.fields.find(r=>r.key===n)).find(Boolean)??(t.labelPattern?e.fields.find(n=>{var r;return(r=t.labelPattern)==null?void 0:r.test(n.label)}):void 0),yJ=(e,t,n)=>{if(t.format==="money"){const o=zo(e.value);return o===null?Mn(e.value,e.key):Xo(o,W6(n))}const r=Mn(e.value,e.key);return t.format==="date"&&r?xJ(r):r},BJ=(e,t)=>{if(t.join){const o=t.join.map(s=>e.fields.find(i=>i.key===s)),u=o.map(s=>Mn(s==null?void 0:s.value,s==null?void 0:s.key)).filter(Boolean).join(" ");if(u&&o.every(Boolean))return{text:u,field:o.find(s=>s==null?void 0:s.deepLink),used:t.join}}const n=ji(e,t),r=n?Mn(n.value,n.key):"";if(r&&n)return{text:r,field:n,used:[n.key]};if(t.join){const o=t.join.map(s=>e.fields.find(i=>i.key===s)).filter(Boolean),u=o.map(s=>Mn(s.value,s.key)).filter(Boolean).join(" ");if(u)return{text:u,field:o[0],used:o.map(s=>s.key)}}return{text:"",used:[]}},vJ=(e,t,n)=>t.fields.map(r=>{const o=ji(e,r);if(o){n.add(o.key);const s=yJ(o,r,e);if(!s&&r.label==="Account")return{label:r.label,value:"No account"};const i=r.label==="Overdue"&&(zo(o.value)??0)>0;return{label:r.label,value:s||"—",...i?{tone:"critical"}:{}}}const u=e.fields.find(s=>!n.has(s.key)&&s.type!=="attachment"&&s.key!=="currency"&&Mn(s.value,s.key));return u?(n.add(u.key),{label:u.label,value:Mn(u.value,u.key)}):null}).filter(r=>r!==null),wJ=(e,t)=>{var r,o;const n={};return t.fields.forEach(u=>{var s;n[u.label]=(s=ji(e,u))==null?void 0:s.value}),n.__title=(r=ji(e,t.title))==null?void 0:r.value,n.__close=(o=e.fields.find(u=>/close_?date/i.test(u.key)))==null?void 0:o.value,n.__currency=W6(e),n},SJ=(e,t)=>e.records.find(n=>{var r;return n.cardTitle.test(t)&&!((r=n.excludeTitle)!=null&&r.test(t))}),IJ=(e,t)=>{const n=[];return t.forEach(({card:r,data:o,errorStatus:u},s)=>{var l;const i=SJ(e,r.title);if(!i)return;const c=!!r.externalResourceId;if(!(e.category==="pm"&&!c)){if(c&&u===mJ){const D=((l=e.recordWord)==null?void 0:l[0])??i.recordType.toLowerCase();n.push({id:`${r.id}:${r.externalResourceId}`,cardId:r.id,recordType:i.recordType,title:`Restricted ${D}`,fields:[],deepLink:null,externalResourceId:r.externalResourceId,linked:c,restricted:!0,spec:i,raw:{},order:s});return}bJ(o).forEach((D,d)=>{var g,A;const m=new Set,b=BJ(D,i.title);b.used.forEach(h=>m.add(h));const C=D.externalResourceId??r.externalResourceId;n.push({id:`${r.id}:${C??d}`,cardId:r.id,recordType:i.recordType,title:b.text||i.recordType,fields:vJ(D,i,m),deepLink:((g=b.field)==null?void 0:g.deepLink)??((A=D.fields.find(h=>h.deepLink))==null?void 0:A.deepLink)??null,externalResourceId:C,linked:c,spec:i,raw:wJ(D,i),order:s})})}}),n},kJ=e=>{const t=new Set;return[...e].sort((n,r)=>Number(r.linked)-Number(n.linked)).filter(n=>{if(!n.externalResourceId)return!0;const r=`${n.recordType}:${n.externalResourceId}`;return t.has(r)?!1:(t.add(r),!0)}).sort((n,r)=>n.order-r.order)},TJ=/closed/i,LJ=/closed/i,OJ=/^(billed|fully billed|closed|cancell?ed)$/i,Pu=e=>{const t=Mn(e.raw.Stage??e.raw.Status);switch(e.recordType){case"Opportunity":case"Deal":return!TJ.test(t);case"Case":return!LJ.test(t);case"Sales order":case"Purchase order":return!OJ.test(t.trim());default:return!0}},Ni=e=>{const t=new Date(Mn(e)).getTime();return Number.isNaN(t)?null:t},Vt=(e,...t)=>e.filter(n=>t.includes(n.recordType)),MJ=(e,t)=>{switch(e.category){case"ecommerce":{const n=Vt(t,"Customer").slice(0,1),r=[...Vt(t,"Order")].sort((o,u)=>(Ni(u.raw["Order date"])??0)-(Ni(o.raw["Order date"])??0)).slice(0,1);return[...n,...r]}case"crm":{const n=Vt(t,"Contact").slice(0,1),r=Vt(t,"Opportunity","Deal").filter(Pu).sort((u,s)=>(Ni(u.raw.__close)??1/0)-(Ni(s.raw.__close)??1/0)).slice(0,1),o=Vt(t,"Case").filter(Pu).slice(0,1);return[...n,...r,...o]}case"finance":{const n=Vt(t,"Customer").slice(0,1),r=Vt(t,"Vendor").slice(0,1),o=Vt(t,n.length?"Sales order":"Purchase order").filter(Pu).slice(0,1);return[...n,...r,...o]}default:return[]}},_J=(e,t)=>e.category==="ecommerce"?[...Vt(t,"Order"),...t.filter(n=>n.recordType!=="Order")]:t,Zo=(e,[t,n])=>`${e} ${e===1?t:n}`,jJ=(e,t,n)=>{var r;switch(e.category){case"ecommerce":{const o=Vt(t,"Customer")[0],u=o?zo(o.raw.Orders):null;if(o&&u!==null)return Zo(u,["order","orders"]);const s=Vt(t,"Order").filter(i=>i.linked).length;return s?Zo(s,["linked order","linked orders"]):""}case"crm":{const o=Vt(t,"Opportunity","Deal").filter(Pu).length;if(o)return Zo(o,e.dealWord??["open deal","open deals"]);if(e.id==="salesforce"){const i=Vt(t,"Case").filter(Pu).length;if(i)return Zo(i,["open case","open cases"])}const u=Vt(t,"Contact")[0],s=Mn((u==null?void 0:u.raw.Account)??(u==null?void 0:u.raw.Company))||Mn((r=Vt(t,"Account","Company")[0])==null?void 0:r.raw.__title);return s||(!u&&n?Zo(n,["linked","linked"]):"")}case"finance":{const o=Vt(t,"Customer")[0];if(o){const s=Mn(o.raw.__currency)||void 0,i=zo(o.raw.Overdue);if(i&&i>0)return`${Xo(i,s)} overdue`;const c=zo(o.raw.Balance);if(c&&c>0)return`${Xo(c,s)} balance`;const l=Vt(t,"Sales order").filter(Pu).length;return l?Zo(l,["open order","open orders"]):`${Xo(0,s)} balance`}const u=Vt(t,"Vendor")[0];if(u){const s=Mn(u.raw.__currency)||void 0,i=zo(u.raw.Balance);if(i&&i>0)return`${Xo(i,s)} payable`;const c=zo(u.raw["Unbilled orders"]);return c&&c>0?`${Xo(c,s)} unbilled`:`${Xo(0,s)} payable`}return""}case"pm":return n?Zo(n,e.recordWord??["record","records"]):"";default:return""}},NJ=e=>e.some(({data:t,errorStatus:n})=>n===EJ||!!(t!=null&&t.redirectToAdminTab)),PJ=2,G6=(e,t)=>{const n=kJ(IJ(e,t)),r=n.filter(c=>c.linked),o=n.filter(c=>!c.linked),u=[..._J(e,r),...MJ(e,o)],s=o.filter(c=>!(e.category==="crm"&&["Account","Company"].includes(c.recordType))),i=r.length+s.length;return{category:e.category,summary:jJ(e,n,r.length),records:u.slice(0,PJ).map(QJ),total:i,connection:NJ(t)?"expired":"ok"}},QJ=e=>({id:e.id,cardId:e.cardId,recordType:e.recordType,title:e.title,fields:e.fields,deepLink:e.deepLink,externalResourceId:e.externalResourceId,linked:e.linked,restricted:e.restricted}),V6=async(e,{connectorId:t,conversationId:n,inboxIds:r})=>{var s;const o=await Up({inboxIds:r,conversationId:n,connectorId:t}),u=(s=o==null?void 0:o.data)==null?void 0:s.cards;return Array.isArray(u)?u.filter(i=>i.connectorId===t).filter(i=>e.category!=="pm"||!!i.externalResourceId):[]},z6=async(e,{conversationId:t,contactEmail:n,inboxIds:r},o=!1)=>{var u;try{const s=await Kp(e.id,n,t,e.externalResourceId,void 0,r,void 0,o);return{card:e,data:(s==null?void 0:s.data)??null}}catch(s){return{card:e,data:null,errorStatus:(u=s==null?void 0:s.response)==null?void 0:u.status}}},RJ=async(e,{refresh:t=!1}={})=>{const n=zl(e.connectorName);if(!n||!e.conversationId)return null;const r=await V6(n,e),o=await Promise.all(r.map(u=>z6(u,e,t)));return G6(n,o)},HJ=5e3,X6=new Map,Z6=(e,t)=>["appWidget",e,t],J6=({connectorId:e,connectorName:t,conversationId:n,contactEmail:r,inboxIds:o,enabled:u=!0})=>{const s=zl(t),i=u&&!!s&&!!n,c=vt(),l=`${e}:${n}`,D=[...Z6(e,n),o.join(",")],d={connectorId:e,connectorName:t,conversationId:n,contactEmail:r,inboxIds:o},m=Ct({queryKey:[...D,"cards"],enabled:i,queryFn:()=>s?V6(s,d):Promise.resolve([])}),b=p.useMemo(()=>m.data??[],[m.data]),C=o0({queries:b.map(F=>({queryKey:[...D,"card",F.id,F.externalResourceId??"",r],enabled:i,retry:!1,queryFn:()=>z6(F,d,Date.now()<(X6.get(l)??0))}))}),g=C.some(F=>F.isLoading),A=C.map(F=>F.data),h=p.useMemo(()=>!s||m.isLoading||g?null:G6(s,A.filter(F=>!!F)),[s,m.isLoading,g,...A]),E=p.useCallback(()=>{X6.set(l,Date.now()+HJ),c.invalidateQueries({queryKey:Z6(e,n)})},[c,l,e,n]);return{app:s,model:h,isLoading:i&&(m.isLoading||g),refresh:E}},Y6=(e,t)=>{const[n,r]=p.useState(!1);return p.useEffect(()=>{if(!e){r(!1);return}const o=setTimeout(()=>r(!0),t);return()=>clearTimeout(o)},[e,t]),n},Pi=(e,t,n,r={})=>{var o;return(o=e.sendTrackingEvent)==null?void 0:o.call(e,n,{app_name:e.connectorName,category:t==null?void 0:t.category,...e.trackingContext,...r})},WJ=e=>{const{app:t,model:n,isLoading:r}=J6(e),{tokens:o}=zf(),u=Y6(r,P6),s=(n==null?void 0:n.connection)==="expired",i=N6(n,!!e.isAdmin),{onSummaryChange:c}=e;p.useEffect(()=>{c==null||c({text:i,isLoading:r,disconnected:s})},[c,i,r,s]);const l=p.useRef(Date.now()),D=p.useRef(!1);return p.useEffect(()=>{D.current||r||!n||(D.current=!0,Pi(e,t,xr.RENDERED,{load_ms:Date.now()-l.current,state:s?"disconnected":n.total===0?"empty":"records"}))},[r,n]),t?r?u?a.jsx(f.Skeleton,{"data-testid":"app-widget-summary-loading",variant:"rounded",width:56,height:16}):null:i?a.jsx(f.Typography,{"data-testid":"app-widget-summary",variant:"body2",noWrap:!0,sx:{color:s?o.negative:o.textSecondary,fontSize:12,lineHeight:"16px"},children:i}):null:null},GJ=e=>{const{app:t,model:n,isLoading:r,refresh:o}=J6(e),{tokens:u}=zf(),s=Y6(r,P6);if(!t)return null;const i=(c,l,D)=>{l&&Pi(e,t,l,D),e.onAction(c)};return r?s?a.jsx(JJ,{}):null:n?n.connection==="expired"?a.jsx(YJ,{app:t,appName:e.connectorName,isAdmin:!!e.isAdmin,adminNotified:!!e.adminNotified,tokens:u,onReconnect:()=>i({type:"reconnect"},xr.AUTH_ACTION,{action:"reconnect"}),onNotifyAdmin:()=>i({type:"notify_admin"},xr.AUTH_ACTION,{action:"notify_admin"})}):a.jsxs(f.Stack,{"data-testid":"app-widget-body",spacing:1,sx:{pb:1},children:[a.jsx(zJ,{lookupKey:t.category==="pm"?"":e.contactEmail,tokens:u,onRefresh:()=>{Pi(e,t,xr.REFRESHED),o()}}),n.records.length===0?a.jsx(f.Typography,{variant:"body2",sx:{color:u.textSecondary,fontSize:13},children:nJ(t)}):n.records.map(c=>a.jsx(XJ,{record:c,tokens:u,onOpen:()=>i({type:"open_record",record:c},xr.CARD_CLICKED,{target:"card",record_type:c.recordType}),onOpenInApp:()=>{Pi(e,t,xr.CARD_CLICKED,{target:"open_in_app",record_type:c.recordType}),c.deepLink&&window.open(c.deepLink,"_blank","noopener,noreferrer")}},c.id)),n.total>n.records.length&&a.jsx(f.Button,{variant:"text",size:"small",sx:{alignSelf:"flex-start",px:0,minWidth:0,color:u.accent},onClick:()=>i({type:"view_all"},xr.VIEW_ALL_CLICKED,{total:n.total}),children:fJ(n.total)}),a.jsx(ZJ,{app:t,tokens:u,onCreate:()=>i({type:"create"},xr.CTA_CLICKED,{cta:"create"}),onSearchLink:()=>i({type:"search_link",prefill:{email:e.contactEmail}},xr.CTA_CLICKED,{cta:"search_link"})})]}):null},VJ=()=>a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":!0,children:[a.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 1-1.6-3.9",strokeLinecap:"round"}),a.jsx("path",{d:"M13.5 2.5v3h-3",strokeLinecap:"round",strokeLinejoin:"round"})]}),zJ=({lookupKey:e,tokens:t,onRefresh:n})=>a.jsxs(f.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[a.jsx(f.Typography,{variant:"caption",noWrap:!0,title:e,sx:{color:t.textTertiary,minWidth:0},children:e?cJ(e):""}),a.jsx(f.Tooltip,{title:"Refresh",children:a.jsx(f.Box,{component:"button",type:"button","aria-label":"Refresh",onClick:n,sx:{display:"flex",border:"none",background:"none",p:.5,cursor:"pointer",color:t.iconSecondary,borderRadius:1,"&:hover":{background:t.surfaceHover}},children:a.jsx(VJ,{})})})]}),XJ=({record:e,tokens:t,onOpen:n,onOpenInApp:r})=>a.jsx(f.Box,{"data-testid":"app-widget-card",role:"button",tabIndex:0,onClick:n,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n())},sx:{border:`1px solid ${t.border}`,borderRadius:1,p:1.25,cursor:"pointer",background:t.surface,"&:hover":{background:t.surfaceHover}},children:a.jsxs(f.Stack,{direction:"row",alignItems:"flex-start",spacing:1,children:[a.jsxs(f.Box,{sx:{minWidth:0,flex:1},children:[a.jsx(f.Typography,{variant:"caption",sx:{color:t.textTertiary,display:"block"},children:e.recordType}),a.jsx(f.Tooltip,{title:e.title,placement:"top-start",children:a.jsx(f.Typography,{variant:"body2",noWrap:!0,sx:{color:t.textPrimary,fontWeight:500},children:e.title})}),e.fields.map(o=>a.jsxs(f.Stack,{direction:"row",spacing:.5,sx:{minWidth:0},children:[a.jsxs(f.Typography,{variant:"caption",sx:{color:t.textTertiary,flexShrink:0},children:[o.label,":"]}),a.jsx(f.Typography,{variant:"caption",noWrap:!0,title:o.value,sx:{color:o.tone==="critical"?t.negative:t.textSecondary},children:o.value})]},o.label))]}),e.deepLink&&a.jsx(f.Tooltip,{title:"Open in app",children:a.jsx(f.Box,{component:"button",type:"button","aria-label":"Open in app",onClick:o=>{o.stopPropagation(),r()},sx:{display:"flex",border:"none",background:"none",p:0,cursor:"pointer",color:t.iconSecondary},children:a.jsx(f.icons.OpenInNew,{sx:{fontSize:16}})})})]})}),ZJ=({app:e,tokens:t,onCreate:n,onSearchLink:r})=>a.jsxs(f.Stack,{direction:"row",spacing:1,children:[e.createLabel&&a.jsx(f.Button,{variant:"contained",size:"small",fullWidth:!0,sx:{background:t.primaryAction,color:t.onAccent,"&:hover":{background:t.primaryActionHover}},onClick:n,children:e.createLabel}),a.jsx(f.Button,{variant:"outlined",size:"small",fullWidth:!0,sx:{borderColor:t.borderStrong,color:t.textPrimary},onClick:r,children:iJ})]}),JJ=()=>a.jsxs(f.Stack,{"data-testid":"app-widget-loading",spacing:1,sx:{pb:1},children:[a.jsx(f.Skeleton,{variant:"rounded",height:64}),a.jsx(f.Skeleton,{variant:"rounded",height:64})]}),YJ=({app:e,appName:t,isAdmin:n,adminNotified:r,tokens:o,onReconnect:u,onNotifyAdmin:s})=>a.jsxs(f.Stack,{"data-testid":"app-widget-disconnected",spacing:1,sx:{pb:1},children:[a.jsx(f.Typography,{variant:"body2",sx:{color:o.textSecondary,fontSize:13},children:rJ(e,t,n)}),n?a.jsx(f.Button,{variant:"contained",size:"small",onClick:u,children:oJ(t)}):a.jsx(f.Button,{variant:"outlined",size:"small",disabled:r,onClick:s,children:r?aJ:uJ})]}),qJ=({theme:e,...t})=>a.jsx(Mr,{config:e,children:a.jsx(_6,{children:a.jsx(WJ,{...t})})}),UJ=({theme:e,...t})=>a.jsx(Mr,{config:e,children:a.jsx(_6,{children:a.jsx(GJ,{...t})})});ge.APP_WIDGET_EVENTS=xr,ge.ActionQueue=vH,ge.AppWidgetBody=UJ,ge.AppWidgetSummary=qJ,ge.CONNECTORS_AGENT_EVENTS=OR,ge.ConnectorCardList=LR,ge.EmailLogger=jG,ge.GmailLogObserver=_G,ge.HigSlackConnectModalIsland=y6,ge.HigSlackSection=_Z,ge.HigSlackSectionBody=jZ,ge.HigSlackTab=hZ,ge.HiverConnectorBifrostAuth=Ee,ge.IntegrationSense=bH,ge.OmniEmailLogger=gV,ge.OmniSlackTab=dZ,ge.SLACK_LINKS_API=sg,ge.SlackConnectModalIsland=y6,ge.SlackLinkActionsIsland=pZ,ge.SplitAppsNudge=eJ,ge.addNewConnectors=hh,ge.appWidgetSummaryText=N6,ge.connectorThemeDefaults=Vf,ge.createAppStore=VZ,ge.dismissNotification=rd,ge.fetchAppCfValues=QZ,ge.fetchDeferredAppCfValues=RZ,ge.getAppWidgetSpec=zl,ge.getConnectorsBifrostConfigs=an,ge.getMetaData=lI,ge.initConnectorsBifrost=sm,ge.loadAppWidgetModel=RJ,ge.resolveConnectorThemeTokens=F1,ge.setCaptureFeedbackOnDemand=Fh,ge.shouldCaptureFeedback=A0,ge.shouldShowNotification=nd,ge.useConnectorSelectedEmail=lR,ge.useSlackLinksSummary=PZ,ge.useSlackTabLabel=NZ,Object.defineProperty(ge,Symbol.toStringTag,{value:"Module"})});
|
|
5875
|
+
`,UZ=({children:e,zIndex:t,onClose:n})=>{const r=a.jsxs(ZZ,{children:[a.jsx(JZ,{variant:"h2",color:"text.primary",children:"Split apps view"}),a.jsx(YZ,{variant:"body2",color:"text.secondary",children:"Each connected app now has its own tab, making it easier to view app-specific data"}),a.jsx(qZ,{variant:"contained",color:"primary",onClick:n,children:"Dismiss"})]});return a.jsx(XZ,{open:!0,title:r,placement:"left-start",disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,slotProps:{popper:{sx:{zIndex:t+1},modifiers:[{name:"flip",enabled:!0},{name:"preventOverflow",enabled:!0}]},tooltip:{sx:{pointerEvents:"auto",maxWidth:"min(360px, calc(60vw - 24px))",padding:"12px"},onClick:o=>o.stopPropagation()},arrow:{sx:{fontSize:`${f.theme.typography.caption.fontSize}px`}}},children:e})},M6=ja("LOCAL"),KZ="connector-library-split-apps-nudge",$Z=({open:e,targetRef:t,endElRef:n,zIndex:r,storageKey:o=KZ,onClose:u})=>{const[s,i]=p.useState(()=>M6.getItem(o)==="true"),c=()=>{M6.setItem(o,"true"),i(!0),u()},l=D=>a.jsx(UZ,{zIndex:r,onClose:c,children:D});return s?null:a.jsx(mL,{open:e,targetRef:t,endElRef:n,padding:8,zIndex:r,renderHighlight:l})},eJ=({theme:e,...t})=>a.jsx(zZ,{theme:e,children:a.jsx($Z,{...t})}),tJ=sl(),_6=({children:e})=>a.jsx(n0,{client:tJ,children:e}),nJ=e=>{var t;switch(e.category){case"ecommerce":return"No customer found for this email. Search by email or order ID to link one.";case"crm":return"No contact found for this email.";case"finance":return"No customer or vendor found for this email.";case"pm":return`No ${((t=e.recordWord)==null?void 0:t[1])??"tasks"} linked to this conversation.`;default:return"Nothing found for this email."}},j6=e=>{var t;return e.category==="ecommerce"?"orders":e.category==="pm"?((t=e.recordWord)==null?void 0:t[1])??"tasks":"records"},rJ=(e,t,n)=>n?`${t} is disconnected. Reconnect to see this customer's ${j6(e)} and keep linked records in sync.`:`${t} is disconnected. Only an admin can reconnect it. ${lJ(j6(e))} will show here again once it's back.`,oJ=e=>`Reconnect ${e}`,uJ="Notify admin",aJ="Admin notified",sJ=e=>e?"Reconnect":"Unavailable",fJ=e=>`View all (${e>99?"99+":e})`,iJ="Search & link",cJ=e=>`Showing records for ${e}`,lJ=e=>e.charAt(0).toUpperCase()+e.slice(1),N6=(e,t)=>e?e.connection==="expired"?sJ(t):e.summary:"",xr={RENDERED:"app_widget_rendered",CARD_CLICKED:"app_widget_card_clicked",VIEW_ALL_CLICKED:"app_widget_view_all_clicked",CTA_CLICKED:"app_widget_cta_clicked",REFRESHED:"app_widget_refreshed",AUTH_ACTION:"app_widget_auth_action"},P6=300,Q6={label:"Order",keys:["order_number","name","number","id","tranid"]},DJ={id:"shopify",namePattern:/shopify/i,category:"ecommerce",records:[{recordType:"Customer",cardTitle:/customer/i,title:{label:"Customer",keys:["customer_name","display_name","name"],join:["first_name","last_name"]},fields:[{label:"Orders",keys:["total_orders","orders_count","number_of_orders"],labelPattern:/orders/i},{label:"Amount spent",keys:["total_spent","amount_spent"],labelPattern:/spent/i,format:"money"}]},{recordType:"Order",cardTitle:/order/i,excludeTitle:/line item/i,title:Q6,fields:[{label:"Fulfillment",keys:["fulfillment_status","display_fulfillment_status"],labelPattern:/fulfil/i},{label:"Order date",keys:["created_at","order_date"],labelPattern:/created|date/i,format:"date"}]}]},dJ={id:"woocommerce",namePattern:/woo/i,category:"ecommerce",records:[{recordType:"Customer",cardTitle:/customer/i,title:{label:"Customer",keys:["name","customer_name"],join:["first_name","last_name"]},fields:[{label:"Orders",keys:["orders_count","total_orders"],labelPattern:/orders/i},{label:"Customer since",keys:["date_created","created_at"],labelPattern:/created|since/i,format:"date"}]},{recordType:"Order",cardTitle:/order/i,title:Q6,fields:[{label:"Status",keys:["status","order_status"],labelPattern:/status/i},{label:"Order date",keys:["date_created","created_at"],labelPattern:/created|date/i,format:"date"}]}]},_i={label:"Owner",keys:["owner_name","owner","deal_owner_name","hubspot_owner_id"],labelPattern:/owner/i},AJ={id:"salesforce",namePattern:/salesforce/i,category:"crm",dealWord:["open opp","open opps"],createLabel:"Create",records:[{recordType:"Contact",cardTitle:/contact/i,title:{label:"Contact",keys:["name","contact_name"],join:["first_name","last_name"]},fields:[{label:"Account",keys:["account_name","account"],labelPattern:/^account( name)?$/i},_i]},{recordType:"Opportunity",cardTitle:/opportunit/i,title:{label:"Opportunity",keys:["opportunity_name","name"]},fields:[{label:"Stage",keys:["stage_name","stage"],labelPattern:/stage/i},{label:"Amount",keys:["amount"],labelPattern:/amount/i,format:"money"}]},{recordType:"Case",cardTitle:/case/i,excludeTitle:/automation/i,title:{label:"Case",keys:["subject","case_number"]},fields:[{label:"Status",keys:["status"],labelPattern:/status/i},{label:"Priority",keys:["priority"],labelPattern:/priority/i}]},{recordType:"Account",cardTitle:/account/i,title:{label:"Account",keys:["name","account_name"]},fields:[_i,{label:"Type",keys:["type","account_type"],labelPattern:/^type$/i}]}]},pJ={id:"hubspot",namePattern:/hubspot/i,category:"crm",dealWord:["open deal","open deals"],records:[{recordType:"Contact",cardTitle:/contact/i,title:{label:"Contact",keys:["name"],join:["first_name","last_name"]},fields:[{label:"Company",keys:["company","company_name"],labelPattern:/^company( name)?$/i},_i]},{recordType:"Deal",cardTitle:/deal/i,title:{label:"Deal",keys:["deal_name","dealname","name"]},fields:[{label:"Stage",keys:["deal_stage","dealstage"],labelPattern:/stage/i},{label:"Amount",keys:["amount"],labelPattern:/amount/i,format:"money"}]},{recordType:"Company",cardTitle:/compan/i,title:{label:"Company",keys:["name","company_name"]},fields:[_i,{label:"Lifecycle stage",keys:["lifecycle_stage","lifecyclestage"],labelPattern:/lifecycle/i}]}]},gJ={id:"netsuite",namePattern:/netsuite/i,category:"finance",records:[{recordType:"Customer",cardTitle:/customer/i,title:{label:"Customer",keys:["company_name","customer_name","name"]},fields:[{label:"Overdue",keys:["overdue_balance","overdueBalance","overdue_amount"],labelPattern:/overdue/i,format:"money"},{label:"Balance",keys:["balance"],labelPattern:/^balance$/i,format:"money"}]},{recordType:"Vendor",cardTitle:/vendor/i,title:{label:"Vendor",keys:["company_name","legal_name","name"]},fields:[{label:"Balance",keys:["balance_primary","balance"],labelPattern:/balance/i,format:"money"},{label:"Unbilled orders",keys:["unbilled_orders_primary","unbilled_orders"],labelPattern:/unbilled/i,format:"money"}]},{recordType:"Sales order",cardTitle:/sales order/i,title:{label:"Sales order",keys:["tranid","tran_id","order_number"]},fields:[{label:"Status",keys:["status"],labelPattern:/status/i},{label:"Total",keys:["total"],labelPattern:/^total$/i,format:"money"}]},{recordType:"Purchase order",cardTitle:/pu?rc?hase order/i,title:{label:"PO",keys:["tranid","tran_id","po_number"]},fields:[{label:"Status",keys:["status"],labelPattern:/status/i},{label:"Total",keys:["total"],labelPattern:/^total$/i,format:"money"}]}]},rs=(e,t,n)=>({recordType:e,cardTitle:/./,title:n??{label:e,keys:["title","name","summary"]},fields:t}),R6={label:"Status",keys:["status","status_name"],labelPattern:/status/i},os={label:"Assignee",keys:["assignee","assignees","members","person"],labelPattern:/assign|member|person/i},CJ=[{id:"jira",namePattern:/jira/i,category:"pm",recordWord:["issue","issues"],createLabel:"Create issue",records:[rs("Issue",[R6,os],{label:"Issue",keys:["title","summary"],join:["issue_id","title"]})]},{id:"clickup",namePattern:/clickup/i,category:"pm",recordWord:["task","tasks"],createLabel:"Create task",records:[rs("Task",[R6,os])]},{id:"asana",namePattern:/asana/i,category:"pm",recordWord:["task","tasks"],createLabel:"Create task",records:[rs("Task",[{label:"Status",keys:["section","completed","status"],labelPattern:/section|completed|status/i},os])]},{id:"monday",namePattern:/monday/i,category:"pm",recordWord:["item","items"],createLabel:"Create item",records:[rs("Item",[{label:"Status",keys:["status","group"],labelPattern:/status|group/i},os])]},{id:"trello",namePattern:/trello/i,category:"pm",recordWord:["card","cards"],createLabel:"Create card",records:[rs("Card",[{label:"List",keys:["list","list_name"],labelPattern:/list/i},os])]}],hJ=[DJ,dJ,AJ,pJ,gJ,...CJ],zl=e=>e?hJ.find(t=>t.namePattern.test(e))??null:null,FJ=404,mJ=403,EJ=401,Xl=e=>e==null||e===""||Array.isArray(e)&&e.length===0,H6=(e,t)=>e.priority-t.priority,bJ=e=>{var r;if(!(e!=null&&e.data))return[];if(e.cardErrorMessage||Vp(e))return[];if(e.cardType==="flat_with_list")return(((r=e.data.listItems)==null?void 0:r.fields)??[]).map(o=>({fields:[...(Array.isArray(o)?o:o.data)??[]].sort(H6),externalResourceId:Array.isArray(o)?void 0:o.externalResourceId}));const t=e.data.flatDisplay,n=(Array.isArray(t)?t:(t==null?void 0:t.data)??[]).filter(o=>Number(o.statusCode)!==FJ&&!(Number(o.statusCode)>=400&&Xl(o.value)));return n.length===0?[]:[{fields:[...n].sort(H6),externalResourceId:Array.isArray(t)||t==null?void 0:t.externalResourceId}]},Mn=(e,t)=>Xl(e)?"":typeof e=="boolean"?t==="completed"?e?"Completed":"Not completed":e?"Yes":"No":Array.isArray(e)?e.map(n=>typeof n=="object"&&n!==null?n.filename??"":String(n)).filter(Boolean).join(", "):String(e),zo=e=>{if(Xl(e)||Array.isArray(e)||typeof e=="boolean")return null;const t=typeof e=="number"?e:Number(String(e).replace(/[^0-9.-]/g,""));return Number.isFinite(t)?t:null},W6=e=>{var n;const t=(n=e.fields.find(r=>r.key==="currency"))==null?void 0:n.value;return typeof t=="string"&&/^[A-Z]{3}$/.test(t)?t:void 0},Xo=(e,t)=>{const n={notation:"compact",maximumFractionDigits:1};try{return new Intl.NumberFormat("en-US",t?{...n,style:"currency",currency:t}:n).format(e)}catch{return new Intl.NumberFormat("en-US",n).format(e)}},xJ=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(t)},ji=(e,t)=>t.keys.map(n=>e.fields.find(r=>r.key===n)).find(Boolean)??(t.labelPattern?e.fields.find(n=>{var r;return(r=t.labelPattern)==null?void 0:r.test(n.label)}):void 0),yJ=(e,t,n)=>{if(t.format==="money"){const o=zo(e.value);return o===null?Mn(e.value,e.key):Xo(o,W6(n))}const r=Mn(e.value,e.key);return t.format==="date"&&r?xJ(r):r},BJ=(e,t)=>{if(t.join){const o=t.join.map(s=>e.fields.find(i=>i.key===s)),u=o.map(s=>Mn(s==null?void 0:s.value,s==null?void 0:s.key)).filter(Boolean).join(" ");if(u&&o.every(Boolean))return{text:u,field:o.find(s=>s==null?void 0:s.deepLink),used:t.join}}const n=ji(e,t),r=n?Mn(n.value,n.key):"";if(r&&n)return{text:r,field:n,used:[n.key]};if(t.join){const o=t.join.map(s=>e.fields.find(i=>i.key===s)).filter(Boolean),u=o.map(s=>Mn(s.value,s.key)).filter(Boolean).join(" ");if(u)return{text:u,field:o[0],used:o.map(s=>s.key)}}return{text:"",used:[]}},vJ=(e,t,n)=>t.fields.map(r=>{const o=ji(e,r);if(o){n.add(o.key);const s=yJ(o,r,e);if(!s&&r.label==="Account")return{label:r.label,value:"No account"};const i=r.label==="Overdue"&&(zo(o.value)??0)>0;return{label:r.label,value:s||"—",...i?{tone:"critical"}:{}}}const u=e.fields.find(s=>!n.has(s.key)&&s.type!=="attachment"&&s.key!=="currency"&&Mn(s.value,s.key));return u?(n.add(u.key),{label:u.label,value:Mn(u.value,u.key)}):null}).filter(r=>r!==null),wJ=(e,t)=>{var r,o;const n={};return t.fields.forEach(u=>{var s;n[u.label]=(s=ji(e,u))==null?void 0:s.value}),n.__title=(r=ji(e,t.title))==null?void 0:r.value,n.__close=(o=e.fields.find(u=>/close_?date/i.test(u.key)))==null?void 0:o.value,n.__currency=W6(e),n},SJ=(e,t)=>e.records.find(n=>{var r;return n.cardTitle.test(t)&&!((r=n.excludeTitle)!=null&&r.test(t))}),IJ=(e,t)=>{const n=[];return t.forEach(({card:r,data:o,errorStatus:u},s)=>{var l;const i=SJ(e,r.title);if(!i)return;const c=!!r.externalResourceId;if(!(e.category==="pm"&&!c)){if(c&&u===mJ){const D=((l=e.recordWord)==null?void 0:l[0])??i.recordType.toLowerCase();n.push({id:`${r.id}:${r.externalResourceId}`,cardId:r.id,recordType:i.recordType,title:`Restricted ${D}`,fields:[],deepLink:null,externalResourceId:r.externalResourceId,linked:c,restricted:!0,spec:i,raw:{},order:s});return}bJ(o).forEach((D,d)=>{var g,A;const m=new Set,b=BJ(D,i.title);b.used.forEach(h=>m.add(h));const C=D.externalResourceId??r.externalResourceId;n.push({id:`${r.id}:${C??d}`,cardId:r.id,recordType:i.recordType,title:b.text||i.recordType,fields:vJ(D,i,m),deepLink:((g=b.field)==null?void 0:g.deepLink)??((A=D.fields.find(h=>h.deepLink))==null?void 0:A.deepLink)??null,externalResourceId:C,linked:c,spec:i,raw:wJ(D,i),order:s})})}}),n},kJ=e=>{const t=new Set;return[...e].sort((n,r)=>Number(r.linked)-Number(n.linked)).filter(n=>{if(!n.externalResourceId)return!0;const r=`${n.recordType}:${n.externalResourceId}`;return t.has(r)?!1:(t.add(r),!0)}).sort((n,r)=>n.order-r.order)},TJ=/closed/i,LJ=/closed/i,OJ=/^(billed|fully billed|closed|cancell?ed)$/i,Pu=e=>{const t=Mn(e.raw.Stage??e.raw.Status);switch(e.recordType){case"Opportunity":case"Deal":return!TJ.test(t);case"Case":return!LJ.test(t);case"Sales order":case"Purchase order":return!OJ.test(t.trim());default:return!0}},Ni=e=>{const t=new Date(Mn(e)).getTime();return Number.isNaN(t)?null:t},Vt=(e,...t)=>e.filter(n=>t.includes(n.recordType)),MJ=(e,t)=>{switch(e.category){case"ecommerce":{const n=Vt(t,"Customer").slice(0,1),r=[...Vt(t,"Order")].sort((o,u)=>(Ni(u.raw["Order date"])??0)-(Ni(o.raw["Order date"])??0)).slice(0,1);return[...n,...r]}case"crm":{const n=Vt(t,"Contact").slice(0,1),r=Vt(t,"Opportunity","Deal").filter(Pu).sort((u,s)=>(Ni(u.raw.__close)??1/0)-(Ni(s.raw.__close)??1/0)).slice(0,1),o=Vt(t,"Case").filter(Pu).slice(0,1);return[...n,...r,...o]}case"finance":{const n=Vt(t,"Customer").slice(0,1),r=Vt(t,"Vendor").slice(0,1),o=Vt(t,n.length?"Sales order":"Purchase order").filter(Pu).slice(0,1);return[...n,...r,...o]}default:return[]}},_J=(e,t)=>e.category==="ecommerce"?[...Vt(t,"Order"),...t.filter(n=>n.recordType!=="Order")]:t,Zo=(e,[t,n])=>`${e} ${e===1?t:n}`,jJ=(e,t,n)=>{var r;switch(e.category){case"ecommerce":{const o=Vt(t,"Customer")[0],u=o?zo(o.raw.Orders):null;if(o&&u!==null)return Zo(u,["order","orders"]);const s=Vt(t,"Order").filter(i=>i.linked).length;return s?Zo(s,["linked order","linked orders"]):""}case"crm":{const o=Vt(t,"Opportunity","Deal").filter(Pu).length;if(o)return Zo(o,e.dealWord??["open deal","open deals"]);if(e.id==="salesforce"){const i=Vt(t,"Case").filter(Pu).length;if(i)return Zo(i,["open case","open cases"])}const u=Vt(t,"Contact")[0],s=Mn((u==null?void 0:u.raw.Account)??(u==null?void 0:u.raw.Company))||Mn((r=Vt(t,"Account","Company")[0])==null?void 0:r.raw.__title);return s||(!u&&n?Zo(n,["linked","linked"]):"")}case"finance":{const o=Vt(t,"Customer")[0];if(o){const s=Mn(o.raw.__currency)||void 0,i=zo(o.raw.Overdue);if(i&&i>0)return`${Xo(i,s)} overdue`;const c=zo(o.raw.Balance);if(c&&c>0)return`${Xo(c,s)} balance`;const l=Vt(t,"Sales order").filter(Pu).length;return l?Zo(l,["open order","open orders"]):`${Xo(0,s)} balance`}const u=Vt(t,"Vendor")[0];if(u){const s=Mn(u.raw.__currency)||void 0,i=zo(u.raw.Balance);if(i&&i>0)return`${Xo(i,s)} payable`;const c=zo(u.raw["Unbilled orders"]);return c&&c>0?`${Xo(c,s)} unbilled`:`${Xo(0,s)} payable`}return""}case"pm":return n?Zo(n,e.recordWord??["record","records"]):"";default:return""}},NJ=/^Your connection to .+ has expired\./,PJ=e=>e.some(({data:t,errorStatus:n})=>n===EJ||!!(t!=null&&t.redirectToAdminTab)||NJ.test((t==null?void 0:t.cardErrorMessage)??"")),QJ=2,G6=(e,t)=>{const n=kJ(IJ(e,t)),r=n.filter(c=>c.linked),o=n.filter(c=>!c.linked),u=[..._J(e,r),...MJ(e,o)],s=o.filter(c=>!(e.category==="crm"&&["Account","Company"].includes(c.recordType))),i=r.length+s.length;return{category:e.category,summary:jJ(e,n,r.length),records:u.slice(0,QJ).map(RJ),total:i,connection:PJ(t)?"expired":"ok"}},RJ=e=>({id:e.id,cardId:e.cardId,recordType:e.recordType,title:e.title,fields:e.fields,deepLink:e.deepLink,externalResourceId:e.externalResourceId,linked:e.linked,restricted:e.restricted}),V6=async(e,{connectorId:t,conversationId:n,inboxIds:r})=>{var s;const o=await Up({inboxIds:r,conversationId:n,connectorId:t}),u=(s=o==null?void 0:o.data)==null?void 0:s.cards;return Array.isArray(u)?u.filter(i=>i.connectorId===t).filter(i=>e.category!=="pm"||!!i.externalResourceId):[]},z6=async(e,{conversationId:t,contactEmail:n,inboxIds:r},o=!1)=>{var u;try{const s=await Kp(e.id,n,t,e.externalResourceId,void 0,r,void 0,o);return{card:e,data:(s==null?void 0:s.data)??null}}catch(s){return{card:e,data:null,errorStatus:(u=s==null?void 0:s.response)==null?void 0:u.status}}},HJ=async(e,{refresh:t=!1}={})=>{const n=zl(e.connectorName);if(!n||!e.conversationId)return null;const r=await V6(n,e),o=await Promise.all(r.map(u=>z6(u,e,t)));return G6(n,o)},WJ=5e3,X6=new Map,Z6=(e,t)=>["appWidget",e,t],J6=({connectorId:e,connectorName:t,conversationId:n,contactEmail:r,inboxIds:o,enabled:u=!0})=>{const s=zl(t),i=u&&!!s&&!!n,c=vt(),l=`${e}:${n}`,D=[...Z6(e,n),o.join(",")],d={connectorId:e,connectorName:t,conversationId:n,contactEmail:r,inboxIds:o},m=Ct({queryKey:[...D,"cards"],enabled:i,queryFn:()=>s?V6(s,d):Promise.resolve([])}),b=p.useMemo(()=>m.data??[],[m.data]),C=o0({queries:b.map(F=>({queryKey:[...D,"card",F.id,F.externalResourceId??"",r],enabled:i,retry:!1,queryFn:()=>z6(F,d,Date.now()<(X6.get(l)??0))}))}),g=C.some(F=>F.isLoading),A=C.map(F=>F.data),h=p.useMemo(()=>!s||m.isLoading||g?null:G6(s,A.filter(F=>!!F)),[s,m.isLoading,g,...A]),E=p.useCallback(()=>{X6.set(l,Date.now()+WJ),c.invalidateQueries({queryKey:Z6(e,n)})},[c,l,e,n]);return{app:s,model:h,isLoading:i&&(m.isLoading||g),refresh:E}},Y6=(e,t)=>{const[n,r]=p.useState(!1);return p.useEffect(()=>{if(!e){r(!1);return}const o=setTimeout(()=>r(!0),t);return()=>clearTimeout(o)},[e,t]),n},Pi=(e,t,n,r={})=>{var o;return(o=e.sendTrackingEvent)==null?void 0:o.call(e,n,{app_name:e.connectorName,category:t==null?void 0:t.category,...e.trackingContext,...r})},GJ=e=>{const{app:t,model:n,isLoading:r}=J6(e),{tokens:o}=zf(),u=Y6(r,P6),s=(n==null?void 0:n.connection)==="expired",i=N6(n,!!e.isAdmin),{onSummaryChange:c}=e;p.useEffect(()=>{c==null||c({text:i,isLoading:r,disconnected:s})},[c,i,r,s]);const l=p.useRef(Date.now()),D=p.useRef(!1);return p.useEffect(()=>{D.current||r||!n||(D.current=!0,Pi(e,t,xr.RENDERED,{load_ms:Date.now()-l.current,state:s?"disconnected":n.total===0?"empty":"records"}))},[r,n]),t?r?u?a.jsx(f.Skeleton,{"data-testid":"app-widget-summary-loading",variant:"rounded",width:56,height:16}):null:i?a.jsx(f.Typography,{"data-testid":"app-widget-summary",variant:"body2",noWrap:!0,sx:{color:s?o.negative:o.textSecondary,fontSize:12,lineHeight:"16px"},children:i}):null:null},VJ=e=>{const{app:t,model:n,isLoading:r,refresh:o}=J6(e),{tokens:u}=zf(),s=Y6(r,P6);if(!t)return null;const i=(c,l,D)=>{l&&Pi(e,t,l,D),e.onAction(c)};return r?s?a.jsx(YJ,{}):null:n?n.connection==="expired"?a.jsx(qJ,{app:t,appName:e.connectorName,isAdmin:!!e.isAdmin,adminNotified:!!e.adminNotified,tokens:u,onReconnect:()=>i({type:"reconnect"},xr.AUTH_ACTION,{action:"reconnect"}),onNotifyAdmin:()=>i({type:"notify_admin"},xr.AUTH_ACTION,{action:"notify_admin"})}):a.jsxs(f.Stack,{"data-testid":"app-widget-body",spacing:1,sx:{pb:1},children:[a.jsx(XJ,{lookupKey:t.category==="pm"?"":e.contactEmail,tokens:u,onRefresh:()=>{Pi(e,t,xr.REFRESHED),o()}}),n.records.length===0?a.jsx(f.Typography,{variant:"body2",sx:{color:u.textSecondary,fontSize:13},children:nJ(t)}):n.records.map(c=>a.jsx(ZJ,{record:c,tokens:u,onOpen:()=>i({type:"open_record",record:c},xr.CARD_CLICKED,{target:"card",record_type:c.recordType}),onOpenInApp:()=>{Pi(e,t,xr.CARD_CLICKED,{target:"open_in_app",record_type:c.recordType}),c.deepLink&&window.open(c.deepLink,"_blank","noopener,noreferrer")}},c.id)),n.total>n.records.length&&a.jsx(f.Button,{variant:"text",size:"small",sx:{alignSelf:"flex-start",px:0,minWidth:0,color:u.accent},onClick:()=>i({type:"view_all"},xr.VIEW_ALL_CLICKED,{total:n.total}),children:fJ(n.total)}),a.jsx(JJ,{app:t,tokens:u,onCreate:()=>i({type:"create"},xr.CTA_CLICKED,{cta:"create"}),onSearchLink:()=>i({type:"search_link",prefill:{email:e.contactEmail}},xr.CTA_CLICKED,{cta:"search_link"})})]}):null},zJ=()=>a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":!0,children:[a.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 1-1.6-3.9",strokeLinecap:"round"}),a.jsx("path",{d:"M13.5 2.5v3h-3",strokeLinecap:"round",strokeLinejoin:"round"})]}),XJ=({lookupKey:e,tokens:t,onRefresh:n})=>a.jsxs(f.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[a.jsx(f.Typography,{variant:"caption",noWrap:!0,title:e,sx:{color:t.textTertiary,minWidth:0},children:e?cJ(e):""}),a.jsx(f.Tooltip,{title:"Refresh",children:a.jsx(f.Box,{component:"button",type:"button","aria-label":"Refresh",onClick:n,sx:{display:"flex",border:"none",background:"none",p:.5,cursor:"pointer",color:t.iconSecondary,borderRadius:1,"&:hover":{background:t.surfaceHover}},children:a.jsx(zJ,{})})})]}),ZJ=({record:e,tokens:t,onOpen:n,onOpenInApp:r})=>a.jsx(f.Box,{"data-testid":"app-widget-card",role:"button",tabIndex:0,onClick:n,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n())},sx:{border:`1px solid ${t.border}`,borderRadius:1,p:1.25,cursor:"pointer",background:t.surface,"&:hover":{background:t.surfaceHover}},children:a.jsxs(f.Stack,{direction:"row",alignItems:"flex-start",spacing:1,children:[a.jsxs(f.Box,{sx:{minWidth:0,flex:1},children:[a.jsx(f.Typography,{variant:"caption",sx:{color:t.textTertiary,display:"block"},children:e.recordType}),a.jsx(f.Tooltip,{title:e.title,placement:"top-start",children:a.jsx(f.Typography,{variant:"body2",noWrap:!0,sx:{color:t.textPrimary,fontWeight:500},children:e.title})}),e.fields.map(o=>a.jsxs(f.Stack,{direction:"row",spacing:.5,sx:{minWidth:0},children:[a.jsxs(f.Typography,{variant:"caption",sx:{color:t.textTertiary,flexShrink:0},children:[o.label,":"]}),a.jsx(f.Typography,{variant:"caption",noWrap:!0,title:o.value,sx:{color:o.tone==="critical"?t.negative:t.textSecondary},children:o.value})]},o.label))]}),e.deepLink&&a.jsx(f.Tooltip,{title:"Open in app",children:a.jsx(f.Box,{component:"button",type:"button","aria-label":"Open in app",onClick:o=>{o.stopPropagation(),r()},sx:{display:"flex",border:"none",background:"none",p:0,cursor:"pointer",color:t.iconSecondary},children:a.jsx(f.icons.OpenInNew,{sx:{fontSize:16}})})})]})}),JJ=({app:e,tokens:t,onCreate:n,onSearchLink:r})=>a.jsxs(f.Stack,{direction:"row",spacing:1,children:[e.createLabel&&a.jsx(f.Button,{variant:"contained",size:"small",fullWidth:!0,sx:{background:t.primaryAction,color:t.onAccent,"&:hover":{background:t.primaryActionHover}},onClick:n,children:e.createLabel}),a.jsx(f.Button,{variant:"outlined",size:"small",fullWidth:!0,sx:{borderColor:t.borderStrong,color:t.textPrimary},onClick:r,children:iJ})]}),YJ=()=>a.jsxs(f.Stack,{"data-testid":"app-widget-loading",spacing:1,sx:{pb:1},children:[a.jsx(f.Skeleton,{variant:"rounded",height:64}),a.jsx(f.Skeleton,{variant:"rounded",height:64})]}),qJ=({app:e,appName:t,isAdmin:n,adminNotified:r,tokens:o,onReconnect:u,onNotifyAdmin:s})=>a.jsxs(f.Stack,{"data-testid":"app-widget-disconnected",spacing:1,sx:{pb:1},children:[a.jsx(f.Typography,{variant:"body2",sx:{color:o.textSecondary,fontSize:13},children:rJ(e,t,n)}),n?a.jsx(f.Button,{variant:"contained",size:"small",onClick:u,children:oJ(t)}):a.jsx(f.Button,{variant:"outlined",size:"small",disabled:r,onClick:s,children:r?aJ:uJ})]}),UJ=({theme:e,...t})=>a.jsx(Mr,{config:e,children:a.jsx(_6,{children:a.jsx(GJ,{...t})})}),KJ=({theme:e,...t})=>a.jsx(Mr,{config:e,children:a.jsx(_6,{children:a.jsx(VJ,{...t})})});ge.APP_WIDGET_EVENTS=xr,ge.ActionQueue=vH,ge.AppWidgetBody=KJ,ge.AppWidgetSummary=UJ,ge.CONNECTORS_AGENT_EVENTS=OR,ge.ConnectorCardList=LR,ge.EmailLogger=jG,ge.GmailLogObserver=_G,ge.HigSlackConnectModalIsland=y6,ge.HigSlackSection=_Z,ge.HigSlackSectionBody=jZ,ge.HigSlackTab=hZ,ge.HiverConnectorBifrostAuth=Ee,ge.IntegrationSense=bH,ge.OmniEmailLogger=gV,ge.OmniSlackTab=dZ,ge.SLACK_LINKS_API=sg,ge.SlackConnectModalIsland=y6,ge.SlackLinkActionsIsland=pZ,ge.SplitAppsNudge=eJ,ge.addNewConnectors=hh,ge.appWidgetSummaryText=N6,ge.connectorThemeDefaults=Vf,ge.createAppStore=VZ,ge.dismissNotification=rd,ge.fetchAppCfValues=QZ,ge.fetchDeferredAppCfValues=RZ,ge.getAppWidgetSpec=zl,ge.getConnectorsBifrostConfigs=an,ge.getMetaData=lI,ge.initConnectorsBifrost=sm,ge.loadAppWidgetModel=HJ,ge.resolveConnectorThemeTokens=F1,ge.setCaptureFeedbackOnDemand=Fh,ge.shouldCaptureFeedback=A0,ge.shouldShowNotification=nd,ge.useConnectorSelectedEmail=lR,ge.useSlackLinksSummary=PZ,ge.useSlackTabLabel=NZ,Object.defineProperty(ge,Symbol.toStringTag,{value:"Module"})});
|