@hiver/connector-agent 4.3.2-analytics-beta.9 → 4.3.2-analytics-beta.10

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/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(le,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react"),require("react-dom"),require("@hiver/hiver-ui-kit")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","@hiver/hiver-ui-kit"],_):(le=typeof globalThis<"u"?globalThis:le||self,_(le["@hiver/connector-agent"]={},le.React,le.ReactDOM,le.hiverUiKit))})(this,function(le,_,Ne,b){"use strict";var nI=Object.defineProperty;var t1=le=>{throw TypeError(le)};var rI=(le,_,Ne)=>_ in le?nI(le,_,{enumerable:!0,configurable:!0,writable:!0,value:Ne}):le[_]=Ne;var Nn=(le,_,Ne)=>rI(le,typeof _!="symbol"?_+"":_,Ne),Pc=(le,_,Ne)=>_.has(le)||t1("Cannot "+Ne);var O=(le,_,Ne)=>(Pc(le,_,"read from private field"),Ne?Ne.call(le):_.get(le)),se=(le,_,Ne)=>_.has(le)?t1("Cannot add the same private member more than once"):_ instanceof WeakSet?_.add(le):_.set(le,Ne),q=(le,_,Ne,b)=>(Pc(le,_,"write to private field"),b?b.call(le,Ne):_.set(le,Ne),Ne),he=(le,_,Ne)=>(Pc(le,_,"access private method"),Ne);var Ei=(le,_,Ne,b)=>({set _(wi){q(le,_,wi,Ne)},get _(){return O(le,_,b)}});var Un,In,Pr,Zp,Br,wn,jr,Xp,Kn,zp,Vr,Gr,Dt,er,ot,Fo,tr,Wt,hn,Yp,Ut,Jp,Kt,ct,nr,en,Rn,Qp,ln,Zt,ko,qp,je,An,_n,Hr,Wr,Tn,Zr,Xr,$p,mt,me,No,lt,rr,zr,Sn,tn,Ro,Yr,Jr,or,sr,Ln,Qr,_e,Ho,Bc,jc,Vc,Gc,Hc,Wc,Zc,n1,Up,On,Dn,bt,un,dn,Ii,Xc,Kp;function wi(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 N=wi(_);var fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ai={exports:{}},Ur={};/**
1
+ (function(le,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react"),require("react-dom"),require("@hiver/hiver-ui-kit")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","@hiver/hiver-ui-kit"],_):(le=typeof globalThis<"u"?globalThis:le||self,_(le["@hiver/connector-agent"]={},le.React,le.ReactDOM,le.hiverUiKit))})(this,function(le,_,Ne,b){"use strict";var nI=Object.defineProperty;var t1=le=>{throw TypeError(le)};var rI=(le,_,Ne)=>_ in le?nI(le,_,{enumerable:!0,configurable:!0,writable:!0,value:Ne}):le[_]=Ne;var hn=(le,_,Ne)=>rI(le,typeof _!="symbol"?_+"":_,Ne),Pc=(le,_,Ne)=>_.has(le)||t1("Cannot "+Ne);var O=(le,_,Ne)=>(Pc(le,_,"read from private field"),Ne?Ne.call(le):_.get(le)),se=(le,_,Ne)=>_.has(le)?t1("Cannot add the same private member more than once"):_ instanceof WeakSet?_.add(le):_.set(le,Ne),q=(le,_,Ne,b)=>(Pc(le,_,"write to private field"),b?b.call(le,Ne):_.set(le,Ne),Ne),he=(le,_,Ne)=>(Pc(le,_,"access private method"),Ne);var Ei=(le,_,Ne,b)=>({set _(wi){q(le,_,wi,Ne)},get _(){return O(le,_,b)}});var Un,wn,Pr,Zp,Br,An,jr,Xp,Kn,zp,Vr,Gr,Dt,er,ot,Fo,tr,Wt,gn,Yp,Ut,Jp,Kt,ct,nr,en,Rn,Qp,ln,Zt,ko,qp,je,_n,Tn,Hr,Wr,Sn,Zr,Xr,$p,mt,me,No,lt,rr,zr,Ln,tn,Ro,Yr,Jr,or,sr,On,Qr,_e,Ho,Bc,jc,Vc,Gc,Hc,Wc,Zc,n1,Up,Dn,Fn,bt,un,dn,Ii,Xc,Kp;function wi(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 N=wi(_);var fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ai={exports:{}},Ur={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -18,21 +18,21 @@
18
18
  `+ee+L}}var P=!1,te;{var ye=typeof WeakMap=="function"?WeakMap:Map;te=new ye}function Z(L,G){if(!L||P)return"";{var Q=te.get(L);if(Q!==void 0)return Q}var de;P=!0;var Le=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var De;De=$.current,$.current=null,V();try{if(G){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(xt){de=xt}Reflect.construct(L,[],Ce)}else{try{Ce.call()}catch(xt){de=xt}L.call(Ce.prototype)}}else{try{throw Error()}catch(xt){de=xt}L()}}catch(xt){if(xt&&de&&typeof xt.stack=="string"){for(var ge=xt.stack.split(`
19
19
  `),ut=de.stack.split(`
20
20
  `),Ge=ge.length-1,Xe=ut.length-1;Ge>=1&&Xe>=0&&ge[Ge]!==ut[Xe];)Xe--;for(;Ge>=1&&Xe>=0;Ge--,Xe--)if(ge[Ge]!==ut[Xe]){if(Ge!==1||Xe!==1)do if(Ge--,Xe--,Xe<0||ge[Ge]!==ut[Xe]){var Nt=`
21
- `+ge[Ge].replace(" at new "," at ");return L.displayName&&Nt.includes("<anonymous>")&&(Nt=Nt.replace("<anonymous>",L.displayName)),typeof L=="function"&&te.set(L,Nt),Nt}while(Ge>=1&&Xe>=0);break}}}finally{P=!1,$.current=De,X(),Error.prepareStackTrace=Le}var $r=L?L.displayName||L.name:"",dr=$r?re($r):"";return typeof L=="function"&&te.set(L,dr),dr}function Me(L,G,Q){return Z(L,!1)}function ke(L){var G=L.prototype;return!!(G&&G.isReactComponent)}function Je(L,G,Q){if(L==null)return"";if(typeof L=="function")return Z(L,ke(L));if(typeof L=="string")return re(L);switch(L){case c:return re("Suspense");case u:return re("SuspenseList")}if(typeof L=="object")switch(L.$$typeof){case l:return Me(L.render);case p:return Je(L.type,G,Q);case g:{var de=L,Le=de._payload,De=de._init;try{return Je(De(Le),G,Q)}catch{}}}return""}var Qe=Object.prototype.hasOwnProperty,fn={},yt=h.ReactDebugCurrentFrame;function st(L){if(L){var G=L._owner,Q=Je(L.type,L._source,G?G.type:null);yt.setExtraStackFrame(Q)}else yt.setExtraStackFrame(null)}function Ze(L,G,Q,de,Le){{var De=Function.call.bind(Qe);for(var Ce in L)if(De(L,Ce)){var ge=void 0;try{if(typeof L[Ce]!="function"){var ut=Error((de||"React class")+": "+Q+" type `"+Ce+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof L[Ce]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ut.name="Invariant Violation",ut}ge=L[Ce](G,Ce,de,Q,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ge){ge=Ge}ge&&!(ge instanceof Error)&&(st(Le),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",de||"React class",Q,Ce,typeof ge),st(null)),ge instanceof Error&&!(ge.message in fn)&&(fn[ge.message]=!0,st(Le),v("Failed %s type: %s",Q,ge.message),st(null))}}}var Fn=Array.isArray;function Ft(L){return Fn(L)}function qr(L){{var G=typeof Symbol=="function"&&Symbol.toStringTag,Q=G&&L[Symbol.toStringTag]||L.constructor.name||"Object";return Q}}function Mo(L){try{return ir(L),!1}catch{return!0}}function ir(L){return""+L}function ar(L){if(Mo(L))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",qr(L)),ir(L)}var ce=h.ReactCurrentOwner,Te={key:!0,ref:!0,__self:!0,__source:!0},et,Ct,vt;vt={};function kt(L){if(Qe.call(L,"ref")){var G=Object.getOwnPropertyDescriptor(L,"ref").get;if(G&&G.isReactWarning)return!1}return L.ref!==void 0}function pn(L){if(Qe.call(L,"key")){var G=Object.getOwnPropertyDescriptor(L,"key").get;if(G&&G.isReactWarning)return!1}return L.key!==void 0}function Po(L,G){if(typeof L.ref=="string"&&ce.current&&G&&ce.current.stateNode!==G){var Q=M(ce.current.type);vt[Q]||(v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',M(ce.current.type),L.ref),vt[Q]=!0)}}function mi(L,G){{var Q=function(){et||(et=!0,v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",G))};Q.isReactWarning=!0,Object.defineProperty(L,"key",{get:Q,configurable:!0})}}function Nc(L,G){{var Q=function(){Ct||(Ct=!0,v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",G))};Q.isReactWarning=!0,Object.defineProperty(L,"ref",{get:Q,configurable:!0})}}var bi=function(L,G,Q,de,Le,De,Ce){var ge={$$typeof:t,type:L,key:G,ref:Q,props:Ce,_owner:De};return ge._store={},Object.defineProperty(ge._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ge,"_self",{configurable:!1,enumerable:!1,writable:!1,value:de}),Object.defineProperty(ge,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Le}),Object.freeze&&(Object.freeze(ge.props),Object.freeze(ge)),ge};function yi(L,G,Q,de,Le){{var De,Ce={},ge=null,ut=null;Q!==void 0&&(ar(Q),ge=""+Q),pn(G)&&(ar(G.key),ge=""+G.key),kt(G)&&(ut=G.ref,Po(G,Le));for(De in G)Qe.call(G,De)&&!Te.hasOwnProperty(De)&&(Ce[De]=G[De]);if(L&&L.defaultProps){var Ge=L.defaultProps;for(De in Ge)Ce[De]===void 0&&(Ce[De]=Ge[De])}if(ge||ut){var Xe=typeof L=="function"?L.displayName||L.name||"Unknown":L;ge&&mi(Ce,Xe),ut&&Nc(Ce,Xe)}return bi(L,ge,ut,Le,de,ce.current,Ce)}}var Bo=h.ReactCurrentOwner,jo=h.ReactDebugCurrentFrame;function kn(L){if(L){var G=L._owner,Q=Je(L.type,L._source,G?G.type:null);jo.setExtraStackFrame(Q)}else jo.setExtraStackFrame(null)}var cr;cr=!1;function lr(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function Ci(){{if(Bo.current){var L=M(Bo.current.type);if(L)return`
21
+ `+ge[Ge].replace(" at new "," at ");return L.displayName&&Nt.includes("<anonymous>")&&(Nt=Nt.replace("<anonymous>",L.displayName)),typeof L=="function"&&te.set(L,Nt),Nt}while(Ge>=1&&Xe>=0);break}}}finally{P=!1,$.current=De,X(),Error.prepareStackTrace=Le}var $r=L?L.displayName||L.name:"",dr=$r?re($r):"";return typeof L=="function"&&te.set(L,dr),dr}function Me(L,G,Q){return Z(L,!1)}function ke(L){var G=L.prototype;return!!(G&&G.isReactComponent)}function Je(L,G,Q){if(L==null)return"";if(typeof L=="function")return Z(L,ke(L));if(typeof L=="string")return re(L);switch(L){case c:return re("Suspense");case u:return re("SuspenseList")}if(typeof L=="object")switch(L.$$typeof){case l:return Me(L.render);case p:return Je(L.type,G,Q);case g:{var de=L,Le=de._payload,De=de._init;try{return Je(De(Le),G,Q)}catch{}}}return""}var Qe=Object.prototype.hasOwnProperty,fn={},yt=h.ReactDebugCurrentFrame;function st(L){if(L){var G=L._owner,Q=Je(L.type,L._source,G?G.type:null);yt.setExtraStackFrame(Q)}else yt.setExtraStackFrame(null)}function Ze(L,G,Q,de,Le){{var De=Function.call.bind(Qe);for(var Ce in L)if(De(L,Ce)){var ge=void 0;try{if(typeof L[Ce]!="function"){var ut=Error((de||"React class")+": "+Q+" type `"+Ce+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof L[Ce]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ut.name="Invariant Violation",ut}ge=L[Ce](G,Ce,de,Q,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ge){ge=Ge}ge&&!(ge instanceof Error)&&(st(Le),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",de||"React class",Q,Ce,typeof ge),st(null)),ge instanceof Error&&!(ge.message in fn)&&(fn[ge.message]=!0,st(Le),v("Failed %s type: %s",Q,ge.message),st(null))}}}var kn=Array.isArray;function Ft(L){return kn(L)}function qr(L){{var G=typeof Symbol=="function"&&Symbol.toStringTag,Q=G&&L[Symbol.toStringTag]||L.constructor.name||"Object";return Q}}function Mo(L){try{return ir(L),!1}catch{return!0}}function ir(L){return""+L}function ar(L){if(Mo(L))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",qr(L)),ir(L)}var ce=h.ReactCurrentOwner,Te={key:!0,ref:!0,__self:!0,__source:!0},et,Ct,vt;vt={};function kt(L){if(Qe.call(L,"ref")){var G=Object.getOwnPropertyDescriptor(L,"ref").get;if(G&&G.isReactWarning)return!1}return L.ref!==void 0}function pn(L){if(Qe.call(L,"key")){var G=Object.getOwnPropertyDescriptor(L,"key").get;if(G&&G.isReactWarning)return!1}return L.key!==void 0}function Po(L,G){if(typeof L.ref=="string"&&ce.current&&G&&ce.current.stateNode!==G){var Q=M(ce.current.type);vt[Q]||(v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',M(ce.current.type),L.ref),vt[Q]=!0)}}function mi(L,G){{var Q=function(){et||(et=!0,v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",G))};Q.isReactWarning=!0,Object.defineProperty(L,"key",{get:Q,configurable:!0})}}function Nc(L,G){{var Q=function(){Ct||(Ct=!0,v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",G))};Q.isReactWarning=!0,Object.defineProperty(L,"ref",{get:Q,configurable:!0})}}var bi=function(L,G,Q,de,Le,De,Ce){var ge={$$typeof:t,type:L,key:G,ref:Q,props:Ce,_owner:De};return ge._store={},Object.defineProperty(ge._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ge,"_self",{configurable:!1,enumerable:!1,writable:!1,value:de}),Object.defineProperty(ge,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Le}),Object.freeze&&(Object.freeze(ge.props),Object.freeze(ge)),ge};function yi(L,G,Q,de,Le){{var De,Ce={},ge=null,ut=null;Q!==void 0&&(ar(Q),ge=""+Q),pn(G)&&(ar(G.key),ge=""+G.key),kt(G)&&(ut=G.ref,Po(G,Le));for(De in G)Qe.call(G,De)&&!Te.hasOwnProperty(De)&&(Ce[De]=G[De]);if(L&&L.defaultProps){var Ge=L.defaultProps;for(De in Ge)Ce[De]===void 0&&(Ce[De]=Ge[De])}if(ge||ut){var Xe=typeof L=="function"?L.displayName||L.name||"Unknown":L;ge&&mi(Ce,Xe),ut&&Nc(Ce,Xe)}return bi(L,ge,ut,Le,de,ce.current,Ce)}}var Bo=h.ReactCurrentOwner,jo=h.ReactDebugCurrentFrame;function Nn(L){if(L){var G=L._owner,Q=Je(L.type,L._source,G?G.type:null);jo.setExtraStackFrame(Q)}else jo.setExtraStackFrame(null)}var cr;cr=!1;function lr(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function Ci(){{if(Bo.current){var L=M(Bo.current.type);if(L)return`
22
22
 
23
23
  Check the render method of \``+L+"`."}return""}}function vi(L){return""}var Se={};function qe(L){{var G=Ci();if(!G){var Q=typeof L=="string"?L:L.displayName||L.name;Q&&(G=`
24
24
 
25
- Check the top-level render call using <`+Q+">.")}return G}}function Lt(L,G){{if(!L._store||L._store.validated||L.key!=null)return;L._store.validated=!0;var Q=qe(G);if(Se[Q])return;Se[Q]=!0;var de="";L&&L._owner&&L._owner!==Bo.current&&(de=" It was passed a child from "+M(L._owner.type)+"."),kn(L),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Q,de),kn(null)}}function ur(L,G){{if(typeof L!="object")return;if(Ft(L))for(var Q=0;Q<L.length;Q++){var de=L[Q];lr(de)&&Lt(de,G)}else if(lr(L))L._store&&(L._store.validated=!0);else if(L){var Le=f(L);if(typeof Le=="function"&&Le!==L.entries)for(var De=Le.call(L),Ce;!(Ce=De.next()).done;)lr(Ce.value)&&Lt(Ce.value,G)}}}function xi(L){{var G=L.type;if(G==null||typeof G=="string")return;var Q;if(typeof G=="function")Q=G.propTypes;else if(typeof G=="object"&&(G.$$typeof===l||G.$$typeof===p))Q=G.propTypes;else return;if(Q){var de=M(G);Ze(Q,L.props,"prop",de,L)}else if(G.PropTypes!==void 0&&!cr){cr=!0;var Le=M(G);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Le||"Unknown")}typeof G.getDefaultProps=="function"&&!G.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Rc(L){{for(var G=Object.keys(L.props),Q=0;Q<G.length;Q++){var de=G[Q];if(de!=="children"&&de!=="key"){kn(L),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",de),kn(null);break}}L.ref!==null&&(kn(L),v("Invalid attribute `ref` supplied to `React.Fragment`."),kn(null))}}var Vo={};function e1(L,G,Q,de,Le,De){{var Ce=F(L);if(!Ce){var ge="";(L===void 0||typeof L=="object"&&L!==null&&Object.keys(L).length===0)&&(ge+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ut=vi();ut?ge+=ut:ge+=Ci();var Ge;L===null?Ge="null":Ft(L)?Ge="array":L!==void 0&&L.$$typeof===t?(Ge="<"+(M(L.type)||"Unknown")+" />",ge=" Did you accidentally export a JSX literal instead of a component?"):Ge=typeof L,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ge,ge)}var Xe=yi(L,G,Q,Le,De);if(Xe==null)return Xe;if(Ce){var Nt=G.children;if(Nt!==void 0)if(de)if(Ft(Nt)){for(var $r=0;$r<Nt.length;$r++)ur(Nt[$r],L);Object.freeze&&Object.freeze(Nt)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ur(Nt,L)}if(Qe.call(G,"key")){var dr=M(L),xt=Object.keys(G).filter(function(tI){return tI!=="key"}),Mc=xt.length>0?"{key: someKey, "+xt.join(": ..., ")+": ...}":"{key: someKey}";if(!Vo[dr+Mc]){var eI=xt.length>0?"{"+xt.join(": ..., ")+": ...}":"{}";v(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+Q+">.")}return G}}function Lt(L,G){{if(!L._store||L._store.validated||L.key!=null)return;L._store.validated=!0;var Q=qe(G);if(Se[Q])return;Se[Q]=!0;var de="";L&&L._owner&&L._owner!==Bo.current&&(de=" It was passed a child from "+M(L._owner.type)+"."),Nn(L),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Q,de),Nn(null)}}function ur(L,G){{if(typeof L!="object")return;if(Ft(L))for(var Q=0;Q<L.length;Q++){var de=L[Q];lr(de)&&Lt(de,G)}else if(lr(L))L._store&&(L._store.validated=!0);else if(L){var Le=f(L);if(typeof Le=="function"&&Le!==L.entries)for(var De=Le.call(L),Ce;!(Ce=De.next()).done;)lr(Ce.value)&&Lt(Ce.value,G)}}}function xi(L){{var G=L.type;if(G==null||typeof G=="string")return;var Q;if(typeof G=="function")Q=G.propTypes;else if(typeof G=="object"&&(G.$$typeof===l||G.$$typeof===p))Q=G.propTypes;else return;if(Q){var de=M(G);Ze(Q,L.props,"prop",de,L)}else if(G.PropTypes!==void 0&&!cr){cr=!0;var Le=M(G);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Le||"Unknown")}typeof G.getDefaultProps=="function"&&!G.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Rc(L){{for(var G=Object.keys(L.props),Q=0;Q<G.length;Q++){var de=G[Q];if(de!=="children"&&de!=="key"){Nn(L),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",de),Nn(null);break}}L.ref!==null&&(Nn(L),v("Invalid attribute `ref` supplied to `React.Fragment`."),Nn(null))}}var Vo={};function e1(L,G,Q,de,Le,De){{var Ce=F(L);if(!Ce){var ge="";(L===void 0||typeof L=="object"&&L!==null&&Object.keys(L).length===0)&&(ge+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ut=vi();ut?ge+=ut:ge+=Ci();var Ge;L===null?Ge="null":Ft(L)?Ge="array":L!==void 0&&L.$$typeof===t?(Ge="<"+(M(L.type)||"Unknown")+" />",ge=" Did you accidentally export a JSX literal instead of a component?"):Ge=typeof L,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ge,ge)}var Xe=yi(L,G,Q,Le,De);if(Xe==null)return Xe;if(Ce){var Nt=G.children;if(Nt!==void 0)if(de)if(Ft(Nt)){for(var $r=0;$r<Nt.length;$r++)ur(Nt[$r],L);Object.freeze&&Object.freeze(Nt)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ur(Nt,L)}if(Qe.call(G,"key")){var dr=M(L),xt=Object.keys(G).filter(function(tI){return tI!=="key"}),Mc=xt.length>0?"{key: someKey, "+xt.join(": ..., ")+": ...}":"{key: someKey}";if(!Vo[dr+Mc]){var eI=xt.length>0?"{"+xt.join(": ..., ")+": ...}":"{}";v(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,Mc,dr,eI,dr),Vo[dr+Mc]=!0}}return L===r?Rc(Xe):xi(Xe),Xe}}function q8(L,G,Q){return e1(L,G,Q,!0)}function $8(L,G,Q){return e1(L,G,Q,!1)}var U8=$8,K8=q8;Kr.Fragment=r,Kr.jsx=U8,Kr.jsxs=K8}()),Kr}process.env.NODE_ENV==="production"?Ai.exports=r1():Ai.exports=o1();var m=Ai.exports;function Jc(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Jc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function gn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Jc(e))&&(r&&(r+=" "),r+=t);return r}const eo=e=>typeof e=="number"&&!isNaN(e),Mn=e=>typeof e=="string",Et=e=>typeof e=="function",Wo=e=>Mn(e)||Et(e)?e:null,_i=e=>_.isValidElement(e)||Mn(e)||Et(e)||eo(e);function s1(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function Zo(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:s=300}=e;return function(i){let{children:a,position:l,preventExitTransition:c,done:u,nodeRef:p,isIn:g,playToast:E}=i;const y=r?`${t}--${l}`:t,d=r?`${n}--${l}`:n,f=_.useRef(0);return _.useLayoutEffect(()=>{const h=p.current,v=y.split(" "),C=I=>{I.target===p.current&&(E(),h.removeEventListener("animationend",C),h.removeEventListener("animationcancel",C),f.current===0&&I.type!=="animationcancel"&&h.classList.remove(...v))};h.classList.add(...v),h.addEventListener("animationend",C),h.addEventListener("animationcancel",C)},[]),_.useEffect(()=>{const h=p.current,v=()=>{h.removeEventListener("animationend",v),o?s1(h,u,s):u()};g||(c?v():(f.current=1,h.className+=` ${d}`,h.addEventListener("animationend",v)))},[g]),_.createElement(_.Fragment,null,a)}}function Qc(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const it=new Map;let to=[];const Ti=new Set,i1=e=>Ti.forEach(t=>t(e)),qc=()=>it.size>0;function $c(e,t){var n;if(t)return!((n=it.get(t))==null||!n.isToastActive(e));let r=!1;return it.forEach(o=>{o.isToastActive(e)&&(r=!0)}),r}function Uc(e,t){_i(e)&&(qc()||to.push({content:e,options:t}),it.forEach(n=>{n.buildToast(e,t)}))}function Kc(e,t){it.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function a1(e){const{subscribe:t,getSnapshot:n,setProps:r}=_.useRef(function(s){const i=s.containerId||1;return{subscribe(a){const l=function(u,p,g){let E=1,y=0,d=[],f=[],h=[],v=p;const C=new Map,I=new Set,x=()=>{h=Array.from(C.values()),I.forEach(A=>A())},w=A=>{f=A==null?[]:f.filter(S=>S!==A),x()},T=A=>{const{toastId:S,onOpen:F,updateId:D,children:k}=A.props,M=D==null;A.staleId&&C.delete(A.staleId),C.set(S,A),f=[...f,A.props.toastId].filter(j=>j!==A.staleId),x(),g(Qc(A,M?"added":"updated")),M&&Et(F)&&F(_.isValidElement(k)&&k.props)};return{id:u,props:v,observe:A=>(I.add(A),()=>I.delete(A)),toggle:(A,S)=>{C.forEach(F=>{S!=null&&S!==F.props.toastId||Et(F.toggle)&&F.toggle(A)})},removeToast:w,toasts:C,clearQueue:()=>{y-=d.length,d=[]},buildToast:(A,S)=>{if((B=>{let{containerId:W,toastId:V,updateId:X}=B;const $=W?W!==u:u!==1,ee=C.has(V)&&X==null;return $||ee})(S))return;const{toastId:F,updateId:D,data:k,staleId:M,delay:j}=S,H=()=>{w(F)},z=D==null;z&&y++;const U={...v,style:v.toastStyle,key:E++,...Object.fromEntries(Object.entries(S).filter(B=>{let[W,V]=B;return V!=null})),toastId:F,updateId:D,data:k,closeToast:H,isIn:!1,className:Wo(S.className||v.toastClassName),bodyClassName:Wo(S.bodyClassName||v.bodyClassName),progressClassName:Wo(S.progressClassName||v.progressClassName),autoClose:!S.isLoading&&(J=S.autoClose,Y=v.autoClose,J===!1||eo(J)&&J>0?J:Y),deleteToast(){const B=C.get(F),{onClose:W,children:V}=B.props;Et(W)&&W(_.isValidElement(V)&&V.props),g(Qc(B,"removed")),C.delete(F),y--,y<0&&(y=0),d.length>0?T(d.shift()):x()}};var J,Y;U.closeButton=v.closeButton,S.closeButton===!1||_i(S.closeButton)?U.closeButton=S.closeButton:S.closeButton===!0&&(U.closeButton=!_i(v.closeButton)||v.closeButton);let ae=A;_.isValidElement(A)&&!Mn(A.type)?ae=_.cloneElement(A,{closeToast:H,toastProps:U,data:k}):Et(A)&&(ae=A({closeToast:H,toastProps:U,data:k}));const ue={content:ae,props:U,staleId:M};v.limit&&v.limit>0&&y>v.limit&&z?d.push(ue):eo(j)?setTimeout(()=>{T(ue)},j):T(ue)},setProps(A){v=A},setToggle:(A,S)=>{C.get(A).toggle=S},isToastActive:A=>f.some(S=>S===A),getSnapshot:()=>v.newestOnTop?h.reverse():h}}(i,s,i1);it.set(i,l);const c=l.observe(a);return to.forEach(u=>Uc(u.content,u.options)),to=[],()=>{c(),it.delete(i)}},setProps(a){var l;(l=it.get(i))==null||l.setProps(a)},getSnapshot(){var a;return(a=it.get(i))==null?void 0:a.getSnapshot()}}}(e)).current;r(e);const o=_.useSyncExternalStore(t,n,n);return{getToastToRender:function(s){if(!o)return[];const i=new Map;return o.forEach(a=>{const{position:l}=a.props;i.has(l)||i.set(l,[]),i.get(l).push(a)}),Array.from(i,a=>s(a[0],a[1]))},isToastActive:$c,count:o==null?void 0:o.length}}function c1(e){const[t,n]=_.useState(!1),[r,o]=_.useState(!1),s=_.useRef(null),i=_.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:a,pauseOnHover:l,closeToast:c,onClick:u,closeOnClick:p}=e;var g,E;function y(){n(!0)}function d(){n(!1)}function f(C){const I=s.current;i.canDrag&&I&&(i.didMove=!0,t&&d(),i.delta=e.draggableDirection==="x"?C.clientX-i.start:C.clientY-i.start,i.start!==C.clientX&&(i.canCloseOnClick=!1),I.style.transform=`translate3d(${e.draggableDirection==="x"?`${i.delta}px, var(--y)`:`0, calc(${i.delta}px + var(--y))`},0)`,I.style.opacity=""+(1-Math.abs(i.delta/i.removalDistance)))}function h(){document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",h);const C=s.current;if(i.canDrag&&i.didMove&&C){if(i.canDrag=!1,Math.abs(i.delta)>i.removalDistance)return o(!0),e.closeToast(),void e.collapseAll();C.style.transition="transform 0.2s, opacity 0.2s",C.style.removeProperty("transform"),C.style.removeProperty("opacity")}}(E=it.get((g={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||E.setToggle(g.id,g.fn),_.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||d(),window.addEventListener("focus",y),window.addEventListener("blur",d),()=>{window.removeEventListener("focus",y),window.removeEventListener("blur",d)}},[e.pauseOnFocusLoss]);const v={onPointerDown:function(C){if(e.draggable===!0||e.draggable===C.pointerType){i.didMove=!1,document.addEventListener("pointermove",f),document.addEventListener("pointerup",h);const I=s.current;i.canCloseOnClick=!0,i.canDrag=!0,I.style.transition="none",e.draggableDirection==="x"?(i.start=C.clientX,i.removalDistance=I.offsetWidth*(e.draggablePercent/100)):(i.start=C.clientY,i.removalDistance=I.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(C){const{top:I,bottom:x,left:w,right:T}=s.current.getBoundingClientRect();C.nativeEvent.type!=="touchend"&&e.pauseOnHover&&C.clientX>=w&&C.clientX<=T&&C.clientY>=I&&C.clientY<=x?d():y()}};return a&&l&&(v.onMouseEnter=d,e.stacked||(v.onMouseLeave=y)),p&&(v.onClick=C=>{u&&u(C),i.canCloseOnClick&&c()}),{playToast:y,pauseToast:d,isRunning:t,preventExitTransition:r,toastRef:s,eventHandlers:v}}function l1(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:s,className:i,style:a,controlledProgress:l,progress:c,rtl:u,isIn:p,theme:g}=e;const E=s||l&&c===0,y={...a,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};l&&(y.transform=`scaleX(${c})`);const d=gn("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${g}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":u}),f=Et(i)?i({rtl:u,type:o,defaultClassName:d}):gn(d,i),h={[l&&c>=1?"onTransitionEnd":"onAnimationEnd"]:l&&c<1?null:()=>{p&&r()}};return _.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":E},_.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${g} Toastify__progress-bar--${o}`}),_.createElement("div",{role:"progressbar","aria-hidden":E?"true":"false","aria-label":"notification timer",className:f,style:y,...h}))}let u1=1;const el=()=>""+u1++;function d1(e){return e&&(Mn(e.toastId)||eo(e.toastId))?e.toastId:el()}function no(e,t){return Uc(e,t),t.toastId}function Xo(e,t){return{...t,type:t&&t.type||e,toastId:d1(t)}}function zo(e){return(t,n)=>no(t,Xo(e,n))}function Ie(e,t){return no(e,Xo("default",t))}Ie.loading=(e,t)=>no(e,Xo("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),Ie.promise=function(e,t,n){let r,{pending:o,error:s,success:i}=t;o&&(r=Mn(o)?Ie.loading(o,n):Ie.loading(o.render,{...n,...o}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(u,p,g)=>{if(p==null)return void Ie.dismiss(r);const E={type:u,...a,...n,data:g},y=Mn(p)?{render:p}:p;return r?Ie.update(r,{...E,...y}):Ie(y.render,{...E,...y}),g},c=Et(e)?e():e;return c.then(u=>l("success",i,u)).catch(u=>l("error",s,u)),c},Ie.success=zo("success"),Ie.info=zo("info"),Ie.error=zo("error"),Ie.warning=zo("warning"),Ie.warn=Ie.warning,Ie.dark=(e,t)=>no(e,Xo("default",{theme:"dark",...t})),Ie.dismiss=function(e){(function(t){var n;if(qc()){if(t==null||Mn(n=t)||eo(n))it.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=it.get(t.containerId);r?r.removeToast(t.id):it.forEach(o=>{o.removeToast(t.id)})}}else to=to.filter(r=>t!=null&&r.options.toastId!==t)})(e)},Ie.clearWaitingQueue=function(e){e===void 0&&(e={}),it.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},Ie.isActive=$c,Ie.update=function(e,t){t===void 0&&(t={});const n=((r,o)=>{var s;let{containerId:i}=o;return(s=it.get(i||1))==null?void 0:s.toasts.get(r)})(e,t);if(n){const{props:r,content:o}=n,s={delay:100,...r,...t,toastId:t.toastId||e,updateId:el()};s.toastId!==e&&(s.staleId=e);const i=s.render||o;delete s.render,no(i,s)}},Ie.done=e=>{Ie.update(e,{progress:1})},Ie.onChange=function(e){return Ti.add(e),()=>{Ti.delete(e)}},Ie.play=e=>Kc(!0,e),Ie.pause=e=>Kc(!1,e);const f1=typeof window<"u"?_.useLayoutEffect:_.useEffect,Yo=e=>{let{theme:t,type:n,isLoading:r,...o}=e;return _.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...o})},Si={info:function(e){return _.createElement(Yo,{...e},_.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return _.createElement(Yo,{...e},_.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return _.createElement(Yo,{...e},_.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return _.createElement(Yo,{...e},_.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return _.createElement("div",{className:"Toastify__spinner"})}},p1=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o,playToast:s}=c1(e),{closeButton:i,children:a,autoClose:l,onClick:c,type:u,hideProgressBar:p,closeToast:g,transition:E,position:y,className:d,style:f,bodyClassName:h,bodyStyle:v,progressClassName:C,progressStyle:I,updateId:x,role:w,progress:T,rtl:A,toastId:S,deleteToast:F,isIn:D,isLoading:k,closeOnClick:M,theme:j}=e,H=gn("Toastify__toast",`Toastify__toast-theme--${j}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":A},{"Toastify__toast--close-on-click":M}),z=Et(d)?d({rtl:A,position:y,type:u,defaultClassName:H}):gn(H,d),U=function(ue){let{theme:B,type:W,isLoading:V,icon:X}=ue,$=null;const ee={theme:B,type:W};return X===!1||(Et(X)?$=X({...ee,isLoading:V}):_.isValidElement(X)?$=_.cloneElement(X,ee):V?$=Si.spinner():(re=>re in Si)(W)&&($=Si[W](ee))),$}(e),J=!!T||!l,Y={closeToast:g,type:u,theme:j};let ae=null;return i===!1||(ae=Et(i)?i(Y):_.isValidElement(i)?_.cloneElement(i,Y):function(ue){let{closeToast:B,theme:W,ariaLabel:V="close"}=ue;return _.createElement("button",{className:`Toastify__close-button Toastify__close-button--${W}`,type:"button",onClick:X=>{X.stopPropagation(),B(X)},"aria-label":V},_.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},_.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(Y)),_.createElement(E,{isIn:D,done:F,position:y,preventExitTransition:n,nodeRef:r,playToast:s},_.createElement("div",{id:S,onClick:c,"data-in":D,className:z,...o,style:f,ref:r},_.createElement("div",{...D&&{role:w},className:Et(h)?h({type:u}):gn("Toastify__toast-body",h),style:v},U!=null&&_.createElement("div",{className:gn("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!k})},U),_.createElement("div",null,a)),ae,_.createElement(l1,{...x&&!J?{key:`pb-${x}`}:{},rtl:A,theme:j,delay:l,isRunning:t,isIn:D,closeToast:g,hide:p,type:u,style:I,className:C,controlledProgress:J,progress:T||0})))},Jo=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},h1=Zo(Jo("bounce",!0));Zo(Jo("slide",!0)),Zo(Jo("zoom")),Zo(Jo("flip"));const g1={position:"top-right",transition:h1,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function tl(e){let t={...g1,...e};const n=e.stacked,[r,o]=_.useState(!0),s=_.useRef(null),{getToastToRender:i,isToastActive:a,count:l}=a1(t),{className:c,style:u,rtl:p,containerId:g}=t;function E(d){const f=gn("Toastify__toast-container",`Toastify__toast-container--${d}`,{"Toastify__toast-container--rtl":p});return Et(c)?c({position:d,rtl:p,defaultClassName:f}):gn(f,Wo(c))}function y(){n&&(o(!0),Ie.play())}return f1(()=>{if(n){var d;const f=s.current.querySelectorAll('[data-in="true"]'),h=12,v=(d=t.position)==null?void 0:d.includes("top");let C=0,I=0;Array.from(f).reverse().forEach((x,w)=>{const T=x;T.classList.add("Toastify__toast--stacked"),w>0&&(T.dataset.collapsed=`${r}`),T.dataset.pos||(T.dataset.pos=v?"top":"bot");const A=C*(r?.2:1)+(r?0:h*w);T.style.setProperty("--y",`${v?A:-1*A}px`),T.style.setProperty("--g",`${h}`),T.style.setProperty("--s",""+(1-(r?I:0))),C+=T.offsetHeight,I+=.025})}},[r,l,n]),_.createElement("div",{ref:s,className:"Toastify",id:g,onMouseEnter:()=>{n&&(o(!1),Ie.pause())},onMouseLeave:y},i((d,f)=>{const h=f.length?{...u}:{...u,pointerEvents:"none"};return _.createElement("div",{className:E(d),style:h,key:`container-${d}`},f.map(v=>{let{content:C,props:I}=v;return _.createElement(p1,{...I,stacked:n,collapseAll:y,isIn:a(I.toastId,I.containerId),style:I.style,key:`toast-${I.key}`},C)}))}))}const Li=(e,t)=>t.some(n=>e instanceof n);let nl,rl;function m1(){return nl||(nl=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function b1(){return rl||(rl=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Oi=new WeakMap,Di=new WeakMap,Qo=new WeakMap;function y1(e){const t=new Promise((n,r)=>{const o=()=>{e.removeEventListener("success",s),e.removeEventListener("error",i)},s=()=>{n(Pn(e.result)),o()},i=()=>{r(e.error),o()};e.addEventListener("success",s),e.addEventListener("error",i)});return Qo.set(t,e),t}function C1(e){if(Oi.has(e))return;const t=new Promise((n,r)=>{const o=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",i),e.removeEventListener("abort",i)},s=()=>{n(),o()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",s),e.addEventListener("error",i),e.addEventListener("abort",i)});Oi.set(e,t)}let Fi={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return Oi.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Pn(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function ol(e){Fi=e(Fi)}function v1(e){return b1().includes(e)?function(...t){return e.apply(ki(this),t),Pn(this.request)}:function(...t){return Pn(e.apply(ki(this),t))}}function x1(e){return typeof e=="function"?v1(e):(e instanceof IDBTransaction&&C1(e),Li(e,m1())?new Proxy(e,Fi):e)}function Pn(e){if(e instanceof IDBRequest)return y1(e);if(Di.has(e))return Di.get(e);const t=x1(e);return t!==e&&(Di.set(e,t),Qo.set(t,e)),t}const ki=e=>Qo.get(e);function E1(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=Pn(i);return r&&i.addEventListener("upgradeneeded",l=>{r(Pn(i.result),l.oldVersion,l.newVersion,Pn(i.transaction),l)}),n&&i.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{s&&l.addEventListener("close",()=>s()),o&&l.addEventListener("versionchange",c=>o(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const I1=["get","getKey","getAll","getAllKeys","count"],w1=["put","add","delete","clear"],Ni=new Map;function sl(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Ni.get(t))return Ni.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=w1.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(o||I1.includes(n)))return;const s=async function(i,...a){const l=this.transaction(i,o?"readwrite":"readonly");let c=l.store;return r&&(c=c.index(a.shift())),(await Promise.all([c[n](...a),o&&l.done]))[0]};return Ni.set(t,s),s}ol(e=>({...e,get:(t,n,r)=>sl(t,n)||e.get(t,n,r),has:(t,n)=>!!sl(t,n)||e.has(t,n)}));const A1=["continue","continuePrimaryKey","advance"],il={},Ri=new WeakMap,al=new WeakMap,_1={get(e,t){if(!A1.includes(t))return e[t];let n=il[t];return n||(n=il[t]=function(...r){Ri.set(this,al.get(this)[t](...r))}),n}};async function*T1(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,_1);for(al.set(n,t),Qo.set(n,ki(t));t;)yield n,t=await(Ri.get(n)||t.continue()),Ri.delete(n)}function cl(e,t){return t===Symbol.asyncIterator&&Li(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&Li(e,[IDBIndex,IDBObjectStore])}ol(e=>({...e,get(t,n,r){return cl(t,n)?T1:e.get(t,n,r)},has(t,n){return cl(t,n)||e.has(t,n)}}));const S1="connector-db",L1=1,qo={FEEDBACK:"feedback"},ro=`${qo.FEEDBACK}:data`,$o=`${qo.FEEDBACK}:last_submitted`,oo=`${qo.FEEDBACK}:capture_on_demand`,so=`${qo.FEEDBACK}:show_notification`,O1=12*60*60*1e3,Mi=(e,t=new Date)=>e?Math.abs(t.getTime()-e.getTime())>=O1:!0,ll=(e,t=!1)=>e.captureFeedback&&(Mi(e.firstViewed)&&(!e.lastSubmittedFeedback||Mi(e.lastSubmittedFeedback))||!!t);let Bn=null;const mn=async()=>{try{Bn||(Bn=await E1(S1,L1,{upgrade(e){e.objectStoreNames.contains(ro)||e.createObjectStore(ro),e.objectStoreNames.contains($o)||e.createObjectStore($o),e.objectStoreNames.contains(oo)||e.createObjectStore(oo),e.objectStoreNames.contains(so)||e.createObjectStore(so)},blocked(){console.warn("Upgrade blocked! Close other tabs using this DB.")},blocking(){console.warn("Another tab is trying to upgrade. Closing connection to allow upgrade."),Bn&&(Bn.close(),Bn=null)},terminated(){console.error("DB connection unexpectedly closed. Resetting connection."),Bn=null}}))}catch(e){console.error("Error opening IndexedDB connection:",e)}return Bn},Pi=async e=>{if(!e)return[];const t=await mn();if(!t)return[];try{return await t.get(ro,e)||[]}catch(n){return console.error("Error fetching user feedback data:",n),[]}},D1=async e=>{if(!e)return null;const t=await mn();if(!t)return null;try{return await t.get($o,e)||null}catch(n){return console.error("Error fetching last submitted feedback:",n),null}},Uo=async e=>{if(!e)return;const t=await mn();if(t)try{return await t.get(oo,e)}catch(n){console.error("Error fetching capture on demand status:",n);return}},F1=async e=>{if(!e)return!1;const t=await mn();if(!t)return!1;try{return await t.get(so,e)??!1}catch(n){return console.error("Error fetching show notification status:",n),!1}},k1=async(e,t)=>{if(!e||!t||!t.length)return;const n=await mn();if(n)try{const r=await Pi(e),o=new Set(r.map(i=>i.connectorId)),s=t.filter(i=>!o.has(i.connector_id)).map(i=>({connectorId:i.connector_id,captureFeedback:!0,firstViewed:new Date}));if(s.length>0){const i=[...r,...s];await n.put(ro,i,e),await n.put(so,!0,e)}}catch(r){console.error("Error updating connectors feedback data:",r)}},N1=async e=>{if(!e)return;const t=await mn();if(t)try{const n=await Pi(e),r=await Uo(e),o=new Date,s=n.map(i=>{const a=ll(i,r);return{...i,lastSubmittedFeedback:a?o:i.lastSubmittedFeedback,captureFeedback:i.captureFeedback!==a}});await t.put(ro,s,e),await t.put($o,o,e),r&&await t.put(oo,!1,e)}catch(n){console.error("Error updating feedback submission date:",n)}},ul=async(e,t)=>{if(!e)return;const n=await mn();if(n)try{await n.put(oo,t,e)}catch(r){console.error("Error updating capture on demand:",r)}},R1=async e=>{if(!e)return;const t=await mn();if(t)try{await t.put(so,!1,e)}catch(n){console.error("Error resetting show notification status:",n)}},M1=async e=>{const t=await Pi(e),n=await Uo(e);return t.filter(o=>ll(o,n))},Bi=async e=>{const t=await D1(e);return t&&!Mi(t)?!1:await Uo(e)&&!t?!0:!!(await M1(e)).length},P1=async(e,t)=>{await k1(e,t)},Ko=async e=>{e&&await N1(e)},B1=async(e,t)=>{const n=await Uo(e);t?n!==!1&&await ul(e,t):await ul(e,void 0)},dl=async e=>await F1(e)&&await Bi(e),fl=async e=>{await R1(e)};var ji={},jn={};function pl(e,t){return function(){return e.apply(t,arguments)}}const{toString:j1}=Object.prototype,{getPrototypeOf:Vi}=Object,es=(e=>t=>{const n=j1.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Rt=e=>(e=e.toLowerCase(),t=>es(t)===e),ts=e=>t=>typeof t===e,{isArray:fr}=Array,io=ts("undefined");function V1(e){return e!==null&&!io(e)&&e.constructor!==null&&!io(e.constructor)&&It(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const hl=Rt("ArrayBuffer");function G1(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&hl(e.buffer),t}const H1=ts("string"),It=ts("function"),gl=ts("number"),ns=e=>e!==null&&typeof e=="object",W1=e=>e===!0||e===!1,rs=e=>{if(es(e)!=="object")return!1;const t=Vi(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Z1=Rt("Date"),X1=Rt("File"),z1=Rt("Blob"),Y1=Rt("FileList"),J1=e=>ns(e)&&It(e.pipe),Q1=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||It(e.append)&&((t=es(e))==="formdata"||t==="object"&&It(e.toString)&&e.toString()==="[object FormData]"))},q1=Rt("URLSearchParams"),[$1,U1,K1,e2]=["ReadableStream","Request","Response","Headers"].map(Rt),t2=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ao(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),fr(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let a;for(r=0;r<i;r++)a=s[r],t.call(null,e[a],a,e)}}function ml(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const Vn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:fe,bl=e=>!io(e)&&e!==Vn;function Gi(){const{caseless:e}=bl(this)&&this||{},t={},n=(r,o)=>{const s=e&&ml(t,o)||o;rs(t[s])&&rs(r)?t[s]=Gi(t[s],r):rs(r)?t[s]=Gi({},r):fr(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&ao(arguments[r],n);return t}const n2=(e,t,n,{allOwnKeys:r}={})=>(ao(t,(o,s)=>{n&&It(o)?e[s]=pl(o,n):e[s]=o},{allOwnKeys:r}),e),r2=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),o2=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},s2=(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&Vi(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},i2=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},a2=e=>{if(!e)return null;if(fr(e))return e;let t=e.length;if(!gl(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},c2=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Vi(Uint8Array)),l2=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},u2=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},d2=Rt("HTMLFormElement"),f2=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),yl=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),p2=Rt("RegExp"),Cl=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ao(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},h2=e=>{Cl(e,(t,n)=>{if(It(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(It(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},g2=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return fr(e)?r(e):r(String(e).split(t)),n},m2=()=>{},b2=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Hi="abcdefghijklmnopqrstuvwxyz",vl="0123456789",xl={DIGIT:vl,ALPHA:Hi,ALPHA_DIGIT:Hi+Hi.toUpperCase()+vl},y2=(e=16,t=xl.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function C2(e){return!!(e&&It(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const v2=e=>{const t=new Array(10),n=(r,o)=>{if(ns(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=fr(r)?[]:{};return ao(r,(i,a)=>{const l=n(i,o+1);!io(l)&&(s[a]=l)}),t[o]=void 0,s}}return r};return n(e,0)},x2=Rt("AsyncFunction"),E2=e=>e&&(ns(e)||It(e))&&It(e.then)&&It(e.catch),El=((e,t)=>e?setImmediate:t?((n,r)=>(Vn.addEventListener("message",({source:o,data:s})=>{o===Vn&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Vn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",It(Vn.postMessage)),I2=typeof queueMicrotask<"u"?queueMicrotask.bind(Vn):typeof process<"u"&&process.nextTick||El;var R={isArray:fr,isArrayBuffer:hl,isBuffer:V1,isFormData:Q1,isArrayBufferView:G1,isString:H1,isNumber:gl,isBoolean:W1,isObject:ns,isPlainObject:rs,isReadableStream:$1,isRequest:U1,isResponse:K1,isHeaders:e2,isUndefined:io,isDate:Z1,isFile:X1,isBlob:z1,isRegExp:p2,isFunction:It,isStream:J1,isURLSearchParams:q1,isTypedArray:c2,isFileList:Y1,forEach:ao,merge:Gi,extend:n2,trim:t2,stripBOM:r2,inherits:o2,toFlatObject:s2,kindOf:es,kindOfTest:Rt,endsWith:i2,toArray:a2,forEachEntry:l2,matchAll:u2,isHTMLForm:d2,hasOwnProperty:yl,hasOwnProp:yl,reduceDescriptors:Cl,freezeMethods:h2,toObjectSet:g2,toCamelCase:f2,noop:m2,toFiniteNumber:b2,findKey:ml,global:Vn,isContextDefined:bl,ALPHABET:xl,generateString:y2,isSpecCompliantForm:C2,toJSONObject:v2,isAsyncFn:x2,isThenable:E2,setImmediate:El,asap:I2};function pe(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}R.inherits(pe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:R.toJSONObject(this.config),code:this.code,status:this.status}}});const Il=pe.prototype,wl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{wl[e]={value:e}}),Object.defineProperties(pe,wl),Object.defineProperty(Il,"isAxiosError",{value:!0}),pe.from=(e,t,n,r,o,s)=>{const i=Object.create(Il);return R.toFlatObject(e,i,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),pe.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};var w2=null;function Wi(e){return R.isPlainObject(e)||R.isArray(e)}function Al(e){return R.endsWith(e,"[]")?e.slice(0,-2):e}function _l(e,t,n){return e?e.concat(t).map(function(o,s){return o=Al(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function A2(e){return R.isArray(e)&&!e.some(Wi)}const _2=R.toFlatObject(R,{},null,function(t){return/^is[A-Z]/.test(t)});function os(e,t,n){if(!R.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=R.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(d,f){return!R.isUndefined(f[d])});const r=n.metaTokens,o=n.visitor||u,s=n.dots,i=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&R.isSpecCompliantForm(t);if(!R.isFunction(o))throw new TypeError("visitor must be a function");function c(y){if(y===null)return"";if(R.isDate(y))return y.toISOString();if(!l&&R.isBlob(y))throw new pe("Blob is not supported. Use a Buffer instead.");return R.isArrayBuffer(y)||R.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function u(y,d,f){let h=y;if(y&&!f&&typeof y=="object"){if(R.endsWith(d,"{}"))d=r?d:d.slice(0,-2),y=JSON.stringify(y);else if(R.isArray(y)&&A2(y)||(R.isFileList(y)||R.endsWith(d,"[]"))&&(h=R.toArray(y)))return d=Al(d),h.forEach(function(C,I){!(R.isUndefined(C)||C===null)&&t.append(i===!0?_l([d],I,s):i===null?d:d+"[]",c(C))}),!1}return Wi(y)?!0:(t.append(_l(f,d,s),c(y)),!1)}const p=[],g=Object.assign(_2,{defaultVisitor:u,convertValue:c,isVisitable:Wi});function E(y,d){if(!R.isUndefined(y)){if(p.indexOf(y)!==-1)throw Error("Circular reference detected in "+d.join("."));p.push(y),R.forEach(y,function(h,v){(!(R.isUndefined(h)||h===null)&&o.call(t,h,R.isString(v)?v.trim():v,d,g))===!0&&E(h,d?d.concat(v):[v])}),p.pop()}}if(!R.isObject(e))throw new TypeError("data must be an object");return E(e),t}function Tl(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Zi(e,t){this._pairs=[],e&&os(e,this,t)}const Sl=Zi.prototype;Sl.append=function(t,n){this._pairs.push([t,n])},Sl.toString=function(t){const n=t?function(r){return t.call(this,r,Tl)}:Tl;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function T2(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ll(e,t,n){if(!t)return e;const r=n&&n.encode||T2,o=n&&n.serialize;let s;if(o?s=o(t,n):s=R.isURLSearchParams(t)?t.toString():new Zi(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class S2{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){R.forEach(this.handlers,function(r){r!==null&&t(r)})}}var Ol=S2,Dl={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},L2=typeof URLSearchParams<"u"?URLSearchParams:Zi,O2=typeof FormData<"u"?FormData:null,D2=typeof Blob<"u"?Blob:null,F2={isBrowser:!0,classes:{URLSearchParams:L2,FormData:O2,Blob:D2},protocols:["http","https","file","blob","url","data"]};const Xi=typeof window<"u"&&typeof document<"u",zi=typeof navigator=="object"&&navigator||void 0,k2=Xi&&(!zi||["ReactNative","NativeScript","NS"].indexOf(zi.product)<0),N2=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",R2=Xi&&window.location.href||"http://localhost";var M2=Object.freeze({__proto__:null,hasBrowserEnv:Xi,hasStandardBrowserWebWorkerEnv:N2,hasStandardBrowserEnv:k2,navigator:zi,origin:R2}),dt={...M2,...F2};function P2(e,t){return os(e,new dt.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return dt.isNode&&R.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function B2(e){return R.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function j2(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function Fl(e){function t(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),l=s>=n.length;return i=!i&&R.isArray(o)?o.length:i,l?(R.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!a):((!o[i]||!R.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&R.isArray(o[i])&&(o[i]=j2(o[i])),!a)}if(R.isFormData(e)&&R.isFunction(e.entries)){const n={};return R.forEachEntry(e,(r,o)=>{t(B2(r),o,n,0)}),n}return null}function V2(e,t,n){if(R.isString(e))try{return(t||JSON.parse)(e),R.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Yi={transitional:Dl,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=R.isObject(t);if(s&&R.isHTMLForm(t)&&(t=new FormData(t)),R.isFormData(t))return o?JSON.stringify(Fl(t)):t;if(R.isArrayBuffer(t)||R.isBuffer(t)||R.isStream(t)||R.isFile(t)||R.isBlob(t)||R.isReadableStream(t))return t;if(R.isArrayBufferView(t))return t.buffer;if(R.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return P2(t,this.formSerializer).toString();if((a=R.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return os(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),V2(t)):t}],transformResponse:[function(t){const n=this.transitional||Yi.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(R.isResponse(t)||R.isReadableStream(t))return t;if(t&&R.isString(t)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(i)throw a.name==="SyntaxError"?pe.from(a,pe.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:dt.classes.FormData,Blob:dt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};R.forEach(["delete","get","head","post","put","patch"],e=>{Yi.headers[e]={}});var Ji=Yi;const G2=R.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var H2=e=>{const t={};let n,r,o;return e&&e.split(`
30
+ <%s key={someKey} {...props} />`,Mc,dr,eI,dr),Vo[dr+Mc]=!0}}return L===r?Rc(Xe):xi(Xe),Xe}}function q8(L,G,Q){return e1(L,G,Q,!0)}function $8(L,G,Q){return e1(L,G,Q,!1)}var U8=$8,K8=q8;Kr.Fragment=r,Kr.jsx=U8,Kr.jsxs=K8}()),Kr}process.env.NODE_ENV==="production"?Ai.exports=r1():Ai.exports=o1();var m=Ai.exports;function Jc(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Jc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function mn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Jc(e))&&(r&&(r+=" "),r+=t);return r}const eo=e=>typeof e=="number"&&!isNaN(e),Mn=e=>typeof e=="string",Et=e=>typeof e=="function",Wo=e=>Mn(e)||Et(e)?e:null,_i=e=>_.isValidElement(e)||Mn(e)||Et(e)||eo(e);function s1(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function Zo(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:s=300}=e;return function(i){let{children:a,position:l,preventExitTransition:c,done:u,nodeRef:p,isIn:g,playToast:E}=i;const y=r?`${t}--${l}`:t,d=r?`${n}--${l}`:n,f=_.useRef(0);return _.useLayoutEffect(()=>{const h=p.current,v=y.split(" "),C=I=>{I.target===p.current&&(E(),h.removeEventListener("animationend",C),h.removeEventListener("animationcancel",C),f.current===0&&I.type!=="animationcancel"&&h.classList.remove(...v))};h.classList.add(...v),h.addEventListener("animationend",C),h.addEventListener("animationcancel",C)},[]),_.useEffect(()=>{const h=p.current,v=()=>{h.removeEventListener("animationend",v),o?s1(h,u,s):u()};g||(c?v():(f.current=1,h.className+=` ${d}`,h.addEventListener("animationend",v)))},[g]),_.createElement(_.Fragment,null,a)}}function Qc(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const it=new Map;let to=[];const Ti=new Set,i1=e=>Ti.forEach(t=>t(e)),qc=()=>it.size>0;function $c(e,t){var n;if(t)return!((n=it.get(t))==null||!n.isToastActive(e));let r=!1;return it.forEach(o=>{o.isToastActive(e)&&(r=!0)}),r}function Uc(e,t){_i(e)&&(qc()||to.push({content:e,options:t}),it.forEach(n=>{n.buildToast(e,t)}))}function Kc(e,t){it.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function a1(e){const{subscribe:t,getSnapshot:n,setProps:r}=_.useRef(function(s){const i=s.containerId||1;return{subscribe(a){const l=function(u,p,g){let E=1,y=0,d=[],f=[],h=[],v=p;const C=new Map,I=new Set,x=()=>{h=Array.from(C.values()),I.forEach(A=>A())},w=A=>{f=A==null?[]:f.filter(S=>S!==A),x()},T=A=>{const{toastId:S,onOpen:F,updateId:D,children:k}=A.props,M=D==null;A.staleId&&C.delete(A.staleId),C.set(S,A),f=[...f,A.props.toastId].filter(j=>j!==A.staleId),x(),g(Qc(A,M?"added":"updated")),M&&Et(F)&&F(_.isValidElement(k)&&k.props)};return{id:u,props:v,observe:A=>(I.add(A),()=>I.delete(A)),toggle:(A,S)=>{C.forEach(F=>{S!=null&&S!==F.props.toastId||Et(F.toggle)&&F.toggle(A)})},removeToast:w,toasts:C,clearQueue:()=>{y-=d.length,d=[]},buildToast:(A,S)=>{if((B=>{let{containerId:W,toastId:V,updateId:X}=B;const $=W?W!==u:u!==1,ee=C.has(V)&&X==null;return $||ee})(S))return;const{toastId:F,updateId:D,data:k,staleId:M,delay:j}=S,H=()=>{w(F)},z=D==null;z&&y++;const U={...v,style:v.toastStyle,key:E++,...Object.fromEntries(Object.entries(S).filter(B=>{let[W,V]=B;return V!=null})),toastId:F,updateId:D,data:k,closeToast:H,isIn:!1,className:Wo(S.className||v.toastClassName),bodyClassName:Wo(S.bodyClassName||v.bodyClassName),progressClassName:Wo(S.progressClassName||v.progressClassName),autoClose:!S.isLoading&&(J=S.autoClose,Y=v.autoClose,J===!1||eo(J)&&J>0?J:Y),deleteToast(){const B=C.get(F),{onClose:W,children:V}=B.props;Et(W)&&W(_.isValidElement(V)&&V.props),g(Qc(B,"removed")),C.delete(F),y--,y<0&&(y=0),d.length>0?T(d.shift()):x()}};var J,Y;U.closeButton=v.closeButton,S.closeButton===!1||_i(S.closeButton)?U.closeButton=S.closeButton:S.closeButton===!0&&(U.closeButton=!_i(v.closeButton)||v.closeButton);let ae=A;_.isValidElement(A)&&!Mn(A.type)?ae=_.cloneElement(A,{closeToast:H,toastProps:U,data:k}):Et(A)&&(ae=A({closeToast:H,toastProps:U,data:k}));const ue={content:ae,props:U,staleId:M};v.limit&&v.limit>0&&y>v.limit&&z?d.push(ue):eo(j)?setTimeout(()=>{T(ue)},j):T(ue)},setProps(A){v=A},setToggle:(A,S)=>{C.get(A).toggle=S},isToastActive:A=>f.some(S=>S===A),getSnapshot:()=>v.newestOnTop?h.reverse():h}}(i,s,i1);it.set(i,l);const c=l.observe(a);return to.forEach(u=>Uc(u.content,u.options)),to=[],()=>{c(),it.delete(i)}},setProps(a){var l;(l=it.get(i))==null||l.setProps(a)},getSnapshot(){var a;return(a=it.get(i))==null?void 0:a.getSnapshot()}}}(e)).current;r(e);const o=_.useSyncExternalStore(t,n,n);return{getToastToRender:function(s){if(!o)return[];const i=new Map;return o.forEach(a=>{const{position:l}=a.props;i.has(l)||i.set(l,[]),i.get(l).push(a)}),Array.from(i,a=>s(a[0],a[1]))},isToastActive:$c,count:o==null?void 0:o.length}}function c1(e){const[t,n]=_.useState(!1),[r,o]=_.useState(!1),s=_.useRef(null),i=_.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:a,pauseOnHover:l,closeToast:c,onClick:u,closeOnClick:p}=e;var g,E;function y(){n(!0)}function d(){n(!1)}function f(C){const I=s.current;i.canDrag&&I&&(i.didMove=!0,t&&d(),i.delta=e.draggableDirection==="x"?C.clientX-i.start:C.clientY-i.start,i.start!==C.clientX&&(i.canCloseOnClick=!1),I.style.transform=`translate3d(${e.draggableDirection==="x"?`${i.delta}px, var(--y)`:`0, calc(${i.delta}px + var(--y))`},0)`,I.style.opacity=""+(1-Math.abs(i.delta/i.removalDistance)))}function h(){document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",h);const C=s.current;if(i.canDrag&&i.didMove&&C){if(i.canDrag=!1,Math.abs(i.delta)>i.removalDistance)return o(!0),e.closeToast(),void e.collapseAll();C.style.transition="transform 0.2s, opacity 0.2s",C.style.removeProperty("transform"),C.style.removeProperty("opacity")}}(E=it.get((g={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||E.setToggle(g.id,g.fn),_.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||d(),window.addEventListener("focus",y),window.addEventListener("blur",d),()=>{window.removeEventListener("focus",y),window.removeEventListener("blur",d)}},[e.pauseOnFocusLoss]);const v={onPointerDown:function(C){if(e.draggable===!0||e.draggable===C.pointerType){i.didMove=!1,document.addEventListener("pointermove",f),document.addEventListener("pointerup",h);const I=s.current;i.canCloseOnClick=!0,i.canDrag=!0,I.style.transition="none",e.draggableDirection==="x"?(i.start=C.clientX,i.removalDistance=I.offsetWidth*(e.draggablePercent/100)):(i.start=C.clientY,i.removalDistance=I.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(C){const{top:I,bottom:x,left:w,right:T}=s.current.getBoundingClientRect();C.nativeEvent.type!=="touchend"&&e.pauseOnHover&&C.clientX>=w&&C.clientX<=T&&C.clientY>=I&&C.clientY<=x?d():y()}};return a&&l&&(v.onMouseEnter=d,e.stacked||(v.onMouseLeave=y)),p&&(v.onClick=C=>{u&&u(C),i.canCloseOnClick&&c()}),{playToast:y,pauseToast:d,isRunning:t,preventExitTransition:r,toastRef:s,eventHandlers:v}}function l1(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:s,className:i,style:a,controlledProgress:l,progress:c,rtl:u,isIn:p,theme:g}=e;const E=s||l&&c===0,y={...a,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};l&&(y.transform=`scaleX(${c})`);const d=mn("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${g}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":u}),f=Et(i)?i({rtl:u,type:o,defaultClassName:d}):mn(d,i),h={[l&&c>=1?"onTransitionEnd":"onAnimationEnd"]:l&&c<1?null:()=>{p&&r()}};return _.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":E},_.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${g} Toastify__progress-bar--${o}`}),_.createElement("div",{role:"progressbar","aria-hidden":E?"true":"false","aria-label":"notification timer",className:f,style:y,...h}))}let u1=1;const el=()=>""+u1++;function d1(e){return e&&(Mn(e.toastId)||eo(e.toastId))?e.toastId:el()}function no(e,t){return Uc(e,t),t.toastId}function Xo(e,t){return{...t,type:t&&t.type||e,toastId:d1(t)}}function zo(e){return(t,n)=>no(t,Xo(e,n))}function Ie(e,t){return no(e,Xo("default",t))}Ie.loading=(e,t)=>no(e,Xo("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),Ie.promise=function(e,t,n){let r,{pending:o,error:s,success:i}=t;o&&(r=Mn(o)?Ie.loading(o,n):Ie.loading(o.render,{...n,...o}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(u,p,g)=>{if(p==null)return void Ie.dismiss(r);const E={type:u,...a,...n,data:g},y=Mn(p)?{render:p}:p;return r?Ie.update(r,{...E,...y}):Ie(y.render,{...E,...y}),g},c=Et(e)?e():e;return c.then(u=>l("success",i,u)).catch(u=>l("error",s,u)),c},Ie.success=zo("success"),Ie.info=zo("info"),Ie.error=zo("error"),Ie.warning=zo("warning"),Ie.warn=Ie.warning,Ie.dark=(e,t)=>no(e,Xo("default",{theme:"dark",...t})),Ie.dismiss=function(e){(function(t){var n;if(qc()){if(t==null||Mn(n=t)||eo(n))it.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=it.get(t.containerId);r?r.removeToast(t.id):it.forEach(o=>{o.removeToast(t.id)})}}else to=to.filter(r=>t!=null&&r.options.toastId!==t)})(e)},Ie.clearWaitingQueue=function(e){e===void 0&&(e={}),it.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},Ie.isActive=$c,Ie.update=function(e,t){t===void 0&&(t={});const n=((r,o)=>{var s;let{containerId:i}=o;return(s=it.get(i||1))==null?void 0:s.toasts.get(r)})(e,t);if(n){const{props:r,content:o}=n,s={delay:100,...r,...t,toastId:t.toastId||e,updateId:el()};s.toastId!==e&&(s.staleId=e);const i=s.render||o;delete s.render,no(i,s)}},Ie.done=e=>{Ie.update(e,{progress:1})},Ie.onChange=function(e){return Ti.add(e),()=>{Ti.delete(e)}},Ie.play=e=>Kc(!0,e),Ie.pause=e=>Kc(!1,e);const f1=typeof window<"u"?_.useLayoutEffect:_.useEffect,Yo=e=>{let{theme:t,type:n,isLoading:r,...o}=e;return _.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...o})},Si={info:function(e){return _.createElement(Yo,{...e},_.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return _.createElement(Yo,{...e},_.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return _.createElement(Yo,{...e},_.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return _.createElement(Yo,{...e},_.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return _.createElement("div",{className:"Toastify__spinner"})}},p1=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o,playToast:s}=c1(e),{closeButton:i,children:a,autoClose:l,onClick:c,type:u,hideProgressBar:p,closeToast:g,transition:E,position:y,className:d,style:f,bodyClassName:h,bodyStyle:v,progressClassName:C,progressStyle:I,updateId:x,role:w,progress:T,rtl:A,toastId:S,deleteToast:F,isIn:D,isLoading:k,closeOnClick:M,theme:j}=e,H=mn("Toastify__toast",`Toastify__toast-theme--${j}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":A},{"Toastify__toast--close-on-click":M}),z=Et(d)?d({rtl:A,position:y,type:u,defaultClassName:H}):mn(H,d),U=function(ue){let{theme:B,type:W,isLoading:V,icon:X}=ue,$=null;const ee={theme:B,type:W};return X===!1||(Et(X)?$=X({...ee,isLoading:V}):_.isValidElement(X)?$=_.cloneElement(X,ee):V?$=Si.spinner():(re=>re in Si)(W)&&($=Si[W](ee))),$}(e),J=!!T||!l,Y={closeToast:g,type:u,theme:j};let ae=null;return i===!1||(ae=Et(i)?i(Y):_.isValidElement(i)?_.cloneElement(i,Y):function(ue){let{closeToast:B,theme:W,ariaLabel:V="close"}=ue;return _.createElement("button",{className:`Toastify__close-button Toastify__close-button--${W}`,type:"button",onClick:X=>{X.stopPropagation(),B(X)},"aria-label":V},_.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},_.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(Y)),_.createElement(E,{isIn:D,done:F,position:y,preventExitTransition:n,nodeRef:r,playToast:s},_.createElement("div",{id:S,onClick:c,"data-in":D,className:z,...o,style:f,ref:r},_.createElement("div",{...D&&{role:w},className:Et(h)?h({type:u}):mn("Toastify__toast-body",h),style:v},U!=null&&_.createElement("div",{className:mn("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!k})},U),_.createElement("div",null,a)),ae,_.createElement(l1,{...x&&!J?{key:`pb-${x}`}:{},rtl:A,theme:j,delay:l,isRunning:t,isIn:D,closeToast:g,hide:p,type:u,style:I,className:C,controlledProgress:J,progress:T||0})))},Jo=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},h1=Zo(Jo("bounce",!0));Zo(Jo("slide",!0)),Zo(Jo("zoom")),Zo(Jo("flip"));const g1={position:"top-right",transition:h1,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function tl(e){let t={...g1,...e};const n=e.stacked,[r,o]=_.useState(!0),s=_.useRef(null),{getToastToRender:i,isToastActive:a,count:l}=a1(t),{className:c,style:u,rtl:p,containerId:g}=t;function E(d){const f=mn("Toastify__toast-container",`Toastify__toast-container--${d}`,{"Toastify__toast-container--rtl":p});return Et(c)?c({position:d,rtl:p,defaultClassName:f}):mn(f,Wo(c))}function y(){n&&(o(!0),Ie.play())}return f1(()=>{if(n){var d;const f=s.current.querySelectorAll('[data-in="true"]'),h=12,v=(d=t.position)==null?void 0:d.includes("top");let C=0,I=0;Array.from(f).reverse().forEach((x,w)=>{const T=x;T.classList.add("Toastify__toast--stacked"),w>0&&(T.dataset.collapsed=`${r}`),T.dataset.pos||(T.dataset.pos=v?"top":"bot");const A=C*(r?.2:1)+(r?0:h*w);T.style.setProperty("--y",`${v?A:-1*A}px`),T.style.setProperty("--g",`${h}`),T.style.setProperty("--s",""+(1-(r?I:0))),C+=T.offsetHeight,I+=.025})}},[r,l,n]),_.createElement("div",{ref:s,className:"Toastify",id:g,onMouseEnter:()=>{n&&(o(!1),Ie.pause())},onMouseLeave:y},i((d,f)=>{const h=f.length?{...u}:{...u,pointerEvents:"none"};return _.createElement("div",{className:E(d),style:h,key:`container-${d}`},f.map(v=>{let{content:C,props:I}=v;return _.createElement(p1,{...I,stacked:n,collapseAll:y,isIn:a(I.toastId,I.containerId),style:I.style,key:`toast-${I.key}`},C)}))}))}const Li=(e,t)=>t.some(n=>e instanceof n);let nl,rl;function m1(){return nl||(nl=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function b1(){return rl||(rl=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Oi=new WeakMap,Di=new WeakMap,Qo=new WeakMap;function y1(e){const t=new Promise((n,r)=>{const o=()=>{e.removeEventListener("success",s),e.removeEventListener("error",i)},s=()=>{n(Pn(e.result)),o()},i=()=>{r(e.error),o()};e.addEventListener("success",s),e.addEventListener("error",i)});return Qo.set(t,e),t}function C1(e){if(Oi.has(e))return;const t=new Promise((n,r)=>{const o=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",i),e.removeEventListener("abort",i)},s=()=>{n(),o()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",s),e.addEventListener("error",i),e.addEventListener("abort",i)});Oi.set(e,t)}let Fi={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return Oi.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Pn(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function ol(e){Fi=e(Fi)}function v1(e){return b1().includes(e)?function(...t){return e.apply(ki(this),t),Pn(this.request)}:function(...t){return Pn(e.apply(ki(this),t))}}function x1(e){return typeof e=="function"?v1(e):(e instanceof IDBTransaction&&C1(e),Li(e,m1())?new Proxy(e,Fi):e)}function Pn(e){if(e instanceof IDBRequest)return y1(e);if(Di.has(e))return Di.get(e);const t=x1(e);return t!==e&&(Di.set(e,t),Qo.set(t,e)),t}const ki=e=>Qo.get(e);function E1(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(e,t),a=Pn(i);return r&&i.addEventListener("upgradeneeded",l=>{r(Pn(i.result),l.oldVersion,l.newVersion,Pn(i.transaction),l)}),n&&i.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{s&&l.addEventListener("close",()=>s()),o&&l.addEventListener("versionchange",c=>o(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const I1=["get","getKey","getAll","getAllKeys","count"],w1=["put","add","delete","clear"],Ni=new Map;function sl(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Ni.get(t))return Ni.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=w1.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(o||I1.includes(n)))return;const s=async function(i,...a){const l=this.transaction(i,o?"readwrite":"readonly");let c=l.store;return r&&(c=c.index(a.shift())),(await Promise.all([c[n](...a),o&&l.done]))[0]};return Ni.set(t,s),s}ol(e=>({...e,get:(t,n,r)=>sl(t,n)||e.get(t,n,r),has:(t,n)=>!!sl(t,n)||e.has(t,n)}));const A1=["continue","continuePrimaryKey","advance"],il={},Ri=new WeakMap,al=new WeakMap,_1={get(e,t){if(!A1.includes(t))return e[t];let n=il[t];return n||(n=il[t]=function(...r){Ri.set(this,al.get(this)[t](...r))}),n}};async function*T1(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,_1);for(al.set(n,t),Qo.set(n,ki(t));t;)yield n,t=await(Ri.get(n)||t.continue()),Ri.delete(n)}function cl(e,t){return t===Symbol.asyncIterator&&Li(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&Li(e,[IDBIndex,IDBObjectStore])}ol(e=>({...e,get(t,n,r){return cl(t,n)?T1:e.get(t,n,r)},has(t,n){return cl(t,n)||e.has(t,n)}}));const S1="connector-db",L1=1,qo={FEEDBACK:"feedback"},ro=`${qo.FEEDBACK}:data`,$o=`${qo.FEEDBACK}:last_submitted`,oo=`${qo.FEEDBACK}:capture_on_demand`,so=`${qo.FEEDBACK}:show_notification`,O1=12*60*60*1e3,Mi=(e,t=new Date)=>e?Math.abs(t.getTime()-e.getTime())>=O1:!0,ll=(e,t=!1)=>e.captureFeedback&&(Mi(e.firstViewed)&&(!e.lastSubmittedFeedback||Mi(e.lastSubmittedFeedback))||!!t);let Bn=null;const bn=async()=>{try{Bn||(Bn=await E1(S1,L1,{upgrade(e){e.objectStoreNames.contains(ro)||e.createObjectStore(ro),e.objectStoreNames.contains($o)||e.createObjectStore($o),e.objectStoreNames.contains(oo)||e.createObjectStore(oo),e.objectStoreNames.contains(so)||e.createObjectStore(so)},blocked(){console.warn("Upgrade blocked! Close other tabs using this DB.")},blocking(){console.warn("Another tab is trying to upgrade. Closing connection to allow upgrade."),Bn&&(Bn.close(),Bn=null)},terminated(){console.error("DB connection unexpectedly closed. Resetting connection."),Bn=null}}))}catch(e){console.error("Error opening IndexedDB connection:",e)}return Bn},Pi=async e=>{if(!e)return[];const t=await bn();if(!t)return[];try{return await t.get(ro,e)||[]}catch(n){return console.error("Error fetching user feedback data:",n),[]}},D1=async e=>{if(!e)return null;const t=await bn();if(!t)return null;try{return await t.get($o,e)||null}catch(n){return console.error("Error fetching last submitted feedback:",n),null}},Uo=async e=>{if(!e)return;const t=await bn();if(t)try{return await t.get(oo,e)}catch(n){console.error("Error fetching capture on demand status:",n);return}},F1=async e=>{if(!e)return!1;const t=await bn();if(!t)return!1;try{return await t.get(so,e)??!1}catch(n){return console.error("Error fetching show notification status:",n),!1}},k1=async(e,t)=>{if(!e||!t||!t.length)return;const n=await bn();if(n)try{const r=await Pi(e),o=new Set(r.map(i=>i.connectorId)),s=t.filter(i=>!o.has(i.connector_id)).map(i=>({connectorId:i.connector_id,captureFeedback:!0,firstViewed:new Date}));if(s.length>0){const i=[...r,...s];await n.put(ro,i,e),await n.put(so,!0,e)}}catch(r){console.error("Error updating connectors feedback data:",r)}},N1=async e=>{if(!e)return;const t=await bn();if(t)try{const n=await Pi(e),r=await Uo(e),o=new Date,s=n.map(i=>{const a=ll(i,r);return{...i,lastSubmittedFeedback:a?o:i.lastSubmittedFeedback,captureFeedback:i.captureFeedback!==a}});await t.put(ro,s,e),await t.put($o,o,e),r&&await t.put(oo,!1,e)}catch(n){console.error("Error updating feedback submission date:",n)}},ul=async(e,t)=>{if(!e)return;const n=await bn();if(n)try{await n.put(oo,t,e)}catch(r){console.error("Error updating capture on demand:",r)}},R1=async e=>{if(!e)return;const t=await bn();if(t)try{await t.put(so,!1,e)}catch(n){console.error("Error resetting show notification status:",n)}},M1=async e=>{const t=await Pi(e),n=await Uo(e);return t.filter(o=>ll(o,n))},Bi=async e=>{const t=await D1(e);return t&&!Mi(t)?!1:await Uo(e)&&!t?!0:!!(await M1(e)).length},P1=async(e,t)=>{await k1(e,t)},Ko=async e=>{e&&await N1(e)},B1=async(e,t)=>{const n=await Uo(e);t?n!==!1&&await ul(e,t):await ul(e,void 0)},dl=async e=>await F1(e)&&await Bi(e),fl=async e=>{await R1(e)};var ji={},jn={};function pl(e,t){return function(){return e.apply(t,arguments)}}const{toString:j1}=Object.prototype,{getPrototypeOf:Vi}=Object,es=(e=>t=>{const n=j1.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Rt=e=>(e=e.toLowerCase(),t=>es(t)===e),ts=e=>t=>typeof t===e,{isArray:fr}=Array,io=ts("undefined");function V1(e){return e!==null&&!io(e)&&e.constructor!==null&&!io(e.constructor)&&It(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const hl=Rt("ArrayBuffer");function G1(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&hl(e.buffer),t}const H1=ts("string"),It=ts("function"),gl=ts("number"),ns=e=>e!==null&&typeof e=="object",W1=e=>e===!0||e===!1,rs=e=>{if(es(e)!=="object")return!1;const t=Vi(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Z1=Rt("Date"),X1=Rt("File"),z1=Rt("Blob"),Y1=Rt("FileList"),J1=e=>ns(e)&&It(e.pipe),Q1=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||It(e.append)&&((t=es(e))==="formdata"||t==="object"&&It(e.toString)&&e.toString()==="[object FormData]"))},q1=Rt("URLSearchParams"),[$1,U1,K1,e2]=["ReadableStream","Request","Response","Headers"].map(Rt),t2=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ao(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),fr(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let a;for(r=0;r<i;r++)a=s[r],t.call(null,e[a],a,e)}}function ml(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const Vn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:fe,bl=e=>!io(e)&&e!==Vn;function Gi(){const{caseless:e}=bl(this)&&this||{},t={},n=(r,o)=>{const s=e&&ml(t,o)||o;rs(t[s])&&rs(r)?t[s]=Gi(t[s],r):rs(r)?t[s]=Gi({},r):fr(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&ao(arguments[r],n);return t}const n2=(e,t,n,{allOwnKeys:r}={})=>(ao(t,(o,s)=>{n&&It(o)?e[s]=pl(o,n):e[s]=o},{allOwnKeys:r}),e),r2=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),o2=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},s2=(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&Vi(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},i2=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},a2=e=>{if(!e)return null;if(fr(e))return e;let t=e.length;if(!gl(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},c2=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Vi(Uint8Array)),l2=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},u2=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},d2=Rt("HTMLFormElement"),f2=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),yl=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),p2=Rt("RegExp"),Cl=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ao(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},h2=e=>{Cl(e,(t,n)=>{if(It(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(It(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},g2=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return fr(e)?r(e):r(String(e).split(t)),n},m2=()=>{},b2=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Hi="abcdefghijklmnopqrstuvwxyz",vl="0123456789",xl={DIGIT:vl,ALPHA:Hi,ALPHA_DIGIT:Hi+Hi.toUpperCase()+vl},y2=(e=16,t=xl.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function C2(e){return!!(e&&It(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const v2=e=>{const t=new Array(10),n=(r,o)=>{if(ns(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=fr(r)?[]:{};return ao(r,(i,a)=>{const l=n(i,o+1);!io(l)&&(s[a]=l)}),t[o]=void 0,s}}return r};return n(e,0)},x2=Rt("AsyncFunction"),E2=e=>e&&(ns(e)||It(e))&&It(e.then)&&It(e.catch),El=((e,t)=>e?setImmediate:t?((n,r)=>(Vn.addEventListener("message",({source:o,data:s})=>{o===Vn&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Vn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",It(Vn.postMessage)),I2=typeof queueMicrotask<"u"?queueMicrotask.bind(Vn):typeof process<"u"&&process.nextTick||El;var R={isArray:fr,isArrayBuffer:hl,isBuffer:V1,isFormData:Q1,isArrayBufferView:G1,isString:H1,isNumber:gl,isBoolean:W1,isObject:ns,isPlainObject:rs,isReadableStream:$1,isRequest:U1,isResponse:K1,isHeaders:e2,isUndefined:io,isDate:Z1,isFile:X1,isBlob:z1,isRegExp:p2,isFunction:It,isStream:J1,isURLSearchParams:q1,isTypedArray:c2,isFileList:Y1,forEach:ao,merge:Gi,extend:n2,trim:t2,stripBOM:r2,inherits:o2,toFlatObject:s2,kindOf:es,kindOfTest:Rt,endsWith:i2,toArray:a2,forEachEntry:l2,matchAll:u2,isHTMLForm:d2,hasOwnProperty:yl,hasOwnProp:yl,reduceDescriptors:Cl,freezeMethods:h2,toObjectSet:g2,toCamelCase:f2,noop:m2,toFiniteNumber:b2,findKey:ml,global:Vn,isContextDefined:bl,ALPHABET:xl,generateString:y2,isSpecCompliantForm:C2,toJSONObject:v2,isAsyncFn:x2,isThenable:E2,setImmediate:El,asap:I2};function pe(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}R.inherits(pe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:R.toJSONObject(this.config),code:this.code,status:this.status}}});const Il=pe.prototype,wl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{wl[e]={value:e}}),Object.defineProperties(pe,wl),Object.defineProperty(Il,"isAxiosError",{value:!0}),pe.from=(e,t,n,r,o,s)=>{const i=Object.create(Il);return R.toFlatObject(e,i,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),pe.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};var w2=null;function Wi(e){return R.isPlainObject(e)||R.isArray(e)}function Al(e){return R.endsWith(e,"[]")?e.slice(0,-2):e}function _l(e,t,n){return e?e.concat(t).map(function(o,s){return o=Al(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function A2(e){return R.isArray(e)&&!e.some(Wi)}const _2=R.toFlatObject(R,{},null,function(t){return/^is[A-Z]/.test(t)});function os(e,t,n){if(!R.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=R.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(d,f){return!R.isUndefined(f[d])});const r=n.metaTokens,o=n.visitor||u,s=n.dots,i=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&R.isSpecCompliantForm(t);if(!R.isFunction(o))throw new TypeError("visitor must be a function");function c(y){if(y===null)return"";if(R.isDate(y))return y.toISOString();if(!l&&R.isBlob(y))throw new pe("Blob is not supported. Use a Buffer instead.");return R.isArrayBuffer(y)||R.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function u(y,d,f){let h=y;if(y&&!f&&typeof y=="object"){if(R.endsWith(d,"{}"))d=r?d:d.slice(0,-2),y=JSON.stringify(y);else if(R.isArray(y)&&A2(y)||(R.isFileList(y)||R.endsWith(d,"[]"))&&(h=R.toArray(y)))return d=Al(d),h.forEach(function(C,I){!(R.isUndefined(C)||C===null)&&t.append(i===!0?_l([d],I,s):i===null?d:d+"[]",c(C))}),!1}return Wi(y)?!0:(t.append(_l(f,d,s),c(y)),!1)}const p=[],g=Object.assign(_2,{defaultVisitor:u,convertValue:c,isVisitable:Wi});function E(y,d){if(!R.isUndefined(y)){if(p.indexOf(y)!==-1)throw Error("Circular reference detected in "+d.join("."));p.push(y),R.forEach(y,function(h,v){(!(R.isUndefined(h)||h===null)&&o.call(t,h,R.isString(v)?v.trim():v,d,g))===!0&&E(h,d?d.concat(v):[v])}),p.pop()}}if(!R.isObject(e))throw new TypeError("data must be an object");return E(e),t}function Tl(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Zi(e,t){this._pairs=[],e&&os(e,this,t)}const Sl=Zi.prototype;Sl.append=function(t,n){this._pairs.push([t,n])},Sl.toString=function(t){const n=t?function(r){return t.call(this,r,Tl)}:Tl;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function T2(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ll(e,t,n){if(!t)return e;const r=n&&n.encode||T2,o=n&&n.serialize;let s;if(o?s=o(t,n):s=R.isURLSearchParams(t)?t.toString():new Zi(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class S2{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){R.forEach(this.handlers,function(r){r!==null&&t(r)})}}var Ol=S2,Dl={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},L2=typeof URLSearchParams<"u"?URLSearchParams:Zi,O2=typeof FormData<"u"?FormData:null,D2=typeof Blob<"u"?Blob:null,F2={isBrowser:!0,classes:{URLSearchParams:L2,FormData:O2,Blob:D2},protocols:["http","https","file","blob","url","data"]};const Xi=typeof window<"u"&&typeof document<"u",zi=typeof navigator=="object"&&navigator||void 0,k2=Xi&&(!zi||["ReactNative","NativeScript","NS"].indexOf(zi.product)<0),N2=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",R2=Xi&&window.location.href||"http://localhost";var M2=Object.freeze({__proto__:null,hasBrowserEnv:Xi,hasStandardBrowserWebWorkerEnv:N2,hasStandardBrowserEnv:k2,navigator:zi,origin:R2}),dt={...M2,...F2};function P2(e,t){return os(e,new dt.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return dt.isNode&&R.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function B2(e){return R.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function j2(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function Fl(e){function t(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),l=s>=n.length;return i=!i&&R.isArray(o)?o.length:i,l?(R.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!a):((!o[i]||!R.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&R.isArray(o[i])&&(o[i]=j2(o[i])),!a)}if(R.isFormData(e)&&R.isFunction(e.entries)){const n={};return R.forEachEntry(e,(r,o)=>{t(B2(r),o,n,0)}),n}return null}function V2(e,t,n){if(R.isString(e))try{return(t||JSON.parse)(e),R.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Yi={transitional:Dl,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=R.isObject(t);if(s&&R.isHTMLForm(t)&&(t=new FormData(t)),R.isFormData(t))return o?JSON.stringify(Fl(t)):t;if(R.isArrayBuffer(t)||R.isBuffer(t)||R.isStream(t)||R.isFile(t)||R.isBlob(t)||R.isReadableStream(t))return t;if(R.isArrayBufferView(t))return t.buffer;if(R.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return P2(t,this.formSerializer).toString();if((a=R.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return os(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),V2(t)):t}],transformResponse:[function(t){const n=this.transitional||Yi.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(R.isResponse(t)||R.isReadableStream(t))return t;if(t&&R.isString(t)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(i)throw a.name==="SyntaxError"?pe.from(a,pe.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:dt.classes.FormData,Blob:dt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};R.forEach(["delete","get","head","post","put","patch"],e=>{Yi.headers[e]={}});var Ji=Yi;const G2=R.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var H2=e=>{const t={};let n,r,o;return e&&e.split(`
31
31
  `).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&G2[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t};const kl=Symbol("internals");function co(e){return e&&String(e).trim().toLowerCase()}function ss(e){return e===!1||e==null?e:R.isArray(e)?e.map(ss):String(e)}function W2(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Z2=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Qi(e,t,n,r,o){if(R.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!R.isString(t)){if(R.isString(r))return t.indexOf(r)!==-1;if(R.isRegExp(r))return r.test(t)}}function X2(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function z2(e,t){const n=R.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,s,i){return this[r].call(this,t,o,s,i)},configurable:!0})})}class is{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(a,l,c){const u=co(l);if(!u)throw new Error("header name must be a non-empty string");const p=R.findKey(o,u);(!p||o[p]===void 0||c===!0||c===void 0&&o[p]!==!1)&&(o[p||l]=ss(a))}const i=(a,l)=>R.forEach(a,(c,u)=>s(c,u,l));if(R.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(R.isString(t)&&(t=t.trim())&&!Z2(t))i(H2(t),n);else if(R.isHeaders(t))for(const[a,l]of t.entries())s(l,a,r);else t!=null&&s(n,t,r);return this}get(t,n){if(t=co(t),t){const r=R.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return W2(o);if(R.isFunction(n))return n.call(this,o,r);if(R.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=co(t),t){const r=R.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Qi(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=co(i),i){const a=R.findKey(r,i);a&&(!n||Qi(r,r[a],a,n))&&(delete r[a],o=!0)}}return R.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!t||Qi(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return R.forEach(this,(o,s)=>{const i=R.findKey(r,s);if(i){n[i]=ss(o),delete n[s];return}const a=t?X2(s):String(s).trim();a!==s&&delete n[s],n[a]=ss(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return R.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&R.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
32
32
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[kl]=this[kl]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=co(i);r[a]||(z2(o,i),r[a]=!0)}return R.isArray(t)?t.forEach(s):s(t),this}}is.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),R.reduceDescriptors(is.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),R.freezeMethods(is);var Mt=is;function qi(e,t){const n=this||Ji,r=t||n,o=Mt.from(r.headers);let s=r.data;return R.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Nl(e){return!!(e&&e.__CANCEL__)}function pr(e,t,n){pe.call(this,e??"canceled",pe.ERR_CANCELED,t,n),this.name="CanceledError"}R.inherits(pr,pe,{__CANCEL__:!0});function Rl(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new pe("Request failed with status code "+n.status,[pe.ERR_BAD_REQUEST,pe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Y2(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function J2(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[s];i||(i=c),n[o]=l,r[o]=c;let p=s,g=0;for(;p!==o;)g+=n[p++],p=p%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i<t)return;const E=u&&c-u;return E?Math.round(g*1e3/E):void 0}}function Q2(e,t){let n=0,r=1e3/t,o,s;const i=(c,u=Date.now())=>{n=u,o=null,s&&(clearTimeout(s),s=null),e.apply(null,c)};return[(...c)=>{const u=Date.now(),p=u-n;p>=r?i(c,u):(o=c,s||(s=setTimeout(()=>{s=null,i(o)},r-p)))},()=>o&&i(o)]}const as=(e,t,n=3)=>{let r=0;const o=J2(50,250);return Q2(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,l=i-r,c=o(l),u=i<=a;r=i;const p={loaded:i,total:a,progress:a?i/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-i)/c:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(p)},n)},Ml=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Pl=e=>(...t)=>R.asap(()=>e(...t));var q2=dt.hasStandardBrowserEnv?function(){const t=dt.navigator&&/(msie|trident)/i.test(dt.navigator.userAgent),n=document.createElement("a");let r;function o(s){let i=s;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(i){const a=R.isString(i)?o(i):i;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),$2=dt.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];R.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),R.isString(r)&&i.push("path="+r),R.isString(o)&&i.push("domain="+o),s===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function U2(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function K2(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Bl(e,t){return e&&!U2(t)?K2(e,t):t}const jl=e=>e instanceof Mt?{...e}:e;function Gn(e,t){t=t||{};const n={};function r(c,u,p){return R.isPlainObject(c)&&R.isPlainObject(u)?R.merge.call({caseless:p},c,u):R.isPlainObject(u)?R.merge({},u):R.isArray(u)?u.slice():u}function o(c,u,p){if(R.isUndefined(u)){if(!R.isUndefined(c))return r(void 0,c,p)}else return r(c,u,p)}function s(c,u){if(!R.isUndefined(u))return r(void 0,u)}function i(c,u){if(R.isUndefined(u)){if(!R.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,p){if(p in t)return r(c,u);if(p in e)return r(void 0,c)}const l={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(c,u)=>o(jl(c),jl(u),!0)};return R.forEach(Object.keys(Object.assign({},e,t)),function(u){const p=l[u]||o,g=p(e[u],t[u],u);R.isUndefined(g)&&p!==a||(n[u]=g)}),n}var Vl=e=>{const t=Gn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;t.headers=i=Mt.from(i),t.url=Ll(Bl(t.baseURL,t.url),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(R.isFormData(n)){if(dt.hasStandardBrowserEnv||dt.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((l=i.getContentType())!==!1){const[c,...u]=l?l.split(";").map(p=>p.trim()).filter(Boolean):[];i.setContentType([c||"multipart/form-data",...u].join("; "))}}if(dt.hasStandardBrowserEnv&&(r&&R.isFunction(r)&&(r=r(t)),r||r!==!1&&q2(t.url))){const c=o&&s&&$2.read(s);c&&i.set(o,c)}return t},eh=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=Vl(e);let s=o.data;const i=Mt.from(o.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=o,u,p,g,E,y;function d(){E&&E(),y&&y(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let f=new XMLHttpRequest;f.open(o.method.toUpperCase(),o.url,!0),f.timeout=o.timeout;function h(){if(!f)return;const C=Mt.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),x={data:!a||a==="text"||a==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:C,config:e,request:f};Rl(function(T){n(T),d()},function(T){r(T),d()},x),f=null}"onloadend"in f?f.onloadend=h:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(h)},f.onabort=function(){f&&(r(new pe("Request aborted",pe.ECONNABORTED,e,f)),f=null)},f.onerror=function(){r(new pe("Network Error",pe.ERR_NETWORK,e,f)),f=null},f.ontimeout=function(){let I=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const x=o.transitional||Dl;o.timeoutErrorMessage&&(I=o.timeoutErrorMessage),r(new pe(I,x.clarifyTimeoutError?pe.ETIMEDOUT:pe.ECONNABORTED,e,f)),f=null},s===void 0&&i.setContentType(null),"setRequestHeader"in f&&R.forEach(i.toJSON(),function(I,x){f.setRequestHeader(x,I)}),R.isUndefined(o.withCredentials)||(f.withCredentials=!!o.withCredentials),a&&a!=="json"&&(f.responseType=o.responseType),c&&([g,y]=as(c,!0),f.addEventListener("progress",g)),l&&f.upload&&([p,E]=as(l),f.upload.addEventListener("progress",p),f.upload.addEventListener("loadend",E)),(o.cancelToken||o.signal)&&(u=C=>{f&&(r(!C||C.type?new pr(null,e,f):C),f.abort(),f=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const v=Y2(o.url);if(v&&dt.protocols.indexOf(v)===-1){r(new pe("Unsupported protocol "+v+":",pe.ERR_BAD_REQUEST,e));return}f.send(s||null)})},th=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const s=function(c){if(!o){o=!0,a();const u=c instanceof Error?c:this.reason;r.abort(u instanceof pe?u:new pr(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,s(new pe(`timeout ${t} of ms exceeded`,pe.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>R.asap(a),l}};const nh=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},rh=async function*(e,t){for await(const n of oh(e))yield*nh(n,t)},oh=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Gl=(e,t,n,r)=>{const o=rh(e,t);let s=0,i,a=l=>{i||(i=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await o.next();if(c){a(),l.close();return}let p=u.byteLength;if(n){let g=s+=p;n(g)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),o.return()}},{highWaterMark:2})},cs=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Hl=cs&&typeof ReadableStream=="function",sh=cs&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Wl=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ih=Hl&&Wl(()=>{let e=!1;const t=new Request(dt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Zl=64*1024,$i=Hl&&Wl(()=>R.isReadableStream(new Response("").body)),ls={stream:$i&&(e=>e.body)};cs&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ls[t]&&(ls[t]=R.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new pe(`Response type '${t}' is not supported`,pe.ERR_NOT_SUPPORT,r)})})})(new Response);const ah=async e=>{if(e==null)return 0;if(R.isBlob(e))return e.size;if(R.isSpecCompliantForm(e))return(await new Request(dt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(R.isArrayBufferView(e)||R.isArrayBuffer(e))return e.byteLength;if(R.isURLSearchParams(e)&&(e=e+""),R.isString(e))return(await sh(e)).byteLength},ch=async(e,t)=>{const n=R.toFiniteNumber(e.getContentLength());return n??ah(t)};var lh=cs&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:p="same-origin",fetchOptions:g}=Vl(e);c=c?(c+"").toLowerCase():"text";let E=th([o,s&&s.toAbortSignal()],i),y;const d=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let f;try{if(l&&ih&&n!=="get"&&n!=="head"&&(f=await ch(u,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),w;if(R.isFormData(r)&&(w=x.headers.get("content-type"))&&u.setContentType(w),x.body){const[T,A]=Ml(f,as(Pl(l)));r=Gl(x.body,Zl,T,A)}}R.isString(p)||(p=p?"include":"omit");const h="credentials"in Request.prototype;y=new Request(t,{...g,signal:E,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:h?p:void 0});let v=await fetch(y);const C=$i&&(c==="stream"||c==="response");if($i&&(a||C&&d)){const x={};["status","statusText","headers"].forEach(S=>{x[S]=v[S]});const w=R.toFiniteNumber(v.headers.get("content-length")),[T,A]=a&&Ml(w,as(Pl(a),!0))||[];v=new Response(Gl(v.body,Zl,T,()=>{A&&A(),d&&d()}),x)}c=c||"text";let I=await ls[R.findKey(ls,c)||"text"](v,e);return!C&&d&&d(),await new Promise((x,w)=>{Rl(x,w,{data:I,headers:Mt.from(v.headers),status:v.status,statusText:v.statusText,config:e,request:y})})}catch(h){throw d&&d(),h&&h.name==="TypeError"&&/fetch/i.test(h.message)?Object.assign(new pe("Network Error",pe.ERR_NETWORK,e,y),{cause:h.cause||h}):pe.from(h,h&&h.code,e,y)}});const Ui={http:w2,xhr:eh,fetch:lh};R.forEach(Ui,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Xl=e=>`- ${e}`,uh=e=>R.isFunction(e)||e===null||e===!1;var zl={getAdapter:e=>{e=R.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){n=e[s];let i;if(r=n,!uh(n)&&(r=Ui[(i=String(n)).toLowerCase()],r===void 0))throw new pe(`Unknown adapter '${i}'`);if(r)break;o[i||"#"+s]=r}if(!r){const s=Object.entries(o).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let i=t?s.length>1?`since :
33
33
  `+s.map(Xl).join(`
34
- `):" "+Xl(s[0]):"as no adapter specified";throw new pe("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:Ui};function Ki(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new pr(null,e)}function Yl(e){return Ki(e),e.headers=Mt.from(e.headers),e.data=qi.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),zl.getAdapter(e.adapter||Ji.adapter)(e).then(function(r){return Ki(e),r.data=qi.call(e,e.transformResponse,r),r.headers=Mt.from(r.headers),r},function(r){return Nl(r)||(Ki(e),r&&r.response&&(r.response.data=qi.call(e,e.transformResponse,r.response),r.response.headers=Mt.from(r.response.headers))),Promise.reject(r)})}const Jl="1.7.7",ea={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ea[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ql={};ea.transitional=function(t,n,r){function o(s,i){return"[Axios v"+Jl+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new pe(o(i," has been removed"+(n?" in "+n:"")),pe.ERR_DEPRECATED);return n&&!Ql[i]&&(Ql[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,i,a):!0}};function dh(e,t,n){if(typeof e!="object")throw new pe("options must be an object",pe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const a=e[s],l=a===void 0||i(a,s,e);if(l!==!0)throw new pe("option "+s+" must be "+l,pe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new pe("Unknown option "+s,pe.ERR_BAD_OPTION)}}var ta={assertOptions:dh,validators:ea};const bn=ta.validators;let us=class{constructor(t){this.defaults=t,this.interceptors={request:new Ol,response:new Ol}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
35
- `+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Gn(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&ta.assertOptions(r,{silentJSONParsing:bn.transitional(bn.boolean),forcedJSONParsing:bn.transitional(bn.boolean),clarifyTimeoutError:bn.transitional(bn.boolean)},!1),o!=null&&(R.isFunction(o)?n.paramsSerializer={serialize:o}:ta.assertOptions(o,{encode:bn.function,serialize:bn.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&R.merge(s.common,s[n.method]);s&&R.forEach(["delete","get","head","post","put","patch","common"],y=>{delete s[y]}),n.headers=Mt.concat(i,s);const a=[];let l=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(n)===!1||(l=l&&d.synchronous,a.unshift(d.fulfilled,d.rejected))});const c=[];this.interceptors.response.forEach(function(d){c.push(d.fulfilled,d.rejected)});let u,p=0,g;if(!l){const y=[Yl.bind(this),void 0];for(y.unshift.apply(y,a),y.push.apply(y,c),g=y.length,u=Promise.resolve(n);p<g;)u=u.then(y[p++],y[p++]);return u}g=a.length;let E=n;for(p=0;p<g;){const y=a[p++],d=a[p++];try{E=y(E)}catch(f){d.call(this,f);break}}try{u=Yl.call(this,E)}catch(y){return Promise.reject(y)}for(p=0,g=c.length;p<g;)u=u.then(c[p++],c[p++]);return u}getUri(t){t=Gn(this.defaults,t);const n=Bl(t.baseURL,t.url);return Ll(n,t.params,t.paramsSerializer)}};R.forEach(["delete","get","head","options"],function(t){us.prototype[t]=function(n,r){return this.request(Gn(r||{},{method:t,url:n,data:(r||{}).data}))}}),R.forEach(["post","put","patch"],function(t){function n(r){return function(s,i,a){return this.request(Gn(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}us.prototype[t]=n(),us.prototype[t+"Form"]=n(!0)});var ds=us;class na{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,a){r.reason||(r.reason=new pr(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new na(function(o){t=o}),cancel:t}}}var fh=na;function ph(e){return function(n){return e.apply(null,n)}}function hh(e){return R.isObject(e)&&e.isAxiosError===!0}const ra={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ra).forEach(([e,t])=>{ra[t]=e});var gh=ra;function ql(e){const t=new ds(e),n=pl(ds.prototype.request,t);return R.extend(n,ds.prototype,t,{allOwnKeys:!0}),R.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return ql(Gn(e,o))},n}const He=ql(Ji);He.Axios=ds,He.CanceledError=pr,He.CancelToken=fh,He.isCancel=Nl,He.VERSION=Jl,He.toFormData=os,He.AxiosError=pe,He.Cancel=He.CanceledError,He.all=function(t){return Promise.all(t)},He.spread=ph,He.isAxiosError=hh,He.mergeConfig=Gn,He.AxiosHeaders=Mt,He.formToJSON=e=>Fl(R.isHTMLForm(e)?new FormData(e):e),He.getAdapter=zl.getAdapter,He.HttpStatusCode=gh,He.default=He;var $l=He,ve={},yn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PLATFORM=e.TENANT_PLATFORM=e.API_CALL_ORIGIN=e.TIERS=e.APP_UI=e.CONFIG_HIVER=e.DEFAULT_INIT_CONFIG_HIVER=e.TWO_MINUTES_IN_MS=e.REFETCH_CHECK_DELAY=e.RETRY_DELAY_IN_CASE_OF_CORRUPTED_EXPIRY=e.INITIAL_RETRY_DELAY=e.MAX_BACKOFF_LIMIT=e.MAX_CONFLICT_RETRY_DELAY=e.MAX_RETRY_DELAY=e.GET_METHOD=void 0,e.GET_METHOD="GET",e.MAX_RETRY_DELAY=18e4,e.MAX_CONFLICT_RETRY_DELAY=63e3,e.MAX_BACKOFF_LIMIT=8e3,e.INITIAL_RETRY_DELAY=1e3,e.RETRY_DELAY_IN_CASE_OF_CORRUPTED_EXPIRY=3e3,e.REFETCH_CHECK_DELAY=168e4,e.TWO_MINUTES_IN_MS=2*60*1e3,e.DEFAULT_INIT_CONFIG_HIVER={getToken:!0,isHiverApiDomain:!0,fetchCsrfToken:function(){return""}},e.CONFIG_HIVER={getToken:!1,fetchCsrfToken:function(){return""},isHiverApiDomain:!0},e.APP_UI={COLLAB_SPACE:"collab-space",DEFAULT:"default"},e.TIERS={DEV:"dev",SIT:"sit",QA:"qa",PRODUCTION:"production",PROD:"prod"},e.API_CALL_ORIGIN={API_RETRY:"Api Retry"},e.TENANT_PLATFORM={GMAIL:"GMAIL",HIVERWEB:"HIVERWEB"},function(t){t[t.WEB=0]="WEB",t[t.MOBILE=1]="MOBILE"}(e.PLATFORM||(e.PLATFORM={}))})(yn);var ft={};Object.defineProperty(ft,"__esModule",{value:!0}),ft.getProdHqConfig=ft.getProdApiConfig=ft.getSitHqConfig=ft.getSitApiConfig=ft.getDevHqConfig=ft.getDevApiConfig=void 0;var hr={heimdallTokenFetch:"/v1/token/get",heimdallLogin:"/v1/login/code",heimdallLogout:"/v1/logout",v2Login:"/api/auth/login/code",hotLogin:"/api/auth/login/code"},mh=function(){return{v2Url:"https://v2dev.hiver.space",heimdallUrl:"https://dev.hiver.space/api/heimdall-api",hotUrl:"http://local.hiverhq.co.in:3000",apiEndpoints:hr}};ft.getDevApiConfig=mh;var bh=function(){return{v2Url:"https://v2dev.hiver.space",heimdallUrl:"https://dev.hiver.space/api/heimdall-api2",hotUrl:"http://local.hiverhq.co.in:3000",apiEndpoints:hr}};ft.getDevHqConfig=bh;var yh=function(e){return{v2Url:"https://v2".concat(e,".hiver.space"),heimdallUrl:"https://".concat(e,".hiver.space/api/heimdall-api"),hotUrl:"https://api-staging.hiverhq.co.in",apiEndpoints:hr}};ft.getSitApiConfig=yh;var Ch=function(e){return{v2Url:"https://v2".concat(e,".hiver.space"),heimdallUrl:"https://".concat(e,".hiver.space/api/heimdall-api2"),hotUrl:"https://api-staging.hiverhq.co.in",apiEndpoints:hr}};ft.getSitHqConfig=Ch;var vh=function(){return{v2Url:"https://v2.hiverhq.com",heimdallUrl:"https://heimdall.hiverapi.com",hotUrl:"https://app.hiverhq.com",apiEndpoints:hr}};ft.getProdApiConfig=vh;var xh=function(){return{v2Url:"https://v2.hiverhq.com",heimdallUrl:"https://heimdall2.hiverhq.com",hotUrl:"https://app.hiverhq.com",apiEndpoints:hr}};ft.getProdHqConfig=xh;var Xt={},zt={};Object.defineProperty(zt,"__esModule",{value:!0}),zt.removeValue=zt.getValue=zt.setValue=void 0;var oa={};function Eh(e,t){oa[e]=t}zt.setValue=Eh;function Ih(e){return oa[e]}zt.getValue=Ih;function wh(e){delete oa[e]}zt.removeValue=wh,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.removeItemFromStorage=Xt.setItemInStorage=Xt.getItemFromStorage=void 0;var gr=yn,mr=zt,Ah=function(e,t){switch(t===void 0&&(t=(0,mr.getValue)("PLATFORM")),t){case gr.PLATFORM.WEB:return sessionStorage.getItem(e);case gr.PLATFORM.MOBILE:return(0,mr.getValue)(e);default:throw Error("Invalid PLATFORM ".concat(t))}};Xt.getItemFromStorage=Ah;var _h=function(e,t,n){switch(n===void 0&&(n=(0,mr.getValue)("PLATFORM")),n){case gr.PLATFORM.WEB:return sessionStorage.setItem(e,t);case gr.PLATFORM.MOBILE:return(0,mr.setValue)(e,t);default:throw Error("Invalid PLATFORM ".concat(n))}};Xt.setItemInStorage=_h;var Th=function(e,t){switch(t===void 0&&(t=(0,mr.getValue)("PLATFORM")),t){case gr.PLATFORM.WEB:sessionStorage.removeItem(e);break;case gr.PLATFORM.MOBILE:(0,mr.removeValue)(e);break;default:throw Error("Invalid PLATFORM ".concat(t))}};Xt.removeItemFromStorage=Th;var Sh=fe&&fe.__awaiter||function(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function a(u){try{c(r.next(u))}catch(p){i(p)}}function l(u){try{c(r.throw(u))}catch(p){i(p)}}function c(u){u.done?s(u.value):o(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})},Lh=fe&&fe.__generator||function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(n=0)),n;)try{if(r=1,o&&(s=c[0]&2?o.return:c[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,c[1])).done)return s;switch(o=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,o=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],o=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(ve,"__esModule",{value:!0}),ve.expireToken=ve.invalidateToken=ve.validateToken=ve.validateAccount=ve.getConfig=ve.introduceDelay=ve.isTokenInExpiryWindow=ve.getStoredAuthData=ve.setUserDetails=ve.getRefreshInterval=ve.setTokenAndExpiry=ve.getRandomDelay=ve.hasValidToken=void 0;var nn=yn,br=ft,wt=Xt,sa=function(){var e=new Date,t=new Date(e.getTime()+e.getTimezoneOffset()*6e4);return t},ia=function(e){var t=parseInt((0,wt.getItemFromStorage)("hiverAuthUserId")||"0"),n=parseInt((0,wt.getItemFromStorage)("hiverAuthUserGroupId")||"0"),r=e.userId,o=e.usergroupId;return t===r&&o===n};ve.validateAccount=ia;var Oh=function(e){var t=ia(e);return!Ul()&&t};ve.validateToken=Oh;var Dh=function(e){return e.apiRetry?e.apiRetry>0:!1};ve.invalidateToken=Dh;var Fh=function(){try{sessionStorage.removeItem("hiverAuthTokenExpiry")}catch{console.log("Heimdall: Unable to Remove token.")}};ve.expireToken=Fh;var kh=function(e){var t=(0,wt.getItemFromStorage)("hiverAuthTokenExpiry")||"",n=new Date(t),r=sa(),o=ia(e);return console.log("Heimdall: checking if there is a valid token",r<n&&o),r<n&&o};ve.hasValidToken=kh;var Nh=function(){return Math.floor(Math.random()*6e4)+6e4};ve.getRandomDelay=Nh;var Rh=function(e,t){if(!e||!t)throw new Error("User Id or user group Id not found in the response");(0,wt.setItemInStorage)("hiverAuthUserId",e),(0,wt.setItemInStorage)("hiverAuthUserGroupId",t)};ve.setUserDetails=Rh;var Mh=function(e,t){if(!e)throw new Error("Token not found in the response");(0,wt.setItemInStorage)("hiverAuthToken",e),(0,wt.setItemInStorage)("hiverAuthTokenExpiry",t)};ve.setTokenAndExpiry=Mh;var Ph=function(){var e=(0,wt.getItemFromStorage)("hiverAuthTokenExpiry"),t=(0,wt.getItemFromStorage)("hiverAuthToken"),n=(0,wt.getItemFromStorage)("hiverAuthUserId"),r=(0,wt.getItemFromStorage)("hiverAuthUserGroupId");return{token:t,expiryTime:e,userId:n,usergroupId:r}};ve.getStoredAuthData=Ph;var Ul=function(){var e=(0,wt.getItemFromStorage)("hiverAuthTokenExpiry")||"";if(!e)return!0;var t=sa(),n=new Date(e),r=4*60*1e3,o=n.getTime()-t.getTime()<r;return console.log({currentTime:t,expiry:n,isInExpiryWindow:o}),o};ve.isTokenInExpiryWindow=Ul;var Bh=function(e){return Sh(void 0,void 0,void 0,function(){return Lh(this,function(t){switch(t.label){case 0:return[4,new Promise(function(n){return setTimeout(n,e)})];case 1:return t.sent(),[2]}})})};ve.introduceDelay=Bh;var jh=function(e,t,n){switch(n===void 0&&(n=!0),t){case nn.TIERS.SIT:case nn.TIERS.QA:return n?(0,br.getSitApiConfig)(e):(0,br.getSitHqConfig)(e);case nn.TIERS.PRODUCTION:case nn.TIERS.PROD:return n?(0,br.getProdApiConfig)():(0,br.getProdHqConfig)();case nn.TIERS.DEV:default:return n?(0,br.getDevApiConfig)():(0,br.getDevHqConfig)()}};ve.getConfig=jh;var Vh=function(){try{var e=(0,wt.getItemFromStorage)("hiverAuthTokenExpiry");if(!e)return nn.RETRY_DELAY_IN_CASE_OF_CORRUPTED_EXPIRY;var t=new Date(e),n=sa();return t.getTime()-n.getTime()>nn.TWO_MINUTES_IN_MS?t.getTime()-nn.TWO_MINUTES_IN_MS:t.getTime()-n.getTime()}catch(r){return console.error("Heimdall: Error in getRefreshInterval",r),nn.REFETCH_CHECK_DELAY}};ve.getRefreshInterval=Vh;var lo={},Pt={},Kl;function eu(){if(Kl)return Pt;Kl=1;var e=fe&&fe.__awaiter||function(y,d,f,h){function v(C){return C instanceof f?C:new f(function(I){I(C)})}return new(f||(f=Promise))(function(C,I){function x(A){try{T(h.next(A))}catch(S){I(S)}}function w(A){try{T(h.throw(A))}catch(S){I(S)}}function T(A){A.done?C(A.value):v(A.value).then(x,w)}T((h=h.apply(y,d||[])).next())})},t=fe&&fe.__generator||function(y,d){var f={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},h,v,C,I;return I={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function x(T){return function(A){return w([T,A])}}function w(T){if(h)throw new TypeError("Generator is already executing.");for(;I&&(I=0,T[0]&&(f=0)),f;)try{if(h=1,v&&(C=T[0]&2?v.return:T[0]?v.throw||((C=v.return)&&C.call(v),0):v.next)&&!(C=C.call(v,T[1])).done)return C;switch(v=0,C&&(T=[T[0]&2,C.value]),T[0]){case 0:case 1:C=T;break;case 4:return f.label++,{value:T[1],done:!1};case 5:f.label++,v=T[1],T=[0];continue;case 7:T=f.ops.pop(),f.trys.pop();continue;default:if(C=f.trys,!(C=C.length>0&&C[C.length-1])&&(T[0]===6||T[0]===2)){f=0;continue}if(T[0]===3&&(!C||T[1]>C[0]&&T[1]<C[3])){f.label=T[1];break}if(T[0]===6&&f.label<C[1]){f.label=C[1],C=T;break}if(C&&f.label<C[2]){f.label=C[2],f.ops.push(T);break}C[2]&&f.ops.pop(),f.trys.pop();continue}T=d.call(y,f)}catch(A){T=[6,A],v=0}finally{h=C=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}};Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.logoutFromHeimdall=Pt.getTenantLoginCode=Pt.getLoginToken=Pt.getAccessToken=void 0;var n=yn,r=su(),o=ve,s=function(y,d,f,h){var v=(0,o.getStoredAuthData)(),C=f===n.TENANT_PLATFORM.HIVERWEB?n.TENANT_PLATFORM.HIVERWEB:n.TENANT_PLATFORM.GMAIL;return{root_url:y.heimdallUrl,url:y.apiEndpoints.heimdallTokenFetch,method:n.GET_METHOD,headers:{"x-hiver-tenant":C},data:{user_id:d.userId,usergroup_id:d.usergroupId,access_token:(v==null?void 0:v.token)||"",source:h}}},i=function(y,d,f,h,v){var C=f===n.TENANT_PLATFORM.HIVERWEB?n.TENANT_PLATFORM.HIVERWEB:n.TENANT_PLATFORM.GMAIL;return{root_url:d.heimdallUrl,url:d.apiEndpoints.heimdallLogin,method:n.GET_METHOD,data:{code:y},headers:{"x-hiver-tenant":C,"x-hiver-userid":h,"x-hiver-usergroupid":v}}},a=function(y,d){var f=d===n.TENANT_PLATFORM.HIVERWEB?n.TENANT_PLATFORM.HIVERWEB:n.TENANT_PLATFORM.GMAIL;return{root_url:y.heimdallUrl,url:y.apiEndpoints.heimdallLogout,method:n.GET_METHOD,headers:{"x-hiver-tenant":f}}},l=function(y){return parseInt(y,10)},c=function(y,d,f,h){return{root_url:f===n.TENANT_PLATFORM.HIVERWEB?y.hotUrl:y.v2Url,url:f===n.TENANT_PLATFORM.HIVERWEB?y.apiEndpoints.hotLogin:y.apiEndpoints.v2Login,method:n.GET_METHOD,data:{usersession:l(d.userId),app:h||n.APP_UI.DEFAULT}}},u=function(y,d,f,h,v){return e(void 0,void 0,void 0,function(){var C,I,x,w,T,A,S;return t(this,function(F){switch(F.label){case 0:console.log("GETTOKEN tenantPlatform -> ",h),F.label=1;case 1:return F.trys.push([1,5,,6]),!(0,o.validateToken)(f)||(0,o.invalidateToken)(f)?(console.log("HEIMDALL: No valid token, fetching token"),C=s(d,f,h,v),[4,(0,r.performAxiosCall)(C)]):[3,3];case 2:return I=F.sent(),[2,{atToken:(w=I==null?void 0:I.data.at)===null||w===void 0?void 0:w.token,expiryTime:(T=I==null?void 0:I.data.at)===null||T===void 0?void 0:T.expires_at,userId:(A=I==null?void 0:I.data)===null||A===void 0?void 0:A.user_id,userGroupId:(S=I==null?void 0:I.data)===null||S===void 0?void 0:S.usergroup_id}];case 3:return console.log("Heimdall: Valid token already exists"),[2,{}];case 4:return[3,6];case 5:throw x=F.sent(),x;case 6:return[2]}})})};Pt.getAccessToken=u;var p=function(y,d,f,h,v,C){return e(void 0,void 0,void 0,function(){var I,x,w,T,A,S,F;return t(this,function(D){switch(D.label){case 0:I=i(y,f,h,v,C),D.label=1;case 1:return D.trys.push([1,3,,4]),[4,(0,r.performAxiosCall)(I)];case 2:return x=D.sent(),[2,{userId:(T=x==null?void 0:x.data)===null||T===void 0?void 0:T.user_id,userGroupId:(A=x==null?void 0:x.data)===null||A===void 0?void 0:A.usergroup_id,atToken:(S=x==null?void 0:x.data.at)===null||S===void 0?void 0:S.token,expiryTime:(F=x==null?void 0:x.data.at)===null||F===void 0?void 0:F.expires_at}];case 3:throw w=D.sent(),w;case 4:return[2]}})})};Pt.getLoginToken=p;var g=function(y,d,f,h,v){return e(void 0,void 0,void 0,function(){var C,I,x;return t(this,function(w){switch(w.label){case 0:return w.trys.push([0,2,,3]),console.log("ERROR debug: in getTenantLoginCode:",v),C=c(d,f,h,v),[4,(0,r.performAxiosCall)(C)];case 1:return I=w.sent(),[2,I==null?void 0:I.data.code];case 2:throw x=w.sent(),x;case 3:return[2]}})})};Pt.getTenantLoginCode=g;var E=function(y,d,f){return f===void 0&&(f=0),e(void 0,void 0,void 0,function(){var h,v,C;return t(this,function(I){switch(I.label){case 0:return I.trys.push([0,2,,5]),h=a(y,d),[4,(0,r.performAxiosCall)(h)];case 1:return v=I.sent(),[2,v==null?void 0:v.status];case 2:return C=I.sent(),f<2?[4,E(y,d,f+1)]:[3,4];case 3:I.sent(),I.label=4;case 4:throw C;case 5:return[2]}})})};return Pt.logoutFromHeimdall=E,Pt}var fs={},Gh=fe&&fe.__awaiter||function(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function a(u){try{c(r.next(u))}catch(p){i(p)}}function l(u){try{c(r.throw(u))}catch(p){i(p)}}function c(u){u.done?s(u.value):o(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})},Hh=fe&&fe.__generator||function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(n=0)),n;)try{if(r=1,o&&(s=c[0]&2?o.return:c[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,c[1])).done)return s;switch(o=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,o=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],o=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(fs,"__esModule",{value:!0}),fs.subscribeToOnlineEvent=void 0;var tu=yn,Wh=zt,Zh=function(e,t){switch(t===void 0&&(t=(0,Wh.getValue)("PLATFORM")),console.log("Online status detected. Fetching token..."),t){case tu.PLATFORM.WEB:return window.addEventListener("online",function(){return Gh(void 0,void 0,void 0,function(){return Hh(this,function(n){switch(n.label){case 0:return console.log("Online status detected. Fetching token..."),[4,e()];case 1:return n.sent(),[2]}})})});case tu.PLATFORM.MOBILE:e();return;default:throw Error("Invalid PLATFORM ".concat(t))}};fs.subscribeToOnlineEvent=Zh;var nu;function ru(){if(nu)return lo;nu=1;var e=fe&&fe.__awaiter||function(y,d,f,h){function v(C){return C instanceof f?C:new f(function(I){I(C)})}return new(f||(f=Promise))(function(C,I){function x(A){try{T(h.next(A))}catch(S){I(S)}}function w(A){try{T(h.throw(A))}catch(S){I(S)}}function T(A){A.done?C(A.value):v(A.value).then(x,w)}T((h=h.apply(y,d||[])).next())})},t=fe&&fe.__generator||function(y,d){var f={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},h,v,C,I;return I={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function x(T){return function(A){return w([T,A])}}function w(T){if(h)throw new TypeError("Generator is already executing.");for(;I&&(I=0,T[0]&&(f=0)),f;)try{if(h=1,v&&(C=T[0]&2?v.return:T[0]?v.throw||((C=v.return)&&C.call(v),0):v.next)&&!(C=C.call(v,T[1])).done)return C;switch(v=0,C&&(T=[T[0]&2,C.value]),T[0]){case 0:case 1:C=T;break;case 4:return f.label++,{value:T[1],done:!1};case 5:f.label++,v=T[1],T=[0];continue;case 7:T=f.ops.pop(),f.trys.pop();continue;default:if(C=f.trys,!(C=C.length>0&&C[C.length-1])&&(T[0]===6||T[0]===2)){f=0;continue}if(T[0]===3&&(!C||T[1]>C[0]&&T[1]<C[3])){f.label=T[1];break}if(T[0]===6&&f.label<C[1]){f.label=C[1],C=T;break}if(C&&f.label<C[2]){f.label=C[2],f.ops.push(T);break}C[2]&&f.ops.pop(),f.trys.pop();continue}T=d.call(y,f)}catch(A){T=[6,A],v=0}finally{h=C=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}};Object.defineProperty(lo,"__esModule",{value:!0}),lo.fetchAccessToken=void 0;var n=eu(),r=yn,o=ve,s=fs,i,a,l,c=function(y,d,f,h,v,C){return C===void 0&&(C=r.APP_UI.DEFAULT),e(void 0,void 0,void 0,function(){var I,x,w,T,A,S,F,D,k;return t(this,function(M){switch(M.label){case 0:I=2,M.label=1;case 1:return M.trys.push([1,7,,12]),console.log("ERROR debug: in login:",C,h),x=void 0,v?[4,v()]:[3,3];case 2:return x=M.sent(),[3,5];case 3:return[4,(0,n.getTenantLoginCode)(r.CONFIG_HIVER,y,d,h,C)];case 4:x=M.sent(),M.label=5;case 5:return[4,(0,n.getLoginToken)(x,r.CONFIG_HIVER,y,h,d.userId,d.usergroupId)];case 6:return w=M.sent(),T=w.userId,A=w.userGroupId,S=w.atToken,F=w.expiryTime,(0,o.setTokenAndExpiry)(S,F),(0,o.setUserDetails)(T,A),[3,12];case 7:D=M.sent(),console.log("ERROR debug: in error login:",D,C),k=f,M.label=8;case 8:return k<I?[4,c(y,d,k+1,h,v,C)]:[3,11];case 9:M.sent(),M.label=10;case 10:return k++,[3,8];case 11:throw D;case 12:return[2]}})})},u=function(y,d,f,h,v){return e(void 0,void 0,void 0,function(){var C,I,x,w;return t(this,function(T){switch(T.label){case 0:return d<r.MAX_CONFLICT_RETRY_DELAY?[4,new Promise(function(A){return setTimeout(A,y)})]:[3,3];case 1:return T.sent(),d+=y,y*2<=r.MAX_BACKOFF_LIMIT?y*=2:y=r.MAX_BACKOFF_LIMIT,console.log("Heimdall: Fetch token post doubling conflict retry delay",y),C=f.retryDelay,I=f.configs,x=f.apiParams,w=f.appUI,[4,p(C,y,d,I,x,h,v,w)];case 2:T.sent(),T.label=3;case 3:return[2]}})})},p=function(y,d,f,h,v,C,I,x,w){return x===void 0&&(x="default"),e(void 0,void 0,void 0,function(){var T,A,S,F,D,k,M,j,H,z,U,J,Y,ae;return t(this,function(ue){switch(ue.label){case 0:return ue.trys.push([0,2,,12]),console.log("Heimdall: Interval Set on fetch token in fetchAndSaveToken:",l),[4,(0,n.getAccessToken)(r.CONFIG_HIVER,h,v,C,x)];case 1:return T=ue.sent(),A=T.atToken,S=T.expiryTime,F=T.userId,D=T.userGroupId,A&&S&&(0,o.setTokenAndExpiry)(A,S),F&&D&&(0,o.setUserDetails)(F,D),y=r.INITIAL_RETRY_DELAY,d=r.INITIAL_RETRY_DELAY,f=0,[3,12];case 2:return k=ue.sent(),console.log("ERROR: Heimdall fetch token",k),((H=k.response)===null||H===void 0?void 0:H.status)===401||((z=k.request)===null||z===void 0?void 0:z.status)===401?(M=1,[4,c(h,v,M,C,I,w)]):[3,4];case 3:return ue.sent(),[3,11];case 4:return((U=k.response)===null||U===void 0?void 0:U.status)===409||((J=k.request)===null||J===void 0?void 0:J.status)===409?(console.log("Heimdall: Fetching token post 409 in fetch And Save Token"),j={retryDelay:y,configs:h,apiParams:v,appUI:w},[4,u(d,f,j,C,I)]):[3,6];case 5:if(ue.sent(),f>=r.MAX_CONFLICT_RETRY_DELAY)throw k;return[3,11];case 6:if(!(((Y=k.response)===null||Y===void 0?void 0:Y.status)===422||((ae=k.request)===null||ae===void 0?void 0:ae.status)===422))return[3,7];throw console.log("ERROR: Throwing error",k.response.status),k;case 7:return y<=r.MAX_RETRY_DELAY?[4,new Promise(function(B){return setTimeout(B,y)})]:[3,10];case 8:return ue.sent(),y*=2,console.log("Heimdall: Fetch token post doubling retry delay",y),[4,p(y,d,f,h,v,C,I,w)];case 9:return ue.sent(),[3,11];case 10:throw k;case 11:return[3,12];case 12:return[2]}})})},g=function(y,d,f,h,v,C,I,x){return f===void 0&&(f=r.INITIAL_RETRY_DELAY),h===void 0&&(h=r.INITIAL_RETRY_DELAY),e(void 0,void 0,void 0,function(){var w,T,A;return t(this,function(S){switch(S.label){case 0:return S.trys.push([0,4,,5]),w=(0,o.isTokenInExpiryWindow)(),w?(T=(0,o.getRandomDelay)(),[4,(0,o.introduceDelay)(T)]):[3,3];case 1:return S.sent(),console.log("Heimdall: Fetching token - in expiry window"),[4,p(f,h,v,y,d,C,I,x)];case 2:S.sent(),S.label=3;case 3:return[3,5];case 4:throw A=S.sent(),A;case 5:return[2]}})})},E=function(y,d,f,h,v,C,I){return e(void 0,void 0,void 0,function(){var x,w,T,A,S,F;return t(this,function(D){switch(D.label){case 0:i=y,a=d,x=r.INITIAL_RETRY_DELAY,w=r.INITIAL_RETRY_DELAY,T=0,A=(0,o.getConfig)(i,a),console.log("Instance: Fetch Call"),D.label=1;case 1:return D.trys.push([1,3,,4]),[4,p(x,w,T,A,f,h,v,C,I)];case 2:return D.sent(),console.log("Heimdall: Interval Set on fetch token when fetch token is called:",l),clearInterval(l),l=setInterval(function(){return g(A,f,r.INITIAL_RETRY_DELAY,r.INITIAL_RETRY_DELAY,0,h,v,I)},r.REFETCH_CHECK_DELAY),S=function(){return e(void 0,void 0,void 0,function(){return t(this,function(k){switch(k.label){case 0:return[4,g(A,f,r.INITIAL_RETRY_DELAY,r.INITIAL_RETRY_DELAY,0,h,v,I)];case 1:return k.sent(),[2]}})})},console.log("Heimdall: Interval Set on fetch token:",l),(0,s.subscribeToOnlineEvent)(S),[3,4];case 3:return F=D.sent(),console.log("ERROR: Fetching token failed",F),[3,4];case 4:return[2]}})})};return lo.fetchAccessToken=E,lo}var ou;function su(){if(ou)return jn;ou=1;var e=fe&&fe.__assign||function(){return e=Object.assign||function(d){for(var f,h=1,v=arguments.length;h<v;h++){f=arguments[h];for(var C in f)Object.prototype.hasOwnProperty.call(f,C)&&(d[C]=f[C])}return d},e.apply(this,arguments)},t=fe&&fe.__awaiter||function(d,f,h,v){function C(I){return I instanceof h?I:new h(function(x){x(I)})}return new(h||(h=Promise))(function(I,x){function w(S){try{A(v.next(S))}catch(F){x(F)}}function T(S){try{A(v.throw(S))}catch(F){x(F)}}function A(S){S.done?I(S.value):C(S.value).then(w,T)}A((v=v.apply(d,f||[])).next())})},n=fe&&fe.__generator||function(d,f){var h={label:0,sent:function(){if(I[0]&1)throw I[1];return I[1]},trys:[],ops:[]},v,C,I,x;return x={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(x[Symbol.iterator]=function(){return this}),x;function w(A){return function(S){return T([A,S])}}function T(A){if(v)throw new TypeError("Generator is already executing.");for(;x&&(x=0,A[0]&&(h=0)),h;)try{if(v=1,C&&(I=A[0]&2?C.return:A[0]?C.throw||((I=C.return)&&I.call(C),0):C.next)&&!(I=I.call(C,A[1])).done)return I;switch(C=0,I&&(A=[A[0]&2,I.value]),A[0]){case 0:case 1:I=A;break;case 4:return h.label++,{value:A[1],done:!1};case 5:h.label++,C=A[1],A=[0];continue;case 7:A=h.ops.pop(),h.trys.pop();continue;default:if(I=h.trys,!(I=I.length>0&&I[I.length-1])&&(A[0]===6||A[0]===2)){h=0;continue}if(A[0]===3&&(!I||A[1]>I[0]&&A[1]<I[3])){h.label=A[1];break}if(A[0]===6&&h.label<I[1]){h.label=I[1],I=A;break}if(I&&h.label<I[2]){h.label=I[2],h.ops.push(A);break}I[2]&&h.ops.pop(),h.trys.pop();continue}A=f.call(d,h)}catch(S){A=[6,S],C=0}finally{v=I=0}if(A[0]&5)throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}};Object.defineProperty(jn,"__esModule",{value:!0}),jn.hiverAxiosCall=jn.performAxiosCall=void 0;var r=$l,o=ve,s=ru(),i=Xt,a=yn,l,c=2,u=function(d,f){var h=f.fetchCsrfToken();d.formData?d.formData.append("_csrf_token",h):(d.data=d.data||{},d.data._csrf_token=h)},p=function(d,f){var h={};!d.method||d.method.toLowerCase()==="get"?h={params:d.params?d.params:d.data}:h=d.params?{params:d,data:d.data}:{data:d.data};var v=e(e({method:d.method,url:"".concat(d.root_url).concat(d.url),headers:d.headers},h),{withCredentials:f,responseType:(d==null?void 0:d.responseType)||""});return v};function g(d,f){return f===void 0&&(f=!0),t(this,void 0,void 0,function(){var h;return n(this,function(v){return h=p(d,f),[2,(0,r.default)(h).then(function(C){return C}).catch(function(C){throw C})]})})}jn.performAxiosCall=g;function E(d,f,h){return t(this,void 0,void 0,function(){var v,C,I;return n(this,function(x){switch(x.label){case 0:return x.trys.push([0,6,,8]),d.authTokenFetchingInProgress?[3,2]:(d.authTokenFetchingInProgress=!0,v=d.appEnv,C=d.tier,[4,(0,s.fetchAccessToken)(v,C,f,d.tenantPlatform,d.getTokenForLogin,h)]);case 1:return x.sent(),d.authTokenFetchingInProgress=!1,[3,5];case 2:return[4,new Promise(function(w){return setTimeout(w,100)})];case 3:return x.sent(),console.log("Heimdall: Retrying fetchAccessToken after 100ms..."),[4,E(d,f,h)];case 4:x.sent(),x.label=5;case 5:return[3,8];case 6:return I=x.sent(),console.log("Error while fetching Auth Token :",I),d.authTokenFetchingInProgress=!1,[4,E(d,f,h)];case 7:return x.sent(),[3,8];case 8:return[2]}})})}function y(d,f,h,v,C){var I,x;return C===void 0&&(C=0),t(this,void 0,void 0,function(){var w,T,A,S,F,D,k;return n(this,function(M){switch(M.label){case 0:if(M.trys.push([0,4,,5]),!(h.getToken&&!(0,o.hasValidToken)(f)))return[3,2];if(w=d.appEnv,T=d.tier,!w||!T)throw Error("appEnv or tier missing : ".concat(w,"/").concat(T));return"userId"in f&&"usergroupId"in f?(A={userId:f.userId,usergroupId:f.usergroupId},[4,E(d,A,v)]):[3,2];case 1:M.sent(),M.label=2;case 2:return d.csrfToken&&u(f,h),S=d.tenantPlatform===a.TENANT_PLATFORM.HIVERWEB?a.TENANT_PLATFORM.HIVERWEB:a.TENANT_PLATFORM.GMAIL,f.headers=e(e({},f.headers),{"x-hiver-tenant":S,"x-hiver-userid":(0,i.getItemFromStorage)("hiverAuthUserId")||"0","x-hiver-usergroupid":(0,i.getItemFromStorage)("hiverAuthUserGroupId")||"0"}),h.getToken&&(l=(0,i.getItemFromStorage)("hiverAuthToken")||"",f.headers=e(e({},f.headers),{Authorization:"Bearer ".concat(l)})),console.log("Performing axios call for:",f),[4,g(f,d.withCredentials)];case 3:return F=M.sent(),f.onSuccess&&f.onSuccess(F),[2,F];case 4:if(D=M.sent(),k=((I=D.response)===null||I===void 0?void 0:I.status)===403||((x=D.request)===null||x===void 0?void 0:x.status)===403,C<c&&k)return(0,o.expireToken)(),[2,y(d,f,h,v,C+1)];if(C>=c&&k||!k)throw f.onFail&&f.onFail(D),console.log("ERROR: Reached make Axios",D),D;return[3,5];case 5:return[2]}})})}return jn.hiverAxiosCall=y,jn}var uo={},Fe={},Pe={};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.TIERS=Pe.APP_UI=Pe.CONFIG_HIVER=Pe.REFETCH_CHECK_DELAY=Pe.INITIAL_RETRY_DELAY=Pe.MAX_BACKOFF_LIMIT=Pe.MAX_CONFLICT_RETRY_DELAY=Pe.MAX_RETRY_DELAY=Pe.GET_METHOD=void 0,Pe.GET_METHOD="GET",Pe.MAX_RETRY_DELAY=18e4,Pe.MAX_CONFLICT_RETRY_DELAY=63e3,Pe.MAX_BACKOFF_LIMIT=8e3,Pe.INITIAL_RETRY_DELAY=1e3,Pe.REFETCH_CHECK_DELAY=168e4,Pe.CONFIG_HIVER={getToken:!1,fetchCsrfToken:function(){return""},isHiverApiDomain:!0},Pe.APP_UI={COLLAB_SPACE:"collab-space",DEFAULT:"default"},Pe.TIERS={DEV:"dev",SIT:"sit",PROD:"production"};var pt={};Object.defineProperty(pt,"__esModule",{value:!0}),pt.getProdHqConfig=pt.getProdApiConfig=pt.getSitHqConfig=pt.getSitApiConfig=pt.getDevHqConfig=pt.getDevApiConfig=void 0;var yr={heimdallTokenFetch:"/v1/token/get",heimdallLogin:"/v1/login/code",v2Login:"/api/auth/login/code"},Xh=function(){return{v2Url:"https://v2dev.hiver.space",heimdallUrl:"https://dev.hiver.space/api/heimdall-api",apiEndpoints:yr}};pt.getDevApiConfig=Xh;var zh=function(){return{v2Url:"https://v2dev.hiver.space",heimdallUrl:"https://dev.hiver.space/api/heimdall-api2",apiEndpoints:yr}};pt.getDevHqConfig=zh;var Yh=function(e){return{v2Url:"https://v2".concat(e,".hiver.space"),heimdallUrl:"https://".concat(e,".hiver.space/api/heimdall-api"),apiEndpoints:yr}};pt.getSitApiConfig=Yh;var Jh=function(e){return{v2Url:"https://v2".concat(e,".hiver.space"),heimdallUrl:"https://".concat(e,".hiver.space/api/heimdall-api2"),apiEndpoints:yr}};pt.getSitHqConfig=Jh;var Qh=function(){return{v2Url:"https://v2.hiverhq.com",heimdallUrl:"https://heimdall.hiverapi.com",apiEndpoints:yr}};pt.getProdApiConfig=Qh;var qh=function(){return{v2Url:"https://v2.hiverhq.com",heimdallUrl:"https://heimdall2.hiverhq.com",apiEndpoints:yr}};pt.getProdHqConfig=qh;var $h=fe&&fe.__awaiter||function(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function a(u){try{c(r.next(u))}catch(p){i(p)}}function l(u){try{c(r.throw(u))}catch(p){i(p)}}function c(u){u.done?s(u.value):o(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})},Uh=fe&&fe.__generator||function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(n=0)),n;)try{if(r=1,o&&(s=c[0]&2?o.return:c[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,c[1])).done)return s;switch(o=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,o=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],o=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.expireToken=Fe.validateToken=Fe.validateAccount=Fe.getConfig=Fe.introduceDelay=Fe.isTokenInExpiryWindow=Fe.getStoredAuthData=Fe.setUserDetails=Fe.setTokenAndExpiry=Fe.getRandomDelay=Fe.hasValidToken=void 0;var aa=Pe,Hn=pt,iu=function(){var e=new Date,t=new Date(e.getTime()+e.getTimezoneOffset()*6e4);return t},ca=function(e){var t=parseInt(sessionStorage.getItem("hiverAuthUserId")||"0"),n=parseInt(sessionStorage.getItem("hiverAuthUserGroupId")||"0"),r=e.userId,o=e.usergroupId;return t===r&&o===n};Fe.validateAccount=ca;var Kh=function(e){var t=ca(e);return!au()&&t};Fe.validateToken=Kh;var eg=function(){try{sessionStorage.removeItem("hiverAuthTokenExpiry")}catch{console.log("Heimdall: Unable to Remove token.")}};Fe.expireToken=eg;var tg=function(e){console.log("Heimdall: checking if there is a valid token");var t=sessionStorage.getItem("hiverAuthTokenExpiry")||"",n=new Date(t),r=iu(),o=ca(e);return r<n&&o};Fe.hasValidToken=tg;var ng=function(){return Math.floor(Math.random()*6e4)+6e4};Fe.getRandomDelay=ng;var rg=function(e,t){if(!e||!t)throw new Error("User Id or user group Id not found in the response");sessionStorage.setItem("hiverAuthUserId",e),sessionStorage.setItem("hiverAuthUserGroupId",t)};Fe.setUserDetails=rg;var og=function(e,t){if(!e)throw new Error("Token not found in the response");sessionStorage.setItem("hiverAuthToken",e),sessionStorage.setItem("hiverAuthTokenExpiry",t)};Fe.setTokenAndExpiry=og;var sg=function(){var e=sessionStorage.getItem("hiverAuthTokenExpiry"),t=sessionStorage.getItem("hiverAuthToken"),n=sessionStorage.getItem("hiverAuthUserId"),r=sessionStorage.getItem("hiverAuthUserGroupId");return{token:t,expiryTime:e,userId:n,usergroupId:r}};Fe.getStoredAuthData=sg;var au=function(){var e=sessionStorage.getItem("hiverAuthTokenExpiry")||"";if(!e)return!0;var t=iu(),n=new Date(e),r=4*60*1e3,o=n.getTime()-t.getTime()<r;return console.log({currentTime:t,expiry:n,isInExpiryWindow:o}),o};Fe.isTokenInExpiryWindow=au;var ig=function(e){return $h(void 0,void 0,void 0,function(){return Uh(this,function(t){switch(t.label){case 0:return[4,new Promise(function(n){return setTimeout(n,e)})];case 1:return t.sent(),[2]}})})};Fe.introduceDelay=ig;var ag=function(e,t,n){switch(t){case aa.TIERS.SIT:return console.log("ISHIVERAPIDOMAIN:",n,(0,Hn.getSitHqConfig)(e)),n?(0,Hn.getSitApiConfig)(e):(0,Hn.getSitHqConfig)(e);case aa.TIERS.PROD:return n?(0,Hn.getProdApiConfig)():(0,Hn.getProdHqConfig)();case aa.TIERS.DEV:default:return n?(0,Hn.getDevApiConfig)():(0,Hn.getDevHqConfig)()}};Fe.getConfig=ag;var fo={},rn={},cu;function cg(){if(cu)return rn;cu=1;var e=fe&&fe.__awaiter||function(g,E,y,d){function f(h){return h instanceof y?h:new y(function(v){v(h)})}return new(y||(y=Promise))(function(h,v){function C(w){try{x(d.next(w))}catch(T){v(T)}}function I(w){try{x(d.throw(w))}catch(T){v(T)}}function x(w){w.done?h(w.value):f(w.value).then(C,I)}x((d=d.apply(g,E||[])).next())})},t=fe&&fe.__generator||function(g,E){var y={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},d,f,h,v;return v={next:C(0),throw:C(1),return:C(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function C(x){return function(w){return I([x,w])}}function I(x){if(d)throw new TypeError("Generator is already executing.");for(;v&&(v=0,x[0]&&(y=0)),y;)try{if(d=1,f&&(h=x[0]&2?f.return:x[0]?f.throw||((h=f.return)&&h.call(f),0):f.next)&&!(h=h.call(f,x[1])).done)return h;switch(f=0,h&&(x=[x[0]&2,h.value]),x[0]){case 0:case 1:h=x;break;case 4:return y.label++,{value:x[1],done:!1};case 5:y.label++,f=x[1],x=[0];continue;case 7:x=y.ops.pop(),y.trys.pop();continue;default:if(h=y.trys,!(h=h.length>0&&h[h.length-1])&&(x[0]===6||x[0]===2)){y=0;continue}if(x[0]===3&&(!h||x[1]>h[0]&&x[1]<h[3])){y.label=x[1];break}if(x[0]===6&&y.label<h[1]){y.label=h[1],h=x;break}if(h&&y.label<h[2]){y.label=h[2],y.ops.push(x);break}h[2]&&y.ops.pop(),y.trys.pop();continue}x=E.call(g,y)}catch(w){x=[6,w],f=0}finally{d=h=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}};Object.defineProperty(rn,"__esModule",{value:!0}),rn.getV2LoginCode=rn.getLoginToken=rn.getAccessToken=void 0;var n=Pe,r=fu(),o=Fe,s=function(g,E,y){var d=(0,o.getStoredAuthData)();return{root_url:g.heimdallUrl,url:g.apiEndpoints.heimdallTokenFetch,method:n.GET_METHOD,data:{user_id:E.userId,usergroup_id:E.usergroupId,access_token:(d==null?void 0:d.token)||"",source:y},withCredentials:!0}},i=function(g,E){return{root_url:E.heimdallUrl,url:E.apiEndpoints.heimdallLogin,method:n.GET_METHOD,data:{code:g},withCredentials:!0}},a=function(g){return parseInt(g,10)},l=function(g,E){return{root_url:g.v2Url,url:g.apiEndpoints.v2Login,method:n.GET_METHOD,withCredentials:!0,data:{usersession:a(localStorage.getItem("hiver-config.usersession")),app:E||n.APP_UI.DEFAULT}}},c=function(g,E,y,d){return e(void 0,void 0,void 0,function(){var f,h,v,C,I,x,w;return t(this,function(T){switch(T.label){case 0:return T.trys.push([0,4,,5]),(0,o.validateToken)(y)?[3,2]:(console.log("HEIMDALL: No valid token, fetching token"),f=s(E,y,d),[4,(0,r.makeAxiosCall)(f,g)]);case 1:return h=T.sent(),[2,{atToken:(C=h==null?void 0:h.data.at)===null||C===void 0?void 0:C.token,expiryTime:(I=h==null?void 0:h.data.at)===null||I===void 0?void 0:I.expires_at,userId:(x=h==null?void 0:h.data)===null||x===void 0?void 0:x.user_id,userGroupId:(w=h==null?void 0:h.data)===null||w===void 0?void 0:w.usergroup_id}];case 2:return console.log("Heimdall: Valid token already exists"),[2,{}];case 3:return[3,5];case 4:throw v=T.sent(),v;case 5:return[2]}})})};rn.getAccessToken=c;var u=function(g,E,y){return e(void 0,void 0,void 0,function(){var d,f,h,v,C,I,x;return t(this,function(w){switch(w.label){case 0:d=i(g,y),w.label=1;case 1:return w.trys.push([1,3,,4]),[4,(0,r.makeAxiosCall)(d,E)];case 2:return f=w.sent(),[2,{userId:(v=f==null?void 0:f.data)===null||v===void 0?void 0:v.user_id,userGroupId:(C=f==null?void 0:f.data)===null||C===void 0?void 0:C.usergroup_id,atToken:(I=f==null?void 0:f.data.at)===null||I===void 0?void 0:I.token,expiryTime:(x=f==null?void 0:f.data.at)===null||x===void 0?void 0:x.expires_at}];case 3:throw h=w.sent(),h;case 4:return[2]}})})};rn.getLoginToken=u;var p=function(g,E,y){return e(void 0,void 0,void 0,function(){var d,f,h;return t(this,function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),console.log("ERROR debug: in getV2loginCode:",y),d=l(E,y),[4,(0,r.makeAxiosCall)(d,g)];case 1:return f=v.sent(),console.log("DEBUG HEIMDALL: local storage:",f==null?void 0:f.data),[2,f==null?void 0:f.data.code];case 2:throw h=v.sent(),h;case 3:return[2]}})})};return rn.getV2LoginCode=p,rn}var lu;function uu(){if(lu)return fo;lu=1;var e=fe&&fe.__awaiter||function(E,y,d,f){function h(v){return v instanceof d?v:new d(function(C){C(v)})}return new(d||(d=Promise))(function(v,C){function I(T){try{w(f.next(T))}catch(A){C(A)}}function x(T){try{w(f.throw(T))}catch(A){C(A)}}function w(T){T.done?v(T.value):h(T.value).then(I,x)}w((f=f.apply(E,y||[])).next())})},t=fe&&fe.__generator||function(E,y){var d={label:0,sent:function(){if(v[0]&1)throw v[1];return v[1]},trys:[],ops:[]},f,h,v,C;return C={next:I(0),throw:I(1),return:I(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function I(w){return function(T){return x([w,T])}}function x(w){if(f)throw new TypeError("Generator is already executing.");for(;C&&(C=0,w[0]&&(d=0)),d;)try{if(f=1,h&&(v=w[0]&2?h.return:w[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,w[1])).done)return v;switch(h=0,v&&(w=[w[0]&2,v.value]),w[0]){case 0:case 1:v=w;break;case 4:return d.label++,{value:w[1],done:!1};case 5:d.label++,h=w[1],w=[0];continue;case 7:w=d.ops.pop(),d.trys.pop();continue;default:if(v=d.trys,!(v=v.length>0&&v[v.length-1])&&(w[0]===6||w[0]===2)){d=0;continue}if(w[0]===3&&(!v||w[1]>v[0]&&w[1]<v[3])){d.label=w[1];break}if(w[0]===6&&d.label<v[1]){d.label=v[1],v=w;break}if(v&&d.label<v[2]){d.label=v[2],d.ops.push(w);break}v[2]&&d.ops.pop(),d.trys.pop();continue}w=y.call(E,d)}catch(T){w=[6,T],h=0}finally{f=v=0}if(w[0]&5)throw w[1];return{value:w[0]?w[1]:void 0,done:!0}}};Object.defineProperty(fo,"__esModule",{value:!0}),fo.fetchToken=void 0;var n=cg(),r=Pe,o=Fe,s,i,a,l=function(E,y,d){return d===void 0&&(d=r.APP_UI.DEFAULT),e(void 0,void 0,void 0,function(){var f,h,v,C,I,x,w,T,A;return t(this,function(S){switch(S.label){case 0:f=2,S.label=1;case 1:return S.trys.push([1,4,,9]),console.log("ERROR debug: in login:",d),[4,(0,n.getV2LoginCode)(r.CONFIG_HIVER,E,d)];case 2:return h=S.sent(),[4,(0,n.getLoginToken)(h,r.CONFIG_HIVER,E)];case 3:return v=S.sent(),C=v.userId,I=v.userGroupId,x=v.atToken,w=v.expiryTime,(0,o.setTokenAndExpiry)(x,w),(0,o.setUserDetails)(C,I),[3,9];case 4:T=S.sent(),console.log("ERROR debug: in error login:",T,d),A=y,S.label=5;case 5:return A<f?[4,l(E,A+1,d)]:[3,8];case 6:S.sent(),S.label=7;case 7:return A++,[3,5];case 8:throw T;case 9:return[2]}})})},c=function(E,y,d){return e(void 0,void 0,void 0,function(){var f,h,v,C;return t(this,function(I){switch(I.label){case 0:return y<r.MAX_CONFLICT_RETRY_DELAY?[4,new Promise(function(x){return setTimeout(x,E)})]:[3,3];case 1:return I.sent(),y+=E,E*2<=r.MAX_BACKOFF_LIMIT?E*=2:E=r.MAX_BACKOFF_LIMIT,console.log("Heimdall: Fetch token post doubling conflict retry delay",E),f=d.retryDelay,h=d.configs,v=d.api_params,C=d.appUI,[4,u(f,E,y,h,v,C)];case 2:I.sent(),I.label=3;case 3:return[2]}})})},u=function(E,y,d,f,h,v,C){return v===void 0&&(v="default"),e(void 0,void 0,void 0,function(){var I,x,w,T,A,S,F,D,k,M,j,H,z,U;return t(this,function(J){switch(J.label){case 0:return J.trys.push([0,2,,12]),console.log("Heimdall: Interval Set on fetch token in fetchAndSaveToken:",a),[4,(0,n.getAccessToken)(r.CONFIG_HIVER,f,h,v)];case 1:return I=J.sent(),x=I.atToken,w=I.expiryTime,T=I.userId,A=I.userGroupId,x&&w&&(0,o.setTokenAndExpiry)(x,w),T&&A&&(0,o.setUserDetails)(T,A),E=r.INITIAL_RETRY_DELAY,y=r.INITIAL_RETRY_DELAY,d=0,[3,12];case 2:return S=J.sent(),console.log("ERROR: Heimdall fetch token",S),((k=S.response)===null||k===void 0?void 0:k.status)===401||((M=S.request)===null||M===void 0?void 0:M.status)===401?(F=1,[4,l(f,F,C)]):[3,4];case 3:return J.sent(),[3,11];case 4:return((j=S.response)===null||j===void 0?void 0:j.status)===409||((H=S.request)===null||H===void 0?void 0:H.status)===409?(console.log("Heimdall: Fetching token post 409 in fetch And Save Token"),D={retryDelay:E,configs:f,api_params:h,appUI:C},[4,c(y,d,D)]):[3,6];case 5:if(J.sent(),d>=r.MAX_CONFLICT_RETRY_DELAY)throw S;return[3,11];case 6:if(!(((z=S.response)===null||z===void 0?void 0:z.status)===422||((U=S.request)===null||U===void 0?void 0:U.status)===422))return[3,7];throw console.log("ERROR: Throwing error",S.response.status),S;case 7:return E<=r.MAX_RETRY_DELAY?[4,new Promise(function(Y){return setTimeout(Y,E)})]:[3,10];case 8:return J.sent(),E*=2,console.log("Heimdall: Fetch token post doubling retry delay",E),[4,u(E,y,d,f,h,C)];case 9:return J.sent(),[3,11];case 10:throw S;case 11:return[3,12];case 12:return[2]}})})},p=function(E,y,d,f,h,v){return d===void 0&&(d=r.INITIAL_RETRY_DELAY),f===void 0&&(f=r.INITIAL_RETRY_DELAY),h===void 0&&(h=0),e(void 0,void 0,void 0,function(){var C,I,x;return t(this,function(w){switch(w.label){case 0:return w.trys.push([0,4,,5]),C=(0,o.isTokenInExpiryWindow)(),C?(I=(0,o.getRandomDelay)(),[4,(0,o.introduceDelay)(I)]):[3,3];case 1:return w.sent(),console.log("Heimdall: Fetching token - in expiry window"),[4,u(d,f,h,E,y,v)];case 2:w.sent(),w.label=3;case 3:return[3,5];case 4:throw x=w.sent(),x;case 5:return[2]}})})},g=function(E,y,d,f,h,v){return e(void 0,void 0,void 0,function(){var C,I,x,w,T;return t(this,function(A){switch(A.label){case 0:s=E,i=y,C=r.INITIAL_RETRY_DELAY,I=r.INITIAL_RETRY_DELAY,x=0,w=(0,o.getConfig)(s,i,f),A.label=1;case 1:return A.trys.push([1,3,,4]),[4,u(C,I,x,w,d,h,v)];case 2:return A.sent(),console.log("Heimdall: Interval Set on fetch token when fetch token is called:",a),clearInterval(a),a=setInterval(function(){return p(w,d)},r.REFETCH_CHECK_DELAY),console.log("Heimdall: Interval Set on fetch token:",a),window.addEventListener("online",function(){return e(void 0,void 0,void 0,function(){return t(this,function(S){switch(S.label){case 0:return console.log("Online status detected. Fetching token..."),[4,p(w,d)];case 1:return S.sent(),[2]}})})}),[3,4];case 3:throw T=A.sent(),T;case 4:return[2]}})})};return fo.fetchToken=g,fo}var du;function fu(){if(du)return uo;du=1;var e=fe&&fe.__assign||function(){return e=Object.assign||function(g){for(var E,y=1,d=arguments.length;y<d;y++){E=arguments[y];for(var f in E)Object.prototype.hasOwnProperty.call(E,f)&&(g[f]=E[f])}return g},e.apply(this,arguments)},t=fe&&fe.__awaiter||function(g,E,y,d){function f(h){return h instanceof y?h:new y(function(v){v(h)})}return new(y||(y=Promise))(function(h,v){function C(w){try{x(d.next(w))}catch(T){v(T)}}function I(w){try{x(d.throw(w))}catch(T){v(T)}}function x(w){w.done?h(w.value):f(w.value).then(C,I)}x((d=d.apply(g,E||[])).next())})},n=fe&&fe.__generator||function(g,E){var y={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},d,f,h,v;return v={next:C(0),throw:C(1),return:C(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function C(x){return function(w){return I([x,w])}}function I(x){if(d)throw new TypeError("Generator is already executing.");for(;v&&(v=0,x[0]&&(y=0)),y;)try{if(d=1,f&&(h=x[0]&2?f.return:x[0]?f.throw||((h=f.return)&&h.call(f),0):f.next)&&!(h=h.call(f,x[1])).done)return h;switch(f=0,h&&(x=[x[0]&2,h.value]),x[0]){case 0:case 1:h=x;break;case 4:return y.label++,{value:x[1],done:!1};case 5:y.label++,f=x[1],x=[0];continue;case 7:x=y.ops.pop(),y.trys.pop();continue;default:if(h=y.trys,!(h=h.length>0&&h[h.length-1])&&(x[0]===6||x[0]===2)){y=0;continue}if(x[0]===3&&(!h||x[1]>h[0]&&x[1]<h[3])){y.label=x[1];break}if(x[0]===6&&y.label<h[1]){y.label=h[1],h=x;break}if(h&&y.label<h[2]){y.label=h[2],y.ops.push(x);break}h[2]&&y.ops.pop(),y.trys.pop();continue}x=E.call(g,y)}catch(w){x=[6,w],f=0}finally{d=h=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}};Object.defineProperty(uo,"__esModule",{value:!0}),uo.makeAxiosCall=void 0;var r=$l,o=Fe,s=uu(),i,a=2,l=function(g,E){var y=E.fetchCsrfToken();g.formData?g.formData.append("_csrf_token",y):(g.data=g.data||{},g.data._csrf_token=y)},c=function(g){var E=!g.method||g.method.toLowerCase()==="get"?{params:g.data}:{data:g.data},y=e(e({method:g.method,url:"".concat(g.root_url).concat(g.url),headers:g.headers},E),{withCredentials:g.withCredentials,responseType:(g==null?void 0:g.responseType)||""});return y};function u(g){return t(this,void 0,void 0,function(){var E;return n(this,function(y){return E=c(g),[2,(0,r.default)(E).then(function(d){return d}).catch(function(d){throw d})]})})}function p(g,E,y,d){var f,h;return d===void 0&&(d=0),t(this,void 0,void 0,function(){var v,C,I,x,w,T;return n(this,function(A){switch(A.label){case 0:if(A.trys.push([0,4,,5]),!(E.getToken&&!(0,o.hasValidToken)(g)))return[3,2];if(v=g.app_env,C=g.tier,!v||!C)throw Error("app_env or tier missing : ".concat(v,"/").concat(C));return"userId"in g&&"usergroupId"in g?(I={userId:g.userId,usergroupId:g.usergroupId},typeof E.isHiverApiDomain!="boolean"&&(E.isHiverApiDomain=!0),[4,(0,s.fetchToken)(v,C,I,E.isHiverApiDomain,y)]):[3,2];case 1:A.sent(),A.label=2;case 2:return g.csrfToken&&l(g,E),E.getToken&&(i=sessionStorage.getItem("hiverAuthToken")||"",g.headers=e(e({},g.headers),{Authorization:"Bearer ".concat(i)})),[4,u(g)];case 3:return x=A.sent(),g.onSuccess&&g.onSuccess(x),[2,x];case 4:if(w=A.sent(),T=((f=w.response)===null||f===void 0?void 0:f.status)===403||((h=w.request)===null||h===void 0?void 0:h.status)===403,d<a&&T)return(0,o.expireToken)(),[2,p(g,E,y,d+1)];if(d>=a&&T||!T)throw g.onFail&&g.onFail(w),console.log("ERROR: Reached make Axios",w),w;return[3,5];case 5:return[2]}})})}return uo.makeAxiosCall=p,uo}(function(e){var t=fe&&fe.__awaiter||function(E,y,d,f){function h(v){return v instanceof d?v:new d(function(C){C(v)})}return new(d||(d=Promise))(function(v,C){function I(T){try{w(f.next(T))}catch(A){C(A)}}function x(T){try{w(f.throw(T))}catch(A){C(A)}}function w(T){T.done?v(T.value):h(T.value).then(I,x)}w((f=f.apply(E,y||[])).next())})},n=fe&&fe.__generator||function(E,y){var d={label:0,sent:function(){if(v[0]&1)throw v[1];return v[1]},trys:[],ops:[]},f,h,v,C;return C={next:I(0),throw:I(1),return:I(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function I(w){return function(T){return x([w,T])}}function x(w){if(f)throw new TypeError("Generator is already executing.");for(;C&&(C=0,w[0]&&(d=0)),d;)try{if(f=1,h&&(v=w[0]&2?h.return:w[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,w[1])).done)return v;switch(h=0,v&&(w=[w[0]&2,v.value]),w[0]){case 0:case 1:v=w;break;case 4:return d.label++,{value:w[1],done:!1};case 5:d.label++,h=w[1],w=[0];continue;case 7:w=d.ops.pop(),d.trys.pop();continue;default:if(v=d.trys,!(v=v.length>0&&v[v.length-1])&&(w[0]===6||w[0]===2)){d=0;continue}if(w[0]===3&&(!v||w[1]>v[0]&&w[1]<v[3])){d.label=w[1];break}if(w[0]===6&&d.label<v[1]){d.label=v[1],v=w;break}if(v&&d.label<v[2]){d.label=v[2],d.ops.push(w);break}v[2]&&d.ops.pop(),d.trys.pop();continue}w=y.call(E,d)}catch(T){w=[6,T],h=0}finally{f=v=0}if(w[0]&5)throw w[1];return{value:w[0]?w[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_INIT_CONFIG_HIVER=e.TENANT_PLATFORM=e.fetchToken=e.makeAxiosCall=e.Bifrost=void 0;var r=su(),o=ru(),s=yn;Object.defineProperty(e,"TENANT_PLATFORM",{enumerable:!0,get:function(){return s.TENANT_PLATFORM}}),Object.defineProperty(e,"DEFAULT_INIT_CONFIG_HIVER",{enumerable:!0,get:function(){return s.DEFAULT_INIT_CONFIG_HIVER}});var i=eu(),a=ve,l=Xt,c=fu();Object.defineProperty(e,"makeAxiosCall",{enumerable:!0,get:function(){return c.makeAxiosCall}});var u=uu();Object.defineProperty(e,"fetchToken",{enumerable:!0,get:function(){return u.fetchToken}});var p=zt,g=function(){function E(y,d,f,h,v,C){f===void 0&&(f=s.TENANT_PLATFORM.GMAIL),h===void 0&&(h=null),v===void 0&&(v=!0),C===void 0&&(C=!1),this.setEnvironment(),this.appEnv=y,this.tier=d,this.tenantPlatform=f,this.authTokenFetchingInProgress=!1,this.getTokenForLogin=h,this.withCredentials=v,this.csrfToken=C}return E.prototype.setEnvironment=function(){typeof window<"u"&&window.document?(0,p.setValue)("PLATFORM",s.PLATFORM.WEB):(0,p.setValue)("PLATFORM",s.PLATFORM.MOBILE)},E.prototype.hiverAxios=function(y,d,f,h){return d===void 0&&(d=s.DEFAULT_INIT_CONFIG_HIVER),t(this,void 0,void 0,function(){var v,C;return n(this,function(I){switch(I.label){case 0:return I.trys.push([0,4,,5]),h&&h<2?(v={userId:y.userId,usergroupId:y.usergroupId,apiRetry:h},console.log("THIS IS THE TENNANTPLAORM -> ",this.tenantPlatform),[4,(0,o.fetchAccessToken)(this.appEnv,this.tier,v,this.tenantPlatform,this.getTokenForLogin,s.API_CALL_ORIGIN.API_RETRY)]):[3,2];case 1:I.sent(),I.label=2;case 2:return[4,(0,r.hiverAxiosCall)(this,y,d,f)];case 3:return[2,I.sent()];case 4:throw C=I.sent(),console.log("ERROR: Axios call failed",C),C;case 5:return[2]}})})},E.prototype.fetchAuthToken=function(y,d,f){return t(this,void 0,void 0,function(){var h;return n(this,function(v){switch(v.label){case 0:return v.trys.push([0,4,7,8]),this.authTokenFetchingInProgress?[3,2]:(this.authTokenFetchingInProgress=!0,[4,(0,o.fetchAccessToken)(this.appEnv,this.tier,y,this.tenantPlatform,this.getTokenForLogin,d,f)]);case 1:return v.sent(),[3,3];case 2:console.log("Heimdall: AuthToken Fetching InProgress",this.authTokenFetchingInProgress),v.label=3;case 3:return[3,8];case 4:return h=v.sent(),console.log("ERROR: Fetching token failed",h),this.authTokenFetchingInProgress=!1,[4,new Promise(function(C){return setTimeout(C,100)})];case 5:return v.sent(),console.log("Heimdall: Retrying fetchAccessToken after 100ms..."),[4,this.fetchAuthToken(y,d,f)];case 6:return v.sent(),[3,8];case 7:return this.authTokenFetchingInProgress=!1,[7];case 8:return[2]}})})},E.prototype.logout=function(){return t(this,void 0,void 0,function(){var y,d;return n(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),y=(0,a.getConfig)(this.appEnv,this.tier),[4,(0,i.logoutFromHeimdall)(y,this.tenantPlatform)];case 1:return f.sent(),(0,l.removeItemFromStorage)("hiverAuthToken"),(0,l.removeItemFromStorage)("hiverAuthTokenExpiry"),(0,l.removeItemFromStorage)("hiverAuthUserId"),(0,l.removeItemFromStorage)("hiverAuthUserGroupId"),[3,3];case 2:throw d=f.sent(),console.error("Heimdall: Logout failed",d),d;case 3:return[2]}})})},E.prototype.isTokenFetchingInProgress=function(){return this.authTokenFetchingInProgress},E}();e.Bifrost=g})(ji);const Bt={userId:"",userGroupId:"",baseUrl:"",appEnv:"",tier:"",bifrost:null,isInitiated:!1},Yt=()=>{if(!Bt.isInitiated)return null;if(!Bt.baseUrl)throw new Error("Base url is not setup. please call the initConnectorsBifrost function with the appropriate value");return Bt},lg=({baseUrl:e,appEnv:t,tier:n,userId:r,userGroupId:o,tenantPlatform:s=ji.TENANT_PLATFORM.GMAIL,withCredentials:i=!0,getTokenForLogin:a})=>{Bt.baseUrl=e,Bt.appEnv=t,Bt.tier=n,Bt.userGroupId=o,Bt.userId=r,Bt.tenantPlatform=s,Bt.bifrost=new ji.Bifrost(t,n,s,a,i),Bt.isInitiated=!0},ze=(({configHiver:e})=>async n=>{const r=Yt();if(!r)throw new Error("Please call initConnectorsBifrost before making any api calls");const{bifrost:o,userGroupId:s,userId:i}=r,{url:a,method:l,root_url:c}=n,p={root_url:(c||r.baseUrl)+((n==null?void 0:n.prefix)||""),url:a,method:l,headers:n==null?void 0:n.headers,onSuccess:n==null?void 0:n.onSuccess,onFail:n==null?void 0:n.onFail,data:n==null?void 0:n.data,params:n==null?void 0:n.params,formData:n==null?void 0:n.formData,responseType:n==null?void 0:n.responseType,userId:Number(i),usergroupId:Number(s)};try{return await(o==null?void 0:o.hiverAxios(p,{...e,isHiverApiDomain:!0}))}catch(g){throw console.error("API call failed with error: ",g),g}})({configHiver:{getToken:!0,fetchCsrfToken:()=>"",isHiverApiDomain:!0},withCredentials:!0}),ug=e=>N.createElement("svg",{width:17,height:17,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_1180_840)"},N.createElement("path",{d:"M5.16667 10.12H9.83333V11.4533H5.16667V10.12ZM5.16667 7.45329H11.8333V8.78662H5.16667V7.45329ZM5.16667 4.78662H11.8333V6.11995H5.16667V4.78662ZM13.1667 2.11995H10.38C10.1 1.34662 9.36667 0.786621 8.5 0.786621C7.63333 0.786621 6.9 1.34662 6.62 2.11995H3.83333C3.74 2.11995 3.65333 2.12662 3.56667 2.14662C3.30667 2.19995 3.07333 2.33329 2.89333 2.51329C2.77333 2.63329 2.67333 2.77995 2.60667 2.93995C2.54 3.09329 2.5 3.26662 2.5 3.45329V12.7866C2.5 12.9666 2.54 13.1466 2.60667 13.3066C2.67333 13.4666 2.77333 13.6066 2.89333 13.7333C3.07333 13.9133 3.30667 14.0466 3.56667 14.1C3.65333 14.1133 3.74 14.12 3.83333 14.12H13.1667C13.9 14.12 14.5 13.52 14.5 12.7866V3.45329C14.5 2.71995 13.9 2.11995 13.1667 2.11995ZM8.5 1.95329C8.77333 1.95329 9 2.17995 9 2.45329C9 2.72662 8.77333 2.95329 8.5 2.95329C8.22667 2.95329 8 2.72662 8 2.45329C8 2.17995 8.22667 1.95329 8.5 1.95329ZM13.1667 12.7866H3.83333V3.45329H13.1667V12.7866Z",fill:"#343C45"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_1180_840"},N.createElement("rect",{width:16,height:16,fill:"white",transform:"translate(0.5 0.120117)"})))),dg=e=>N.createElement("svg",{width:24,height:22,viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("rect",{x:3.63636,y:2.27393,width:15.2727,height:17.2308,rx:2.90909,fill:"#F6C035"}),N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.4621 12.0506C22.1745 11.7669 21.7845 11.6074 21.3779 11.6074C20.9712 11.6074 20.5812 11.7669 20.2937 12.0506L19.9323 12.4079L22.4626 14.9057L22.8235 14.549C22.9659 14.4084 23.0789 14.2415 23.156 14.0578C23.2331 13.8741 23.2727 13.6773 23.2727 13.4784C23.2727 13.2796 23.2331 13.0827 23.156 12.8991C23.0789 12.7154 22.9659 12.5485 22.8235 12.4079L22.4621 12.0506ZM21.7393 15.6192L19.209 13.1214L14.5624 17.7088C14.4607 17.8092 14.3897 17.9358 14.3574 18.0742L13.8314 20.3222C13.8118 20.4056 13.814 20.4927 13.8379 20.575C13.8618 20.6574 13.9065 20.7324 13.9679 20.793C14.0293 20.8535 14.1052 20.8977 14.1887 20.9213C14.2721 20.9448 14.3603 20.9471 14.4448 20.9277L16.7226 20.409C16.8626 20.377 16.9906 20.3069 17.0922 20.2066L21.7393 15.6192Z",fill:"#FFE298"}),N.createElement("rect",{x:6.54546,y:6.58154,width:10.1818,height:1.4359,rx:.717949,fill:"#FFDC83"}),N.createElement("rect",{x:6.54546,y:10.1714,width:10.1818,height:1.4359,rx:.717949,fill:"#FFDC83"}),N.createElement("rect",{x:6.54546,y:13.7612,width:6.54545,height:1.4359,rx:.717949,fill:"#FFDC83"})),fg=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_825_73646)"},N.createElement("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z",fill:"#6F7C90"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_825_73646"},N.createElement("rect",{width:24,height:24,fill:"white"})))),pg="Rate your experience with Hiver Apps",hg="Share feedback on Apps",gg="Got any feedback?",pu="https://txeep2wshyx.typeform.com/to/RuOwF9SG",mg="https://txeep2wshyx.typeform.com/to/Tfa8IrCd",bg="https://txeep2wshyx.typeform.com/to/bqhVSfDk",yg="https://cdn.hiverhq.com/chat-support/hiver-chat.html",Cg="enable_connectors_clicked",vg="learn_more_clicked",xg="connector_card_expand_clicked",Eg="connector_card_collapsed_clicked",Ig="connector_card_refresh_clicked",wg="connector_cards_loaded",Ag="connector_whats_new_card_viewed",_g="connector_whats_new_explore_now_clicked",Tg="connector_whats_new_learn_more_clicked",Sg="connector_whats_new_dismissed",Lg="connector_create_new_object_clicked",Og="connector_link_new_object_clicked",Dg="connector_new_object_created_by_form",Fg="connector_new_object_linked_by_form",kg="connector_object_unlinked_by_form",Ng="connector_link_preview_clicked",Rg="connector_create_panel_cancel_clicked",Mg="connector_create_panel_back_clicked",Pg="card_loaded_on_click",Bg="card_loaded",jg="schedule_call_clicked",Vg="schedule_call_cross_clicked",hu="CONNECTOR_EDIT_CLICKED",Gg="CONNECTOR_EDIT_REQUEST_SEND",Hg="CONNECTOR_EDIT_CANCELLED",Wg="CONNECTOR_EDIT_BACK_CLICKED",Zg="CONNECTOR_EDIT_SUCCESS",Xg="connector_video_clicked",zg="connector_card_error",la="got_any_feedback_clicked",Yg="connector_deeplink_clicked",Jg="search_bar_tapped",Qg="search_suggestions_selected",qg="search_initiated",$g="no_results_found",Ug="search_results_found",Kg="search_result_selected",em="search_result_linked",tm="feedback_closed_clicked",nm="help_btn_clicked",rm="connector_chat_support_clicked",om="missing_field_clicked",sm={userEmail:"",email:"",baseUrls:{},currentSmIds:[],metaData:void 0,availableFeatures:{},sendTrackingEvent:()=>{},conversationId:void 0,isAdmin:!1,connectorFunctions:{redirectToAdmin:()=>{}},stackingContext:{}},Ve=_.createContext(sm),ps="hiver_connectors",ua={NOT_FOUND:404},im="ftr-connector-blue-dot",gu="ftr-connectors-write-flow",am="ftr-connectors-enhancements",cm="ftr-connector-schedule-call-agent",lm="ftr-connectors-edit",um="enableAllConnectorFtr",dm="ftr-cards-open-state",fm="ftr-connectors-global-search",pm="ftr-connectors-smart-suggestions",hm="ftr-connectors-email-selection",gm="ftr-connector-agent-feedback",hs="ftr-connector-unified-view",mm="ftr-connectors-expanded-form",mu="Please refresh and try again",bm="No data available",gs="-",bu="Refresh",yu="Minimize",da="Expand",Cu="Connectors",fa="Apps",ym="Collapse",Cm="Close",vu="Link",vm="Create",xm="Update",xu="Unlink",Eu="Edit",pa="Cancel",Iu="Create new object",wu="Link existing object",Em="Are you sure you want to unlink this object?",Im="The object will be removed from this conversation for all users. However the object will still be available on {{connectorName}} if you'd like to link it back in the future.",wm="Edit card",Am="bullet_list",_m="Expanded",Tm="Collapsed",Au="Something is wrong with the {{connector_name}} Connector setup. Please check our help guide <>here<>.",_u="UNKNOWN_ERROR",Sm="https://help.hiverhq.com/custom-connectors/common-connector-errors",Tu={MAIN_BUTTON:"main_button",ICON:"create_icon"},Lm="Missing any fields? Inform us.",ha=e=>{let t=localStorage.getItem(ps);return t=t?JSON.parse(t):!1,t==null?void 0:t[e]},Om=e=>!!ha(e),Su=()=>{const{userId:e=""}=Yt()||{};return String(e)},Dm=(e,t=Su())=>{const n=ha(e);return((n==null?void 0:n.isExtensionNew)??[]).includes(t)},ga=(e,t=!1,n=!1)=>{const r=Su(),o=ha(e);if(t||!o){localStorage.removeItem(ps);const s={[e]:{...!n&&{isExtensionNew:t?[]:[r]},...n&&{extensionExpand:[r]}}};localStorage.setItem(ps,JSON.stringify(s));return}else{const s=(o==null?void 0:o.isExtensionNew)??[],i=(o==null?void 0:o.extensionExpand)??[],a={[e]:{...o,...!n&&{isExtensionNew:[...new Set([...s,r])]},...n&&{extensionExpand:[...new Set([...i,r])]}}};localStorage.setItem(ps,JSON.stringify(a));return}},tt=(e={},t)=>e&&typeof e[t]>"u"?(e==null?void 0:e[um])===!0:(e==null?void 0:e[t])===!0,Cr=(e,t)=>e.replace(/:(\w+)/g,(n,r)=>String(t[r])||""),Lu=(e,t,n,r=!1)=>{var s;const o={};return o.card_title=t,o.card_state=n?_m:Tm,r&&e?(o.data_state=e==null?void 0:e.status,o.connector_names=(s=e==null?void 0:e.data)==null?void 0:s.connectorNames):e&&(o.data_state=(e==null?void 0:e.status)||"unknown_error"),o},Ou=e=>{switch(e.cardType){case"flat":if(Array.isArray(e.data.flatDisplay)){const t=e.data.flatDisplay.filter(n=>Number(n.statusCode)!==ua.NOT_FOUND).sort((n,r)=>n.priority-r.priority);e.data.flatDisplay={data:t}}else{const t=e.data.flatDisplay.data.filter(n=>Number(n.statusCode)!==ua.NOT_FOUND).sort((n,r)=>n.priority-r.priority);e.data.flatDisplay.data=t}break;case"flat_with_list":e.data.listItems.fields=e.data.listItems.fields.map(t=>Array.isArray(t)?{data:t.sort((r,o)=>r.priority-o.priority)}:{data:t.data.sort((r,o)=>r.priority-o.priority),externalResourceId:t.externalResourceId});break}return e},Fm=e=>{if(!e||Object.keys(e).length===0)return[];const t=new Set;return Object.values(e).forEach(n=>{n.connectorNames&&n.connectorNames.forEach(r=>t.add(r))}),Array.from(t)},ms=({url:e,params:t})=>{const n=Object.entries(t).reduce((o,[s,i])=>(i!==void 0&&i!==""&&i!==null&&(o[s]=i),o),{}),r=new URL(e);return Object.entries(n).forEach(([o,s])=>{r.searchParams.set(o,s)}),r.toString()};function Du(e,t){return e.length>t?e.substring(0,t)+"...":e}const km=e=>N.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_1187_180)"},N.createElement("path",{d:"M18.3333 7.81995L12.3417 7.30329L10 1.78662L7.65833 7.31162L1.66666 7.81995L6.21666 11.7616L4.85 17.62L10 14.5116L15.15 17.62L13.7917 11.7616L18.3333 7.81995ZM10 12.9533L6.86666 14.845L7.7 11.2783L4.93333 8.87829L8.58333 8.56162L10 5.20329L11.425 8.56995L15.075 8.88662L12.3083 11.2866L13.1417 14.8533L10 12.9533Z",fill:"#4D596C"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_1187_180"},N.createElement("rect",{width:20,height:20,fill:"white",transform:"translate(0 0.120117)"})))),Nm=e=>N.createElement("svg",{width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_847_49587)"},N.createElement("path",{d:"M10.6668 14.392L15.8168 17.5003L14.4502 11.642L19.0002 7.70033L13.0085 7.19199L10.6668 1.66699L8.32516 7.19199L2.3335 7.70033L6.8835 11.642L5.51683 17.5003L10.6668 14.392Z",fill:"#FFE250"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_847_49587"},N.createElement("rect",{width:20,height:20,fill:"white",transform:"translate(0.666992)"})))),Rm=b.keyframes`
34
+ `):" "+Xl(s[0]):"as no adapter specified";throw new pe("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:Ui};function Ki(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new pr(null,e)}function Yl(e){return Ki(e),e.headers=Mt.from(e.headers),e.data=qi.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),zl.getAdapter(e.adapter||Ji.adapter)(e).then(function(r){return Ki(e),r.data=qi.call(e,e.transformResponse,r),r.headers=Mt.from(r.headers),r},function(r){return Nl(r)||(Ki(e),r&&r.response&&(r.response.data=qi.call(e,e.transformResponse,r.response),r.response.headers=Mt.from(r.response.headers))),Promise.reject(r)})}const Jl="1.7.7",ea={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ea[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ql={};ea.transitional=function(t,n,r){function o(s,i){return"[Axios v"+Jl+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new pe(o(i," has been removed"+(n?" in "+n:"")),pe.ERR_DEPRECATED);return n&&!Ql[i]&&(Ql[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,i,a):!0}};function dh(e,t,n){if(typeof e!="object")throw new pe("options must be an object",pe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const a=e[s],l=a===void 0||i(a,s,e);if(l!==!0)throw new pe("option "+s+" must be "+l,pe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new pe("Unknown option "+s,pe.ERR_BAD_OPTION)}}var ta={assertOptions:dh,validators:ea};const yn=ta.validators;let us=class{constructor(t){this.defaults=t,this.interceptors={request:new Ol,response:new Ol}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
35
+ `+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Gn(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&ta.assertOptions(r,{silentJSONParsing:yn.transitional(yn.boolean),forcedJSONParsing:yn.transitional(yn.boolean),clarifyTimeoutError:yn.transitional(yn.boolean)},!1),o!=null&&(R.isFunction(o)?n.paramsSerializer={serialize:o}:ta.assertOptions(o,{encode:yn.function,serialize:yn.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&R.merge(s.common,s[n.method]);s&&R.forEach(["delete","get","head","post","put","patch","common"],y=>{delete s[y]}),n.headers=Mt.concat(i,s);const a=[];let l=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(n)===!1||(l=l&&d.synchronous,a.unshift(d.fulfilled,d.rejected))});const c=[];this.interceptors.response.forEach(function(d){c.push(d.fulfilled,d.rejected)});let u,p=0,g;if(!l){const y=[Yl.bind(this),void 0];for(y.unshift.apply(y,a),y.push.apply(y,c),g=y.length,u=Promise.resolve(n);p<g;)u=u.then(y[p++],y[p++]);return u}g=a.length;let E=n;for(p=0;p<g;){const y=a[p++],d=a[p++];try{E=y(E)}catch(f){d.call(this,f);break}}try{u=Yl.call(this,E)}catch(y){return Promise.reject(y)}for(p=0,g=c.length;p<g;)u=u.then(c[p++],c[p++]);return u}getUri(t){t=Gn(this.defaults,t);const n=Bl(t.baseURL,t.url);return Ll(n,t.params,t.paramsSerializer)}};R.forEach(["delete","get","head","options"],function(t){us.prototype[t]=function(n,r){return this.request(Gn(r||{},{method:t,url:n,data:(r||{}).data}))}}),R.forEach(["post","put","patch"],function(t){function n(r){return function(s,i,a){return this.request(Gn(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}us.prototype[t]=n(),us.prototype[t+"Form"]=n(!0)});var ds=us;class na{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,a){r.reason||(r.reason=new pr(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new na(function(o){t=o}),cancel:t}}}var fh=na;function ph(e){return function(n){return e.apply(null,n)}}function hh(e){return R.isObject(e)&&e.isAxiosError===!0}const ra={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ra).forEach(([e,t])=>{ra[t]=e});var gh=ra;function ql(e){const t=new ds(e),n=pl(ds.prototype.request,t);return R.extend(n,ds.prototype,t,{allOwnKeys:!0}),R.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return ql(Gn(e,o))},n}const He=ql(Ji);He.Axios=ds,He.CanceledError=pr,He.CancelToken=fh,He.isCancel=Nl,He.VERSION=Jl,He.toFormData=os,He.AxiosError=pe,He.Cancel=He.CanceledError,He.all=function(t){return Promise.all(t)},He.spread=ph,He.isAxiosError=hh,He.mergeConfig=Gn,He.AxiosHeaders=Mt,He.formToJSON=e=>Fl(R.isHTMLForm(e)?new FormData(e):e),He.getAdapter=zl.getAdapter,He.HttpStatusCode=gh,He.default=He;var $l=He,ve={},Cn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PLATFORM=e.TENANT_PLATFORM=e.API_CALL_ORIGIN=e.TIERS=e.APP_UI=e.CONFIG_HIVER=e.DEFAULT_INIT_CONFIG_HIVER=e.TWO_MINUTES_IN_MS=e.REFETCH_CHECK_DELAY=e.RETRY_DELAY_IN_CASE_OF_CORRUPTED_EXPIRY=e.INITIAL_RETRY_DELAY=e.MAX_BACKOFF_LIMIT=e.MAX_CONFLICT_RETRY_DELAY=e.MAX_RETRY_DELAY=e.GET_METHOD=void 0,e.GET_METHOD="GET",e.MAX_RETRY_DELAY=18e4,e.MAX_CONFLICT_RETRY_DELAY=63e3,e.MAX_BACKOFF_LIMIT=8e3,e.INITIAL_RETRY_DELAY=1e3,e.RETRY_DELAY_IN_CASE_OF_CORRUPTED_EXPIRY=3e3,e.REFETCH_CHECK_DELAY=168e4,e.TWO_MINUTES_IN_MS=2*60*1e3,e.DEFAULT_INIT_CONFIG_HIVER={getToken:!0,isHiverApiDomain:!0,fetchCsrfToken:function(){return""}},e.CONFIG_HIVER={getToken:!1,fetchCsrfToken:function(){return""},isHiverApiDomain:!0},e.APP_UI={COLLAB_SPACE:"collab-space",DEFAULT:"default"},e.TIERS={DEV:"dev",SIT:"sit",QA:"qa",PRODUCTION:"production",PROD:"prod"},e.API_CALL_ORIGIN={API_RETRY:"Api Retry"},e.TENANT_PLATFORM={GMAIL:"GMAIL",HIVERWEB:"HIVERWEB"},function(t){t[t.WEB=0]="WEB",t[t.MOBILE=1]="MOBILE"}(e.PLATFORM||(e.PLATFORM={}))})(Cn);var ft={};Object.defineProperty(ft,"__esModule",{value:!0}),ft.getProdHqConfig=ft.getProdApiConfig=ft.getSitHqConfig=ft.getSitApiConfig=ft.getDevHqConfig=ft.getDevApiConfig=void 0;var hr={heimdallTokenFetch:"/v1/token/get",heimdallLogin:"/v1/login/code",heimdallLogout:"/v1/logout",v2Login:"/api/auth/login/code",hotLogin:"/api/auth/login/code"},mh=function(){return{v2Url:"https://v2dev.hiver.space",heimdallUrl:"https://dev.hiver.space/api/heimdall-api",hotUrl:"http://local.hiverhq.co.in:3000",apiEndpoints:hr}};ft.getDevApiConfig=mh;var bh=function(){return{v2Url:"https://v2dev.hiver.space",heimdallUrl:"https://dev.hiver.space/api/heimdall-api2",hotUrl:"http://local.hiverhq.co.in:3000",apiEndpoints:hr}};ft.getDevHqConfig=bh;var yh=function(e){return{v2Url:"https://v2".concat(e,".hiver.space"),heimdallUrl:"https://".concat(e,".hiver.space/api/heimdall-api"),hotUrl:"https://api-staging.hiverhq.co.in",apiEndpoints:hr}};ft.getSitApiConfig=yh;var Ch=function(e){return{v2Url:"https://v2".concat(e,".hiver.space"),heimdallUrl:"https://".concat(e,".hiver.space/api/heimdall-api2"),hotUrl:"https://api-staging.hiverhq.co.in",apiEndpoints:hr}};ft.getSitHqConfig=Ch;var vh=function(){return{v2Url:"https://v2.hiverhq.com",heimdallUrl:"https://heimdall.hiverapi.com",hotUrl:"https://app.hiverhq.com",apiEndpoints:hr}};ft.getProdApiConfig=vh;var xh=function(){return{v2Url:"https://v2.hiverhq.com",heimdallUrl:"https://heimdall2.hiverhq.com",hotUrl:"https://app.hiverhq.com",apiEndpoints:hr}};ft.getProdHqConfig=xh;var Xt={},zt={};Object.defineProperty(zt,"__esModule",{value:!0}),zt.removeValue=zt.getValue=zt.setValue=void 0;var oa={};function Eh(e,t){oa[e]=t}zt.setValue=Eh;function Ih(e){return oa[e]}zt.getValue=Ih;function wh(e){delete oa[e]}zt.removeValue=wh,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.removeItemFromStorage=Xt.setItemInStorage=Xt.getItemFromStorage=void 0;var gr=Cn,mr=zt,Ah=function(e,t){switch(t===void 0&&(t=(0,mr.getValue)("PLATFORM")),t){case gr.PLATFORM.WEB:return sessionStorage.getItem(e);case gr.PLATFORM.MOBILE:return(0,mr.getValue)(e);default:throw Error("Invalid PLATFORM ".concat(t))}};Xt.getItemFromStorage=Ah;var _h=function(e,t,n){switch(n===void 0&&(n=(0,mr.getValue)("PLATFORM")),n){case gr.PLATFORM.WEB:return sessionStorage.setItem(e,t);case gr.PLATFORM.MOBILE:return(0,mr.setValue)(e,t);default:throw Error("Invalid PLATFORM ".concat(n))}};Xt.setItemInStorage=_h;var Th=function(e,t){switch(t===void 0&&(t=(0,mr.getValue)("PLATFORM")),t){case gr.PLATFORM.WEB:sessionStorage.removeItem(e);break;case gr.PLATFORM.MOBILE:(0,mr.removeValue)(e);break;default:throw Error("Invalid PLATFORM ".concat(t))}};Xt.removeItemFromStorage=Th;var Sh=fe&&fe.__awaiter||function(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function a(u){try{c(r.next(u))}catch(p){i(p)}}function l(u){try{c(r.throw(u))}catch(p){i(p)}}function c(u){u.done?s(u.value):o(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})},Lh=fe&&fe.__generator||function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(n=0)),n;)try{if(r=1,o&&(s=c[0]&2?o.return:c[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,c[1])).done)return s;switch(o=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,o=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],o=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(ve,"__esModule",{value:!0}),ve.expireToken=ve.invalidateToken=ve.validateToken=ve.validateAccount=ve.getConfig=ve.introduceDelay=ve.isTokenInExpiryWindow=ve.getStoredAuthData=ve.setUserDetails=ve.getRefreshInterval=ve.setTokenAndExpiry=ve.getRandomDelay=ve.hasValidToken=void 0;var nn=Cn,br=ft,wt=Xt,sa=function(){var e=new Date,t=new Date(e.getTime()+e.getTimezoneOffset()*6e4);return t},ia=function(e){var t=parseInt((0,wt.getItemFromStorage)("hiverAuthUserId")||"0"),n=parseInt((0,wt.getItemFromStorage)("hiverAuthUserGroupId")||"0"),r=e.userId,o=e.usergroupId;return t===r&&o===n};ve.validateAccount=ia;var Oh=function(e){var t=ia(e);return!Ul()&&t};ve.validateToken=Oh;var Dh=function(e){return e.apiRetry?e.apiRetry>0:!1};ve.invalidateToken=Dh;var Fh=function(){try{sessionStorage.removeItem("hiverAuthTokenExpiry")}catch{console.log("Heimdall: Unable to Remove token.")}};ve.expireToken=Fh;var kh=function(e){var t=(0,wt.getItemFromStorage)("hiverAuthTokenExpiry")||"",n=new Date(t),r=sa(),o=ia(e);return console.log("Heimdall: checking if there is a valid token",r<n&&o),r<n&&o};ve.hasValidToken=kh;var Nh=function(){return Math.floor(Math.random()*6e4)+6e4};ve.getRandomDelay=Nh;var Rh=function(e,t){if(!e||!t)throw new Error("User Id or user group Id not found in the response");(0,wt.setItemInStorage)("hiverAuthUserId",e),(0,wt.setItemInStorage)("hiverAuthUserGroupId",t)};ve.setUserDetails=Rh;var Mh=function(e,t){if(!e)throw new Error("Token not found in the response");(0,wt.setItemInStorage)("hiverAuthToken",e),(0,wt.setItemInStorage)("hiverAuthTokenExpiry",t)};ve.setTokenAndExpiry=Mh;var Ph=function(){var e=(0,wt.getItemFromStorage)("hiverAuthTokenExpiry"),t=(0,wt.getItemFromStorage)("hiverAuthToken"),n=(0,wt.getItemFromStorage)("hiverAuthUserId"),r=(0,wt.getItemFromStorage)("hiverAuthUserGroupId");return{token:t,expiryTime:e,userId:n,usergroupId:r}};ve.getStoredAuthData=Ph;var Ul=function(){var e=(0,wt.getItemFromStorage)("hiverAuthTokenExpiry")||"";if(!e)return!0;var t=sa(),n=new Date(e),r=4*60*1e3,o=n.getTime()-t.getTime()<r;return console.log({currentTime:t,expiry:n,isInExpiryWindow:o}),o};ve.isTokenInExpiryWindow=Ul;var Bh=function(e){return Sh(void 0,void 0,void 0,function(){return Lh(this,function(t){switch(t.label){case 0:return[4,new Promise(function(n){return setTimeout(n,e)})];case 1:return t.sent(),[2]}})})};ve.introduceDelay=Bh;var jh=function(e,t,n){switch(n===void 0&&(n=!0),t){case nn.TIERS.SIT:case nn.TIERS.QA:return n?(0,br.getSitApiConfig)(e):(0,br.getSitHqConfig)(e);case nn.TIERS.PRODUCTION:case nn.TIERS.PROD:return n?(0,br.getProdApiConfig)():(0,br.getProdHqConfig)();case nn.TIERS.DEV:default:return n?(0,br.getDevApiConfig)():(0,br.getDevHqConfig)()}};ve.getConfig=jh;var Vh=function(){try{var e=(0,wt.getItemFromStorage)("hiverAuthTokenExpiry");if(!e)return nn.RETRY_DELAY_IN_CASE_OF_CORRUPTED_EXPIRY;var t=new Date(e),n=sa();return t.getTime()-n.getTime()>nn.TWO_MINUTES_IN_MS?t.getTime()-nn.TWO_MINUTES_IN_MS:t.getTime()-n.getTime()}catch(r){return console.error("Heimdall: Error in getRefreshInterval",r),nn.REFETCH_CHECK_DELAY}};ve.getRefreshInterval=Vh;var lo={},Pt={},Kl;function eu(){if(Kl)return Pt;Kl=1;var e=fe&&fe.__awaiter||function(y,d,f,h){function v(C){return C instanceof f?C:new f(function(I){I(C)})}return new(f||(f=Promise))(function(C,I){function x(A){try{T(h.next(A))}catch(S){I(S)}}function w(A){try{T(h.throw(A))}catch(S){I(S)}}function T(A){A.done?C(A.value):v(A.value).then(x,w)}T((h=h.apply(y,d||[])).next())})},t=fe&&fe.__generator||function(y,d){var f={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},h,v,C,I;return I={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function x(T){return function(A){return w([T,A])}}function w(T){if(h)throw new TypeError("Generator is already executing.");for(;I&&(I=0,T[0]&&(f=0)),f;)try{if(h=1,v&&(C=T[0]&2?v.return:T[0]?v.throw||((C=v.return)&&C.call(v),0):v.next)&&!(C=C.call(v,T[1])).done)return C;switch(v=0,C&&(T=[T[0]&2,C.value]),T[0]){case 0:case 1:C=T;break;case 4:return f.label++,{value:T[1],done:!1};case 5:f.label++,v=T[1],T=[0];continue;case 7:T=f.ops.pop(),f.trys.pop();continue;default:if(C=f.trys,!(C=C.length>0&&C[C.length-1])&&(T[0]===6||T[0]===2)){f=0;continue}if(T[0]===3&&(!C||T[1]>C[0]&&T[1]<C[3])){f.label=T[1];break}if(T[0]===6&&f.label<C[1]){f.label=C[1],C=T;break}if(C&&f.label<C[2]){f.label=C[2],f.ops.push(T);break}C[2]&&f.ops.pop(),f.trys.pop();continue}T=d.call(y,f)}catch(A){T=[6,A],v=0}finally{h=C=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}};Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.logoutFromHeimdall=Pt.getTenantLoginCode=Pt.getLoginToken=Pt.getAccessToken=void 0;var n=Cn,r=su(),o=ve,s=function(y,d,f,h){var v=(0,o.getStoredAuthData)(),C=f===n.TENANT_PLATFORM.HIVERWEB?n.TENANT_PLATFORM.HIVERWEB:n.TENANT_PLATFORM.GMAIL;return{root_url:y.heimdallUrl,url:y.apiEndpoints.heimdallTokenFetch,method:n.GET_METHOD,headers:{"x-hiver-tenant":C},data:{user_id:d.userId,usergroup_id:d.usergroupId,access_token:(v==null?void 0:v.token)||"",source:h}}},i=function(y,d,f,h,v){var C=f===n.TENANT_PLATFORM.HIVERWEB?n.TENANT_PLATFORM.HIVERWEB:n.TENANT_PLATFORM.GMAIL;return{root_url:d.heimdallUrl,url:d.apiEndpoints.heimdallLogin,method:n.GET_METHOD,data:{code:y},headers:{"x-hiver-tenant":C,"x-hiver-userid":h,"x-hiver-usergroupid":v}}},a=function(y,d){var f=d===n.TENANT_PLATFORM.HIVERWEB?n.TENANT_PLATFORM.HIVERWEB:n.TENANT_PLATFORM.GMAIL;return{root_url:y.heimdallUrl,url:y.apiEndpoints.heimdallLogout,method:n.GET_METHOD,headers:{"x-hiver-tenant":f}}},l=function(y){return parseInt(y,10)},c=function(y,d,f,h){return{root_url:f===n.TENANT_PLATFORM.HIVERWEB?y.hotUrl:y.v2Url,url:f===n.TENANT_PLATFORM.HIVERWEB?y.apiEndpoints.hotLogin:y.apiEndpoints.v2Login,method:n.GET_METHOD,data:{usersession:l(d.userId),app:h||n.APP_UI.DEFAULT}}},u=function(y,d,f,h,v){return e(void 0,void 0,void 0,function(){var C,I,x,w,T,A,S;return t(this,function(F){switch(F.label){case 0:console.log("GETTOKEN tenantPlatform -> ",h),F.label=1;case 1:return F.trys.push([1,5,,6]),!(0,o.validateToken)(f)||(0,o.invalidateToken)(f)?(console.log("HEIMDALL: No valid token, fetching token"),C=s(d,f,h,v),[4,(0,r.performAxiosCall)(C)]):[3,3];case 2:return I=F.sent(),[2,{atToken:(w=I==null?void 0:I.data.at)===null||w===void 0?void 0:w.token,expiryTime:(T=I==null?void 0:I.data.at)===null||T===void 0?void 0:T.expires_at,userId:(A=I==null?void 0:I.data)===null||A===void 0?void 0:A.user_id,userGroupId:(S=I==null?void 0:I.data)===null||S===void 0?void 0:S.usergroup_id}];case 3:return console.log("Heimdall: Valid token already exists"),[2,{}];case 4:return[3,6];case 5:throw x=F.sent(),x;case 6:return[2]}})})};Pt.getAccessToken=u;var p=function(y,d,f,h,v,C){return e(void 0,void 0,void 0,function(){var I,x,w,T,A,S,F;return t(this,function(D){switch(D.label){case 0:I=i(y,f,h,v,C),D.label=1;case 1:return D.trys.push([1,3,,4]),[4,(0,r.performAxiosCall)(I)];case 2:return x=D.sent(),[2,{userId:(T=x==null?void 0:x.data)===null||T===void 0?void 0:T.user_id,userGroupId:(A=x==null?void 0:x.data)===null||A===void 0?void 0:A.usergroup_id,atToken:(S=x==null?void 0:x.data.at)===null||S===void 0?void 0:S.token,expiryTime:(F=x==null?void 0:x.data.at)===null||F===void 0?void 0:F.expires_at}];case 3:throw w=D.sent(),w;case 4:return[2]}})})};Pt.getLoginToken=p;var g=function(y,d,f,h,v){return e(void 0,void 0,void 0,function(){var C,I,x;return t(this,function(w){switch(w.label){case 0:return w.trys.push([0,2,,3]),console.log("ERROR debug: in getTenantLoginCode:",v),C=c(d,f,h,v),[4,(0,r.performAxiosCall)(C)];case 1:return I=w.sent(),[2,I==null?void 0:I.data.code];case 2:throw x=w.sent(),x;case 3:return[2]}})})};Pt.getTenantLoginCode=g;var E=function(y,d,f){return f===void 0&&(f=0),e(void 0,void 0,void 0,function(){var h,v,C;return t(this,function(I){switch(I.label){case 0:return I.trys.push([0,2,,5]),h=a(y,d),[4,(0,r.performAxiosCall)(h)];case 1:return v=I.sent(),[2,v==null?void 0:v.status];case 2:return C=I.sent(),f<2?[4,E(y,d,f+1)]:[3,4];case 3:I.sent(),I.label=4;case 4:throw C;case 5:return[2]}})})};return Pt.logoutFromHeimdall=E,Pt}var fs={},Gh=fe&&fe.__awaiter||function(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function a(u){try{c(r.next(u))}catch(p){i(p)}}function l(u){try{c(r.throw(u))}catch(p){i(p)}}function c(u){u.done?s(u.value):o(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})},Hh=fe&&fe.__generator||function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(n=0)),n;)try{if(r=1,o&&(s=c[0]&2?o.return:c[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,c[1])).done)return s;switch(o=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,o=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],o=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(fs,"__esModule",{value:!0}),fs.subscribeToOnlineEvent=void 0;var tu=Cn,Wh=zt,Zh=function(e,t){switch(t===void 0&&(t=(0,Wh.getValue)("PLATFORM")),console.log("Online status detected. Fetching token..."),t){case tu.PLATFORM.WEB:return window.addEventListener("online",function(){return Gh(void 0,void 0,void 0,function(){return Hh(this,function(n){switch(n.label){case 0:return console.log("Online status detected. Fetching token..."),[4,e()];case 1:return n.sent(),[2]}})})});case tu.PLATFORM.MOBILE:e();return;default:throw Error("Invalid PLATFORM ".concat(t))}};fs.subscribeToOnlineEvent=Zh;var nu;function ru(){if(nu)return lo;nu=1;var e=fe&&fe.__awaiter||function(y,d,f,h){function v(C){return C instanceof f?C:new f(function(I){I(C)})}return new(f||(f=Promise))(function(C,I){function x(A){try{T(h.next(A))}catch(S){I(S)}}function w(A){try{T(h.throw(A))}catch(S){I(S)}}function T(A){A.done?C(A.value):v(A.value).then(x,w)}T((h=h.apply(y,d||[])).next())})},t=fe&&fe.__generator||function(y,d){var f={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},h,v,C,I;return I={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function x(T){return function(A){return w([T,A])}}function w(T){if(h)throw new TypeError("Generator is already executing.");for(;I&&(I=0,T[0]&&(f=0)),f;)try{if(h=1,v&&(C=T[0]&2?v.return:T[0]?v.throw||((C=v.return)&&C.call(v),0):v.next)&&!(C=C.call(v,T[1])).done)return C;switch(v=0,C&&(T=[T[0]&2,C.value]),T[0]){case 0:case 1:C=T;break;case 4:return f.label++,{value:T[1],done:!1};case 5:f.label++,v=T[1],T=[0];continue;case 7:T=f.ops.pop(),f.trys.pop();continue;default:if(C=f.trys,!(C=C.length>0&&C[C.length-1])&&(T[0]===6||T[0]===2)){f=0;continue}if(T[0]===3&&(!C||T[1]>C[0]&&T[1]<C[3])){f.label=T[1];break}if(T[0]===6&&f.label<C[1]){f.label=C[1],C=T;break}if(C&&f.label<C[2]){f.label=C[2],f.ops.push(T);break}C[2]&&f.ops.pop(),f.trys.pop();continue}T=d.call(y,f)}catch(A){T=[6,A],v=0}finally{h=C=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}};Object.defineProperty(lo,"__esModule",{value:!0}),lo.fetchAccessToken=void 0;var n=eu(),r=Cn,o=ve,s=fs,i,a,l,c=function(y,d,f,h,v,C){return C===void 0&&(C=r.APP_UI.DEFAULT),e(void 0,void 0,void 0,function(){var I,x,w,T,A,S,F,D,k;return t(this,function(M){switch(M.label){case 0:I=2,M.label=1;case 1:return M.trys.push([1,7,,12]),console.log("ERROR debug: in login:",C,h),x=void 0,v?[4,v()]:[3,3];case 2:return x=M.sent(),[3,5];case 3:return[4,(0,n.getTenantLoginCode)(r.CONFIG_HIVER,y,d,h,C)];case 4:x=M.sent(),M.label=5;case 5:return[4,(0,n.getLoginToken)(x,r.CONFIG_HIVER,y,h,d.userId,d.usergroupId)];case 6:return w=M.sent(),T=w.userId,A=w.userGroupId,S=w.atToken,F=w.expiryTime,(0,o.setTokenAndExpiry)(S,F),(0,o.setUserDetails)(T,A),[3,12];case 7:D=M.sent(),console.log("ERROR debug: in error login:",D,C),k=f,M.label=8;case 8:return k<I?[4,c(y,d,k+1,h,v,C)]:[3,11];case 9:M.sent(),M.label=10;case 10:return k++,[3,8];case 11:throw D;case 12:return[2]}})})},u=function(y,d,f,h,v){return e(void 0,void 0,void 0,function(){var C,I,x,w;return t(this,function(T){switch(T.label){case 0:return d<r.MAX_CONFLICT_RETRY_DELAY?[4,new Promise(function(A){return setTimeout(A,y)})]:[3,3];case 1:return T.sent(),d+=y,y*2<=r.MAX_BACKOFF_LIMIT?y*=2:y=r.MAX_BACKOFF_LIMIT,console.log("Heimdall: Fetch token post doubling conflict retry delay",y),C=f.retryDelay,I=f.configs,x=f.apiParams,w=f.appUI,[4,p(C,y,d,I,x,h,v,w)];case 2:T.sent(),T.label=3;case 3:return[2]}})})},p=function(y,d,f,h,v,C,I,x,w){return x===void 0&&(x="default"),e(void 0,void 0,void 0,function(){var T,A,S,F,D,k,M,j,H,z,U,J,Y,ae;return t(this,function(ue){switch(ue.label){case 0:return ue.trys.push([0,2,,12]),console.log("Heimdall: Interval Set on fetch token in fetchAndSaveToken:",l),[4,(0,n.getAccessToken)(r.CONFIG_HIVER,h,v,C,x)];case 1:return T=ue.sent(),A=T.atToken,S=T.expiryTime,F=T.userId,D=T.userGroupId,A&&S&&(0,o.setTokenAndExpiry)(A,S),F&&D&&(0,o.setUserDetails)(F,D),y=r.INITIAL_RETRY_DELAY,d=r.INITIAL_RETRY_DELAY,f=0,[3,12];case 2:return k=ue.sent(),console.log("ERROR: Heimdall fetch token",k),((H=k.response)===null||H===void 0?void 0:H.status)===401||((z=k.request)===null||z===void 0?void 0:z.status)===401?(M=1,[4,c(h,v,M,C,I,w)]):[3,4];case 3:return ue.sent(),[3,11];case 4:return((U=k.response)===null||U===void 0?void 0:U.status)===409||((J=k.request)===null||J===void 0?void 0:J.status)===409?(console.log("Heimdall: Fetching token post 409 in fetch And Save Token"),j={retryDelay:y,configs:h,apiParams:v,appUI:w},[4,u(d,f,j,C,I)]):[3,6];case 5:if(ue.sent(),f>=r.MAX_CONFLICT_RETRY_DELAY)throw k;return[3,11];case 6:if(!(((Y=k.response)===null||Y===void 0?void 0:Y.status)===422||((ae=k.request)===null||ae===void 0?void 0:ae.status)===422))return[3,7];throw console.log("ERROR: Throwing error",k.response.status),k;case 7:return y<=r.MAX_RETRY_DELAY?[4,new Promise(function(B){return setTimeout(B,y)})]:[3,10];case 8:return ue.sent(),y*=2,console.log("Heimdall: Fetch token post doubling retry delay",y),[4,p(y,d,f,h,v,C,I,w)];case 9:return ue.sent(),[3,11];case 10:throw k;case 11:return[3,12];case 12:return[2]}})})},g=function(y,d,f,h,v,C,I,x){return f===void 0&&(f=r.INITIAL_RETRY_DELAY),h===void 0&&(h=r.INITIAL_RETRY_DELAY),e(void 0,void 0,void 0,function(){var w,T,A;return t(this,function(S){switch(S.label){case 0:return S.trys.push([0,4,,5]),w=(0,o.isTokenInExpiryWindow)(),w?(T=(0,o.getRandomDelay)(),[4,(0,o.introduceDelay)(T)]):[3,3];case 1:return S.sent(),console.log("Heimdall: Fetching token - in expiry window"),[4,p(f,h,v,y,d,C,I,x)];case 2:S.sent(),S.label=3;case 3:return[3,5];case 4:throw A=S.sent(),A;case 5:return[2]}})})},E=function(y,d,f,h,v,C,I){return e(void 0,void 0,void 0,function(){var x,w,T,A,S,F;return t(this,function(D){switch(D.label){case 0:i=y,a=d,x=r.INITIAL_RETRY_DELAY,w=r.INITIAL_RETRY_DELAY,T=0,A=(0,o.getConfig)(i,a),console.log("Instance: Fetch Call"),D.label=1;case 1:return D.trys.push([1,3,,4]),[4,p(x,w,T,A,f,h,v,C,I)];case 2:return D.sent(),console.log("Heimdall: Interval Set on fetch token when fetch token is called:",l),clearInterval(l),l=setInterval(function(){return g(A,f,r.INITIAL_RETRY_DELAY,r.INITIAL_RETRY_DELAY,0,h,v,I)},r.REFETCH_CHECK_DELAY),S=function(){return e(void 0,void 0,void 0,function(){return t(this,function(k){switch(k.label){case 0:return[4,g(A,f,r.INITIAL_RETRY_DELAY,r.INITIAL_RETRY_DELAY,0,h,v,I)];case 1:return k.sent(),[2]}})})},console.log("Heimdall: Interval Set on fetch token:",l),(0,s.subscribeToOnlineEvent)(S),[3,4];case 3:return F=D.sent(),console.log("ERROR: Fetching token failed",F),[3,4];case 4:return[2]}})})};return lo.fetchAccessToken=E,lo}var ou;function su(){if(ou)return jn;ou=1;var e=fe&&fe.__assign||function(){return e=Object.assign||function(d){for(var f,h=1,v=arguments.length;h<v;h++){f=arguments[h];for(var C in f)Object.prototype.hasOwnProperty.call(f,C)&&(d[C]=f[C])}return d},e.apply(this,arguments)},t=fe&&fe.__awaiter||function(d,f,h,v){function C(I){return I instanceof h?I:new h(function(x){x(I)})}return new(h||(h=Promise))(function(I,x){function w(S){try{A(v.next(S))}catch(F){x(F)}}function T(S){try{A(v.throw(S))}catch(F){x(F)}}function A(S){S.done?I(S.value):C(S.value).then(w,T)}A((v=v.apply(d,f||[])).next())})},n=fe&&fe.__generator||function(d,f){var h={label:0,sent:function(){if(I[0]&1)throw I[1];return I[1]},trys:[],ops:[]},v,C,I,x;return x={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(x[Symbol.iterator]=function(){return this}),x;function w(A){return function(S){return T([A,S])}}function T(A){if(v)throw new TypeError("Generator is already executing.");for(;x&&(x=0,A[0]&&(h=0)),h;)try{if(v=1,C&&(I=A[0]&2?C.return:A[0]?C.throw||((I=C.return)&&I.call(C),0):C.next)&&!(I=I.call(C,A[1])).done)return I;switch(C=0,I&&(A=[A[0]&2,I.value]),A[0]){case 0:case 1:I=A;break;case 4:return h.label++,{value:A[1],done:!1};case 5:h.label++,C=A[1],A=[0];continue;case 7:A=h.ops.pop(),h.trys.pop();continue;default:if(I=h.trys,!(I=I.length>0&&I[I.length-1])&&(A[0]===6||A[0]===2)){h=0;continue}if(A[0]===3&&(!I||A[1]>I[0]&&A[1]<I[3])){h.label=A[1];break}if(A[0]===6&&h.label<I[1]){h.label=I[1],I=A;break}if(I&&h.label<I[2]){h.label=I[2],h.ops.push(A);break}I[2]&&h.ops.pop(),h.trys.pop();continue}A=f.call(d,h)}catch(S){A=[6,S],C=0}finally{v=I=0}if(A[0]&5)throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}};Object.defineProperty(jn,"__esModule",{value:!0}),jn.hiverAxiosCall=jn.performAxiosCall=void 0;var r=$l,o=ve,s=ru(),i=Xt,a=Cn,l,c=2,u=function(d,f){var h=f.fetchCsrfToken();d.formData?d.formData.append("_csrf_token",h):(d.data=d.data||{},d.data._csrf_token=h)},p=function(d,f){var h={};!d.method||d.method.toLowerCase()==="get"?h={params:d.params?d.params:d.data}:h=d.params?{params:d,data:d.data}:{data:d.data};var v=e(e({method:d.method,url:"".concat(d.root_url).concat(d.url),headers:d.headers},h),{withCredentials:f,responseType:(d==null?void 0:d.responseType)||""});return v};function g(d,f){return f===void 0&&(f=!0),t(this,void 0,void 0,function(){var h;return n(this,function(v){return h=p(d,f),[2,(0,r.default)(h).then(function(C){return C}).catch(function(C){throw C})]})})}jn.performAxiosCall=g;function E(d,f,h){return t(this,void 0,void 0,function(){var v,C,I;return n(this,function(x){switch(x.label){case 0:return x.trys.push([0,6,,8]),d.authTokenFetchingInProgress?[3,2]:(d.authTokenFetchingInProgress=!0,v=d.appEnv,C=d.tier,[4,(0,s.fetchAccessToken)(v,C,f,d.tenantPlatform,d.getTokenForLogin,h)]);case 1:return x.sent(),d.authTokenFetchingInProgress=!1,[3,5];case 2:return[4,new Promise(function(w){return setTimeout(w,100)})];case 3:return x.sent(),console.log("Heimdall: Retrying fetchAccessToken after 100ms..."),[4,E(d,f,h)];case 4:x.sent(),x.label=5;case 5:return[3,8];case 6:return I=x.sent(),console.log("Error while fetching Auth Token :",I),d.authTokenFetchingInProgress=!1,[4,E(d,f,h)];case 7:return x.sent(),[3,8];case 8:return[2]}})})}function y(d,f,h,v,C){var I,x;return C===void 0&&(C=0),t(this,void 0,void 0,function(){var w,T,A,S,F,D,k;return n(this,function(M){switch(M.label){case 0:if(M.trys.push([0,4,,5]),!(h.getToken&&!(0,o.hasValidToken)(f)))return[3,2];if(w=d.appEnv,T=d.tier,!w||!T)throw Error("appEnv or tier missing : ".concat(w,"/").concat(T));return"userId"in f&&"usergroupId"in f?(A={userId:f.userId,usergroupId:f.usergroupId},[4,E(d,A,v)]):[3,2];case 1:M.sent(),M.label=2;case 2:return d.csrfToken&&u(f,h),S=d.tenantPlatform===a.TENANT_PLATFORM.HIVERWEB?a.TENANT_PLATFORM.HIVERWEB:a.TENANT_PLATFORM.GMAIL,f.headers=e(e({},f.headers),{"x-hiver-tenant":S,"x-hiver-userid":(0,i.getItemFromStorage)("hiverAuthUserId")||"0","x-hiver-usergroupid":(0,i.getItemFromStorage)("hiverAuthUserGroupId")||"0"}),h.getToken&&(l=(0,i.getItemFromStorage)("hiverAuthToken")||"",f.headers=e(e({},f.headers),{Authorization:"Bearer ".concat(l)})),console.log("Performing axios call for:",f),[4,g(f,d.withCredentials)];case 3:return F=M.sent(),f.onSuccess&&f.onSuccess(F),[2,F];case 4:if(D=M.sent(),k=((I=D.response)===null||I===void 0?void 0:I.status)===403||((x=D.request)===null||x===void 0?void 0:x.status)===403,C<c&&k)return(0,o.expireToken)(),[2,y(d,f,h,v,C+1)];if(C>=c&&k||!k)throw f.onFail&&f.onFail(D),console.log("ERROR: Reached make Axios",D),D;return[3,5];case 5:return[2]}})})}return jn.hiverAxiosCall=y,jn}var uo={},Fe={},Pe={};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.TIERS=Pe.APP_UI=Pe.CONFIG_HIVER=Pe.REFETCH_CHECK_DELAY=Pe.INITIAL_RETRY_DELAY=Pe.MAX_BACKOFF_LIMIT=Pe.MAX_CONFLICT_RETRY_DELAY=Pe.MAX_RETRY_DELAY=Pe.GET_METHOD=void 0,Pe.GET_METHOD="GET",Pe.MAX_RETRY_DELAY=18e4,Pe.MAX_CONFLICT_RETRY_DELAY=63e3,Pe.MAX_BACKOFF_LIMIT=8e3,Pe.INITIAL_RETRY_DELAY=1e3,Pe.REFETCH_CHECK_DELAY=168e4,Pe.CONFIG_HIVER={getToken:!1,fetchCsrfToken:function(){return""},isHiverApiDomain:!0},Pe.APP_UI={COLLAB_SPACE:"collab-space",DEFAULT:"default"},Pe.TIERS={DEV:"dev",SIT:"sit",PROD:"production"};var pt={};Object.defineProperty(pt,"__esModule",{value:!0}),pt.getProdHqConfig=pt.getProdApiConfig=pt.getSitHqConfig=pt.getSitApiConfig=pt.getDevHqConfig=pt.getDevApiConfig=void 0;var yr={heimdallTokenFetch:"/v1/token/get",heimdallLogin:"/v1/login/code",v2Login:"/api/auth/login/code"},Xh=function(){return{v2Url:"https://v2dev.hiver.space",heimdallUrl:"https://dev.hiver.space/api/heimdall-api",apiEndpoints:yr}};pt.getDevApiConfig=Xh;var zh=function(){return{v2Url:"https://v2dev.hiver.space",heimdallUrl:"https://dev.hiver.space/api/heimdall-api2",apiEndpoints:yr}};pt.getDevHqConfig=zh;var Yh=function(e){return{v2Url:"https://v2".concat(e,".hiver.space"),heimdallUrl:"https://".concat(e,".hiver.space/api/heimdall-api"),apiEndpoints:yr}};pt.getSitApiConfig=Yh;var Jh=function(e){return{v2Url:"https://v2".concat(e,".hiver.space"),heimdallUrl:"https://".concat(e,".hiver.space/api/heimdall-api2"),apiEndpoints:yr}};pt.getSitHqConfig=Jh;var Qh=function(){return{v2Url:"https://v2.hiverhq.com",heimdallUrl:"https://heimdall.hiverapi.com",apiEndpoints:yr}};pt.getProdApiConfig=Qh;var qh=function(){return{v2Url:"https://v2.hiverhq.com",heimdallUrl:"https://heimdall2.hiverhq.com",apiEndpoints:yr}};pt.getProdHqConfig=qh;var $h=fe&&fe.__awaiter||function(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function a(u){try{c(r.next(u))}catch(p){i(p)}}function l(u){try{c(r.throw(u))}catch(p){i(p)}}function c(u){u.done?s(u.value):o(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})},Uh=fe&&fe.__generator||function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(n=0)),n;)try{if(r=1,o&&(s=c[0]&2?o.return:c[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,c[1])).done)return s;switch(o=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,o=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],o=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.expireToken=Fe.validateToken=Fe.validateAccount=Fe.getConfig=Fe.introduceDelay=Fe.isTokenInExpiryWindow=Fe.getStoredAuthData=Fe.setUserDetails=Fe.setTokenAndExpiry=Fe.getRandomDelay=Fe.hasValidToken=void 0;var aa=Pe,Hn=pt,iu=function(){var e=new Date,t=new Date(e.getTime()+e.getTimezoneOffset()*6e4);return t},ca=function(e){var t=parseInt(sessionStorage.getItem("hiverAuthUserId")||"0"),n=parseInt(sessionStorage.getItem("hiverAuthUserGroupId")||"0"),r=e.userId,o=e.usergroupId;return t===r&&o===n};Fe.validateAccount=ca;var Kh=function(e){var t=ca(e);return!au()&&t};Fe.validateToken=Kh;var eg=function(){try{sessionStorage.removeItem("hiverAuthTokenExpiry")}catch{console.log("Heimdall: Unable to Remove token.")}};Fe.expireToken=eg;var tg=function(e){console.log("Heimdall: checking if there is a valid token");var t=sessionStorage.getItem("hiverAuthTokenExpiry")||"",n=new Date(t),r=iu(),o=ca(e);return r<n&&o};Fe.hasValidToken=tg;var ng=function(){return Math.floor(Math.random()*6e4)+6e4};Fe.getRandomDelay=ng;var rg=function(e,t){if(!e||!t)throw new Error("User Id or user group Id not found in the response");sessionStorage.setItem("hiverAuthUserId",e),sessionStorage.setItem("hiverAuthUserGroupId",t)};Fe.setUserDetails=rg;var og=function(e,t){if(!e)throw new Error("Token not found in the response");sessionStorage.setItem("hiverAuthToken",e),sessionStorage.setItem("hiverAuthTokenExpiry",t)};Fe.setTokenAndExpiry=og;var sg=function(){var e=sessionStorage.getItem("hiverAuthTokenExpiry"),t=sessionStorage.getItem("hiverAuthToken"),n=sessionStorage.getItem("hiverAuthUserId"),r=sessionStorage.getItem("hiverAuthUserGroupId");return{token:t,expiryTime:e,userId:n,usergroupId:r}};Fe.getStoredAuthData=sg;var au=function(){var e=sessionStorage.getItem("hiverAuthTokenExpiry")||"";if(!e)return!0;var t=iu(),n=new Date(e),r=4*60*1e3,o=n.getTime()-t.getTime()<r;return console.log({currentTime:t,expiry:n,isInExpiryWindow:o}),o};Fe.isTokenInExpiryWindow=au;var ig=function(e){return $h(void 0,void 0,void 0,function(){return Uh(this,function(t){switch(t.label){case 0:return[4,new Promise(function(n){return setTimeout(n,e)})];case 1:return t.sent(),[2]}})})};Fe.introduceDelay=ig;var ag=function(e,t,n){switch(t){case aa.TIERS.SIT:return console.log("ISHIVERAPIDOMAIN:",n,(0,Hn.getSitHqConfig)(e)),n?(0,Hn.getSitApiConfig)(e):(0,Hn.getSitHqConfig)(e);case aa.TIERS.PROD:return n?(0,Hn.getProdApiConfig)():(0,Hn.getProdHqConfig)();case aa.TIERS.DEV:default:return n?(0,Hn.getDevApiConfig)():(0,Hn.getDevHqConfig)()}};Fe.getConfig=ag;var fo={},rn={},cu;function cg(){if(cu)return rn;cu=1;var e=fe&&fe.__awaiter||function(g,E,y,d){function f(h){return h instanceof y?h:new y(function(v){v(h)})}return new(y||(y=Promise))(function(h,v){function C(w){try{x(d.next(w))}catch(T){v(T)}}function I(w){try{x(d.throw(w))}catch(T){v(T)}}function x(w){w.done?h(w.value):f(w.value).then(C,I)}x((d=d.apply(g,E||[])).next())})},t=fe&&fe.__generator||function(g,E){var y={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},d,f,h,v;return v={next:C(0),throw:C(1),return:C(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function C(x){return function(w){return I([x,w])}}function I(x){if(d)throw new TypeError("Generator is already executing.");for(;v&&(v=0,x[0]&&(y=0)),y;)try{if(d=1,f&&(h=x[0]&2?f.return:x[0]?f.throw||((h=f.return)&&h.call(f),0):f.next)&&!(h=h.call(f,x[1])).done)return h;switch(f=0,h&&(x=[x[0]&2,h.value]),x[0]){case 0:case 1:h=x;break;case 4:return y.label++,{value:x[1],done:!1};case 5:y.label++,f=x[1],x=[0];continue;case 7:x=y.ops.pop(),y.trys.pop();continue;default:if(h=y.trys,!(h=h.length>0&&h[h.length-1])&&(x[0]===6||x[0]===2)){y=0;continue}if(x[0]===3&&(!h||x[1]>h[0]&&x[1]<h[3])){y.label=x[1];break}if(x[0]===6&&y.label<h[1]){y.label=h[1],h=x;break}if(h&&y.label<h[2]){y.label=h[2],y.ops.push(x);break}h[2]&&y.ops.pop(),y.trys.pop();continue}x=E.call(g,y)}catch(w){x=[6,w],f=0}finally{d=h=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}};Object.defineProperty(rn,"__esModule",{value:!0}),rn.getV2LoginCode=rn.getLoginToken=rn.getAccessToken=void 0;var n=Pe,r=fu(),o=Fe,s=function(g,E,y){var d=(0,o.getStoredAuthData)();return{root_url:g.heimdallUrl,url:g.apiEndpoints.heimdallTokenFetch,method:n.GET_METHOD,data:{user_id:E.userId,usergroup_id:E.usergroupId,access_token:(d==null?void 0:d.token)||"",source:y},withCredentials:!0}},i=function(g,E){return{root_url:E.heimdallUrl,url:E.apiEndpoints.heimdallLogin,method:n.GET_METHOD,data:{code:g},withCredentials:!0}},a=function(g){return parseInt(g,10)},l=function(g,E){return{root_url:g.v2Url,url:g.apiEndpoints.v2Login,method:n.GET_METHOD,withCredentials:!0,data:{usersession:a(localStorage.getItem("hiver-config.usersession")),app:E||n.APP_UI.DEFAULT}}},c=function(g,E,y,d){return e(void 0,void 0,void 0,function(){var f,h,v,C,I,x,w;return t(this,function(T){switch(T.label){case 0:return T.trys.push([0,4,,5]),(0,o.validateToken)(y)?[3,2]:(console.log("HEIMDALL: No valid token, fetching token"),f=s(E,y,d),[4,(0,r.makeAxiosCall)(f,g)]);case 1:return h=T.sent(),[2,{atToken:(C=h==null?void 0:h.data.at)===null||C===void 0?void 0:C.token,expiryTime:(I=h==null?void 0:h.data.at)===null||I===void 0?void 0:I.expires_at,userId:(x=h==null?void 0:h.data)===null||x===void 0?void 0:x.user_id,userGroupId:(w=h==null?void 0:h.data)===null||w===void 0?void 0:w.usergroup_id}];case 2:return console.log("Heimdall: Valid token already exists"),[2,{}];case 3:return[3,5];case 4:throw v=T.sent(),v;case 5:return[2]}})})};rn.getAccessToken=c;var u=function(g,E,y){return e(void 0,void 0,void 0,function(){var d,f,h,v,C,I,x;return t(this,function(w){switch(w.label){case 0:d=i(g,y),w.label=1;case 1:return w.trys.push([1,3,,4]),[4,(0,r.makeAxiosCall)(d,E)];case 2:return f=w.sent(),[2,{userId:(v=f==null?void 0:f.data)===null||v===void 0?void 0:v.user_id,userGroupId:(C=f==null?void 0:f.data)===null||C===void 0?void 0:C.usergroup_id,atToken:(I=f==null?void 0:f.data.at)===null||I===void 0?void 0:I.token,expiryTime:(x=f==null?void 0:f.data.at)===null||x===void 0?void 0:x.expires_at}];case 3:throw h=w.sent(),h;case 4:return[2]}})})};rn.getLoginToken=u;var p=function(g,E,y){return e(void 0,void 0,void 0,function(){var d,f,h;return t(this,function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),console.log("ERROR debug: in getV2loginCode:",y),d=l(E,y),[4,(0,r.makeAxiosCall)(d,g)];case 1:return f=v.sent(),console.log("DEBUG HEIMDALL: local storage:",f==null?void 0:f.data),[2,f==null?void 0:f.data.code];case 2:throw h=v.sent(),h;case 3:return[2]}})})};return rn.getV2LoginCode=p,rn}var lu;function uu(){if(lu)return fo;lu=1;var e=fe&&fe.__awaiter||function(E,y,d,f){function h(v){return v instanceof d?v:new d(function(C){C(v)})}return new(d||(d=Promise))(function(v,C){function I(T){try{w(f.next(T))}catch(A){C(A)}}function x(T){try{w(f.throw(T))}catch(A){C(A)}}function w(T){T.done?v(T.value):h(T.value).then(I,x)}w((f=f.apply(E,y||[])).next())})},t=fe&&fe.__generator||function(E,y){var d={label:0,sent:function(){if(v[0]&1)throw v[1];return v[1]},trys:[],ops:[]},f,h,v,C;return C={next:I(0),throw:I(1),return:I(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function I(w){return function(T){return x([w,T])}}function x(w){if(f)throw new TypeError("Generator is already executing.");for(;C&&(C=0,w[0]&&(d=0)),d;)try{if(f=1,h&&(v=w[0]&2?h.return:w[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,w[1])).done)return v;switch(h=0,v&&(w=[w[0]&2,v.value]),w[0]){case 0:case 1:v=w;break;case 4:return d.label++,{value:w[1],done:!1};case 5:d.label++,h=w[1],w=[0];continue;case 7:w=d.ops.pop(),d.trys.pop();continue;default:if(v=d.trys,!(v=v.length>0&&v[v.length-1])&&(w[0]===6||w[0]===2)){d=0;continue}if(w[0]===3&&(!v||w[1]>v[0]&&w[1]<v[3])){d.label=w[1];break}if(w[0]===6&&d.label<v[1]){d.label=v[1],v=w;break}if(v&&d.label<v[2]){d.label=v[2],d.ops.push(w);break}v[2]&&d.ops.pop(),d.trys.pop();continue}w=y.call(E,d)}catch(T){w=[6,T],h=0}finally{f=v=0}if(w[0]&5)throw w[1];return{value:w[0]?w[1]:void 0,done:!0}}};Object.defineProperty(fo,"__esModule",{value:!0}),fo.fetchToken=void 0;var n=cg(),r=Pe,o=Fe,s,i,a,l=function(E,y,d){return d===void 0&&(d=r.APP_UI.DEFAULT),e(void 0,void 0,void 0,function(){var f,h,v,C,I,x,w,T,A;return t(this,function(S){switch(S.label){case 0:f=2,S.label=1;case 1:return S.trys.push([1,4,,9]),console.log("ERROR debug: in login:",d),[4,(0,n.getV2LoginCode)(r.CONFIG_HIVER,E,d)];case 2:return h=S.sent(),[4,(0,n.getLoginToken)(h,r.CONFIG_HIVER,E)];case 3:return v=S.sent(),C=v.userId,I=v.userGroupId,x=v.atToken,w=v.expiryTime,(0,o.setTokenAndExpiry)(x,w),(0,o.setUserDetails)(C,I),[3,9];case 4:T=S.sent(),console.log("ERROR debug: in error login:",T,d),A=y,S.label=5;case 5:return A<f?[4,l(E,A+1,d)]:[3,8];case 6:S.sent(),S.label=7;case 7:return A++,[3,5];case 8:throw T;case 9:return[2]}})})},c=function(E,y,d){return e(void 0,void 0,void 0,function(){var f,h,v,C;return t(this,function(I){switch(I.label){case 0:return y<r.MAX_CONFLICT_RETRY_DELAY?[4,new Promise(function(x){return setTimeout(x,E)})]:[3,3];case 1:return I.sent(),y+=E,E*2<=r.MAX_BACKOFF_LIMIT?E*=2:E=r.MAX_BACKOFF_LIMIT,console.log("Heimdall: Fetch token post doubling conflict retry delay",E),f=d.retryDelay,h=d.configs,v=d.api_params,C=d.appUI,[4,u(f,E,y,h,v,C)];case 2:I.sent(),I.label=3;case 3:return[2]}})})},u=function(E,y,d,f,h,v,C){return v===void 0&&(v="default"),e(void 0,void 0,void 0,function(){var I,x,w,T,A,S,F,D,k,M,j,H,z,U;return t(this,function(J){switch(J.label){case 0:return J.trys.push([0,2,,12]),console.log("Heimdall: Interval Set on fetch token in fetchAndSaveToken:",a),[4,(0,n.getAccessToken)(r.CONFIG_HIVER,f,h,v)];case 1:return I=J.sent(),x=I.atToken,w=I.expiryTime,T=I.userId,A=I.userGroupId,x&&w&&(0,o.setTokenAndExpiry)(x,w),T&&A&&(0,o.setUserDetails)(T,A),E=r.INITIAL_RETRY_DELAY,y=r.INITIAL_RETRY_DELAY,d=0,[3,12];case 2:return S=J.sent(),console.log("ERROR: Heimdall fetch token",S),((k=S.response)===null||k===void 0?void 0:k.status)===401||((M=S.request)===null||M===void 0?void 0:M.status)===401?(F=1,[4,l(f,F,C)]):[3,4];case 3:return J.sent(),[3,11];case 4:return((j=S.response)===null||j===void 0?void 0:j.status)===409||((H=S.request)===null||H===void 0?void 0:H.status)===409?(console.log("Heimdall: Fetching token post 409 in fetch And Save Token"),D={retryDelay:E,configs:f,api_params:h,appUI:C},[4,c(y,d,D)]):[3,6];case 5:if(J.sent(),d>=r.MAX_CONFLICT_RETRY_DELAY)throw S;return[3,11];case 6:if(!(((z=S.response)===null||z===void 0?void 0:z.status)===422||((U=S.request)===null||U===void 0?void 0:U.status)===422))return[3,7];throw console.log("ERROR: Throwing error",S.response.status),S;case 7:return E<=r.MAX_RETRY_DELAY?[4,new Promise(function(Y){return setTimeout(Y,E)})]:[3,10];case 8:return J.sent(),E*=2,console.log("Heimdall: Fetch token post doubling retry delay",E),[4,u(E,y,d,f,h,C)];case 9:return J.sent(),[3,11];case 10:throw S;case 11:return[3,12];case 12:return[2]}})})},p=function(E,y,d,f,h,v){return d===void 0&&(d=r.INITIAL_RETRY_DELAY),f===void 0&&(f=r.INITIAL_RETRY_DELAY),h===void 0&&(h=0),e(void 0,void 0,void 0,function(){var C,I,x;return t(this,function(w){switch(w.label){case 0:return w.trys.push([0,4,,5]),C=(0,o.isTokenInExpiryWindow)(),C?(I=(0,o.getRandomDelay)(),[4,(0,o.introduceDelay)(I)]):[3,3];case 1:return w.sent(),console.log("Heimdall: Fetching token - in expiry window"),[4,u(d,f,h,E,y,v)];case 2:w.sent(),w.label=3;case 3:return[3,5];case 4:throw x=w.sent(),x;case 5:return[2]}})})},g=function(E,y,d,f,h,v){return e(void 0,void 0,void 0,function(){var C,I,x,w,T;return t(this,function(A){switch(A.label){case 0:s=E,i=y,C=r.INITIAL_RETRY_DELAY,I=r.INITIAL_RETRY_DELAY,x=0,w=(0,o.getConfig)(s,i,f),A.label=1;case 1:return A.trys.push([1,3,,4]),[4,u(C,I,x,w,d,h,v)];case 2:return A.sent(),console.log("Heimdall: Interval Set on fetch token when fetch token is called:",a),clearInterval(a),a=setInterval(function(){return p(w,d)},r.REFETCH_CHECK_DELAY),console.log("Heimdall: Interval Set on fetch token:",a),window.addEventListener("online",function(){return e(void 0,void 0,void 0,function(){return t(this,function(S){switch(S.label){case 0:return console.log("Online status detected. Fetching token..."),[4,p(w,d)];case 1:return S.sent(),[2]}})})}),[3,4];case 3:throw T=A.sent(),T;case 4:return[2]}})})};return fo.fetchToken=g,fo}var du;function fu(){if(du)return uo;du=1;var e=fe&&fe.__assign||function(){return e=Object.assign||function(g){for(var E,y=1,d=arguments.length;y<d;y++){E=arguments[y];for(var f in E)Object.prototype.hasOwnProperty.call(E,f)&&(g[f]=E[f])}return g},e.apply(this,arguments)},t=fe&&fe.__awaiter||function(g,E,y,d){function f(h){return h instanceof y?h:new y(function(v){v(h)})}return new(y||(y=Promise))(function(h,v){function C(w){try{x(d.next(w))}catch(T){v(T)}}function I(w){try{x(d.throw(w))}catch(T){v(T)}}function x(w){w.done?h(w.value):f(w.value).then(C,I)}x((d=d.apply(g,E||[])).next())})},n=fe&&fe.__generator||function(g,E){var y={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},d,f,h,v;return v={next:C(0),throw:C(1),return:C(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function C(x){return function(w){return I([x,w])}}function I(x){if(d)throw new TypeError("Generator is already executing.");for(;v&&(v=0,x[0]&&(y=0)),y;)try{if(d=1,f&&(h=x[0]&2?f.return:x[0]?f.throw||((h=f.return)&&h.call(f),0):f.next)&&!(h=h.call(f,x[1])).done)return h;switch(f=0,h&&(x=[x[0]&2,h.value]),x[0]){case 0:case 1:h=x;break;case 4:return y.label++,{value:x[1],done:!1};case 5:y.label++,f=x[1],x=[0];continue;case 7:x=y.ops.pop(),y.trys.pop();continue;default:if(h=y.trys,!(h=h.length>0&&h[h.length-1])&&(x[0]===6||x[0]===2)){y=0;continue}if(x[0]===3&&(!h||x[1]>h[0]&&x[1]<h[3])){y.label=x[1];break}if(x[0]===6&&y.label<h[1]){y.label=h[1],h=x;break}if(h&&y.label<h[2]){y.label=h[2],y.ops.push(x);break}h[2]&&y.ops.pop(),y.trys.pop();continue}x=E.call(g,y)}catch(w){x=[6,w],f=0}finally{d=h=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}};Object.defineProperty(uo,"__esModule",{value:!0}),uo.makeAxiosCall=void 0;var r=$l,o=Fe,s=uu(),i,a=2,l=function(g,E){var y=E.fetchCsrfToken();g.formData?g.formData.append("_csrf_token",y):(g.data=g.data||{},g.data._csrf_token=y)},c=function(g){var E=!g.method||g.method.toLowerCase()==="get"?{params:g.data}:{data:g.data},y=e(e({method:g.method,url:"".concat(g.root_url).concat(g.url),headers:g.headers},E),{withCredentials:g.withCredentials,responseType:(g==null?void 0:g.responseType)||""});return y};function u(g){return t(this,void 0,void 0,function(){var E;return n(this,function(y){return E=c(g),[2,(0,r.default)(E).then(function(d){return d}).catch(function(d){throw d})]})})}function p(g,E,y,d){var f,h;return d===void 0&&(d=0),t(this,void 0,void 0,function(){var v,C,I,x,w,T;return n(this,function(A){switch(A.label){case 0:if(A.trys.push([0,4,,5]),!(E.getToken&&!(0,o.hasValidToken)(g)))return[3,2];if(v=g.app_env,C=g.tier,!v||!C)throw Error("app_env or tier missing : ".concat(v,"/").concat(C));return"userId"in g&&"usergroupId"in g?(I={userId:g.userId,usergroupId:g.usergroupId},typeof E.isHiverApiDomain!="boolean"&&(E.isHiverApiDomain=!0),[4,(0,s.fetchToken)(v,C,I,E.isHiverApiDomain,y)]):[3,2];case 1:A.sent(),A.label=2;case 2:return g.csrfToken&&l(g,E),E.getToken&&(i=sessionStorage.getItem("hiverAuthToken")||"",g.headers=e(e({},g.headers),{Authorization:"Bearer ".concat(i)})),[4,u(g)];case 3:return x=A.sent(),g.onSuccess&&g.onSuccess(x),[2,x];case 4:if(w=A.sent(),T=((f=w.response)===null||f===void 0?void 0:f.status)===403||((h=w.request)===null||h===void 0?void 0:h.status)===403,d<a&&T)return(0,o.expireToken)(),[2,p(g,E,y,d+1)];if(d>=a&&T||!T)throw g.onFail&&g.onFail(w),console.log("ERROR: Reached make Axios",w),w;return[3,5];case 5:return[2]}})})}return uo.makeAxiosCall=p,uo}(function(e){var t=fe&&fe.__awaiter||function(E,y,d,f){function h(v){return v instanceof d?v:new d(function(C){C(v)})}return new(d||(d=Promise))(function(v,C){function I(T){try{w(f.next(T))}catch(A){C(A)}}function x(T){try{w(f.throw(T))}catch(A){C(A)}}function w(T){T.done?v(T.value):h(T.value).then(I,x)}w((f=f.apply(E,y||[])).next())})},n=fe&&fe.__generator||function(E,y){var d={label:0,sent:function(){if(v[0]&1)throw v[1];return v[1]},trys:[],ops:[]},f,h,v,C;return C={next:I(0),throw:I(1),return:I(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function I(w){return function(T){return x([w,T])}}function x(w){if(f)throw new TypeError("Generator is already executing.");for(;C&&(C=0,w[0]&&(d=0)),d;)try{if(f=1,h&&(v=w[0]&2?h.return:w[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,w[1])).done)return v;switch(h=0,v&&(w=[w[0]&2,v.value]),w[0]){case 0:case 1:v=w;break;case 4:return d.label++,{value:w[1],done:!1};case 5:d.label++,h=w[1],w=[0];continue;case 7:w=d.ops.pop(),d.trys.pop();continue;default:if(v=d.trys,!(v=v.length>0&&v[v.length-1])&&(w[0]===6||w[0]===2)){d=0;continue}if(w[0]===3&&(!v||w[1]>v[0]&&w[1]<v[3])){d.label=w[1];break}if(w[0]===6&&d.label<v[1]){d.label=v[1],v=w;break}if(v&&d.label<v[2]){d.label=v[2],d.ops.push(w);break}v[2]&&d.ops.pop(),d.trys.pop();continue}w=y.call(E,d)}catch(T){w=[6,T],h=0}finally{f=v=0}if(w[0]&5)throw w[1];return{value:w[0]?w[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_INIT_CONFIG_HIVER=e.TENANT_PLATFORM=e.fetchToken=e.makeAxiosCall=e.Bifrost=void 0;var r=su(),o=ru(),s=Cn;Object.defineProperty(e,"TENANT_PLATFORM",{enumerable:!0,get:function(){return s.TENANT_PLATFORM}}),Object.defineProperty(e,"DEFAULT_INIT_CONFIG_HIVER",{enumerable:!0,get:function(){return s.DEFAULT_INIT_CONFIG_HIVER}});var i=eu(),a=ve,l=Xt,c=fu();Object.defineProperty(e,"makeAxiosCall",{enumerable:!0,get:function(){return c.makeAxiosCall}});var u=uu();Object.defineProperty(e,"fetchToken",{enumerable:!0,get:function(){return u.fetchToken}});var p=zt,g=function(){function E(y,d,f,h,v,C){f===void 0&&(f=s.TENANT_PLATFORM.GMAIL),h===void 0&&(h=null),v===void 0&&(v=!0),C===void 0&&(C=!1),this.setEnvironment(),this.appEnv=y,this.tier=d,this.tenantPlatform=f,this.authTokenFetchingInProgress=!1,this.getTokenForLogin=h,this.withCredentials=v,this.csrfToken=C}return E.prototype.setEnvironment=function(){typeof window<"u"&&window.document?(0,p.setValue)("PLATFORM",s.PLATFORM.WEB):(0,p.setValue)("PLATFORM",s.PLATFORM.MOBILE)},E.prototype.hiverAxios=function(y,d,f,h){return d===void 0&&(d=s.DEFAULT_INIT_CONFIG_HIVER),t(this,void 0,void 0,function(){var v,C;return n(this,function(I){switch(I.label){case 0:return I.trys.push([0,4,,5]),h&&h<2?(v={userId:y.userId,usergroupId:y.usergroupId,apiRetry:h},console.log("THIS IS THE TENNANTPLAORM -> ",this.tenantPlatform),[4,(0,o.fetchAccessToken)(this.appEnv,this.tier,v,this.tenantPlatform,this.getTokenForLogin,s.API_CALL_ORIGIN.API_RETRY)]):[3,2];case 1:I.sent(),I.label=2;case 2:return[4,(0,r.hiverAxiosCall)(this,y,d,f)];case 3:return[2,I.sent()];case 4:throw C=I.sent(),console.log("ERROR: Axios call failed",C),C;case 5:return[2]}})})},E.prototype.fetchAuthToken=function(y,d,f){return t(this,void 0,void 0,function(){var h;return n(this,function(v){switch(v.label){case 0:return v.trys.push([0,4,7,8]),this.authTokenFetchingInProgress?[3,2]:(this.authTokenFetchingInProgress=!0,[4,(0,o.fetchAccessToken)(this.appEnv,this.tier,y,this.tenantPlatform,this.getTokenForLogin,d,f)]);case 1:return v.sent(),[3,3];case 2:console.log("Heimdall: AuthToken Fetching InProgress",this.authTokenFetchingInProgress),v.label=3;case 3:return[3,8];case 4:return h=v.sent(),console.log("ERROR: Fetching token failed",h),this.authTokenFetchingInProgress=!1,[4,new Promise(function(C){return setTimeout(C,100)})];case 5:return v.sent(),console.log("Heimdall: Retrying fetchAccessToken after 100ms..."),[4,this.fetchAuthToken(y,d,f)];case 6:return v.sent(),[3,8];case 7:return this.authTokenFetchingInProgress=!1,[7];case 8:return[2]}})})},E.prototype.logout=function(){return t(this,void 0,void 0,function(){var y,d;return n(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),y=(0,a.getConfig)(this.appEnv,this.tier),[4,(0,i.logoutFromHeimdall)(y,this.tenantPlatform)];case 1:return f.sent(),(0,l.removeItemFromStorage)("hiverAuthToken"),(0,l.removeItemFromStorage)("hiverAuthTokenExpiry"),(0,l.removeItemFromStorage)("hiverAuthUserId"),(0,l.removeItemFromStorage)("hiverAuthUserGroupId"),[3,3];case 2:throw d=f.sent(),console.error("Heimdall: Logout failed",d),d;case 3:return[2]}})})},E.prototype.isTokenFetchingInProgress=function(){return this.authTokenFetchingInProgress},E}();e.Bifrost=g})(ji);const Bt={userId:"",userGroupId:"",baseUrl:"",appEnv:"",tier:"",bifrost:null,isInitiated:!1},Yt=()=>{if(!Bt.isInitiated)return null;if(!Bt.baseUrl)throw new Error("Base url is not setup. please call the initConnectorsBifrost function with the appropriate value");return Bt},lg=({baseUrl:e,appEnv:t,tier:n,userId:r,userGroupId:o,tenantPlatform:s=ji.TENANT_PLATFORM.GMAIL,withCredentials:i=!0,getTokenForLogin:a})=>{Bt.baseUrl=e,Bt.appEnv=t,Bt.tier=n,Bt.userGroupId=o,Bt.userId=r,Bt.tenantPlatform=s,Bt.bifrost=new ji.Bifrost(t,n,s,a,i),Bt.isInitiated=!0},ze=(({configHiver:e})=>async n=>{const r=Yt();if(!r)throw new Error("Please call initConnectorsBifrost before making any api calls");const{bifrost:o,userGroupId:s,userId:i}=r,{url:a,method:l,root_url:c}=n,p={root_url:(c||r.baseUrl)+((n==null?void 0:n.prefix)||""),url:a,method:l,headers:n==null?void 0:n.headers,onSuccess:n==null?void 0:n.onSuccess,onFail:n==null?void 0:n.onFail,data:n==null?void 0:n.data,params:n==null?void 0:n.params,formData:n==null?void 0:n.formData,responseType:n==null?void 0:n.responseType,userId:Number(i),usergroupId:Number(s)};try{return await(o==null?void 0:o.hiverAxios(p,{...e,isHiverApiDomain:!0}))}catch(g){throw console.error("API call failed with error: ",g),g}})({configHiver:{getToken:!0,fetchCsrfToken:()=>"",isHiverApiDomain:!0},withCredentials:!0}),ug=e=>N.createElement("svg",{width:17,height:17,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_1180_840)"},N.createElement("path",{d:"M5.16667 10.12H9.83333V11.4533H5.16667V10.12ZM5.16667 7.45329H11.8333V8.78662H5.16667V7.45329ZM5.16667 4.78662H11.8333V6.11995H5.16667V4.78662ZM13.1667 2.11995H10.38C10.1 1.34662 9.36667 0.786621 8.5 0.786621C7.63333 0.786621 6.9 1.34662 6.62 2.11995H3.83333C3.74 2.11995 3.65333 2.12662 3.56667 2.14662C3.30667 2.19995 3.07333 2.33329 2.89333 2.51329C2.77333 2.63329 2.67333 2.77995 2.60667 2.93995C2.54 3.09329 2.5 3.26662 2.5 3.45329V12.7866C2.5 12.9666 2.54 13.1466 2.60667 13.3066C2.67333 13.4666 2.77333 13.6066 2.89333 13.7333C3.07333 13.9133 3.30667 14.0466 3.56667 14.1C3.65333 14.1133 3.74 14.12 3.83333 14.12H13.1667C13.9 14.12 14.5 13.52 14.5 12.7866V3.45329C14.5 2.71995 13.9 2.11995 13.1667 2.11995ZM8.5 1.95329C8.77333 1.95329 9 2.17995 9 2.45329C9 2.72662 8.77333 2.95329 8.5 2.95329C8.22667 2.95329 8 2.72662 8 2.45329C8 2.17995 8.22667 1.95329 8.5 1.95329ZM13.1667 12.7866H3.83333V3.45329H13.1667V12.7866Z",fill:"#343C45"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_1180_840"},N.createElement("rect",{width:16,height:16,fill:"white",transform:"translate(0.5 0.120117)"})))),dg=e=>N.createElement("svg",{width:24,height:22,viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("rect",{x:3.63636,y:2.27393,width:15.2727,height:17.2308,rx:2.90909,fill:"#F6C035"}),N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.4621 12.0506C22.1745 11.7669 21.7845 11.6074 21.3779 11.6074C20.9712 11.6074 20.5812 11.7669 20.2937 12.0506L19.9323 12.4079L22.4626 14.9057L22.8235 14.549C22.9659 14.4084 23.0789 14.2415 23.156 14.0578C23.2331 13.8741 23.2727 13.6773 23.2727 13.4784C23.2727 13.2796 23.2331 13.0827 23.156 12.8991C23.0789 12.7154 22.9659 12.5485 22.8235 12.4079L22.4621 12.0506ZM21.7393 15.6192L19.209 13.1214L14.5624 17.7088C14.4607 17.8092 14.3897 17.9358 14.3574 18.0742L13.8314 20.3222C13.8118 20.4056 13.814 20.4927 13.8379 20.575C13.8618 20.6574 13.9065 20.7324 13.9679 20.793C14.0293 20.8535 14.1052 20.8977 14.1887 20.9213C14.2721 20.9448 14.3603 20.9471 14.4448 20.9277L16.7226 20.409C16.8626 20.377 16.9906 20.3069 17.0922 20.2066L21.7393 15.6192Z",fill:"#FFE298"}),N.createElement("rect",{x:6.54546,y:6.58154,width:10.1818,height:1.4359,rx:.717949,fill:"#FFDC83"}),N.createElement("rect",{x:6.54546,y:10.1714,width:10.1818,height:1.4359,rx:.717949,fill:"#FFDC83"}),N.createElement("rect",{x:6.54546,y:13.7612,width:6.54545,height:1.4359,rx:.717949,fill:"#FFDC83"})),fg=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_825_73646)"},N.createElement("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z",fill:"#6F7C90"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_825_73646"},N.createElement("rect",{width:24,height:24,fill:"white"})))),pg="Rate your experience with Hiver Apps",hg="Share feedback on Apps",gg="Got any feedback?",pu="https://txeep2wshyx.typeform.com/to/RuOwF9SG",mg="https://txeep2wshyx.typeform.com/to/Tfa8IrCd",bg="https://txeep2wshyx.typeform.com/to/bqhVSfDk",yg="https://cdn.hiverhq.com/chat-support/hiver-chat.html",Cg="enable_connectors_clicked",vg="learn_more_clicked",xg="connector_card_expand_clicked",Eg="connector_card_collapsed_clicked",Ig="connector_card_refresh_clicked",wg="connector_cards_loaded",Ag="connector_whats_new_card_viewed",_g="connector_whats_new_explore_now_clicked",Tg="connector_whats_new_learn_more_clicked",Sg="connector_whats_new_dismissed",Lg="connector_create_new_object_clicked",Og="connector_link_new_object_clicked",Dg="connector_new_object_created_by_form",Fg="connector_new_object_linked_by_form",kg="connector_object_unlinked_by_form",Ng="connector_link_preview_clicked",Rg="connector_create_panel_cancel_clicked",Mg="connector_create_panel_back_clicked",Pg="card_loaded_on_click",Bg="card_loaded",jg="schedule_call_clicked",Vg="schedule_call_cross_clicked",hu="CONNECTOR_EDIT_CLICKED",Gg="CONNECTOR_EDIT_REQUEST_SEND",Hg="CONNECTOR_EDIT_CANCELLED",Wg="CONNECTOR_EDIT_BACK_CLICKED",Zg="CONNECTOR_EDIT_SUCCESS",Xg="connector_video_clicked",zg="connector_card_error",la="got_any_feedback_clicked",Yg="connector_deeplink_clicked",Jg="search_bar_tapped",Qg="search_suggestions_selected",qg="search_initiated",$g="no_results_found",Ug="search_results_found",Kg="search_result_selected",em="search_result_linked",tm="feedback_closed_clicked",nm="help_btn_clicked",rm="connector_chat_support_clicked",om="missing_field_clicked",sm={userEmail:"",email:"",baseUrls:{},currentSmIds:[],metaData:void 0,availableFeatures:{},sendTrackingEvent:()=>{},conversationId:void 0,isAdmin:!1,connectorFunctions:{redirectToAdmin:()=>{}},stackingContext:{}},Ve=_.createContext(sm),ps="hiver_connectors",ua={NOT_FOUND:404},im="ftr-connector-blue-dot",gu="ftr-connectors-write-flow",am="ftr-connectors-enhancements",cm="ftr-connector-schedule-call-agent",lm="ftr-connectors-edit",um="enableAllConnectorFtr",dm="ftr-cards-open-state",fm="ftr-connectors-global-search",pm="ftr-connectors-smart-suggestions",hm="ftr-connectors-email-selection",gm="ftr-connector-agent-feedback",hs="ftr-connector-unified-view",mm="ftr-connectors-expanded-form",mu="Please refresh and try again",bm="No data available",gs="-",bu="Refresh",yu="Minimize",da="Expand",Cu="Connectors",fa="Apps",ym="Collapse",Cm="Close",vu="Link",vm="Create",xm="Update",xu="Unlink",Eu="Edit",pa="Cancel",Iu="Create new object",wu="Link existing object",Em="Are you sure you want to unlink this object?",Im="The object will be removed from this conversation for all users. However the object will still be available on {{connectorName}} if you'd like to link it back in the future.",wm="Edit card",Am="bullet_list",_m="Expanded",Tm="Collapsed",Au="Something is wrong with the {{connector_name}} Connector setup. Please check our help guide <>here<>.",_u="UNKNOWN_ERROR",Sm="https://help.hiverhq.com/custom-connectors/common-connector-errors",Tu={MAIN_BUTTON:"main_button",ICON:"create_icon"},Lm="Missing any fields? Inform us.",ha=e=>{let t=localStorage.getItem(ps);return t=t?JSON.parse(t):!1,t==null?void 0:t[e]},Om=e=>!!ha(e),Su=()=>{const{userId:e=""}=Yt()||{};return String(e)},Dm=(e,t=Su())=>{const n=ha(e);return((n==null?void 0:n.isExtensionNew)??[]).includes(t)},ga=(e,t=!1,n=!1)=>{const r=Su(),o=ha(e);if(t||!o){localStorage.removeItem(ps);const s={[e]:{...!n&&{isExtensionNew:t?[]:[r]},...n&&{extensionExpand:[r]}}};localStorage.setItem(ps,JSON.stringify(s));return}else{const s=(o==null?void 0:o.isExtensionNew)??[],i=(o==null?void 0:o.extensionExpand)??[],a={[e]:{...o,...!n&&{isExtensionNew:[...new Set([...s,r])]},...n&&{extensionExpand:[...new Set([...i,r])]}}};localStorage.setItem(ps,JSON.stringify(a));return}},tt=(e={},t)=>e&&typeof e[t]>"u"?(e==null?void 0:e[um])===!0:(e==null?void 0:e[t])===!0,Cr=(e,t)=>e.replace(/:(\w+)/g,(n,r)=>String(t[r])||""),Lu=(e,t,n,r=!1)=>{var s;const o={};return o.card_title=t,o.card_state=n?_m:Tm,r&&e?(o.data_state=e==null?void 0:e.status,o.connector_names=(s=e==null?void 0:e.data)==null?void 0:s.connectorNames):e&&(o.data_state=(e==null?void 0:e.status)||"unknown_error"),o},Ou=e=>{switch(e.cardType){case"flat":if(Array.isArray(e.data.flatDisplay)){const t=e.data.flatDisplay.filter(n=>Number(n.statusCode)!==ua.NOT_FOUND).sort((n,r)=>n.priority-r.priority);e.data.flatDisplay={data:t}}else{const t=e.data.flatDisplay.data.filter(n=>Number(n.statusCode)!==ua.NOT_FOUND).sort((n,r)=>n.priority-r.priority);e.data.flatDisplay.data=t}break;case"flat_with_list":e.data.listItems.fields=e.data.listItems.fields.map(t=>Array.isArray(t)?{data:t.sort((r,o)=>r.priority-o.priority)}:{data:t.data.sort((r,o)=>r.priority-o.priority),externalResourceId:t.externalResourceId});break}return e},Fm=e=>{if(!e||Object.keys(e).length===0)return[];const t=new Set;return Object.values(e).forEach(n=>{n.connectorNames&&n.connectorNames.forEach(r=>t.add(r))}),Array.from(t)},ms=({url:e,params:t})=>{const n=Object.entries(t).reduce((o,[s,i])=>(i!==void 0&&i!==""&&i!==null&&(o[s]=i),o),{}),r=new URL(e);return Object.entries(n).forEach(([o,s])=>{r.searchParams.set(o,s)}),r.toString()};function Du(e,t){return e.length>t?e.substring(0,t)+"...":e}const km=e=>N.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_1187_180)"},N.createElement("path",{d:"M18.3333 7.81995L12.3417 7.30329L10 1.78662L7.65833 7.31162L1.66666 7.81995L6.21666 11.7616L4.85 17.62L10 14.5116L15.15 17.62L13.7917 11.7616L18.3333 7.81995ZM10 12.9533L6.86666 14.845L7.7 11.2783L4.93333 8.87829L8.58333 8.56162L10 5.20329L11.425 8.56995L15.075 8.88662L12.3083 11.2866L13.1417 14.8533L10 12.9533Z",fill:"#4D596C"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_1187_180"},N.createElement("rect",{width:20,height:20,fill:"white",transform:"translate(0 0.120117)"})))),Nm=e=>N.createElement("svg",{width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_847_49587)"},N.createElement("path",{d:"M10.6668 14.392L15.8168 17.5003L14.4502 11.642L19.0002 7.70033L13.0085 7.19199L10.6668 1.66699L8.32516 7.19199L2.3335 7.70033L6.8835 11.642L5.51683 17.5003L10.6668 14.392Z",fill:"#FFE250"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_847_49587"},N.createElement("rect",{width:20,height:20,fill:"white",transform:"translate(0.666992)"})))),Rm=b.keyframes`
36
36
  from {
37
37
  transform: translateY(-100%);
38
38
  opacity: 0;
@@ -360,7 +360,7 @@ React keys must be passed directly to JSX without using spread:
360
360
  transform: rotate(135deg);
361
361
  }
362
362
  }
363
- `,Cn=b.styled(b.Skeleton)`
363
+ `,vn=b.styled(b.Skeleton)`
364
364
  display: block;
365
365
  margin: ${e=>e.margin?e.margin:0};
366
366
  `,vr=b.styled(b.IconButton)`
@@ -559,9 +559,9 @@ React keys must be passed directly to JSX without using spread:
559
559
  *
560
560
  * This source code is licensed under the MIT license found in the
561
561
  * LICENSE file in the root directory of this source tree.
562
- */var Hu;function X3(){return Hu||(Hu=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=_;function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,s=e.useEffect,i=e.useMemo,a=e.useDebugValue;function l(c,u,p,g,E){var y=o(null),d;y.current===null?(d={hasValue:!1,value:null},y.current=d):d=y.current;var f=i(function(){var I=!1,x,w,T=function(D){if(!I){I=!0,x=D;var k=g(D);if(E!==void 0&&d.hasValue){var M=d.value;if(E(M,k))return w=M,M}return w=k,k}var j=x,H=w;if(n(j,D))return H;var z=g(D);return E!==void 0&&E(H,z)?H:(x=D,w=z,z)},A=p===void 0?null:p,S=function(){return T(u())},F=A===null?void 0:function(){return T(A())};return[S,F]},[u,p,g,E]),h=f[0],v=f[1],C=r(c,h,v);return s(function(){d.hasValue=!0,d.value=C},[C]),a(C),C}va.useSyncExternalStoreWithSelector=l,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),va}process.env.NODE_ENV==="production"?ya.exports=Z3():ya.exports=X3();var z3=ya.exports,At="default"in N?N.default:N,Wu=Symbol.for("react-redux-context"),Zu=typeof globalThis<"u"?globalThis:{};function Y3(){if(!At.createContext)return{};const e=Zu[Wu]??(Zu[Wu]=new Map);let t=e.get(At.createContext);return t||(t=At.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(At.createContext,t)),t}var vn=Y3(),J3=()=>{throw new Error("uSES not initialized!")};function xa(e=vn){return function(){const n=At.useContext(e);if(process.env.NODE_ENV!=="production"&&!n)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return n}}var Xu=xa(),zu=J3,Q3=e=>{zu=e},q3=(e,t)=>e===t;function $3(e=vn){const t=e===vn?Xu:xa(e),n=(r,o={})=>{const{equalityFn:s=q3,devModeChecks:i={}}=typeof o=="function"?{equalityFn:o}:o;if(process.env.NODE_ENV!=="production"){if(!r)throw new Error("You must pass a selector to useSelector");if(typeof r!="function")throw new Error("You must pass a function as a selector to useSelector");if(typeof s!="function")throw new Error("You must pass a function as an equality function to useSelector")}const{store:a,subscription:l,getServerState:c,stabilityCheck:u,identityFunctionCheck:p}=t(),g=At.useRef(!0),E=At.useCallback({[r.name](d){const f=r(d);if(process.env.NODE_ENV!=="production"){const{identityFunctionCheck:h,stabilityCheck:v}={stabilityCheck:u,identityFunctionCheck:p,...i};if(v==="always"||v==="once"&&g.current){const C=r(d);if(!s(f,C)){let I;try{throw new Error}catch(x){({stack:I}=x)}console.warn("Selector "+(r.name||"unknown")+` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
562
+ */var Hu;function X3(){return Hu||(Hu=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=_;function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,s=e.useEffect,i=e.useMemo,a=e.useDebugValue;function l(c,u,p,g,E){var y=o(null),d;y.current===null?(d={hasValue:!1,value:null},y.current=d):d=y.current;var f=i(function(){var I=!1,x,w,T=function(D){if(!I){I=!0,x=D;var k=g(D);if(E!==void 0&&d.hasValue){var M=d.value;if(E(M,k))return w=M,M}return w=k,k}var j=x,H=w;if(n(j,D))return H;var z=g(D);return E!==void 0&&E(H,z)?H:(x=D,w=z,z)},A=p===void 0?null:p,S=function(){return T(u())},F=A===null?void 0:function(){return T(A())};return[S,F]},[u,p,g,E]),h=f[0],v=f[1],C=r(c,h,v);return s(function(){d.hasValue=!0,d.value=C},[C]),a(C),C}va.useSyncExternalStoreWithSelector=l,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),va}process.env.NODE_ENV==="production"?ya.exports=Z3():ya.exports=X3();var z3=ya.exports,At="default"in N?N.default:N,Wu=Symbol.for("react-redux-context"),Zu=typeof globalThis<"u"?globalThis:{};function Y3(){if(!At.createContext)return{};const e=Zu[Wu]??(Zu[Wu]=new Map);let t=e.get(At.createContext);return t||(t=At.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(At.createContext,t)),t}var xn=Y3(),J3=()=>{throw new Error("uSES not initialized!")};function xa(e=xn){return function(){const n=At.useContext(e);if(process.env.NODE_ENV!=="production"&&!n)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return n}}var Xu=xa(),zu=J3,Q3=e=>{zu=e},q3=(e,t)=>e===t;function $3(e=xn){const t=e===xn?Xu:xa(e),n=(r,o={})=>{const{equalityFn:s=q3,devModeChecks:i={}}=typeof o=="function"?{equalityFn:o}:o;if(process.env.NODE_ENV!=="production"){if(!r)throw new Error("You must pass a selector to useSelector");if(typeof r!="function")throw new Error("You must pass a function as a selector to useSelector");if(typeof s!="function")throw new Error("You must pass a function as an equality function to useSelector")}const{store:a,subscription:l,getServerState:c,stabilityCheck:u,identityFunctionCheck:p}=t(),g=At.useRef(!0),E=At.useCallback({[r.name](d){const f=r(d);if(process.env.NODE_ENV!=="production"){const{identityFunctionCheck:h,stabilityCheck:v}={stabilityCheck:u,identityFunctionCheck:p,...i};if(v==="always"||v==="once"&&g.current){const C=r(d);if(!s(f,C)){let I;try{throw new Error}catch(x){({stack:I}=x)}console.warn("Selector "+(r.name||"unknown")+` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
563
563
  Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization`,{state:d,selected:f,selected2:C,stack:I})}}if((h==="always"||h==="once"&&g.current)&&f===d){let C;try{throw new Error}catch(I){({stack:C}=I)}console.warn("Selector "+(r.name||"unknown")+` returned the root state when called. This can lead to unnecessary rerenders.
564
- Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,{stack:C})}g.current&&(g.current=!1)}return f}}[r.name],[r,u,i.stabilityCheck]),y=zu(l.addNestedSub,a.getState,c||a.getState,E,s);return At.useDebugValue(y),y};return Object.assign(n,{withTypes:()=>n}),n}var U3=$3();function K3(e){e()}function eb(){let e=null,t=null;return{clear(){e=null,t=null},notify(){K3(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var Yu={notify(){},get:()=>[]};function tb(e,t){let n,r=Yu,o=0,s=!1;function i(d){u();const f=r.subscribe(d);let h=!1;return()=>{h||(h=!0,f(),p())}}function a(){r.notify()}function l(){y.onStateChange&&y.onStateChange()}function c(){return s}function u(){o++,n||(n=e.subscribe(l),r=eb())}function p(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=Yu)}function g(){s||(s=!0,u())}function E(){s&&(s=!1,p())}const y={addNestedSub:i,notifyNestedSubs:a,handleChangeWrapper:l,isSubscribed:c,trySubscribe:g,tryUnsubscribe:E,getListeners:()=>r};return y}var nb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",rb=typeof navigator<"u"&&navigator.product==="ReactNative",ob=nb||rb?At.useLayoutEffect:At.useEffect;function sb({store:e,context:t,children:n,serverState:r,stabilityCheck:o="once",identityFunctionCheck:s="once"}){const i=At.useMemo(()=>{const c=tb(e);return{store:e,subscription:c,getServerState:r?()=>r:void 0,stabilityCheck:o,identityFunctionCheck:s}},[e,r,o,s]),a=At.useMemo(()=>e.getState(),[e]);ob(()=>{const{subscription:c}=i;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),a!==e.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[i,a]);const l=t||vn;return At.createElement(l.Provider,{value:i},n)}var Ju=sb;function Qu(e=vn){const t=e===vn?Xu:xa(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var ib=Qu();function ab(e=vn){const t=e===vn?ib:Qu(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var cb=ab();Q3(z3.useSyncExternalStoreWithSelector);const jt=cb.withTypes(),be=U3.withTypes(),nt={GET:"GET",POST:"POST",DELETE:"DELETE",PATCH:"PATCH",PUT:"PUT"},K={IDLE:"idle",LOADING:"loading",FAILED:"failed"},lb="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%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.7%209.71005L6.19497%207.20503C5.92161%206.93166%205.47839%206.93166%205.20503%207.20503C4.93166%207.47839%204.93166%207.92161%205.20503%208.19497L8.20503%2011.195C8.47839%2011.4683%208.92161%2011.4683%209.19497%2011.195L12.195%208.19497C12.4683%207.92161%2012.4683%207.47839%2012.195%207.20503C11.9216%206.93166%2011.4784%206.93166%2011.205%207.20503L8.7%209.71005Z'%20fill='%23196FE0'/%3e%3c/svg%3e",qu="Show more",ub="Show less",db="Show preview",fb="Hide preview",pb="Select email";function Ue(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var hb=typeof Symbol=="function"&&Symbol.observable||"@@observable",$u=hb,Ea=()=>Math.random().toString(36).substring(7).split("").join("."),gb={INIT:`@@redux/INIT${Ea()}`,REPLACE:`@@redux/REPLACE${Ea()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ea()}`},Wn=gb;function po(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function mb(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(Cb(e))return"date";if(yb(e))return"error";const n=bb(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function bb(e){return typeof e.constructor=="function"?e.constructor.name:null}function yb(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Cb(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function xn(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=mb(e)),t}function Uu(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Ue(2):`Expected the root reducer to be a function. Instead, received: '${xn(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ue(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?Ue(1):`Expected the enhancer to be a function. Instead, received: '${xn(n)}'`);return n(Uu)(e,t)}let r=e,o=t,s=new Map,i=s,a=0,l=!1;function c(){i===s&&(i=new Map,s.forEach((f,h)=>{i.set(h,f)}))}function u(){if(l)throw new Error(process.env.NODE_ENV==="production"?Ue(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function p(f){if(typeof f!="function")throw new Error(process.env.NODE_ENV==="production"?Ue(4):`Expected the listener to be a function. Instead, received: '${xn(f)}'`);if(l)throw new Error(process.env.NODE_ENV==="production"?Ue(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let h=!0;c();const v=a++;return i.set(v,f),function(){if(h){if(l)throw new Error(process.env.NODE_ENV==="production"?Ue(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");h=!1,c(),i.delete(v),s=null}}}function g(f){if(!po(f))throw new Error(process.env.NODE_ENV==="production"?Ue(7):`Actions must be plain objects. Instead, the actual type was: '${xn(f)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof f.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ue(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof f.type!="string")throw new Error(process.env.NODE_ENV==="production"?Ue(17):`Action "type" property must be a string. Instead, the actual type was: '${xn(f.type)}'. Value was: '${f.type}' (stringified)`);if(l)throw new Error(process.env.NODE_ENV==="production"?Ue(9):"Reducers may not dispatch actions.");try{l=!0,o=r(o,f)}finally{l=!1}return(s=i).forEach(v=>{v()}),f}function E(f){if(typeof f!="function")throw new Error(process.env.NODE_ENV==="production"?Ue(10):`Expected the nextReducer to be a function. Instead, received: '${xn(f)}`);r=f,g({type:Wn.REPLACE})}function y(){const f=p;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(process.env.NODE_ENV==="production"?Ue(11):`Expected the observer to be an object. Instead, received: '${xn(h)}'`);function v(){const I=h;I.next&&I.next(u())}return v(),{unsubscribe:f(v)}},[$u](){return this}}}return g({type:Wn.INIT}),{dispatch:g,subscribe:p,getState:u,replaceReducer:E,[$u]:y}}function Ku(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function vb(e,t,n,r){const o=Object.keys(t),s=n&&n.type===Wn.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(o.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!po(e))return`The ${s} has unexpected type of "${xn(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const i=Object.keys(e).filter(a=>!t.hasOwnProperty(a)&&!r[a]);if(i.forEach(a=>{r[a]=!0}),!(n&&n.type===Wn.REPLACE)&&i.length>0)return`Unexpected ${i.length>1?"keys":"key"} "${i.join('", "')}" found in ${s}. Expected to find one of the known reducer keys instead: "${o.join('", "')}". Unexpected keys will be ignored.`}function xb(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Wn.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?Ue(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:Wn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?Ue(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Wn.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function ed(e){const t=Object.keys(e),n={};for(let i=0;i<t.length;i++){const a=t[i];process.env.NODE_ENV!=="production"&&typeof e[a]>"u"&&Ku(`No reducer provided for key "${a}"`),typeof e[a]=="function"&&(n[a]=e[a])}const r=Object.keys(n);let o;process.env.NODE_ENV!=="production"&&(o={});let s;try{xb(n)}catch(i){s=i}return function(a={},l){if(s)throw s;if(process.env.NODE_ENV!=="production"){const p=vb(a,n,l,o);p&&Ku(p)}let c=!1;const u={};for(let p=0;p<r.length;p++){const g=r[p],E=n[g],y=a[g],d=E(y,l);if(typeof d>"u"){const f=l&&l.type;throw new Error(process.env.NODE_ENV==="production"?Ue(14):`When called with an action of type ${f?`"${String(f)}"`:"(unknown type)"}, the slice reducer for key "${g}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}u[g]=d,c=c||d!==y}return c=c||r.length!==Object.keys(a).length,c?u:a}}function bs(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Eb(...e){return t=>(n,r)=>{const o=t(n,r);let s=()=>{throw new Error(process.env.NODE_ENV==="production"?Ue(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const i={getState:o.getState,dispatch:(l,...c)=>s(l,...c)},a=e.map(l=>l(i));return s=bs(...a)(o.dispatch),{...o,dispatch:s}}}function td(e){return po(e)&&"type"in e&&typeof e.type=="string"}var nd=Symbol.for("immer-nothing"),rd=Symbol.for("immer-draftable"),_t=Symbol.for("immer-state"),Ib=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function ht(e,...t){if(process.env.NODE_ENV!=="production"){const n=Ib[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var xr=Object.getPrototypeOf;function Zn(e){return!!e&&!!e[_t]}function on(e){var t;return e?od(e)||Array.isArray(e)||!!e[rd]||!!((t=e.constructor)!=null&&t[rd])||vs(e)||xs(e):!1}var wb=Object.prototype.constructor.toString();function od(e){if(!e||typeof e!="object")return!1;const t=xr(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===wb}function ys(e,t){Cs(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Cs(e){const t=e[_t];return t?t.type_:Array.isArray(e)?1:vs(e)?2:xs(e)?3:0}function Ia(e,t){return Cs(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function sd(e,t,n){const r=Cs(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Ab(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function vs(e){return e instanceof Map}function xs(e){return e instanceof Set}function Xn(e){return e.copy_||e.base_}function wa(e,t){if(vs(e))return new Map(e);if(xs(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=od(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[_t];let o=Reflect.ownKeys(r);for(let s=0;s<o.length;s++){const i=o[s],a=r[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(xr(e),r)}else{const r=xr(e);if(r!==null&&n)return{...e};const o=Object.create(r);return Object.assign(o,e)}}function Aa(e,t=!1){return Es(e)||Zn(e)||!on(e)||(Cs(e)>1&&(e.set=e.add=e.clear=e.delete=_b),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>Aa(r,!0))),e}function _b(){ht(2)}function Es(e){return Object.isFrozen(e)}var Tb={};function zn(e){const t=Tb[e];return t||ht(0,e),t}var ho;function id(){return ho}function Sb(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ad(e,t){t&&(zn("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function _a(e){Ta(e),e.drafts_.forEach(Lb),e.drafts_=null}function Ta(e){e===ho&&(ho=e.parent_)}function cd(e){return ho=Sb(ho,e)}function Lb(e){const t=e[_t];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ld(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[_t].modified_&&(_a(t),ht(4)),on(e)&&(e=Is(t,e),t.parent_||ws(t,e)),t.patches_&&zn("Patches").generateReplacementPatches_(n[_t].base_,e,t.patches_,t.inversePatches_)):e=Is(t,n,[]),_a(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==nd?e:void 0}function Is(e,t,n){if(Es(t))return t;const r=t[_t];if(!r)return ys(t,(o,s)=>ud(e,r,t,o,s,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return ws(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let s=o,i=!1;r.type_===3&&(s=new Set(o),o.clear(),i=!0),ys(s,(a,l)=>ud(e,r,o,a,l,n,i)),ws(e,o,!1),n&&e.patches_&&zn("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function ud(e,t,n,r,o,s,i){if(process.env.NODE_ENV!=="production"&&o===n&&ht(5),Zn(o)){const a=s&&t&&t.type_!==3&&!Ia(t.assigned_,r)?s.concat(r):void 0,l=Is(e,o,a);if(sd(n,r,l),Zn(l))e.canAutoFreeze_=!1;else return}else i&&n.add(o);if(on(o)&&!Es(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Is(e,o),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&ws(e,o)}}function ws(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Aa(t,n)}function Ob(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:id(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,s=Sa;n&&(o=[r],s=go);const{revoke:i,proxy:a}=Proxy.revocable(o,s);return r.draft_=a,r.revoke_=i,a}var Sa={get(e,t){if(t===_t)return e;const n=Xn(e);if(!Ia(n,t))return Db(e,n,t);const r=n[t];return e.finalized_||!on(r)?r:r===La(e.base_,t)?(Da(e),e.copy_[t]=Fa(r,e)):r},has(e,t){return t in Xn(e)},ownKeys(e){return Reflect.ownKeys(Xn(e))},set(e,t,n){const r=dd(Xn(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=La(Xn(e),t),s=o==null?void 0:o[_t];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Ab(n,o)&&(n!==void 0||Ia(e.base_,t)))return!0;Da(e),Oa(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return La(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Da(e),Oa(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Xn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ht(11)},getPrototypeOf(e){return xr(e.base_)},setPrototypeOf(){ht(12)}},go={};ys(Sa,(e,t)=>{go[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),go.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ht(13),go.set.call(this,e,t,void 0)},go.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ht(14),Sa.set.call(this,e[0],t,n,e[0])};function La(e,t){const n=e[_t];return(n?Xn(n):e)[t]}function Db(e,t,n){var o;const r=dd(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function dd(e,t){if(!(t in e))return;let n=xr(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=xr(n)}}function Oa(e){e.modified_||(e.modified_=!0,e.parent_&&Oa(e.parent_))}function Da(e){e.copy_||(e.copy_=wa(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Fb=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const s=n;n=t;const i=this;return function(l=s,...c){return i.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&ht(6),r!==void 0&&typeof r!="function"&&ht(7);let o;if(on(t)){const s=cd(this),i=Fa(t,void 0);let a=!0;try{o=n(i),a=!1}finally{a?_a(s):Ta(s)}return ad(s,r),ld(o,s)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===nd&&(o=void 0),this.autoFreeze_&&Aa(o,!0),r){const s=[],i=[];zn("Patches").generateReplacementPatches_(t,o,s,i),r(s,i)}return o}else ht(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(i,...a)=>this.produceWithPatches(i,l=>t(l,...a));let r,o;return[this.produce(t,n,(i,a)=>{r=i,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){on(e)||ht(8),Zn(e)&&(e=kb(e));const t=cd(this),n=Fa(e,void 0);return n[_t].isManual_=!0,Ta(t),n}finishDraft(e,t){const n=e&&e[_t];(!n||!n.isManual_)&&ht(9);const{scope_:r}=n;return ad(r,t),ld(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=zn("Patches").applyPatches_;return Zn(e)?r(e,t):this.produce(e,o=>r(o,t))}};function Fa(e,t){const n=vs(e)?zn("MapSet").proxyMap_(e,t):xs(e)?zn("MapSet").proxySet_(e,t):Ob(e,t);return(t?t.scope_:id()).drafts_.push(n),n}function kb(e){return Zn(e)||ht(10,e),fd(e)}function fd(e){if(!on(e)||Es(e))return e;const t=e[_t];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=wa(e,t.scope_.immer_.useStrictShallowCopy_)}else n=wa(e,!0);return ys(n,(r,o)=>{sd(n,r,fd(o))}),t&&(t.finalized_=!1),n}var Tt=new Fb,pd=Tt.produce;Tt.produceWithPatches.bind(Tt),Tt.setAutoFreeze.bind(Tt),Tt.setUseStrictShallowCopy.bind(Tt),Tt.applyPatches.bind(Tt),Tt.createDraft.bind(Tt),Tt.finishDraft.bind(Tt);var Nb=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const o={};e(o)===o&&(r=!0)}catch{}if(r){let o;try{throw new Error}catch(s){({stack:o}=s)}console.warn(`The result function returned its own inputs without modification. e.g
564
+ Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,{stack:C})}g.current&&(g.current=!1)}return f}}[r.name],[r,u,i.stabilityCheck]),y=zu(l.addNestedSub,a.getState,c||a.getState,E,s);return At.useDebugValue(y),y};return Object.assign(n,{withTypes:()=>n}),n}var U3=$3();function K3(e){e()}function eb(){let e=null,t=null;return{clear(){e=null,t=null},notify(){K3(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var Yu={notify(){},get:()=>[]};function tb(e,t){let n,r=Yu,o=0,s=!1;function i(d){u();const f=r.subscribe(d);let h=!1;return()=>{h||(h=!0,f(),p())}}function a(){r.notify()}function l(){y.onStateChange&&y.onStateChange()}function c(){return s}function u(){o++,n||(n=e.subscribe(l),r=eb())}function p(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=Yu)}function g(){s||(s=!0,u())}function E(){s&&(s=!1,p())}const y={addNestedSub:i,notifyNestedSubs:a,handleChangeWrapper:l,isSubscribed:c,trySubscribe:g,tryUnsubscribe:E,getListeners:()=>r};return y}var nb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",rb=typeof navigator<"u"&&navigator.product==="ReactNative",ob=nb||rb?At.useLayoutEffect:At.useEffect;function sb({store:e,context:t,children:n,serverState:r,stabilityCheck:o="once",identityFunctionCheck:s="once"}){const i=At.useMemo(()=>{const c=tb(e);return{store:e,subscription:c,getServerState:r?()=>r:void 0,stabilityCheck:o,identityFunctionCheck:s}},[e,r,o,s]),a=At.useMemo(()=>e.getState(),[e]);ob(()=>{const{subscription:c}=i;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),a!==e.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[i,a]);const l=t||xn;return At.createElement(l.Provider,{value:i},n)}var Ju=sb;function Qu(e=xn){const t=e===xn?Xu:xa(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var ib=Qu();function ab(e=xn){const t=e===xn?ib:Qu(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var cb=ab();Q3(z3.useSyncExternalStoreWithSelector);const jt=cb.withTypes(),be=U3.withTypes(),nt={GET:"GET",POST:"POST",DELETE:"DELETE",PATCH:"PATCH",PUT:"PUT"},K={IDLE:"idle",LOADING:"loading",FAILED:"failed"},lb="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%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.7%209.71005L6.19497%207.20503C5.92161%206.93166%205.47839%206.93166%205.20503%207.20503C4.93166%207.47839%204.93166%207.92161%205.20503%208.19497L8.20503%2011.195C8.47839%2011.4683%208.92161%2011.4683%209.19497%2011.195L12.195%208.19497C12.4683%207.92161%2012.4683%207.47839%2012.195%207.20503C11.9216%206.93166%2011.4784%206.93166%2011.205%207.20503L8.7%209.71005Z'%20fill='%23196FE0'/%3e%3c/svg%3e",qu="Show more",ub="Show less",db="Show preview",fb="Hide preview",pb="Select email";function Ue(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var hb=typeof Symbol=="function"&&Symbol.observable||"@@observable",$u=hb,Ea=()=>Math.random().toString(36).substring(7).split("").join("."),gb={INIT:`@@redux/INIT${Ea()}`,REPLACE:`@@redux/REPLACE${Ea()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ea()}`},Wn=gb;function po(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function mb(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(Cb(e))return"date";if(yb(e))return"error";const n=bb(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function bb(e){return typeof e.constructor=="function"?e.constructor.name:null}function yb(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Cb(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function En(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=mb(e)),t}function Uu(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Ue(2):`Expected the root reducer to be a function. Instead, received: '${En(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ue(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?Ue(1):`Expected the enhancer to be a function. Instead, received: '${En(n)}'`);return n(Uu)(e,t)}let r=e,o=t,s=new Map,i=s,a=0,l=!1;function c(){i===s&&(i=new Map,s.forEach((f,h)=>{i.set(h,f)}))}function u(){if(l)throw new Error(process.env.NODE_ENV==="production"?Ue(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function p(f){if(typeof f!="function")throw new Error(process.env.NODE_ENV==="production"?Ue(4):`Expected the listener to be a function. Instead, received: '${En(f)}'`);if(l)throw new Error(process.env.NODE_ENV==="production"?Ue(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let h=!0;c();const v=a++;return i.set(v,f),function(){if(h){if(l)throw new Error(process.env.NODE_ENV==="production"?Ue(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");h=!1,c(),i.delete(v),s=null}}}function g(f){if(!po(f))throw new Error(process.env.NODE_ENV==="production"?Ue(7):`Actions must be plain objects. Instead, the actual type was: '${En(f)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof f.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ue(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof f.type!="string")throw new Error(process.env.NODE_ENV==="production"?Ue(17):`Action "type" property must be a string. Instead, the actual type was: '${En(f.type)}'. Value was: '${f.type}' (stringified)`);if(l)throw new Error(process.env.NODE_ENV==="production"?Ue(9):"Reducers may not dispatch actions.");try{l=!0,o=r(o,f)}finally{l=!1}return(s=i).forEach(v=>{v()}),f}function E(f){if(typeof f!="function")throw new Error(process.env.NODE_ENV==="production"?Ue(10):`Expected the nextReducer to be a function. Instead, received: '${En(f)}`);r=f,g({type:Wn.REPLACE})}function y(){const f=p;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(process.env.NODE_ENV==="production"?Ue(11):`Expected the observer to be an object. Instead, received: '${En(h)}'`);function v(){const I=h;I.next&&I.next(u())}return v(),{unsubscribe:f(v)}},[$u](){return this}}}return g({type:Wn.INIT}),{dispatch:g,subscribe:p,getState:u,replaceReducer:E,[$u]:y}}function Ku(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function vb(e,t,n,r){const o=Object.keys(t),s=n&&n.type===Wn.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(o.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!po(e))return`The ${s} has unexpected type of "${En(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const i=Object.keys(e).filter(a=>!t.hasOwnProperty(a)&&!r[a]);if(i.forEach(a=>{r[a]=!0}),!(n&&n.type===Wn.REPLACE)&&i.length>0)return`Unexpected ${i.length>1?"keys":"key"} "${i.join('", "')}" found in ${s}. Expected to find one of the known reducer keys instead: "${o.join('", "')}". Unexpected keys will be ignored.`}function xb(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Wn.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?Ue(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:Wn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?Ue(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Wn.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function ed(e){const t=Object.keys(e),n={};for(let i=0;i<t.length;i++){const a=t[i];process.env.NODE_ENV!=="production"&&typeof e[a]>"u"&&Ku(`No reducer provided for key "${a}"`),typeof e[a]=="function"&&(n[a]=e[a])}const r=Object.keys(n);let o;process.env.NODE_ENV!=="production"&&(o={});let s;try{xb(n)}catch(i){s=i}return function(a={},l){if(s)throw s;if(process.env.NODE_ENV!=="production"){const p=vb(a,n,l,o);p&&Ku(p)}let c=!1;const u={};for(let p=0;p<r.length;p++){const g=r[p],E=n[g],y=a[g],d=E(y,l);if(typeof d>"u"){const f=l&&l.type;throw new Error(process.env.NODE_ENV==="production"?Ue(14):`When called with an action of type ${f?`"${String(f)}"`:"(unknown type)"}, the slice reducer for key "${g}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}u[g]=d,c=c||d!==y}return c=c||r.length!==Object.keys(a).length,c?u:a}}function bs(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Eb(...e){return t=>(n,r)=>{const o=t(n,r);let s=()=>{throw new Error(process.env.NODE_ENV==="production"?Ue(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const i={getState:o.getState,dispatch:(l,...c)=>s(l,...c)},a=e.map(l=>l(i));return s=bs(...a)(o.dispatch),{...o,dispatch:s}}}function td(e){return po(e)&&"type"in e&&typeof e.type=="string"}var nd=Symbol.for("immer-nothing"),rd=Symbol.for("immer-draftable"),_t=Symbol.for("immer-state"),Ib=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function ht(e,...t){if(process.env.NODE_ENV!=="production"){const n=Ib[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var xr=Object.getPrototypeOf;function Zn(e){return!!e&&!!e[_t]}function on(e){var t;return e?od(e)||Array.isArray(e)||!!e[rd]||!!((t=e.constructor)!=null&&t[rd])||vs(e)||xs(e):!1}var wb=Object.prototype.constructor.toString();function od(e){if(!e||typeof e!="object")return!1;const t=xr(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===wb}function ys(e,t){Cs(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Cs(e){const t=e[_t];return t?t.type_:Array.isArray(e)?1:vs(e)?2:xs(e)?3:0}function Ia(e,t){return Cs(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function sd(e,t,n){const r=Cs(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Ab(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function vs(e){return e instanceof Map}function xs(e){return e instanceof Set}function Xn(e){return e.copy_||e.base_}function wa(e,t){if(vs(e))return new Map(e);if(xs(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=od(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[_t];let o=Reflect.ownKeys(r);for(let s=0;s<o.length;s++){const i=o[s],a=r[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(xr(e),r)}else{const r=xr(e);if(r!==null&&n)return{...e};const o=Object.create(r);return Object.assign(o,e)}}function Aa(e,t=!1){return Es(e)||Zn(e)||!on(e)||(Cs(e)>1&&(e.set=e.add=e.clear=e.delete=_b),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>Aa(r,!0))),e}function _b(){ht(2)}function Es(e){return Object.isFrozen(e)}var Tb={};function zn(e){const t=Tb[e];return t||ht(0,e),t}var ho;function id(){return ho}function Sb(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ad(e,t){t&&(zn("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function _a(e){Ta(e),e.drafts_.forEach(Lb),e.drafts_=null}function Ta(e){e===ho&&(ho=e.parent_)}function cd(e){return ho=Sb(ho,e)}function Lb(e){const t=e[_t];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ld(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[_t].modified_&&(_a(t),ht(4)),on(e)&&(e=Is(t,e),t.parent_||ws(t,e)),t.patches_&&zn("Patches").generateReplacementPatches_(n[_t].base_,e,t.patches_,t.inversePatches_)):e=Is(t,n,[]),_a(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==nd?e:void 0}function Is(e,t,n){if(Es(t))return t;const r=t[_t];if(!r)return ys(t,(o,s)=>ud(e,r,t,o,s,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return ws(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let s=o,i=!1;r.type_===3&&(s=new Set(o),o.clear(),i=!0),ys(s,(a,l)=>ud(e,r,o,a,l,n,i)),ws(e,o,!1),n&&e.patches_&&zn("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function ud(e,t,n,r,o,s,i){if(process.env.NODE_ENV!=="production"&&o===n&&ht(5),Zn(o)){const a=s&&t&&t.type_!==3&&!Ia(t.assigned_,r)?s.concat(r):void 0,l=Is(e,o,a);if(sd(n,r,l),Zn(l))e.canAutoFreeze_=!1;else return}else i&&n.add(o);if(on(o)&&!Es(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Is(e,o),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&ws(e,o)}}function ws(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Aa(t,n)}function Ob(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:id(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,s=Sa;n&&(o=[r],s=go);const{revoke:i,proxy:a}=Proxy.revocable(o,s);return r.draft_=a,r.revoke_=i,a}var Sa={get(e,t){if(t===_t)return e;const n=Xn(e);if(!Ia(n,t))return Db(e,n,t);const r=n[t];return e.finalized_||!on(r)?r:r===La(e.base_,t)?(Da(e),e.copy_[t]=Fa(r,e)):r},has(e,t){return t in Xn(e)},ownKeys(e){return Reflect.ownKeys(Xn(e))},set(e,t,n){const r=dd(Xn(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=La(Xn(e),t),s=o==null?void 0:o[_t];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Ab(n,o)&&(n!==void 0||Ia(e.base_,t)))return!0;Da(e),Oa(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return La(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Da(e),Oa(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Xn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ht(11)},getPrototypeOf(e){return xr(e.base_)},setPrototypeOf(){ht(12)}},go={};ys(Sa,(e,t)=>{go[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),go.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ht(13),go.set.call(this,e,t,void 0)},go.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ht(14),Sa.set.call(this,e[0],t,n,e[0])};function La(e,t){const n=e[_t];return(n?Xn(n):e)[t]}function Db(e,t,n){var o;const r=dd(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function dd(e,t){if(!(t in e))return;let n=xr(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=xr(n)}}function Oa(e){e.modified_||(e.modified_=!0,e.parent_&&Oa(e.parent_))}function Da(e){e.copy_||(e.copy_=wa(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Fb=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const s=n;n=t;const i=this;return function(l=s,...c){return i.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&ht(6),r!==void 0&&typeof r!="function"&&ht(7);let o;if(on(t)){const s=cd(this),i=Fa(t,void 0);let a=!0;try{o=n(i),a=!1}finally{a?_a(s):Ta(s)}return ad(s,r),ld(o,s)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===nd&&(o=void 0),this.autoFreeze_&&Aa(o,!0),r){const s=[],i=[];zn("Patches").generateReplacementPatches_(t,o,s,i),r(s,i)}return o}else ht(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(i,...a)=>this.produceWithPatches(i,l=>t(l,...a));let r,o;return[this.produce(t,n,(i,a)=>{r=i,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){on(e)||ht(8),Zn(e)&&(e=kb(e));const t=cd(this),n=Fa(e,void 0);return n[_t].isManual_=!0,Ta(t),n}finishDraft(e,t){const n=e&&e[_t];(!n||!n.isManual_)&&ht(9);const{scope_:r}=n;return ad(r,t),ld(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=zn("Patches").applyPatches_;return Zn(e)?r(e,t):this.produce(e,o=>r(o,t))}};function Fa(e,t){const n=vs(e)?zn("MapSet").proxyMap_(e,t):xs(e)?zn("MapSet").proxySet_(e,t):Ob(e,t);return(t?t.scope_:id()).drafts_.push(n),n}function kb(e){return Zn(e)||ht(10,e),fd(e)}function fd(e){if(!on(e)||Es(e))return e;const t=e[_t];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=wa(e,t.scope_.immer_.useStrictShallowCopy_)}else n=wa(e,!0);return ys(n,(r,o)=>{sd(n,r,fd(o))}),t&&(t.finalized_=!1),n}var Tt=new Fb,pd=Tt.produce;Tt.produceWithPatches.bind(Tt),Tt.setAutoFreeze.bind(Tt),Tt.setUseStrictShallowCopy.bind(Tt),Tt.applyPatches.bind(Tt),Tt.createDraft.bind(Tt),Tt.finishDraft.bind(Tt);var Nb=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const o={};e(o)===o&&(r=!0)}catch{}if(r){let o;try{throw new Error}catch(s){({stack:o}=s)}console.warn(`The result function returned its own inputs without modification. e.g
565
565
  \`createSelector([state => state.todos], todos => todos)\`
566
566
  This could lead to inefficient memoization and unnecessary re-renders.
567
567
  Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:o})}}},Rb=(e,t,n)=>{const{memoize:r,memoizeOptions:o}=t,{inputSelectorResults:s,inputSelectorResultsCopy:i}=e,a=r(()=>({}),...o);if(!(a.apply(null,s)===a.apply(null,i))){let c;try{throw new Error}catch(u){({stack:c}=u)}console.warn(`An input selector returned a different result when passed same arguments.
@@ -575,7 +575,7 @@ Take a look at the logic that dispatched this action: `,E,`
575
575
  (See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)`,`
576
576
  (To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),a||(d.measureTime(()=>{const f=p.getState(),h=ka(f,"",t,n,s,u);if(h){const{keyPath:v,value:C}=h;console.error(`A non-serializable value was detected in the state, in the path: \`${v}\`. Value:`,C,`
577
577
  Take a look at the reducer(s) handling this action type: ${E.type}.
578
- (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),d.warnIfExceeded()),y}}}function _s(e){return typeof e=="boolean"}var oy=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:o=!0,actionCreatorCheck:s=!0}=t??{};let i=new xd;if(n&&(_s(n)?i.push(Jb):i.push(Qb(n.extraArgument))),process.env.NODE_ENV!=="production"){if(r){let a={};_s(r)||(a=r),i.unshift(ny(a))}if(o){let a={};_s(o)||(a=o),i.push(ry(a))}if(s){let a={};_s(s)||(a=s),i.unshift(Kb(a))}}return i},sy="RTK_autoBatch",Sd=e=>t=>{setTimeout(t,e)},iy=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Sd(10),ay=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,s=!1,i=!1;const a=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?iy:e.type==="callback"?e.queueNotification:Sd(e.timeout),c=()=>{i=!1,s&&(s=!1,a.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){const p=()=>o&&u(),g=r.subscribe(p);return a.add(u),()=>{g(),a.delete(u)}},dispatch(u){var p;try{return o=!((p=u==null?void 0:u.meta)!=null&&p[sy]),s=!o,s&&(i||(i=!0,l(c))),r.dispatch(u)}finally{o=!0}}})},cy=e=>function(n){const{autoBatch:r=!0}=n??{};let o=new xd(e);return r&&o.push(ay(typeof r=="object"?r:void 0)),o};function ly(e){const t=oy(),{reducer:n=void 0,middleware:r,devTools:o=!0,preloadedState:s=void 0,enhancers:i=void 0}=e||{};let a;if(typeof n=="function")a=n;else if(po(n))a=ed(n);else throw new Error(process.env.NODE_ENV==="production"?Oe(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&r&&typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Oe(2):"`middleware` field must be a callback");let l;if(typeof r=="function"){if(l=r(t),process.env.NODE_ENV!=="production"&&!Array.isArray(l))throw new Error(process.env.NODE_ENV==="production"?Oe(3):"when using a middleware builder function, an array of middleware must be returned")}else l=t();if(process.env.NODE_ENV!=="production"&&l.some(y=>typeof y!="function"))throw new Error(process.env.NODE_ENV==="production"?Oe(4):"each middleware provided to configureStore must be a function");let c=bs;o&&(c=qb({trace:process.env.NODE_ENV!=="production",...typeof o=="object"&&o}));const u=Eb(...l),p=cy(u);if(process.env.NODE_ENV!=="production"&&i&&typeof i!="function")throw new Error(process.env.NODE_ENV==="production"?Oe(5):"`enhancers` field must be a callback");let g=typeof i=="function"?i(p):p();if(process.env.NODE_ENV!=="production"&&!Array.isArray(g))throw new Error(process.env.NODE_ENV==="production"?Oe(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&g.some(y=>typeof y!="function"))throw new Error(process.env.NODE_ENV==="production"?Oe(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&l.length&&!g.includes(u)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const E=c(...g);return Uu(a,s,E)}function Ld(e){const t={},n=[];let r;const o={addCase(s,i){if(process.env.NODE_ENV!=="production"){if(n.length>0)throw new Error(process.env.NODE_ENV==="production"?Oe(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(r)throw new Error(process.env.NODE_ENV==="production"?Oe(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const a=typeof s=="string"?s:s.type;if(!a)throw new Error(process.env.NODE_ENV==="production"?Oe(28):"`builder.addCase` cannot be called with an empty action type");if(a in t)throw new Error(process.env.NODE_ENV==="production"?Oe(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${a}'`);return t[a]=i,o},addMatcher(s,i){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Oe(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:s,reducer:i}),o},addDefaultCase(s){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Oe(31):"`builder.addDefaultCase` can only be called once");return r=s,o}};return e(o),[t,n,r]}function uy(e){return typeof e=="function"}function dy(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?Oe(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[n,r,o]=Ld(t),s;if(uy(e))s=()=>Ed(e());else{const a=Ed(e);s=()=>a}function i(a=s(),l){let c=[n[l.type],...r.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return c.filter(u=>!!u).length===0&&(c=[o]),c.reduce((u,p)=>{if(p)if(Zn(u)){const E=p(u,l);return E===void 0?u:E}else{if(on(u))return pd(u,g=>p(g,l));{const g=p(u,l);if(g===void 0){if(u===null)return u;throw new Error(process.env.NODE_ENV==="production"?Oe(9):"A case reducer on a non-draftable value must not return undefined")}return g}}return u},a)}return i.getInitialState=s,i}var fy=(e,t)=>Cd(e)?e.match(t):e(t);function py(...e){return t=>e.some(n=>fy(n,t))}var hy="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",gy=(e=21)=>{let t="",n=e;for(;n--;)t+=hy[Math.random()*64|0];return t},my=["name","message","stack","code"],Na=class{constructor(e,t){Nn(this,"_type");this.payload=e,this.meta=t}},Od=class{constructor(e,t){Nn(this,"_type");this.payload=e,this.meta=t}},by=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of my)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},Vt=(()=>{function e(t,n,r){const o=mo(t+"/fulfilled",(l,c,u,p)=>({payload:l,meta:{...p||{},arg:u,requestId:c,requestStatus:"fulfilled"}})),s=mo(t+"/pending",(l,c,u)=>({payload:void 0,meta:{...u||{},arg:c,requestId:l,requestStatus:"pending"}})),i=mo(t+"/rejected",(l,c,u,p,g)=>({payload:p,error:(r&&r.serializeError||by)(l||"Rejected"),meta:{...g||{},arg:u,requestId:c,rejectedWithValue:!!p,requestStatus:"rejected",aborted:(l==null?void 0:l.name)==="AbortError",condition:(l==null?void 0:l.name)==="ConditionError"}}));function a(l){return(c,u,p)=>{const g=r!=null&&r.idGenerator?r.idGenerator(l):gy(),E=new AbortController;let y,d;function f(v){d=v,E.abort()}const h=async function(){var I,x;let v;try{let w=(I=r==null?void 0:r.condition)==null?void 0:I.call(r,l,{getState:u,extra:p});if(Cy(w)&&(w=await w),w===!1||E.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const T=new Promise((A,S)=>{y=()=>{S({name:"AbortError",message:d||"Aborted"})},E.signal.addEventListener("abort",y)});c(s(g,l,(x=r==null?void 0:r.getPendingMeta)==null?void 0:x.call(r,{requestId:g,arg:l},{getState:u,extra:p}))),v=await Promise.race([T,Promise.resolve(n(l,{dispatch:c,getState:u,extra:p,requestId:g,signal:E.signal,abort:f,rejectWithValue:(A,S)=>new Na(A,S),fulfillWithValue:(A,S)=>new Od(A,S)})).then(A=>{if(A instanceof Na)throw A;return A instanceof Od?o(A.payload,g,l,A.meta):o(A,g,l)})])}catch(w){v=w instanceof Na?i(null,g,l,w.payload,w.meta):i(w,g,l)}finally{y&&E.signal.removeEventListener("abort",y)}return r&&!r.dispatchConditionRejection&&i.match(v)&&v.meta.condition||c(v),v}();return Object.assign(h,{abort:f,requestId:g,arg:l,unwrap(){return h.then(yy)}})}}return Object.assign(a,{pending:s,rejected:i,fulfilled:o,settled:py(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function yy(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Cy(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var vy=Symbol.for("rtk-slice-createasyncthunk");function xy(e,t){return`${e}/${t}`}function Ey({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[vy];return function(o){const{name:s,reducerPath:i=s}=o;if(!s)throw new Error(process.env.NODE_ENV==="production"?Oe(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&o.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const a=(typeof o.reducers=="function"?o.reducers(wy()):o.reducers)||{},l=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(C,I){const x=typeof C=="string"?C:C.type;if(!x)throw new Error(process.env.NODE_ENV==="production"?Oe(12):"`context.addCase` cannot be called with an empty action type");if(x in c.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?Oe(13):"`context.addCase` cannot be called with two reducers for the same action type: "+x);return c.sliceCaseReducersByType[x]=I,u},addMatcher(C,I){return c.sliceMatchers.push({matcher:C,reducer:I}),u},exposeAction(C,I){return c.actionCreators[C]=I,u},exposeCaseReducer(C,I){return c.sliceCaseReducersByName[C]=I,u}};l.forEach(C=>{const I=a[C],x={reducerName:C,type:xy(s,C),createNotation:typeof o.reducers=="function"};_y(I)?Sy(x,I,u,t):Ay(x,I,u)});function p(){if(process.env.NODE_ENV!=="production"&&typeof o.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?Oe(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[C={},I=[],x=void 0]=typeof o.extraReducers=="function"?Ld(o.extraReducers):[o.extraReducers],w={...C,...c.sliceCaseReducersByType};return dy(o.initialState,T=>{for(let A in w)T.addCase(A,w[A]);for(let A of c.sliceMatchers)T.addMatcher(A.matcher,A.reducer);for(let A of I)T.addMatcher(A.matcher,A.reducer);x&&T.addDefaultCase(x)})}const g=C=>C,E=new Map;let y;function d(C,I){return y||(y=p()),y(C,I)}function f(){return y||(y=p()),y.getInitialState()}function h(C,I=!1){function x(T){let A=T[C];if(typeof A>"u"){if(I)A=f();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Oe(15):"selectSlice returned undefined for an uninjected slice reducer")}return A}function w(T=g){const A=Id(E,I,{insert:()=>new WeakMap});return Id(A,T,{insert:()=>{const S={};for(const[F,D]of Object.entries(o.selectors??{}))S[F]=Iy(D,T,f,I);return S}})}return{reducerPath:C,getSelectors:w,get selectors(){return w(x)},selectSlice:x}}const v={name:s,reducer:d,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:f,...h(i),injectInto(C,{reducerPath:I,...x}={}){const w=I??i;return C.inject({reducerPath:w,reducer:d},x),{...v,...h(w,!0)}}};return v}}function Iy(e,t,n,r){function o(s,...i){let a=t(s);if(typeof a>"u"){if(r)a=n();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Oe(16):"selectState returned undefined for an uninjected slice reducer")}return e(a,...i)}return o.unwrapped=e,o}var Ra=Ey();function wy(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function Ay({type:e,reducerName:t,createNotation:n},r,o){let s,i;if("reducer"in r){if(n&&!Ty(r))throw new Error(process.env.NODE_ENV==="production"?Oe(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");s=r.reducer,i=r.prepare}else s=r;o.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,i?mo(e,i):mo(e))}function _y(e){return e._reducerDefinitionType==="asyncThunk"}function Ty(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Sy({type:e,reducerName:t},n,r,o){if(!o)throw new Error(process.env.NODE_ENV==="production"?Oe(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:s,fulfilled:i,pending:a,rejected:l,settled:c,options:u}=n,p=o(e,s,u);r.exposeAction(t,p),i&&r.addCase(p.fulfilled,i),a&&r.addCase(p.pending,a),l&&r.addCase(p.rejected,l),c&&r.addMatcher(p.settled,c),r.exposeCaseReducer(t,{fulfilled:i||Ts,pending:a||Ts,rejected:l||Ts,settled:c||Ts})}function Ts(){}function Oe(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const sn="success",at="error",Dd="Some error occured. Please contact support@hiverhq.com",Fd="Card refreshed successfully",Ly="Card linked successfully",Oy="Error in linking the card",Dy="Card unlinked successfully",Fy="Failed to unlink the card",Ss="Something went wrong",ky="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='15'%20height='15'%20viewBox='0%200%2015%2015'%3e%3cpath%20fill='%23ffffff'%20fill-rule='nonzero'%20d='M8.821%207.496L14.716%201.6A.937.937%200%201%200%2013.391.275L7.496%206.17%201.6.275A.937.937%200%201%200%20.275%201.601L6.17%207.496.275%2013.39A.937.937%200%201%200%201.6%2014.716L7.496%208.82l5.895%205.895a.935.935%200%200%200%201.325%200%20.937.937%200%200%200%200-1.326L8.821%207.496z'%20opacity='.8'/%3e%3c/svg%3e",Ny=b.styled(b.Box)`
578
+ (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),d.warnIfExceeded()),y}}}function _s(e){return typeof e=="boolean"}var oy=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:o=!0,actionCreatorCheck:s=!0}=t??{};let i=new xd;if(n&&(_s(n)?i.push(Jb):i.push(Qb(n.extraArgument))),process.env.NODE_ENV!=="production"){if(r){let a={};_s(r)||(a=r),i.unshift(ny(a))}if(o){let a={};_s(o)||(a=o),i.push(ry(a))}if(s){let a={};_s(s)||(a=s),i.unshift(Kb(a))}}return i},sy="RTK_autoBatch",Sd=e=>t=>{setTimeout(t,e)},iy=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Sd(10),ay=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,s=!1,i=!1;const a=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?iy:e.type==="callback"?e.queueNotification:Sd(e.timeout),c=()=>{i=!1,s&&(s=!1,a.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){const p=()=>o&&u(),g=r.subscribe(p);return a.add(u),()=>{g(),a.delete(u)}},dispatch(u){var p;try{return o=!((p=u==null?void 0:u.meta)!=null&&p[sy]),s=!o,s&&(i||(i=!0,l(c))),r.dispatch(u)}finally{o=!0}}})},cy=e=>function(n){const{autoBatch:r=!0}=n??{};let o=new xd(e);return r&&o.push(ay(typeof r=="object"?r:void 0)),o};function ly(e){const t=oy(),{reducer:n=void 0,middleware:r,devTools:o=!0,preloadedState:s=void 0,enhancers:i=void 0}=e||{};let a;if(typeof n=="function")a=n;else if(po(n))a=ed(n);else throw new Error(process.env.NODE_ENV==="production"?Oe(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&r&&typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Oe(2):"`middleware` field must be a callback");let l;if(typeof r=="function"){if(l=r(t),process.env.NODE_ENV!=="production"&&!Array.isArray(l))throw new Error(process.env.NODE_ENV==="production"?Oe(3):"when using a middleware builder function, an array of middleware must be returned")}else l=t();if(process.env.NODE_ENV!=="production"&&l.some(y=>typeof y!="function"))throw new Error(process.env.NODE_ENV==="production"?Oe(4):"each middleware provided to configureStore must be a function");let c=bs;o&&(c=qb({trace:process.env.NODE_ENV!=="production",...typeof o=="object"&&o}));const u=Eb(...l),p=cy(u);if(process.env.NODE_ENV!=="production"&&i&&typeof i!="function")throw new Error(process.env.NODE_ENV==="production"?Oe(5):"`enhancers` field must be a callback");let g=typeof i=="function"?i(p):p();if(process.env.NODE_ENV!=="production"&&!Array.isArray(g))throw new Error(process.env.NODE_ENV==="production"?Oe(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&g.some(y=>typeof y!="function"))throw new Error(process.env.NODE_ENV==="production"?Oe(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&l.length&&!g.includes(u)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const E=c(...g);return Uu(a,s,E)}function Ld(e){const t={},n=[];let r;const o={addCase(s,i){if(process.env.NODE_ENV!=="production"){if(n.length>0)throw new Error(process.env.NODE_ENV==="production"?Oe(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(r)throw new Error(process.env.NODE_ENV==="production"?Oe(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const a=typeof s=="string"?s:s.type;if(!a)throw new Error(process.env.NODE_ENV==="production"?Oe(28):"`builder.addCase` cannot be called with an empty action type");if(a in t)throw new Error(process.env.NODE_ENV==="production"?Oe(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${a}'`);return t[a]=i,o},addMatcher(s,i){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Oe(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:s,reducer:i}),o},addDefaultCase(s){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?Oe(31):"`builder.addDefaultCase` can only be called once");return r=s,o}};return e(o),[t,n,r]}function uy(e){return typeof e=="function"}function dy(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?Oe(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[n,r,o]=Ld(t),s;if(uy(e))s=()=>Ed(e());else{const a=Ed(e);s=()=>a}function i(a=s(),l){let c=[n[l.type],...r.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return c.filter(u=>!!u).length===0&&(c=[o]),c.reduce((u,p)=>{if(p)if(Zn(u)){const E=p(u,l);return E===void 0?u:E}else{if(on(u))return pd(u,g=>p(g,l));{const g=p(u,l);if(g===void 0){if(u===null)return u;throw new Error(process.env.NODE_ENV==="production"?Oe(9):"A case reducer on a non-draftable value must not return undefined")}return g}}return u},a)}return i.getInitialState=s,i}var fy=(e,t)=>Cd(e)?e.match(t):e(t);function py(...e){return t=>e.some(n=>fy(n,t))}var hy="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",gy=(e=21)=>{let t="",n=e;for(;n--;)t+=hy[Math.random()*64|0];return t},my=["name","message","stack","code"],Na=class{constructor(e,t){hn(this,"_type");this.payload=e,this.meta=t}},Od=class{constructor(e,t){hn(this,"_type");this.payload=e,this.meta=t}},by=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of my)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},Vt=(()=>{function e(t,n,r){const o=mo(t+"/fulfilled",(l,c,u,p)=>({payload:l,meta:{...p||{},arg:u,requestId:c,requestStatus:"fulfilled"}})),s=mo(t+"/pending",(l,c,u)=>({payload:void 0,meta:{...u||{},arg:c,requestId:l,requestStatus:"pending"}})),i=mo(t+"/rejected",(l,c,u,p,g)=>({payload:p,error:(r&&r.serializeError||by)(l||"Rejected"),meta:{...g||{},arg:u,requestId:c,rejectedWithValue:!!p,requestStatus:"rejected",aborted:(l==null?void 0:l.name)==="AbortError",condition:(l==null?void 0:l.name)==="ConditionError"}}));function a(l){return(c,u,p)=>{const g=r!=null&&r.idGenerator?r.idGenerator(l):gy(),E=new AbortController;let y,d;function f(v){d=v,E.abort()}const h=async function(){var I,x;let v;try{let w=(I=r==null?void 0:r.condition)==null?void 0:I.call(r,l,{getState:u,extra:p});if(Cy(w)&&(w=await w),w===!1||E.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const T=new Promise((A,S)=>{y=()=>{S({name:"AbortError",message:d||"Aborted"})},E.signal.addEventListener("abort",y)});c(s(g,l,(x=r==null?void 0:r.getPendingMeta)==null?void 0:x.call(r,{requestId:g,arg:l},{getState:u,extra:p}))),v=await Promise.race([T,Promise.resolve(n(l,{dispatch:c,getState:u,extra:p,requestId:g,signal:E.signal,abort:f,rejectWithValue:(A,S)=>new Na(A,S),fulfillWithValue:(A,S)=>new Od(A,S)})).then(A=>{if(A instanceof Na)throw A;return A instanceof Od?o(A.payload,g,l,A.meta):o(A,g,l)})])}catch(w){v=w instanceof Na?i(null,g,l,w.payload,w.meta):i(w,g,l)}finally{y&&E.signal.removeEventListener("abort",y)}return r&&!r.dispatchConditionRejection&&i.match(v)&&v.meta.condition||c(v),v}();return Object.assign(h,{abort:f,requestId:g,arg:l,unwrap(){return h.then(yy)}})}}return Object.assign(a,{pending:s,rejected:i,fulfilled:o,settled:py(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function yy(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Cy(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var vy=Symbol.for("rtk-slice-createasyncthunk");function xy(e,t){return`${e}/${t}`}function Ey({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[vy];return function(o){const{name:s,reducerPath:i=s}=o;if(!s)throw new Error(process.env.NODE_ENV==="production"?Oe(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&o.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const a=(typeof o.reducers=="function"?o.reducers(wy()):o.reducers)||{},l=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(C,I){const x=typeof C=="string"?C:C.type;if(!x)throw new Error(process.env.NODE_ENV==="production"?Oe(12):"`context.addCase` cannot be called with an empty action type");if(x in c.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?Oe(13):"`context.addCase` cannot be called with two reducers for the same action type: "+x);return c.sliceCaseReducersByType[x]=I,u},addMatcher(C,I){return c.sliceMatchers.push({matcher:C,reducer:I}),u},exposeAction(C,I){return c.actionCreators[C]=I,u},exposeCaseReducer(C,I){return c.sliceCaseReducersByName[C]=I,u}};l.forEach(C=>{const I=a[C],x={reducerName:C,type:xy(s,C),createNotation:typeof o.reducers=="function"};_y(I)?Sy(x,I,u,t):Ay(x,I,u)});function p(){if(process.env.NODE_ENV!=="production"&&typeof o.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?Oe(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[C={},I=[],x=void 0]=typeof o.extraReducers=="function"?Ld(o.extraReducers):[o.extraReducers],w={...C,...c.sliceCaseReducersByType};return dy(o.initialState,T=>{for(let A in w)T.addCase(A,w[A]);for(let A of c.sliceMatchers)T.addMatcher(A.matcher,A.reducer);for(let A of I)T.addMatcher(A.matcher,A.reducer);x&&T.addDefaultCase(x)})}const g=C=>C,E=new Map;let y;function d(C,I){return y||(y=p()),y(C,I)}function f(){return y||(y=p()),y.getInitialState()}function h(C,I=!1){function x(T){let A=T[C];if(typeof A>"u"){if(I)A=f();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Oe(15):"selectSlice returned undefined for an uninjected slice reducer")}return A}function w(T=g){const A=Id(E,I,{insert:()=>new WeakMap});return Id(A,T,{insert:()=>{const S={};for(const[F,D]of Object.entries(o.selectors??{}))S[F]=Iy(D,T,f,I);return S}})}return{reducerPath:C,getSelectors:w,get selectors(){return w(x)},selectSlice:x}}const v={name:s,reducer:d,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:f,...h(i),injectInto(C,{reducerPath:I,...x}={}){const w=I??i;return C.inject({reducerPath:w,reducer:d},x),{...v,...h(w,!0)}}};return v}}function Iy(e,t,n,r){function o(s,...i){let a=t(s);if(typeof a>"u"){if(r)a=n();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Oe(16):"selectState returned undefined for an uninjected slice reducer")}return e(a,...i)}return o.unwrapped=e,o}var Ra=Ey();function wy(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function Ay({type:e,reducerName:t,createNotation:n},r,o){let s,i;if("reducer"in r){if(n&&!Ty(r))throw new Error(process.env.NODE_ENV==="production"?Oe(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");s=r.reducer,i=r.prepare}else s=r;o.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,i?mo(e,i):mo(e))}function _y(e){return e._reducerDefinitionType==="asyncThunk"}function Ty(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Sy({type:e,reducerName:t},n,r,o){if(!o)throw new Error(process.env.NODE_ENV==="production"?Oe(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:s,fulfilled:i,pending:a,rejected:l,settled:c,options:u}=n,p=o(e,s,u);r.exposeAction(t,p),i&&r.addCase(p.fulfilled,i),a&&r.addCase(p.pending,a),l&&r.addCase(p.rejected,l),c&&r.addMatcher(p.settled,c),r.exposeCaseReducer(t,{fulfilled:i||Ts,pending:a||Ts,rejected:l||Ts,settled:c||Ts})}function Ts(){}function Oe(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const sn="success",at="error",Dd="Some error occured. Please contact support@hiverhq.com",Fd="Card refreshed successfully",Ly="Card linked successfully",Oy="Error in linking the card",Dy="Card unlinked successfully",Fy="Failed to unlink the card",Ss="Something went wrong",ky="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='15'%20height='15'%20viewBox='0%200%2015%2015'%3e%3cpath%20fill='%23ffffff'%20fill-rule='nonzero'%20d='M8.821%207.496L14.716%201.6A.937.937%200%201%200%2013.391.275L7.496%206.17%201.6.275A.937.937%200%201%200%20.275%201.601L6.17%207.496.275%2013.39A.937.937%200%201%200%201.6%2014.716L7.496%208.82l5.895%205.895a.935.935%200%200%200%201.325%200%20.937.937%200%200%200%200-1.326L8.821%207.496z'%20opacity='.8'/%3e%3c/svg%3e",Ny=b.styled(b.Box)`
579
579
  display: flex;
580
580
  flex-direction: row;
581
581
  align-items: center;
@@ -655,7 +655,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
655
655
  `,cf=e=>m.jsx(cn.ClearIndicator,{...e,children:m.jsx(hv,{})}),lf=(e,t)=>({...e,placeholder:(n,r)=>{var o;return{...n,...(o=e==null?void 0:e.placeholder)==null?void 0:o.call(e,n,r),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},control:(n,r)=>{var o;return{...n,backgroundColor:"transparent",...(o=e==null?void 0:e.control)==null?void 0:o.call(e,n,r)}},...t?{menuPortal:(n,r)=>{var o;return{...n,...(o=e==null?void 0:e.menuPortal)==null?void 0:o.call(e,n,r),zIndex:t,fontFamily:b.theme.typography.fontFamily,fontSize:"13px"}}}:null}),gv=b.styled(b.Stack)`
656
656
  width: 0;
657
657
  height: 0;
658
- `,mv=({root:e,rootMargin:t,callback:n})=>{const r=_.useRef(null),o=_.useCallback(s=>{if(!s||!e)return;r.current&&r.current.disconnect();const i=new IntersectionObserver(a=>{const l=a[0];n(l)},{root:e,rootMargin:t});i.observe(s),r.current=i},[e,t,n]);return m.jsx(gv,{ref:o})},uf=({options:e,isMulti:t,isScrollTarget:n})=>{const r=_.useRef(),o=_.useMemo(()=>e?Object.fromEntries(e.map(a=>[a.value,a])):{},[e]);return{optionsMap:o,getValue:a=>{var u;if(t||typeof a=="object")return a;const l=o[a];return l&&(r.current=l),a===((u=r.current)==null?void 0:u.value)?r.current:a},closeMenuOnScroll:n?a=>{const l=a.target;return!n||!l?!1:n(l)}:void 0}},bv=e=>m.jsx(cn.DropdownIndicator,{...e,children:m.jsx(b.Icon,{children:e.selectProps.menuIsOpen?m.jsx(b.icons.ArrowDropUp,{}):m.jsx(b.icons.ArrowDropDown,{})})}),df=()=>({ClearIndicator:cf,DropdownIndicator:bv,IndicatorSeparator:()=>null,Option:af}),wo=({stackIndex:e,isScrollTarget:t,...n})=>{const{value:r,options:o,isMulti:s}=n,[i,a]=_.useState(!1),l=_.useCallback(p=>{a(!p.isIntersecting)},[]),{getValue:c,closeMenuOnScroll:u}=uf({options:o,isMulti:s,isScrollTarget:t});return m.jsxs(m.Fragment,{children:[n.menuPortalTarget&&n.root?m.jsx(mv,{root:n.root,rootMargin:"-38px 0px 0px 0px",callback:l}):null,m.jsx(dv,{...n,isDisabled:n.disabled,value:r?c(r):void 0,styles:lf(n.styles,e),components:n.components?n.components:df(),closeMenuOnScroll:u,...i&&{menuIsOpen:!1}})]})};wo.getDefaultComponents=df;const ff="Required Field",yv="Validation Failed";var pf=(e=>(e.DATE="DD/MM/YYYY",e))(pf||{}),Cv=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"];function hf(e){var t=e.defaultOptions,n=t===void 0?!1:t,r=e.cacheOptions,o=r===void 0?!1:r,s=e.loadOptions;e.options;var i=e.isLoading,a=i===void 0?!1:i,l=e.onInputChange,c=e.filterOption,u=c===void 0?null:c,p=Gt(e,Cv),g=p.inputValue,E=_.useRef(void 0),y=_.useRef(!1),d=_.useState(Array.isArray(n)?n:void 0),f=$e(d,2),h=f[0],v=f[1],C=_.useState(typeof g<"u"?g:""),I=$e(C,2),x=I[0],w=I[1],T=_.useState(n===!0),A=$e(T,2),S=A[0],F=A[1],D=_.useState(void 0),k=$e(D,2),M=k[0],j=k[1],H=_.useState([]),z=$e(H,2),U=z[0],J=z[1],Y=_.useState(!1),ae=$e(Y,2),ue=ae[0],B=ae[1],W=_.useState({}),V=$e(W,2),X=V[0],$=V[1],ee=_.useState(void 0),re=$e(ee,2),P=re[0],te=re[1],ye=_.useState(void 0),Z=$e(ye,2),Me=Z[0],ke=Z[1];o!==Me&&($({}),ke(o)),n!==P&&(v(Array.isArray(n)?n:void 0),te(n)),_.useEffect(function(){return y.current=!0,function(){y.current=!1}},[]);var Je=_.useCallback(function(yt,st){if(!s)return st();var Ze=s(yt,st);Ze&&typeof Ze.then=="function"&&Ze.then(st,function(){return st()})},[s]);_.useEffect(function(){n===!0&&Je(x,function(yt){y.current&&(v(yt||[]),F(!!E.current))})},[]);var Qe=_.useCallback(function(yt,st){var Ze=q4(yt,st,l);if(!Ze){E.current=void 0,w(""),j(""),J([]),F(!1),B(!1);return}if(o&&X[Ze])w(Ze),j(Ze),J(X[Ze]),F(!1),B(!1);else{var Fn=E.current={};w(Ze),F(!0),B(!M),Je(Ze,function(Ft){y&&Fn===E.current&&(E.current=void 0,F(!1),j(Ze),J(Ft||[]),B(!1),$(Ft?ne(ne({},X),{},Ir({},Ze,Ft)):X))})}},[o,Je,M,X,l]),fn=ue?[]:x&&M?U:h||[];return ne(ne({},p),{},{options:fn,isLoading:S||a,onInputChange:Qe,filterOption:u})}var vv=_.forwardRef(function(e,t){var n=hf(e),r=Ba(n);return N.createElement(Us,ie({ref:t},r))}),xv=vv,Ev=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],gf=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=String(t).toLowerCase(),s=String(r.getOptionValue(n)).toLowerCase(),i=String(r.getOptionLabel(n)).toLowerCase();return s===o||i===o},uc={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,o){return!(!t||n.some(function(s){return gf(t,s,o)})||r.some(function(s){return gf(t,s,o)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function Iv(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,o=r===void 0?"last":r,s=e.formatCreateLabel,i=s===void 0?uc.formatCreateLabel:s,a=e.isValidNewOption,l=a===void 0?uc.isValidNewOption:a,c=e.getNewOptionData,u=c===void 0?uc.getNewOptionData:c,p=e.onCreateOption,g=e.options,E=g===void 0?[]:g,y=e.onChange,d=Gt(e,Ev),f=d.getOptionValue,h=f===void 0?Q0:f,v=d.getOptionLabel,C=v===void 0?J0:v,I=d.inputValue,x=d.isLoading,w=d.isMulti,T=d.value,A=d.name,S=_.useMemo(function(){return l(I,Xs(T),E,{getOptionValue:h,getOptionLabel:C})?u(I,i(I)):void 0},[i,u,C,h,I,l,E,T]),F=_.useMemo(function(){return(n||!x)&&S?o==="first"?[S].concat(wr(E)):[].concat(wr(E),[S]):E},[n,o,x,S,E]),D=_.useCallback(function(k,M){if(M.action!=="select-option")return y(k,M);var j=Array.isArray(k)?k:[k];if(j[j.length-1]===S){if(p)p(I);else{var H=u(I,I),z={action:"create-option",name:A,option:H};y(Eo(w,[].concat(wr(Xs(T)),[H]),H),z)}return}y(k,M)},[u,I,w,A,S,p,y,T]);return ne(ne({},d),{},{options:F,onChange:D})}var wv=_.forwardRef(function(e,t){var n=hf(e),r=Ba(n),o=Iv(r);return N.createElement(Us,ie({ref:t},o))}),Av=wv;const _v=b.styled(b.Typography)`
658
+ `,mv=({root:e,rootMargin:t,callback:n})=>{const r=_.useRef(null),o=_.useCallback(s=>{if(!s||!e)return;r.current&&r.current.disconnect();const i=new IntersectionObserver(a=>{const l=a[0];n(l)},{root:e,rootMargin:t});i.observe(s),r.current=i},[e,t,n]);return m.jsx(gv,{ref:o})},uf=({options:e,isMulti:t,isScrollTarget:n})=>{const r=_.useRef(),o=_.useMemo(()=>e?Object.fromEntries(e.map(a=>[a.value,a])):{},[e]);return{optionsMap:o,getValue:a=>{var u;if(t||typeof a=="object")return a;const l=o[a];return l&&(r.current=l),a===((u=r.current)==null?void 0:u.value)?r.current:a},closeMenuOnScroll:n?a=>{const l=a.target;return!n||!l?!1:n(l)}:void 0}},bv=e=>m.jsx(cn.DropdownIndicator,{...e,children:m.jsx(b.Icon,{children:e.selectProps.menuIsOpen?m.jsx(b.icons.ArrowDropUp,{}):m.jsx(b.icons.ArrowDropDown,{})})}),df=()=>({ClearIndicator:cf,DropdownIndicator:bv,IndicatorSeparator:()=>null,Option:af}),wo=({stackIndex:e,isScrollTarget:t,...n})=>{const{value:r,options:o,isMulti:s}=n,[i,a]=_.useState(!1),l=_.useCallback(p=>{a(!p.isIntersecting)},[]),{getValue:c,closeMenuOnScroll:u}=uf({options:o,isMulti:s,isScrollTarget:t});return m.jsxs(m.Fragment,{children:[n.menuPortalTarget&&n.root?m.jsx(mv,{root:n.root,rootMargin:"-38px 0px 0px 0px",callback:l}):null,m.jsx(dv,{...n,isDisabled:n.disabled,value:r?c(r):void 0,styles:lf(n.styles,e),components:n.components?n.components:df(),closeMenuOnScroll:u,...i&&{menuIsOpen:!1}})]})};wo.getDefaultComponents=df;const ff="Required Field",yv="Validation Failed";var pf=(e=>(e.DATE="DD/MM/YYYY",e))(pf||{}),Cv=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"];function hf(e){var t=e.defaultOptions,n=t===void 0?!1:t,r=e.cacheOptions,o=r===void 0?!1:r,s=e.loadOptions;e.options;var i=e.isLoading,a=i===void 0?!1:i,l=e.onInputChange,c=e.filterOption,u=c===void 0?null:c,p=Gt(e,Cv),g=p.inputValue,E=_.useRef(void 0),y=_.useRef(!1),d=_.useState(Array.isArray(n)?n:void 0),f=$e(d,2),h=f[0],v=f[1],C=_.useState(typeof g<"u"?g:""),I=$e(C,2),x=I[0],w=I[1],T=_.useState(n===!0),A=$e(T,2),S=A[0],F=A[1],D=_.useState(void 0),k=$e(D,2),M=k[0],j=k[1],H=_.useState([]),z=$e(H,2),U=z[0],J=z[1],Y=_.useState(!1),ae=$e(Y,2),ue=ae[0],B=ae[1],W=_.useState({}),V=$e(W,2),X=V[0],$=V[1],ee=_.useState(void 0),re=$e(ee,2),P=re[0],te=re[1],ye=_.useState(void 0),Z=$e(ye,2),Me=Z[0],ke=Z[1];o!==Me&&($({}),ke(o)),n!==P&&(v(Array.isArray(n)?n:void 0),te(n)),_.useEffect(function(){return y.current=!0,function(){y.current=!1}},[]);var Je=_.useCallback(function(yt,st){if(!s)return st();var Ze=s(yt,st);Ze&&typeof Ze.then=="function"&&Ze.then(st,function(){return st()})},[s]);_.useEffect(function(){n===!0&&Je(x,function(yt){y.current&&(v(yt||[]),F(!!E.current))})},[]);var Qe=_.useCallback(function(yt,st){var Ze=q4(yt,st,l);if(!Ze){E.current=void 0,w(""),j(""),J([]),F(!1),B(!1);return}if(o&&X[Ze])w(Ze),j(Ze),J(X[Ze]),F(!1),B(!1);else{var kn=E.current={};w(Ze),F(!0),B(!M),Je(Ze,function(Ft){y&&kn===E.current&&(E.current=void 0,F(!1),j(Ze),J(Ft||[]),B(!1),$(Ft?ne(ne({},X),{},Ir({},Ze,Ft)):X))})}},[o,Je,M,X,l]),fn=ue?[]:x&&M?U:h||[];return ne(ne({},p),{},{options:fn,isLoading:S||a,onInputChange:Qe,filterOption:u})}var vv=_.forwardRef(function(e,t){var n=hf(e),r=Ba(n);return N.createElement(Us,ie({ref:t},r))}),xv=vv,Ev=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],gf=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=String(t).toLowerCase(),s=String(r.getOptionValue(n)).toLowerCase(),i=String(r.getOptionLabel(n)).toLowerCase();return s===o||i===o},uc={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,o){return!(!t||n.some(function(s){return gf(t,s,o)})||r.some(function(s){return gf(t,s,o)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function Iv(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,o=r===void 0?"last":r,s=e.formatCreateLabel,i=s===void 0?uc.formatCreateLabel:s,a=e.isValidNewOption,l=a===void 0?uc.isValidNewOption:a,c=e.getNewOptionData,u=c===void 0?uc.getNewOptionData:c,p=e.onCreateOption,g=e.options,E=g===void 0?[]:g,y=e.onChange,d=Gt(e,Ev),f=d.getOptionValue,h=f===void 0?Q0:f,v=d.getOptionLabel,C=v===void 0?J0:v,I=d.inputValue,x=d.isLoading,w=d.isMulti,T=d.value,A=d.name,S=_.useMemo(function(){return l(I,Xs(T),E,{getOptionValue:h,getOptionLabel:C})?u(I,i(I)):void 0},[i,u,C,h,I,l,E,T]),F=_.useMemo(function(){return(n||!x)&&S?o==="first"?[S].concat(wr(E)):[].concat(wr(E),[S]):E},[n,o,x,S,E]),D=_.useCallback(function(k,M){if(M.action!=="select-option")return y(k,M);var j=Array.isArray(k)?k:[k];if(j[j.length-1]===S){if(p)p(I);else{var H=u(I,I),z={action:"create-option",name:A,option:H};y(Eo(w,[].concat(wr(Xs(T)),[H]),H),z)}return}y(k,M)},[u,I,w,A,S,p,y,T]);return ne(ne({},d),{},{options:F,onChange:D})}var wv=_.forwardRef(function(e,t){var n=hf(e),r=Ba(n),o=Iv(r);return N.createElement(Us,ie({ref:t},o))}),Av=wv;const _v=b.styled(b.Typography)`
659
659
  display: block;
660
660
  white-space: nowrap;
661
661
  overflow: hidden;
@@ -1037,7 +1037,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1037
1037
  height: 40px;
1038
1038
  }
1039
1039
  `,r6=e=>N.createElement("svg",{width:35,height:35,viewBox:"0 0 35 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("rect",{x:9,y:9,width:15,height:17,fill:"white"}),N.createElement("g",{clipPath:"url(#clip0_7787_114457)"},N.createElement("path",{d:"M17.1981 2.86633C9.28704 2.86633 2.86646 9.28691 2.86646 17.198C2.86646 25.1091 9.28704 31.5296 17.1981 31.5296C25.1092 31.5296 31.5298 25.1091 31.5298 17.198C31.5298 9.28691 25.1092 2.86633 17.1981 2.86633ZM14.3318 23.6472V10.7487L22.9308 17.198L14.3318 23.6472Z",fill:"#4D596C"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_7787_114457"},N.createElement("rect",{width:34.396,height:34.396,fill:"white"})))),o6=({aspectRatio:e="auto",...t})=>{const[n,r]=_.useState(!1);return n?null:m.jsxs(n6,{aspectRatio:e,children:[m.jsx("img",{className:"preview-img",onError:()=>r(!0),...t}),m.jsx(r6,{className:"play-icon"})]})},fc=(e,t,n)=>{let r=`${t}_${n}`;return Object.keys(e).forEach(o=>{r=`${r}_${o}:${e[o]}`}),r},s6=(e,t)=>t?Object.values(t).filter(r=>e.values[r]&&!e.errors[r]):[],_o=(e,t)=>t?Object.keys(t).reduce((r,o)=>{let s="";const i=t[o];return e.values&&e.values[i]&&typeof e.values[i]=="object"&&"value"in e.values[i]?s=e.values[i].value:e.values&&e.values[i]&&typeof e.values[i]!="object"?s=e.values[i]:s=null,{...r,[o]:s}},{}):{},pc=({formFields:e})=>{const t={};return e.forEach(n=>{var r,o,s,i,a,l;if(t[n.name]={},(r=n.validations)!=null&&r.isRequired&&(typeof n.validations.isRequired=="object"?t[n.name].isRequired=d5(n.validations.isRequired.msg):t[n.name].isRequired=!0),n.type==="date"){let c=typeof((o=n.validations)==null?void 0:o.disableFuture)=="object"?n.validations.disableFuture.msg:"";c=typeof((s=n.validations)==null?void 0:s.disablePast)=="object"?n.validations.disablePast.msg:c,t[n.name].validate=f5(c);return}if(n.type==="number"&&((i=n.validations)!=null&&i.range)){t[n.name].validate=p5();return}if(n.type==="text"&&n.limit){t[n.name].validate=Vd();return}if(n.type==="table"){const c=pc({formFields:n.columns??[]});t[n.name].validations=c}if((a=n.validations)!=null&&a.isUrl){const c=typeof n.validations.isUrl=="object"?n.validations.isUrl.msg:"";t[n.name].validate=l5(c)}else if((l=n.validations)!=null&&l.isEmail){const c=typeof n.validations.isEmail=="object"?n.validations.isEmail.msg:"";t[n.name].validate=u5(c)}}),t},ni={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[ti.ROW_ID]):!1,isSelect:e=>!!e&&typeof e=="object"&&"label"in e,isDate:e=>!!e&&typeof e=="object"&&"toISOString"in e},ri=(e,t)=>Object.keys(t).reduce((n,r)=>{const o=e.values[t[r]];let s;return ni.isMultiSelect(o)?s=o.map(i=>i.value):ni.isTable(o)?s=o.map(({...a})=>(delete a[ti.ROW_ID],a)).filter(a=>Object.keys(a).length>0):ni.isSelect(o)?s=o.value:ni.isDate(o)?s=o.toISOString():s=o||"",n[r]=s,n},{}),i6=(e,t)=>{const n={},r=new Set;let o="";for(const s of e)s.rowId?(n[s.rowId]||(n[s.rowId]=[]),n[s.rowId].push(s),r.add(s.rowId),o=""):!n[o]||n[o].length>=t?(r.add(s.name),n[s.name]=[s],o=s.name):n[o].push(s);return[...r].map(s=>({id:s,formFields:n[s]}))},wf=(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 s=0;for(const i of o){const a=wf(r.columns,i);s+=a}s>0&&n++;continue}o===""||o===void 0||o===null||n++}return n},Dr="/v1/api",a6=`${Dr}/connectors/conversation/:conversationId/metadata`,c6=`${Dr}/connectors/forms/:formId/field/:fieldName/data`,l6=`${Dr}/connectors/form/:formId`,u6=`${Dr}/connectors/forms/:id/link`,d6=`${Dr}/connectors/forms/:id/preview`,f6=`${Dr}/connectors/conversation/:conversationId/selected-email`,p6=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),ze({url:Cr(`${c6}?${r.toString()}`,e),method:nt.POST,data:t})},h6=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),ze({url:Cr(`${l6}?${r.toString()}`,e),method:nt.POST,data:t})},g6=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),ze({url:`${d6.replace(":id",e)}?${r.toString()}`,method:nt.POST,data:{args:t}})},Af={optionsMap:null,createOptionApi:K.IDLE,dropdownOptionsApis:K.IDLE,previewCardData:null,previewCardApiStatus:K.IDLE,selectedSuggestionType:"basic"},_f=Ra({name:"commonSlice",initialState:Af,reducers:{resetState:()=>Af,resetPreviewCardData:e=>{e.previewCardData=null,e.previewCardApiStatus=K.IDLE},setSelectedSuggestionType:(e,t)=>{e.selectedSuggestionType=t.payload}},extraReducers:e=>{e.addCase(oi.pending,t=>{t.createOptionApi=K.LOADING}).addCase(oi.fulfilled,(t,n)=>{const r=t.optionsMap||{},{optionsList:o,key:s}=n.payload;t.createOptionApi=K.IDLE,t.optionsMap={...r,[s]:{...r[s],options:o}}}).addCase(oi.rejected,t=>{t.createOptionApi=K.FAILED}).addCase(Qn.pending,t=>{t.dropdownOptionsApis=K.LOADING}).addCase(Qn.fulfilled,(t,n)=>{const r=t.optionsMap||{},{optionsList:o,hasMore:s,currentPage:i,searchTerm:a,key:l}=n.payload;t.dropdownOptionsApis=K.IDLE,t.optionsMap={...r,[l]:{options:o,hasMore:s,currentPage:i,searchTerm:a}}}).addCase(Qn.rejected,t=>{t.dropdownOptionsApis=K.FAILED}).addCase(Fr.pending,t=>{t.previewCardApiStatus=K.LOADING}).addCase(Fr.fulfilled,(t,n)=>{const{data:r}=n.payload;r&&(t.previewCardData=r),t.previewCardApiStatus=K.IDLE}).addCase(Fr.rejected,t=>{t.previewCardApiStatus=K.FAILED})}}),oi=Vt("commonSlice/createDropDownOption",async(e,{getState:t,rejectWithValue:n})=>{var d,f,h;const{fieldName:r,label:o,formId:s,interfaceId:i,conversationId:a=null,args:l={},createArgs:c={},callback:u}=e,p=fc(l||{},s,r),{common:g}=t(),{options:E=[],...y}=((d=g.optionsMap)==null?void 0:d[p])||{};try{const v=await h6({fieldName:r,formId:i},{args:c,conversation_id:a});if(!v||!("data"in v)||!("output_variables"in v.data)||!("external_resource_id"in v.data.output_variables))throw v;const C=v.data.output_variables,{external_resource_id:I,...x}=C,T=[{label:o,value:I,prefillValues:x},...E],A=Md(T,S=>S.value);return u==null||u(A),{optionsList:A,key:p,...y}}catch(v){u==null||u(E);const C=v,I=(f=C==null?void 0:C.response)==null?void 0:f.data,x=typeof I=="string"?I:(I==null?void 0:I.message)||Ss;return Re({message:x,type:at}),n((h=C==null?void 0:C.response)==null?void 0:h.status)}}),Qn=Vt("commonSlice/fetchDropDownOptions",async(e,{getState:t,rejectWithValue:n})=>{var T,A,S;const{fieldName:r,formId:o,searchTerm:s,fieldConfig:i,callback:a,args:l={},interfaceId:c="",pagination:u={enabled:!1},controller:p}=e,g=fc(l||{},o,r),{common:E}=t();let y=!1;i.meta&&"showAvatar"in i.meta&&typeof i.meta.showAvatar=="boolean"&&(y=i.meta.showAvatar);const d=((T=E.optionsMap)==null?void 0:T[g])||{},f=s===d.searchTerm?d:{},{options:h=[],hasMore:v=!0,currentPage:C=0}=f,{enabled:I,limit:x}=u,w=x||10;try{let F;const D=p==null?void 0:p.signal,k=I?{pageNumber:C+1,searchTerm:s,limit:w,enabled:I}:null;if(v&&(F=await p6({fieldName:r,formId:o},{pagination:k||{},args:l,interfaceId:c})),D!=null&&D.aborted)throw D.reason;if(!F||!F.data||!("data"in F.data)||!Array.isArray(F.data.data)||!F.data.data.length){const{common:J}=t(),Y=(A=J.optionsMap)==null?void 0:A[g];return a==null||a(Y.options??[]),{...Y,optionsList:Y.options??[],key:g,hasMore:!1}}const j=F.data.data.map(J=>y?{...J,avatarUrl:J.avatarUrl||Uy}:(delete J.avatarUrl,J)),H=[...h,...j],z=I?j.length>=w:!1,U=Md(H,J=>J.value);return a==null||a(U),{optionsList:U,fieldName:r,formId:o,searchTerm:s,currentPage:C+1,hasMore:z,key:g}}catch(F){const{common:D}=t(),k=((S=D.optionsMap)==null?void 0:S[g])||{};return a==null||a(k.options??[]),n(F)}},{condition:(e,{getState:t})=>{var p;if(e.isScrollToBottomEvent)return!0;const{fieldName:n,formId:r,searchTerm:o,callback:s,args:i}=e,a=fc(i||{},r,n),{common:l}=t(),c=(p=l.optionsMap)==null?void 0:p[a];if((c==null?void 0:c.searchTerm)!==o)return!0;const u=(c==null?void 0:c.options)||[];return u&&u.length?(s==null||s(u),!1):!0}}),Fr=Vt("commonSlice/previewCard",async({id:e,args:t,channelType:n,isRefresh:r},{rejectWithValue:o})=>{var s;try{const i=await g6(e,t,n),a=i==null?void 0:i.data;return a?(r&&Re({message:Fd,type:sn}),{data:Ou(a)}):(r&&Re({message:Dd,type:at}),{data:null})}catch(i){return o({status:(s=i.response)==null?void 0:s.status})}}),{resetState:uI,resetPreviewCardData:m6,setSelectedSuggestionType:b6}=_f.actions,y6=_f.reducer,To="/v1/api",C6=`${To}/connectors/forms/list`,v6=`${To}/connectors/cards/:id/unlink`,x6=`${To}/connectors/forms/:id/link`,E6=`${To}/connectors/form/:formId`,I6=`${To}/connectors/forms/:formId/data`,w6=({inboxIds:e,channelType:t,conversationId:n})=>{const r=new URLSearchParams;return e.forEach(o=>r.append("inbox_ids",o)),r.append("channel_type",t),r.append("conversation_id",String(n)),ze({url:`${C6}?${r.toString()}`,method:nt.GET})},Tf=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),ze({url:Cr(`${E6}?${r.toString()}`,e),method:nt.POST,data:t})},A6=(e,t="email",n,r)=>{const o=new URLSearchParams;return o.append("channel_type",t),ze({url:`${v6.replace(":id",e)}?${o.toString()}`,method:nt.POST,data:{externalResourceId:n,conversationId:r}})},_6=(e,t,n="email",r)=>{const o=new URLSearchParams;return o.append("channel_type",n),ze({url:`${x6.replace(":id",e)}?${o.toString()}`,method:nt.POST,data:{externalResourceId:t,conversationId:r}})},T6=(e,t="email",n,r,o)=>{const s=new URLSearchParams;return s.append("channel_type",t),s.append("conversation_id",String(n||"")),s.append("senderEmail",o),s.append("externalResourceId",r),ze({url:`${I6.replace(":formId",e)}?${s.toString()}`,method:nt.GET})},S6="Error in previewing the card",Sf="Link format isn't recognized. Please check that you've entered a valid URL",L6="Item already linked",O6="Card linked successfully",D6="Error in linking the card",F6="New card created",k6="Card creation failed",N6="Create and link objects from different apps to this conversation",R6="Are you sure you want to change the primary object?",M6="Changing the primary object will reset all the information you’ve entered and all data will be lost and can’t be recovered.",P6="Are you sure you want to leave?",B6=`If you go back now, all the information you’ve entered will be lost and can’t be recovered.
1040
- Do you want to continue?`,j6="Select an object to create",V6="Select an object to link",Lf="Select object",G6="Paste URL or ID",H6="Object ID/Link",W6="Card updated",Z6="Card updation failed",Of=3,Df=(e,t)=>{var r,o,s,i,a,l,c,u,p,g,E,y,d;let n={};switch(e.type){case"select":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(((s=e.interfaceDetails)==null?void 0:s.args)||{}).length>0,isMultiSelect:e.type==="multi-select",type:e.interfaceDetails?"async-select":"select",isClearable:((i=e.meta)==null?void 0:i.isClearable)??!0};break}case"date":{n={...e,type:"date",disablePast:!!((a=e.validations)!=null&&a.disablePast)||!1,disableFuture:!!((l=e.validations)!=null&&l.disableFuture)||!1};break}case"number":{n={...e,type:"number",min:((u=(c=e.validations)==null?void 0:c.range)==null?void 0:u.min)||Number.MIN_SAFE_INTEGER,max:((g=(p=e.validations)==null?void 0:p.range)==null?void 0:g.max)||Number.MAX_SAFE_INTEGER};break}case"multiline":{n={...e,type:"text",maxRows:((E=e.validations)==null?void 0:E.maxRows)||5,limit:(y=e.validations)==null?void 0:y.maxCharacters,rows:5,multiline:!0};break}case"text":{n={...e,type:"text",limit:(d=e.validations)==null?void 0:d.maxCharacters};break}default:n={...e}}return"value"in n&&(n.defaultValue=n.value,delete n.value),{...n,...t}},Ff=Ra({name:"writeCapability",initialState:kd,reducers:{resetState:()=>kd,resetCurrentResourceDetails:e=>{e.currentResourceDetails=null,e.currentResourceDetailsApiStatus=K.IDLE},setCurrentCardInEdit:(e,t)=>{e.currentCardInEdit=t.payload},setHasUnsavedChanges:(e,t)=>{e.hasUnsavedChanges=t.payload}},extraReducers:e=>{e.addCase(si.pending,t=>{t.objectListApiStatus=K.LOADING}).addCase(si.fulfilled,(t,n)=>{const{createObjectList:r,createObjectConnectorNamesList:o,linkObjectList:s,editObjectList:i,searchObjectList:a,formFields:l,objectDict:c,dependentFieldsMap:u}=n.payload;t.objectListApiStatus=K.IDLE,t.createObjectList=r,t.createObjectConnectorNamesList=o,t.linkObjectList=s,t.editObjectList=i,t.searchObjectList=a,t.formFields=l,t.objectDict=c,t.dependentFieldsMap=u}).addCase(si.rejected,t=>{t.objectListApiStatus=K.FAILED}).addCase(Qn.pending,t=>{t.dropdownOptionsApis=K.LOADING}).addCase(Qn.fulfilled,(t,n)=>{const r=t.optionsMap||{},{optionsList:o,hasMore:s,currentPage:i,key:a}=n.payload;t.dropdownOptionsApis=K.IDLE,t.optionsMap={...r,[a]:{options:o,hasMore:s,currentPage:i}}}).addCase(Qn.rejected,t=>{t.dropdownOptionsApis=K.FAILED}).addCase(ii.pending,t=>{t.createFormApiStatus=K.LOADING}).addCase(ii.fulfilled,t=>{t.createFormApiStatus=K.IDLE}).addCase(ii.rejected,t=>{t.createFormApiStatus=K.FAILED}).addCase(li.pending,t=>{t.linkCardApiStatus=K.LOADING}).addCase(li.fulfilled,t=>{t.linkCardApiStatus=K.IDLE}).addCase(li.rejected,t=>{t.linkCardApiStatus=K.FAILED}).addCase(ci.pending,t=>{t.unlinkCardApiStatus=K.LOADING}).addCase(ci.fulfilled,t=>{t.unlinkCardApiStatus=K.IDLE}).addCase(ci.rejected,t=>{t.unlinkCardApiStatus=K.FAILED}).addCase(ai.pending,t=>{t.updateFormApiStatus=K.LOADING}).addCase(ai.fulfilled,t=>{t.updateFormApiStatus=K.IDLE}).addCase(ai.rejected,t=>{t.updateFormApiStatus=K.FAILED}).addCase(ui.pending,t=>{t.currentResourceDetailsApiStatus=K.LOADING}).addCase(ui.fulfilled,(t,n)=>{const{data:r}=n.payload;r&&(t.currentResourceDetails=r),t.currentResourceDetailsApiStatus=K.IDLE}).addCase(ui.rejected,t=>{t.currentResourceDetailsApiStatus=K.FAILED})}}),si=Vt("writeCapability/fetchObjectList",async e=>{const{inboxIds:t,channelType:n,conversationId:r,isExpandedFormEnabled:o}=e,s=await w6({inboxIds:t,channelType:n,conversationId:r});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,a={},l=[],c=[],u=[],p=[],g=[],E={},y={};return i==null||i.forEach(d=>{var h,v;if(d.expandedView&&!o)return;const f={...d};"fieldList"in f&&delete f.fieldList,y[d.id]=f,a[d.id]||(a[d.id]={}),E[d.id]||(E[d.id]=[]),d.type==="create"&&d.authenticated?(l.push({value:d.id,label:d.name,avatarUrl:d.logoUrl,connectorKey:d.connectorName}),d.connectorName&&!c.includes(d.connectorName)&&c.push(d.connectorName)):d.type==="link"&&d.authenticated?u.push({value:d.id,label:d.name,avatarUrl:d.logoUrl}):d.type==="edit"&&d.authenticated?p.push({value:d.id,label:d.name,avatarUrl:d.logoUrl}):d.type==="search_and_link"&&d.authenticated&&g.push({value:d.id,label:d.name,avatarUrl:d.logoUrl}),(h=d.fieldList)==null||h.sort((C,I)=>C.priority-I.priority),(v=d.fieldList)==null||v.forEach(C=>{const I=Df(C);if(I.columns&&(I.columns=I.columns.map(x=>Df(x,{loadOptionsOnFocus:!0,defaultOptions:!1}))),E[d.id]=[...E[d.id],I],C.interfaceDetails&&(C.interfaceDetails.args||C.interfaceDetails.optionalArgs)){const x={...C.interfaceDetails.args,...C.interfaceDetails.optionalArgs};Object.values(x).forEach(w=>{a[d.id][w]?a[d.id][w]=[...a[d.id][w],C.name]:a[d.id][w]=[C.name]})}})}),{createObjectList:l,createObjectConnectorNamesList:c,linkObjectList:u,editObjectList:p,searchObjectList:g,formFields:E,objectDict:y,dependentFieldsMap:a}}),ii=Vt("writeCapability/createForm",async(e,{rejectWithValue:t})=>{var l;const{formId:n,successCallback:r,failureCallback:o,args:s={},interfaceId:i,conversationId:a}=e;try{await Tf({formId:n},{args:s,interfaceId:i,conversationId:a}),r==null||r(),Re({message:F6,type:sn})}catch(c){const u=c,p=(l=u==null?void 0:u.response)==null?void 0:l.data,g=(p==null?void 0:p.message)??k6;return o==null||o(c),Re({message:g,type:at}),t(c)}}),ai=Vt("writeCapability/updateForm",async(e,{rejectWithValue:t})=>{const{formId:n,successCallback:r,failureCallback:o,args:s={},interfaceId:i,conversationId:a,externalResourceId:l,previousArgs:c={}}=e;try{await Tf({formId:n},{args:s,interfaceId:i,conversationId:a,externalResourceId:l,previousArgs:c}),r==null||r(),Re({message:W6,type:sn})}catch(u){return o==null||o(u),Re({message:Z6,type:at}),t(u)}}),ci=Vt("writeCapability/unlinkCard",async({id:e,channelType:t,externalResourceId:n,conversationId:r})=>{await A6(e,t,n,r)}),li=Vt("writeCapability/linkCard",async({id:e,externalResourceId:t,channelType:n,conversationId:r},{rejectWithValue:o})=>{var s;try{await _6(e,t,n,r)}catch(i){return o({status:(s=i.response)==null?void 0:s.status})}}),ui=Vt("connectorCardLibrary/fetchCurrentResourceDetails",async(e,{rejectWithValue:t})=>{const{id:n,channelType:r,conversationId:o,externalResourceId:s,contactEmail:i}=e;try{const a=await T6(n,r,o,s,i),l=a==null?void 0:a.data,c=a==null?void 0:a.status,u={values:{},errors:{}};return Object.entries(l.formData).forEach(([p,g])=>{"label"in g&&(g.type&&g.type==="date"?u.values[p]=g.label?new Date(parseInt(g.label)).toISOString():"":g.type&&g.type==="multi-select"&&"value"in g&&"label"in g&&g.value&&g.label?u.values[p]=[{value:g.value,label:g.label}]:g.value?u.values[p]={value:g.value,label:g.label}:u.values[p]=g.label)}),{data:u,status:c}}catch(a){return Re({message:Ss,type:at}),t(a)}}),{resetState:dI,setCurrentCardInEdit:kr,resetCurrentResourceDetails:X6,setHasUnsavedChanges:kf}=Ff.actions,z6=Ff.reducer,Y6=()=>{const[e,t]=_.useState(null),[n,r]=_.useState({isVertical:!1,isHorizontal:!1,isScrolling:!1}),o=_.useCallback(s=>{t(s)},[]);return _.useEffect(()=>{if(!e)return;e.dataset.prevScrollLeft="0",e.dataset.prevScrollTop="0";let s=null;const i=100;let a=null;const l=150,c=u=>{s||(s=window.setTimeout(()=>{const p=u.target,g=Number(e.dataset.prevScrollLeft)||0,E=Number(e.dataset.prevScrollTop)||0,y=p.scrollLeft,d=p.scrollTop,f=y-g,h=d-E,v=Math.abs(h)>Math.abs(f),C=Math.abs(f)>Math.abs(h);r({isVertical:v,isHorizontal:C,isScrolling:!0}),e.dataset.prevScrollLeft=String(y),e.dataset.prevScrollTop=String(d),s=null},i),a&&window.clearTimeout(a),a=window.setTimeout(()=>{r(p=>({...p,isScrolling:!1})),a=null},l))};return e.addEventListener("scroll",c),()=>{e.removeEventListener("scroll",c),s&&window.clearTimeout(s),a&&window.clearTimeout(a)}},[e]),[n,o]},J6="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='M5.8016%2011.709L12.3416%205.16893L11.4298%204.25712L4.88979%2010.7972V11.709H5.8016ZM6.33618%2012.9987H3.6001V10.2626L10.9739%202.88875C11.0948%202.76786%2011.2588%202.69995%2011.4298%202.69995C11.6008%202.69995%2011.7648%202.76786%2011.8857%202.88875L13.71%204.71302C13.8309%204.83395%2013.8988%204.99794%2013.8988%205.16893C13.8988%205.33992%2013.8309%205.50391%2013.71%205.62484L6.33618%2012.9987ZM3.6001%2014.2884H15.2073V15.578H3.6001V14.2884Z'%20fill='%236C7B94'/%3e%3c/svg%3e",Q6=({data:e,title:t,currentCard:n,setShowModal:r})=>{const o=jt(),{sendTrackingEvent:s,currentSmIds:i}=_.useContext(Ve),{userGroupId:a}=Yt()||{},[l,c]=Y6(),{isScrolling:u,isVertical:p}=l,g=u&&p,E=_.useMemo(()=>(e==null?void 0:e[0].data.map(h=>h.label))||[],[e]),y=_.useMemo(()=>e.map(h=>{const v={cells:{},externalResourceId:h.externalResourceId};return h.data.forEach((C,I)=>{if(E[I]){let x=C.value?C.value:gs;x&&C.type==="date"&&(x=new Date(parseInt(x)).toLocaleDateString(navigator.language)),v.cells[E[I]]={label:x,deepLink:C==null?void 0:C.deepLink}}}),v}),[e,E]),d=(h,v)=>m.jsx(A3,{align:"left",children:h.deepLink?m.jsx(b.Link,{target:"_blank",underline:"none",href:h.deepLink,children:h.label}):m.jsx(b.Typography,{variant:"body2",color:"gray.black",children:h.label})},`${v}_${h.label}`),f=h=>{!h||!n||(r(!1),s(hu,{card_title:n.title,connector_name:n.connectorName,ug_id:a,sm_ids:i}),o(kr({...n,externalResourceId:h})))};return m.jsxs(b.Stack,{maxHeight:"340px",maxWidth:"700px",padding:"32px 0px 32px 32px",overflow:"auto",children:[m.jsx(b.Typography,{variant:"h2",color:"gray.black",marginBottom:"16px",children:t}),m.jsx(b.TableContainer,{ref:c,children:m.jsxs(b.Table,{stickyHeader:!0,children:[m.jsx(E3,{children:m.jsxs(b.TableRow,{children:[E.map(h=>m.jsx(I3,{sx:{whiteSpace:"nowrap"},children:m.jsx(b.Typography,{variant:"overline",color:"gray.gray3",children:h})},h)),m.jsx(T3,{})]})}),m.jsx(b.TableBody,{children:y.map((h,v)=>m.jsxs(w3,{children:[Object.values(h.cells).map((C,I)=>d(C,I)),m.jsx(_3,{children:!g&&h.externalResourceId&&m.jsx(b.Tooltip,{title:Eu,placement:"bottom",children:m.jsx(b.IconButton,{className:"row-edit",onClick:()=>f(h.externalResourceId),children:m.jsx("img",{src:J6})})})})]},`id_${v}`))})]})})]})},q6=e=>e.cardList.connectorCards,$6=e=>e.cardList.connectorsEnabled,U6=e=>e.cardList.connectorApiStatus,K6=e=>e.cardList.cardSpecificData,e7=e=>e.cardList.specificConnectorApiStatus,t7=e=>e.cardList.specificConnectorErrorCode,n7="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",Nf=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}},r7=(e,t)=>`${Au} (Error code: ${e})`.replace(/{{connector_name}}/g,(t==null?void 0:t[0])||""),Rf=e=>{const{value:t,error:n,deepLink:r,statusCode:o,isLoading:s,type:i,redirectToAdminTab:a,isFailed:l,connectorNames:c,cardTitle:u,currentCard:p,cardId:g,isCardLevelError:E,fieldName:y,showErrorIcon:d}=e,f=_.useRef(null),h=_.useRef(null),{email:v,currentSmIds:C,conversationId:I,sendTrackingEvent:x,connectorFunctions:w}=_.useContext(Ve),T=be(t7),A=T==null?void 0:T[g],[S,F]=_.useState(!1),D=_.useMemo(()=>{if(n&&E){const{error_message:Y}=Nf(n);return Y}return l?Au.replace(/{{connector_name}}/g,(c==null?void 0:c[0])||""):mu},[n,l,c,E]),k=_.useCallback(()=>{const Y=n||r7(A,c),{error_code:ae,error_message:ue}=Nf(Y);x==null||x(zg,{sm_ids:C,frontend_req_params:{email:v,conversationId:I,externalResourceId:p==null?void 0:p.externalResourceId},card_title:u,connector_name:c!=null&&c.length?c:"",error_code:ae,error_message:ue})},[n,A,x,C,v,I,u,c,p==null?void 0:p.externalResourceId]);_.useEffect(()=>{(n&&E||l&&A)&&k()},[k,A,l,n,E]),_.useEffect(()=>{const Y=r?h.current:f.current;if(Y){const ae=Y.scrollHeight>Y.clientHeight||Y.scrollWidth>Y.clientWidth;F(ae)}},[t,r]);const M=o==ua.NOT_FOUND;let j=M?gs:t;i==="date"&&j&&!M&&(j=new Date(parseInt(j)).toLocaleDateString(navigator.language));const H=!!n||l,z=()=>{a?w==null||w.redirectToAdmin():window.open(Sm,"_blank")},U=()=>{x==null||x(Yg,{sm_ids:C,card_title:u,field_name:y})},J=Y=>{const ae=/<>(.*?)<>/g,ue=Y.split(ae);return m.jsx(_.Fragment,{children:ue.map((B,W)=>W%2===1?m.jsx(y3,{variant:"body2",onClick:z,children:B},W):B)})};return s?m.jsx(Cn,{variant:"rounded",width:"100%",height:16,animation:"wave",margin:"4px 0 0 0"}):H?m.jsxs(Bu,{gap:"7px",children:[d?m.jsx(b.Stack,{marginTop:"3px",flexShrink:"0",children:m.jsx("img",{src:n7,width:"18px",height:"18px"})}):null,m.jsx(ju,{variant:"body2",children:D?J(D):mu})]}):m.jsx(b.Tooltip,{title:S?j:null,placement:"bottom",children:r?m.jsx(Vu,{ref:h,target:"_blank",underline:"none",href:r,fontSize:"13px",onClick:U,children:j||gs}):m.jsx(v3,{ref:f,variant:"body2",children:j||gs})})},Mf="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_825_73646)'%3e%3cpath%20d='M19%206.41L17.59%205L12%2010.59L6.41%205L5%206.41L10.59%2012L5%2017.59L6.41%2019L12%2013.41L17.59%2019L19%2017.59L13.41%2012L19%206.41Z'%20fill='%236F7C90'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_825_73646'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",So=({shown:e,setShown:t,children:n,showCloseButton:r=!1,borderRadius:o=4,sx:s})=>m.jsx(b.Dialog,{open:e,onClose:()=>t(!1),PaperProps:{style:{borderRadius:o,padding:0,height:"fit-content",width:"fit-content",maxWidth:"none"}},sx:{...s},children:m.jsxs(b.Stack,{direction:"row",children:[r&&m.jsx(b.Box,{position:"absolute",right:10,top:10,children:m.jsx(b.Tooltip,{title:"Close",placement:"bottom",children:m.jsx(b.IconButton,{onClick:()=>t(!1),children:m.jsx("img",{src:Mf})})})}),n]})}),Pf=e=>{var B,W,V;const{id:t,cardTitle:n,specificCardData:r,specificConnectorApiStatus:o,isOpen:s,currentCard:i}=e,a=24,l=(o==null?void 0:o[t])===K.IDLE,c=(o==null?void 0:o[t])===K.LOADING,u=(o==null?void 0:o[t])===K.FAILED,{cardType:p,data:g,cardErrorMessage:E,redirectToAdminTab:y,connectorNames:d}=(r==null?void 0:r[t])||{},f=p==="flat",[h,v]=_.useState(!1),[C,I]=_.useState(!1),[x,w]=_.useState(!1),[T,A]=_.useState(!1),S=((B=g==null?void 0:g.listItems)==null?void 0:B.statusCode)!==401,F=_.useMemo(()=>{var X,$,ee,re;return f&&((X=g==null?void 0:g.flatDisplay)!=null&&X.data)?g.flatDisplay.data:!f&&((re=(ee=($=g==null?void 0:g.listItems)==null?void 0:$.fields)==null?void 0:ee[0])!=null&&re.data)?g.listItems.fields[0].data:[]},[f,g]),D=_.useMemo(()=>F==null?void 0:F.slice(0,5),[F]),[k,M]=_.useState([]),j=_.useRef(null),[H,z]=_.useState(0),U=h?-180:0,J=f?!1:!!((W=g==null?void 0:g.listItems)!=null&&W.errorMessage),Y=J||u||E,ae=l&&!J&&s&&(x||C);_.useLayoutEffect(()=>{var X;(X=j.current)!=null&&X.scrollHeight&&z(j.current.scrollHeight+a)},[o==null?void 0:o[t],k,j]),_.useEffect(()=>{var re,P;const X=((F==null?void 0:F.length)||0)>5,$=!f&&(((P=(re=g==null?void 0:g.listItems)==null?void 0:re.fields)==null?void 0:P.length)||0)>1;w(X&&!$),I($)},[g,f,F==null?void 0:F.length]),_.useEffect(()=>{M(h?F:D)},[g,h,D,F]);const ue=()=>{x?v(X=>!X):A(X=>!X)};return m.jsxs(m.Fragment,{children:[m.jsx(So,{shown:T,setShown:A,showCloseButton:!0,borderRadius:12,children:m.jsx(Q6,{data:((V=g==null?void 0:g.listItems)==null?void 0:V.fields)||[],title:n,currentCard:i,setShowModal:A})}),m.jsx(m3,{className:s?"":"slideUp",height:H,children:m.jsx(b.Stack,{ref:j,gap:1,margin:"12px",children:c&&!(k!=null&&k.length)?m.jsxs(m.Fragment,{children:[m.jsx(Cn,{variant:"rounded",width:"100%",height:20,animation:"wave"}),m.jsx(Cn,{variant:"rounded",width:"100%",height:20,animation:"wave"})]}):m.jsx(m.Fragment,{children:Y?m.jsx(b.Box,{margin:"8px 0",children:m.jsx(Rf,{error:E,isLoading:c,redirectToAdminTab:y,isFailed:u,showErrorIcon:!S,connectorNames:d,cardId:t,cardTitle:n,currentCard:i,isCardLevelError:!0})}):k!=null&&k.length?k==null?void 0:k.map(X=>{const{value:$,label:ee,deepLink:re,type:P}=X,te="errorMessage"in X?X.errorMessage:null,ye="statusCode"in X?X.statusCode:null;return m.jsxs("div",{children:[m.jsx(b3,{variant:"overline",children:ee}),m.jsx(Rf,{value:$,error:te,deepLink:re,statusCode:ye,isLoading:c,type:P,cardTitle:n,currentCard:i,cardId:t,fieldName:ee})]},ee)}):m.jsx(b.Box,{margin:"8px 0",children:m.jsx(ju,{children:bm})})})})}),!E&&ae&&m.jsx(L3,{variant:"body2_medium",onClick:ue,children:x?m.jsxs(m.Fragment,{children:[h?ub:qu,m.jsx(S3,{src:lb,transformAngle:U})]}):qu})]})},o7={connectorCards:null,cardSpecificData:null,connectorApiStatus:K.IDLE,conversationMetaDataApiStatus:K.IDLE,specificConnectorApiStatus:null,threadId:null,connectorsEnabled:!1,specificConnectorErrorCode:null,conversationEmailHeaders:null},Bf="/v1/api",s7=`${Bf}/connectors/cards`,i7=`${Bf}/connectors/cards/:id/data`,a7=({inboxIds:e,conversationId:t,channelType:n="email"})=>{const r=new URLSearchParams;return e.forEach(o=>r.append("inbox_ids",o)),r.append("channel_type",n),r.append("conversation_id",String(t||"")),ze({url:`${s7}?${r.toString()}`,method:nt.GET})},c7=(e,t,n,r)=>{const o=new URLSearchParams;return o.append("senderEmail",t),o.append("conversation_id",String(n||"")),r&&o.append("externalResourceId",r),ze({url:`${i7.replace(":id",e)}?${o.toString()}`,method:nt.GET})},jf=Ra({name:"connectorCardLibrary",initialState:o7,reducers:{updateThreadId(e,t){const{payload:n}=t;e.threadId=n.threadId,e.connectorCards=null},clearConnectorList(e){e.connectorCards=null,e.cardSpecificData=null}},extraReducers:e=>{e.addCase(di.pending,t=>{t.connectorApiStatus=K.LOADING}).addCase(di.fulfilled,(t,n)=>{t.connectorApiStatus=K.IDLE,t.connectorCards=n.payload.cards,t.connectorsEnabled=n.payload.connectorsEnabled}).addCase(di.rejected,t=>{t.connectorApiStatus=K.FAILED}).addCase(Lo.pending,(t,n)=>{const{id:r,externalResourceId:o=""}=n.meta.arg;let s=r;o&&(s=`${s}_${o}`),t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[s]:K.LOADING}}).addCase(Lo.fulfilled,(t,n)=>{const{id:r,externalResourceId:o=""}=n.meta.arg;let s=r;o&&(s=`${s}_${o}`);const{data:i}=n.payload||{};i&&(t.cardSpecificData={...t.cardSpecificData?t.cardSpecificData:{},[s]:i}),t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[s]:K.IDLE}}).addCase(Lo.rejected,(t,n)=>{const{id:r,externalResourceId:o=""}=n.meta.arg;let s=r;o&&(s=`${s}_${o}`),t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[s]:K.FAILED};const i=n.payload&&typeof n.payload=="object"&&"code"in n.payload?String(n.payload.code):_u;t.specificConnectorErrorCode={...t.specificConnectorErrorCode??{},[s]:i}})}}),di=Vt("connectorCardLibrary/fetchAllCard",async({inboxIds:e,channelType:t,conversationId:n})=>{var a;const r=await a7({inboxIds:e,channelType:t,conversationId:n});if(!Array.isArray((a=r==null?void 0:r.data)==null?void 0:a.cards))return{cards:[],connectorsEnabled:!1};const{cards:o,connectorsEnabled:s=!1}=r.data;return{cards:o.sort((l,c)=>(l==null?void 0:l.priority)-(c==null?void 0:c.priority)),connectorsEnabled:s}}),Lo=Vt("connectorCardLibrary/fetchSpecificCard",async({id:e,email:t,conversationId:n,isRefresh:r,externalResourceId:o},s)=>{try{const i=await c7(e,t,n,o),a=i==null?void 0:i.data,l=i==null?void 0:i.status;return a?(r&&Re({message:Fd,type:sn}),{data:Ou(a),status:l}):(r&&Re({message:Dd,type:at}),{data:{},status:l})}catch(i){const a=i;return s.rejectWithValue({...a,code:a.code||_u})}}),l7=jf.reducer,Vf=jf.actions,Gf="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.76618%202.23341C8.79952%201.26675%207.47285%200.666748%205.99952%200.666748C3.05285%200.666748%200.672852%203.05341%200.672852%206.00008C0.672852%208.94675%203.05285%2011.3334%205.99952%2011.3334C8.48619%2011.3334%2010.5595%209.63341%2011.1529%207.33341H9.76618C9.21952%208.88675%207.73952%2010.0001%205.99952%2010.0001C3.79285%2010.0001%201.99952%208.20675%201.99952%206.00008C1.99952%203.79341%203.79285%202.00008%205.99952%202.00008C7.10618%202.00008%208.09285%202.46008%208.81285%203.18675L6.66618%205.33341H11.3329V0.666748L9.76618%202.23341Z'%20fill='%236C7B94'/%3e%3c/svg%3e",u7="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%20d='M11.4587%206.7528C11.2244%206.51848%2010.8445%206.51848%2010.6102%206.7528C10.3759%206.98711%2010.3759%207.36701%2010.6102%207.60132L11.4587%206.7528ZM12.1916%208.33414L12.6158%207.90988L12.1916%208.33414ZM8.33462%2012.1911L8.75888%2011.7668L8.33462%2012.1911ZM7.6018%2010.6097C7.36748%2010.3754%206.98758%2010.3754%206.75327%2010.6097C6.51895%2010.8441%206.51895%2011.224%206.75327%2011.4583L7.6018%2010.6097ZM4.43911%209.14411C4.67343%209.37842%205.05333%209.37842%205.28764%209.14411C5.52196%208.9098%205.52196%208.5299%205.28764%208.29558L4.43911%209.14411ZM3.70629%207.56276L4.13056%207.1385L3.70629%207.56276ZM7.56324%203.70582L7.9875%203.28155L7.56324%203.70582ZM8.29606%205.28716C8.53037%205.52148%208.91027%205.52148%209.14459%205.28716C9.3789%205.05285%209.3789%204.67295%209.14459%204.43864L8.29606%205.28716ZM10.6102%207.60132L11.7673%208.75841L12.6158%207.90988L11.4587%206.7528L10.6102%207.60132ZM11.7673%208.75841C12.1662%209.15735%2012.3904%209.69843%2012.3904%2010.2626L13.5904%2010.2626C13.5904%209.38017%2013.2398%208.53387%2012.6158%207.90988L11.7673%208.75841ZM12.3904%2010.2626C12.3904%2010.8268%2012.1662%2011.3679%2011.7673%2011.7668L12.6158%2012.6154C13.2398%2011.9914%2013.5904%2011.1451%2013.5904%2010.2626L12.3904%2010.2626ZM11.7673%2011.7668C10.9365%2012.5976%209.58963%2012.5976%208.75888%2011.7668L7.91035%2012.6154C9.20973%2013.9147%2011.3164%2013.9147%2012.6158%2012.6154L11.7673%2011.7668ZM8.75888%2011.7668L7.6018%2010.6097L6.75327%2011.4583L7.91035%2012.6154L8.75888%2011.7668ZM5.28764%208.29558L4.13056%207.1385L3.28203%207.98703L4.43911%209.14411L5.28764%208.29558ZM4.13056%207.1385C3.73162%206.73956%203.50749%206.19848%203.50749%205.63429L2.30749%205.63429C2.30749%206.51674%202.65804%207.36304%203.28203%207.98703L4.13056%207.1385ZM3.50749%205.63429C3.50749%205.0701%203.73162%204.52902%204.13056%204.13008L3.28203%203.28155C2.65804%203.90554%202.30749%204.75184%202.30749%205.63429L3.50749%205.63429ZM4.13056%204.13008C4.96131%203.29933%206.30822%203.29933%207.13897%204.13008L7.9875%203.28155C6.68812%201.98217%204.58141%201.98217%203.28203%203.28155L4.13056%204.13008ZM7.13897%204.13008L8.29606%205.28716L9.14459%204.43864L7.9875%203.28155L7.13897%204.13008Z'%20fill='%236C7B94'/%3e%3crect%20x='5.08887'%20y='6.0791'%20width='1.33333'%20height='6.66667'%20rx='0.666667'%20transform='rotate(-45%205.08887%206.0791)'%20fill='%236C7B94'/%3e%3cpath%20d='M5.59961%2014.3998V12.7998'%20stroke='%236C7B94'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.7998%205.59961H14.3998'%20stroke='%236C7B94'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.40039%2011.2002H4.00039'%20stroke='%236C7B94'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.2002%202.40039V4.00039'%20stroke='%236C7B94'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",d7="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_5908_39767)'%3e%3cpath%20d='M9.37333%206.01333L9.98667%206.62667L3.94667%2012.6667H3.33333V12.0533L9.37333%206.01333ZM11.7733%202C11.6067%202%2011.4333%202.06667%2011.3067%202.19333L10.0867%203.41333L12.5867%205.91333L13.8067%204.69333C14.0667%204.43333%2014.0667%204.01333%2013.8067%203.75333L12.2467%202.19333C12.1133%202.06%2011.9467%202%2011.7733%202ZM9.37333%204.12667L2%2011.5V14H4.5L11.8733%206.62667L9.37333%204.12667Z'%20fill='%236C7B94'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_5908_39767'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Hf=e=>e.write.createObjectList,f7=e=>e.write.createObjectConnectorNamesList,Wf=e=>e.write.linkObjectList,p7=e=>e.write.editObjectList,h7=e=>e.write.objectDict,g7=e=>e.write.formFields,m7=e=>e.write.linkCardApiStatus,b7=e=>e.write.unlinkCardApiStatus,y7=e=>e.write.dependentFieldsMap,C7=e=>e.write.createFormApiStatus,v7=e=>e.write.updateFormApiStatus,x7=e=>e.write.currentResourceDetails,E7=e=>e.write.currentResourceDetailsApiStatus,Zf=e=>e.write.currentCardInEdit,Xf=e=>e.write.hasUnsavedChanges,I7=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,zf=e=>Object.keys(e).sort((n,r)=>r.localeCompare(n)).reduce((n,r)=>{var o;return(typeof e[r]=="string"||typeof e[r]=="object"&&e[r]!==null)&&I7(e[r])?n[r]=(o=new Date(`${e[r]}`))==null?void 0:o.toString():n[r]=e[r],n},{}),w7=e=>Im.replace("{{connectorName}}",e),A7=({showUnlinkModal:e,setShowUnlinkModal:t,cardId:n,onCardUnlinking:r,externalResourceId:o,conversationId:s,connectorName:i})=>{const a=jt(),{sendTrackingEvent:l}=_.useContext(Ve),u=be(b7)===K.LOADING,p=()=>{s&&o&&a(ci({id:n,conversationId:s,externalResourceId:o})).unwrap().then(()=>{l(kg,{connector_name:i,conversation_id:s}),t(!1),r(),Re({message:Dy,type:sn})}).catch(()=>{Re({message:Fy,type:sn})})};return m.jsx(So,{shown:e,setShown:t,showCloseButton:!0,children:m.jsxs(b.Stack,{width:"400px",padding:"20px",gap:"8px",children:[m.jsx(b.Typography,{variant:"h2",children:Em}),m.jsx(b.Typography,{variant:"body2",children:w7(i)}),m.jsxs(b.Stack,{direction:"row",gap:"8px",marginTop:"20px",justifyContent:"flex-end",children:[m.jsx(b.Button,{variant:"text",onClick:()=>t(!1),children:pa}),m.jsx(b.Button,{disabled:u,color:"error",onClick:p,children:xu})]})]})})},_7=({actions:e,isHovered:t=!1})=>{const r=e.filter(a=>a.shown);if(r.length===0)return null;const o=r[r.length-1],s=r.slice(0,-1),i=t?(s.length+1)*32:32;return m.jsxs(x3,{width:i,isHovered:t,children:[m.jsx("div",{className:"hidden-actions",children:s.map(({id:a,disabled:l,label:c,iconSrc:u,action:p})=>m.jsx(b.Tooltip,{title:c,placement:"bottom",children:m.jsx(vr,{onClick:p,disabled:l,children:m.jsx("img",{src:u})})},a))}),o&&m.jsx(b.Tooltip,{title:o.label,placement:"bottom",children:m.jsx(vr,{onClick:o.action,disabled:o.disabled,children:m.jsx("img",{src:o.iconSrc})})},o.id)]})},T7=e=>{const{card:t,specificCardData:n,email:r,specificConnectorApiStatus:o,defaultOpenState:s=!1,onCardUnlinking:i}=e,a=jt(),{availableFeatures:l,sendTrackingEvent:c,conversationId:u,currentSmIds:p}=_.useContext(Ve),{userGroupId:g}=Yt()||{},[E,y]=_.useState(!!s),[d,f]=_.useState(!1),[h,v]=_.useState(!1),[C,I]=_.useState(!1),{id:x,title:w,externalResourceId:T="",forms:A=[],logoUrl:S}=t;let F=x;T&&(F=`${F}_${T}`);const{data:D,cardType:k,cardErrorMessage:M,connectorNames:j}=(n==null?void 0:n[F])??{},H=(j==null?void 0:j[0])||"",z=(o==null?void 0:o[F])===K.LOADING,U=(o==null?void 0:o[F])===K.FAILED,J=!!(tt(l,gu)&&T),Y=_.useMemo(()=>{var P,te;if(M||U||!(tt(l,lm)&&A.some(ye=>ye.type==="edit")))return!1;switch(k){case"flat":return!!((D==null?void 0:D.flatDisplay.externalResourceId)??t.externalResourceId);case"flat_with_list":return((P=D==null?void 0:D.listItems)==null?void 0:P.fields.length)===1?(te=D==null?void 0:D.listItems)==null?void 0:te.fields.some(ye=>ye.externalResourceId):!1;default:return!1}},[D,k,l,A,t,M,U]),ae=_.useCallback((P=!1)=>{const te=P?Bg:Pg;r&&x&&u&&a(Lo({id:x,email:r,conversationId:u,externalResourceId:T})).unwrap().then(ye=>{const Z={...Lu(ye,w,P,!0),sm_ids:p};c(te,Z)}).catch(ye=>{const Z={...Lu(ye,w,P,!1),sm_ids:p};c(te,Z)})},[a,r,x,w,c,u,T,p]);_.useEffect(()=>{E&&ae(!0)},[E,ae]);const ue=(P,te)=>{var Z;P==null||P.stopPropagation(),a(Lo({id:te,email:r,conversationId:u,isRefresh:!0,externalResourceId:T})).unwrap().then(()=>{c(Ig,{id:te})});const ye=P.target.tagName==="BUTTON"?(Z=P.target)==null?void 0:Z.firstChild:P.target;ye.className&&(ye.className=""),setTimeout(()=>ye.className="selected",1)},B=(P,te)=>{P.stopPropagation(),!(n!=null&&n[te])&&!z&&ae(),c(E?Eg:xg,{id:te}),y(ye=>!ye)},W=P=>{P.stopPropagation();const te=P.currentTarget.offsetWidth<P.currentTarget.scrollWidth;f(!!te)},V=P=>{var ye,Z;P.stopPropagation(),c(hu,{card_title:w,connector_name:H,ug_id:g,sm_ids:p});let te;k==="flat"?te=(D==null?void 0:D.flatDisplay.externalResourceId)??t.externalResourceId:k==="flat_with_list"&&(te=(Z=(ye=D==null?void 0:D.listItems)==null?void 0:ye.fields[0])==null?void 0:Z.externalResourceId),te?a(kr({...t,externalResourceId:te})):Re({message:Ss,type:at})},X=P=>{P.stopPropagation(),v(!0)},$=()=>{I(!0)},ee=()=>{I(!1)},re=[{id:"unlink",label:xu,disabled:z,shown:J,iconSrc:u7,action:P=>X(P)},{id:"refresh",label:bu,disabled:z,shown:!0,iconSrc:Gf,action:P=>ue(P,x)},{id:"edit",label:Eu,disabled:z,shown:Y,iconSrc:d7,action:P=>V(P)}];return m.jsxs(f3,{"data-testid":`test_${x}`,onMouseEnter:$,onMouseLeave:ee,children:[m.jsxs(p3,{className:E?"hiver-card-expanded":"",onClick:P=>B(P,F),children:[m.jsxs(h3,{children:[S&&m.jsx("img",{src:S,alt:w}),m.jsx(b.Tooltip,{title:d?w:"",placement:"bottom",children:m.jsx(g3,{variant:"h4",onMouseOver:P=>W(P),onMouseLeave:P=>W(P),children:w})})]}),m.jsxs(Bu,{children:[m.jsx(_7,{actions:re,isHovered:C}),m.jsx(b.Tooltip,{title:E?yu:da,placement:"bottom",children:m.jsx(vr,{onClick:P=>B(P,F),children:m.jsx(ba,{className:E?"":"hiver-up"})})})]})]}),m.jsx(Pf,{id:F,cardTitle:t.title,currentCard:t,specificCardData:n,specificConnectorApiStatus:o,isOpen:E}),m.jsx(A7,{showUnlinkModal:h,setShowUnlinkModal:v,cardId:x,onCardUnlinking:i,conversationId:u,externalResourceId:T,connectorName:H})]})},S7=Number.MAX_SAFE_INTEGER,L7=({cards:e,email:t,specificCardData:n,specificConnectorApiStatus:r,onCardUnlinking:o})=>{const{availableFeatures:s}=_.useContext(Ve),a=tt(s,dm)?S7:1;return m.jsx(b.Box,{flexGrow:1,children:e.map((l,c)=>{const{id:u,externalResourceId:p}=l;let g=u;return p&&(g=`${g}_${p}`),m.jsx("div",{children:m.jsx(T7,{card:l,specificCardData:n,email:t??"",defaultOpenState:c<a,specificConnectorApiStatus:r,onCardUnlinking:o})},g)})})},hc=({children:e})=>{if(!Array.isArray(e))return e;let t=null;return e.find(r=>typeof(r==null?void 0:r.type)!="function"?!1:(r.props.fallback&&(t=r),r.props.condition))??t};function Nr({children:e,condition:t,fallback:n=!1}){return!t&&!n?null:e}hc.CaseView=Nr;const O7="Bring your favourite tools into Hiver",D7="Plugin image",F7="Integrate tools like Salesforce, HubSpot, and Shopify to boost productivity",k7="Enable Connectors",N7="Enable Apps",R7="Learn more",M7="https://help.hiverhq.com/custom-connectors/hiver-s-custom-connectors",P7="Contact your admin to enable this",B7="https://youtu.be/ODcJnzZLb50",j7="connectors-module/assets/connectors-images/connector-mainpage.png",V7="connectors-module/assets/connectors-images/connector-mainpage-apps.png",G7="Explore connectors",H7="Connectors",W7=b.styled(b.Box)`
1040
+ Do you want to continue?`,j6="Select an object to create",V6="Select an object to link",Lf="Select object",G6="Paste URL or ID",H6="Object ID/Link",W6="Card updated",Z6="Card updation failed",Of=3,Df=(e,t)=>{var r,o,s,i,a,l,c,u,p,g,E,y,d;let n={};switch(e.type){case"select":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(((s=e.interfaceDetails)==null?void 0:s.args)||{}).length>0,isMultiSelect:e.type==="multi-select",type:e.interfaceDetails?"async-select":"select",isClearable:((i=e.meta)==null?void 0:i.isClearable)??!0};break}case"date":{n={...e,type:"date",disablePast:!!((a=e.validations)!=null&&a.disablePast)||!1,disableFuture:!!((l=e.validations)!=null&&l.disableFuture)||!1};break}case"number":{n={...e,type:"number",min:((u=(c=e.validations)==null?void 0:c.range)==null?void 0:u.min)||Number.MIN_SAFE_INTEGER,max:((g=(p=e.validations)==null?void 0:p.range)==null?void 0:g.max)||Number.MAX_SAFE_INTEGER};break}case"multiline":{n={...e,type:"text",maxRows:((E=e.validations)==null?void 0:E.maxRows)||5,limit:(y=e.validations)==null?void 0:y.maxCharacters,rows:5,multiline:!0};break}case"text":{n={...e,type:"text",limit:(d=e.validations)==null?void 0:d.maxCharacters};break}default:n={...e}}return"value"in n&&(n.defaultValue=n.value,delete n.value),{...n,...t}},Ff=Ra({name:"writeCapability",initialState:kd,reducers:{resetState:()=>kd,resetCurrentResourceDetails:e=>{e.currentResourceDetails=null,e.currentResourceDetailsApiStatus=K.IDLE},setCurrentCardInEdit:(e,t)=>{e.currentCardInEdit=t.payload},setHasUnsavedChanges:(e,t)=>{e.hasUnsavedChanges=t.payload}},extraReducers:e=>{e.addCase(si.pending,t=>{t.objectListApiStatus=K.LOADING}).addCase(si.fulfilled,(t,n)=>{const{createObjectList:r,createObjectConnectorNamesList:o,linkObjectList:s,editObjectList:i,searchObjectList:a,formFields:l,objectDict:c,dependentFieldsMap:u}=n.payload;t.objectListApiStatus=K.IDLE,t.createObjectList=r,t.createObjectConnectorNamesList=o,t.linkObjectList=s,t.editObjectList=i,t.searchObjectList=a,t.formFields=l,t.objectDict=c,t.dependentFieldsMap=u}).addCase(si.rejected,t=>{t.objectListApiStatus=K.FAILED}).addCase(Qn.pending,t=>{t.dropdownOptionsApis=K.LOADING}).addCase(Qn.fulfilled,(t,n)=>{const r=t.optionsMap||{},{optionsList:o,hasMore:s,currentPage:i,key:a}=n.payload;t.dropdownOptionsApis=K.IDLE,t.optionsMap={...r,[a]:{options:o,hasMore:s,currentPage:i}}}).addCase(Qn.rejected,t=>{t.dropdownOptionsApis=K.FAILED}).addCase(ii.pending,t=>{t.createFormApiStatus=K.LOADING}).addCase(ii.fulfilled,t=>{t.createFormApiStatus=K.IDLE}).addCase(ii.rejected,t=>{t.createFormApiStatus=K.FAILED}).addCase(li.pending,t=>{t.linkCardApiStatus=K.LOADING}).addCase(li.fulfilled,t=>{t.linkCardApiStatus=K.IDLE}).addCase(li.rejected,t=>{t.linkCardApiStatus=K.FAILED}).addCase(ci.pending,t=>{t.unlinkCardApiStatus=K.LOADING}).addCase(ci.fulfilled,t=>{t.unlinkCardApiStatus=K.IDLE}).addCase(ci.rejected,t=>{t.unlinkCardApiStatus=K.FAILED}).addCase(ai.pending,t=>{t.updateFormApiStatus=K.LOADING}).addCase(ai.fulfilled,t=>{t.updateFormApiStatus=K.IDLE}).addCase(ai.rejected,t=>{t.updateFormApiStatus=K.FAILED}).addCase(ui.pending,t=>{t.currentResourceDetailsApiStatus=K.LOADING}).addCase(ui.fulfilled,(t,n)=>{const{data:r}=n.payload;r&&(t.currentResourceDetails=r),t.currentResourceDetailsApiStatus=K.IDLE}).addCase(ui.rejected,t=>{t.currentResourceDetailsApiStatus=K.FAILED})}}),si=Vt("writeCapability/fetchObjectList",async e=>{const{inboxIds:t,channelType:n,conversationId:r,isExpandedFormEnabled:o}=e,s=await w6({inboxIds:t,channelType:n,conversationId:r});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,a={},l=[],c=[],u=[],p=[],g=[],E={},y={};return i==null||i.forEach(d=>{var h,v;if(d.expandedView&&!o)return;const f={...d};"fieldList"in f&&delete f.fieldList,y[d.id]=f,a[d.id]||(a[d.id]={}),E[d.id]||(E[d.id]=[]),d.type==="create"&&d.authenticated?(l.push({value:d.id,label:d.name,avatarUrl:d.logoUrl,connectorKey:d.connectorName}),d.connectorName&&!c.includes(d.connectorName)&&c.push(d.connectorName)):d.type==="link"&&d.authenticated?u.push({value:d.id,label:d.name,avatarUrl:d.logoUrl}):d.type==="edit"&&d.authenticated?p.push({value:d.id,label:d.name,avatarUrl:d.logoUrl}):d.type==="search_and_link"&&d.authenticated&&g.push({value:d.id,label:d.name,avatarUrl:d.logoUrl}),(h=d.fieldList)==null||h.sort((C,I)=>C.priority-I.priority),(v=d.fieldList)==null||v.forEach(C=>{const I=Df(C);if(I.columns&&(I.columns=I.columns.map(x=>Df(x,{loadOptionsOnFocus:!0,defaultOptions:!1}))),E[d.id]=[...E[d.id],I],C.interfaceDetails&&(C.interfaceDetails.args||C.interfaceDetails.optionalArgs)){const x={...C.interfaceDetails.args,...C.interfaceDetails.optionalArgs};Object.values(x).forEach(w=>{a[d.id][w]?a[d.id][w]=[...a[d.id][w],C.name]:a[d.id][w]=[C.name]})}})}),{createObjectList:l,createObjectConnectorNamesList:c,linkObjectList:u,editObjectList:p,searchObjectList:g,formFields:E,objectDict:y,dependentFieldsMap:a}}),ii=Vt("writeCapability/createForm",async(e,{rejectWithValue:t})=>{var l;const{formId:n,successCallback:r,failureCallback:o,args:s={},interfaceId:i,conversationId:a}=e;try{await Tf({formId:n},{args:s,interfaceId:i,conversationId:a}),r==null||r(),Re({message:F6,type:sn})}catch(c){const u=c,p=(l=u==null?void 0:u.response)==null?void 0:l.data,g=(p==null?void 0:p.message)??k6;return o==null||o(c),Re({message:g,type:at}),t(c)}}),ai=Vt("writeCapability/updateForm",async(e,{rejectWithValue:t})=>{const{formId:n,successCallback:r,failureCallback:o,args:s={},interfaceId:i,conversationId:a,externalResourceId:l,previousArgs:c={}}=e;try{await Tf({formId:n},{args:s,interfaceId:i,conversationId:a,externalResourceId:l,previousArgs:c}),r==null||r(),Re({message:W6,type:sn})}catch(u){return o==null||o(u),Re({message:Z6,type:at}),t(u)}}),ci=Vt("writeCapability/unlinkCard",async({id:e,channelType:t,externalResourceId:n,conversationId:r})=>{await A6(e,t,n,r)}),li=Vt("writeCapability/linkCard",async({id:e,externalResourceId:t,channelType:n,conversationId:r},{rejectWithValue:o})=>{var s;try{await _6(e,t,n,r)}catch(i){return o({status:(s=i.response)==null?void 0:s.status})}}),ui=Vt("connectorCardLibrary/fetchCurrentResourceDetails",async(e,{rejectWithValue:t})=>{const{id:n,channelType:r,conversationId:o,externalResourceId:s,contactEmail:i}=e;try{const a=await T6(n,r,o,s,i),l=a==null?void 0:a.data,c=a==null?void 0:a.status,u={values:{},errors:{}};return Object.entries(l.formData).forEach(([p,g])=>{"label"in g&&(g.type&&g.type==="date"?u.values[p]=g.label?new Date(parseInt(g.label)).toISOString():"":g.type&&g.type==="multi-select"&&"value"in g&&"label"in g&&g.value&&g.label?u.values[p]=[{value:g.value,label:g.label}]:g.value?u.values[p]={value:g.value,label:g.label}:u.values[p]=g.label)}),{data:u,status:c}}catch(a){return Re({message:Ss,type:at}),t(a)}}),{resetState:dI,setCurrentCardInEdit:kr,resetCurrentResourceDetails:X6,setHasUnsavedChanges:kf}=Ff.actions,z6=Ff.reducer,Y6=()=>{const[e,t]=_.useState(null),[n,r]=_.useState({isVertical:!1,isHorizontal:!1,isScrolling:!1}),o=_.useCallback(s=>{t(s)},[]);return _.useEffect(()=>{if(!e)return;e.dataset.prevScrollLeft="0",e.dataset.prevScrollTop="0";let s=null;const i=100;let a=null;const l=150,c=u=>{s||(s=window.setTimeout(()=>{const p=u.target,g=Number(e.dataset.prevScrollLeft)||0,E=Number(e.dataset.prevScrollTop)||0,y=p.scrollLeft,d=p.scrollTop,f=y-g,h=d-E,v=Math.abs(h)>Math.abs(f),C=Math.abs(f)>Math.abs(h);r({isVertical:v,isHorizontal:C,isScrolling:!0}),e.dataset.prevScrollLeft=String(y),e.dataset.prevScrollTop=String(d),s=null},i),a&&window.clearTimeout(a),a=window.setTimeout(()=>{r(p=>({...p,isScrolling:!1})),a=null},l))};return e.addEventListener("scroll",c),()=>{e.removeEventListener("scroll",c),s&&window.clearTimeout(s),a&&window.clearTimeout(a)}},[e]),[n,o]},J6="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='M5.8016%2011.709L12.3416%205.16893L11.4298%204.25712L4.88979%2010.7972V11.709H5.8016ZM6.33618%2012.9987H3.6001V10.2626L10.9739%202.88875C11.0948%202.76786%2011.2588%202.69995%2011.4298%202.69995C11.6008%202.69995%2011.7648%202.76786%2011.8857%202.88875L13.71%204.71302C13.8309%204.83395%2013.8988%204.99794%2013.8988%205.16893C13.8988%205.33992%2013.8309%205.50391%2013.71%205.62484L6.33618%2012.9987ZM3.6001%2014.2884H15.2073V15.578H3.6001V14.2884Z'%20fill='%236C7B94'/%3e%3c/svg%3e",Q6=({data:e,title:t,currentCard:n,setShowModal:r})=>{const o=jt(),{sendTrackingEvent:s,currentSmIds:i}=_.useContext(Ve),{userGroupId:a}=Yt()||{},[l,c]=Y6(),{isScrolling:u,isVertical:p}=l,g=u&&p,E=_.useMemo(()=>(e==null?void 0:e[0].data.map(h=>h.label))||[],[e]),y=_.useMemo(()=>e.map(h=>{const v={cells:{},externalResourceId:h.externalResourceId};return h.data.forEach((C,I)=>{if(E[I]){let x=C.value?C.value:gs;x&&C.type==="date"&&(x=new Date(parseInt(x)).toLocaleDateString(navigator.language)),v.cells[E[I]]={label:x,deepLink:C==null?void 0:C.deepLink}}}),v}),[e,E]),d=(h,v)=>m.jsx(A3,{align:"left",children:h.deepLink?m.jsx(b.Link,{target:"_blank",underline:"none",href:h.deepLink,children:h.label}):m.jsx(b.Typography,{variant:"body2",color:"gray.black",children:h.label})},`${v}_${h.label}`),f=h=>{!h||!n||(r(!1),s(hu,{card_title:n.title,connector_name:n.connectorName,ug_id:a,sm_ids:i}),o(kr({...n,externalResourceId:h})))};return m.jsxs(b.Stack,{maxHeight:"340px",maxWidth:"700px",padding:"32px 0px 32px 32px",overflow:"auto",children:[m.jsx(b.Typography,{variant:"h2",color:"gray.black",marginBottom:"16px",children:t}),m.jsx(b.TableContainer,{ref:c,children:m.jsxs(b.Table,{stickyHeader:!0,children:[m.jsx(E3,{children:m.jsxs(b.TableRow,{children:[E.map(h=>m.jsx(I3,{sx:{whiteSpace:"nowrap"},children:m.jsx(b.Typography,{variant:"overline",color:"gray.gray3",children:h})},h)),m.jsx(T3,{})]})}),m.jsx(b.TableBody,{children:y.map((h,v)=>m.jsxs(w3,{children:[Object.values(h.cells).map((C,I)=>d(C,I)),m.jsx(_3,{children:!g&&h.externalResourceId&&m.jsx(b.Tooltip,{title:Eu,placement:"bottom",children:m.jsx(b.IconButton,{className:"row-edit",onClick:()=>f(h.externalResourceId),children:m.jsx("img",{src:J6})})})})]},`id_${v}`))})]})})]})},q6=e=>e.cardList.connectorCards,$6=e=>e.cardList.connectorsEnabled,U6=e=>e.cardList.connectorApiStatus,K6=e=>e.cardList.cardSpecificData,e7=e=>e.cardList.specificConnectorApiStatus,t7=e=>e.cardList.specificConnectorErrorCode,n7="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",Nf=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}},r7=(e,t)=>`${Au} (Error code: ${e})`.replace(/{{connector_name}}/g,(t==null?void 0:t[0])||""),Rf=e=>{const{value:t,error:n,deepLink:r,statusCode:o,isLoading:s,type:i,redirectToAdminTab:a,isFailed:l,connectorNames:c,cardTitle:u,currentCard:p,cardId:g,isCardLevelError:E,fieldName:y,showErrorIcon:d}=e,f=_.useRef(null),h=_.useRef(null),{email:v,currentSmIds:C,conversationId:I,sendTrackingEvent:x,connectorFunctions:w}=_.useContext(Ve),T=be(t7),A=T==null?void 0:T[g],[S,F]=_.useState(!1),D=_.useMemo(()=>{if(n&&E){const{error_message:Y}=Nf(n);return Y}return l?Au.replace(/{{connector_name}}/g,(c==null?void 0:c[0])||""):mu},[n,l,c,E]),k=_.useCallback(()=>{const Y=n||r7(A,c),{error_code:ae,error_message:ue}=Nf(Y);x==null||x(zg,{sm_ids:C,frontend_req_params:{email:v,conversationId:I,externalResourceId:p==null?void 0:p.externalResourceId},card_title:u,connector_name:c!=null&&c.length?c:"",error_code:ae,error_message:ue})},[n,A,x,C,v,I,u,c,p==null?void 0:p.externalResourceId]);_.useEffect(()=>{(n&&E||l&&A)&&k()},[k,A,l,n,E]),_.useEffect(()=>{const Y=r?h.current:f.current;if(Y){const ae=Y.scrollHeight>Y.clientHeight||Y.scrollWidth>Y.clientWidth;F(ae)}},[t,r]);const M=o==ua.NOT_FOUND;let j=M?gs:t;i==="date"&&j&&!M&&(j=new Date(parseInt(j)).toLocaleDateString(navigator.language));const H=!!n||l,z=()=>{a?w==null||w.redirectToAdmin():window.open(Sm,"_blank")},U=()=>{x==null||x(Yg,{sm_ids:C,card_title:u,field_name:y})},J=Y=>{const ae=/<>(.*?)<>/g,ue=Y.split(ae);return m.jsx(_.Fragment,{children:ue.map((B,W)=>W%2===1?m.jsx(y3,{variant:"body2",onClick:z,children:B},W):B)})};return s?m.jsx(vn,{variant:"rounded",width:"100%",height:16,animation:"wave",margin:"4px 0 0 0"}):H?m.jsxs(Bu,{gap:"7px",children:[d?m.jsx(b.Stack,{marginTop:"3px",flexShrink:"0",children:m.jsx("img",{src:n7,width:"18px",height:"18px"})}):null,m.jsx(ju,{variant:"body2",children:D?J(D):mu})]}):m.jsx(b.Tooltip,{title:S?j:null,placement:"bottom",children:r?m.jsx(Vu,{ref:h,target:"_blank",underline:"none",href:r,fontSize:"13px",onClick:U,children:j||gs}):m.jsx(v3,{ref:f,variant:"body2",children:j||gs})})},Mf="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_825_73646)'%3e%3cpath%20d='M19%206.41L17.59%205L12%2010.59L6.41%205L5%206.41L10.59%2012L5%2017.59L6.41%2019L12%2013.41L17.59%2019L19%2017.59L13.41%2012L19%206.41Z'%20fill='%236F7C90'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_825_73646'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",So=({shown:e,setShown:t,children:n,showCloseButton:r=!1,borderRadius:o=4,sx:s})=>m.jsx(b.Dialog,{open:e,onClose:()=>t(!1),PaperProps:{style:{borderRadius:o,padding:0,height:"fit-content",width:"fit-content",maxWidth:"none"}},sx:{...s},children:m.jsxs(b.Stack,{direction:"row",children:[r&&m.jsx(b.Box,{position:"absolute",right:10,top:10,children:m.jsx(b.Tooltip,{title:"Close",placement:"bottom",children:m.jsx(b.IconButton,{onClick:()=>t(!1),children:m.jsx("img",{src:Mf})})})}),n]})}),Pf=e=>{var B,W,V;const{id:t,cardTitle:n,specificCardData:r,specificConnectorApiStatus:o,isOpen:s,currentCard:i}=e,a=24,l=(o==null?void 0:o[t])===K.IDLE,c=(o==null?void 0:o[t])===K.LOADING,u=(o==null?void 0:o[t])===K.FAILED,{cardType:p,data:g,cardErrorMessage:E,redirectToAdminTab:y,connectorNames:d}=(r==null?void 0:r[t])||{},f=p==="flat",[h,v]=_.useState(!1),[C,I]=_.useState(!1),[x,w]=_.useState(!1),[T,A]=_.useState(!1),S=((B=g==null?void 0:g.listItems)==null?void 0:B.statusCode)!==401,F=_.useMemo(()=>{var X,$,ee,re;return f&&((X=g==null?void 0:g.flatDisplay)!=null&&X.data)?g.flatDisplay.data:!f&&((re=(ee=($=g==null?void 0:g.listItems)==null?void 0:$.fields)==null?void 0:ee[0])!=null&&re.data)?g.listItems.fields[0].data:[]},[f,g]),D=_.useMemo(()=>F==null?void 0:F.slice(0,5),[F]),[k,M]=_.useState([]),j=_.useRef(null),[H,z]=_.useState(0),U=h?-180:0,J=f?!1:!!((W=g==null?void 0:g.listItems)!=null&&W.errorMessage),Y=J||u||E,ae=l&&!J&&s&&(x||C);_.useLayoutEffect(()=>{var X;(X=j.current)!=null&&X.scrollHeight&&z(j.current.scrollHeight+a)},[o==null?void 0:o[t],k,j]),_.useEffect(()=>{var re,P;const X=((F==null?void 0:F.length)||0)>5,$=!f&&(((P=(re=g==null?void 0:g.listItems)==null?void 0:re.fields)==null?void 0:P.length)||0)>1;w(X&&!$),I($)},[g,f,F==null?void 0:F.length]),_.useEffect(()=>{M(h?F:D)},[g,h,D,F]);const ue=()=>{x?v(X=>!X):A(X=>!X)};return m.jsxs(m.Fragment,{children:[m.jsx(So,{shown:T,setShown:A,showCloseButton:!0,borderRadius:12,children:m.jsx(Q6,{data:((V=g==null?void 0:g.listItems)==null?void 0:V.fields)||[],title:n,currentCard:i,setShowModal:A})}),m.jsx(m3,{className:s?"":"slideUp",height:H,children:m.jsx(b.Stack,{ref:j,gap:1,margin:"12px",children:c&&!(k!=null&&k.length)?m.jsxs(m.Fragment,{children:[m.jsx(vn,{variant:"rounded",width:"100%",height:20,animation:"wave"}),m.jsx(vn,{variant:"rounded",width:"100%",height:20,animation:"wave"})]}):m.jsx(m.Fragment,{children:Y?m.jsx(b.Box,{margin:"8px 0",children:m.jsx(Rf,{error:E,isLoading:c,redirectToAdminTab:y,isFailed:u,showErrorIcon:!S,connectorNames:d,cardId:t,cardTitle:n,currentCard:i,isCardLevelError:!0})}):k!=null&&k.length?k==null?void 0:k.map(X=>{const{value:$,label:ee,deepLink:re,type:P}=X,te="errorMessage"in X?X.errorMessage:null,ye="statusCode"in X?X.statusCode:null;return m.jsxs("div",{children:[m.jsx(b3,{variant:"overline",children:ee}),m.jsx(Rf,{value:$,error:te,deepLink:re,statusCode:ye,isLoading:c,type:P,cardTitle:n,currentCard:i,cardId:t,fieldName:ee})]},ee)}):m.jsx(b.Box,{margin:"8px 0",children:m.jsx(ju,{children:bm})})})})}),!E&&ae&&m.jsx(L3,{variant:"body2_medium",onClick:ue,children:x?m.jsxs(m.Fragment,{children:[h?ub:qu,m.jsx(S3,{src:lb,transformAngle:U})]}):qu})]})},o7={connectorCards:null,cardSpecificData:null,connectorApiStatus:K.IDLE,conversationMetaDataApiStatus:K.IDLE,specificConnectorApiStatus:null,threadId:null,connectorsEnabled:!1,specificConnectorErrorCode:null,conversationEmailHeaders:null},Bf="/v1/api",s7=`${Bf}/connectors/cards`,i7=`${Bf}/connectors/cards/:id/data`,a7=({inboxIds:e,conversationId:t,channelType:n="email"})=>{const r=new URLSearchParams;return e.forEach(o=>r.append("inbox_ids",o)),r.append("channel_type",n),r.append("conversation_id",String(t||"")),ze({url:`${s7}?${r.toString()}`,method:nt.GET})},c7=(e,t,n,r)=>{const o=new URLSearchParams;return o.append("senderEmail",t),o.append("conversation_id",String(n||"")),r&&o.append("externalResourceId",r),ze({url:`${i7.replace(":id",e)}?${o.toString()}`,method:nt.GET})},jf=Ra({name:"connectorCardLibrary",initialState:o7,reducers:{updateThreadId(e,t){const{payload:n}=t;e.threadId=n.threadId,e.connectorCards=null},clearConnectorList(e){e.connectorCards=null,e.cardSpecificData=null}},extraReducers:e=>{e.addCase(di.pending,t=>{t.connectorApiStatus=K.LOADING}).addCase(di.fulfilled,(t,n)=>{t.connectorApiStatus=K.IDLE,t.connectorCards=n.payload.cards,t.connectorsEnabled=n.payload.connectorsEnabled}).addCase(di.rejected,t=>{t.connectorApiStatus=K.FAILED}).addCase(Lo.pending,(t,n)=>{const{id:r,externalResourceId:o=""}=n.meta.arg;let s=r;o&&(s=`${s}_${o}`),t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[s]:K.LOADING}}).addCase(Lo.fulfilled,(t,n)=>{const{id:r,externalResourceId:o=""}=n.meta.arg;let s=r;o&&(s=`${s}_${o}`);const{data:i}=n.payload||{};i&&(t.cardSpecificData={...t.cardSpecificData?t.cardSpecificData:{},[s]:i}),t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[s]:K.IDLE}}).addCase(Lo.rejected,(t,n)=>{const{id:r,externalResourceId:o=""}=n.meta.arg;let s=r;o&&(s=`${s}_${o}`),t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[s]:K.FAILED};const i=n.payload&&typeof n.payload=="object"&&"code"in n.payload?String(n.payload.code):_u;t.specificConnectorErrorCode={...t.specificConnectorErrorCode??{},[s]:i}})}}),di=Vt("connectorCardLibrary/fetchAllCard",async({inboxIds:e,channelType:t,conversationId:n})=>{var a;const r=await a7({inboxIds:e,channelType:t,conversationId:n});if(!Array.isArray((a=r==null?void 0:r.data)==null?void 0:a.cards))return{cards:[],connectorsEnabled:!1};const{cards:o,connectorsEnabled:s=!1}=r.data;return{cards:o.sort((l,c)=>(l==null?void 0:l.priority)-(c==null?void 0:c.priority)),connectorsEnabled:s}}),Lo=Vt("connectorCardLibrary/fetchSpecificCard",async({id:e,email:t,conversationId:n,isRefresh:r,externalResourceId:o},s)=>{try{const i=await c7(e,t,n,o),a=i==null?void 0:i.data,l=i==null?void 0:i.status;return a?(r&&Re({message:Fd,type:sn}),{data:Ou(a),status:l}):(r&&Re({message:Dd,type:at}),{data:{},status:l})}catch(i){const a=i;return s.rejectWithValue({...a,code:a.code||_u})}}),l7=jf.reducer,Vf=jf.actions,Gf="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.76618%202.23341C8.79952%201.26675%207.47285%200.666748%205.99952%200.666748C3.05285%200.666748%200.672852%203.05341%200.672852%206.00008C0.672852%208.94675%203.05285%2011.3334%205.99952%2011.3334C8.48619%2011.3334%2010.5595%209.63341%2011.1529%207.33341H9.76618C9.21952%208.88675%207.73952%2010.0001%205.99952%2010.0001C3.79285%2010.0001%201.99952%208.20675%201.99952%206.00008C1.99952%203.79341%203.79285%202.00008%205.99952%202.00008C7.10618%202.00008%208.09285%202.46008%208.81285%203.18675L6.66618%205.33341H11.3329V0.666748L9.76618%202.23341Z'%20fill='%236C7B94'/%3e%3c/svg%3e",u7="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%20d='M11.4587%206.7528C11.2244%206.51848%2010.8445%206.51848%2010.6102%206.7528C10.3759%206.98711%2010.3759%207.36701%2010.6102%207.60132L11.4587%206.7528ZM12.1916%208.33414L12.6158%207.90988L12.1916%208.33414ZM8.33462%2012.1911L8.75888%2011.7668L8.33462%2012.1911ZM7.6018%2010.6097C7.36748%2010.3754%206.98758%2010.3754%206.75327%2010.6097C6.51895%2010.8441%206.51895%2011.224%206.75327%2011.4583L7.6018%2010.6097ZM4.43911%209.14411C4.67343%209.37842%205.05333%209.37842%205.28764%209.14411C5.52196%208.9098%205.52196%208.5299%205.28764%208.29558L4.43911%209.14411ZM3.70629%207.56276L4.13056%207.1385L3.70629%207.56276ZM7.56324%203.70582L7.9875%203.28155L7.56324%203.70582ZM8.29606%205.28716C8.53037%205.52148%208.91027%205.52148%209.14459%205.28716C9.3789%205.05285%209.3789%204.67295%209.14459%204.43864L8.29606%205.28716ZM10.6102%207.60132L11.7673%208.75841L12.6158%207.90988L11.4587%206.7528L10.6102%207.60132ZM11.7673%208.75841C12.1662%209.15735%2012.3904%209.69843%2012.3904%2010.2626L13.5904%2010.2626C13.5904%209.38017%2013.2398%208.53387%2012.6158%207.90988L11.7673%208.75841ZM12.3904%2010.2626C12.3904%2010.8268%2012.1662%2011.3679%2011.7673%2011.7668L12.6158%2012.6154C13.2398%2011.9914%2013.5904%2011.1451%2013.5904%2010.2626L12.3904%2010.2626ZM11.7673%2011.7668C10.9365%2012.5976%209.58963%2012.5976%208.75888%2011.7668L7.91035%2012.6154C9.20973%2013.9147%2011.3164%2013.9147%2012.6158%2012.6154L11.7673%2011.7668ZM8.75888%2011.7668L7.6018%2010.6097L6.75327%2011.4583L7.91035%2012.6154L8.75888%2011.7668ZM5.28764%208.29558L4.13056%207.1385L3.28203%207.98703L4.43911%209.14411L5.28764%208.29558ZM4.13056%207.1385C3.73162%206.73956%203.50749%206.19848%203.50749%205.63429L2.30749%205.63429C2.30749%206.51674%202.65804%207.36304%203.28203%207.98703L4.13056%207.1385ZM3.50749%205.63429C3.50749%205.0701%203.73162%204.52902%204.13056%204.13008L3.28203%203.28155C2.65804%203.90554%202.30749%204.75184%202.30749%205.63429L3.50749%205.63429ZM4.13056%204.13008C4.96131%203.29933%206.30822%203.29933%207.13897%204.13008L7.9875%203.28155C6.68812%201.98217%204.58141%201.98217%203.28203%203.28155L4.13056%204.13008ZM7.13897%204.13008L8.29606%205.28716L9.14459%204.43864L7.9875%203.28155L7.13897%204.13008Z'%20fill='%236C7B94'/%3e%3crect%20x='5.08887'%20y='6.0791'%20width='1.33333'%20height='6.66667'%20rx='0.666667'%20transform='rotate(-45%205.08887%206.0791)'%20fill='%236C7B94'/%3e%3cpath%20d='M5.59961%2014.3998V12.7998'%20stroke='%236C7B94'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.7998%205.59961H14.3998'%20stroke='%236C7B94'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.40039%2011.2002H4.00039'%20stroke='%236C7B94'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.2002%202.40039V4.00039'%20stroke='%236C7B94'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",d7="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_5908_39767)'%3e%3cpath%20d='M9.37333%206.01333L9.98667%206.62667L3.94667%2012.6667H3.33333V12.0533L9.37333%206.01333ZM11.7733%202C11.6067%202%2011.4333%202.06667%2011.3067%202.19333L10.0867%203.41333L12.5867%205.91333L13.8067%204.69333C14.0667%204.43333%2014.0667%204.01333%2013.8067%203.75333L12.2467%202.19333C12.1133%202.06%2011.9467%202%2011.7733%202ZM9.37333%204.12667L2%2011.5V14H4.5L11.8733%206.62667L9.37333%204.12667Z'%20fill='%236C7B94'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_5908_39767'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Hf=e=>e.write.createObjectList,f7=e=>e.write.createObjectConnectorNamesList,Wf=e=>e.write.linkObjectList,p7=e=>e.write.editObjectList,h7=e=>e.write.objectDict,g7=e=>e.write.formFields,m7=e=>e.write.linkCardApiStatus,b7=e=>e.write.unlinkCardApiStatus,y7=e=>e.write.dependentFieldsMap,C7=e=>e.write.createFormApiStatus,v7=e=>e.write.updateFormApiStatus,x7=e=>e.write.currentResourceDetails,E7=e=>e.write.currentResourceDetailsApiStatus,Zf=e=>e.write.currentCardInEdit,Xf=e=>e.write.hasUnsavedChanges,I7=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,zf=e=>Object.keys(e).sort((n,r)=>r.localeCompare(n)).reduce((n,r)=>{var o;return(typeof e[r]=="string"||typeof e[r]=="object"&&e[r]!==null)&&I7(e[r])?n[r]=(o=new Date(`${e[r]}`))==null?void 0:o.toString():n[r]=e[r],n},{}),w7=e=>Im.replace("{{connectorName}}",e),A7=({showUnlinkModal:e,setShowUnlinkModal:t,cardId:n,onCardUnlinking:r,externalResourceId:o,conversationId:s,connectorName:i})=>{const a=jt(),{sendTrackingEvent:l}=_.useContext(Ve),u=be(b7)===K.LOADING,p=()=>{s&&o&&a(ci({id:n,conversationId:s,externalResourceId:o})).unwrap().then(()=>{l(kg,{connector_name:i,conversation_id:s}),t(!1),r(),Re({message:Dy,type:sn})}).catch(()=>{Re({message:Fy,type:sn})})};return m.jsx(So,{shown:e,setShown:t,showCloseButton:!0,children:m.jsxs(b.Stack,{width:"400px",padding:"20px",gap:"8px",children:[m.jsx(b.Typography,{variant:"h2",children:Em}),m.jsx(b.Typography,{variant:"body2",children:w7(i)}),m.jsxs(b.Stack,{direction:"row",gap:"8px",marginTop:"20px",justifyContent:"flex-end",children:[m.jsx(b.Button,{variant:"text",onClick:()=>t(!1),children:pa}),m.jsx(b.Button,{disabled:u,color:"error",onClick:p,children:xu})]})]})})},_7=({actions:e,isHovered:t=!1})=>{const r=e.filter(a=>a.shown);if(r.length===0)return null;const o=r[r.length-1],s=r.slice(0,-1),i=t?(s.length+1)*32:32;return m.jsxs(x3,{width:i,isHovered:t,children:[m.jsx("div",{className:"hidden-actions",children:s.map(({id:a,disabled:l,label:c,iconSrc:u,action:p})=>m.jsx(b.Tooltip,{title:c,placement:"bottom",children:m.jsx(vr,{onClick:p,disabled:l,children:m.jsx("img",{src:u})})},a))}),o&&m.jsx(b.Tooltip,{title:o.label,placement:"bottom",children:m.jsx(vr,{onClick:o.action,disabled:o.disabled,children:m.jsx("img",{src:o.iconSrc})})},o.id)]})},T7=e=>{const{card:t,specificCardData:n,email:r,specificConnectorApiStatus:o,defaultOpenState:s=!1,onCardUnlinking:i}=e,a=jt(),{availableFeatures:l,sendTrackingEvent:c,conversationId:u,currentSmIds:p}=_.useContext(Ve),{userGroupId:g}=Yt()||{},[E,y]=_.useState(!!s),[d,f]=_.useState(!1),[h,v]=_.useState(!1),[C,I]=_.useState(!1),{id:x,title:w,externalResourceId:T="",forms:A=[],logoUrl:S}=t;let F=x;T&&(F=`${F}_${T}`);const{data:D,cardType:k,cardErrorMessage:M,connectorNames:j}=(n==null?void 0:n[F])??{},H=(j==null?void 0:j[0])||"",z=(o==null?void 0:o[F])===K.LOADING,U=(o==null?void 0:o[F])===K.FAILED,J=!!(tt(l,gu)&&T),Y=_.useMemo(()=>{var P,te;if(M||U||!(tt(l,lm)&&A.some(ye=>ye.type==="edit")))return!1;switch(k){case"flat":return!!((D==null?void 0:D.flatDisplay.externalResourceId)??t.externalResourceId);case"flat_with_list":return((P=D==null?void 0:D.listItems)==null?void 0:P.fields.length)===1?(te=D==null?void 0:D.listItems)==null?void 0:te.fields.some(ye=>ye.externalResourceId):!1;default:return!1}},[D,k,l,A,t,M,U]),ae=_.useCallback((P=!1)=>{const te=P?Bg:Pg;r&&x&&u&&a(Lo({id:x,email:r,conversationId:u,externalResourceId:T})).unwrap().then(ye=>{const Z={...Lu(ye,w,P,!0),sm_ids:p};c(te,Z)}).catch(ye=>{const Z={...Lu(ye,w,P,!1),sm_ids:p};c(te,Z)})},[a,r,x,w,c,u,T,p]);_.useEffect(()=>{E&&ae(!0)},[E,ae]);const ue=(P,te)=>{var Z;P==null||P.stopPropagation(),a(Lo({id:te,email:r,conversationId:u,isRefresh:!0,externalResourceId:T})).unwrap().then(()=>{c(Ig,{id:te})});const ye=P.target.tagName==="BUTTON"?(Z=P.target)==null?void 0:Z.firstChild:P.target;ye.className&&(ye.className=""),setTimeout(()=>ye.className="selected",1)},B=(P,te)=>{P.stopPropagation(),!(n!=null&&n[te])&&!z&&ae(),c(E?Eg:xg,{id:te}),y(ye=>!ye)},W=P=>{P.stopPropagation();const te=P.currentTarget.offsetWidth<P.currentTarget.scrollWidth;f(!!te)},V=P=>{var ye,Z;P.stopPropagation(),c(hu,{card_title:w,connector_name:H,ug_id:g,sm_ids:p});let te;k==="flat"?te=(D==null?void 0:D.flatDisplay.externalResourceId)??t.externalResourceId:k==="flat_with_list"&&(te=(Z=(ye=D==null?void 0:D.listItems)==null?void 0:ye.fields[0])==null?void 0:Z.externalResourceId),te?a(kr({...t,externalResourceId:te})):Re({message:Ss,type:at})},X=P=>{P.stopPropagation(),v(!0)},$=()=>{I(!0)},ee=()=>{I(!1)},re=[{id:"unlink",label:xu,disabled:z,shown:J,iconSrc:u7,action:P=>X(P)},{id:"refresh",label:bu,disabled:z,shown:!0,iconSrc:Gf,action:P=>ue(P,x)},{id:"edit",label:Eu,disabled:z,shown:Y,iconSrc:d7,action:P=>V(P)}];return m.jsxs(f3,{"data-testid":`test_${x}`,onMouseEnter:$,onMouseLeave:ee,children:[m.jsxs(p3,{className:E?"hiver-card-expanded":"",onClick:P=>B(P,F),children:[m.jsxs(h3,{children:[S&&m.jsx("img",{src:S,alt:w}),m.jsx(b.Tooltip,{title:d?w:"",placement:"bottom",children:m.jsx(g3,{variant:"h4",onMouseOver:P=>W(P),onMouseLeave:P=>W(P),children:w})})]}),m.jsxs(Bu,{children:[m.jsx(_7,{actions:re,isHovered:C}),m.jsx(b.Tooltip,{title:E?yu:da,placement:"bottom",children:m.jsx(vr,{onClick:P=>B(P,F),children:m.jsx(ba,{className:E?"":"hiver-up"})})})]})]}),m.jsx(Pf,{id:F,cardTitle:t.title,currentCard:t,specificCardData:n,specificConnectorApiStatus:o,isOpen:E}),m.jsx(A7,{showUnlinkModal:h,setShowUnlinkModal:v,cardId:x,onCardUnlinking:i,conversationId:u,externalResourceId:T,connectorName:H})]})},S7=Number.MAX_SAFE_INTEGER,L7=({cards:e,email:t,specificCardData:n,specificConnectorApiStatus:r,onCardUnlinking:o})=>{const{availableFeatures:s}=_.useContext(Ve),a=tt(s,dm)?S7:1;return m.jsx(b.Box,{flexGrow:1,children:e.map((l,c)=>{const{id:u,externalResourceId:p}=l;let g=u;return p&&(g=`${g}_${p}`),m.jsx("div",{children:m.jsx(T7,{card:l,specificCardData:n,email:t??"",defaultOpenState:c<a,specificConnectorApiStatus:r,onCardUnlinking:o})},g)})})},hc=({children:e})=>{if(!Array.isArray(e))return e;let t=null;return e.find(r=>typeof(r==null?void 0:r.type)!="function"?!1:(r.props.fallback&&(t=r),r.props.condition))??t};function Nr({children:e,condition:t,fallback:n=!1}){return!t&&!n?null:e}hc.CaseView=Nr;const O7="Bring your favourite tools into Hiver",D7="Plugin image",F7="Integrate tools like Salesforce, HubSpot, and Shopify to boost productivity",k7="Enable Connectors",N7="Enable Apps",R7="Learn more",M7="https://help.hiverhq.com/custom-connectors/hiver-s-custom-connectors",P7="Contact your admin to enable this",B7="https://youtu.be/ODcJnzZLb50",j7="connectors-module/assets/connectors-images/connector-mainpage.png",V7="connectors-module/assets/connectors-images/connector-mainpage-apps.png",G7="Explore connectors",H7="Connectors",W7=b.styled(b.Box)`
1041
1041
  padding-top: 20px;
1042
1042
  `,Z7=b.styled(b.Stack)`
1043
1043
  width: 100%;
@@ -1089,7 +1089,7 @@ Do you want to continue?`,j6="Select an object to create",V6="Select an object t
1089
1089
  color: ${b.theme.palette.gray.gray3};
1090
1090
  `,q7=b.styled(b.Typography)`
1091
1091
  color: ${b.theme.palette.gray.gray3};
1092
- `,$7="https://cdn.hiverhq.com/connectors-module/assets/PlugIn.svg",U7={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_HIVER_CDN_URL:"https://cdn.hiverhq.com/",VITE_MY_ENV_VAR:"myVariable From Agent"},{VITE_HIVER_CDN_URL:K7}=U7,Jf=({isAdmin:e=!0,hideHeading:t=!1})=>{const{sendTrackingEvent:n,availableFeatures:r,connectorFunctions:o}=_.useContext(Ve),s=tt(r,am),i=tt(r,hs),a=p=>{p.stopPropagation(),n(Cg),o==null||o.redirectToAdmin()},l=p=>{p.stopPropagation(),n(vg),window.open(M7,"_blank")},c=()=>{n(Xg,{source:"main_tab"})},u=i?V7:j7;return m.jsxs(W7,{"data-testid":"noConnectors",children:[s?m.jsxs(m.Fragment,{children:[t?null:m.jsx(b.Typography,{variant:"h2",children:i?fa:H7}),m.jsx(z7,{onClick:c,href:B7,target:"_blank",children:m.jsx(o6,{src:K7+u,alt:G7,aspectRatio:"1000/783"})})]}):m.jsxs(Z7,{children:[m.jsx(X7,{variant:"body1_medium",children:O7}),m.jsx("img",{src:$7,alt:D7})]}),m.jsx(Y7,{variant:"body2",children:F7}),e?m.jsx(Yf,{endIcon:m.jsx(b.icons.ArrowForward,{}),onClick:a,...s&&{size:"medium"},children:i?N7:k7}):m.jsxs(m.Fragment,{children:[m.jsx(Yf,{onClick:l,children:R7}),m.jsxs(J7,{direction:"row",children:[m.jsx(Q7,{}),m.jsx(q7,{variant:"caption",children:P7})]})]})]})},ex=()=>{const{availableFeatures:e}=_.useContext(Ve),t=tt(e,hs);return m.jsxs(Pu,{children:[m.jsxs(b.Stack,{direction:"row",boxSizing:"content-box",paddingTop:"20px",paddingBottom:"12px",height:"36px",gap:"8px",alignItems:"center",children:[t?m.jsx(ku,{width:"20px",height:"20px"}):m.jsx(Ru,{}),m.jsx(Mu,{variant:"h2",children:t?fa:Cu})]}),m.jsxs(b.Stack,{gap:"12px",children:[m.jsx(Cn,{variant:"rounded",width:"100%",height:"46px",animation:"wave"}),m.jsx(Cn,{variant:"rounded",width:"100%",height:"46px",animation:"wave"}),m.jsx(Cn,{variant:"rounded",width:"100%",height:"46px",animation:"wave"})]})]})},tx=()=>{const{metaData:e,sendTrackingEvent:t,isAdmin:n,connectorFunctions:r}=_.useContext(Ve),[o,s]=_.useState(!1),i=_.useRef(null),[a,l]=_.useState(0),{templateUpdates:c}=e||{},{sections:u=[],actionButtons:p=[],title:g}=c||{},{version:E=""}=c||{},y=Dm(E),d=_.useMemo(()=>Om(E),[E]),f=_.useMemo(()=>(p==null?void 0:p.filter(({isAdminPanelLink:I})=>!(!n&&I)))??[],[p,n]);if(_.useEffect(()=>{!d&&c&&ga(E,!0)},[d,E,c]),_.useLayoutEffect(()=>{var I;(I=i.current)!=null&&I.scrollHeight&&l(i.current.scrollHeight)},[i]),_.useEffect(()=>{c&&!y&&t(Ag,{update_version_id:E})},[]),!c||y)return null;const h=I=>{var x;I.stopPropagation(),s(w=>!w),(x=i.current)!=null&&x.scrollHeight&&l(i.current.scrollHeight),ga(E,!1,!0)},v=(I,x="",w=!1,T=!1)=>{var A;if(I.stopPropagation(),w&&T?t(_g,{update_version_id:E}):T&&t(Tg,{update_version_id:E}),!w&&x){(A=window.open(x,"_blank"))==null||A.focus();return}C(I,!1),r==null||r.redirectToAdmin()},C=(I,x=!0)=>{I.stopPropagation(),ga(E,!1),s(!1),x&&t(Sg,{update_version_id:E})};return m.jsxs(D3,{children:[m.jsxs(F3,{children:[m.jsx(O3,{variant:"h3",children:g}),m.jsxs(b.Box,{children:[o?m.jsx(b.Tooltip,{title:Cm,placement:"bottom",children:m.jsx(b.IconButton,{onClick:C,children:m.jsx(b.icons.Close,{sx:{height:"16px",width:"16px",opacity:"0.8"}})})}):null,m.jsx(b.Tooltip,{title:o?ym:da,placement:"bottom",children:m.jsx(vr,{onClick:h,children:m.jsx(ba,{className:o?"":"hiver-up"})})})]})]}),m.jsx(k3,{className:o?"slideDown":"slideUp",ref:i,height:a,children:m.jsxs(N3,{children:[u.map(({title:I,items:x,type:w})=>m.jsxs(j3,{children:[m.jsx(b.Typography,{variant:"body2_medium",children:I}),x.map(T=>{const A=w===Am,{deeplink:S,textHtml:F,imageUrl:D}=T,k=()=>m.jsx(C3,{className:A?"":"ellipsisClass",component:"div",variant:"body2",dangerouslySetInnerHTML:{__html:F}});return m.jsx(R3,{component:"ul",children:m.jsxs(M3,{component:A?"li":"div",marginLeft:D?"0":"14px",children:[D?m.jsx("img",{src:D}):null,S?m.jsx(Vu,{target:"_blank",underline:"none",onClick:M=>v(M,S),fontSize:"13px",children:k()}):k()]})},F)})]},I)),m.jsx(b.Stack,{flexDirection:"row",gap:"8px",marginBottom:"11.5px",children:f.map(({text:I,link:x,isAdminPanelLink:w})=>m.jsx(P3,{variant:w?"contained":"text",children:m.jsx(B3,{variant:"caption",onClick:T=>v(T,x,w,!0),children:I})},I))})]})})]})},nx=({selectedEmail:e,conversationId:t})=>ze({url:f6.replace(":conversationId",""+t),method:nt.PATCH,data:{selectedEmail:e}}),rx="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='7'%20cy='7'%20r='7'%20fill='%23196FE0'/%3e%3cpath%20d='M10.8288%204.89995C10.5922%204.64324%2010.1976%204.63193%209.94761%204.87601L5.96804%208.75823L4.06989%206.75353C3.82948%206.49981%203.43531%206.49425%203.18845%206.74158C2.9418%206.98865%202.9366%207.39455%203.1768%207.64827L5.50404%2010.1061C5.626%2010.235%205.78808%2010.3%205.95059%2010.3C6.10477%2010.3%206.25896%2010.2414%206.37969%2010.124L10.8056%205.80646C11.0553%205.56278%2011.0659%205.15689%2010.8288%204.89995Z'%20fill='white'/%3e%3c/svg%3e",Qf=e=>{const t=_.useRef(null),[n,r]=_.useState(!1);return _.useEffect(()=>{t.current&&r(t.current.scrollWidth>t.current.clientWidth)},[e]),{textRef:t,isOverflow:n}},ox=e=>{const{textRef:t,isOverflow:n}=Qf(e.data.label);return m.jsx(b.Tooltip,{title:n?e.data.value:null,placement:"bottom",children:m.jsx(V3,{ref:t,variant:"body2",paddingTop:n?"5px":"0px",children:e.data.label})})},sx=e=>m.jsxs(cn.MenuList,{...e,children:[m.jsx(G3,{children:m.jsx(b.Typography,{variant:"body2_medium",children:pb})}),e.children]}),ix=e=>{const{isSelected:t}=e,{textRef:n,isOverflow:r}=Qf(e.data.label);return m.jsx(cn.Option,{...e,children:m.jsxs(b.Stack,{direction:"row",gap:"5px",justifyContent:"space-between",alignItems:"center",children:[m.jsx(b.Tooltip,{title:r?e.data.value:null,placement:"bottom",children:m.jsx(H3,{ref:n,className:"dropdown-item-text",variant:"body2",children:e.data.label})}),t?m.jsx("img",{src:rx,width:"14px",height:"14px"}):null]})})},ax=e=>m.jsx(cn.DropdownIndicator,{...e,children:e.selectProps.menuIsOpen?m.jsx(b.icons.ArrowDropUp,{sx:{height:"18px",width:"18px",color:b.theme.palette.gray.gray3}}):m.jsx(b.icons.ArrowDropDown,{sx:{height:"18px",width:"18px",color:b.theme.palette.gray.gray3}})}),cx={control:e=>({...e,border:"none",boxShadow:"none",marginTop:"12px","&:hover":{border:"none",cursor:"pointer",backgroundColor:b.theme.palette.gray.gray7},"& > :first-child":{"& > :first-child":{paddingTop:"0px"},"& > :nth-child(2)":{height:"0px"}}}),option:(e,t)=>({...e,backgroundColor:b.theme.palette.gray.white,color:b.theme.palette.gray.black,height:"36px",padding:"6px 16px","&:hover":{backgroundColor:t.isFocused?b.theme.palette.gray.gray7:b.theme.palette.gray.white}}),singleValue:e=>({...e}),menuList:e=>({...e,maxHeight:"160px",borderRadius:"4px",overflowX:"hidden"}),menu:e=>({...e,boxShadow:"0px 3px 15px 0px #00000040",marginTop:"3px"}),menuPortal:e=>({...e,zIndex:2,maxHeight:"160px"})},lx=({selectedEmail:e,emailHeaders:t,root:n,isLoading:r,setSelectedEmail:o})=>{const{conversationId:s}=_.useContext(Ve),i=t?Object.entries(t).map(([l])=>({value:l,label:l})):e?[{value:e,label:e}]:[];_.useEffect(()=>{if(!e&&!r&&t&&Object.keys(t).length>0){const l=Object.keys(t)[0];l&&o(l)}},[t,o,e,r]);const a=l=>{const c=String((l==null?void 0:l.value)||"");c&&s&&nx({selectedEmail:c,conversationId:s}),o(c)};return m.jsx(wo,{options:i,value:e&&!r?{value:e,label:e}:null,placeholder:"Select an email",name:"email-selection",type:"select",onChange:a,components:{...wo.getDefaultComponents(),MenuList:sx,Option:ix,SingleValue:ox,DropdownIndicator:ax},root:n,styles:cx,isSearchable:!1,menuPortalTarget:document.body,isLoading:r})},ux=b.styled(b.Paper)`
1092
+ `,$7="https://cdn.hiverhq.com/connectors-module/assets/PlugIn.svg",U7={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_HIVER_CDN_URL:"https://cdn.hiverhq.com/",VITE_MY_ENV_VAR:"myVariable From Agent"},{VITE_HIVER_CDN_URL:K7}=U7,Jf=({isAdmin:e=!0,hideHeading:t=!1})=>{const{sendTrackingEvent:n,availableFeatures:r,connectorFunctions:o}=_.useContext(Ve),s=tt(r,am),i=tt(r,hs),a=p=>{p.stopPropagation(),n(Cg),o==null||o.redirectToAdmin()},l=p=>{p.stopPropagation(),n(vg),window.open(M7,"_blank")},c=()=>{n(Xg,{source:"main_tab"})},u=i?V7:j7;return m.jsxs(W7,{"data-testid":"noConnectors",children:[s?m.jsxs(m.Fragment,{children:[t?null:m.jsx(b.Typography,{variant:"h2",children:i?fa:H7}),m.jsx(z7,{onClick:c,href:B7,target:"_blank",children:m.jsx(o6,{src:K7+u,alt:G7,aspectRatio:"1000/783"})})]}):m.jsxs(Z7,{children:[m.jsx(X7,{variant:"body1_medium",children:O7}),m.jsx("img",{src:$7,alt:D7})]}),m.jsx(Y7,{variant:"body2",children:F7}),e?m.jsx(Yf,{endIcon:m.jsx(b.icons.ArrowForward,{}),onClick:a,...s&&{size:"medium"},children:i?N7:k7}):m.jsxs(m.Fragment,{children:[m.jsx(Yf,{onClick:l,children:R7}),m.jsxs(J7,{direction:"row",children:[m.jsx(Q7,{}),m.jsx(q7,{variant:"caption",children:P7})]})]})]})},ex=()=>{const{availableFeatures:e}=_.useContext(Ve),t=tt(e,hs);return m.jsxs(Pu,{children:[m.jsxs(b.Stack,{direction:"row",boxSizing:"content-box",paddingTop:"20px",paddingBottom:"12px",height:"36px",gap:"8px",alignItems:"center",children:[t?m.jsx(ku,{width:"20px",height:"20px"}):m.jsx(Ru,{}),m.jsx(Mu,{variant:"h2",children:t?fa:Cu})]}),m.jsxs(b.Stack,{gap:"12px",children:[m.jsx(vn,{variant:"rounded",width:"100%",height:"46px",animation:"wave"}),m.jsx(vn,{variant:"rounded",width:"100%",height:"46px",animation:"wave"}),m.jsx(vn,{variant:"rounded",width:"100%",height:"46px",animation:"wave"})]})]})},tx=()=>{const{metaData:e,sendTrackingEvent:t,isAdmin:n,connectorFunctions:r}=_.useContext(Ve),[o,s]=_.useState(!1),i=_.useRef(null),[a,l]=_.useState(0),{templateUpdates:c}=e||{},{sections:u=[],actionButtons:p=[],title:g}=c||{},{version:E=""}=c||{},y=Dm(E),d=_.useMemo(()=>Om(E),[E]),f=_.useMemo(()=>(p==null?void 0:p.filter(({isAdminPanelLink:I})=>!(!n&&I)))??[],[p,n]);if(_.useEffect(()=>{!d&&c&&ga(E,!0)},[d,E,c]),_.useLayoutEffect(()=>{var I;(I=i.current)!=null&&I.scrollHeight&&l(i.current.scrollHeight)},[i]),_.useEffect(()=>{c&&!y&&t(Ag,{update_version_id:E})},[]),!c||y)return null;const h=I=>{var x;I.stopPropagation(),s(w=>!w),(x=i.current)!=null&&x.scrollHeight&&l(i.current.scrollHeight),ga(E,!1,!0)},v=(I,x="",w=!1,T=!1)=>{var A;if(I.stopPropagation(),w&&T?t(_g,{update_version_id:E}):T&&t(Tg,{update_version_id:E}),!w&&x){(A=window.open(x,"_blank"))==null||A.focus();return}C(I,!1),r==null||r.redirectToAdmin()},C=(I,x=!0)=>{I.stopPropagation(),ga(E,!1),s(!1),x&&t(Sg,{update_version_id:E})};return m.jsxs(D3,{children:[m.jsxs(F3,{children:[m.jsx(O3,{variant:"h3",children:g}),m.jsxs(b.Box,{children:[o?m.jsx(b.Tooltip,{title:Cm,placement:"bottom",children:m.jsx(b.IconButton,{onClick:C,children:m.jsx(b.icons.Close,{sx:{height:"16px",width:"16px",opacity:"0.8"}})})}):null,m.jsx(b.Tooltip,{title:o?ym:da,placement:"bottom",children:m.jsx(vr,{onClick:h,children:m.jsx(ba,{className:o?"":"hiver-up"})})})]})]}),m.jsx(k3,{className:o?"slideDown":"slideUp",ref:i,height:a,children:m.jsxs(N3,{children:[u.map(({title:I,items:x,type:w})=>m.jsxs(j3,{children:[m.jsx(b.Typography,{variant:"body2_medium",children:I}),x.map(T=>{const A=w===Am,{deeplink:S,textHtml:F,imageUrl:D}=T,k=()=>m.jsx(C3,{className:A?"":"ellipsisClass",component:"div",variant:"body2",dangerouslySetInnerHTML:{__html:F}});return m.jsx(R3,{component:"ul",children:m.jsxs(M3,{component:A?"li":"div",marginLeft:D?"0":"14px",children:[D?m.jsx("img",{src:D}):null,S?m.jsx(Vu,{target:"_blank",underline:"none",onClick:M=>v(M,S),fontSize:"13px",children:k()}):k()]})},F)})]},I)),m.jsx(b.Stack,{flexDirection:"row",gap:"8px",marginBottom:"11.5px",children:f.map(({text:I,link:x,isAdminPanelLink:w})=>m.jsx(P3,{variant:w?"contained":"text",children:m.jsx(B3,{variant:"caption",onClick:T=>v(T,x,w,!0),children:I})},I))})]})})]})},nx=({selectedEmail:e,conversationId:t})=>ze({url:f6.replace(":conversationId",""+t),method:nt.PATCH,data:{selectedEmail:e}}),rx="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='7'%20cy='7'%20r='7'%20fill='%23196FE0'/%3e%3cpath%20d='M10.8288%204.89995C10.5922%204.64324%2010.1976%204.63193%209.94761%204.87601L5.96804%208.75823L4.06989%206.75353C3.82948%206.49981%203.43531%206.49425%203.18845%206.74158C2.9418%206.98865%202.9366%207.39455%203.1768%207.64827L5.50404%2010.1061C5.626%2010.235%205.78808%2010.3%205.95059%2010.3C6.10477%2010.3%206.25896%2010.2414%206.37969%2010.124L10.8056%205.80646C11.0553%205.56278%2011.0659%205.15689%2010.8288%204.89995Z'%20fill='white'/%3e%3c/svg%3e",Qf=e=>{const t=_.useRef(null),[n,r]=_.useState(!1);return _.useEffect(()=>{t.current&&r(t.current.scrollWidth>t.current.clientWidth)},[e]),{textRef:t,isOverflow:n}},ox=e=>{const{textRef:t,isOverflow:n}=Qf(e.data.label);return m.jsx(b.Tooltip,{title:n?e.data.value:null,placement:"bottom",children:m.jsx(V3,{ref:t,variant:"body2",paddingTop:n?"5px":"0px",children:e.data.label})})},sx=e=>m.jsxs(cn.MenuList,{...e,children:[m.jsx(G3,{children:m.jsx(b.Typography,{variant:"body2_medium",children:pb})}),e.children]}),ix=e=>{const{isSelected:t}=e,{textRef:n,isOverflow:r}=Qf(e.data.label);return m.jsx(cn.Option,{...e,children:m.jsxs(b.Stack,{direction:"row",gap:"5px",justifyContent:"space-between",alignItems:"center",children:[m.jsx(b.Tooltip,{title:r?e.data.value:null,placement:"bottom",children:m.jsx(H3,{ref:n,className:"dropdown-item-text",variant:"body2",children:e.data.label})}),t?m.jsx("img",{src:rx,width:"14px",height:"14px"}):null]})})},ax=e=>m.jsx(cn.DropdownIndicator,{...e,children:e.selectProps.menuIsOpen?m.jsx(b.icons.ArrowDropUp,{sx:{height:"18px",width:"18px",color:b.theme.palette.gray.gray3}}):m.jsx(b.icons.ArrowDropDown,{sx:{height:"18px",width:"18px",color:b.theme.palette.gray.gray3}})}),cx={control:e=>({...e,border:"none",boxShadow:"none",marginTop:"12px","&:hover":{border:"none",cursor:"pointer",backgroundColor:b.theme.palette.gray.gray7},"& > :first-child":{"& > :first-child":{paddingTop:"0px"},"& > :nth-child(2)":{height:"0px"}}}),option:(e,t)=>({...e,backgroundColor:b.theme.palette.gray.white,color:b.theme.palette.gray.black,height:"36px",padding:"6px 16px","&:hover":{backgroundColor:t.isFocused?b.theme.palette.gray.gray7:b.theme.palette.gray.white}}),singleValue:e=>({...e}),menuList:e=>({...e,maxHeight:"160px",borderRadius:"4px",overflowX:"hidden"}),menu:e=>({...e,boxShadow:"0px 3px 15px 0px #00000040",marginTop:"3px"}),menuPortal:e=>({...e,zIndex:2,maxHeight:"160px"})},lx=({selectedEmail:e,emailHeaders:t,root:n,isLoading:r,setSelectedEmail:o})=>{const{conversationId:s}=_.useContext(Ve),i=t?Object.entries(t).map(([l])=>({value:l,label:l})):e?[{value:e,label:e}]:[];_.useEffect(()=>{if(!e&&!r&&t&&Object.keys(t).length>0){const l=Object.keys(t)[0];l&&o(l)}},[t,o,e,r]);const a=l=>{const c=String((l==null?void 0:l.value)||"");c&&s&&nx({selectedEmail:c,conversationId:s}),o(c)};return m.jsx(wo,{options:i,value:e&&!r?{value:e,label:e}:null,placeholder:"Select an email",name:"email-selection",type:"select",onChange:a,components:{...wo.getDefaultComponents(),MenuList:sx,Option:ix,SingleValue:ox,DropdownIndicator:ax},root:n,styles:cx,isSearchable:!1,menuPortalTarget:document.body,isLoading:r})},ux=b.styled(b.Paper)`
1093
1093
  width: stretch;
1094
1094
  height: 100%;
1095
1095
  position: absolute;
@@ -1138,8 +1138,8 @@ Do you want to continue?`,j6="Select an object to create",V6="Select an object t
1138
1138
  height: 20px;
1139
1139
  flex-shrink: 0;
1140
1140
  }
1141
- `,Uf=({cardData:e,cardDataApiStatus:t,objectToLink:n,args:r})=>{const o=jt(),[s,i]=_.useState(!1),[a,l]=_.useState(!0),{id:c="",cardTitle:u="",logoUrl:p}=e||{},g=t===K.LOADING,E=d=>{d.stopPropagation();const f=d.currentTarget.offsetWidth<d.currentTarget.scrollWidth;i(!!f)},y=d=>{var h;o(Fr({id:n,args:r,isRefresh:!0}));const f=d.target.tagName==="BUTTON"?(h=d.target)==null?void 0:h.firstChild:d.target;f.className&&(f.className=""),setTimeout(()=>f.className="selected",1)};return m.jsxs(gx,{children:[m.jsxs(mx,{direction:"row",justifyContent:"space-between",children:[g?m.jsxs(b.Stack,{gap:"6px",direction:"row",children:[m.jsx(Cn,{width:"16px",height:"24px"}),m.jsx(Cn,{width:"100px",height:"24px"})]}):m.jsxs(yx,{children:[p&&m.jsx("img",{src:p,alt:u}),m.jsx(b.Tooltip,{title:s?u:"",children:m.jsx(b.Typography,{variant:"h4",onMouseOver:d=>E(d),onMouseLeave:d=>E(d),children:u})})]}),m.jsxs(b.Stack,{direction:"row",alignItems:"center",children:[a?m.jsx(b.Tooltip,{title:bu,placement:"bottom",children:m.jsx(vr,{onClick:d=>y(d),children:m.jsx("img",{src:Gf})})}):null,m.jsx(b.Tooltip,{title:a?yu:da,placement:"bottom",children:m.jsx(vr,{onClick:()=>l(d=>!d),children:m.jsx(ba,{className:a?"":"hiver-up"})})})]})]}),m.jsx(Pf,{id:c,cardTitle:u,specificCardData:{[c]:e},specificConnectorApiStatus:{[c]:t},isOpen:a})]})},Kf={values:{},errors:{}},$t={SET_FIELD_VALUE:"SET_FIELD_VALUE",CLEAR_ERROR:"CLEAR_ERROR",SET_FIELD_ERROR:"SET_FIELD_ERROR",SET_FIELDS:"SET_FIELDS",CLEAR_FIELDS:"CLEAR_FIELDS",RESET_STATE:"RESET_STATE"},Cx=(e,t)=>{const{type:n,payload:r}=t;switch(n){case $t.SET_FIELD_VALUE:{if(!(r!=null&&r.value))return e;const{name:o,value:s}=r.value;return{...e,values:{...e.values,[o]:s}}}case $t.SET_FIELD_ERROR:{if(!(r!=null&&r.value))return e;const{name:o,value:s}=r.value;return typeof s=="boolean"||typeof s=="string"?{...e,errors:{...e.errors,[o]:s}}:e}case $t.CLEAR_ERROR:{if(!(r!=null&&r.value))return e;const{name:o}=r.value;return{...e,errors:{...e.errors,[o]:""}}}case $t.SET_FIELDS:{if(!(r!=null&&r.values))return e;const{values:o}=r;return{...e,values:o}}case $t.RESET_STATE:return Kf}return e},ep=()=>_.useReducer(Cx,Kf),tp=({state:e,dispatch:t,validations:n})=>{const r=e.errors,o=(p,g)=>{t({type:$t.SET_FIELD_VALUE,payload:{value:{value:g,name:p}}})},s=_.useCallback(()=>Object.keys(r).filter(g=>!!r[g]).length>0,[r]),i=p=>{p.stopPropagation();const{name:g,value:E}=(p==null?void 0:p.target)||{};o(g,E)},a=(p,g)=>{p.stopPropagation();const{name:E}=(p==null?void 0:p.target)||{};o(E,g)},l=(p,g)=>{o(p,g||"")},c=(p,g)=>{e.errors[p]!==g&&t({type:$t.SET_FIELD_ERROR,payload:{value:{name:p,value:g}}})},u=(p,g)=>{if(g){const E=g[p];E==null||E.forEach(y=>{var d;o(y,""),g[y]&&u(y,g),(d=n[y])!=null&&d.isRequired&&c(y,!0)})}};return{setValue:o,isErrorInValidations:s,inputChangeHandler:i,checkboxChangeHandler:a,dateChangeHandler:l,handleValidationError:c,clearDependentFields:u}},np=({formFields:e,formId:t,formState:n,appDispatch:r})=>e.reduce((o,s)=>{if(s.type!=="async-select"||!s.interfaceDetails)return o;const i=s.interfaceDetails,a={loadOptions:(l,c,u,p)=>{let g=i;s.searchInterfaceDetails&&typeof l=="string"&&l.trim().length>0&&!u&&(g=s.searchInterfaceDetails);const E=s6(n,g==null?void 0:g.args),y=Object.values((g==null?void 0:g.args)||{});if(E.length===y.length){r(Qn({fieldName:s.name,formId:String(t),searchTerm:l,fieldConfig:s,interfaceId:g==null?void 0:g.id,pagination:g==null?void 0:g.pagination,callback:c,args:{..._o(n,g==null?void 0:g.args),..._o(n,g==null?void 0:g.optionalArgs)},isScrollToBottomEvent:u,controller:p}));return}return c([])}};return{...o,[s.name]:a}},{}),rp=({formFields:e,formId:t,formState:n,conversationId:r,appDispatch:o})=>e.reduce((s,i)=>{if(!i.createOptionInterfaceDetails)return s;const a=i.createOptionInterfaceDetails;return{...s,[i.name]:{createOption:(l,c)=>{var p,g;if(!l)return;const u={values:{name:i.name,value:l},errors:{}};o(oi({fieldName:i.name,formId:String(t),interfaceId:a.id,conversationId:r,label:l,callback:c,args:{..._o(n,(p=i==null?void 0:i.interfaceDetails)==null?void 0:p.args),..._o(n,(g=i==null?void 0:i.interfaceDetails)==null?void 0:g.optionalArgs)},createArgs:{..._o(u,a.args)}}))}}}},{}),op=({formFields:e,formState:t,formId:n,conversationId:r})=>{const o=jt(),s=_.useMemo(()=>{if(e&&e.length){const a=np({formFields:e,formId:n,formState:t,appDispatch:o});return e.reduce((c,u)=>{const p=u.columns;if(!p)return c;const g=np({formFields:p,formId:n,formState:t,appDispatch:o});return{...c,[u.name]:{loadOptionsList:g}}},a)}return null},[e,t,n,o]),i=_.useMemo(()=>{const a=rp({formFields:e,formId:n,formState:t,conversationId:r,appDispatch:o});return e.reduce((c,u)=>{const p=u.columns;if(!p)return c;const g=rp({formFields:p,formId:n,formState:t,conversationId:r,appDispatch:o});return{...c,[u.name]:{createOptionList:g}}},a)},[e,n,t,r,o]);return{fetchConfig:s,createConfig:i}},sp=({setShown:e,shown:t,title:n,description:r,buttons:o})=>m.jsx(So,{shown:t,setShown:e,showCloseButton:!0,children:m.jsxs(b.Stack,{width:"400px",padding:"20px",children:[m.jsx(b.Typography,{variant:"h2",marginBottom:"8px",children:n}),m.jsx(b.Stack,{gap:"4px",marginBottom:"20px",children:r.split(`
1142
- `).map((s,i)=>m.jsx(b.Typography,{variant:"body2",children:s},i))}),m.jsx(b.Stack,{direction:"row",justifyContent:"flex-end",gap:"8px",children:o.map(s=>m.jsx(b.Button,{variant:s.variant,size:"medium",onClick:s.action,children:s.label},s.label.split(" ").join("_").toLowerCase()))})]})}),ip="connector-agent-expanded-write-form",ap=({metaData:e,isEdit:t=!1,defaultOption:n,onClose:r,onCreateSuccess:o,setMetaData:s,connectors:i})=>{var ar;const{userGroupId:a,userId:l}=Yt()||{},[c,u]=_.useState(null),[p,g]=_.useState(!1),E=_.useRef(null),[y,d]=ep(),f=be(Zf),h=be(t?p7:Hf),v=be(g7),C=be(h7),I=be(y7),x=be(C7),w=be(v7),T=be(x7),A=be(E7),S=be(Xf),F=C==null?void 0:C[(c==null?void 0:c.value)??""],D=F==null?void 0:F.expandedView,{formConfigs:k,formViewConfigs:M}=_.useMemo(()=>{if(c&&"value"in c&&v&&v[c.value]&&Array.isArray(v[c.value])){const Te=v[c.value],et=[{id:c.value,formFields:Te}];return{formConfigs:et,formViewConfigs:D?i6(Te,Of):et}}const ce=[{id:"emptyFormId",formFields:[]}];return{formConfigs:ce,formViewConfigs:ce}},[v,c,D]),j=_.useMemo(()=>{var Te;const ce=((Te=k==null?void 0:k[0])==null?void 0:Te.formFields)||[];return pc({formFields:ce})},[k]),{setValue:H,inputChangeHandler:z,checkboxChangeHandler:U,dateChangeHandler:J,clearDependentFields:Y,handleValidationError:ae,isErrorInValidations:ue}=tp({state:y,dispatch:d,validations:j}),{conversationId:B,sendTrackingEvent:W,currentSmIds:V,connectorFunctions:{getFormElement:X,toggleFormElement:$},stackingContext:ee,userEmail:re}=_.useContext(Ve),{userGroupId:P}=Yt()||{},{fetchConfig:te,createConfig:ye}=op({formFields:k[0].formFields,formId:k[0].id,formState:y,conversationId:B}),Z=(ar=f==null?void 0:f.forms.find(ce=>ce.type==="edit"))==null?void 0:ar.id,{externalResourceId:Me}=f??{},ke=[x,w,A].includes(K.LOADING),Je=_.useMemo(()=>!D||!X?null:X(),[D,X]),Qe=jt();_.useEffect(()=>(D&&$&&$(!0),()=>{D&&$&&$(!1)}),[D,$]),_.useEffect(()=>{Qe(kf(t?!(T&&"values"in T&&"values"in y&&JSON.stringify(zf(y.values))===JSON.stringify(zf(T.values))):(e==null?void 0:e.fields_filled)!==void 0&&e.fields_filled>0))},[t,e,T,y,Qe]),_.useEffect(()=>(t&&T&&d({type:$t.SET_FIELDS,payload:T}),()=>{d({type:$t.SET_FIELDS,payload:{values:{}}})}),[t,d,T]),_.useEffect(()=>{c!==null&&s(ce=>({...ce,object_type:c.label}))},[c,s]),_.useEffect(()=>{if(y.values){const ce=wf(k[0].formFields,y.values);s(Te=>({...Te,fields_filled:ce}))}},[y,k,s]),_.useEffect(()=>{if(n&&!t)return u(n);h&&h.length&&u(t&&Z?h.find(ce=>ce.value===Z)??null:ce=>ce||!C?ce:h.length===1?h[0]:h.find(et=>!C[et.value].expandedView)??null)},[h,C,t,Z,n]);const fn=()=>{u(E.current),g(!1),d({type:$t.RESET_STATE})},yt=(ce,Te)=>{H(ce,Te)},st=(ce,Te,et)=>{if(Te.action==="clear"&&Te.name&&(H(Te.name,""),c!=null&&c.value&&Y(Te.name,I==null?void 0:I[c.value]),j[Te.name].isRequired&&ae(Te.name,!0)),ce&&typeof ce=="object"&&"label"in ce&&typeof ce.label=="string"&&"value"in ce&&(typeof ce.value=="string"||typeof ce.value=="number")&&typeof Te.name<"u")if(Te.name==="form-object")E.current={value:ce.value,label:ce.label},y.values&&ce.value!==(c==null?void 0:c.value)&&(Object.values(y.values).filter(vt=>vt!=="").length>0?g(!0):fn());else{let Ct=!1;et&&(Ct=et.isMultiSelect||!1);const vt=!Ct&&"prefillValues"in ce&&ce.prefillValues,kt=Ct?[{value:ce.value,label:ce.label}]:{value:ce.value,label:ce.label};if(H(Te.name,kt),vt)for(const pn in vt)H(pn,vt[pn]);c!=null&&c.value&&Y(Te.name,I==null?void 0:I[c.value])}},Ze=()=>{if(!ue()&&Z&&(C!=null&&C[Z])&&B&&Me){const{connectorName:ce,title:Te}=f;W(Gg,{connector_name:ce,card_title:Te,sm_ids:V,ug_id:P});const et=C[Z].interfaceDetails;if(!et||!T)return;const{id:Ct,args:vt={},previousArgs:kt={}}=et,pn=ri(T,kt),Po=ri(y,vt);Qe(ai({formId:String(Z),conversationId:B,args:Po,previousArgs:pn,externalResourceId:Me,interfaceId:Ct,successCallback:()=>{o()}})).unwrap().then(()=>{W(Zg,{connector_name:ce,card_title:Te,sm_ids:V,ug_id:P})}).finally(()=>{Qe(kr(null))})}},Fn=()=>{if(!ue()&&c&&(C!=null&&C[c.value])&&B){const ce=C==null?void 0:C[c.value].interfaceDetails;if(!ce)return;const{id:Te,args:et={}}=ce,Ct=ri(y,et);Qe(ii({formId:String(c.value),conversationId:B,args:Ct,interfaceId:Te,successCallback:()=>{o()}})).unwrap().then(()=>{W(Dg,{object_type:c})})}},Ft=[{label:"Cancel",action:()=>g(!1),variant:"text"},{label:"Continue",action:fn}],qr=ms({url:bg,params:{email:re,user_id:l,ug_id:a,sm_ids:V.join(","),connector_names:i.join(","),form_object:F==null?void 0:F.name}}),Mo=()=>{window.open(qr,"_blank"),W(om,{sm_ids:V,ug_id:a,connector_name:F==null?void 0:F.connectorName,form_object:F==null?void 0:F.name})},ir=m.jsxs(up,{className:D?ip:"",children:[m.jsx(sp,{shown:p,setShown:g,title:R6,description:M6,buttons:Ft}),D?m.jsxs(vx,{children:[m.jsxs(b.Typography,{children:[t?"Edit":"Add"," to ",F.connectorName]}),m.jsx(b.Tooltip,{title:"Close Popup",placement:"bottom",children:m.jsx(b.IconButton,{onClick:r,children:m.jsx(xx,{src:Mf})})})]}):null,m.jsxs(lp,{spacing:3,children:[!t&&!D?m.jsx(Or,{type:"select",placeholder:Lf,options:h,value:c,name:"form-object",selectChangeHandler:st,label:j6,labelSpacing:.5,validation:{isRequired:!0}}):null,m.jsx(If,{showGlobalLoader:A===K.LOADING,formConfig:M,selectChangeHandler:st,inputChangeHandler:z,checkboxChangeHandler:U,dateChangeHandler:J,tableChangeHandler:yt,onValidationError:ae,fieldsSpacing:3,labelSpacing:.5,fetchConfig:te,createConfig:ye,values:y.values,validations:j,...D?{cols:Of,stackIndex:ee.expandedForm}:null}),m.jsx(b.Stack,{marginTop:"28px",width:"100%",justifyContent:"center",children:m.jsx(Ex,{variant:"text",onClick:Mo,size:"small",children:Lm})})]}),m.jsxs(cp,{children:[m.jsx(b.Button,{disabled:ue()||ke||!S,onClick:t?Ze:Fn,size:"small",...D?{style:{order:2}}:null,children:t?xm:vm}),m.jsx(dp,{variant:"outlined",color:"tertiary",size:"small",onClick:r,disabled:ke,children:pa})]})]});return D&&Je?Ne.createPortal(ir,Je):ir},cp=b.styled(b.Box)`
1141
+ `,Uf=({cardData:e,cardDataApiStatus:t,objectToLink:n,args:r})=>{const o=jt(),[s,i]=_.useState(!1),[a,l]=_.useState(!0),{id:c="",cardTitle:u="",logoUrl:p}=e||{},g=t===K.LOADING,E=d=>{d.stopPropagation();const f=d.currentTarget.offsetWidth<d.currentTarget.scrollWidth;i(!!f)},y=d=>{var h;o(Fr({id:n,args:r,isRefresh:!0}));const f=d.target.tagName==="BUTTON"?(h=d.target)==null?void 0:h.firstChild:d.target;f.className&&(f.className=""),setTimeout(()=>f.className="selected",1)};return m.jsxs(gx,{children:[m.jsxs(mx,{direction:"row",justifyContent:"space-between",children:[g?m.jsxs(b.Stack,{gap:"6px",direction:"row",children:[m.jsx(vn,{width:"16px",height:"24px"}),m.jsx(vn,{width:"100px",height:"24px"})]}):m.jsxs(yx,{children:[p&&m.jsx("img",{src:p,alt:u}),m.jsx(b.Tooltip,{title:s?u:"",children:m.jsx(b.Typography,{variant:"h4",onMouseOver:d=>E(d),onMouseLeave:d=>E(d),children:u})})]}),m.jsxs(b.Stack,{direction:"row",alignItems:"center",children:[a?m.jsx(b.Tooltip,{title:bu,placement:"bottom",children:m.jsx(vr,{onClick:d=>y(d),children:m.jsx("img",{src:Gf})})}):null,m.jsx(b.Tooltip,{title:a?yu:da,placement:"bottom",children:m.jsx(vr,{onClick:()=>l(d=>!d),children:m.jsx(ba,{className:a?"":"hiver-up"})})})]})]}),m.jsx(Pf,{id:c,cardTitle:u,specificCardData:{[c]:e},specificConnectorApiStatus:{[c]:t},isOpen:a})]})},Kf={values:{},errors:{}},$t={SET_FIELD_VALUE:"SET_FIELD_VALUE",CLEAR_ERROR:"CLEAR_ERROR",SET_FIELD_ERROR:"SET_FIELD_ERROR",SET_FIELDS:"SET_FIELDS",CLEAR_FIELDS:"CLEAR_FIELDS",RESET_STATE:"RESET_STATE"},Cx=(e,t)=>{const{type:n,payload:r}=t;switch(n){case $t.SET_FIELD_VALUE:{if(!(r!=null&&r.value))return e;const{name:o,value:s}=r.value;return{...e,values:{...e.values,[o]:s}}}case $t.SET_FIELD_ERROR:{if(!(r!=null&&r.value))return e;const{name:o,value:s}=r.value;return typeof s=="boolean"||typeof s=="string"?{...e,errors:{...e.errors,[o]:s}}:e}case $t.CLEAR_ERROR:{if(!(r!=null&&r.value))return e;const{name:o}=r.value;return{...e,errors:{...e.errors,[o]:""}}}case $t.SET_FIELDS:{if(!(r!=null&&r.values))return e;const{values:o}=r;return{...e,values:o}}case $t.RESET_STATE:return Kf}return e},ep=()=>_.useReducer(Cx,Kf),tp=({state:e,dispatch:t,validations:n})=>{const r=e.errors,o=(p,g)=>{t({type:$t.SET_FIELD_VALUE,payload:{value:{value:g,name:p}}})},s=_.useCallback(()=>Object.keys(r).filter(g=>!!r[g]).length>0,[r]),i=p=>{p.stopPropagation();const{name:g,value:E}=(p==null?void 0:p.target)||{};o(g,E)},a=(p,g)=>{p.stopPropagation();const{name:E}=(p==null?void 0:p.target)||{};o(E,g)},l=(p,g)=>{o(p,g||"")},c=(p,g)=>{e.errors[p]!==g&&t({type:$t.SET_FIELD_ERROR,payload:{value:{name:p,value:g}}})},u=(p,g)=>{if(g){const E=g[p];E==null||E.forEach(y=>{var d;o(y,""),g[y]&&u(y,g),(d=n[y])!=null&&d.isRequired&&c(y,!0)})}};return{setValue:o,isErrorInValidations:s,inputChangeHandler:i,checkboxChangeHandler:a,dateChangeHandler:l,handleValidationError:c,clearDependentFields:u}},np=({formFields:e,formId:t,formState:n,appDispatch:r})=>e.reduce((o,s)=>{if(s.type!=="async-select"||!s.interfaceDetails)return o;const i=s.interfaceDetails,a={loadOptions:(l,c,u,p)=>{let g=i;s.searchInterfaceDetails&&typeof l=="string"&&l.trim().length>0&&!u&&(g=s.searchInterfaceDetails);const E=s6(n,g==null?void 0:g.args),y=Object.values((g==null?void 0:g.args)||{});if(E.length===y.length){r(Qn({fieldName:s.name,formId:String(t),searchTerm:l,fieldConfig:s,interfaceId:g==null?void 0:g.id,pagination:g==null?void 0:g.pagination,callback:c,args:{..._o(n,g==null?void 0:g.args),..._o(n,g==null?void 0:g.optionalArgs)},isScrollToBottomEvent:u,controller:p}));return}return c([])}};return{...o,[s.name]:a}},{}),rp=({formFields:e,formId:t,formState:n,conversationId:r,appDispatch:o})=>e.reduce((s,i)=>{if(!i.createOptionInterfaceDetails)return s;const a=i.createOptionInterfaceDetails;return{...s,[i.name]:{createOption:(l,c)=>{var p,g;if(!l)return;const u={values:{name:i.name,value:l},errors:{}};o(oi({fieldName:i.name,formId:String(t),interfaceId:a.id,conversationId:r,label:l,callback:c,args:{..._o(n,(p=i==null?void 0:i.interfaceDetails)==null?void 0:p.args),..._o(n,(g=i==null?void 0:i.interfaceDetails)==null?void 0:g.optionalArgs)},createArgs:{..._o(u,a.args)}}))}}}},{}),op=({formFields:e,formState:t,formId:n,conversationId:r})=>{const o=jt(),s=_.useMemo(()=>{if(e&&e.length){const a=np({formFields:e,formId:n,formState:t,appDispatch:o});return e.reduce((c,u)=>{const p=u.columns;if(!p)return c;const g=np({formFields:p,formId:n,formState:t,appDispatch:o});return{...c,[u.name]:{loadOptionsList:g}}},a)}return null},[e,t,n,o]),i=_.useMemo(()=>{const a=rp({formFields:e,formId:n,formState:t,conversationId:r,appDispatch:o});return e.reduce((c,u)=>{const p=u.columns;if(!p)return c;const g=rp({formFields:p,formId:n,formState:t,conversationId:r,appDispatch:o});return{...c,[u.name]:{createOptionList:g}}},a)},[e,n,t,r,o]);return{fetchConfig:s,createConfig:i}},sp=({setShown:e,shown:t,title:n,description:r,buttons:o})=>m.jsx(So,{shown:t,setShown:e,showCloseButton:!0,children:m.jsxs(b.Stack,{width:"400px",padding:"20px",children:[m.jsx(b.Typography,{variant:"h2",marginBottom:"8px",children:n}),m.jsx(b.Stack,{gap:"4px",marginBottom:"20px",children:r.split(`
1142
+ `).map((s,i)=>m.jsx(b.Typography,{variant:"body2",children:s},i))}),m.jsx(b.Stack,{direction:"row",justifyContent:"flex-end",gap:"8px",children:o.map(s=>m.jsx(b.Button,{variant:s.variant,size:"medium",onClick:s.action,children:s.label},s.label.split(" ").join("_").toLowerCase()))})]})}),ip="connector-agent-expanded-write-form",ap=({metaData:e,isEdit:t=!1,defaultOption:n,onClose:r,onCreateSuccess:o,setMetaData:s,connectors:i})=>{var ar;const{userGroupId:a,userId:l}=Yt()||{},[c,u]=_.useState(null),[p,g]=_.useState(!1),E=_.useRef(null),[y,d]=ep(),f=be(Zf),h=be(t?p7:Hf),v=be(g7),C=be(h7),I=be(y7),x=be(C7),w=be(v7),T=be(x7),A=be(E7),S=be(Xf),F=C==null?void 0:C[(c==null?void 0:c.value)??""],D=F==null?void 0:F.expandedView,{formConfigs:k,formViewConfigs:M}=_.useMemo(()=>{if(c&&"value"in c&&v&&v[c.value]&&Array.isArray(v[c.value])){const Te=v[c.value],et=[{id:c.value,formFields:Te}];return{formConfigs:et,formViewConfigs:D?i6(Te,Of):et}}const ce=[{id:"emptyFormId",formFields:[]}];return{formConfigs:ce,formViewConfigs:ce}},[v,c,D]),j=_.useMemo(()=>{var Te;const ce=((Te=k==null?void 0:k[0])==null?void 0:Te.formFields)||[];return pc({formFields:ce})},[k]),{setValue:H,inputChangeHandler:z,checkboxChangeHandler:U,dateChangeHandler:J,clearDependentFields:Y,handleValidationError:ae,isErrorInValidations:ue}=tp({state:y,dispatch:d,validations:j}),{conversationId:B,sendTrackingEvent:W,currentSmIds:V,connectorFunctions:{getFormElement:X,toggleFormElement:$},stackingContext:ee,userEmail:re}=_.useContext(Ve),{userGroupId:P}=Yt()||{},{fetchConfig:te,createConfig:ye}=op({formFields:k[0].formFields,formId:k[0].id,formState:y,conversationId:B}),Z=(ar=f==null?void 0:f.forms.find(ce=>ce.type==="edit"))==null?void 0:ar.id,{externalResourceId:Me}=f??{},ke=[x,w,A].includes(K.LOADING),Je=_.useMemo(()=>!D||!X?null:X(),[D,X]),Qe=jt();_.useEffect(()=>(D&&$&&$(!0),()=>{D&&$&&$(!1)}),[D,$]),_.useEffect(()=>{Qe(kf(t?!(T&&"values"in T&&"values"in y&&JSON.stringify(zf(y.values))===JSON.stringify(zf(T.values))):(e==null?void 0:e.fields_filled)!==void 0&&e.fields_filled>0))},[t,e,T,y,Qe]),_.useEffect(()=>(t&&T&&d({type:$t.SET_FIELDS,payload:T}),()=>{d({type:$t.SET_FIELDS,payload:{values:{}}})}),[t,d,T]),_.useEffect(()=>{c!==null&&s(ce=>({...ce,object_type:c.label}))},[c,s]),_.useEffect(()=>{if(y.values){const ce=wf(k[0].formFields,y.values);s(Te=>({...Te,fields_filled:ce}))}},[y,k,s]),_.useEffect(()=>{if(n&&!t)return u(n);h&&h.length&&u(t&&Z?h.find(ce=>ce.value===Z)??null:ce=>ce||!C?ce:h.length===1?h[0]:h.find(et=>!C[et.value].expandedView)??null)},[h,C,t,Z,n]);const fn=()=>{u(E.current),g(!1),d({type:$t.RESET_STATE})},yt=(ce,Te)=>{H(ce,Te)},st=(ce,Te,et)=>{if(Te.action==="clear"&&Te.name&&(H(Te.name,""),c!=null&&c.value&&Y(Te.name,I==null?void 0:I[c.value]),j[Te.name].isRequired&&ae(Te.name,!0)),ce&&typeof ce=="object"&&"label"in ce&&typeof ce.label=="string"&&"value"in ce&&(typeof ce.value=="string"||typeof ce.value=="number")&&typeof Te.name<"u")if(Te.name==="form-object")E.current={value:ce.value,label:ce.label},y.values&&ce.value!==(c==null?void 0:c.value)&&(Object.values(y.values).filter(vt=>vt!=="").length>0?g(!0):fn());else{let Ct=!1;et&&(Ct=et.isMultiSelect||!1);const vt=!Ct&&"prefillValues"in ce&&ce.prefillValues,kt=Ct?[{value:ce.value,label:ce.label}]:{value:ce.value,label:ce.label};if(H(Te.name,kt),vt)for(const pn in vt)H(pn,vt[pn]);c!=null&&c.value&&Y(Te.name,I==null?void 0:I[c.value])}},Ze=()=>{if(!ue()&&Z&&(C!=null&&C[Z])&&B&&Me){const{connectorName:ce,title:Te}=f;W(Gg,{connector_name:ce,card_title:Te,sm_ids:V,ug_id:P});const et=C[Z].interfaceDetails;if(!et||!T)return;const{id:Ct,args:vt={},previousArgs:kt={}}=et,pn=ri(T,kt),Po=ri(y,vt);Qe(ai({formId:String(Z),conversationId:B,args:Po,previousArgs:pn,externalResourceId:Me,interfaceId:Ct,successCallback:()=>{o()}})).unwrap().then(()=>{W(Zg,{connector_name:ce,card_title:Te,sm_ids:V,ug_id:P})}).finally(()=>{Qe(kr(null))})}},kn=()=>{if(!ue()&&c&&(C!=null&&C[c.value])&&B){const ce=C==null?void 0:C[c.value].interfaceDetails;if(!ce)return;const{id:Te,args:et={}}=ce,Ct=ri(y,et);Qe(ii({formId:String(c.value),conversationId:B,args:Ct,interfaceId:Te,successCallback:()=>{o()}})).unwrap().then(()=>{W(Dg,{object_type:c})})}},Ft=[{label:"Cancel",action:()=>g(!1),variant:"text"},{label:"Continue",action:fn}],qr=ms({url:bg,params:{email:re,user_id:l,ug_id:a,sm_ids:V.join(","),connector_names:i.join(","),form_object:F==null?void 0:F.name}}),Mo=()=>{window.open(qr,"_blank"),W(om,{sm_ids:V,ug_id:a,connector_name:F==null?void 0:F.connectorName,form_object:F==null?void 0:F.name})},ir=m.jsxs(up,{className:D?ip:"",children:[m.jsx(sp,{shown:p,setShown:g,title:R6,description:M6,buttons:Ft}),D?m.jsxs(vx,{children:[m.jsxs(b.Typography,{children:[t?"Edit":"Add"," to ",F.connectorName]}),m.jsx(b.Tooltip,{title:"Close Popup",placement:"bottom",children:m.jsx(b.IconButton,{onClick:r,children:m.jsx(xx,{src:Mf})})})]}):null,m.jsxs(lp,{spacing:3,children:[!t&&!D?m.jsx(Or,{type:"select",placeholder:Lf,options:h,value:c,name:"form-object",selectChangeHandler:st,label:j6,labelSpacing:.5,validation:{isRequired:!0}}):null,m.jsx(If,{showGlobalLoader:A===K.LOADING,formConfig:M,selectChangeHandler:st,inputChangeHandler:z,checkboxChangeHandler:U,dateChangeHandler:J,tableChangeHandler:yt,onValidationError:ae,fieldsSpacing:3,labelSpacing:.5,fetchConfig:te,createConfig:ye,values:y.values,validations:j,...D?{cols:Of,stackIndex:ee.expandedForm}:null}),m.jsx(b.Stack,{marginTop:"28px",width:"100%",justifyContent:"center",children:m.jsx(Ex,{variant:"text",onClick:Mo,size:"small",children:Lm})})]}),m.jsxs(cp,{children:[m.jsx(b.Button,{disabled:ue()||ke||!S,onClick:t?Ze:kn,size:"small",...D?{style:{order:2}}:null,children:t?xm:vm}),m.jsx(dp,{variant:"outlined",color:"tertiary",size:"small",onClick:r,disabled:ke,children:pa})]})]});return D&&Je?Ne.createPortal(ir,Je):ir},cp=b.styled(b.Box)`
1143
1143
  box-sizing: border-box;
1144
1144
  height: 52px;
1145
1145
  background-color: var(--form-background-color, inherit);
@@ -1258,7 +1258,7 @@ Do you want to continue?`,j6="Select an object to create",V6="Select an object t
1258
1258
  color: ${b.theme.palette.gray.gray3};
1259
1259
  font-size: 11px;
1260
1260
  text-transform: uppercase;
1261
- `,eE=({onSelect:e,selectedOption:t,options:n})=>n.length?m.jsxs($x,{children:[m.jsx(Ux,{children:Nx}),m.jsx(Kx,{children:Rx}),n.map(r=>m.jsx(pp,{suggestionType:"smart",data:r,isSelected:t===r,onSelect:e},r.label+r.description))]}):null;var Rr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},qn=typeof window>"u"||"Deno"in globalThis;function Ot(){}function tE(e,t){return typeof e=="function"?e(t):e}function yc(e){return typeof e=="number"&&e>=0&&e!==1/0}function hp(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Mr(e,t){return typeof e=="function"?e(t):e}function Ht(e,t){return typeof e=="function"?e(t):e}function gp(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Cc(i,t.options))return!1}else if(!Oo(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function mp(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if($n(t.options.mutationKey)!==$n(s))return!1}else if(!Oo(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Cc(e,t){return((t==null?void 0:t.queryKeyHashFn)||$n)(e)}function $n(e){return JSON.stringify(e,(t,n)=>xc(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Oo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Oo(e[n],t[n])):!1}function vc(e,t){if(e===t)return e;const n=bp(e)&&bp(t);if(n||xc(e)&&xc(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{};let l=0;for(let c=0;c<i;c++){const u=n?c:s[c];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=vc(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===i&&l===o?e:a}return t}function fi(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function bp(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function xc(e){if(!yp(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!yp(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function yp(e){return Object.prototype.toString.call(e)==="[object Object]"}function nE(e){return new Promise(t=>{setTimeout(t,e)})}function Ec(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return vc(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return vc(e,t)}return t}function rE(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function oE(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var pi=Symbol();function Cp(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===pi&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===pi?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var sE=(Zp=class extends Rr{constructor(){super();se(this,Un);se(this,In);se(this,Pr);q(this,Pr,t=>{if(!qn&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){O(this,In)||this.setEventListener(O(this,Pr))}onUnsubscribe(){var t;this.hasListeners()||((t=O(this,In))==null||t.call(this),q(this,In,void 0))}setEventListener(t){var n;q(this,Pr,t),(n=O(this,In))==null||n.call(this),q(this,In,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){O(this,Un)!==t&&(q(this,Un,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof O(this,Un)=="boolean"?O(this,Un):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Un=new WeakMap,In=new WeakMap,Pr=new WeakMap,Zp),Ic=new sE,iE=(Xp=class extends Rr{constructor(){super();se(this,Br,!0);se(this,wn);se(this,jr);q(this,jr,t=>{if(!qn&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){O(this,wn)||this.setEventListener(O(this,jr))}onUnsubscribe(){var t;this.hasListeners()||((t=O(this,wn))==null||t.call(this),q(this,wn,void 0))}setEventListener(t){var n;q(this,jr,t),(n=O(this,wn))==null||n.call(this),q(this,wn,t(this.setOnline.bind(this)))}setOnline(t){O(this,Br)!==t&&(q(this,Br,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return O(this,Br)}},Br=new WeakMap,wn=new WeakMap,jr=new WeakMap,Xp),hi=new iE;function wc(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function aE(e){return Math.min(1e3*2**e,3e4)}function vp(e){return(e??"online")==="online"?hi.isOnline():!0}var xp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ac(e){return e instanceof xp}function Ep(e){let t=!1,n=0,r=!1,o;const s=wc(),i=d=>{var f;r||(g(new xp(d)),(f=e.abort)==null||f.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>Ic.isFocused()&&(e.networkMode==="always"||hi.isOnline())&&e.canRun(),u=()=>vp(e.networkMode)&&e.canRun(),p=d=>{var f;r||(r=!0,(f=e.onSuccess)==null||f.call(e,d),o==null||o(),s.resolve(d))},g=d=>{var f;r||(r=!0,(f=e.onError)==null||f.call(e,d),o==null||o(),s.reject(d))},E=()=>new Promise(d=>{var f;o=h=>{(r||c())&&d(h)},(f=e.onPause)==null||f.call(e)}).then(()=>{var d;o=void 0,r||(d=e.onContinue)==null||d.call(e)}),y=()=>{if(r)return;let d;const f=n===0?e.initialPromise:void 0;try{d=f??e.fn()}catch(h){d=Promise.reject(h)}Promise.resolve(d).then(p).catch(h=>{var w;if(r)return;const v=e.retry??(qn?0:3),C=e.retryDelay??aE,I=typeof C=="function"?C(n,h):C,x=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,h);if(t||!x){g(h);return}n++,(w=e.onFail)==null||w.call(e,n,h),nE(I).then(()=>c()?void 0:E()).then(()=>{t?g(h):y()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?y():E().then(y),s)}}function cE(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Ye=cE(),Ip=(zp=class{constructor(){se(this,Kn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),yc(this.gcTime)&&q(this,Kn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(qn?1/0:5*60*1e3))}clearGcTimeout(){O(this,Kn)&&(clearTimeout(O(this,Kn)),q(this,Kn,void 0))}},Kn=new WeakMap,zp),lE=(Yp=class extends Ip{constructor(t){super();se(this,Wt);se(this,Vr);se(this,Gr);se(this,Dt);se(this,er);se(this,ot);se(this,Fo);se(this,tr);q(this,tr,!1),q(this,Fo,t.defaultOptions),this.setOptions(t.options),this.observers=[],q(this,er,t.client),q(this,Dt,O(this,er).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,q(this,Vr,uE(this.options)),this.state=t.state??O(this,Vr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=O(this,ot))==null?void 0:t.promise}setOptions(t){this.options={...O(this,Fo),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&O(this,Dt).remove(this)}setData(t,n){const r=Ec(this.state.data,t,this.options);return he(this,Wt,hn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){he(this,Wt,hn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=O(this,ot))==null?void 0:r.promise;return(o=O(this,ot))==null||o.cancel(t),n?n.then(Ot).catch(Ot):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(O(this,Vr))}isActive(){return this.observers.some(t=>Ht(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===pi||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!hp(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=O(this,ot))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=O(this,ot))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),O(this,Dt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(O(this,ot)&&(O(this,tr)?O(this,ot).cancel({revert:!0}):O(this,ot).cancelRetry()),this.scheduleGc()),O(this,Dt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||he(this,Wt,hn).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(O(this,ot))return O(this,ot).continueRetry(),O(this,ot).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(g=>g.options.queryFn);p&&this.setOptions(p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(q(this,tr,!0),r.signal)})},s=()=>{const p=Cp(this.options,n),g={client:O(this,er),queryKey:this.queryKey,meta:this.meta};return o(g),q(this,tr,!1),this.options.persister?this.options.persister(p,g,this):p(g)},i={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:O(this,er),state:this.state,fetchFn:s};o(i),(l=this.options.behavior)==null||l.onFetch(i,this),q(this,Gr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=i.fetchOptions)==null?void 0:c.meta))&&he(this,Wt,hn).call(this,{type:"fetch",meta:(u=i.fetchOptions)==null?void 0:u.meta});const a=p=>{var g,E,y,d;Ac(p)&&p.silent||he(this,Wt,hn).call(this,{type:"error",error:p}),Ac(p)||((E=(g=O(this,Dt).config).onError)==null||E.call(g,p,this),(d=(y=O(this,Dt).config).onSettled)==null||d.call(y,this.state.data,p,this)),this.scheduleGc()};return q(this,ot,Ep({initialPromise:n==null?void 0:n.initialPromise,fn:i.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var g,E,y,d;if(p===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(f){a(f);return}(E=(g=O(this,Dt).config).onSuccess)==null||E.call(g,p,this),(d=(y=O(this,Dt).config).onSettled)==null||d.call(y,p,this.state.error,this),this.scheduleGc()},onError:a,onFail:(p,g)=>{he(this,Wt,hn).call(this,{type:"failed",failureCount:p,error:g})},onPause:()=>{he(this,Wt,hn).call(this,{type:"pause"})},onContinue:()=>{he(this,Wt,hn).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0})),O(this,ot).start()}},Vr=new WeakMap,Gr=new WeakMap,Dt=new WeakMap,er=new WeakMap,ot=new WeakMap,Fo=new WeakMap,tr=new WeakMap,Wt=new WeakSet,hn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...wp(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Ac(o)&&o.revert&&O(this,Gr)?{...O(this,Gr),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ye.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),O(this,Dt).notify({query:this,type:"updated",action:t})})},Yp);function wp(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vp(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uE(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var dE=(Jp=class extends Rr{constructor(t={}){super();se(this,Ut);this.config=t,q(this,Ut,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Cc(o,n);let i=this.get(s);return i||(i=new lE({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){O(this,Ut).has(t.queryHash)||(O(this,Ut).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=O(this,Ut).get(t.queryHash);n&&(t.destroy(),n===t&&O(this,Ut).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ye.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return O(this,Ut).get(t)}getAll(){return[...O(this,Ut).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>gp(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>gp(t,r)):n}notify(t){Ye.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ye.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ye.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ut=new WeakMap,Jp),fE=(Qp=class extends Ip{constructor(t){super();se(this,en);se(this,Kt);se(this,ct);se(this,nr);this.mutationId=t.mutationId,q(this,ct,t.mutationCache),q(this,Kt,[]),this.state=t.state||Ap(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){O(this,Kt).includes(t)||(O(this,Kt).push(t),this.clearGcTimeout(),O(this,ct).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){q(this,Kt,O(this,Kt).filter(n=>n!==t)),this.scheduleGc(),O(this,ct).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){O(this,Kt).length||(this.state.status==="pending"?this.scheduleGc():O(this,ct).remove(this))}continue(){var t;return((t=O(this,nr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,i,a,l,c,u,p,g,E,y,d,f,h,v,C,I,x,w,T;q(this,nr,Ep({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,S)=>{he(this,en,Rn).call(this,{type:"failed",failureCount:A,error:S})},onPause:()=>{he(this,en,Rn).call(this,{type:"pause"})},onContinue:()=>{he(this,en,Rn).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>O(this,ct).canRun(this)}));const n=this.state.status==="pending",r=!O(this,nr).canStart();try{if(!n){he(this,en,Rn).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(o=O(this,ct).config).onMutate)==null?void 0:s.call(o,t,this));const S=await((a=(i=this.options).onMutate)==null?void 0:a.call(i,t));S!==this.state.context&&he(this,en,Rn).call(this,{type:"pending",context:S,variables:t,isPaused:r})}const A=await O(this,nr).start();return await((c=(l=O(this,ct).config).onSuccess)==null?void 0:c.call(l,A,t,this.state.context,this)),await((p=(u=this.options).onSuccess)==null?void 0:p.call(u,A,t,this.state.context)),await((E=(g=O(this,ct).config).onSettled)==null?void 0:E.call(g,A,null,this.state.variables,this.state.context,this)),await((d=(y=this.options).onSettled)==null?void 0:d.call(y,A,null,t,this.state.context)),he(this,en,Rn).call(this,{type:"success",data:A}),A}catch(A){try{throw await((h=(f=O(this,ct).config).onError)==null?void 0:h.call(f,A,t,this.state.context,this)),await((C=(v=this.options).onError)==null?void 0:C.call(v,A,t,this.state.context)),await((x=(I=O(this,ct).config).onSettled)==null?void 0:x.call(I,void 0,A,this.state.variables,this.state.context,this)),await((T=(w=this.options).onSettled)==null?void 0:T.call(w,void 0,A,t,this.state.context)),A}finally{he(this,en,Rn).call(this,{type:"error",error:A})}}finally{O(this,ct).runNext(this)}}},Kt=new WeakMap,ct=new WeakMap,nr=new WeakMap,en=new WeakSet,Rn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ye.batch(()=>{O(this,Kt).forEach(r=>{r.onMutationUpdate(t)}),O(this,ct).notify({mutation:this,type:"updated",action:t})})},Qp);function Ap(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pE=(qp=class extends Rr{constructor(t={}){super();se(this,ln);se(this,Zt);se(this,ko);this.config=t,q(this,ln,new Set),q(this,Zt,new Map),q(this,ko,0)}build(t,n,r){const o=new fE({mutationCache:this,mutationId:++Ei(this,ko)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){O(this,ln).add(t);const n=gi(t);if(typeof n=="string"){const r=O(this,Zt).get(n);r?r.push(t):O(this,Zt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(O(this,ln).delete(t)){const n=gi(t);if(typeof n=="string"){const r=O(this,Zt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&O(this,Zt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=gi(t);if(typeof n=="string"){const r=O(this,Zt).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=gi(t);if(typeof n=="string"){const o=(r=O(this,Zt).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ye.batch(()=>{O(this,ln).forEach(t=>{this.notify({type:"removed",mutation:t})}),O(this,ln).clear(),O(this,Zt).clear()})}getAll(){return Array.from(O(this,ln))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>mp(n,r))}findAll(t={}){return this.getAll().filter(n=>mp(t,n))}notify(t){Ye.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ye.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ot))))}},ln=new WeakMap,Zt=new WeakMap,ko=new WeakMap,qp);function gi(e){var t;return(t=e.options.scope)==null?void 0:t.id}function _p(e){return{onFetch:(t,n)=>{var u,p,g,E,y;const r=t.options,o=(g=(p=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:p.fetchMore)==null?void 0:g.direction,s=((E=t.state.data)==null?void 0:E.pages)||[],i=((y=t.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let d=!1;const f=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?d=!0:t.signal.addEventListener("abort",()=>{d=!0}),t.signal)})},h=Cp(t.options,t.fetchOptions),v=async(C,I,x)=>{if(d)return Promise.reject();if(I==null&&C.pages.length)return Promise.resolve(C);const w={client:t.client,queryKey:t.queryKey,pageParam:I,direction:x?"backward":"forward",meta:t.options.meta};f(w);const T=await h(w),{maxPages:A}=t.options,S=x?oE:rE;return{pages:S(C.pages,T,A),pageParams:S(C.pageParams,I,A)}};if(o&&s.length){const C=o==="backward",I=C?hE:Tp,x={pages:s,pageParams:i},w=I(r,x);a=await v(x,w,C)}else{const C=e??s.length;do{const I=l===0?i[0]??r.initialPageParam:Tp(r,a);if(l>0&&I==null)break;a=await v(a,I),l++}while(l<C)}return a};t.options.persister?t.fetchFn=()=>{var d,f;return(f=(d=t.options).persister)==null?void 0:f.call(d,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Tp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function hE(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var gE=($p=class{constructor(e={}){se(this,je);se(this,An);se(this,_n);se(this,Hr);se(this,Wr);se(this,Tn);se(this,Zr);se(this,Xr);q(this,je,e.queryCache||new dE),q(this,An,e.mutationCache||new pE),q(this,_n,e.defaultOptions||{}),q(this,Hr,new Map),q(this,Wr,new Map),q(this,Tn,0)}mount(){Ei(this,Tn)._++,O(this,Tn)===1&&(q(this,Zr,Ic.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,je).onFocus())})),q(this,Xr,hi.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,je).onOnline())})))}unmount(){var e,t;Ei(this,Tn)._--,O(this,Tn)===0&&((e=O(this,Zr))==null||e.call(this),q(this,Zr,void 0),(t=O(this,Xr))==null||t.call(this),q(this,Xr,void 0))}isFetching(e){return O(this,je).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return O(this,An).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=O(this,je).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=O(this,je).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Mr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return O(this,je).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=O(this,je).get(r.queryHash),s=o==null?void 0:o.state.data,i=tE(t,s);if(i!==void 0)return O(this,je).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Ye.batch(()=>O(this,je).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=O(this,je).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=O(this,je);Ye.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=O(this,je);return Ye.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ye.batch(()=>O(this,je).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ot).catch(Ot)}invalidateQueries(e,t={}){return Ye.batch(()=>(O(this,je).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ye.batch(()=>O(this,je).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ot)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ot)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=O(this,je).build(this,t);return n.isStaleByTime(Mr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ot).catch(Ot)}fetchInfiniteQuery(e){return e.behavior=_p(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ot).catch(Ot)}ensureInfiniteQueryData(e){return e.behavior=_p(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return hi.isOnline()?O(this,An).resumePausedMutations():Promise.resolve()}getQueryCache(){return O(this,je)}getMutationCache(){return O(this,An)}getDefaultOptions(){return O(this,_n)}setDefaultOptions(e){q(this,_n,e)}setQueryDefaults(e,t){O(this,Hr).set($n(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...O(this,Hr).values()],n={};return t.forEach(r=>{Oo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){O(this,Wr).set($n(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...O(this,Wr).values()],n={};return t.forEach(r=>{Oo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...O(this,_n).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Cc(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===pi&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...O(this,_n).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){O(this,je).clear(),O(this,An).clear()}},je=new WeakMap,An=new WeakMap,_n=new WeakMap,Hr=new WeakMap,Wr=new WeakMap,Tn=new WeakMap,Zr=new WeakMap,Xr=new WeakMap,$p),mE=(Up=class extends Rr{constructor(t,n){super();se(this,_e);se(this,mt);se(this,me);se(this,No);se(this,lt);se(this,rr);se(this,zr);se(this,Sn);se(this,tn);se(this,Ro);se(this,Yr);se(this,Jr);se(this,or);se(this,sr);se(this,Ln);se(this,Qr,new Set);this.options=n,q(this,mt,t),q(this,tn,null),q(this,Sn,wc()),this.options.experimental_prefetchInRender||O(this,Sn).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(O(this,me).addObserver(this),Sp(O(this,me),this.options)?he(this,_e,Ho).call(this):this.updateResult(),he(this,_e,Gc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _c(O(this,me),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _c(O(this,me),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,he(this,_e,Hc).call(this),he(this,_e,Wc).call(this),O(this,me).removeObserver(this)}setOptions(t,n){const r=this.options,o=O(this,me);if(this.options=O(this,mt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ht(this.options.enabled,O(this,me))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");he(this,_e,Zc).call(this),O(this,me).setOptions(this.options),r._defaulted&&!fi(this.options,r)&&O(this,mt).getQueryCache().notify({type:"observerOptionsUpdated",query:O(this,me),observer:this});const s=this.hasListeners();s&&Lp(O(this,me),o,this.options,r)&&he(this,_e,Ho).call(this),this.updateResult(n),s&&(O(this,me)!==o||Ht(this.options.enabled,O(this,me))!==Ht(r.enabled,O(this,me))||Mr(this.options.staleTime,O(this,me))!==Mr(r.staleTime,O(this,me)))&&he(this,_e,Bc).call(this);const i=he(this,_e,jc).call(this);s&&(O(this,me)!==o||Ht(this.options.enabled,O(this,me))!==Ht(r.enabled,O(this,me))||i!==O(this,Ln))&&he(this,_e,Vc).call(this,i)}getOptimisticResult(t){const n=O(this,mt).getQueryCache().build(O(this,mt),t),r=this.createResult(n,t);return yE(this,r)&&(q(this,lt,r),q(this,zr,this.options),q(this,rr,O(this,me).state)),r}getCurrentResult(){return O(this,lt)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){O(this,Qr).add(t)}getCurrentQuery(){return O(this,me)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=O(this,mt).defaultQueryOptions(t),r=O(this,mt).getQueryCache().build(O(this,mt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return he(this,_e,Ho).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),O(this,lt)))}createResult(t,n){var A;const r=O(this,me),o=this.options,s=O(this,lt),i=O(this,rr),a=O(this,zr),c=t!==r?t.state:O(this,No),{state:u}=t;let p={...u},g=!1,E;if(n._optimisticResults){const S=this.hasListeners(),F=!S&&Sp(t,n),D=S&&Lp(t,r,n,o);(F||D)&&(p={...p,...wp(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:y,errorUpdatedAt:d,status:f}=p;if(n.select&&p.data!==void 0)if(s&&p.data===(i==null?void 0:i.data)&&n.select===O(this,Ro))E=O(this,Yr);else try{q(this,Ro,n.select),E=n.select(p.data),E=Ec(s==null?void 0:s.data,E,n),q(this,Yr,E),q(this,tn,null)}catch(S){q(this,tn,S)}else E=p.data;if(n.placeholderData!==void 0&&E===void 0&&f==="pending"){let S;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))S=s.data;else if(S=typeof n.placeholderData=="function"?n.placeholderData((A=O(this,Jr))==null?void 0:A.state.data,O(this,Jr)):n.placeholderData,n.select&&S!==void 0)try{S=n.select(S),q(this,tn,null)}catch(F){q(this,tn,F)}S!==void 0&&(f="success",E=Ec(s==null?void 0:s.data,S,n),g=!0)}O(this,tn)&&(y=O(this,tn),E=O(this,Yr),d=Date.now(),f="error");const h=p.fetchStatus==="fetching",v=f==="pending",C=f==="error",I=v&&h,x=E!==void 0,T={status:f,fetchStatus:p.fetchStatus,isPending:v,isSuccess:f==="success",isError:C,isInitialLoading:I,isLoading:I,data:E,dataUpdatedAt:p.dataUpdatedAt,error:y,errorUpdatedAt:d,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>c.dataUpdateCount||p.errorUpdateCount>c.errorUpdateCount,isFetching:h,isRefetching:h&&!v,isLoadingError:C&&!x,isPaused:p.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:C&&x,isStale:Tc(t,n),refetch:this.refetch,promise:O(this,Sn)};if(this.options.experimental_prefetchInRender){const S=k=>{T.status==="error"?k.reject(T.error):T.data!==void 0&&k.resolve(T.data)},F=()=>{const k=q(this,Sn,T.promise=wc());S(k)},D=O(this,Sn);switch(D.status){case"pending":t.queryHash===r.queryHash&&S(D);break;case"fulfilled":(T.status==="error"||T.data!==D.value)&&F();break;case"rejected":(T.status!=="error"||T.error!==D.reason)&&F();break}}return T}updateResult(t){const n=O(this,lt),r=this.createResult(O(this,me),this.options);if(q(this,rr,O(this,me).state),q(this,zr,this.options),O(this,rr).data!==void 0&&q(this,Jr,O(this,me)),fi(r,n))return;q(this,lt,r);const o={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!O(this,Qr).size)return!0;const l=new Set(a??O(this,Qr));return this.options.throwOnError&&l.add("error"),Object.keys(O(this,lt)).some(c=>{const u=c;return O(this,lt)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&s()&&(o.listeners=!0),he(this,_e,n1).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&he(this,_e,Gc).call(this)}},mt=new WeakMap,me=new WeakMap,No=new WeakMap,lt=new WeakMap,rr=new WeakMap,zr=new WeakMap,Sn=new WeakMap,tn=new WeakMap,Ro=new WeakMap,Yr=new WeakMap,Jr=new WeakMap,or=new WeakMap,sr=new WeakMap,Ln=new WeakMap,Qr=new WeakMap,_e=new WeakSet,Ho=function(t){he(this,_e,Zc).call(this);let n=O(this,me).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ot)),n},Bc=function(){he(this,_e,Hc).call(this);const t=Mr(this.options.staleTime,O(this,me));if(qn||O(this,lt).isStale||!yc(t))return;const r=hp(O(this,lt).dataUpdatedAt,t)+1;q(this,or,setTimeout(()=>{O(this,lt).isStale||this.updateResult()},r))},jc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(O(this,me)):this.options.refetchInterval)??!1},Vc=function(t){he(this,_e,Wc).call(this),q(this,Ln,t),!(qn||Ht(this.options.enabled,O(this,me))===!1||!yc(O(this,Ln))||O(this,Ln)===0)&&q(this,sr,setInterval(()=>{(this.options.refetchIntervalInBackground||Ic.isFocused())&&he(this,_e,Ho).call(this)},O(this,Ln)))},Gc=function(){he(this,_e,Bc).call(this),he(this,_e,Vc).call(this,he(this,_e,jc).call(this))},Hc=function(){O(this,or)&&(clearTimeout(O(this,or)),q(this,or,void 0))},Wc=function(){O(this,sr)&&(clearInterval(O(this,sr)),q(this,sr,void 0))},Zc=function(){const t=O(this,mt).getQueryCache().build(O(this,mt),this.options);if(t===O(this,me))return;const n=O(this,me);q(this,me,t),q(this,No,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},n1=function(t){Ye.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(O(this,lt))}),O(this,mt).getQueryCache().notify({query:O(this,me),type:"observerResultsUpdated"})})},Up);function bE(e,t){return Ht(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Sp(e,t){return bE(e,t)||e.state.data!==void 0&&_c(e,t,t.refetchOnMount)}function _c(e,t,n){if(Ht(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Tc(e,t)}return!1}function Lp(e,t,n,r){return(e!==t||Ht(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Tc(e,n)}function Tc(e,t){return Ht(t.enabled,e)!==!1&&e.isStaleByTime(Mr(t.staleTime,e))}function yE(e,t){return!fi(e.getCurrentResult(),t)}var CE=(Kp=class extends Rr{constructor(n,r){super();se(this,dn);se(this,On);se(this,Dn);se(this,bt);se(this,un);q(this,On,n),this.setOptions(r),this.bindMethods(),he(this,dn,Ii).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=O(this,On).defaultMutationOptions(n),fi(this.options,r)||O(this,On).getMutationCache().notify({type:"observerOptionsUpdated",mutation:O(this,bt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&$n(r.mutationKey)!==$n(this.options.mutationKey)?this.reset():((o=O(this,bt))==null?void 0:o.state.status)==="pending"&&O(this,bt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=O(this,bt))==null||n.removeObserver(this)}onMutationUpdate(n){he(this,dn,Ii).call(this),he(this,dn,Xc).call(this,n)}getCurrentResult(){return O(this,Dn)}reset(){var n;(n=O(this,bt))==null||n.removeObserver(this),q(this,bt,void 0),he(this,dn,Ii).call(this),he(this,dn,Xc).call(this)}mutate(n,r){var o;return q(this,un,r),(o=O(this,bt))==null||o.removeObserver(this),q(this,bt,O(this,On).getMutationCache().build(O(this,On),this.options)),O(this,bt).addObserver(this),O(this,bt).execute(n)}},On=new WeakMap,Dn=new WeakMap,bt=new WeakMap,un=new WeakMap,dn=new WeakSet,Ii=function(){var r;const n=((r=O(this,bt))==null?void 0:r.state)??Ap();q(this,Dn,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Xc=function(n){Ye.batch(()=>{var r,o,s,i,a,l,c,u;if(O(this,un)&&this.hasListeners()){const p=O(this,Dn).variables,g=O(this,Dn).context;(n==null?void 0:n.type)==="success"?((o=(r=O(this,un)).onSuccess)==null||o.call(r,n.data,p,g),(i=(s=O(this,un)).onSettled)==null||i.call(s,n.data,null,p,g)):(n==null?void 0:n.type)==="error"&&((l=(a=O(this,un)).onError)==null||l.call(a,n.error,p,g),(u=(c=O(this,un)).onSettled)==null||u.call(c,void 0,n.error,p,g))}this.listeners.forEach(p=>{p(O(this,Dn))})})},Kp),Op=N.createContext(void 0),Dp=e=>{const t=N.useContext(Op);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},vE=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),m.jsx(Op.Provider,{value:e,children:t})),Fp=N.createContext(!1),xE=()=>N.useContext(Fp);Fp.Provider;function EE(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var IE=N.createContext(EE()),wE=()=>N.useContext(IE);function kp(e,t){return typeof e=="function"?e(...t):!!e}function Sc(){}var AE=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},_E=e=>{N.useEffect(()=>{e.clearReset()},[e])},TE=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||kp(n,[e.error,r])),SE=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},LE=(e,t)=>e.isLoading&&e.isFetching&&!t,OE=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Np=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function DE(e,t,n){var p,g,E,y,d;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=Dp(),o=xE(),s=wE(),i=r.defaultQueryOptions(e);(g=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||g.call(p,i),process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),i._optimisticResults=o?"isRestoring":"optimistic",SE(i),AE(i,s),_E(s);const a=!r.getQueryCache().get(i.queryHash),[l]=N.useState(()=>new t(r,i)),c=l.getOptimisticResult(i),u=!o&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(f=>{const h=u?l.subscribe(Ye.batchCalls(f)):Sc;return l.updateResult(),h},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),N.useEffect(()=>{l.setOptions(i,{listeners:!1})},[i,l]),OE(i,c))throw Np(i,l,s);if(TE({result:c,errorResetBoundary:s,throwOnError:i.throwOnError,query:r.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw c.error;if((y=(E=r.getDefaultOptions().queries)==null?void 0:E._experimental_afterQuery)==null||y.call(E,i,c),i.experimental_prefetchInRender&&!qn&&LE(c,o)){const f=a?Np(i,l,s):(d=r.getQueryCache().get(i.queryHash))==null?void 0:d.promise;f==null||f.catch(Sc).finally(()=>{l.updateResult()})}return i.notifyOnChangeProps?c:l.trackResult(c)}function Lc(e,t){return DE(e,mE)}function Oc(e,t){const n=Dp(),[r]=N.useState(()=>new CE(n,e));N.useEffect(()=>{r.setOptions(e)},[r,e]);const o=N.useSyncExternalStore(N.useCallback(i=>r.subscribe(Ye.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=N.useCallback((i,a)=>{r.mutate(i,a).catch(Sc)},[r]);if(o.error&&kp(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const FE=e=>new Promise(t=>setTimeout(t,e)),kE=({apiFn:e,intervalMillis:t,maxRetries:n,isSatisfied:r})=>(...s)=>{const i=async(a=0)=>{const l=await e(...s);if(r(l))return l;if(a>=n)throw l;return a++,FE(t).then(()=>i(a))};return i()},NE=async({conversationId:e,senderEmail:t})=>{try{const n=await ze({url:Cr(a6,{conversationId:e}),params:{senderEmail:t},method:nt.GET});return n==null?void 0:n.data}catch(n){throw console.error(n),n}},Rp=({conversationId:e,senderEmail:t,enabled:n})=>Lc({queryKey:["Global","ConversationMetaData",e,t],queryFn:()=>NE({conversationId:e,senderEmail:t}),refetchOnMount:!1,enabled:n}),Mp="/v1/api",RE=`${Mp}/connectors/forms/:formId/search`,ME=`${Mp}/connectors/conversation/:conversationId/smart-suggestions`,PE=e=>{if(e.status!=="completed")return e;const t=e.smart_suggestions??[],n=[];for(const r of t)n.push({label:r.search_string,description:`${r.connector_name??""} - ${r.object_name??""}`,avatarUrl:r.connector_logo,value:r.form_id,connectorName:r.connector_name,objectName:r.object_name});return{...e,suggestedOptions:n}},BE=kE({apiFn:async({conversationId:e})=>{try{const t=await ze({url:Cr(ME,{conversationId:e}),method:nt.GET}),n=t==null?void 0:t.data;return PE(n)}catch(t){throw console.error(t),t}},intervalMillis:1500,maxRetries:5,isSatisfied:e=>e.status!=="pending"}),jE=({conversationId:e,senderEmail:t,enabled:n})=>{const{isSuccess:r}=Rp({conversationId:e,senderEmail:t,enabled:n});return Lc({queryKey:["GlobalSearch","SmartSuggestions",e],queryFn:()=>BE({conversationId:e}),enabled:n&&r})},VE=({selectedObject:e,root:t,setSelectedObject:n,fetchSearchResults:r,onReset:o})=>{const[s,i]=_.useState(""),{conversationId:a,email:l,availableFeatures:c}=_.useContext(Ve),u=be(Lx),p=be(fp),g=tt(c,pm),{sortedObjectList:E,updatePriority:y}=qx({objectList:u}),{data:d}=jE({enabled:g&&!!a,conversationId:String(a),senderEmail:l}),f=(d==null?void 0:d.suggestedOptions)??[],h=_.useMemo(()=>!p||!E.length?[]:E.map(({value:C})=>{const I=p[C];return I?{description:`${I.connectorName??""} - ${I.searchObject}`,avatarUrl:I.logoUrl,label:"",value:C,connectorName:I.connectorName,objectName:I.searchObject}:null}).filter(C=>!!C),[E,p]),v=C=>{n(C),C&&y(""+C.value)};return h.length?m.jsxs(b.Stack,{children:[m.jsx(Yx,{value:e,options:h.map(C=>({...C,label:s})),inputValue:s,root:t,onInputChange:i,onChange:v,onReset:o,NoOptionsMessage:({selectOption:C})=>m.jsx(eE,{selectedOption:e,onSelect:C,options:f}),menuOpen:!s&&!f.length?!1:void 0}),e?m.jsx(Qx,{objectId:e.value,searchString:e.label,fetchSearchResults:r},e.value):null]}):null},GE="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.00483%2012.5052C7.73146%2012.7786%207.73146%2013.2218%208.00483%2013.4952C8.2782%2013.7685%208.72141%2013.7685%208.99478%2013.4952L11.9948%2010.4952C12.2681%2010.2218%2012.2681%209.77859%2011.9948%209.50522L8.99478%206.50522C8.72141%206.23185%208.2782%206.23185%208.00483%206.50522C7.73146%206.77859%207.73146%207.2218%208.00483%207.49517L10.5099%2010.0002L8.00483%2012.5052Z'%20fill='%236C7B94'/%3e%3c/svg%3e",HE=async({id:e,externalResourceId:t,conversationId:n,channelType:r="email"})=>{const o=new URLSearchParams;o.append("channel_type",r),await ze({url:`${u6.replace(":id",e)}?${o.toString()}`,method:nt.POST,data:{externalResourceId:t,conversationId:n}})},WE=({onSuccess:e})=>Oc({mutationFn:HE,onSuccess:()=>{Re({message:Ly,type:sn}),e==null||e()},onError:()=>{Re({message:Oy,type:at})}}),ZE="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_8444_63907)'%3e%3cpath%20d='M7.99967%2013.333L8.93967%2012.393L5.21968%208.66634H13.333V7.33301L5.21968%207.33301L8.93967%203.60634L7.99967%202.66634L2.66634%207.99967L7.99967%2013.333Z'%20fill='%23343C45'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_8444_63907'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='matrix(-1%200%200%20-1%2016%2016)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",XE=b.styled(b.Stack)`
1261
+ `,eE=({onSelect:e,selectedOption:t,options:n})=>n.length?m.jsxs($x,{children:[m.jsx(Ux,{children:Nx}),m.jsx(Kx,{children:Rx}),n.map(r=>m.jsx(pp,{suggestionType:"smart",data:r,isSelected:t===r,onSelect:e},r.label+r.description))]}):null;var Rr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},qn=typeof window>"u"||"Deno"in globalThis;function Ot(){}function tE(e,t){return typeof e=="function"?e(t):e}function yc(e){return typeof e=="number"&&e>=0&&e!==1/0}function hp(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Mr(e,t){return typeof e=="function"?e(t):e}function Ht(e,t){return typeof e=="function"?e(t):e}function gp(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Cc(i,t.options))return!1}else if(!Oo(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function mp(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if($n(t.options.mutationKey)!==$n(s))return!1}else if(!Oo(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Cc(e,t){return((t==null?void 0:t.queryKeyHashFn)||$n)(e)}function $n(e){return JSON.stringify(e,(t,n)=>xc(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Oo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Oo(e[n],t[n])):!1}function vc(e,t){if(e===t)return e;const n=bp(e)&&bp(t);if(n||xc(e)&&xc(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{};let l=0;for(let c=0;c<i;c++){const u=n?c:s[c];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=vc(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===i&&l===o?e:a}return t}function fi(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function bp(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function xc(e){if(!yp(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!yp(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function yp(e){return Object.prototype.toString.call(e)==="[object Object]"}function nE(e){return new Promise(t=>{setTimeout(t,e)})}function Ec(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return vc(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return vc(e,t)}return t}function rE(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function oE(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var pi=Symbol();function Cp(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===pi&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===pi?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var sE=(Zp=class extends Rr{constructor(){super();se(this,Un);se(this,wn);se(this,Pr);q(this,Pr,t=>{if(!qn&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){O(this,wn)||this.setEventListener(O(this,Pr))}onUnsubscribe(){var t;this.hasListeners()||((t=O(this,wn))==null||t.call(this),q(this,wn,void 0))}setEventListener(t){var n;q(this,Pr,t),(n=O(this,wn))==null||n.call(this),q(this,wn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){O(this,Un)!==t&&(q(this,Un,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof O(this,Un)=="boolean"?O(this,Un):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Un=new WeakMap,wn=new WeakMap,Pr=new WeakMap,Zp),Ic=new sE,iE=(Xp=class extends Rr{constructor(){super();se(this,Br,!0);se(this,An);se(this,jr);q(this,jr,t=>{if(!qn&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){O(this,An)||this.setEventListener(O(this,jr))}onUnsubscribe(){var t;this.hasListeners()||((t=O(this,An))==null||t.call(this),q(this,An,void 0))}setEventListener(t){var n;q(this,jr,t),(n=O(this,An))==null||n.call(this),q(this,An,t(this.setOnline.bind(this)))}setOnline(t){O(this,Br)!==t&&(q(this,Br,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return O(this,Br)}},Br=new WeakMap,An=new WeakMap,jr=new WeakMap,Xp),hi=new iE;function wc(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function aE(e){return Math.min(1e3*2**e,3e4)}function vp(e){return(e??"online")==="online"?hi.isOnline():!0}var xp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ac(e){return e instanceof xp}function Ep(e){let t=!1,n=0,r=!1,o;const s=wc(),i=d=>{var f;r||(g(new xp(d)),(f=e.abort)==null||f.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>Ic.isFocused()&&(e.networkMode==="always"||hi.isOnline())&&e.canRun(),u=()=>vp(e.networkMode)&&e.canRun(),p=d=>{var f;r||(r=!0,(f=e.onSuccess)==null||f.call(e,d),o==null||o(),s.resolve(d))},g=d=>{var f;r||(r=!0,(f=e.onError)==null||f.call(e,d),o==null||o(),s.reject(d))},E=()=>new Promise(d=>{var f;o=h=>{(r||c())&&d(h)},(f=e.onPause)==null||f.call(e)}).then(()=>{var d;o=void 0,r||(d=e.onContinue)==null||d.call(e)}),y=()=>{if(r)return;let d;const f=n===0?e.initialPromise:void 0;try{d=f??e.fn()}catch(h){d=Promise.reject(h)}Promise.resolve(d).then(p).catch(h=>{var w;if(r)return;const v=e.retry??(qn?0:3),C=e.retryDelay??aE,I=typeof C=="function"?C(n,h):C,x=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,h);if(t||!x){g(h);return}n++,(w=e.onFail)==null||w.call(e,n,h),nE(I).then(()=>c()?void 0:E()).then(()=>{t?g(h):y()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?y():E().then(y),s)}}function cE(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Ye=cE(),Ip=(zp=class{constructor(){se(this,Kn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),yc(this.gcTime)&&q(this,Kn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(qn?1/0:5*60*1e3))}clearGcTimeout(){O(this,Kn)&&(clearTimeout(O(this,Kn)),q(this,Kn,void 0))}},Kn=new WeakMap,zp),lE=(Yp=class extends Ip{constructor(t){super();se(this,Wt);se(this,Vr);se(this,Gr);se(this,Dt);se(this,er);se(this,ot);se(this,Fo);se(this,tr);q(this,tr,!1),q(this,Fo,t.defaultOptions),this.setOptions(t.options),this.observers=[],q(this,er,t.client),q(this,Dt,O(this,er).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,q(this,Vr,uE(this.options)),this.state=t.state??O(this,Vr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=O(this,ot))==null?void 0:t.promise}setOptions(t){this.options={...O(this,Fo),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&O(this,Dt).remove(this)}setData(t,n){const r=Ec(this.state.data,t,this.options);return he(this,Wt,gn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){he(this,Wt,gn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=O(this,ot))==null?void 0:r.promise;return(o=O(this,ot))==null||o.cancel(t),n?n.then(Ot).catch(Ot):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(O(this,Vr))}isActive(){return this.observers.some(t=>Ht(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===pi||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!hp(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=O(this,ot))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=O(this,ot))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),O(this,Dt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(O(this,ot)&&(O(this,tr)?O(this,ot).cancel({revert:!0}):O(this,ot).cancelRetry()),this.scheduleGc()),O(this,Dt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||he(this,Wt,gn).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(O(this,ot))return O(this,ot).continueRetry(),O(this,ot).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(g=>g.options.queryFn);p&&this.setOptions(p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(q(this,tr,!0),r.signal)})},s=()=>{const p=Cp(this.options,n),g={client:O(this,er),queryKey:this.queryKey,meta:this.meta};return o(g),q(this,tr,!1),this.options.persister?this.options.persister(p,g,this):p(g)},i={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:O(this,er),state:this.state,fetchFn:s};o(i),(l=this.options.behavior)==null||l.onFetch(i,this),q(this,Gr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=i.fetchOptions)==null?void 0:c.meta))&&he(this,Wt,gn).call(this,{type:"fetch",meta:(u=i.fetchOptions)==null?void 0:u.meta});const a=p=>{var g,E,y,d;Ac(p)&&p.silent||he(this,Wt,gn).call(this,{type:"error",error:p}),Ac(p)||((E=(g=O(this,Dt).config).onError)==null||E.call(g,p,this),(d=(y=O(this,Dt).config).onSettled)==null||d.call(y,this.state.data,p,this)),this.scheduleGc()};return q(this,ot,Ep({initialPromise:n==null?void 0:n.initialPromise,fn:i.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var g,E,y,d;if(p===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(f){a(f);return}(E=(g=O(this,Dt).config).onSuccess)==null||E.call(g,p,this),(d=(y=O(this,Dt).config).onSettled)==null||d.call(y,p,this.state.error,this),this.scheduleGc()},onError:a,onFail:(p,g)=>{he(this,Wt,gn).call(this,{type:"failed",failureCount:p,error:g})},onPause:()=>{he(this,Wt,gn).call(this,{type:"pause"})},onContinue:()=>{he(this,Wt,gn).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0})),O(this,ot).start()}},Vr=new WeakMap,Gr=new WeakMap,Dt=new WeakMap,er=new WeakMap,ot=new WeakMap,Fo=new WeakMap,tr=new WeakMap,Wt=new WeakSet,gn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...wp(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Ac(o)&&o.revert&&O(this,Gr)?{...O(this,Gr),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ye.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),O(this,Dt).notify({query:this,type:"updated",action:t})})},Yp);function wp(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vp(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uE(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var dE=(Jp=class extends Rr{constructor(t={}){super();se(this,Ut);this.config=t,q(this,Ut,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Cc(o,n);let i=this.get(s);return i||(i=new lE({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){O(this,Ut).has(t.queryHash)||(O(this,Ut).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=O(this,Ut).get(t.queryHash);n&&(t.destroy(),n===t&&O(this,Ut).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ye.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return O(this,Ut).get(t)}getAll(){return[...O(this,Ut).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>gp(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>gp(t,r)):n}notify(t){Ye.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ye.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ye.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ut=new WeakMap,Jp),fE=(Qp=class extends Ip{constructor(t){super();se(this,en);se(this,Kt);se(this,ct);se(this,nr);this.mutationId=t.mutationId,q(this,ct,t.mutationCache),q(this,Kt,[]),this.state=t.state||Ap(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){O(this,Kt).includes(t)||(O(this,Kt).push(t),this.clearGcTimeout(),O(this,ct).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){q(this,Kt,O(this,Kt).filter(n=>n!==t)),this.scheduleGc(),O(this,ct).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){O(this,Kt).length||(this.state.status==="pending"?this.scheduleGc():O(this,ct).remove(this))}continue(){var t;return((t=O(this,nr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,i,a,l,c,u,p,g,E,y,d,f,h,v,C,I,x,w,T;q(this,nr,Ep({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,S)=>{he(this,en,Rn).call(this,{type:"failed",failureCount:A,error:S})},onPause:()=>{he(this,en,Rn).call(this,{type:"pause"})},onContinue:()=>{he(this,en,Rn).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>O(this,ct).canRun(this)}));const n=this.state.status==="pending",r=!O(this,nr).canStart();try{if(!n){he(this,en,Rn).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(o=O(this,ct).config).onMutate)==null?void 0:s.call(o,t,this));const S=await((a=(i=this.options).onMutate)==null?void 0:a.call(i,t));S!==this.state.context&&he(this,en,Rn).call(this,{type:"pending",context:S,variables:t,isPaused:r})}const A=await O(this,nr).start();return await((c=(l=O(this,ct).config).onSuccess)==null?void 0:c.call(l,A,t,this.state.context,this)),await((p=(u=this.options).onSuccess)==null?void 0:p.call(u,A,t,this.state.context)),await((E=(g=O(this,ct).config).onSettled)==null?void 0:E.call(g,A,null,this.state.variables,this.state.context,this)),await((d=(y=this.options).onSettled)==null?void 0:d.call(y,A,null,t,this.state.context)),he(this,en,Rn).call(this,{type:"success",data:A}),A}catch(A){try{throw await((h=(f=O(this,ct).config).onError)==null?void 0:h.call(f,A,t,this.state.context,this)),await((C=(v=this.options).onError)==null?void 0:C.call(v,A,t,this.state.context)),await((x=(I=O(this,ct).config).onSettled)==null?void 0:x.call(I,void 0,A,this.state.variables,this.state.context,this)),await((T=(w=this.options).onSettled)==null?void 0:T.call(w,void 0,A,t,this.state.context)),A}finally{he(this,en,Rn).call(this,{type:"error",error:A})}}finally{O(this,ct).runNext(this)}}},Kt=new WeakMap,ct=new WeakMap,nr=new WeakMap,en=new WeakSet,Rn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ye.batch(()=>{O(this,Kt).forEach(r=>{r.onMutationUpdate(t)}),O(this,ct).notify({mutation:this,type:"updated",action:t})})},Qp);function Ap(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pE=(qp=class extends Rr{constructor(t={}){super();se(this,ln);se(this,Zt);se(this,ko);this.config=t,q(this,ln,new Set),q(this,Zt,new Map),q(this,ko,0)}build(t,n,r){const o=new fE({mutationCache:this,mutationId:++Ei(this,ko)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){O(this,ln).add(t);const n=gi(t);if(typeof n=="string"){const r=O(this,Zt).get(n);r?r.push(t):O(this,Zt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(O(this,ln).delete(t)){const n=gi(t);if(typeof n=="string"){const r=O(this,Zt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&O(this,Zt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=gi(t);if(typeof n=="string"){const r=O(this,Zt).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=gi(t);if(typeof n=="string"){const o=(r=O(this,Zt).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ye.batch(()=>{O(this,ln).forEach(t=>{this.notify({type:"removed",mutation:t})}),O(this,ln).clear(),O(this,Zt).clear()})}getAll(){return Array.from(O(this,ln))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>mp(n,r))}findAll(t={}){return this.getAll().filter(n=>mp(t,n))}notify(t){Ye.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ye.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ot))))}},ln=new WeakMap,Zt=new WeakMap,ko=new WeakMap,qp);function gi(e){var t;return(t=e.options.scope)==null?void 0:t.id}function _p(e){return{onFetch:(t,n)=>{var u,p,g,E,y;const r=t.options,o=(g=(p=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:p.fetchMore)==null?void 0:g.direction,s=((E=t.state.data)==null?void 0:E.pages)||[],i=((y=t.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let d=!1;const f=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?d=!0:t.signal.addEventListener("abort",()=>{d=!0}),t.signal)})},h=Cp(t.options,t.fetchOptions),v=async(C,I,x)=>{if(d)return Promise.reject();if(I==null&&C.pages.length)return Promise.resolve(C);const w={client:t.client,queryKey:t.queryKey,pageParam:I,direction:x?"backward":"forward",meta:t.options.meta};f(w);const T=await h(w),{maxPages:A}=t.options,S=x?oE:rE;return{pages:S(C.pages,T,A),pageParams:S(C.pageParams,I,A)}};if(o&&s.length){const C=o==="backward",I=C?hE:Tp,x={pages:s,pageParams:i},w=I(r,x);a=await v(x,w,C)}else{const C=e??s.length;do{const I=l===0?i[0]??r.initialPageParam:Tp(r,a);if(l>0&&I==null)break;a=await v(a,I),l++}while(l<C)}return a};t.options.persister?t.fetchFn=()=>{var d,f;return(f=(d=t.options).persister)==null?void 0:f.call(d,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Tp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function hE(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var gE=($p=class{constructor(e={}){se(this,je);se(this,_n);se(this,Tn);se(this,Hr);se(this,Wr);se(this,Sn);se(this,Zr);se(this,Xr);q(this,je,e.queryCache||new dE),q(this,_n,e.mutationCache||new pE),q(this,Tn,e.defaultOptions||{}),q(this,Hr,new Map),q(this,Wr,new Map),q(this,Sn,0)}mount(){Ei(this,Sn)._++,O(this,Sn)===1&&(q(this,Zr,Ic.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,je).onFocus())})),q(this,Xr,hi.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,je).onOnline())})))}unmount(){var e,t;Ei(this,Sn)._--,O(this,Sn)===0&&((e=O(this,Zr))==null||e.call(this),q(this,Zr,void 0),(t=O(this,Xr))==null||t.call(this),q(this,Xr,void 0))}isFetching(e){return O(this,je).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return O(this,_n).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=O(this,je).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=O(this,je).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Mr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return O(this,je).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=O(this,je).get(r.queryHash),s=o==null?void 0:o.state.data,i=tE(t,s);if(i!==void 0)return O(this,je).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Ye.batch(()=>O(this,je).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=O(this,je).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=O(this,je);Ye.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=O(this,je);return Ye.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ye.batch(()=>O(this,je).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ot).catch(Ot)}invalidateQueries(e,t={}){return Ye.batch(()=>(O(this,je).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ye.batch(()=>O(this,je).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ot)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ot)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=O(this,je).build(this,t);return n.isStaleByTime(Mr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ot).catch(Ot)}fetchInfiniteQuery(e){return e.behavior=_p(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ot).catch(Ot)}ensureInfiniteQueryData(e){return e.behavior=_p(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return hi.isOnline()?O(this,_n).resumePausedMutations():Promise.resolve()}getQueryCache(){return O(this,je)}getMutationCache(){return O(this,_n)}getDefaultOptions(){return O(this,Tn)}setDefaultOptions(e){q(this,Tn,e)}setQueryDefaults(e,t){O(this,Hr).set($n(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...O(this,Hr).values()],n={};return t.forEach(r=>{Oo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){O(this,Wr).set($n(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...O(this,Wr).values()],n={};return t.forEach(r=>{Oo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...O(this,Tn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Cc(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===pi&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...O(this,Tn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){O(this,je).clear(),O(this,_n).clear()}},je=new WeakMap,_n=new WeakMap,Tn=new WeakMap,Hr=new WeakMap,Wr=new WeakMap,Sn=new WeakMap,Zr=new WeakMap,Xr=new WeakMap,$p),mE=(Up=class extends Rr{constructor(t,n){super();se(this,_e);se(this,mt);se(this,me);se(this,No);se(this,lt);se(this,rr);se(this,zr);se(this,Ln);se(this,tn);se(this,Ro);se(this,Yr);se(this,Jr);se(this,or);se(this,sr);se(this,On);se(this,Qr,new Set);this.options=n,q(this,mt,t),q(this,tn,null),q(this,Ln,wc()),this.options.experimental_prefetchInRender||O(this,Ln).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(O(this,me).addObserver(this),Sp(O(this,me),this.options)?he(this,_e,Ho).call(this):this.updateResult(),he(this,_e,Gc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _c(O(this,me),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _c(O(this,me),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,he(this,_e,Hc).call(this),he(this,_e,Wc).call(this),O(this,me).removeObserver(this)}setOptions(t,n){const r=this.options,o=O(this,me);if(this.options=O(this,mt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ht(this.options.enabled,O(this,me))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");he(this,_e,Zc).call(this),O(this,me).setOptions(this.options),r._defaulted&&!fi(this.options,r)&&O(this,mt).getQueryCache().notify({type:"observerOptionsUpdated",query:O(this,me),observer:this});const s=this.hasListeners();s&&Lp(O(this,me),o,this.options,r)&&he(this,_e,Ho).call(this),this.updateResult(n),s&&(O(this,me)!==o||Ht(this.options.enabled,O(this,me))!==Ht(r.enabled,O(this,me))||Mr(this.options.staleTime,O(this,me))!==Mr(r.staleTime,O(this,me)))&&he(this,_e,Bc).call(this);const i=he(this,_e,jc).call(this);s&&(O(this,me)!==o||Ht(this.options.enabled,O(this,me))!==Ht(r.enabled,O(this,me))||i!==O(this,On))&&he(this,_e,Vc).call(this,i)}getOptimisticResult(t){const n=O(this,mt).getQueryCache().build(O(this,mt),t),r=this.createResult(n,t);return yE(this,r)&&(q(this,lt,r),q(this,zr,this.options),q(this,rr,O(this,me).state)),r}getCurrentResult(){return O(this,lt)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){O(this,Qr).add(t)}getCurrentQuery(){return O(this,me)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=O(this,mt).defaultQueryOptions(t),r=O(this,mt).getQueryCache().build(O(this,mt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return he(this,_e,Ho).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),O(this,lt)))}createResult(t,n){var A;const r=O(this,me),o=this.options,s=O(this,lt),i=O(this,rr),a=O(this,zr),c=t!==r?t.state:O(this,No),{state:u}=t;let p={...u},g=!1,E;if(n._optimisticResults){const S=this.hasListeners(),F=!S&&Sp(t,n),D=S&&Lp(t,r,n,o);(F||D)&&(p={...p,...wp(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:y,errorUpdatedAt:d,status:f}=p;if(n.select&&p.data!==void 0)if(s&&p.data===(i==null?void 0:i.data)&&n.select===O(this,Ro))E=O(this,Yr);else try{q(this,Ro,n.select),E=n.select(p.data),E=Ec(s==null?void 0:s.data,E,n),q(this,Yr,E),q(this,tn,null)}catch(S){q(this,tn,S)}else E=p.data;if(n.placeholderData!==void 0&&E===void 0&&f==="pending"){let S;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))S=s.data;else if(S=typeof n.placeholderData=="function"?n.placeholderData((A=O(this,Jr))==null?void 0:A.state.data,O(this,Jr)):n.placeholderData,n.select&&S!==void 0)try{S=n.select(S),q(this,tn,null)}catch(F){q(this,tn,F)}S!==void 0&&(f="success",E=Ec(s==null?void 0:s.data,S,n),g=!0)}O(this,tn)&&(y=O(this,tn),E=O(this,Yr),d=Date.now(),f="error");const h=p.fetchStatus==="fetching",v=f==="pending",C=f==="error",I=v&&h,x=E!==void 0,T={status:f,fetchStatus:p.fetchStatus,isPending:v,isSuccess:f==="success",isError:C,isInitialLoading:I,isLoading:I,data:E,dataUpdatedAt:p.dataUpdatedAt,error:y,errorUpdatedAt:d,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>c.dataUpdateCount||p.errorUpdateCount>c.errorUpdateCount,isFetching:h,isRefetching:h&&!v,isLoadingError:C&&!x,isPaused:p.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:C&&x,isStale:Tc(t,n),refetch:this.refetch,promise:O(this,Ln)};if(this.options.experimental_prefetchInRender){const S=k=>{T.status==="error"?k.reject(T.error):T.data!==void 0&&k.resolve(T.data)},F=()=>{const k=q(this,Ln,T.promise=wc());S(k)},D=O(this,Ln);switch(D.status){case"pending":t.queryHash===r.queryHash&&S(D);break;case"fulfilled":(T.status==="error"||T.data!==D.value)&&F();break;case"rejected":(T.status!=="error"||T.error!==D.reason)&&F();break}}return T}updateResult(t){const n=O(this,lt),r=this.createResult(O(this,me),this.options);if(q(this,rr,O(this,me).state),q(this,zr,this.options),O(this,rr).data!==void 0&&q(this,Jr,O(this,me)),fi(r,n))return;q(this,lt,r);const o={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!O(this,Qr).size)return!0;const l=new Set(a??O(this,Qr));return this.options.throwOnError&&l.add("error"),Object.keys(O(this,lt)).some(c=>{const u=c;return O(this,lt)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&s()&&(o.listeners=!0),he(this,_e,n1).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&he(this,_e,Gc).call(this)}},mt=new WeakMap,me=new WeakMap,No=new WeakMap,lt=new WeakMap,rr=new WeakMap,zr=new WeakMap,Ln=new WeakMap,tn=new WeakMap,Ro=new WeakMap,Yr=new WeakMap,Jr=new WeakMap,or=new WeakMap,sr=new WeakMap,On=new WeakMap,Qr=new WeakMap,_e=new WeakSet,Ho=function(t){he(this,_e,Zc).call(this);let n=O(this,me).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ot)),n},Bc=function(){he(this,_e,Hc).call(this);const t=Mr(this.options.staleTime,O(this,me));if(qn||O(this,lt).isStale||!yc(t))return;const r=hp(O(this,lt).dataUpdatedAt,t)+1;q(this,or,setTimeout(()=>{O(this,lt).isStale||this.updateResult()},r))},jc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(O(this,me)):this.options.refetchInterval)??!1},Vc=function(t){he(this,_e,Wc).call(this),q(this,On,t),!(qn||Ht(this.options.enabled,O(this,me))===!1||!yc(O(this,On))||O(this,On)===0)&&q(this,sr,setInterval(()=>{(this.options.refetchIntervalInBackground||Ic.isFocused())&&he(this,_e,Ho).call(this)},O(this,On)))},Gc=function(){he(this,_e,Bc).call(this),he(this,_e,Vc).call(this,he(this,_e,jc).call(this))},Hc=function(){O(this,or)&&(clearTimeout(O(this,or)),q(this,or,void 0))},Wc=function(){O(this,sr)&&(clearInterval(O(this,sr)),q(this,sr,void 0))},Zc=function(){const t=O(this,mt).getQueryCache().build(O(this,mt),this.options);if(t===O(this,me))return;const n=O(this,me);q(this,me,t),q(this,No,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},n1=function(t){Ye.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(O(this,lt))}),O(this,mt).getQueryCache().notify({query:O(this,me),type:"observerResultsUpdated"})})},Up);function bE(e,t){return Ht(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Sp(e,t){return bE(e,t)||e.state.data!==void 0&&_c(e,t,t.refetchOnMount)}function _c(e,t,n){if(Ht(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Tc(e,t)}return!1}function Lp(e,t,n,r){return(e!==t||Ht(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Tc(e,n)}function Tc(e,t){return Ht(t.enabled,e)!==!1&&e.isStaleByTime(Mr(t.staleTime,e))}function yE(e,t){return!fi(e.getCurrentResult(),t)}var CE=(Kp=class extends Rr{constructor(n,r){super();se(this,dn);se(this,Dn);se(this,Fn);se(this,bt);se(this,un);q(this,Dn,n),this.setOptions(r),this.bindMethods(),he(this,dn,Ii).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=O(this,Dn).defaultMutationOptions(n),fi(this.options,r)||O(this,Dn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:O(this,bt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&$n(r.mutationKey)!==$n(this.options.mutationKey)?this.reset():((o=O(this,bt))==null?void 0:o.state.status)==="pending"&&O(this,bt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=O(this,bt))==null||n.removeObserver(this)}onMutationUpdate(n){he(this,dn,Ii).call(this),he(this,dn,Xc).call(this,n)}getCurrentResult(){return O(this,Fn)}reset(){var n;(n=O(this,bt))==null||n.removeObserver(this),q(this,bt,void 0),he(this,dn,Ii).call(this),he(this,dn,Xc).call(this)}mutate(n,r){var o;return q(this,un,r),(o=O(this,bt))==null||o.removeObserver(this),q(this,bt,O(this,Dn).getMutationCache().build(O(this,Dn),this.options)),O(this,bt).addObserver(this),O(this,bt).execute(n)}},Dn=new WeakMap,Fn=new WeakMap,bt=new WeakMap,un=new WeakMap,dn=new WeakSet,Ii=function(){var r;const n=((r=O(this,bt))==null?void 0:r.state)??Ap();q(this,Fn,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Xc=function(n){Ye.batch(()=>{var r,o,s,i,a,l,c,u;if(O(this,un)&&this.hasListeners()){const p=O(this,Fn).variables,g=O(this,Fn).context;(n==null?void 0:n.type)==="success"?((o=(r=O(this,un)).onSuccess)==null||o.call(r,n.data,p,g),(i=(s=O(this,un)).onSettled)==null||i.call(s,n.data,null,p,g)):(n==null?void 0:n.type)==="error"&&((l=(a=O(this,un)).onError)==null||l.call(a,n.error,p,g),(u=(c=O(this,un)).onSettled)==null||u.call(c,void 0,n.error,p,g))}this.listeners.forEach(p=>{p(O(this,Fn))})})},Kp),Op=N.createContext(void 0),Dp=e=>{const t=N.useContext(Op);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},vE=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),m.jsx(Op.Provider,{value:e,children:t})),Fp=N.createContext(!1),xE=()=>N.useContext(Fp);Fp.Provider;function EE(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var IE=N.createContext(EE()),wE=()=>N.useContext(IE);function kp(e,t){return typeof e=="function"?e(...t):!!e}function Sc(){}var AE=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},_E=e=>{N.useEffect(()=>{e.clearReset()},[e])},TE=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||kp(n,[e.error,r])),SE=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},LE=(e,t)=>e.isLoading&&e.isFetching&&!t,OE=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Np=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function DE(e,t,n){var p,g,E,y,d;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=Dp(),o=xE(),s=wE(),i=r.defaultQueryOptions(e);(g=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||g.call(p,i),process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),i._optimisticResults=o?"isRestoring":"optimistic",SE(i),AE(i,s),_E(s);const a=!r.getQueryCache().get(i.queryHash),[l]=N.useState(()=>new t(r,i)),c=l.getOptimisticResult(i),u=!o&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(f=>{const h=u?l.subscribe(Ye.batchCalls(f)):Sc;return l.updateResult(),h},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),N.useEffect(()=>{l.setOptions(i,{listeners:!1})},[i,l]),OE(i,c))throw Np(i,l,s);if(TE({result:c,errorResetBoundary:s,throwOnError:i.throwOnError,query:r.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw c.error;if((y=(E=r.getDefaultOptions().queries)==null?void 0:E._experimental_afterQuery)==null||y.call(E,i,c),i.experimental_prefetchInRender&&!qn&&LE(c,o)){const f=a?Np(i,l,s):(d=r.getQueryCache().get(i.queryHash))==null?void 0:d.promise;f==null||f.catch(Sc).finally(()=>{l.updateResult()})}return i.notifyOnChangeProps?c:l.trackResult(c)}function Lc(e,t){return DE(e,mE)}function Oc(e,t){const n=Dp(),[r]=N.useState(()=>new CE(n,e));N.useEffect(()=>{r.setOptions(e)},[r,e]);const o=N.useSyncExternalStore(N.useCallback(i=>r.subscribe(Ye.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=N.useCallback((i,a)=>{r.mutate(i,a).catch(Sc)},[r]);if(o.error&&kp(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const FE=e=>new Promise(t=>setTimeout(t,e)),kE=({apiFn:e,intervalMillis:t,maxRetries:n,isSatisfied:r})=>(...s)=>{const i=async(a=0)=>{const l=await e(...s);if(r(l))return l;if(a>=n)throw l;return a++,FE(t).then(()=>i(a))};return i()},NE=async({conversationId:e,senderEmail:t})=>{try{const n=await ze({url:Cr(a6,{conversationId:e}),params:{senderEmail:t},method:nt.GET});return n==null?void 0:n.data}catch(n){throw console.error(n),n}},Rp=({conversationId:e,senderEmail:t,enabled:n})=>Lc({queryKey:["Global","ConversationMetaData",e,t],queryFn:()=>NE({conversationId:e,senderEmail:t}),refetchOnMount:!1,enabled:n}),Mp="/v1/api",RE=`${Mp}/connectors/forms/:formId/search`,ME=`${Mp}/connectors/conversation/:conversationId/smart-suggestions`,PE=e=>{if(e.status!=="completed")return e;const t=e.smart_suggestions??[],n=[];for(const r of t)n.push({label:r.search_string,description:`${r.connector_name??""} - ${r.object_name??""}`,avatarUrl:r.connector_logo,value:r.form_id,connectorName:r.connector_name,objectName:r.object_name});return{...e,suggestedOptions:n}},BE=kE({apiFn:async({conversationId:e})=>{try{const t=await ze({url:Cr(ME,{conversationId:e}),method:nt.GET}),n=t==null?void 0:t.data;return PE(n)}catch(t){throw console.error(t),t}},intervalMillis:1500,maxRetries:5,isSatisfied:e=>e.status!=="pending"}),jE=({conversationId:e,senderEmail:t,enabled:n})=>{const{isSuccess:r}=Rp({conversationId:e,senderEmail:t,enabled:n});return Lc({queryKey:["GlobalSearch","SmartSuggestions",e],queryFn:()=>BE({conversationId:e}),enabled:n&&r})},VE=({selectedObject:e,root:t,setSelectedObject:n,fetchSearchResults:r,onReset:o})=>{const[s,i]=_.useState(""),{conversationId:a,email:l,availableFeatures:c}=_.useContext(Ve),u=be(Lx),p=be(fp),g=tt(c,pm),{sortedObjectList:E,updatePriority:y}=qx({objectList:u}),{data:d}=jE({enabled:g&&!!a,conversationId:String(a),senderEmail:l}),f=(d==null?void 0:d.suggestedOptions)??[],h=_.useMemo(()=>!p||!E.length?[]:E.map(({value:C})=>{const I=p[C];return I?{description:`${I.connectorName??""} - ${I.searchObject}`,avatarUrl:I.logoUrl,label:"",value:C,connectorName:I.connectorName,objectName:I.searchObject}:null}).filter(C=>!!C),[E,p]),v=C=>{n(C),C&&y(""+C.value)};return h.length?m.jsxs(b.Stack,{children:[m.jsx(Yx,{value:e,options:h.map(C=>({...C,label:s})),inputValue:s,root:t,onInputChange:i,onChange:v,onReset:o,NoOptionsMessage:({selectOption:C})=>m.jsx(eE,{selectedOption:e,onSelect:C,options:f}),menuOpen:!s&&!f.length?!1:void 0}),e?m.jsx(Qx,{objectId:e.value,searchString:e.label,fetchSearchResults:r},e.value):null]}):null},GE="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.00483%2012.5052C7.73146%2012.7786%207.73146%2013.2218%208.00483%2013.4952C8.2782%2013.7685%208.72141%2013.7685%208.99478%2013.4952L11.9948%2010.4952C12.2681%2010.2218%2012.2681%209.77859%2011.9948%209.50522L8.99478%206.50522C8.72141%206.23185%208.2782%206.23185%208.00483%206.50522C7.73146%206.77859%207.73146%207.2218%208.00483%207.49517L10.5099%2010.0002L8.00483%2012.5052Z'%20fill='%236C7B94'/%3e%3c/svg%3e",HE=async({id:e,externalResourceId:t,conversationId:n,channelType:r="email"})=>{const o=new URLSearchParams;o.append("channel_type",r),await ze({url:`${u6.replace(":id",e)}?${o.toString()}`,method:nt.POST,data:{externalResourceId:t,conversationId:n}})},WE=({onSuccess:e})=>Oc({mutationFn:HE,onSuccess:()=>{Re({message:Ly,type:sn}),e==null||e()},onError:()=>{Re({message:Oy,type:at})}}),ZE="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_8444_63907)'%3e%3cpath%20d='M7.99967%2013.333L8.93967%2012.393L5.21968%208.66634H13.333V7.33301L5.21968%207.33301L8.93967%203.60634L7.99967%202.66634L2.66634%207.99967L7.99967%2013.333Z'%20fill='%23343C45'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_8444_63907'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='matrix(-1%200%200%20-1%2016%2016)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",XE=b.styled(b.Stack)`
1262
1262
  width: fit-content;
1263
1263
  cursor: pointer;
1264
1264
  gap: 8px;
@@ -1289,7 +1289,7 @@ Do you want to continue?`,j6="Select an object to create",V6="Select an object t
1289
1289
  `,YE="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",JE=()=>m.jsxs(b.Box,{justifyItems:"center",marginTop:"40px",children:[m.jsx("img",{src:YE,width:124,height:107}),m.jsx(b.Typography,{variant:"body2",color:b.theme.palette.gray.gray3,children:Bx})]}),QE=({searchResults:e,selectedObject:t,onReset:n,fetchCards:r})=>{const o=jt(),{sendTrackingEvent:s,currentSmIds:i}=_.useContext(Ve),[a,l]=_.useState(null),c=Cr(Mx,{count:e.length.toString(),countSuffix:e.length>1?"s":"",searchObject:t.objectName,connectorName:t.connectorName}),u=(E,y)=>{s(Kg,{search_keyword:t.label,search_result_label:y,sm_ids:i,connector_name:t.connectorName}),l({externalResourceId:E,formId:t.value.toString(),searchKeyword:t.label,searchResultLabel:y})},p=()=>{l(null),o(m6())},g=()=>{n(),r(),p()};return e.length?a?m.jsx(zE,{meta:a,onBack:p,onLink:g}):m.jsxs(b.Stack,{gap:"14px",marginTop:"12px",children:[m.jsx(b.Typography,{variant:"body2",children:c}),m.jsx(b.Stack,{gap:"17px",children:e==null?void 0:e.map(({externalResourceId:E,name:y,description:d})=>m.jsxs(Pp,{onClick:()=>u(E,y),direction:"row",children:[m.jsxs(b.Stack,{flexGrow:1,children:[m.jsx(b.Typography,{variant:"body2",color:b.theme.palette.gray.gray1,children:y}),m.jsx(b.Typography,{variant:"caption",color:b.theme.palette.gray.gray3,children:d})]}),m.jsx(b.Box,{alignSelf:"center",className:"search-item__chevron",width:"20px",height:"20px",children:m.jsx("img",{src:GE})})]},E))})]}):m.jsx(JE,{})},Dc=b.styled(b.Skeleton)`
1290
1290
  display: block;
1291
1291
  margin: ${e=>e.margin?e.margin:0};
1292
- `,qE=()=>m.jsxs(b.Stack,{marginTop:"12px",children:[m.jsx(Dc,{variant:"rounded",width:"50%",height:"16px",animation:"wave",margin:"0 0 18px 0"}),m.jsx(b.Stack,{gap:"17px",children:m.jsxs(Pp,{gap:"8px",disableHover:!0,children:[m.jsx(Dc,{variant:"rounded",width:"30%",height:"16px",animation:"wave"}),m.jsx(Dc,{variant:"rounded",width:"70%",height:"16px",animation:"wave"})]})})]}),$E=async({id:e,searchString:t,args:n})=>{try{if(e===void 0||t===void 0)return[];const r=await ze({url:RE.replace(":formId",e.toString()),method:nt.POST,data:{search_string:t,args:n}});let o=null;return r!=null&&r.data&&"data"in r.data&&(o=r.data.data),o}catch(r){Re({message:Ss,type:at}),console.error(r)}},UE=(e,t)=>Oc({mutationFn:$E,onMutate:({searchString:n,connectorName:r})=>{e(n,r)},onSuccess:(n,{searchString:r,connectorName:o})=>{t(r,n,o)}}),Fc={OPEN_FORM_VIEW:"connector-agent-open-form-view"},KE=(e,t={})=>{const{delayAfterLoad:n=1e3}=t,r=_.useRef(!1),o=_.useRef(void 0),s=_.useCallback((l="auto")=>{const c=e.current;c&&c.scrollIntoView({behavior:l})},[e]),i=_.useCallback((l,c="smooth")=>{r.current||(o.current!==void 0&&clearTimeout(o.current),l&&(o.current=setTimeout(()=>{s(c),r.current=!0},n)))},[s,n]),a=_.useCallback(()=>{r.current=!1,o.current!==void 0&&clearTimeout(o.current)},[]);return _.useEffect(()=>()=>{o.current!==void 0&&clearTimeout(o.current)},[]),{scrollOnceAfterLoad:i,resetScrollState:a,hasScrolledOnce:r.current}},e8=({isAdmin:e=!1})=>{var vi;const{email:t,currentSmIds:n,sendTrackingEvent:r,availableFeatures:o,conversationId:s}=_.useContext(Ve),i=jt(),{userGroupId:a,userId:l}=Yt()||{},c=_.useRef(!1),u=_.useRef(null),p=_.useRef(null),g=_.useRef(null),[E,y]=_.useState(!1),[d,f]=_.useState(!1),[h,v]=_.useState(!1),[C,I]=_.useState(!1),[x,w]=_.useState(),[T,A]=_.useState(!1),[S,F]=_.useState(null),[D,k]=_.useState(),[M,j]=_.useState(null),[H,z]=_.useState(!1),[U,J]=_.useState(!1),Y=be(q6),ae=be($6),ue=be(K6),B=be(e7),W=be(U6),V=be(Hf),X=be(f7),$=be(Wf),ee=be(Zf),re=be(Xf),P=be(hx),te=tt(o,im),ye=tt(o,gu),Z=tt(o,fm),Me=tt(o,hm),ke=tt(o,gm),Je=tt(o,mm),Qe=Fm(ue),{data:fn,isLoading:yt}=Rp({senderEmail:t,conversationId:String(s),enabled:Me&&!!t}),{emailHeaders:st,selectedEmail:Ze}=fn??{},{scrollOnceAfterLoad:Fn,resetScrollState:Ft}=KE(p),qr=W!==K.LOADING&&(!B||!Object.values(B).some(Se=>Se===K.LOADING))&&Y&&Y.length>0;_.useLayoutEffect(()=>{var Se;H&&!E&&U&&((Se=g==null?void 0:g.current)!=null&&Se.scrollHeight)&&Fn(!!qr,"smooth")},[H,E,U,qr,Fn,(vi=g==null?void 0:g.current)==null?void 0:vi.scrollHeight,l]);const Mo=(Se,qe)=>{r(qg,{search_keyword:Se,sm_ids:n,connector_name:qe,suggestion_type:P})},ir=(Se,qe,Lt)=>{!Array.isArray(qe)||!qe.length?r($g,{search_keyword:Se,sm_ids:n,connector_name:Lt,suggestion_type:P}):qe.length&&r(Ug,{num_of_results:qe.length,search_keyword:Se,sm_ids:n,connector_name:Lt,suggestion_type:P})},{mutate:ar,reset:ce,data:Te,isPending:et,isIdle:Ct}=UE(Mo,ir),vt=_.useCallback(()=>{ce(),F(null)},[ce,F]),kt=_.useCallback(()=>{t&&n.length&&s&&i(di({inboxIds:n,conversationId:s}))},[i,t,n,s]),pn=_.useCallback((Se,qe)=>{Se&&s&&qe&&i(ui({id:Se,channelType:"email",conversationId:s,externalResourceId:qe,contactEmail:t})).unwrap().catch(()=>{i(kr(null))})},[i,s,t]);if(_.useEffect(()=>{(async()=>{l&&(z(await Bi(l)),J(await dl(l)))})()},[l]),_.useEffect(()=>{yt||k(Ze||t)},[t,Ze,yt]),_.useEffect(()=>{U&&l&&fl(l)},[U,l]),_.useEffect(()=>{var Se;if(ee){f(!0);const{externalResourceId:qe}=ee,Lt=(Se=ee.forms.find(ur=>ur.type==="edit"))==null?void 0:Se.id;pn(Lt,qe)}else f(!1),i(X6())},[ee,pn,i]),_.useEffect(()=>(kt(),Ft(),()=>{i(Vf.clearConnectorList())}),[i,kt,Ft]),_.useEffect(()=>(Y&&Y.length&&!c.current&&(r(wg,{numOfCards:Y.length,sm_ids:n}),c.current=!0),()=>{(!Y||!n||c.current)&&(c.current=!1)}),[Y,r,n]),_.useEffect(()=>{s&&n&&n.length&&i(si({inboxIds:n,conversationId:s,channelType:"email",isExpandedFormEnabled:Je}))},[i,n,s,Je]),_.useEffect(()=>{const Se=qe=>{var xi;if(!(qe instanceof CustomEvent))return;const Lt=(xi=qe.detail)==null?void 0:xi.connectorKey,ur=V.find(Rc=>{var Vo;return((Vo=Rc.connectorKey)==null?void 0:Vo.toLowerCase())===(Lt==null?void 0:Lt.toLowerCase())});ur&&(j(ur),v(!0))};return window.addEventListener(Fc.OPEN_FORM_VIEW,Se),()=>{window.removeEventListener(Fc.OPEN_FORM_VIEW,Se)}},[V]),!t.length||W===K.LOADING)return m.jsx(ex,{});const Po=Se=>{r(Lg,{connector_name:X,source:Se,sm_ids:n})},mi=Se=>{v(!0),Po(Se)},Nc=()=>{I(!0),r(Og)},bi=Se=>{r(Se,x),re?A(!0):(v(!1),j(null))},yi=Se=>{if(ee){const{connectorName:qe,title:Lt}=ee;r(Se,{connector_name:qe,card_title:Lt,sm_ids:n,ug_id:a})}re?A(!0):i(kr(null))},Bo=()=>{v(!1),i(kr(null)),w(void 0),A(!1)},jo=()=>{kt(),i(Vf.clearConnectorList())},kn=[{label:"Go back",variant:"text",action:Bo},{label:"Stay",variant:"contained",action:()=>A(!1)}],cr=V.length>0,lr=$.length>0,Ci=()=>cr||lr?m.jsx(Sx,{haveCreateObjects:cr,haveLinkObjects:lr,onCreateClick:()=>mi(Tu.MAIN_BUTTON),onLinkClick:()=>I(!0)}):m.jsx(Jf,{isAdmin:e,hideHeading:!0});return m.jsxs(Pu,{ref:u,"data-testid":Array.isArray(Y)?"connector-agent":"loading",id:"connector-agent-container",stopOverflow:h||C,children:[m.jsx(sp,{shown:T,setShown:A,title:P6,description:B6,buttons:kn}),m.jsx(d3,{onWheel:()=>y(!0),ref:g,children:ae?m.jsxs(m.Fragment,{children:[m.jsx(W3,{connectors:Qe,isWriteFlowEnabled:ye,haveCreateObjects:cr,haveLinkObjects:lr,cards:Y,handleCreateNewObject:()=>mi(Tu.ICON),handleLinkNewObject:Nc}),Z?m.jsx(VE,{selectedObject:S,setSelectedObject:F,fetchSearchResults:ar,onReset:vt,root:u.current}):null,m.jsxs(hc,{children:[m.jsx(Nr,{condition:Z&&et,children:m.jsx(qE,{})},"search"),m.jsx(Nr,{condition:Z&&!!S&&!Ct,children:m.jsx(QE,{searchResults:Te??[],selectedObject:S,onReset:vt,fetchCards:kt})},"results"),m.jsxs(Nr,{fallback:!0,children:[Me&&(Y!=null&&Y.length)?m.jsx(lx,{emailHeaders:st,selectedEmail:D,root:u.current,isLoading:yt,setSelectedEmail:k}):null,te?m.jsx(tx,{}):null,m.jsxs(hc,{children:[m.jsxs(Nr,{condition:!!Y&&Y.length>0,children:[m.jsx(L7,{cards:Y,specificCardData:ue,email:D??"",specificConnectorApiStatus:B,onCardUnlinking:kt}),m.jsx("div",{ref:p,children:ke?m.jsx(Zm,{connectors:Qe,expanded:H}):null})]},"cards-list"),m.jsx(Nr,{condition:!(Y!=null&&Y.length)&&ye,children:Ci()},"create-banner")]})]},"cards")]})]}):m.jsx(Jf,{isAdmin:e})}),m.jsx(gc,{onClose:()=>yi(Wg),isOpen:d,setIsOpen:f,title:wm,portalId:"connector-layover-portal",backButtonTooltip:"Back",children:m.jsx(ap,{isEdit:!0,onClose:()=>yi(Hg),onCreateSuccess:jo,metaData:x,setMetaData:w,connectors:Qe})}),m.jsx(gc,{onClose:()=>bi(Mg),portalId:"connector-layover-portal",isOpen:h,setIsOpen:v,children:m.jsx(ap,{onClose:()=>bi(Rg),onCreateSuccess:jo,metaData:x,setMetaData:w,defaultOption:M,connectors:Qe})}),m.jsx(gc,{onClose:()=>I(!1),portalId:"connector-layover-portal",isOpen:C,setIsOpen:I,children:m.jsx(Ix,{setOpenTaskLinking:I,onLinkingSuccess:kt})}),!ae&&m.jsx(n3,{})]})},t8=({children:e,sendTrackingEvent:t,contactEmail:n,baseUrls:r={},currentSmIds:o=[],userEmail:s,metaData:i,availableFeatures:a,conversationId:l,connectorFunctions:c,stackingContext:u,isAdmin:p=!1})=>{const g=_.useMemo(()=>({userEmail:s,email:n,baseUrls:r,currentSmIds:o,metaData:i,conversationId:l,sendTrackingEvent:t||(()=>{}),availableFeatures:a,isAdmin:p,connectorFunctions:c,stackingContext:u}),[s,n,r,t,o,i,a,l,p,c,u]);return m.jsx(Ve.Provider,{value:g,children:e})},Bp=({children:e})=>{const[t]=_.useState(()=>new gE);return m.jsx(vE,{client:t,children:e})},n8=ed({cardList:l7,write:z6,common:y6}),jp=ly({reducer:n8,devTools:!0}),r8=({children:e,userEmail:t,extraParams:n,contactEmail:r,baseUrls:o,availableFeatures:s,connectorFunctions:i,stackingContext:a})=>m.jsx(Ju,{store:jp,children:m.jsx(b.HiverProvider,{custom:!0,children:m.jsx(Bp,{children:m.jsx(t8,{userEmail:t,availableFeatures:s,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:i,stackingContext:a,isAdmin:n==null?void 0:n.isAdmin,children:m.jsx(_.Suspense,{fallback:m.jsx(m.Fragment,{}),children:e})})})})}),Vp=b.styled(b.Box)`
1292
+ `,qE=()=>m.jsxs(b.Stack,{marginTop:"12px",children:[m.jsx(Dc,{variant:"rounded",width:"50%",height:"16px",animation:"wave",margin:"0 0 18px 0"}),m.jsx(b.Stack,{gap:"17px",children:m.jsxs(Pp,{gap:"8px",disableHover:!0,children:[m.jsx(Dc,{variant:"rounded",width:"30%",height:"16px",animation:"wave"}),m.jsx(Dc,{variant:"rounded",width:"70%",height:"16px",animation:"wave"})]})})]}),$E=async({id:e,searchString:t,args:n})=>{try{if(e===void 0||t===void 0)return[];const r=await ze({url:RE.replace(":formId",e.toString()),method:nt.POST,data:{search_string:t,args:n}});let o=null;return r!=null&&r.data&&"data"in r.data&&(o=r.data.data),o}catch(r){Re({message:Ss,type:at}),console.error(r)}},UE=(e,t)=>Oc({mutationFn:$E,onMutate:({searchString:n,connectorName:r})=>{e(n,r)},onSuccess:(n,{searchString:r,connectorName:o})=>{t(r,n,o)}}),Fc={OPEN_FORM_VIEW:"connector-agent-open-form-view"},KE=(e,t={})=>{const{delayAfterLoad:n=1e3}=t,r=_.useRef(!1),o=_.useRef(void 0),s=_.useCallback((l="auto")=>{const c=e.current;c&&c.scrollIntoView({behavior:l})},[e]),i=_.useCallback((l,c="smooth")=>{r.current||(o.current!==void 0&&clearTimeout(o.current),l&&(o.current=setTimeout(()=>{s(c),r.current=!0},n)))},[s,n]),a=_.useCallback(()=>{r.current=!1,o.current!==void 0&&clearTimeout(o.current)},[]);return _.useEffect(()=>()=>{o.current!==void 0&&clearTimeout(o.current)},[]),{scrollOnceAfterLoad:i,resetScrollState:a,hasScrolledOnce:r.current}},e8=({isAdmin:e=!1})=>{var vi;const{email:t,currentSmIds:n,sendTrackingEvent:r,availableFeatures:o,conversationId:s}=_.useContext(Ve),i=jt(),{userGroupId:a,userId:l}=Yt()||{},c=_.useRef(!1),u=_.useRef(null),p=_.useRef(null),g=_.useRef(null),[E,y]=_.useState(!1),[d,f]=_.useState(!1),[h,v]=_.useState(!1),[C,I]=_.useState(!1),[x,w]=_.useState(),[T,A]=_.useState(!1),[S,F]=_.useState(null),[D,k]=_.useState(),[M,j]=_.useState(null),[H,z]=_.useState(!1),[U,J]=_.useState(!1),Y=be(q6),ae=be($6),ue=be(K6),B=be(e7),W=be(U6),V=be(Hf),X=be(f7),$=be(Wf),ee=be(Zf),re=be(Xf),P=be(hx),te=tt(o,im),ye=tt(o,gu),Z=tt(o,fm),Me=tt(o,hm),ke=tt(o,gm),Je=tt(o,mm),Qe=Fm(ue),{data:fn,isLoading:yt}=Rp({senderEmail:t,conversationId:String(s),enabled:Me&&!!t}),{emailHeaders:st,selectedEmail:Ze}=fn??{},{scrollOnceAfterLoad:kn,resetScrollState:Ft}=KE(p),qr=W!==K.LOADING&&(!B||!Object.values(B).some(Se=>Se===K.LOADING))&&Y&&Y.length>0;_.useLayoutEffect(()=>{var Se;H&&!E&&U&&((Se=g==null?void 0:g.current)!=null&&Se.scrollHeight)&&kn(!!qr,"smooth")},[H,E,U,qr,kn,(vi=g==null?void 0:g.current)==null?void 0:vi.scrollHeight,l]);const Mo=(Se,qe)=>{r(qg,{search_keyword:Se,sm_ids:n,connector_name:qe,suggestion_type:P})},ir=(Se,qe,Lt)=>{!Array.isArray(qe)||!qe.length?r($g,{search_keyword:Se,sm_ids:n,connector_name:Lt,suggestion_type:P}):qe.length&&r(Ug,{num_of_results:qe.length,search_keyword:Se,sm_ids:n,connector_name:Lt,suggestion_type:P})},{mutate:ar,reset:ce,data:Te,isPending:et,isIdle:Ct}=UE(Mo,ir),vt=_.useCallback(()=>{ce(),F(null)},[ce,F]),kt=_.useCallback(()=>{t&&n.length&&s&&i(di({inboxIds:n,conversationId:s}))},[i,t,n,s]),pn=_.useCallback((Se,qe)=>{Se&&s&&qe&&i(ui({id:Se,channelType:"email",conversationId:s,externalResourceId:qe,contactEmail:t})).unwrap().catch(()=>{i(kr(null))})},[i,s,t]);if(_.useEffect(()=>{(async()=>{l&&(z(await Bi(l)),J(await dl(l)))})()},[l]),_.useEffect(()=>{yt||k(Ze||t)},[t,Ze,yt]),_.useEffect(()=>{U&&l&&fl(l)},[U,l]),_.useEffect(()=>{var Se;if(ee){f(!0);const{externalResourceId:qe}=ee,Lt=(Se=ee.forms.find(ur=>ur.type==="edit"))==null?void 0:Se.id;pn(Lt,qe)}else f(!1),i(X6())},[ee,pn,i]),_.useEffect(()=>(kt(),Ft(),()=>{i(Vf.clearConnectorList())}),[i,kt,Ft]),_.useEffect(()=>(Y&&Y.length&&!c.current&&(r(wg,{numOfCards:Y.length,sm_ids:n}),c.current=!0),()=>{(!Y||!n||c.current)&&(c.current=!1)}),[Y,r,n]),_.useEffect(()=>{s&&n&&n.length&&i(si({inboxIds:n,conversationId:s,channelType:"email",isExpandedFormEnabled:Je}))},[i,n,s,Je]),_.useEffect(()=>{const Se=qe=>{var xi;if(!(qe instanceof CustomEvent))return;const Lt=(xi=qe.detail)==null?void 0:xi.connectorKey,ur=V.find(Rc=>{var Vo;return((Vo=Rc.connectorKey)==null?void 0:Vo.toLowerCase())===(Lt==null?void 0:Lt.toLowerCase())});ur&&(j(ur),v(!0))};return window.addEventListener(Fc.OPEN_FORM_VIEW,Se),()=>{window.removeEventListener(Fc.OPEN_FORM_VIEW,Se)}},[V]),!t.length||W===K.LOADING)return m.jsx(ex,{});const Po=Se=>{r(Lg,{connector_name:X,source:Se,sm_ids:n})},mi=Se=>{v(!0),Po(Se)},Nc=()=>{I(!0),r(Og)},bi=Se=>{r(Se,x),re?A(!0):(v(!1),j(null))},yi=Se=>{if(ee){const{connectorName:qe,title:Lt}=ee;r(Se,{connector_name:qe,card_title:Lt,sm_ids:n,ug_id:a})}re?A(!0):i(kr(null))},Bo=()=>{v(!1),i(kr(null)),w(void 0),A(!1)},jo=()=>{kt(),i(Vf.clearConnectorList())},Nn=[{label:"Go back",variant:"text",action:Bo},{label:"Stay",variant:"contained",action:()=>A(!1)}],cr=V.length>0,lr=$.length>0,Ci=()=>cr||lr?m.jsx(Sx,{haveCreateObjects:cr,haveLinkObjects:lr,onCreateClick:()=>mi(Tu.MAIN_BUTTON),onLinkClick:()=>I(!0)}):m.jsx(Jf,{isAdmin:e,hideHeading:!0});return m.jsxs(Pu,{ref:u,"data-testid":Array.isArray(Y)?"connector-agent":"loading",id:"connector-agent-container",stopOverflow:h||C,children:[m.jsx(sp,{shown:T,setShown:A,title:P6,description:B6,buttons:Nn}),m.jsx(d3,{onWheel:()=>y(!0),ref:g,children:ae?m.jsxs(m.Fragment,{children:[m.jsx(W3,{connectors:Qe,isWriteFlowEnabled:ye,haveCreateObjects:cr,haveLinkObjects:lr,cards:Y,handleCreateNewObject:()=>mi(Tu.ICON),handleLinkNewObject:Nc}),Z?m.jsx(VE,{selectedObject:S,setSelectedObject:F,fetchSearchResults:ar,onReset:vt,root:u.current}):null,m.jsxs(hc,{children:[m.jsx(Nr,{condition:Z&&et,children:m.jsx(qE,{})},"search"),m.jsx(Nr,{condition:Z&&!!S&&!Ct,children:m.jsx(QE,{searchResults:Te??[],selectedObject:S,onReset:vt,fetchCards:kt})},"results"),m.jsxs(Nr,{fallback:!0,children:[Me&&(Y!=null&&Y.length)?m.jsx(lx,{emailHeaders:st,selectedEmail:D,root:u.current,isLoading:yt,setSelectedEmail:k}):null,te?m.jsx(tx,{}):null,m.jsxs(hc,{children:[m.jsxs(Nr,{condition:!!Y&&Y.length>0,children:[m.jsx(L7,{cards:Y,specificCardData:ue,email:D??"",specificConnectorApiStatus:B,onCardUnlinking:kt}),m.jsx("div",{ref:p,children:ke?m.jsx(Zm,{connectors:Qe,expanded:H}):null})]},"cards-list"),m.jsx(Nr,{condition:!(Y!=null&&Y.length)&&ye,children:Ci()},"create-banner")]})]},"cards")]})]}):m.jsx(Jf,{isAdmin:e})}),m.jsx(gc,{onClose:()=>yi(Wg),isOpen:d,setIsOpen:f,title:wm,portalId:"connector-layover-portal",backButtonTooltip:"Back",children:m.jsx(ap,{isEdit:!0,onClose:()=>yi(Hg),onCreateSuccess:jo,metaData:x,setMetaData:w,connectors:Qe})}),m.jsx(gc,{onClose:()=>bi(Mg),portalId:"connector-layover-portal",isOpen:h,setIsOpen:v,children:m.jsx(ap,{onClose:()=>bi(Rg),onCreateSuccess:jo,metaData:x,setMetaData:w,defaultOption:M,connectors:Qe})}),m.jsx(gc,{onClose:()=>I(!1),portalId:"connector-layover-portal",isOpen:C,setIsOpen:I,children:m.jsx(Ix,{setOpenTaskLinking:I,onLinkingSuccess:kt})}),!ae&&m.jsx(n3,{})]})},t8=({children:e,sendTrackingEvent:t,contactEmail:n,baseUrls:r={},currentSmIds:o=[],userEmail:s,metaData:i,availableFeatures:a,conversationId:l,connectorFunctions:c,stackingContext:u,isAdmin:p=!1})=>{const g=_.useMemo(()=>({userEmail:s,email:n,baseUrls:r,currentSmIds:o,metaData:i,conversationId:l,sendTrackingEvent:t||(()=>{}),availableFeatures:a,isAdmin:p,connectorFunctions:c,stackingContext:u}),[s,n,r,t,o,i,a,l,p,c,u]);return m.jsx(Ve.Provider,{value:g,children:e})},Bp=({children:e})=>{const[t]=_.useState(()=>new gE);return m.jsx(vE,{client:t,children:e})},n8=ed({cardList:l7,write:z6,common:y6}),jp=ly({reducer:n8,devTools:!0}),r8=({children:e,userEmail:t,extraParams:n,contactEmail:r,baseUrls:o,availableFeatures:s,connectorFunctions:i,stackingContext:a})=>m.jsx(Ju,{store:jp,children:m.jsx(b.HiverProvider,{custom:!0,children:m.jsx(Bp,{children:m.jsx(t8,{userEmail:t,availableFeatures:s,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:i,stackingContext:a,isAdmin:n==null?void 0:n.isAdmin,children:m.jsx(_.Suspense,{fallback:m.jsx(m.Fragment,{}),children:e})})})})}),Vp=b.styled(b.Box)`
1293
1293
  height: inherit;
1294
1294
  .MuiScopedCssBaseline-root {
1295
1295
  height: inherit;
@@ -2177,7 +2177,7 @@ Do you want to continue?`,j6="Select an object to create",V6="Select an object t
2177
2177
  align-self: auto !important;
2178
2178
  margin-left: 12px;
2179
2179
  }
2180
- `,s8=({userEmail:e="",contactEmail:t="",baseUrls:n={},extraParams:r={},availableFeatures:o={},connectorFunctions:s,stackingContext:i={}})=>m.jsx(Vp,{children:m.jsxs(r8,{userEmail:e,availableFeatures:o,extraParams:r,contactEmail:t,connectorFunctions:s,stackingContext:i,baseUrls:n,children:[m.jsx(e8,{isAdmin:r==null?void 0:r.isAdmin}),Ne.createPortal(m.jsx(Gp,{id:"toast-message",children:m.jsx(tl,{position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0,...!!i.toastMessage&&{style:{zIndex:i.toastMessage}}})}),document.body),m.jsx("div",{"data-connectorid":"connector-layover-portal"})]})}),Hp="/v1/api",i8=`${Hp}/connector/conversation/:conversationId/data`,a8=`${Hp}/connector/feedback/conversation/:conversationId`,c8=async e=>{try{const t=await ze({url:i8.replace(":conversationId",e)+"?channel_type=email",method:nt.GET});return t!=null&&t.data&&Array.isArray(t.data)?t.data.reduce((r,o)=>{var s,i;return r[(s=o==null?void 0:o.cardData)==null?void 0:s.textToHighlight]||(r[(i=o==null?void 0:o.cardData)==null?void 0:i.textToHighlight]={...o}),r},{}):null}catch(t){return Promise.reject(t)}};function l8(e,t){return Lc({queryKey:["connector-analytics",e,t],queryFn:async()=>!t||!e?null:await c8(e),enabled:!!t&&!!e})}class u8{constructor(t=[]){Nn(this,"highlightTerms");Nn(this,"observer");Nn(this,"isHighlighting");Nn(this,"debounceTimer");Nn(this,"debounceDelay");this.highlightTerms=t,this.observer=null,this.isHighlighting=!1,this.debounceTimer=null,this.debounceDelay=500,console.log("Gmail Highlighter initialized for:",t),this.init()}init(){console.log("Initialising Highlighting+++++"),this.highlightAllEmails(),this.startObserver()}startObserver(){const t=this.findGmailContainer();if(!t){console.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(a=>{var l,c,u,p;return a.nodeType===1&&a instanceof Element&&(((l=a.classList)==null?void 0:l.contains("a3s"))||((c=a.classList)==null?void 0:c.contains("ii"))||((u=a.querySelector)==null?void 0:u.call(a,".a3s"))||((p=a.querySelector)==null?void 0:p.call(a,"h2.hP")))})&&(r=!0)}),r&&this.debounceHighlight()}),this.observer.observe(t,{childList:!0,subtree:!0}),console.log("Observer started for email expand/collapse")}findGmailContainer(){return document.querySelector('[role="main"]')||document.querySelector(".nH.if")||document.querySelector(".AO")||document.body}debounceHighlight(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{console.log("Email expanded/collapsed - re-highlighting"),this.highlightAllEmails()},this.debounceDelay)}highlightAllEmails(){if(this.highlightTerms.length===0){console.log("No highlight terms available");return}this.isHighlighting=!0;try{this.clearHighlights();const t=["h2.hP",".ii.gt .a3s.aiL",".ii.gt .a3s",'[data-expanded="true"]'];let n=0;t.forEach(r=>{document.querySelectorAll(r).forEach(s=>{this.isElementVisible(s)&&(this.highlightInElement(s),n++)})}),console.log(`Highlighted ${this.highlightTerms.length} terms in ${n} elements`)}finally{setTimeout(()=>{this.isHighlighting=!1},300)}}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:i=>i.parentElement&&i.parentElement.classList.contains("gmail-highlight")||i.parentElement&&["SCRIPT","STYLE"].includes(i.parentElement.tagName)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),o=[];let s;for(;s=r.nextNode();)o.push(s);o.forEach(i=>{this.highlightInTextNode(i)}),t.dataset.highlightProcessed="true"}highlightInTextNode(t){let n=t.textContent,r=!1;if(!n)return;if([...this.highlightTerms].sort((s,i)=>i.length-s.length).forEach(s=>{if(!s||s.trim().length===0)return;const i=this.escapeRegex(s.trim()),a=new RegExp(`\\b${i}\\b`,"gi");a.test(n)&&(n=n.replace(a,`<span class="gmail-highlight" data-highlight-term="${s.trim()}"><span class="gmail-highlight-inner">${s}</span></span>`),r=!0)}),r&&t.parentNode){const s=document.createElement("span");s.innerHTML=n,t.parentNode.replaceChild(s,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,"\\$&")}refreshHighlights(){console.log("Manually refreshing highlights"),this.highlightAllEmails()}updateHighlightTerms(t){console.log("Updating highlight terms:",t),this.highlightTerms=t||[],this.highlightAllEmails()}destroy(){console.log("Destroying Gmail Highlighter"),this.observer&&(this.observer.disconnect(),this.observer=null),this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.clearHighlights(),this.highlightTerms=[]}}if(!document.getElementById("gmail-highlighter-styles")){const e=document.createElement("style");e.id="gmail-highlighter-styles",e.textContent=`
2180
+ `,s8=({userEmail:e="",contactEmail:t="",baseUrls:n={},extraParams:r={},availableFeatures:o={},connectorFunctions:s,stackingContext:i={}})=>m.jsx(Vp,{children:m.jsxs(r8,{userEmail:e,availableFeatures:o,extraParams:r,contactEmail:t,connectorFunctions:s,stackingContext:i,baseUrls:n,children:[m.jsx(e8,{isAdmin:r==null?void 0:r.isAdmin}),Ne.createPortal(m.jsx(Gp,{id:"toast-message",children:m.jsx(tl,{position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0,...!!i.toastMessage&&{style:{zIndex:i.toastMessage}}})}),document.body),m.jsx("div",{"data-connectorid":"connector-layover-portal"})]})}),Hp="/v1/api",i8=`${Hp}/connector/conversation/:conversationId/data`,a8=`${Hp}/connector/feedback/conversation/:conversationId`,c8=async e=>{try{const t=await ze({url:i8.replace(":conversationId",e)+"?channel_type=email",method:nt.GET});return t!=null&&t.data&&Array.isArray(t.data)?t.data.reduce((r,o)=>{var s,i;return r[(s=o==null?void 0:o.cardData)==null?void 0:s.textToHighlight]||(r[(i=o==null?void 0:o.cardData)==null?void 0:i.textToHighlight]={...o}),r},{}):null}catch(t){return Promise.reject(t)}};function l8(e,t){return Lc({queryKey:["connector-analytics",e,t],queryFn:async()=>!t||!e?null:await c8(e),enabled:!!t&&!!e})}class u8{constructor(t=[],n=null){hn(this,"highlightTerms");hn(this,"observer");hn(this,"isHighlighting");hn(this,"debounceTimer");hn(this,"debounceDelay");hn(this,"onHighlightsUpdated");this.highlightTerms=t,this.observer=null,this.isHighlighting=!1,this.debounceTimer=null,this.debounceDelay=500,this.onHighlightsUpdated=n,console.log("Gmail Highlighter initialized for:",t),this.init()}init(){console.log("Initialising Highlighting+++++"),this.highlightAllEmails(),this.startObserver()}startObserver(){const t=this.findGmailContainer();if(!t){console.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(a=>{var l,c,u,p;return a.nodeType===1&&a instanceof Element&&(((l=a.classList)==null?void 0:l.contains("a3s"))||((c=a.classList)==null?void 0:c.contains("ii"))||((u=a.querySelector)==null?void 0:u.call(a,".a3s"))||((p=a.querySelector)==null?void 0:p.call(a,"h2.hP")))})&&(r=!0)}),r&&this.debounceHighlight()}),this.observer.observe(t,{childList:!0,subtree:!0}),console.log("Observer started for email expand/collapse")}findGmailContainer(){return document.querySelector('[role="main"]')||document.querySelector(".nH.if")||document.querySelector(".AO")||document.body}debounceHighlight(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{console.log("Email expanded/collapsed - re-highlighting"),this.highlightAllEmails()},this.debounceDelay)}highlightAllEmails(){if(this.highlightTerms.length===0){console.log("No highlight terms available");return}this.isHighlighting=!0;try{this.clearHighlights();const t=["h2.hP",".ii.gt .a3s.aiL",".ii.gt .a3s",'[data-expanded="true"]'];let n=0;t.forEach(r=>{document.querySelectorAll(r).forEach(s=>{this.isElementVisible(s)&&(this.highlightInElement(s),n++)})}),this.onHighlightsUpdated&&setTimeout(()=>{var o;const r=Array.from(document.querySelectorAll(".gmail-highlight"));(o=this.onHighlightsUpdated)==null||o.call(this,r)},1e3),console.log(`Highlighted ${this.highlightTerms.length} terms in ${n} elements`)}finally{setTimeout(()=>{this.isHighlighting=!1},300)}}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:i=>i.parentElement&&i.parentElement.classList.contains("gmail-highlight")||i.parentElement&&["SCRIPT","STYLE"].includes(i.parentElement.tagName)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),o=[];let s;for(;s=r.nextNode();)o.push(s);o.forEach(i=>{this.highlightInTextNode(i)}),t.dataset.highlightProcessed="true"}highlightInTextNode(t){let n=t.textContent,r=!1;if(!n)return;if([...this.highlightTerms].sort((s,i)=>i.length-s.length).forEach(s=>{if(!s||s.trim().length===0)return;const i=this.escapeRegex(s.trim()),a=new RegExp(`\\b${i}\\b`,"gi");a.test(n)&&(n=n.replace(a,`<span class="gmail-highlight" data-highlight-term="${s.trim()}"><span class="gmail-highlight-inner">${s}</span></span>`),r=!0)}),r&&t.parentNode){const s=document.createElement("span");s.innerHTML=n,t.parentNode.replaceChild(s,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,"\\$&")}refreshHighlights(){console.log("Manually refreshing highlights"),this.highlightAllEmails()}updateHighlightTerms(t){console.log("Updating highlight terms:",t),this.highlightTerms=t||[],this.highlightAllEmails()}destroy(){console.log("Destroying Gmail Highlighter"),this.observer&&(this.observer.disconnect(),this.observer=null),this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.clearHighlights(),this.highlightTerms=[]}}if(!document.getElementById("gmail-highlighter-styles")){const e=document.createElement("style");e.id="gmail-highlighter-styles",e.textContent=`
2181
2181
  .gmail-highlight {
2182
2182
  background-color: #ECEFF6 !important;
2183
2183
  color: #2c3e50 !important;
@@ -2207,7 +2207,7 @@ Do you want to continue?`,j6="Select an object to create",V6="Select an object t
2207
2207
  transform: translateY(0) !important;
2208
2208
  box-shadow: none !important;
2209
2209
  }
2210
- `,document.head.appendChild(e)}function d8(){return Oc({mutationKey:["submit-connector-feedback"],mutationFn:async({conversationId:e,feedbackData:t})=>{if(!e)throw new Error("Conversation ID is required");const n=await ze({url:a8.replace(":conversationId",e)+"?channel_type=email",method:"POST",data:t});return n==null?void 0:n.data}})}const f8="Everything looks good",p8="Something is not working",h8="Provide feedback",g8="Integration Sense Configuration",m8="Reach out to your admin to disable this feature",b8="Go to Apps",y8="Disable Feature",C8="Tell us what went wrong",v8="Please provide feedback",x8=[{label:"Data is not accurate",value:"Data is not accurate"},{label:"Wrong App is showing",value:"Wrong App is showing"},{label:"Other",value:"other"}],E8="Enter your feedback",kc=40,I8="Feedback submitted successfully",w8="Failed to submit feedback",En={OBJECT_HIGHLIGHTED:"app_object_detection_highlighted",OBJECT_HOVERED:"app_object_detection_hovered",PERMALINK_CLICKED:"app_object_detection_permalink_clicked",POSITIVE_FEEDBACK_CLICKED:"app_object_detection_positive_feedback_detected",NEGATIVE_FEEDBACK_CLICKED:"app_object_detection_negative_feedback_clicked",NEGATIVE_FEEDBACK_SUBMITTED:"app_object_detection_negative_feedback_submitted",FEEDBACK_OPTION_CLICKED:"app_object_detection_general_feedback_clicked",FEEDBACK_OPTION_SUBMITTED:"app_object_detection_general_feedback_submitted"},A8=e=>m.jsx(b.Button,{...e,disabled:e.isLoading||e.disabled,children:e.isLoading?m.jsx(b.CircularProgress,{sx:{color:"#97A3B7"},size:20}):e.label}),_8=b.styled(b.Box)`
2210
+ `,document.head.appendChild(e)}function d8(){return Oc({mutationKey:["submit-connector-feedback"],mutationFn:async({conversationId:e,feedbackData:t})=>{if(!e)throw new Error("Conversation ID is required");const n=await ze({url:a8.replace(":conversationId",e)+"?channel_type=email",method:"POST",data:t});return n==null?void 0:n.data}})}const f8="Everything looks good",p8="Something is not working",h8="Provide feedback",g8="Integration Sense Configuration",m8="Reach out to your admin to disable this feature",b8="Go to Apps",y8="Disable Feature",C8="Tell us what went wrong",v8="Please provide feedback",x8=[{label:"Data is not accurate",value:"Data is not accurate"},{label:"Wrong App is showing",value:"Wrong App is showing"},{label:"Other",value:"other"}],E8="Enter your feedback",kc=40,I8="Feedback submitted successfully",w8="Failed to submit feedback",In={OBJECT_HIGHLIGHTED:"app_object_detection_highlighted",OBJECT_HOVERED:"app_object_detection_hovered",PERMALINK_CLICKED:"app_object_detection_permalink_clicked",POSITIVE_FEEDBACK_CLICKED:"app_object_detection_positive_feedback_detected",NEGATIVE_FEEDBACK_CLICKED:"app_object_detection_negative_feedback_clicked",NEGATIVE_FEEDBACK_SUBMITTED:"app_object_detection_negative_feedback_submitted",FEEDBACK_OPTION_CLICKED:"app_object_detection_general_feedback_clicked",FEEDBACK_OPTION_SUBMITTED:"app_object_detection_general_feedback_submitted"},A8=e=>m.jsx(b.Button,{...e,disabled:e.isLoading||e.disabled,children:e.isLoading?m.jsx(b.CircularProgress,{sx:{color:"#97A3B7"},size:20}):e.label}),_8=b.styled(b.Box)`
2211
2211
  max-height: 340px;
2212
2212
  width: 440px;
2213
2213
  border-radius: 12px;
@@ -2299,4 +2299,4 @@ Do you want to continue?`,j6="Select an object to create",V6="Select an object t
2299
2299
  color: #196fe0;
2300
2300
  padding: 5px 12px;
2301
2301
  min-width: 100px;
2302
- `,j8=e=>N.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M7.87354 2.73877C7.87354 2.30139 7.53821 1.94227 7.11084 1.90381L5.09229 6.44775C5.06387 6.51167 5.02799 6.57074 4.98975 6.62744V12.3667H10.4722C11.0395 12.3665 11.5225 11.9529 11.6089 11.3921L12.2368 7.30811C12.3437 6.61168 11.8047 5.98395 11.1001 5.98389H9.05615C8.40276 5.98371 7.87354 5.45372 7.87354 4.80029V2.73877ZM2.07275 11.8003C2.07275 12.1133 2.32718 12.3667 2.64014 12.3667H3.78955V7.1499H2.64014C2.32718 7.1499 2.07275 7.40432 2.07275 7.71729V11.8003ZM9.07275 4.78369H11.1001C12.5403 4.78375 13.6412 6.0673 13.4224 7.49072L12.7944 11.5747C12.6179 12.7208 11.6318 13.5667 10.4722 13.5669H2.64014C1.66443 13.5669 0.873535 12.776 0.873535 11.8003V7.71729C0.873535 6.74158 1.66443 5.95068 2.64014 5.95068H3.99951L6.04834 1.34131L6.12256 1.20166C6.31844 0.892431 6.66142 0.700708 7.03467 0.700684C8.16045 0.700684 9.07275 1.61299 9.07275 2.73877V4.78369Z",fill:"#97A3B7"})),V8=e=>N.createElement("svg",{width:13,height:14,viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M11.8008 3.16651C11.8008 2.83026 11.7996 2.61407 11.7861 2.44972C11.7733 2.29228 11.7516 2.23558 11.7383 2.20948C11.684 2.10311 11.5976 2.0167 11.4912 1.96241C11.4651 1.94911 11.4084 1.92742 11.251 1.91456C11.0866 1.90113 10.8698 1.89991 10.5332 1.89991H10.084V7.11671H10.5332C10.8697 7.11671 11.0866 7.11647 11.251 7.10304C11.4084 7.09017 11.4651 7.06848 11.4912 7.05519C11.5977 7.00085 11.684 6.91369 11.7383 6.80714C11.7516 6.78095 11.7733 6.72473 11.7861 6.56788C11.7996 6.40344 11.8008 6.18671 11.8008 5.85011V3.16651ZM6.00001 11.5288C6.00014 11.9658 6.33491 12.3239 6.76173 12.3628L8.68946 8.02784C8.73905 7.91626 8.79776 7.77463 8.8838 7.6421V1.89991H4.30275C3.86739 1.89991 3.57385 1.9011 3.34571 1.91847C3.12524 1.93527 3.00982 1.96482 2.92677 2.00245C2.72742 2.09281 2.55809 2.23906 2.43849 2.42237C2.38875 2.49873 2.34108 2.60774 2.29103 2.82276C2.23917 3.04561 2.19414 3.33583 2.12794 3.76612L1.82325 5.74952C1.73618 6.31551 1.67724 6.70248 1.65724 7.00245C1.63765 7.29653 1.66125 7.4439 1.69923 7.54347C1.79436 7.79282 1.97309 8.00139 2.20509 8.13331C2.29773 8.18598 2.43978 8.23198 2.73341 8.25733C3.03294 8.28318 3.42441 8.2837 3.99708 8.2837H4.46681C4.62026 8.2837 4.77205 8.28306 4.89943 8.29347C5.00019 8.30172 5.11526 8.31839 5.23439 8.36085L5.3545 8.41261L5.51271 8.51026C5.61292 8.58313 5.70157 8.67078 5.77443 8.77101L5.8711 8.93019L5.92286 9.0503C5.96524 9.1694 5.98202 9.28456 5.99025 9.38526C6.00063 9.51256 6.00001 9.66359 6.00001 9.8169V11.5288ZM13 5.85011C13 6.1669 13.0008 6.44089 12.9824 6.66554C12.9635 6.89709 12.9214 7.12868 12.8076 7.35206C12.6383 7.68439 12.3684 7.95514 12.0361 8.12452C11.8127 8.23838 11.5803 8.2804 11.3486 8.29933C11.124 8.31767 10.8499 8.3169 10.5332 8.3169H10.0899C9.97739 8.31691 9.91771 8.31637 9.87501 8.31886C9.85536 8.35692 9.83103 8.41194 9.78517 8.51515L7.82521 12.9263C7.6519 13.3159 7.26532 13.5669 6.83888 13.5669C5.71318 13.5669 4.80093 12.6545 4.80079 11.5288V9.8169C4.80079 9.64881 4.799 9.55553 4.79396 9.48878C4.72728 9.48383 4.63383 9.4839 4.46681 9.4839H3.99708C3.44579 9.4839 2.99395 9.48395 2.63087 9.45265C2.26202 9.42082 1.92186 9.35223 1.61232 9.17628C1.13824 8.90671 0.772529 8.48073 0.578136 7.9712C0.451217 7.63844 0.43534 7.29185 0.459972 6.92237C0.484222 6.55869 0.552876 6.11195 0.63673 5.5669L0.942394 3.58351C1.00581 3.17132 1.05751 2.82883 1.12208 2.55128C1.18838 2.26634 1.27691 2.00629 1.4336 1.76612C1.67803 1.39152 2.02424 1.0943 2.43165 0.909678C2.69285 0.791323 2.96319 0.743407 3.25489 0.721201C3.53908 0.699573 3.8856 0.700693 4.30275 0.700693H10.5332C10.8499 0.700693 11.124 0.69993 11.3486 0.718272C11.5803 0.737198 11.8127 0.779216 12.0361 0.893076C12.3683 1.06241 12.6383 1.33244 12.8076 1.66456C12.9215 1.88802 12.9635 2.12041 12.9824 2.35206C13.0008 2.57656 13 2.85001 13 3.16651V5.85011Z",fill:"#97A3B7"})),G8=e=>N.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M6.02637 0.261719C6.91006 0.100716 7.81654 0.108586 8.69727 0.285156C8.77943 0.301685 8.85737 0.335356 8.92578 0.383789C8.99413 0.432207 9.05187 0.494446 9.09473 0.566406L10.1699 2.37109L12.2686 2.40137C12.3521 2.40267 12.4348 2.42105 12.5107 2.45605C12.5866 2.49114 12.6547 2.5417 12.71 2.60449L12.9268 2.8623C13.4177 3.47393 13.8044 4.1638 14.0703 4.90332H14.0713C14.1006 4.98499 14.1111 5.07276 14.1035 5.15918C14.0958 5.24545 14.0694 5.32914 14.0264 5.4043L13.0107 7.17676L14.0654 8.97949C14.1089 9.05374 14.1349 9.13706 14.1436 9.22266C14.1522 9.30829 14.143 9.39509 14.1152 9.47656C13.8308 10.316 13.3846 11.0919 12.8008 11.7588C12.7442 11.8235 12.6731 11.8748 12.5947 11.9102C12.5163 11.9454 12.4307 11.9644 12.3447 11.9639L10.2559 11.9512L9.22656 13.7188C9.18293 13.7935 9.12263 13.8576 9.05176 13.9072C8.98094 13.9567 8.90045 13.9914 8.81543 14.0068C7.9318 14.1675 7.02506 14.1583 6.14453 13.9814L6.14355 13.9824C6.0797 13.9694 6.01838 13.9446 5.96191 13.9121C5.87332 13.8615 5.7985 13.7897 5.74609 13.7021L4.67188 11.8955L2.56934 11.8682C2.48571 11.8669 2.4031 11.8485 2.32715 11.8135C2.25108 11.7784 2.18323 11.727 2.12793 11.6641C1.60736 11.0751 1.18875 10.4045 0.888672 9.67969L0.767578 9.36621C0.738264 9.28452 0.726773 9.19681 0.734375 9.11035C0.742031 9.02393 0.768379 8.93953 0.811523 8.86426L1.82617 7.0918L0.772461 5.28906C0.729026 5.2148 0.702006 5.1315 0.693359 5.0459C0.684801 4.96052 0.695058 4.87421 0.722656 4.79297C1.00784 3.95289 1.45608 3.17678 2.04102 2.50977C2.09771 2.44503 2.16762 2.39274 2.24609 2.35742C2.32438 2.32222 2.40928 2.30426 2.49512 2.30469L4.58398 2.31543L5.61426 0.549805C5.65789 0.474997 5.71718 0.410066 5.78809 0.360352C5.8591 0.31064 5.94107 0.277156 6.02637 0.261719ZM7.53809 14.0195C7.59898 14.0196 7.65982 14.0181 7.7207 14.0166C7.65982 14.0181 7.59898 14.0196 7.53809 14.0195ZM7.2334 14.0117C7.28581 14.014 7.33818 14.0164 7.39062 14.0176C7.33818 14.0164 7.28581 14.014 7.2334 14.0117ZM7.85742 14.0127C7.89653 14.0109 7.93552 14.0073 7.97461 14.0049C7.93552 14.0073 7.89654 14.0109 7.85742 14.0127ZM6.91113 13.9902C6.97295 13.9958 7.03476 14.0009 7.09668 14.0049C7.03476 14.0009 6.97295 13.9958 6.91113 13.9902ZM6.6543 13.9619C6.6898 13.9665 6.72519 13.9716 6.76074 13.9756C6.72519 13.9716 6.6898 13.9665 6.6543 13.9619ZM5.91016 13.75C5.94027 13.7795 5.97474 13.8051 6.01172 13.8262L5.95898 13.791C5.94197 13.7782 5.92535 13.7649 5.91016 13.75ZM6.58008 12.9414H6.58105H6.58008ZM8.2002 1.41895C7.63858 1.33129 7.06722 1.32543 6.50391 1.40137L5.5127 3.10059C5.45667 3.19686 5.37383 3.27503 5.27539 3.32715C5.21254 3.36088 5.14878 3.39942 5.08594 3.43555L5.08496 3.43457C4.99197 3.48895 4.88605 3.51825 4.77832 3.51758L2.77637 3.50586C2.43354 3.9367 2.15694 4.41647 1.95508 4.92871L2.96875 6.66211H2.96973C3.01013 6.73278 3.03531 6.81132 3.04492 6.8916L3.04883 6.97461C3.04667 7.04613 3.0485 7.11658 3.05078 7.18945C3.0548 7.30124 3.02821 7.41268 2.97266 7.50977L1.99609 9.21289C2.21404 9.7388 2.50744 10.2299 2.86621 10.6719L4.88281 10.7012H4.88379C4.99002 10.7034 5.09368 10.7341 5.18457 10.7891L5.39258 10.9082C5.45916 10.9464 5.51715 10.9978 5.56445 11.0576L5.6084 11.1201L6.6416 12.8486C7.20362 12.9365 7.77513 12.9432 8.33887 12.8672L9.3291 11.1689C9.38528 11.0722 9.46843 10.9926 9.56738 10.9404C9.63017 10.9067 9.69505 10.8701 9.75781 10.834L9.8291 10.7988C9.90336 10.7678 9.98341 10.7514 10.0645 10.752L12.0664 10.7646C12.4092 10.3324 12.6847 9.85062 12.8857 9.33691L11.8711 7.60645L11.8721 7.60547C11.8181 7.51108 11.7903 7.40365 11.792 7.29492L11.791 7.29395C11.7932 7.22206 11.7923 7.15042 11.79 7.07715C11.7862 6.96565 11.8128 6.85466 11.8682 6.75781L12.8438 5.05371C12.6258 4.52811 12.3333 4.03648 11.9746 3.59473L9.95801 3.56641H9.95703C9.85067 3.56414 9.74722 3.53265 9.65625 3.47754V3.47852L9.45898 3.36426L9.39258 3.32129C9.32844 3.27486 9.27351 3.21669 9.23242 3.14844V3.14746L8.2002 1.41895ZM2.4668 11.7559L2.57031 11.7686H2.57129C2.50157 11.7675 2.43246 11.7518 2.36914 11.7227L2.4668 11.7559ZM1.78809 11.082V11.0811V11.082ZM13.0244 11.3203C13.0502 11.2862 13.0774 11.2533 13.1025 11.2188C13.0774 11.2533 13.0502 11.2862 13.0244 11.3203ZM13.2051 11.0713C13.2348 11.0279 13.2643 10.9845 13.293 10.9404C13.2643 10.9845 13.2348 11.0279 13.2051 11.0713ZM9.90918 10.876C9.90231 10.8782 9.89544 10.8803 9.88867 10.8828C9.89545 10.8803 9.90231 10.8782 9.90918 10.876ZM13.3535 10.8447C13.3903 10.7861 13.426 10.7268 13.4609 10.667C13.426 10.7268 13.3903 10.7861 13.3535 10.8447ZM13.5049 10.5928C13.5426 10.5264 13.5789 10.4593 13.6143 10.3916C13.5789 10.4593 13.5426 10.5264 13.5049 10.5928ZM13.6582 10.3066C13.695 10.2337 13.7305 10.1602 13.7646 10.0859C13.7305 10.1602 13.695 10.2337 13.6582 10.3066ZM7.2168 4.04004C7.82858 3.99994 8.43974 4.14269 8.9707 4.44922C9.68176 4.86085 10.2003 5.53844 10.4131 6.33203C10.6256 7.12573 10.5145 7.97155 10.1045 8.68359C9.79803 9.21429 9.34157 9.64291 8.79199 9.91406C8.24214 10.1852 7.62346 10.287 7.01562 10.207C6.40793 10.127 5.83684 9.86895 5.37598 9.46484C4.91529 9.06072 4.58448 8.52844 4.42578 7.93652C4.26721 7.34451 4.28843 6.71808 4.48535 6.1377C4.68236 5.55755 5.04627 5.04792 5.53223 4.6748C6.01845 4.30171 6.60526 4.08027 7.2168 4.04004ZM13.7852 10.041C13.8281 9.94559 13.8697 9.84945 13.9082 9.75195V9.75098C13.8696 9.84876 13.8283 9.94531 13.7852 10.041ZM6.40918 9.95703C6.46044 9.97542 6.51219 9.99222 6.56445 10.0078C6.51219 9.99225 6.46044 9.97539 6.40918 9.95703ZM6.20996 9.87695C6.25096 9.89508 6.2922 9.91244 6.33398 9.92871C6.2922 9.91247 6.25097 9.89505 6.20996 9.87695ZM6.02832 9.79004C6.0678 9.81077 6.10809 9.82969 6.14844 9.84863C6.10808 9.82972 6.06781 9.81074 6.02832 9.79004ZM5.84082 9.68262C5.87596 9.70443 5.9113 9.72578 5.94727 9.74609C5.91128 9.7258 5.87597 9.7044 5.84082 9.68262ZM12.9131 9.53613C12.9421 9.46825 12.9707 9.40012 12.9971 9.33105L12.9961 9.33008C12.9697 9.3993 12.9422 9.46808 12.9131 9.53613ZM5.66602 9.56543C5.7015 9.59105 5.73694 9.61662 5.77344 9.64062C5.73693 9.61664 5.70151 9.59104 5.66602 9.56543ZM1.97461 9.41699C1.99284 9.4575 2.01311 9.49704 2.03223 9.53711C1.98023 9.42813 1.93016 9.31814 1.88477 9.20605L1.97461 9.41699ZM5.59277 9.5127C5.59556 9.51484 5.59877 9.51642 5.60156 9.51855C5.54737 9.47722 5.49386 9.43478 5.44238 9.38965L5.59277 9.5127ZM8.03125 5.33496C7.67547 5.21424 7.29063 5.20159 6.92773 5.29883C6.56509 5.39617 6.23977 5.59952 5.99219 5.88184C5.74452 6.16433 5.58615 6.51424 5.53711 6.88672C5.48824 7.25901 5.54977 7.63783 5.71582 7.97461C5.88202 8.31152 6.14537 8.59145 6.4707 8.7793C6.90703 9.0311 7.42549 9.09913 7.91211 8.96875C8.39876 8.83831 8.81448 8.52031 9.06641 8.08398C9.25414 7.7587 9.3409 7.38453 9.31641 7.00977C9.2918 6.635 9.15631 6.27555 8.92773 5.97754C8.69908 5.67961 8.38685 5.45577 8.03125 5.33496ZM6.17676 8.69922C6.25355 8.76023 6.3343 8.81676 6.41992 8.86621L6.4209 8.86523C6.33525 8.81578 6.2536 8.76024 6.17676 8.69922ZM8.47754 8.83203V8.83105V8.83203ZM5.77637 8.27246C5.83227 8.35318 5.89399 8.4295 5.96094 8.50098L5.86426 8.38965C5.83359 8.35168 5.80422 8.31265 5.77637 8.27246ZM4.52246 7.91113C4.5608 8.0541 4.60948 8.19346 4.66797 8.32812C4.60945 8.19325 4.56083 8.05334 4.52246 7.91016V7.91113ZM9.40039 6.85645C9.40722 6.90519 9.41278 6.95457 9.41602 7.00391C9.41922 7.05311 9.42035 7.1023 9.41992 7.15137C9.42035 7.10204 9.41926 7.05239 9.41602 7.00293C9.41279 6.95379 9.40719 6.90498 9.40039 6.85645ZM11.9004 6.95215C11.8982 6.96247 11.897 6.97295 11.8955 6.9834C11.8971 6.97295 11.8982 6.96247 11.9004 6.95215ZM4.65137 5.97754C4.62849 6.03229 4.60852 6.08831 4.58887 6.14453C4.60851 6.0883 4.6285 6.03229 4.65137 5.97754ZM4.73633 5.79492C4.7241 5.81941 4.71274 5.8443 4.70117 5.86914C4.71273 5.8443 4.72411 5.81941 4.73633 5.79492ZM4.84473 5.59863C4.82627 5.62957 4.80836 5.66078 4.79102 5.69238C4.80835 5.66077 4.82628 5.62957 4.84473 5.59863ZM4.95605 5.42383C4.93113 5.45972 4.90714 5.49624 4.88379 5.5332C4.90712 5.49623 4.93114 5.45973 4.95605 5.42383ZM8.31445 4.27051C8.52443 4.33607 8.72746 4.42504 8.91992 4.53613L8.9209 4.53516C8.72801 4.42379 8.52395 4.33516 8.31348 4.26953L8.31445 4.27051ZM5.09082 5.24609C5.06172 5.28198 5.03326 5.3183 5.00586 5.35547C5.03325 5.31828 5.06173 5.28199 5.09082 5.24609ZM6.63965 5.29199C6.64276 5.29067 6.6463 5.29037 6.64941 5.28906C6.6463 5.29037 6.64276 5.29067 6.63965 5.29199ZM7.9209 5.19824H7.92188H7.9209ZM6.90234 5.20215H6.90332H6.90234ZM5.23145 5.08496C5.19896 5.11965 5.16651 5.15429 5.13574 5.19043C5.1665 5.15428 5.19897 5.11966 5.23145 5.08496ZM13.9766 4.93652V4.9375V4.93652ZM0.922852 4.53613C0.885573 4.63126 0.850299 4.72727 0.817383 4.82422V4.8252C0.850362 4.72803 0.885496 4.63148 0.922852 4.53613ZM2.01855 4.5293H2.01953H2.01855ZM1.04688 4.24316C1.02195 4.29878 0.998013 4.35481 0.974609 4.41113C0.998008 4.35481 1.02196 4.29878 1.04688 4.24316ZM7.22363 4.13965L7.22461 4.14062L7.22363 4.13965ZM7.66699 4.14453L7.66602 4.14355L7.66699 4.14453ZM1.17188 3.97852C1.1445 4.03303 1.11865 4.08828 1.09277 4.14355C1.11864 4.08828 1.14451 4.03304 1.17188 3.97852ZM12.4287 4.0498V4.04883V4.0498ZM12.6348 2.66992V2.6709C12.8546 2.91962 13.0566 3.1828 13.2383 3.45898C13.1171 3.27471 12.987 3.09618 12.8486 2.92383C12.7796 2.83782 12.708 2.75273 12.6348 2.66992ZM1.30859 3.72168C1.28765 3.75921 1.26729 3.79703 1.24707 3.83496C1.26728 3.79703 1.28765 3.75921 1.30859 3.72168ZM2.72656 3.40723V3.4082L4.7793 3.41797V3.41699L2.72656 3.40723ZM12.0234 3.49707C12.0719 3.55591 12.1198 3.61522 12.166 3.67578L12.0234 3.49609L9.95898 3.4668L12.0234 3.49707ZM1.47852 3.43457C1.45114 3.47831 1.42381 3.52205 1.39746 3.56641C1.4238 3.52204 1.45115 3.47831 1.47852 3.43457ZM9.78809 3.43164C9.79329 3.43365 9.79845 3.43566 9.80371 3.4375C9.79845 3.43567 9.79329 3.43365 9.78809 3.43164ZM5.22852 3.23926V3.24023V3.23926ZM1.64746 3.17676C1.61837 3.21879 1.58963 3.26104 1.56152 3.30371C1.58963 3.26104 1.61837 3.21879 1.64746 3.17676ZM2.11523 2.5752H2.11621H2.11523ZM8.94629 0.53418C8.96978 0.559626 8.99096 0.587273 9.00879 0.617188C8.97313 0.557368 8.92497 0.505135 8.86816 0.464844L8.94629 0.53418ZM6.37305 0.307617C6.26302 0.322319 6.15337 0.34041 6.04395 0.360352C6.15337 0.340409 6.26301 0.322304 6.37305 0.307617ZM8.35059 0.325195C8.25055 0.310024 8.15027 0.296933 8.0498 0.286133C8.15027 0.296945 8.25055 0.310026 8.35059 0.325195ZM7.92578 0.275391C7.85971 0.269476 7.79372 0.26282 7.72754 0.258789C7.79372 0.262834 7.85971 0.269466 7.92578 0.275391ZM6.9502 0.255859C6.89287 0.258741 6.83558 0.262311 6.77832 0.266602C6.83559 0.262325 6.89287 0.258726 6.9502 0.255859ZM7.58008 0.25293C7.53418 0.251105 7.4883 0.248968 7.44238 0.248047C7.4883 0.24898 7.53418 0.251094 7.58008 0.25293ZM7.12988 0.249023C7.17448 0.24794 7.21907 0.247302 7.26367 0.24707C7.21907 0.247314 7.17448 0.247928 7.12988 0.249023ZM6.67871 0.274414C6.57668 0.283521 6.47471 0.294033 6.37305 0.307617C6.47471 0.294047 6.57668 0.283499 6.67871 0.274414Z",fill:"#97A3B7"})),H8=e=>N.createElement("svg",{width:14,height:15,viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_189_1728)"},N.createElement("path",{d:"M2.33317 2.4672H11.6665V9.4672H3.01567L2.33317 10.1497V2.4672ZM2.33317 1.30054C1.6915 1.30054 1.17234 1.82554 1.17234 2.4672L1.1665 12.9672L3.49984 10.6339H11.6665C12.3082 10.6339 12.8332 10.1089 12.8332 9.4672V2.4672C12.8332 1.82554 12.3082 1.30054 11.6665 1.30054H2.33317ZM3.49984 7.13387H8.1665V8.30054H3.49984V7.13387ZM3.49984 5.38387H10.4998V6.55054H3.49984V5.38387ZM3.49984 3.63387H10.4998V4.80054H3.49984V3.63387Z",fill:"#97A3B7"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_189_1728"},N.createElement("rect",{width:14,height:14,fill:"white",transform:"translate(0 0.133789)"})))),W8=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_3803_129233)"},N.createElement("path",{d:"M7.3335 4.66683H8.66683V6.00016H7.3335V4.66683ZM7.3335 7.3335H8.66683V11.3335H7.3335V7.3335ZM8.00016 1.3335C4.32016 1.3335 1.3335 4.32016 1.3335 8.00016C1.3335 11.6802 4.32016 14.6668 8.00016 14.6668C11.6802 14.6668 14.6668 11.6802 14.6668 8.00016C14.6668 4.32016 11.6802 1.3335 8.00016 1.3335ZM8.00016 13.3335C5.06016 13.3335 2.66683 10.9402 2.66683 8.00016C2.66683 5.06016 5.06016 2.66683 8.00016 2.66683C10.9402 2.66683 13.3335 5.06016 13.3335 8.00016C13.3335 10.9402 10.9402 13.3335 8.00016 13.3335Z",fill:"#6F7C90"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_3803_129233"},N.createElement("rect",{width:16,height:16,fill:"white"})))),Z8=({analysisData:e,isAdmin:t=!1,conversationId:n,showGoToApp:r=!1,redirectToAdmin:o,goToApps:s,hideTooltip:i,sendTrackingEvent:a})=>{const[l,c]=_.useState(!1),[u,p]=_.useState(!1),[g,E]=_.useState([]),{mutate:y,isPending:d}=d8(),{logoUrl:f,cardTitle:h,id:v,externalResourceId:C,connectorId:I,textToHighlight:x}=e.cardData||{};if(_.useEffect(()=>{var H,z,U;const j=(U=(z=(H=e==null?void 0:e.cardData)==null?void 0:H.data)==null?void 0:z.flatDetails)==null?void 0:U.data;if(j){const J=j.sort((Y,ae)=>Y.priority-ae.priority);E(J),a(En.OBJECT_HOVERED,{key:x,cardId:v})}},[e,x,a,v]),!g||g.length===0)return null;const w=()=>{c(!0),a(En.FEEDBACK_OPTION_CLICKED,{key:x,cardId:v,connectorId:I,externalResourceId:C})},T=()=>{p(!0),a(En.NEGATIVE_FEEDBACK_CLICKED,{key:x,cardId:v,connectorId:I,externalResourceId:C})},A=j=>{const H={card_id:v,entity_id:C,comment:j.feedbackComment,option:j.feedbackOption,feedback_type:"entity_extraction"};typeof j.isThumbsUp<"u"&&(H.positive_feedback=j.isThumbsUp),y({conversationId:n,feedbackData:H},{onSuccess:()=>{const z={cardId:v,externalResourceId:C,connectorId:I,key:x};l?a(En.FEEDBACK_OPTION_SUBMITTED,z):u&&a(En.NEGATIVE_FEEDBACK_SUBMITTED,z),c(!1),p(!1),Re({message:I8,type:sn})},onError:()=>{Re({message:w8,type:at})}})},S=()=>{A({isThumbsUp:!0}),a(En.POSITIVE_FEEDBACK_CLICKED,{key:x,cardId:v,connectorId:I,externalResourceId:C})},F=j=>{A({...j,isThumbsUp:!1})},D=()=>{o==null||o(I),i()},k=()=>{s==null||s()},M=j=>{a(En.PERMALINK_CLICKED,{key:x,cardId:v,clickedValue:j,connectorId:I,externalResourceId:C})};return m.jsxs(m.Fragment,{children:[m.jsxs(L8,{children:[m.jsxs(k8,{children:[m.jsxs(O8,{children:[m.jsxs(b.Stack,{flexDirection:"row",alignItems:"center",style:{height:"100%"},children:[f&&m.jsx("img",{src:f,alt:"Logo",style:{marginRight:8},height:18,width:18}),m.jsx(b.Tooltip,{title:h,arrow:!0,placement:"top",children:m.jsx(D8,{variant:"h3",color:b.theme.palette.gray.black,width:r?"100px":"200px",children:h})})]}),r?m.jsx(B8,{variant:"text",size:"small",endIcon:m.jsx(b.icons.ArrowForward,{}),onClick:k,children:b8}):null]}),m.jsx(F8,{}),m.jsx(b.Box,{paddingY:"16px",children:g.map(({key:j,value:H,label:z,deepLink:U})=>m.jsxs(M8,{children:[m.jsxs(N8,{children:[z,":"]}),m.jsx(b.Tooltip,{title:(H==null?void 0:H.length)>kc?H:"",arrow:!0,placement:"top",children:U?m.jsx(b.Link,{href:U,target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"none",color:b.theme.palette.primary.main},onClick:()=>M(H),children:Du(H||"N/A",kc)}):m.jsx(R8,{children:Du(H||"N/A",kc)})})]},j))})]}),m.jsxs(P8,{children:[m.jsx(b.Stack,{flexDirection:"row",alignItems:"center",children:t?m.jsx(Do,{arrow:!0,title:g8,placement:"top",children:m.jsx(b.IconButton,{onClick:D,children:m.jsx(G8,{})})}):m.jsxs(m.Fragment,{children:[m.jsx(b.Typography,{color:b.theme.palette.gray.gray3,fontSize:12,children:y8}),m.jsx(Do,{arrow:!0,title:m8,placement:"top",children:m.jsx(b.IconButton,{size:"small",children:m.jsx(W8,{})})})]})}),m.jsxs(b.Stack,{flexDirection:"row",alignItems:"center",children:[m.jsx(Do,{arrow:!0,title:f8,placement:"top",children:m.jsx(b.IconButton,{size:"small",disabled:d,onClick:S,children:m.jsx(j8,{})})}),m.jsx(Do,{arrow:!0,title:p8,placement:"top",children:m.jsx(b.IconButton,{size:"small",disabled:d,onClick:T,children:m.jsx(V8,{})})}),m.jsx(Do,{arrow:!0,title:h8,placement:"top",children:m.jsx(b.IconButton,{onClick:w,size:"small",disabled:d,children:m.jsx(H8,{})})})]})]})]}),m.jsx(So,{shown:l,setShown:c,borderRadius:12,sx:{zIndex:15002},children:m.jsx(Wp,{onCancel:()=>c(!1),onSubmit:A,isLoading:d,showOptions:!1,title:v8})}),m.jsx(So,{shown:u,setShown:p,borderRadius:12,sx:{zIndex:15002},children:m.jsx(Wp,{onCancel:()=>p(!1),onSubmit:F,isLoading:d,title:C8})})]})},X8=b.styled(({className:e,...t})=>m.jsx(b.Tooltip,{...t,classes:{popper:e}}))(()=>({[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:"#fff",padding:0,maxWidth:"288px",width:"288px",maxHeight:"300px",overflowY:"auto",borderRadius:"12px",boxShadow:"0px 0px 8px 0px #04060F14",border:`1px solid ${b.theme.palette.gray.gray6}`,position:"relative"}}));function z8({elements:e,title:t,onKeyChange:n}){const[r,o]=_.useState(!1),[s,i]=_.useState(null),[a,l]=_.useState(""),[c,u]=_.useState("bottom"),[p,g]=_.useState(!1),E=_.useRef(null),y=_.useRef({x:0,y:0}),d=_.useCallback(()=>{E.current&&(clearTimeout(E.current),E.current=null)},[]),f=_.useCallback((T,A,S,F=10)=>T>=S.left-F&&T<=S.right+F&&A>=S.top-F&&A<=S.bottom+F,[]),h=_.useCallback(T=>{const A=T.getBoundingClientRect(),S=window.innerHeight,F=window.innerWidth,D=350,k=400,M=A.top,j=S-A.bottom;return j>=D||j>M?A.left<k/2?"bottom-start":F-A.right<k/2?"bottom-end":"bottom":A.left<k/2?"top-start":F-A.right<k/2?"top-end":"top"},[]);_.useEffect(()=>{if(e&&e.length>0){const T=F=>{const D=F.currentTarget,k=D.textContent||"",M=h(D);u(M),l(k),n&&n(k),i(D),o(!0)},A=()=>{if(r&&s){const F=h(s);u(F)}},S=F=>{if(y.current={x:F.clientX,y:F.clientY},!r||p)return;const D=F.clientX,k=F.clientY;let M=!1;for(const j of e)if(f(D,k,j.getBoundingClientRect())){M=!0;break}if(!M){const j=document.querySelector(`.${b.tooltipClasses.tooltip}`);j&&f(D,k,j.getBoundingClientRect())&&(M=!0)}M||(o(!1),i(null))};return e.forEach(F=>{F.addEventListener("mouseenter",T)}),window.addEventListener("resize",A),window.addEventListener("scroll",A),document.addEventListener("mousemove",S),()=>{e.forEach(F=>{F.removeEventListener("mouseenter",T)}),window.removeEventListener("resize",A),window.removeEventListener("scroll",A),document.removeEventListener("mousemove",S),d()}}},[e,n,r,s,h,p,d,f]);const v=()=>{g(!0),d()},C=()=>{g(!1),E.current=setTimeout(()=>{o(!1),i(null)},150)},x=typeof t=="function"?t(a,()=>{o(!1),i(null)}):t,w=m.jsx("div",{onMouseEnter:v,onMouseLeave:C,children:x});return m.jsx(X8,{title:w,open:r,placement:c,disableInteractive:!1,PopperProps:{anchorEl:s,modifiers:[{name:"preventOverflow",options:{boundary:window}}]},children:m.jsx("span",{})})}const Y8=({conversationId:e,hasSmList:t,isAdmin:n,goToApps:r,redirectToAdmin:o,sendTrackingEvent:s})=>{const[i,a]=_.useState(null),[l,c]=_.useState([]),{data:u,isError:p}=l8(e,t);return _.useEffect(()=>(console.log("Connector Highlighter mounting++++",{conversationId:e}),()=>{console.log("Connector Highlighter unmounting++++",{conversationId:e})}),[e]),_.useEffect(()=>{u?a(u):p&&a(null)},[u,p]),console.log("analysisData in ConnectorHighlighter++++",i),_.useEffect(()=>{let g=null;return i&&Object.keys(i).length&&e&&(g=new u8(Object.keys(i)||[]),window.gmailHighlighter=g,s(En.OBJECT_HIGHLIGHTED,{keys:Object.keys(i)}),setTimeout(()=>{const E=Array.from(document.querySelectorAll(".gmail-highlight"));c(E)},1e3)),()=>{g&&g.destroy(),window.tooltipCleanup&&delete window.tooltipCleanup}},[i,e,s]),m.jsx("div",{children:m.jsx(z8,{elements:l,title:(g,E)=>{var y;return!i||!g||!((y=i[g])!=null&&y.cardData)?m.jsx("div",{children:"Loading data..."}):m.jsx(Z8,{conversationId:e||"",analysisData:i[g],isAdmin:n,redirectToAdmin:o,goToApps:r,hideTooltip:E,sendTrackingEvent:s})}})})},J8=({children:e})=>m.jsx(Ju,{store:jp,children:m.jsx(b.HiverProvider,{custom:!0,children:m.jsx(Bp,{children:m.jsx(_.Suspense,{fallback:m.jsx(m.Fragment,{}),children:e})})})}),Q8=({conversationId:e,hasSmList:t,isAdmin:n,connectorFunctions:r})=>m.jsx(Vp,{children:m.jsxs(J8,{children:[m.jsx(Y8,{hasSmList:t,conversationId:e,isAdmin:n,goToApps:r.goToApps,redirectToAdmin:r.redirectToAdmin,sendTrackingEvent:r.sendTrackingEvent}),Ne.createPortal(m.jsx(Gp,{id:"toast-message",children:m.jsx(tl,{position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0})}),document.body)]})});le.CONNECTORS_AGENT_EVENTS=Fc,le.ConnectorCardList=s8,le.HiverConnectorBifrostAuth=ze,le.IntegrationSense=Q8,le.addNewConnectors=P1,le.dismissNotification=fl,le.getConnectorsBifrostConfigs=Yt,le.getMetaData=Hy,le.initConnectorsBifrost=lg,le.setCaptureFeedbackOnDemand=B1,le.shouldCaptureFeedback=Bi,le.shouldShowNotification=dl,Object.defineProperty(le,Symbol.toStringTag,{value:"Module"})});
2302
+ `,j8=e=>N.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M7.87354 2.73877C7.87354 2.30139 7.53821 1.94227 7.11084 1.90381L5.09229 6.44775C5.06387 6.51167 5.02799 6.57074 4.98975 6.62744V12.3667H10.4722C11.0395 12.3665 11.5225 11.9529 11.6089 11.3921L12.2368 7.30811C12.3437 6.61168 11.8047 5.98395 11.1001 5.98389H9.05615C8.40276 5.98371 7.87354 5.45372 7.87354 4.80029V2.73877ZM2.07275 11.8003C2.07275 12.1133 2.32718 12.3667 2.64014 12.3667H3.78955V7.1499H2.64014C2.32718 7.1499 2.07275 7.40432 2.07275 7.71729V11.8003ZM9.07275 4.78369H11.1001C12.5403 4.78375 13.6412 6.0673 13.4224 7.49072L12.7944 11.5747C12.6179 12.7208 11.6318 13.5667 10.4722 13.5669H2.64014C1.66443 13.5669 0.873535 12.776 0.873535 11.8003V7.71729C0.873535 6.74158 1.66443 5.95068 2.64014 5.95068H3.99951L6.04834 1.34131L6.12256 1.20166C6.31844 0.892431 6.66142 0.700708 7.03467 0.700684C8.16045 0.700684 9.07275 1.61299 9.07275 2.73877V4.78369Z",fill:"#97A3B7"})),V8=e=>N.createElement("svg",{width:13,height:14,viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M11.8008 3.16651C11.8008 2.83026 11.7996 2.61407 11.7861 2.44972C11.7733 2.29228 11.7516 2.23558 11.7383 2.20948C11.684 2.10311 11.5976 2.0167 11.4912 1.96241C11.4651 1.94911 11.4084 1.92742 11.251 1.91456C11.0866 1.90113 10.8698 1.89991 10.5332 1.89991H10.084V7.11671H10.5332C10.8697 7.11671 11.0866 7.11647 11.251 7.10304C11.4084 7.09017 11.4651 7.06848 11.4912 7.05519C11.5977 7.00085 11.684 6.91369 11.7383 6.80714C11.7516 6.78095 11.7733 6.72473 11.7861 6.56788C11.7996 6.40344 11.8008 6.18671 11.8008 5.85011V3.16651ZM6.00001 11.5288C6.00014 11.9658 6.33491 12.3239 6.76173 12.3628L8.68946 8.02784C8.73905 7.91626 8.79776 7.77463 8.8838 7.6421V1.89991H4.30275C3.86739 1.89991 3.57385 1.9011 3.34571 1.91847C3.12524 1.93527 3.00982 1.96482 2.92677 2.00245C2.72742 2.09281 2.55809 2.23906 2.43849 2.42237C2.38875 2.49873 2.34108 2.60774 2.29103 2.82276C2.23917 3.04561 2.19414 3.33583 2.12794 3.76612L1.82325 5.74952C1.73618 6.31551 1.67724 6.70248 1.65724 7.00245C1.63765 7.29653 1.66125 7.4439 1.69923 7.54347C1.79436 7.79282 1.97309 8.00139 2.20509 8.13331C2.29773 8.18598 2.43978 8.23198 2.73341 8.25733C3.03294 8.28318 3.42441 8.2837 3.99708 8.2837H4.46681C4.62026 8.2837 4.77205 8.28306 4.89943 8.29347C5.00019 8.30172 5.11526 8.31839 5.23439 8.36085L5.3545 8.41261L5.51271 8.51026C5.61292 8.58313 5.70157 8.67078 5.77443 8.77101L5.8711 8.93019L5.92286 9.0503C5.96524 9.1694 5.98202 9.28456 5.99025 9.38526C6.00063 9.51256 6.00001 9.66359 6.00001 9.8169V11.5288ZM13 5.85011C13 6.1669 13.0008 6.44089 12.9824 6.66554C12.9635 6.89709 12.9214 7.12868 12.8076 7.35206C12.6383 7.68439 12.3684 7.95514 12.0361 8.12452C11.8127 8.23838 11.5803 8.2804 11.3486 8.29933C11.124 8.31767 10.8499 8.3169 10.5332 8.3169H10.0899C9.97739 8.31691 9.91771 8.31637 9.87501 8.31886C9.85536 8.35692 9.83103 8.41194 9.78517 8.51515L7.82521 12.9263C7.6519 13.3159 7.26532 13.5669 6.83888 13.5669C5.71318 13.5669 4.80093 12.6545 4.80079 11.5288V9.8169C4.80079 9.64881 4.799 9.55553 4.79396 9.48878C4.72728 9.48383 4.63383 9.4839 4.46681 9.4839H3.99708C3.44579 9.4839 2.99395 9.48395 2.63087 9.45265C2.26202 9.42082 1.92186 9.35223 1.61232 9.17628C1.13824 8.90671 0.772529 8.48073 0.578136 7.9712C0.451217 7.63844 0.43534 7.29185 0.459972 6.92237C0.484222 6.55869 0.552876 6.11195 0.63673 5.5669L0.942394 3.58351C1.00581 3.17132 1.05751 2.82883 1.12208 2.55128C1.18838 2.26634 1.27691 2.00629 1.4336 1.76612C1.67803 1.39152 2.02424 1.0943 2.43165 0.909678C2.69285 0.791323 2.96319 0.743407 3.25489 0.721201C3.53908 0.699573 3.8856 0.700693 4.30275 0.700693H10.5332C10.8499 0.700693 11.124 0.69993 11.3486 0.718272C11.5803 0.737198 11.8127 0.779216 12.0361 0.893076C12.3683 1.06241 12.6383 1.33244 12.8076 1.66456C12.9215 1.88802 12.9635 2.12041 12.9824 2.35206C13.0008 2.57656 13 2.85001 13 3.16651V5.85011Z",fill:"#97A3B7"})),G8=e=>N.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M6.02637 0.261719C6.91006 0.100716 7.81654 0.108586 8.69727 0.285156C8.77943 0.301685 8.85737 0.335356 8.92578 0.383789C8.99413 0.432207 9.05187 0.494446 9.09473 0.566406L10.1699 2.37109L12.2686 2.40137C12.3521 2.40267 12.4348 2.42105 12.5107 2.45605C12.5866 2.49114 12.6547 2.5417 12.71 2.60449L12.9268 2.8623C13.4177 3.47393 13.8044 4.1638 14.0703 4.90332H14.0713C14.1006 4.98499 14.1111 5.07276 14.1035 5.15918C14.0958 5.24545 14.0694 5.32914 14.0264 5.4043L13.0107 7.17676L14.0654 8.97949C14.1089 9.05374 14.1349 9.13706 14.1436 9.22266C14.1522 9.30829 14.143 9.39509 14.1152 9.47656C13.8308 10.316 13.3846 11.0919 12.8008 11.7588C12.7442 11.8235 12.6731 11.8748 12.5947 11.9102C12.5163 11.9454 12.4307 11.9644 12.3447 11.9639L10.2559 11.9512L9.22656 13.7188C9.18293 13.7935 9.12263 13.8576 9.05176 13.9072C8.98094 13.9567 8.90045 13.9914 8.81543 14.0068C7.9318 14.1675 7.02506 14.1583 6.14453 13.9814L6.14355 13.9824C6.0797 13.9694 6.01838 13.9446 5.96191 13.9121C5.87332 13.8615 5.7985 13.7897 5.74609 13.7021L4.67188 11.8955L2.56934 11.8682C2.48571 11.8669 2.4031 11.8485 2.32715 11.8135C2.25108 11.7784 2.18323 11.727 2.12793 11.6641C1.60736 11.0751 1.18875 10.4045 0.888672 9.67969L0.767578 9.36621C0.738264 9.28452 0.726773 9.19681 0.734375 9.11035C0.742031 9.02393 0.768379 8.93953 0.811523 8.86426L1.82617 7.0918L0.772461 5.28906C0.729026 5.2148 0.702006 5.1315 0.693359 5.0459C0.684801 4.96052 0.695058 4.87421 0.722656 4.79297C1.00784 3.95289 1.45608 3.17678 2.04102 2.50977C2.09771 2.44503 2.16762 2.39274 2.24609 2.35742C2.32438 2.32222 2.40928 2.30426 2.49512 2.30469L4.58398 2.31543L5.61426 0.549805C5.65789 0.474997 5.71718 0.410066 5.78809 0.360352C5.8591 0.31064 5.94107 0.277156 6.02637 0.261719ZM7.53809 14.0195C7.59898 14.0196 7.65982 14.0181 7.7207 14.0166C7.65982 14.0181 7.59898 14.0196 7.53809 14.0195ZM7.2334 14.0117C7.28581 14.014 7.33818 14.0164 7.39062 14.0176C7.33818 14.0164 7.28581 14.014 7.2334 14.0117ZM7.85742 14.0127C7.89653 14.0109 7.93552 14.0073 7.97461 14.0049C7.93552 14.0073 7.89654 14.0109 7.85742 14.0127ZM6.91113 13.9902C6.97295 13.9958 7.03476 14.0009 7.09668 14.0049C7.03476 14.0009 6.97295 13.9958 6.91113 13.9902ZM6.6543 13.9619C6.6898 13.9665 6.72519 13.9716 6.76074 13.9756C6.72519 13.9716 6.6898 13.9665 6.6543 13.9619ZM5.91016 13.75C5.94027 13.7795 5.97474 13.8051 6.01172 13.8262L5.95898 13.791C5.94197 13.7782 5.92535 13.7649 5.91016 13.75ZM6.58008 12.9414H6.58105H6.58008ZM8.2002 1.41895C7.63858 1.33129 7.06722 1.32543 6.50391 1.40137L5.5127 3.10059C5.45667 3.19686 5.37383 3.27503 5.27539 3.32715C5.21254 3.36088 5.14878 3.39942 5.08594 3.43555L5.08496 3.43457C4.99197 3.48895 4.88605 3.51825 4.77832 3.51758L2.77637 3.50586C2.43354 3.9367 2.15694 4.41647 1.95508 4.92871L2.96875 6.66211H2.96973C3.01013 6.73278 3.03531 6.81132 3.04492 6.8916L3.04883 6.97461C3.04667 7.04613 3.0485 7.11658 3.05078 7.18945C3.0548 7.30124 3.02821 7.41268 2.97266 7.50977L1.99609 9.21289C2.21404 9.7388 2.50744 10.2299 2.86621 10.6719L4.88281 10.7012H4.88379C4.99002 10.7034 5.09368 10.7341 5.18457 10.7891L5.39258 10.9082C5.45916 10.9464 5.51715 10.9978 5.56445 11.0576L5.6084 11.1201L6.6416 12.8486C7.20362 12.9365 7.77513 12.9432 8.33887 12.8672L9.3291 11.1689C9.38528 11.0722 9.46843 10.9926 9.56738 10.9404C9.63017 10.9067 9.69505 10.8701 9.75781 10.834L9.8291 10.7988C9.90336 10.7678 9.98341 10.7514 10.0645 10.752L12.0664 10.7646C12.4092 10.3324 12.6847 9.85062 12.8857 9.33691L11.8711 7.60645L11.8721 7.60547C11.8181 7.51108 11.7903 7.40365 11.792 7.29492L11.791 7.29395C11.7932 7.22206 11.7923 7.15042 11.79 7.07715C11.7862 6.96565 11.8128 6.85466 11.8682 6.75781L12.8438 5.05371C12.6258 4.52811 12.3333 4.03648 11.9746 3.59473L9.95801 3.56641H9.95703C9.85067 3.56414 9.74722 3.53265 9.65625 3.47754V3.47852L9.45898 3.36426L9.39258 3.32129C9.32844 3.27486 9.27351 3.21669 9.23242 3.14844V3.14746L8.2002 1.41895ZM2.4668 11.7559L2.57031 11.7686H2.57129C2.50157 11.7675 2.43246 11.7518 2.36914 11.7227L2.4668 11.7559ZM1.78809 11.082V11.0811V11.082ZM13.0244 11.3203C13.0502 11.2862 13.0774 11.2533 13.1025 11.2188C13.0774 11.2533 13.0502 11.2862 13.0244 11.3203ZM13.2051 11.0713C13.2348 11.0279 13.2643 10.9845 13.293 10.9404C13.2643 10.9845 13.2348 11.0279 13.2051 11.0713ZM9.90918 10.876C9.90231 10.8782 9.89544 10.8803 9.88867 10.8828C9.89545 10.8803 9.90231 10.8782 9.90918 10.876ZM13.3535 10.8447C13.3903 10.7861 13.426 10.7268 13.4609 10.667C13.426 10.7268 13.3903 10.7861 13.3535 10.8447ZM13.5049 10.5928C13.5426 10.5264 13.5789 10.4593 13.6143 10.3916C13.5789 10.4593 13.5426 10.5264 13.5049 10.5928ZM13.6582 10.3066C13.695 10.2337 13.7305 10.1602 13.7646 10.0859C13.7305 10.1602 13.695 10.2337 13.6582 10.3066ZM7.2168 4.04004C7.82858 3.99994 8.43974 4.14269 8.9707 4.44922C9.68176 4.86085 10.2003 5.53844 10.4131 6.33203C10.6256 7.12573 10.5145 7.97155 10.1045 8.68359C9.79803 9.21429 9.34157 9.64291 8.79199 9.91406C8.24214 10.1852 7.62346 10.287 7.01562 10.207C6.40793 10.127 5.83684 9.86895 5.37598 9.46484C4.91529 9.06072 4.58448 8.52844 4.42578 7.93652C4.26721 7.34451 4.28843 6.71808 4.48535 6.1377C4.68236 5.55755 5.04627 5.04792 5.53223 4.6748C6.01845 4.30171 6.60526 4.08027 7.2168 4.04004ZM13.7852 10.041C13.8281 9.94559 13.8697 9.84945 13.9082 9.75195V9.75098C13.8696 9.84876 13.8283 9.94531 13.7852 10.041ZM6.40918 9.95703C6.46044 9.97542 6.51219 9.99222 6.56445 10.0078C6.51219 9.99225 6.46044 9.97539 6.40918 9.95703ZM6.20996 9.87695C6.25096 9.89508 6.2922 9.91244 6.33398 9.92871C6.2922 9.91247 6.25097 9.89505 6.20996 9.87695ZM6.02832 9.79004C6.0678 9.81077 6.10809 9.82969 6.14844 9.84863C6.10808 9.82972 6.06781 9.81074 6.02832 9.79004ZM5.84082 9.68262C5.87596 9.70443 5.9113 9.72578 5.94727 9.74609C5.91128 9.7258 5.87597 9.7044 5.84082 9.68262ZM12.9131 9.53613C12.9421 9.46825 12.9707 9.40012 12.9971 9.33105L12.9961 9.33008C12.9697 9.3993 12.9422 9.46808 12.9131 9.53613ZM5.66602 9.56543C5.7015 9.59105 5.73694 9.61662 5.77344 9.64062C5.73693 9.61664 5.70151 9.59104 5.66602 9.56543ZM1.97461 9.41699C1.99284 9.4575 2.01311 9.49704 2.03223 9.53711C1.98023 9.42813 1.93016 9.31814 1.88477 9.20605L1.97461 9.41699ZM5.59277 9.5127C5.59556 9.51484 5.59877 9.51642 5.60156 9.51855C5.54737 9.47722 5.49386 9.43478 5.44238 9.38965L5.59277 9.5127ZM8.03125 5.33496C7.67547 5.21424 7.29063 5.20159 6.92773 5.29883C6.56509 5.39617 6.23977 5.59952 5.99219 5.88184C5.74452 6.16433 5.58615 6.51424 5.53711 6.88672C5.48824 7.25901 5.54977 7.63783 5.71582 7.97461C5.88202 8.31152 6.14537 8.59145 6.4707 8.7793C6.90703 9.0311 7.42549 9.09913 7.91211 8.96875C8.39876 8.83831 8.81448 8.52031 9.06641 8.08398C9.25414 7.7587 9.3409 7.38453 9.31641 7.00977C9.2918 6.635 9.15631 6.27555 8.92773 5.97754C8.69908 5.67961 8.38685 5.45577 8.03125 5.33496ZM6.17676 8.69922C6.25355 8.76023 6.3343 8.81676 6.41992 8.86621L6.4209 8.86523C6.33525 8.81578 6.2536 8.76024 6.17676 8.69922ZM8.47754 8.83203V8.83105V8.83203ZM5.77637 8.27246C5.83227 8.35318 5.89399 8.4295 5.96094 8.50098L5.86426 8.38965C5.83359 8.35168 5.80422 8.31265 5.77637 8.27246ZM4.52246 7.91113C4.5608 8.0541 4.60948 8.19346 4.66797 8.32812C4.60945 8.19325 4.56083 8.05334 4.52246 7.91016V7.91113ZM9.40039 6.85645C9.40722 6.90519 9.41278 6.95457 9.41602 7.00391C9.41922 7.05311 9.42035 7.1023 9.41992 7.15137C9.42035 7.10204 9.41926 7.05239 9.41602 7.00293C9.41279 6.95379 9.40719 6.90498 9.40039 6.85645ZM11.9004 6.95215C11.8982 6.96247 11.897 6.97295 11.8955 6.9834C11.8971 6.97295 11.8982 6.96247 11.9004 6.95215ZM4.65137 5.97754C4.62849 6.03229 4.60852 6.08831 4.58887 6.14453C4.60851 6.0883 4.6285 6.03229 4.65137 5.97754ZM4.73633 5.79492C4.7241 5.81941 4.71274 5.8443 4.70117 5.86914C4.71273 5.8443 4.72411 5.81941 4.73633 5.79492ZM4.84473 5.59863C4.82627 5.62957 4.80836 5.66078 4.79102 5.69238C4.80835 5.66077 4.82628 5.62957 4.84473 5.59863ZM4.95605 5.42383C4.93113 5.45972 4.90714 5.49624 4.88379 5.5332C4.90712 5.49623 4.93114 5.45973 4.95605 5.42383ZM8.31445 4.27051C8.52443 4.33607 8.72746 4.42504 8.91992 4.53613L8.9209 4.53516C8.72801 4.42379 8.52395 4.33516 8.31348 4.26953L8.31445 4.27051ZM5.09082 5.24609C5.06172 5.28198 5.03326 5.3183 5.00586 5.35547C5.03325 5.31828 5.06173 5.28199 5.09082 5.24609ZM6.63965 5.29199C6.64276 5.29067 6.6463 5.29037 6.64941 5.28906C6.6463 5.29037 6.64276 5.29067 6.63965 5.29199ZM7.9209 5.19824H7.92188H7.9209ZM6.90234 5.20215H6.90332H6.90234ZM5.23145 5.08496C5.19896 5.11965 5.16651 5.15429 5.13574 5.19043C5.1665 5.15428 5.19897 5.11966 5.23145 5.08496ZM13.9766 4.93652V4.9375V4.93652ZM0.922852 4.53613C0.885573 4.63126 0.850299 4.72727 0.817383 4.82422V4.8252C0.850362 4.72803 0.885496 4.63148 0.922852 4.53613ZM2.01855 4.5293H2.01953H2.01855ZM1.04688 4.24316C1.02195 4.29878 0.998013 4.35481 0.974609 4.41113C0.998008 4.35481 1.02196 4.29878 1.04688 4.24316ZM7.22363 4.13965L7.22461 4.14062L7.22363 4.13965ZM7.66699 4.14453L7.66602 4.14355L7.66699 4.14453ZM1.17188 3.97852C1.1445 4.03303 1.11865 4.08828 1.09277 4.14355C1.11864 4.08828 1.14451 4.03304 1.17188 3.97852ZM12.4287 4.0498V4.04883V4.0498ZM12.6348 2.66992V2.6709C12.8546 2.91962 13.0566 3.1828 13.2383 3.45898C13.1171 3.27471 12.987 3.09618 12.8486 2.92383C12.7796 2.83782 12.708 2.75273 12.6348 2.66992ZM1.30859 3.72168C1.28765 3.75921 1.26729 3.79703 1.24707 3.83496C1.26728 3.79703 1.28765 3.75921 1.30859 3.72168ZM2.72656 3.40723V3.4082L4.7793 3.41797V3.41699L2.72656 3.40723ZM12.0234 3.49707C12.0719 3.55591 12.1198 3.61522 12.166 3.67578L12.0234 3.49609L9.95898 3.4668L12.0234 3.49707ZM1.47852 3.43457C1.45114 3.47831 1.42381 3.52205 1.39746 3.56641C1.4238 3.52204 1.45115 3.47831 1.47852 3.43457ZM9.78809 3.43164C9.79329 3.43365 9.79845 3.43566 9.80371 3.4375C9.79845 3.43567 9.79329 3.43365 9.78809 3.43164ZM5.22852 3.23926V3.24023V3.23926ZM1.64746 3.17676C1.61837 3.21879 1.58963 3.26104 1.56152 3.30371C1.58963 3.26104 1.61837 3.21879 1.64746 3.17676ZM2.11523 2.5752H2.11621H2.11523ZM8.94629 0.53418C8.96978 0.559626 8.99096 0.587273 9.00879 0.617188C8.97313 0.557368 8.92497 0.505135 8.86816 0.464844L8.94629 0.53418ZM6.37305 0.307617C6.26302 0.322319 6.15337 0.34041 6.04395 0.360352C6.15337 0.340409 6.26301 0.322304 6.37305 0.307617ZM8.35059 0.325195C8.25055 0.310024 8.15027 0.296933 8.0498 0.286133C8.15027 0.296945 8.25055 0.310026 8.35059 0.325195ZM7.92578 0.275391C7.85971 0.269476 7.79372 0.26282 7.72754 0.258789C7.79372 0.262834 7.85971 0.269466 7.92578 0.275391ZM6.9502 0.255859C6.89287 0.258741 6.83558 0.262311 6.77832 0.266602C6.83559 0.262325 6.89287 0.258726 6.9502 0.255859ZM7.58008 0.25293C7.53418 0.251105 7.4883 0.248968 7.44238 0.248047C7.4883 0.24898 7.53418 0.251094 7.58008 0.25293ZM7.12988 0.249023C7.17448 0.24794 7.21907 0.247302 7.26367 0.24707C7.21907 0.247314 7.17448 0.247928 7.12988 0.249023ZM6.67871 0.274414C6.57668 0.283521 6.47471 0.294033 6.37305 0.307617C6.47471 0.294047 6.57668 0.283499 6.67871 0.274414Z",fill:"#97A3B7"})),H8=e=>N.createElement("svg",{width:14,height:15,viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_189_1728)"},N.createElement("path",{d:"M2.33317 2.4672H11.6665V9.4672H3.01567L2.33317 10.1497V2.4672ZM2.33317 1.30054C1.6915 1.30054 1.17234 1.82554 1.17234 2.4672L1.1665 12.9672L3.49984 10.6339H11.6665C12.3082 10.6339 12.8332 10.1089 12.8332 9.4672V2.4672C12.8332 1.82554 12.3082 1.30054 11.6665 1.30054H2.33317ZM3.49984 7.13387H8.1665V8.30054H3.49984V7.13387ZM3.49984 5.38387H10.4998V6.55054H3.49984V5.38387ZM3.49984 3.63387H10.4998V4.80054H3.49984V3.63387Z",fill:"#97A3B7"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_189_1728"},N.createElement("rect",{width:14,height:14,fill:"white",transform:"translate(0 0.133789)"})))),W8=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_3803_129233)"},N.createElement("path",{d:"M7.3335 4.66683H8.66683V6.00016H7.3335V4.66683ZM7.3335 7.3335H8.66683V11.3335H7.3335V7.3335ZM8.00016 1.3335C4.32016 1.3335 1.3335 4.32016 1.3335 8.00016C1.3335 11.6802 4.32016 14.6668 8.00016 14.6668C11.6802 14.6668 14.6668 11.6802 14.6668 8.00016C14.6668 4.32016 11.6802 1.3335 8.00016 1.3335ZM8.00016 13.3335C5.06016 13.3335 2.66683 10.9402 2.66683 8.00016C2.66683 5.06016 5.06016 2.66683 8.00016 2.66683C10.9402 2.66683 13.3335 5.06016 13.3335 8.00016C13.3335 10.9402 10.9402 13.3335 8.00016 13.3335Z",fill:"#6F7C90"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_3803_129233"},N.createElement("rect",{width:16,height:16,fill:"white"})))),Z8=({analysisData:e,isAdmin:t=!1,conversationId:n,showGoToApp:r=!1,redirectToAdmin:o,goToApps:s,hideTooltip:i,sendTrackingEvent:a})=>{const[l,c]=_.useState(!1),[u,p]=_.useState(!1),[g,E]=_.useState([]),{mutate:y,isPending:d}=d8(),{logoUrl:f,cardTitle:h,id:v,externalResourceId:C,connectorId:I,textToHighlight:x}=e.cardData||{};if(_.useEffect(()=>{var H,z,U;const j=(U=(z=(H=e==null?void 0:e.cardData)==null?void 0:H.data)==null?void 0:z.flatDetails)==null?void 0:U.data;if(j){const J=j.sort((Y,ae)=>Y.priority-ae.priority);E(J),a(In.OBJECT_HOVERED,{key:x,cardId:v})}},[e,x,a,v]),!g||g.length===0)return null;const w=()=>{c(!0),a(In.FEEDBACK_OPTION_CLICKED,{key:x,cardId:v,connectorId:I,externalResourceId:C})},T=()=>{p(!0),a(In.NEGATIVE_FEEDBACK_CLICKED,{key:x,cardId:v,connectorId:I,externalResourceId:C})},A=j=>{const H={card_id:v,entity_id:C,comment:j.feedbackComment,option:j.feedbackOption,feedback_type:"entity_extraction"};typeof j.isThumbsUp<"u"&&(H.positive_feedback=j.isThumbsUp),y({conversationId:n,feedbackData:H},{onSuccess:()=>{const z={cardId:v,externalResourceId:C,connectorId:I,key:x};l?a(In.FEEDBACK_OPTION_SUBMITTED,z):u&&a(In.NEGATIVE_FEEDBACK_SUBMITTED,z),c(!1),p(!1),Re({message:I8,type:sn})},onError:()=>{Re({message:w8,type:at})}})},S=()=>{A({isThumbsUp:!0}),a(In.POSITIVE_FEEDBACK_CLICKED,{key:x,cardId:v,connectorId:I,externalResourceId:C})},F=j=>{A({...j,isThumbsUp:!1})},D=()=>{o==null||o(I),i()},k=()=>{s==null||s()},M=j=>{a(In.PERMALINK_CLICKED,{key:x,cardId:v,clickedValue:j,connectorId:I,externalResourceId:C})};return m.jsxs(m.Fragment,{children:[m.jsxs(L8,{children:[m.jsxs(k8,{children:[m.jsxs(O8,{children:[m.jsxs(b.Stack,{flexDirection:"row",alignItems:"center",style:{height:"100%"},children:[f&&m.jsx("img",{src:f,alt:"Logo",style:{marginRight:8},height:18,width:18}),m.jsx(b.Tooltip,{title:h,arrow:!0,placement:"top",children:m.jsx(D8,{variant:"h3",color:b.theme.palette.gray.black,width:r?"100px":"200px",children:h})})]}),r?m.jsx(B8,{variant:"text",size:"small",endIcon:m.jsx(b.icons.ArrowForward,{}),onClick:k,children:b8}):null]}),m.jsx(F8,{}),m.jsx(b.Box,{paddingY:"16px",children:g.map(({key:j,value:H,label:z,deepLink:U})=>m.jsxs(M8,{children:[m.jsxs(N8,{children:[z,":"]}),m.jsx(b.Tooltip,{title:(H==null?void 0:H.length)>kc?H:"",arrow:!0,placement:"top",children:U?m.jsx(b.Link,{href:U,target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"none",color:b.theme.palette.primary.main},onClick:()=>M(H),children:Du(H||"N/A",kc)}):m.jsx(R8,{children:Du(H||"N/A",kc)})})]},j))})]}),m.jsxs(P8,{children:[m.jsx(b.Stack,{flexDirection:"row",alignItems:"center",children:t?m.jsx(Do,{arrow:!0,title:g8,placement:"top",children:m.jsx(b.IconButton,{onClick:D,children:m.jsx(G8,{})})}):m.jsxs(m.Fragment,{children:[m.jsx(b.Typography,{color:b.theme.palette.gray.gray3,fontSize:12,children:y8}),m.jsx(Do,{arrow:!0,title:m8,placement:"top",children:m.jsx(b.IconButton,{size:"small",children:m.jsx(W8,{})})})]})}),m.jsxs(b.Stack,{flexDirection:"row",alignItems:"center",children:[m.jsx(Do,{arrow:!0,title:f8,placement:"top",children:m.jsx(b.IconButton,{size:"small",disabled:d,onClick:S,children:m.jsx(j8,{})})}),m.jsx(Do,{arrow:!0,title:p8,placement:"top",children:m.jsx(b.IconButton,{size:"small",disabled:d,onClick:T,children:m.jsx(V8,{})})}),m.jsx(Do,{arrow:!0,title:h8,placement:"top",children:m.jsx(b.IconButton,{onClick:w,size:"small",disabled:d,children:m.jsx(H8,{})})})]})]})]}),m.jsx(So,{shown:l,setShown:c,borderRadius:12,sx:{zIndex:15002},children:m.jsx(Wp,{onCancel:()=>c(!1),onSubmit:A,isLoading:d,showOptions:!1,title:v8})}),m.jsx(So,{shown:u,setShown:p,borderRadius:12,sx:{zIndex:15002},children:m.jsx(Wp,{onCancel:()=>p(!1),onSubmit:F,isLoading:d,title:C8})})]})},X8=b.styled(({className:e,...t})=>m.jsx(b.Tooltip,{...t,classes:{popper:e}}))(()=>({[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:"#fff",padding:0,maxWidth:"288px",width:"288px",maxHeight:"300px",overflowY:"auto",borderRadius:"12px",boxShadow:"0px 0px 8px 0px #04060F14",border:`1px solid ${b.theme.palette.gray.gray6}`,position:"relative"}}));function z8({elements:e,title:t,onKeyChange:n}){const[r,o]=_.useState(!1),[s,i]=_.useState(null),[a,l]=_.useState(""),[c,u]=_.useState("bottom"),[p,g]=_.useState(!1),E=_.useRef(null),y=_.useRef({x:0,y:0}),d=_.useCallback(()=>{E.current&&(clearTimeout(E.current),E.current=null)},[]),f=_.useCallback((T,A,S,F=10)=>T>=S.left-F&&T<=S.right+F&&A>=S.top-F&&A<=S.bottom+F,[]),h=_.useCallback(T=>{const A=T.getBoundingClientRect(),S=window.innerHeight,F=window.innerWidth,D=350,k=400,M=A.top,j=S-A.bottom;return j>=D||j>M?A.left<k/2?"bottom-start":F-A.right<k/2?"bottom-end":"bottom":A.left<k/2?"top-start":F-A.right<k/2?"top-end":"top"},[]);_.useEffect(()=>{if(e&&e.length>0){const T=F=>{const D=F.currentTarget,k=D.textContent||"",M=h(D);u(M),l(k),n&&n(k),i(D),o(!0)},A=()=>{if(r&&s){const F=h(s);u(F)}},S=F=>{if(y.current={x:F.clientX,y:F.clientY},!r||p)return;const D=F.clientX,k=F.clientY;let M=!1;for(const j of e)if(f(D,k,j.getBoundingClientRect())){M=!0;break}if(!M){const j=document.querySelector(`.${b.tooltipClasses.tooltip}`);j&&f(D,k,j.getBoundingClientRect())&&(M=!0)}M||(o(!1),i(null))};return e.forEach(F=>{F.addEventListener("mouseenter",T)}),window.addEventListener("resize",A),window.addEventListener("scroll",A),document.addEventListener("mousemove",S),()=>{e.forEach(F=>{F.removeEventListener("mouseenter",T)}),window.removeEventListener("resize",A),window.removeEventListener("scroll",A),document.removeEventListener("mousemove",S),d()}}},[e,n,r,s,h,p,d,f]);const v=()=>{g(!0),d()},C=()=>{g(!1),E.current=setTimeout(()=>{o(!1),i(null)},150)},x=typeof t=="function"?t(a,()=>{o(!1),i(null)}):t,w=m.jsx("div",{onMouseEnter:v,onMouseLeave:C,children:x});return m.jsx(X8,{title:w,open:r,placement:c,disableInteractive:!1,PopperProps:{anchorEl:s,modifiers:[{name:"preventOverflow",options:{boundary:window}}]},children:m.jsx("span",{})})}const Y8=({conversationId:e,hasSmList:t,isAdmin:n,goToApps:r,redirectToAdmin:o,sendTrackingEvent:s})=>{const[i,a]=_.useState(null),[l,c]=_.useState([]),{data:u,isError:p}=l8(e,t);return _.useEffect(()=>(console.log("Connector Highlighter mounting++++",{conversationId:e}),()=>{console.log("Connector Highlighter unmounting++++",{conversationId:e})}),[e]),_.useEffect(()=>{u?a(u):p&&a(null)},[u,p]),console.log("analysisData in ConnectorHighlighter++++",i),_.useEffect(()=>{let g=null;return i&&Object.keys(i).length&&e&&(g=new u8(Object.keys(i)||[],c),s(In.OBJECT_HIGHLIGHTED,{keys:Object.keys(i)})),()=>{g&&g.destroy(),window.tooltipCleanup&&delete window.tooltipCleanup}},[i,e,s]),m.jsx("div",{children:m.jsx(z8,{elements:l,title:(g,E)=>{var y;return!i||!g||!((y=i[g])!=null&&y.cardData)?m.jsx("div",{children:"Loading data..."}):m.jsx(Z8,{conversationId:e||"",analysisData:i[g],isAdmin:n,redirectToAdmin:o,goToApps:r,hideTooltip:E,sendTrackingEvent:s})}})})},J8=({children:e})=>m.jsx(Ju,{store:jp,children:m.jsx(b.HiverProvider,{custom:!0,children:m.jsx(Bp,{children:m.jsx(_.Suspense,{fallback:m.jsx(m.Fragment,{}),children:e})})})}),Q8=({conversationId:e,hasSmList:t,isAdmin:n,connectorFunctions:r})=>m.jsx(Vp,{children:m.jsxs(J8,{children:[m.jsx(Y8,{hasSmList:t,conversationId:e,isAdmin:n,goToApps:r.goToApps,redirectToAdmin:r.redirectToAdmin,sendTrackingEvent:r.sendTrackingEvent}),Ne.createPortal(m.jsx(Gp,{id:"toast-message",children:m.jsx(tl,{position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0})}),document.body)]})});le.CONNECTORS_AGENT_EVENTS=Fc,le.ConnectorCardList=s8,le.HiverConnectorBifrostAuth=ze,le.IntegrationSense=Q8,le.addNewConnectors=P1,le.dismissNotification=fl,le.getConnectorsBifrostConfigs=Yt,le.getMetaData=Hy,le.initConnectorsBifrost=lg,le.setCaptureFeedbackOnDemand=B1,le.shouldCaptureFeedback=Bi,le.shouldShowNotification=dl,Object.defineProperty(le,Symbol.toStringTag,{value:"Module"})});