@hiver/connector-admin 3.0.5-beta.2 → 3.0.5-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/connectors/index.d.ts.map +1 -1
- package/app/connectors/pages/connector-view/dashboard/index.d.ts.map +1 -1
- package/constants/gainsight.d.ts +1 -0
- package/constants/gainsight.d.ts.map +1 -1
- package/features/request-new-connector/components/request-new-card/index.d.ts.map +1 -1
- package/features/request-new-connector/components/request-new-modal/index.d.ts.map +1 -1
- package/index.es.js +291 -288
- package/index.umd.js +29 -29
- package/package.json +1 -1
package/index.umd.js
CHANGED
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
`+ge+_}}var Ae=!1,me;{var ze=typeof WeakMap=="function"?WeakMap:Map;me=new ze}function V(_,F){if(!_||Ae)return"";{var J=me.get(_);if(J!==void 0)return J}var ce;Ae=!0;var ne=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var be;be=ie.current,ie.current=null,oe();try{if(F){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(Dt){ce=Dt}Reflect.construct(_,[],le)}else{try{le.call()}catch(Dt){ce=Dt}_.call(le.prototype)}}else{try{throw Error()}catch(Dt){ce=Dt}_()}}catch(Dt){if(Dt&&ce&&typeof Dt.stack=="string"){for(var ae=Dt.stack.split(`
|
|
19
19
|
`),ke=ce.stack.split(`
|
|
20
20
|
`),Ne=ae.length-1,Fe=ke.length-1;Ne>=1&&Fe>=0&&ae[Ne]!==ke[Fe];)Fe--;for(;Ne>=1&&Fe>=0;Ne--,Fe--)if(ae[Ne]!==ke[Fe]){if(Ne!==1||Fe!==1)do if(Ne--,Fe--,Fe<0||ae[Ne]!==ke[Fe]){var Me=`
|
|
21
|
-
`+ae[Ne].replace(" at new "," at ");return _.displayName&&Me.includes("<anonymous>")&&(Me=Me.replace("<anonymous>",_.displayName)),typeof _=="function"&&me.set(_,Me),Me}while(Ne>=1&&Fe>=0);break}}}finally{Ae=!1,ie.current=be,de(),Error.prepareStackTrace=ne}var bt=_?_.displayName||_.name:"",ot=bt?Ee(bt):"";return typeof _=="function"&&me.set(_,ot),ot}function Ye(_,F,J){return V(_,!1)}function Le(_){var F=_.prototype;return!!(F&&F.isReactComponent)}function Ue(_,F,J){if(_==null)return"";if(typeof _=="function")return V(_,Le(_));if(typeof _=="string")return Ee(_);switch(_){case u:return Ee("Suspense");case c:return Ee("SuspenseList")}if(typeof _=="object")switch(_.$$typeof){case s:return Ye(_.render);case f:return Ue(_.type,F,J);case b:{var ce=_,ne=ce._payload,be=ce._init;try{return Ue(be(ne),F,J)}catch{}}}return""}var Pt=Object.prototype.hasOwnProperty,Nn={},kt=h.ReactDebugCurrentFrame;function
|
|
21
|
+
`+ae[Ne].replace(" at new "," at ");return _.displayName&&Me.includes("<anonymous>")&&(Me=Me.replace("<anonymous>",_.displayName)),typeof _=="function"&&me.set(_,Me),Me}while(Ne>=1&&Fe>=0);break}}}finally{Ae=!1,ie.current=be,de(),Error.prepareStackTrace=ne}var bt=_?_.displayName||_.name:"",ot=bt?Ee(bt):"";return typeof _=="function"&&me.set(_,ot),ot}function Ye(_,F,J){return V(_,!1)}function Le(_){var F=_.prototype;return!!(F&&F.isReactComponent)}function Ue(_,F,J){if(_==null)return"";if(typeof _=="function")return V(_,Le(_));if(typeof _=="string")return Ee(_);switch(_){case u:return Ee("Suspense");case c:return Ee("SuspenseList")}if(typeof _=="object")switch(_.$$typeof){case s:return Ye(_.render);case f:return Ue(_.type,F,J);case b:{var ce=_,ne=ce._payload,be=ce._init;try{return Ue(be(ne),F,J)}catch{}}}return""}var Pt=Object.prototype.hasOwnProperty,Nn={},kt=h.ReactDebugCurrentFrame;function qt(_){if(_){var F=_._owner,J=Ue(_.type,_._source,F?F.type:null);kt.setExtraStackFrame(J)}else kt.setExtraStackFrame(null)}function mt(_,F,J,ce,ne){{var be=Function.call.bind(Pt);for(var le in _)if(be(_,le)){var ae=void 0;try{if(typeof _[le]!="function"){var ke=Error((ce||"React class")+": "+J+" type `"+le+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof _[le]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ke.name="Invariant Violation",ke}ae=_[le](F,le,ce,J,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ne){ae=Ne}ae&&!(ae instanceof Error)&&(qt(ne),g("%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).",ce||"React class",J,le,typeof ae),qt(null)),ae instanceof Error&&!(ae.message in Nn)&&(Nn[ae.message]=!0,qt(ne),g("Failed %s type: %s",J,ae.message),qt(null))}}}var zn=Array.isArray;function cn(_){return zn(_)}function So(_){{var F=typeof Symbol=="function"&&Symbol.toStringTag,J=F&&_[Symbol.toStringTag]||_.constructor.name||"Object";return J}}function To(_){try{return Ao(_),!1}catch{return!0}}function Ao(_){return""+_}function Dn(_){if(To(_))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",So(_)),Ao(_)}var Vt=h.ReactCurrentOwner,Xn={key:!0,ref:!0,__self:!0,__source:!0},dn,fn,Ct;Ct={};function Ur(_){if(Pt.call(_,"ref")){var F=Object.getOwnPropertyDescriptor(_,"ref").get;if(F&&F.isReactWarning)return!1}return _.ref!==void 0}function Fr(_){if(Pt.call(_,"key")){var F=Object.getOwnPropertyDescriptor(_,"key").get;if(F&&F.isReactWarning)return!1}return _.key!==void 0}function _o(_,F){if(typeof _.ref=="string"&&Vt.current&&F&&Vt.current.stateNode!==F){var J=G(Vt.current.type);Ct[J]||(g('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',G(Vt.current.type),_.ref),Ct[J]=!0)}}function pn(_,F){{var J=function(){dn||(dn=!0,g("%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)",F))};J.isReactWarning=!0,Object.defineProperty(_,"key",{get:J,configurable:!0})}}function qr(_,F){{var J=function(){fn||(fn=!0,g("%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)",F))};J.isReactWarning=!0,Object.defineProperty(_,"ref",{get:J,configurable:!0})}}var we=function(_,F,J,ce,ne,be,le){var ae={$$typeof:t,type:_,key:F,ref:J,props:le,_owner:be};return ae._store={},Object.defineProperty(ae._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ae,"_self",{configurable:!1,enumerable:!1,writable:!1,value:ce}),Object.defineProperty(ae,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ne}),Object.freeze&&(Object.freeze(ae.props),Object.freeze(ae)),ae};function mr(_,F,J,ce,ne){{var be,le={},ae=null,ke=null;J!==void 0&&(Dn(J),ae=""+J),Fr(F)&&(Dn(F.key),ae=""+F.key),Ur(F)&&(ke=F.ref,_o(F,ne));for(be in F)Pt.call(F,be)&&!Xn.hasOwnProperty(be)&&(le[be]=F[be]);if(_&&_.defaultProps){var Ne=_.defaultProps;for(be in Ne)le[be]===void 0&&(le[be]=Ne[be])}if(ae||ke){var Fe=typeof _=="function"?_.displayName||_.name||"Unknown":_;ae&&pn(le,Fe),ke&&qr(le,Fe)}return we(_,ae,ke,ne,ce,Vt.current,le)}}var er=h.ReactCurrentOwner,wt=h.ReactDebugCurrentFrame;function Ke(_){if(_){var F=_._owner,J=Ue(_.type,_._source,F?F.type:null);wt.setExtraStackFrame(J)}else wt.setExtraStackFrame(null)}var ht;ht=!1;function At(_){return typeof _=="object"&&_!==null&&_.$$typeof===t}function _t(){{if(er.current){var _=G(er.current.type);if(_)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+_+"`."}return""}}function rn(_){return""}var Lt={};function Gt(_){{var F=_t();if(!F){var J=typeof _=="string"?_:_.displayName||_.name;J&&(F=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+J+">.")}return F}}function Kt(_,F){{if(!_._store||_._store.validated||_.key!=null)return;_._store.validated=!0;var J=Gt(F);if(Lt[J])return;Lt[J]=!0;var ce="";_&&_._owner&&_._owner!==er.current&&(ce=" It was passed a child from "+G(_._owner.type)+".")
|
|
25
|
+
Check the top-level render call using <`+J+">.")}return F}}function Kt(_,F){{if(!_._store||_._store.validated||_.key!=null)return;_._store.validated=!0;var J=Gt(F);if(Lt[J])return;Lt[J]=!0;var ce="";_&&_._owner&&_._owner!==er.current&&(ce=" It was passed a child from "+G(_._owner.type)+"."),Ke(_),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',J,ce),Ke(null)}}function Pn(_,F){{if(typeof _!="object")return;if(cn(_))for(var J=0;J<_.length;J++){var ce=_[J];At(ce)&&Kt(ce,F)}else if(At(_))_._store&&(_._store.validated=!0);else if(_){var ne=p(_);if(typeof ne=="function"&&ne!==_.entries)for(var be=ne.call(_),le;!(le=be.next()).done;)At(le.value)&&Kt(le.value,F)}}}function Wt(_){{var F=_.type;if(F==null||typeof F=="string")return;var J;if(typeof F=="function")J=F.propTypes;else if(typeof F=="object"&&(F.$$typeof===s||F.$$typeof===f))J=F.propTypes;else return;if(J){var ce=G(F);mt(J,_.props,"prop",ce,_)}else if(F.PropTypes!==void 0&&!ht){ht=!0;var ne=G(F);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ne||"Unknown")}typeof F.getDefaultProps=="function"&&!F.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function xt(_){{for(var F=Object.keys(_.props),J=0;J<F.length;J++){var ce=F[J];if(ce!=="children"&&ce!=="key"){Ke(_),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ce),Ke(null);break}}_.ref!==null&&(Ke(_),g("Invalid attribute `ref` supplied to `React.Fragment`."),Ke(null))}}var Zn={};function Yn(_,F,J,ce,ne,be){{var le=M(_);if(!le){var ae="";(_===void 0||typeof _=="object"&&_!==null&&Object.keys(_).length===0)&&(ae+=" 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 ke=rn();ke?ae+=ke:ae+=_t();var Ne;_===null?Ne="null":cn(_)?Ne="array":_!==void 0&&_.$$typeof===t?(Ne="<"+(G(_.type)||"Unknown")+" />",ae=" Did you accidentally export a JSX literal instead of a component?"):Ne=typeof _,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ne,ae)}var Fe=mr(_,F,J,ne,be);if(Fe==null)return Fe;if(le){var Me=F.children;if(Me!==void 0)if(ce)if(cn(Me)){for(var bt=0;bt<Me.length;bt++)Pn(Me[bt],_);Object.freeze&&Object.freeze(Me)}else g("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 Pn(Me,_)}if(Pt.call(F,"key")){var ot=G(_),Dt=Object.keys(F).filter(function(tr){return tr!=="key"}),gn=Dt.length>0?"{key: someKey, "+Dt.join(": ..., ")+": ...}":"{key: someKey}";if(!Zn[ot+gn]){var Mr=Dt.length>0?"{"+Dt.join(": ..., ")+": ...}":"{}";g(`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:
|
|
@@ -64,7 +64,7 @@ Take a look at the reducer(s) handling this action type: ${y.type}.
|
|
|
64
64
|
`)}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[ch]=this[ch]={accessors:{}}).accessors,o=this.prototype;function i(a){const l=ga(a);r[l]||(oC(o,a),r[l]=!0)}return Y.isArray(t)?t.forEach(i):i(t),this}}Fs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Y.reduceDescriptors(Fs.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),Y.freezeMethods(Fs);var or=Fs;function Xu(e,t){const n=this||Hu,r=t||n,o=or.from(r.headers);let i=r.data;return Y.forEach(e,function(l){i=l.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function dh(e){return!!(e&&e.__CANCEL__)}function li(e,t,n){je.call(this,e??"canceled",je.ERR_CANCELED,t,n),this.name="CanceledError"}Y.inherits(li,je,{__CANCEL__:!0});function fh(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new je("Request failed with status code "+n.status,[je.ERR_BAD_REQUEST,je.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function iC(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function aC(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,a;return t=t!==void 0?t:1e3,function(s){const u=Date.now(),c=r[i];a||(a=u),n[o]=s,r[o]=u;let f=i,b=0;for(;f!==o;)b+=n[f++],f=f%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),u-a<t)return;const y=c&&u-c;return y?Math.round(b*1e3/y):void 0}}function sC(e,t){let n=0,r=1e3/t,o,i;const a=(u,c=Date.now())=>{n=c,o=null,i&&(clearTimeout(i),i=null),e.apply(null,u)};return[(...u)=>{const c=Date.now(),f=c-n;f>=r?a(u,c):(o=u,i||(i=setTimeout(()=>{i=null,a(o)},r-f)))},()=>o&&a(o)]}const Ms=(e,t,n=3)=>{let r=0;const o=aC(50,250);return sC(i=>{const a=i.loaded,l=i.lengthComputable?i.total:void 0,s=a-r,u=o(s),c=a<=l;r=a;const f={loaded:a,total:l,progress:l?a/l:void 0,bytes:s,rate:u||void 0,estimated:u&&l&&c?(l-a)/u:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},ph=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},hh=e=>(...t)=>Y.asap(()=>e(...t));var lC=In.hasStandardBrowserEnv?function(){const t=In.navigator&&/(msie|trident)/i.test(In.navigator.userAgent),n=document.createElement("a");let r;function o(i){let a=i;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{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(a){const l=Y.isString(a)?o(a):a;return l.protocol===r.protocol&&l.host===r.host}}():function(){return function(){return!0}}(),uC=In.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const a=[e+"="+encodeURIComponent(t)];Y.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),Y.isString(r)&&a.push("path="+r),Y.isString(o)&&a.push("domain="+o),i===!0&&a.push("secure"),document.cookie=a.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 cC(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function dC(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function gh(e,t){return e&&!cC(t)?dC(e,t):t}const mh=e=>e instanceof or?{...e}:e;function Mo(e,t){t=t||{};const n={};function r(u,c,f){return Y.isPlainObject(u)&&Y.isPlainObject(c)?Y.merge.call({caseless:f},u,c):Y.isPlainObject(c)?Y.merge({},c):Y.isArray(c)?c.slice():c}function o(u,c,f){if(Y.isUndefined(c)){if(!Y.isUndefined(u))return r(void 0,u,f)}else return r(u,c,f)}function i(u,c){if(!Y.isUndefined(c))return r(void 0,c)}function a(u,c){if(Y.isUndefined(c)){if(!Y.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function l(u,c,f){if(f in t)return r(u,c);if(f in e)return r(void 0,u)}const s={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(u,c)=>o(mh(u),mh(c),!0)};return Y.forEach(Object.keys(Object.assign({},e,t)),function(c){const f=s[c]||o,b=f(e[c],t[c],c);Y.isUndefined(b)&&f!==l||(n[c]=b)}),n}var bh=e=>{const t=Mo({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:l}=t;t.headers=a=or.from(a),t.url=ah(gh(t.baseURL,t.url),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let s;if(Y.isFormData(n)){if(In.hasStandardBrowserEnv||In.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((s=a.getContentType())!==!1){const[u,...c]=s?s.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([u||"multipart/form-data",...c].join("; "))}}if(In.hasStandardBrowserEnv&&(r&&Y.isFunction(r)&&(r=r(t)),r||r!==!1&&lC(t.url))){const u=o&&i&&uC.read(i);u&&a.set(o,u)}return t},fC=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=bh(e);let i=o.data;const a=or.from(o.headers).normalize();let{responseType:l,onUploadProgress:s,onDownloadProgress:u}=o,c,f,b,y,v;function d(){y&&y(),v&&v(),o.cancelToken&&o.cancelToken.unsubscribe(c),o.signal&&o.signal.removeEventListener("abort",c)}let p=new XMLHttpRequest;p.open(o.method.toUpperCase(),o.url,!0),p.timeout=o.timeout;function h(){if(!p)return;const m=or.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),x={data:!l||l==="text"||l==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:m,config:e,request:p};fh(function(T){n(T),d()},function(T){r(T),d()},x),p=null}"onloadend"in p?p.onloadend=h:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(h)},p.onabort=function(){p&&(r(new je("Request aborted",je.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new je("Network Error",je.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let E=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const x=o.transitional||lh;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),r(new je(E,x.clarifyTimeoutError?je.ETIMEDOUT:je.ECONNABORTED,e,p)),p=null},i===void 0&&a.setContentType(null),"setRequestHeader"in p&&Y.forEach(a.toJSON(),function(E,x){p.setRequestHeader(x,E)}),Y.isUndefined(o.withCredentials)||(p.withCredentials=!!o.withCredentials),l&&l!=="json"&&(p.responseType=o.responseType),u&&([b,v]=Ms(u,!0),p.addEventListener("progress",b)),s&&p.upload&&([f,y]=Ms(s),p.upload.addEventListener("progress",f),p.upload.addEventListener("loadend",y)),(o.cancelToken||o.signal)&&(c=m=>{p&&(r(!m||m.type?new li(null,e,p):m),p.abort(),p=null)},o.cancelToken&&o.cancelToken.subscribe(c),o.signal&&(o.signal.aborted?c():o.signal.addEventListener("abort",c)));const g=iC(o.url);if(g&&In.protocols.indexOf(g)===-1){r(new je("Unsupported protocol "+g+":",je.ERR_BAD_REQUEST,e));return}p.send(i||null)})},pC=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const i=function(u){if(!o){o=!0,l();const c=u instanceof Error?u:this.reason;r.abort(c instanceof je?c:new li(c instanceof Error?c.message:c))}};let a=t&&setTimeout(()=>{a=null,i(new je(`timeout ${t} of ms exceeded`,je.ETIMEDOUT))},t);const l=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:s}=r;return s.unsubscribe=()=>Y.asap(l),s}};const hC=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},gC=async function*(e,t){for await(const n of mC(e))yield*hC(n,t)},mC=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()}},vh=(e,t,n,r)=>{const o=gC(e,t);let i=0,a,l=s=>{a||(a=!0,r&&r(s))};return new ReadableStream({async pull(s){try{const{done:u,value:c}=await o.next();if(u){l(),s.close();return}let f=c.byteLength;if(n){let b=i+=f;n(b)}s.enqueue(new Uint8Array(c))}catch(u){throw l(u),u}},cancel(s){return l(s),o.return()}},{highWaterMark:2})},Bs=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",yh=Bs&&typeof ReadableStream=="function",bC=Bs&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Eh=(e,...t)=>{try{return!!e(...t)}catch{return!1}},vC=yh&&Eh(()=>{let e=!1;const t=new Request(In.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),xh=64*1024,Zu=yh&&Eh(()=>Y.isReadableStream(new Response("").body)),js={stream:Zu&&(e=>e.body)};Bs&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!js[t]&&(js[t]=Y.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new je(`Response type '${t}' is not supported`,je.ERR_NOT_SUPPORT,r)})})})(new Response);const yC=async e=>{if(e==null)return 0;if(Y.isBlob(e))return e.size;if(Y.isSpecCompliantForm(e))return(await new Request(In.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Y.isArrayBufferView(e)||Y.isArrayBuffer(e))return e.byteLength;if(Y.isURLSearchParams(e)&&(e=e+""),Y.isString(e))return(await bC(e)).byteLength},EC=async(e,t)=>{const n=Y.toFiniteNumber(e.getContentLength());return n??yC(t)};var xC=Bs&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:a,onDownloadProgress:l,onUploadProgress:s,responseType:u,headers:c,withCredentials:f="same-origin",fetchOptions:b}=bh(e);u=u?(u+"").toLowerCase():"text";let y=pC([o,i&&i.toAbortSignal()],a),v;const d=y&&y.unsubscribe&&(()=>{y.unsubscribe()});let p;try{if(s&&vC&&n!=="get"&&n!=="head"&&(p=await EC(c,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),A;if(Y.isFormData(r)&&(A=x.headers.get("content-type"))&&c.setContentType(A),x.body){const[T,C]=ph(p,Ms(hh(s)));r=vh(x.body,xh,T,C)}}Y.isString(f)||(f=f?"include":"omit");const h="credentials"in Request.prototype;v=new Request(t,{...b,signal:y,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:h?f:void 0});let g=await fetch(v);const m=Zu&&(u==="stream"||u==="response");if(Zu&&(l||m&&d)){const x={};["status","statusText","headers"].forEach(O=>{x[O]=g[O]});const A=Y.toFiniteNumber(g.headers.get("content-length")),[T,C]=l&&ph(A,Ms(hh(l),!0))||[];g=new Response(vh(g.body,xh,T,()=>{C&&C(),d&&d()}),x)}u=u||"text";let E=await js[Y.findKey(js,u)||"text"](g,e);return!m&&d&&d(),await new Promise((x,A)=>{fh(x,A,{data:E,headers:or.from(g.headers),status:g.status,statusText:g.statusText,config:e,request:v})})}catch(h){throw d&&d(),h&&h.name==="TypeError"&&/fetch/i.test(h.message)?Object.assign(new je("Network Error",je.ERR_NETWORK,e,v),{cause:h.cause||h}):je.from(h,h&&h.code,e,v)}});const Yu={http:Fx,xhr:fC,fetch:xC};Y.forEach(Yu,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ch=e=>`- ${e}`,CC=e=>Y.isFunction(e)||e===null||e===!1;var wh={getAdapter:e=>{e=Y.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){n=e[i];let a;if(r=n,!CC(n)&&(r=Yu[(a=String(n)).toLowerCase()],r===void 0))throw new je(`Unknown adapter '${a}'`);if(r)break;o[a||"#"+i]=r}if(!r){const i=Object.entries(o).map(([l,s])=>`adapter ${l} `+(s===!1?"is not supported by the environment":"is not available in the build"));let a=t?i.length>1?`since :
|
|
65
65
|
`+i.map(Ch).join(`
|
|
66
66
|
`):" "+Ch(i[0]):"as no adapter specified";throw new je("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Yu};function Uu(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new li(null,e)}function Ih(e){return Uu(e),e.headers=or.from(e.headers),e.data=Xu.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),wh.getAdapter(e.adapter||Hu.adapter)(e).then(function(r){return Uu(e),r.data=Xu.call(e,e.transformResponse,r),r.headers=or.from(r.headers),r},function(r){return dh(r)||(Uu(e),r&&r.response&&(r.response.data=Xu.call(e,e.transformResponse,r.response),r.response.headers=or.from(r.response.headers))),Promise.reject(r)})}const Sh="1.7.7",qu={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{qu[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Th={};qu.transitional=function(t,n,r){function o(i,a){return"[Axios v"+Sh+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,l)=>{if(t===!1)throw new je(o(a," has been removed"+(n?" in "+n:"")),je.ERR_DEPRECATED);return n&&!Th[a]&&(Th[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,l):!0}};function wC(e,t,n){if(typeof e!="object")throw new je("options must be an object",je.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const l=e[i],s=l===void 0||a(l,i,e);if(s!==!0)throw new je("option "+i+" must be "+s,je.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new je("Unknown option "+i,je.ERR_BAD_OPTION)}}var Ju={assertOptions:wC,validators:qu};const eo=Ju.validators;let Vs=class{constructor(t){this.defaults=t,this.interceptors={request:new sh,response:new sh}}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 i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
67
|
-
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Mo(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Ju.assertOptions(r,{silentJSONParsing:eo.transitional(eo.boolean),forcedJSONParsing:eo.transitional(eo.boolean),clarifyTimeoutError:eo.transitional(eo.boolean)},!1),o!=null&&(Y.isFunction(o)?n.paramsSerializer={serialize:o}:Ju.assertOptions(o,{encode:eo.function,serialize:eo.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&Y.merge(i.common,i[n.method]);i&&Y.forEach(["delete","get","head","post","put","patch","common"],v=>{delete i[v]}),n.headers=or.concat(a,i);const l=[];let s=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(n)===!1||(s=s&&d.synchronous,l.unshift(d.fulfilled,d.rejected))});const u=[];this.interceptors.response.forEach(function(d){u.push(d.fulfilled,d.rejected)});let c,f=0,b;if(!s){const v=[Ih.bind(this),void 0];for(v.unshift.apply(v,l),v.push.apply(v,u),b=v.length,c=Promise.resolve(n);f<b;)c=c.then(v[f++],v[f++]);return c}b=l.length;let y=n;for(f=0;f<b;){const v=l[f++],d=l[f++];try{y=v(y)}catch(p){d.call(this,p);break}}try{c=Ih.call(this,y)}catch(v){return Promise.reject(v)}for(f=0,b=u.length;f<b;)c=c.then(u[f++],u[f++]);return c}getUri(t){t=Mo(this.defaults,t);const n=gh(t.baseURL,t.url);return ah(n,t.params,t.paramsSerializer)}};Y.forEach(["delete","get","head","options"],function(t){Vs.prototype[t]=function(n,r){return this.request(Mo(r||{},{method:t,url:n,data:(r||{}).data}))}}),Y.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,l){return this.request(Mo(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}Vs.prototype[t]=n(),Vs.prototype[t+"Form"]=n(!0)});var Gs=Vs;class Qu{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(l=>{r.subscribe(l),i=l}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,l){r.reason||(r.reason=new li(i,a,l),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 Qu(function(o){t=o}),cancel:t}}}var IC=Qu;function SC(e){return function(n){return e.apply(null,n)}}function TC(e){return Y.isObject(e)&&e.isAxiosError===!0}const $u={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($u).forEach(([e,t])=>{$u[t]=e});var AC=$u;function Ah(e){const t=new Gs(e),n=zp(Gs.prototype.request,t);return Y.extend(n,Gs.prototype,t,{allOwnKeys:!0}),Y.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Ah(Mo(e,o))},n}const Ft=Ah(Hu);Ft.Axios=Gs,Ft.CanceledError=li,Ft.CancelToken=IC,Ft.isCancel=dh,Ft.VERSION=Sh,Ft.toFormData=ks,Ft.AxiosError=je,Ft.Cancel=Ft.CanceledError,Ft.all=function(t){return Promise.all(t)},Ft.spread=SC,Ft.isAxiosError=TC,Ft.mergeConfig=Mo,Ft.AxiosHeaders=or,Ft.formToJSON=e=>uh(Y.isHTMLForm(e)?new FormData(e):e),Ft.getAdapter=wh.getAdapter,Ft.HttpStatusCode=AC,Ft.default=Ft;var _h=Ft,et={},to={};(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={}))})(to);var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.getProdHqConfig=Sn.getProdApiConfig=Sn.getSitHqConfig=Sn.getSitApiConfig=Sn.getDevHqConfig=Sn.getDevApiConfig=void 0;var ui={heimdallTokenFetch:"/v1/token/get",heimdallLogin:"/v1/login/code",heimdallLogout:"/v1/logout",v2Login:"/api/auth/login/code",hotLogin:"/api/auth/login/code"},_C=function(){return{v2Url:"https://v2dev.hiver.space",heimdallUrl:"https://dev.hiver.space/api/heimdall-api",hotUrl:"http://local.hiverhq.co.in:3000",apiEndpoints:ui}};Sn.getDevApiConfig=_C;var OC=function(){return{v2Url:"https://v2dev.hiver.space",heimdallUrl:"https://dev.hiver.space/api/heimdall-api2",hotUrl:"http://local.hiverhq.co.in:3000",apiEndpoints:ui}};Sn.getDevHqConfig=OC;var RC=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:ui}};Sn.getSitApiConfig=RC;var NC=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:ui}};Sn.getSitHqConfig=NC;var DC=function(){return{v2Url:"https://v2.hiverhq.com",heimdallUrl:"https://heimdall.hiverapi.com",hotUrl:"https://app.hiverhq.com",apiEndpoints:ui}};Sn.getProdApiConfig=DC;var PC=function(){return{v2Url:"https://v2.hiverhq.com",heimdallUrl:"https://heimdall2.hiverhq.com",hotUrl:"https://app.hiverhq.com",apiEndpoints:ui}};Sn.getProdHqConfig=PC;var vr={},yr={};Object.defineProperty(yr,"__esModule",{value:!0}),yr.removeValue=yr.getValue=yr.setValue=void 0;var Ku={};function kC(e,t){Ku[e]=t}yr.setValue=kC;function LC(e){return Ku[e]}yr.getValue=LC;function FC(e){delete Ku[e]}yr.removeValue=FC,Object.defineProperty(vr,"__esModule",{value:!0}),vr.removeItemFromStorage=vr.setItemInStorage=vr.getItemFromStorage=void 0;var ci=to,di=yr,MC=function(e,t){switch(t===void 0&&(t=(0,di.getValue)("PLATFORM")),t){case ci.PLATFORM.WEB:return sessionStorage.getItem(e);case ci.PLATFORM.MOBILE:return(0,di.getValue)(e);default:throw Error("Invalid PLATFORM ".concat(t))}};vr.getItemFromStorage=MC;var BC=function(e,t,n){switch(n===void 0&&(n=(0,di.getValue)("PLATFORM")),n){case ci.PLATFORM.WEB:return sessionStorage.setItem(e,t);case ci.PLATFORM.MOBILE:return(0,di.setValue)(e,t);default:throw Error("Invalid PLATFORM ".concat(n))}};vr.setItemInStorage=BC;var jC=function(e,t){switch(t===void 0&&(t=(0,di.getValue)("PLATFORM")),t){case ci.PLATFORM.WEB:sessionStorage.removeItem(e);break;case ci.PLATFORM.MOBILE:(0,di.removeValue)(e);break;default:throw Error("Invalid PLATFORM ".concat(t))}};vr.removeItemFromStorage=jC;var VC=Be&&Be.__awaiter||function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function l(c){try{u(r.next(c))}catch(f){a(f)}}function s(c){try{u(r.throw(c))}catch(f){a(f)}}function u(c){c.done?i(c.value):o(c.value).then(l,s)}u((r=r.apply(e,t||[])).next())})},GC=Be&&Be.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(u){return function(c){return s([u,c])}}function s(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(et,"__esModule",{value:!0}),et.expireToken=et.invalidateToken=et.validateToken=et.validateAccount=et.getConfig=et.introduceDelay=et.isTokenInExpiryWindow=et.getStoredAuthData=et.setUserDetails=et.getRefreshInterval=et.setTokenAndExpiry=et.getRandomDelay=et.hasValidToken=void 0;var jr=to,fi=Sn,Gn=vr,ec=function(){var e=new Date,t=new Date(e.getTime()+e.getTimezoneOffset()*6e4);return t},tc=function(e){var t=parseInt((0,Gn.getItemFromStorage)("hiverAuthUserId")||"0"),n=parseInt((0,Gn.getItemFromStorage)("hiverAuthUserGroupId")||"0"),r=e.userId,o=e.usergroupId;return t===r&&o===n};et.validateAccount=tc;var WC=function(e){var t=tc(e);return!Oh()&&t};et.validateToken=WC;var HC=function(e){return e.apiRetry?e.apiRetry>0:!1};et.invalidateToken=HC;var zC=function(){try{sessionStorage.removeItem("hiverAuthTokenExpiry")}catch{console.log("Heimdall: Unable to Remove token.")}};et.expireToken=zC;var XC=function(e){var t=(0,Gn.getItemFromStorage)("hiverAuthTokenExpiry")||"",n=new Date(t),r=ec(),o=tc(e);return console.log("Heimdall: checking if there is a valid token",r<n&&o),r<n&&o};et.hasValidToken=XC;var ZC=function(){return Math.floor(Math.random()*6e4)+6e4};et.getRandomDelay=ZC;var YC=function(e,t){if(!e||!t)throw new Error("User Id or user group Id not found in the response");(0,Gn.setItemInStorage)("hiverAuthUserId",e),(0,Gn.setItemInStorage)("hiverAuthUserGroupId",t)};et.setUserDetails=YC;var UC=function(e,t){if(!e)throw new Error("Token not found in the response");(0,Gn.setItemInStorage)("hiverAuthToken",e),(0,Gn.setItemInStorage)("hiverAuthTokenExpiry",t)};et.setTokenAndExpiry=UC;var qC=function(){var e=(0,Gn.getItemFromStorage)("hiverAuthTokenExpiry"),t=(0,Gn.getItemFromStorage)("hiverAuthToken"),n=(0,Gn.getItemFromStorage)("hiverAuthUserId"),r=(0,Gn.getItemFromStorage)("hiverAuthUserGroupId");return{token:t,expiryTime:e,userId:n,usergroupId:r}};et.getStoredAuthData=qC;var Oh=function(){var e=(0,Gn.getItemFromStorage)("hiverAuthTokenExpiry")||"";if(!e)return!0;var t=ec(),n=new Date(e),r=4*60*1e3,o=n.getTime()-t.getTime()<r;return console.log({currentTime:t,expiry:n,isInExpiryWindow:o}),o};et.isTokenInExpiryWindow=Oh;var JC=function(e){return VC(void 0,void 0,void 0,function(){return GC(this,function(t){switch(t.label){case 0:return[4,new Promise(function(n){return setTimeout(n,e)})];case 1:return t.sent(),[2]}})})};et.introduceDelay=JC;var QC=function(e,t,n){switch(n===void 0&&(n=!0),t){case jr.TIERS.SIT:case jr.TIERS.QA:return n?(0,fi.getSitApiConfig)(e):(0,fi.getSitHqConfig)(e);case jr.TIERS.PRODUCTION:case jr.TIERS.PROD:return n?(0,fi.getProdApiConfig)():(0,fi.getProdHqConfig)();case jr.TIERS.DEV:default:return n?(0,fi.getDevApiConfig)():(0,fi.getDevHqConfig)()}};et.getConfig=QC;var $C=function(){try{var e=(0,Gn.getItemFromStorage)("hiverAuthTokenExpiry");if(!e)return jr.RETRY_DELAY_IN_CASE_OF_CORRUPTED_EXPIRY;var t=new Date(e),n=ec();return t.getTime()-n.getTime()>jr.TWO_MINUTES_IN_MS?t.getTime()-jr.TWO_MINUTES_IN_MS:t.getTime()-n.getTime()}catch(r){return console.error("Heimdall: Error in getRefreshInterval",r),jr.REFETCH_CHECK_DELAY}};et.getRefreshInterval=$C;var ma={},ir={},Rh;function Nh(){if(Rh)return ir;Rh=1;var e=Be&&Be.__awaiter||function(v,d,p,h){function g(m){return m instanceof p?m:new p(function(E){E(m)})}return new(p||(p=Promise))(function(m,E){function x(C){try{T(h.next(C))}catch(O){E(O)}}function A(C){try{T(h.throw(C))}catch(O){E(O)}}function T(C){C.done?m(C.value):g(C.value).then(x,A)}T((h=h.apply(v,d||[])).next())})},t=Be&&Be.__generator||function(v,d){var p={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},h,g,m,E;return E={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function x(T){return function(C){return A([T,C])}}function A(T){if(h)throw new TypeError("Generator is already executing.");for(;E&&(E=0,T[0]&&(p=0)),p;)try{if(h=1,g&&(m=T[0]&2?g.return:T[0]?g.throw||((m=g.return)&&m.call(g),0):g.next)&&!(m=m.call(g,T[1])).done)return m;switch(g=0,m&&(T=[T[0]&2,m.value]),T[0]){case 0:case 1:m=T;break;case 4:return p.label++,{value:T[1],done:!1};case 5:p.label++,g=T[1],T=[0];continue;case 7:T=p.ops.pop(),p.trys.pop();continue;default:if(m=p.trys,!(m=m.length>0&&m[m.length-1])&&(T[0]===6||T[0]===2)){p=0;continue}if(T[0]===3&&(!m||T[1]>m[0]&&T[1]<m[3])){p.label=T[1];break}if(T[0]===6&&p.label<m[1]){p.label=m[1],m=T;break}if(m&&p.label<m[2]){p.label=m[2],p.ops.push(T);break}m[2]&&p.ops.pop(),p.trys.pop();continue}T=d.call(v,p)}catch(C){T=[6,C],g=0}finally{h=m=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}};Object.defineProperty(ir,"__esModule",{value:!0}),ir.logoutFromHeimdall=ir.getTenantLoginCode=ir.getLoginToken=ir.getAccessToken=void 0;var n=to,r=Fh(),o=et,i=function(v,d,p,h){var g=(0,o.getStoredAuthData)(),m=p===n.TENANT_PLATFORM.HIVERWEB?n.TENANT_PLATFORM.HIVERWEB:n.TENANT_PLATFORM.GMAIL;return{root_url:v.heimdallUrl,url:v.apiEndpoints.heimdallTokenFetch,method:n.GET_METHOD,headers:{"x-hiver-tenant":m},data:{user_id:d.userId,usergroup_id:d.usergroupId,access_token:(g==null?void 0:g.token)||"",source:h}}},a=function(v,d,p,h,g){var m=p===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:v},headers:{"x-hiver-tenant":m,"x-hiver-userid":h,"x-hiver-usergroupid":g}}},l=function(v,d){var p=d===n.TENANT_PLATFORM.HIVERWEB?n.TENANT_PLATFORM.HIVERWEB:n.TENANT_PLATFORM.GMAIL;return{root_url:v.heimdallUrl,url:v.apiEndpoints.heimdallLogout,method:n.GET_METHOD,headers:{"x-hiver-tenant":p}}},s=function(v){return parseInt(v,10)},u=function(v,d,p,h){return{root_url:p===n.TENANT_PLATFORM.HIVERWEB?v.hotUrl:v.v2Url,url:p===n.TENANT_PLATFORM.HIVERWEB?v.apiEndpoints.hotLogin:v.apiEndpoints.v2Login,method:n.GET_METHOD,data:{usersession:s(d.userId),app:h||n.APP_UI.DEFAULT}}},c=function(v,d,p,h,g){return e(void 0,void 0,void 0,function(){var m,E,x,A,T,C,O;return t(this,function(M){switch(M.label){case 0:console.log("GETTOKEN tenantPlatform -> ",h),M.label=1;case 1:return M.trys.push([1,5,,6]),!(0,o.validateToken)(p)||(0,o.invalidateToken)(p)?(console.log("HEIMDALL: No valid token, fetching token"),m=i(d,p,h,g),[4,(0,r.performAxiosCall)(m)]):[3,3];case 2:return E=M.sent(),[2,{atToken:(A=E==null?void 0:E.data.at)===null||A===void 0?void 0:A.token,expiryTime:(T=E==null?void 0:E.data.at)===null||T===void 0?void 0:T.expires_at,userId:(C=E==null?void 0:E.data)===null||C===void 0?void 0:C.user_id,userGroupId:(O=E==null?void 0:E.data)===null||O===void 0?void 0:O.usergroup_id}];case 3:return console.log("Heimdall: Valid token already exists"),[2,{}];case 4:return[3,6];case 5:throw x=M.sent(),x;case 6:return[2]}})})};ir.getAccessToken=c;var f=function(v,d,p,h,g,m){return e(void 0,void 0,void 0,function(){var E,x,A,T,C,O,M;return t(this,function(B){switch(B.label){case 0:E=a(v,p,h,g,m),B.label=1;case 1:return B.trys.push([1,3,,4]),[4,(0,r.performAxiosCall)(E)];case 2:return x=B.sent(),[2,{userId:(T=x==null?void 0:x.data)===null||T===void 0?void 0:T.user_id,userGroupId:(C=x==null?void 0:x.data)===null||C===void 0?void 0:C.usergroup_id,atToken:(O=x==null?void 0:x.data.at)===null||O===void 0?void 0:O.token,expiryTime:(M=x==null?void 0:x.data.at)===null||M===void 0?void 0:M.expires_at}];case 3:throw A=B.sent(),A;case 4:return[2]}})})};ir.getLoginToken=f;var b=function(v,d,p,h,g){return e(void 0,void 0,void 0,function(){var m,E,x;return t(this,function(A){switch(A.label){case 0:return A.trys.push([0,2,,3]),console.log("ERROR debug: in getTenantLoginCode:",g),m=u(d,p,h,g),[4,(0,r.performAxiosCall)(m)];case 1:return E=A.sent(),[2,E==null?void 0:E.data.code];case 2:throw x=A.sent(),x;case 3:return[2]}})})};ir.getTenantLoginCode=b;var y=function(v,d,p){return p===void 0&&(p=0),e(void 0,void 0,void 0,function(){var h,g,m;return t(this,function(E){switch(E.label){case 0:return E.trys.push([0,2,,5]),h=l(v,d),[4,(0,r.performAxiosCall)(h)];case 1:return g=E.sent(),[2,g==null?void 0:g.status];case 2:return m=E.sent(),p<2?[4,y(v,d,p+1)]:[3,4];case 3:E.sent(),E.label=4;case 4:throw m;case 5:return[2]}})})};return ir.logoutFromHeimdall=y,ir}var Ws={},KC=Be&&Be.__awaiter||function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function l(c){try{u(r.next(c))}catch(f){a(f)}}function s(c){try{u(r.throw(c))}catch(f){a(f)}}function u(c){c.done?i(c.value):o(c.value).then(l,s)}u((r=r.apply(e,t||[])).next())})},ew=Be&&Be.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(u){return function(c){return s([u,c])}}function s(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.subscribeToOnlineEvent=void 0;var Dh=to,tw=yr,nw=function(e,t){switch(t===void 0&&(t=(0,tw.getValue)("PLATFORM")),console.log("Online status detected. Fetching token..."),t){case Dh.PLATFORM.WEB:return window.addEventListener("online",function(){return KC(void 0,void 0,void 0,function(){return ew(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 Dh.PLATFORM.MOBILE:e();return;default:throw Error("Invalid PLATFORM ".concat(t))}};Ws.subscribeToOnlineEvent=nw;var Ph;function kh(){if(Ph)return ma;Ph=1;var e=Be&&Be.__awaiter||function(v,d,p,h){function g(m){return m instanceof p?m:new p(function(E){E(m)})}return new(p||(p=Promise))(function(m,E){function x(C){try{T(h.next(C))}catch(O){E(O)}}function A(C){try{T(h.throw(C))}catch(O){E(O)}}function T(C){C.done?m(C.value):g(C.value).then(x,A)}T((h=h.apply(v,d||[])).next())})},t=Be&&Be.__generator||function(v,d){var p={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},h,g,m,E;return E={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function x(T){return function(C){return A([T,C])}}function A(T){if(h)throw new TypeError("Generator is already executing.");for(;E&&(E=0,T[0]&&(p=0)),p;)try{if(h=1,g&&(m=T[0]&2?g.return:T[0]?g.throw||((m=g.return)&&m.call(g),0):g.next)&&!(m=m.call(g,T[1])).done)return m;switch(g=0,m&&(T=[T[0]&2,m.value]),T[0]){case 0:case 1:m=T;break;case 4:return p.label++,{value:T[1],done:!1};case 5:p.label++,g=T[1],T=[0];continue;case 7:T=p.ops.pop(),p.trys.pop();continue;default:if(m=p.trys,!(m=m.length>0&&m[m.length-1])&&(T[0]===6||T[0]===2)){p=0;continue}if(T[0]===3&&(!m||T[1]>m[0]&&T[1]<m[3])){p.label=T[1];break}if(T[0]===6&&p.label<m[1]){p.label=m[1],m=T;break}if(m&&p.label<m[2]){p.label=m[2],p.ops.push(T);break}m[2]&&p.ops.pop(),p.trys.pop();continue}T=d.call(v,p)}catch(C){T=[6,C],g=0}finally{h=m=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}};Object.defineProperty(ma,"__esModule",{value:!0}),ma.fetchAccessToken=void 0;var n=Nh(),r=to,o=et,i=Ws,a,l,s,u=function(v,d,p,h,g,m){return m===void 0&&(m=r.APP_UI.DEFAULT),e(void 0,void 0,void 0,function(){var E,x,A,T,C,O,M,B,U;return t(this,function(G){switch(G.label){case 0:E=2,G.label=1;case 1:return G.trys.push([1,7,,12]),console.log("ERROR debug: in login:",m,h),x=void 0,g?[4,g()]:[3,3];case 2:return x=G.sent(),[3,5];case 3:return[4,(0,n.getTenantLoginCode)(r.CONFIG_HIVER,v,d,h,m)];case 4:x=G.sent(),G.label=5;case 5:return[4,(0,n.getLoginToken)(x,r.CONFIG_HIVER,v,h,d.userId,d.usergroupId)];case 6:return A=G.sent(),T=A.userId,C=A.userGroupId,O=A.atToken,M=A.expiryTime,(0,o.setTokenAndExpiry)(O,M),(0,o.setUserDetails)(T,C),[3,12];case 7:B=G.sent(),console.log("ERROR debug: in error login:",B,m),U=p,G.label=8;case 8:return U<E?[4,u(v,d,U+1,h,g,m)]:[3,11];case 9:G.sent(),G.label=10;case 10:return U++,[3,8];case 11:throw B;case 12:return[2]}})})},c=function(v,d,p,h,g){return e(void 0,void 0,void 0,function(){var m,E,x,A;return t(this,function(T){switch(T.label){case 0:return d<r.MAX_CONFLICT_RETRY_DELAY?[4,new Promise(function(C){return setTimeout(C,v)})]:[3,3];case 1:return T.sent(),d+=v,v*2<=r.MAX_BACKOFF_LIMIT?v*=2:v=r.MAX_BACKOFF_LIMIT,console.log("Heimdall: Fetch token post doubling conflict retry delay",v),m=p.retryDelay,E=p.configs,x=p.apiParams,A=p.appUI,[4,f(m,v,d,E,x,h,g,A)];case 2:T.sent(),T.label=3;case 3:return[2]}})})},f=function(v,d,p,h,g,m,E,x,A){return x===void 0&&(x="default"),e(void 0,void 0,void 0,function(){var T,C,O,M,B,U,G,X,q,$,ue,se,ve,W;return t(this,function(te){switch(te.label){case 0:return te.trys.push([0,2,,12]),console.log("Heimdall: Interval Set on fetch token in fetchAndSaveToken:",s),[4,(0,n.getAccessToken)(r.CONFIG_HIVER,h,g,m,x)];case 1:return T=te.sent(),C=T.atToken,O=T.expiryTime,M=T.userId,B=T.userGroupId,C&&O&&(0,o.setTokenAndExpiry)(C,O),M&&B&&(0,o.setUserDetails)(M,B),v=r.INITIAL_RETRY_DELAY,d=r.INITIAL_RETRY_DELAY,p=0,[3,12];case 2:return U=te.sent(),console.log("ERROR: Heimdall fetch token",U),((q=U.response)===null||q===void 0?void 0:q.status)===401||(($=U.request)===null||$===void 0?void 0:$.status)===401?(G=1,[4,u(h,g,G,m,E,A)]):[3,4];case 3:return te.sent(),[3,11];case 4:return((ue=U.response)===null||ue===void 0?void 0:ue.status)===409||((se=U.request)===null||se===void 0?void 0:se.status)===409?(console.log("Heimdall: Fetching token post 409 in fetch And Save Token"),X={retryDelay:v,configs:h,apiParams:g,appUI:A},[4,c(d,p,X,m,E)]):[3,6];case 5:if(te.sent(),p>=r.MAX_CONFLICT_RETRY_DELAY)throw U;return[3,11];case 6:if(!(((ve=U.response)===null||ve===void 0?void 0:ve.status)===422||((W=U.request)===null||W===void 0?void 0:W.status)===422))return[3,7];throw console.log("ERROR: Throwing error",U.response.status),U;case 7:return v<=r.MAX_RETRY_DELAY?[4,new Promise(function(re){return setTimeout(re,v)})]:[3,10];case 8:return te.sent(),v*=2,console.log("Heimdall: Fetch token post doubling retry delay",v),[4,f(v,d,p,h,g,m,E,A)];case 9:return te.sent(),[3,11];case 10:throw U;case 11:return[3,12];case 12:return[2]}})})},b=function(v,d,p,h,g,m,E,x){return p===void 0&&(p=r.INITIAL_RETRY_DELAY),h===void 0&&(h=r.INITIAL_RETRY_DELAY),e(void 0,void 0,void 0,function(){var A,T,C;return t(this,function(O){switch(O.label){case 0:return O.trys.push([0,4,,5]),A=(0,o.isTokenInExpiryWindow)(),A?(T=(0,o.getRandomDelay)(),[4,(0,o.introduceDelay)(T)]):[3,3];case 1:return O.sent(),console.log("Heimdall: Fetching token - in expiry window"),[4,f(p,h,g,v,d,m,E,x)];case 2:O.sent(),O.label=3;case 3:return[3,5];case 4:throw C=O.sent(),C;case 5:return[2]}})})},y=function(v,d,p,h,g,m,E){return e(void 0,void 0,void 0,function(){var x,A,T,C,O,M;return t(this,function(B){switch(B.label){case 0:a=v,l=d,x=r.INITIAL_RETRY_DELAY,A=r.INITIAL_RETRY_DELAY,T=0,C=(0,o.getConfig)(a,l),console.log("Instance: Fetch Call"),B.label=1;case 1:return B.trys.push([1,3,,4]),[4,f(x,A,T,C,p,h,g,m,E)];case 2:return B.sent(),console.log("Heimdall: Interval Set on fetch token when fetch token is called:",s),clearInterval(s),s=setInterval(function(){return b(C,p,r.INITIAL_RETRY_DELAY,r.INITIAL_RETRY_DELAY,0,h,g,E)},r.REFETCH_CHECK_DELAY),O=function(){return e(void 0,void 0,void 0,function(){return t(this,function(U){switch(U.label){case 0:return[4,b(C,p,r.INITIAL_RETRY_DELAY,r.INITIAL_RETRY_DELAY,0,h,g,E)];case 1:return U.sent(),[2]}})})},console.log("Heimdall: Interval Set on fetch token:",s),(0,i.subscribeToOnlineEvent)(O),[3,4];case 3:return M=B.sent(),console.log("ERROR: Fetching token failed",M),[3,4];case 4:return[2]}})})};return ma.fetchAccessToken=y,ma}var Lh;function Fh(){if(Lh)return Lo;Lh=1;var e=Be&&Be.__assign||function(){return e=Object.assign||function(d){for(var p,h=1,g=arguments.length;h<g;h++){p=arguments[h];for(var m in p)Object.prototype.hasOwnProperty.call(p,m)&&(d[m]=p[m])}return d},e.apply(this,arguments)},t=Be&&Be.__awaiter||function(d,p,h,g){function m(E){return E instanceof h?E:new h(function(x){x(E)})}return new(h||(h=Promise))(function(E,x){function A(O){try{C(g.next(O))}catch(M){x(M)}}function T(O){try{C(g.throw(O))}catch(M){x(M)}}function C(O){O.done?E(O.value):m(O.value).then(A,T)}C((g=g.apply(d,p||[])).next())})},n=Be&&Be.__generator||function(d,p){var h={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},g,m,E,x;return x={next:A(0),throw:A(1),return:A(2)},typeof Symbol=="function"&&(x[Symbol.iterator]=function(){return this}),x;function A(C){return function(O){return T([C,O])}}function T(C){if(g)throw new TypeError("Generator is already executing.");for(;x&&(x=0,C[0]&&(h=0)),h;)try{if(g=1,m&&(E=C[0]&2?m.return:C[0]?m.throw||((E=m.return)&&E.call(m),0):m.next)&&!(E=E.call(m,C[1])).done)return E;switch(m=0,E&&(C=[C[0]&2,E.value]),C[0]){case 0:case 1:E=C;break;case 4:return h.label++,{value:C[1],done:!1};case 5:h.label++,m=C[1],C=[0];continue;case 7:C=h.ops.pop(),h.trys.pop();continue;default:if(E=h.trys,!(E=E.length>0&&E[E.length-1])&&(C[0]===6||C[0]===2)){h=0;continue}if(C[0]===3&&(!E||C[1]>E[0]&&C[1]<E[3])){h.label=C[1];break}if(C[0]===6&&h.label<E[1]){h.label=E[1],E=C;break}if(E&&h.label<E[2]){h.label=E[2],h.ops.push(C);break}E[2]&&h.ops.pop(),h.trys.pop();continue}C=p.call(d,h)}catch(O){C=[6,O],m=0}finally{g=E=0}if(C[0]&5)throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}};Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.hiverAxiosCall=Lo.performAxiosCall=void 0;var r=_h,o=et,i=kh(),a=vr,l=to,s,u=2,c=function(d,p){var h=p.fetchCsrfToken();d.formData?d.formData.append("_csrf_token",h):(d.data=d.data||{},d.data._csrf_token=h)},f=function(d,p){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 g=e(e({method:d.method,url:"".concat(d.root_url).concat(d.url),headers:d.headers},h),{withCredentials:p,responseType:(d==null?void 0:d.responseType)||""});return g};function b(d,p){return p===void 0&&(p=!0),t(this,void 0,void 0,function(){var h;return n(this,function(g){return h=f(d,p),[2,(0,r.default)(h).then(function(m){return m}).catch(function(m){throw m})]})})}Lo.performAxiosCall=b;function y(d,p,h){return t(this,void 0,void 0,function(){var g,m,E;return n(this,function(x){switch(x.label){case 0:return x.trys.push([0,6,,8]),d.authTokenFetchingInProgress?[3,2]:(d.authTokenFetchingInProgress=!0,g=d.appEnv,m=d.tier,[4,(0,i.fetchAccessToken)(g,m,p,d.tenantPlatform,d.getTokenForLogin,h)]);case 1:return x.sent(),d.authTokenFetchingInProgress=!1,[3,5];case 2:return[4,new Promise(function(A){return setTimeout(A,100)})];case 3:return x.sent(),console.log("Heimdall: Retrying fetchAccessToken after 100ms..."),[4,y(d,p,h)];case 4:x.sent(),x.label=5;case 5:return[3,8];case 6:return E=x.sent(),console.log("Error while fetching Auth Token :",E),d.authTokenFetchingInProgress=!1,[4,y(d,p,h)];case 7:return x.sent(),[3,8];case 8:return[2]}})})}function v(d,p,h,g,m){var E,x;return m===void 0&&(m=0),t(this,void 0,void 0,function(){var A,T,C,O,M,B,U;return n(this,function(G){switch(G.label){case 0:if(G.trys.push([0,4,,5]),!(h.getToken&&!(0,o.hasValidToken)(p)))return[3,2];if(A=d.appEnv,T=d.tier,!A||!T)throw Error("appEnv or tier missing : ".concat(A,"/").concat(T));return"userId"in p&&"usergroupId"in p?(C={userId:p.userId,usergroupId:p.usergroupId},[4,y(d,C,g)]):[3,2];case 1:G.sent(),G.label=2;case 2:return d.csrfToken&&c(p,h),O=d.tenantPlatform===l.TENANT_PLATFORM.HIVERWEB?l.TENANT_PLATFORM.HIVERWEB:l.TENANT_PLATFORM.GMAIL,p.headers=e(e({},p.headers),{"x-hiver-tenant":O,"x-hiver-userid":(0,a.getItemFromStorage)("hiverAuthUserId")||"0","x-hiver-usergroupid":(0,a.getItemFromStorage)("hiverAuthUserGroupId")||"0"}),h.getToken&&(s=(0,a.getItemFromStorage)("hiverAuthToken")||"",p.headers=e(e({},p.headers),{Authorization:"Bearer ".concat(s)})),console.log("Performing axios call for:",p),[4,b(p,d.withCredentials)];case 3:return M=G.sent(),p.onSuccess&&p.onSuccess(M),[2,M];case 4:if(B=G.sent(),U=((E=B.response)===null||E===void 0?void 0:E.status)===403||((x=B.request)===null||x===void 0?void 0:x.status)===403,m<u&&U)return(0,o.expireToken)(),[2,v(d,p,h,g,m+1)];if(m>=u&&U||!U)throw p.onFail&&p.onFail(B),console.log("ERROR: Reached make Axios",B),B;return[3,5];case 5:return[2]}})})}return Lo.hiverAxiosCall=v,Lo}var ba={},Et={},Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.TIERS=Ot.APP_UI=Ot.CONFIG_HIVER=Ot.REFETCH_CHECK_DELAY=Ot.INITIAL_RETRY_DELAY=Ot.MAX_BACKOFF_LIMIT=Ot.MAX_CONFLICT_RETRY_DELAY=Ot.MAX_RETRY_DELAY=Ot.GET_METHOD=void 0,Ot.GET_METHOD="GET",Ot.MAX_RETRY_DELAY=18e4,Ot.MAX_CONFLICT_RETRY_DELAY=63e3,Ot.MAX_BACKOFF_LIMIT=8e3,Ot.INITIAL_RETRY_DELAY=1e3,Ot.REFETCH_CHECK_DELAY=168e4,Ot.CONFIG_HIVER={getToken:!1,fetchCsrfToken:function(){return""},isHiverApiDomain:!0},Ot.APP_UI={COLLAB_SPACE:"collab-space",DEFAULT:"default"},Ot.TIERS={DEV:"dev",SIT:"sit",PROD:"production"};var Tn={};Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.getProdHqConfig=Tn.getProdApiConfig=Tn.getSitHqConfig=Tn.getSitApiConfig=Tn.getDevHqConfig=Tn.getDevApiConfig=void 0;var pi={heimdallTokenFetch:"/v1/token/get",heimdallLogin:"/v1/login/code",v2Login:"/api/auth/login/code"},rw=function(){return{v2Url:"https://v2dev.hiver.space",heimdallUrl:"https://dev.hiver.space/api/heimdall-api",apiEndpoints:pi}};Tn.getDevApiConfig=rw;var ow=function(){return{v2Url:"https://v2dev.hiver.space",heimdallUrl:"https://dev.hiver.space/api/heimdall-api2",apiEndpoints:pi}};Tn.getDevHqConfig=ow;var iw=function(e){return{v2Url:"https://v2".concat(e,".hiver.space"),heimdallUrl:"https://".concat(e,".hiver.space/api/heimdall-api"),apiEndpoints:pi}};Tn.getSitApiConfig=iw;var aw=function(e){return{v2Url:"https://v2".concat(e,".hiver.space"),heimdallUrl:"https://".concat(e,".hiver.space/api/heimdall-api2"),apiEndpoints:pi}};Tn.getSitHqConfig=aw;var sw=function(){return{v2Url:"https://v2.hiverhq.com",heimdallUrl:"https://heimdall.hiverapi.com",apiEndpoints:pi}};Tn.getProdApiConfig=sw;var lw=function(){return{v2Url:"https://v2.hiverhq.com",heimdallUrl:"https://heimdall2.hiverhq.com",apiEndpoints:pi}};Tn.getProdHqConfig=lw;var uw=Be&&Be.__awaiter||function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function l(c){try{u(r.next(c))}catch(f){a(f)}}function s(c){try{u(r.throw(c))}catch(f){a(f)}}function u(c){c.done?i(c.value):o(c.value).then(l,s)}u((r=r.apply(e,t||[])).next())})},cw=Be&&Be.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(u){return function(c){return s([u,c])}}function s(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Et,"__esModule",{value:!0}),Et.expireToken=Et.validateToken=Et.validateAccount=Et.getConfig=Et.introduceDelay=Et.isTokenInExpiryWindow=Et.getStoredAuthData=Et.setUserDetails=Et.setTokenAndExpiry=Et.getRandomDelay=Et.hasValidToken=void 0;var nc=Ot,Bo=Tn,Mh=function(){var e=new Date,t=new Date(e.getTime()+e.getTimezoneOffset()*6e4);return t},rc=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};Et.validateAccount=rc;var dw=function(e){var t=rc(e);return!Bh()&&t};Et.validateToken=dw;var fw=function(){try{sessionStorage.removeItem("hiverAuthTokenExpiry")}catch{console.log("Heimdall: Unable to Remove token.")}};Et.expireToken=fw;var pw=function(e){console.log("Heimdall: checking if there is a valid token");var t=sessionStorage.getItem("hiverAuthTokenExpiry")||"",n=new Date(t),r=Mh(),o=rc(e);return r<n&&o};Et.hasValidToken=pw;var hw=function(){return Math.floor(Math.random()*6e4)+6e4};Et.getRandomDelay=hw;var gw=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)};Et.setUserDetails=gw;var mw=function(e,t){if(!e)throw new Error("Token not found in the response");sessionStorage.setItem("hiverAuthToken",e),sessionStorage.setItem("hiverAuthTokenExpiry",t)};Et.setTokenAndExpiry=mw;var bw=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}};Et.getStoredAuthData=bw;var Bh=function(){var e=sessionStorage.getItem("hiverAuthTokenExpiry")||"";if(!e)return!0;var t=Mh(),n=new Date(e),r=4*60*1e3,o=n.getTime()-t.getTime()<r;return console.log({currentTime:t,expiry:n,isInExpiryWindow:o}),o};Et.isTokenInExpiryWindow=Bh;var vw=function(e){return uw(void 0,void 0,void 0,function(){return cw(this,function(t){switch(t.label){case 0:return[4,new Promise(function(n){return setTimeout(n,e)})];case 1:return t.sent(),[2]}})})};Et.introduceDelay=vw;var yw=function(e,t,n){switch(t){case nc.TIERS.SIT:return console.log("ISHIVERAPIDOMAIN:",n,(0,Bo.getSitHqConfig)(e)),n?(0,Bo.getSitApiConfig)(e):(0,Bo.getSitHqConfig)(e);case nc.TIERS.PROD:return n?(0,Bo.getProdApiConfig)():(0,Bo.getProdHqConfig)();case nc.TIERS.DEV:default:return n?(0,Bo.getDevApiConfig)():(0,Bo.getDevHqConfig)()}};Et.getConfig=yw;var va={},Vr={},jh;function Ew(){if(jh)return Vr;jh=1;var e=Be&&Be.__awaiter||function(b,y,v,d){function p(h){return h instanceof v?h:new v(function(g){g(h)})}return new(v||(v=Promise))(function(h,g){function m(A){try{x(d.next(A))}catch(T){g(T)}}function E(A){try{x(d.throw(A))}catch(T){g(T)}}function x(A){A.done?h(A.value):p(A.value).then(m,E)}x((d=d.apply(b,y||[])).next())})},t=Be&&Be.__generator||function(b,y){var v={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},d,p,h,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(x){return function(A){return E([x,A])}}function E(x){if(d)throw new TypeError("Generator is already executing.");for(;g&&(g=0,x[0]&&(v=0)),v;)try{if(d=1,p&&(h=x[0]&2?p.return:x[0]?p.throw||((h=p.return)&&h.call(p),0):p.next)&&!(h=h.call(p,x[1])).done)return h;switch(p=0,h&&(x=[x[0]&2,h.value]),x[0]){case 0:case 1:h=x;break;case 4:return v.label++,{value:x[1],done:!1};case 5:v.label++,p=x[1],x=[0];continue;case 7:x=v.ops.pop(),v.trys.pop();continue;default:if(h=v.trys,!(h=h.length>0&&h[h.length-1])&&(x[0]===6||x[0]===2)){v=0;continue}if(x[0]===3&&(!h||x[1]>h[0]&&x[1]<h[3])){v.label=x[1];break}if(x[0]===6&&v.label<h[1]){v.label=h[1],h=x;break}if(h&&v.label<h[2]){v.label=h[2],v.ops.push(x);break}h[2]&&v.ops.pop(),v.trys.pop();continue}x=y.call(b,v)}catch(A){x=[6,A],p=0}finally{d=h=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}};Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.getV2LoginCode=Vr.getLoginToken=Vr.getAccessToken=void 0;var n=Ot,r=Hh(),o=Et,i=function(b,y,v){var d=(0,o.getStoredAuthData)();return{root_url:b.heimdallUrl,url:b.apiEndpoints.heimdallTokenFetch,method:n.GET_METHOD,data:{user_id:y.userId,usergroup_id:y.usergroupId,access_token:(d==null?void 0:d.token)||"",source:v},withCredentials:!0}},a=function(b,y){return{root_url:y.heimdallUrl,url:y.apiEndpoints.heimdallLogin,method:n.GET_METHOD,data:{code:b},withCredentials:!0}},l=function(b){return parseInt(b,10)},s=function(b,y){return{root_url:b.v2Url,url:b.apiEndpoints.v2Login,method:n.GET_METHOD,withCredentials:!0,data:{usersession:l(localStorage.getItem("hiver-config.usersession")),app:y||n.APP_UI.DEFAULT}}},u=function(b,y,v,d){return e(void 0,void 0,void 0,function(){var p,h,g,m,E,x,A;return t(this,function(T){switch(T.label){case 0:return T.trys.push([0,4,,5]),(0,o.validateToken)(v)?[3,2]:(console.log("HEIMDALL: No valid token, fetching token"),p=i(y,v,d),[4,(0,r.makeAxiosCall)(p,b)]);case 1:return h=T.sent(),[2,{atToken:(m=h==null?void 0:h.data.at)===null||m===void 0?void 0:m.token,expiryTime:(E=h==null?void 0:h.data.at)===null||E===void 0?void 0:E.expires_at,userId:(x=h==null?void 0:h.data)===null||x===void 0?void 0:x.user_id,userGroupId:(A=h==null?void 0:h.data)===null||A===void 0?void 0:A.usergroup_id}];case 2:return console.log("Heimdall: Valid token already exists"),[2,{}];case 3:return[3,5];case 4:throw g=T.sent(),g;case 5:return[2]}})})};Vr.getAccessToken=u;var c=function(b,y,v){return e(void 0,void 0,void 0,function(){var d,p,h,g,m,E,x;return t(this,function(A){switch(A.label){case 0:d=a(b,v),A.label=1;case 1:return A.trys.push([1,3,,4]),[4,(0,r.makeAxiosCall)(d,y)];case 2:return p=A.sent(),[2,{userId:(g=p==null?void 0:p.data)===null||g===void 0?void 0:g.user_id,userGroupId:(m=p==null?void 0:p.data)===null||m===void 0?void 0:m.usergroup_id,atToken:(E=p==null?void 0:p.data.at)===null||E===void 0?void 0:E.token,expiryTime:(x=p==null?void 0:p.data.at)===null||x===void 0?void 0:x.expires_at}];case 3:throw h=A.sent(),h;case 4:return[2]}})})};Vr.getLoginToken=c;var f=function(b,y,v){return e(void 0,void 0,void 0,function(){var d,p,h;return t(this,function(g){switch(g.label){case 0:return g.trys.push([0,2,,3]),console.log("ERROR debug: in getV2loginCode:",v),d=s(y,v),[4,(0,r.makeAxiosCall)(d,b)];case 1:return p=g.sent(),console.log("DEBUG HEIMDALL: local storage:",p==null?void 0:p.data),[2,p==null?void 0:p.data.code];case 2:throw h=g.sent(),h;case 3:return[2]}})})};return Vr.getV2LoginCode=f,Vr}var Vh;function Gh(){if(Vh)return va;Vh=1;var e=Be&&Be.__awaiter||function(y,v,d,p){function h(g){return g instanceof d?g:new d(function(m){m(g)})}return new(d||(d=Promise))(function(g,m){function E(T){try{A(p.next(T))}catch(C){m(C)}}function x(T){try{A(p.throw(T))}catch(C){m(C)}}function A(T){T.done?g(T.value):h(T.value).then(E,x)}A((p=p.apply(y,v||[])).next())})},t=Be&&Be.__generator||function(y,v){var d={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},p,h,g,m;return m={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function E(A){return function(T){return x([A,T])}}function x(A){if(p)throw new TypeError("Generator is already executing.");for(;m&&(m=0,A[0]&&(d=0)),d;)try{if(p=1,h&&(g=A[0]&2?h.return:A[0]?h.throw||((g=h.return)&&g.call(h),0):h.next)&&!(g=g.call(h,A[1])).done)return g;switch(h=0,g&&(A=[A[0]&2,g.value]),A[0]){case 0:case 1:g=A;break;case 4:return d.label++,{value:A[1],done:!1};case 5:d.label++,h=A[1],A=[0];continue;case 7:A=d.ops.pop(),d.trys.pop();continue;default:if(g=d.trys,!(g=g.length>0&&g[g.length-1])&&(A[0]===6||A[0]===2)){d=0;continue}if(A[0]===3&&(!g||A[1]>g[0]&&A[1]<g[3])){d.label=A[1];break}if(A[0]===6&&d.label<g[1]){d.label=g[1],g=A;break}if(g&&d.label<g[2]){d.label=g[2],d.ops.push(A);break}g[2]&&d.ops.pop(),d.trys.pop();continue}A=v.call(y,d)}catch(T){A=[6,T],h=0}finally{p=g=0}if(A[0]&5)throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}};Object.defineProperty(va,"__esModule",{value:!0}),va.fetchToken=void 0;var n=Ew(),r=Ot,o=Et,i,a,l,s=function(y,v,d){return d===void 0&&(d=r.APP_UI.DEFAULT),e(void 0,void 0,void 0,function(){var p,h,g,m,E,x,A,T,C;return t(this,function(O){switch(O.label){case 0:p=2,O.label=1;case 1:return O.trys.push([1,4,,9]),console.log("ERROR debug: in login:",d),[4,(0,n.getV2LoginCode)(r.CONFIG_HIVER,y,d)];case 2:return h=O.sent(),[4,(0,n.getLoginToken)(h,r.CONFIG_HIVER,y)];case 3:return g=O.sent(),m=g.userId,E=g.userGroupId,x=g.atToken,A=g.expiryTime,(0,o.setTokenAndExpiry)(x,A),(0,o.setUserDetails)(m,E),[3,9];case 4:T=O.sent(),console.log("ERROR debug: in error login:",T,d),C=v,O.label=5;case 5:return C<p?[4,s(y,C+1,d)]:[3,8];case 6:O.sent(),O.label=7;case 7:return C++,[3,5];case 8:throw T;case 9:return[2]}})})},u=function(y,v,d){return e(void 0,void 0,void 0,function(){var p,h,g,m;return t(this,function(E){switch(E.label){case 0:return v<r.MAX_CONFLICT_RETRY_DELAY?[4,new Promise(function(x){return setTimeout(x,y)})]:[3,3];case 1:return E.sent(),v+=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),p=d.retryDelay,h=d.configs,g=d.api_params,m=d.appUI,[4,c(p,y,v,h,g,m)];case 2:E.sent(),E.label=3;case 3:return[2]}})})},c=function(y,v,d,p,h,g,m){return g===void 0&&(g="default"),e(void 0,void 0,void 0,function(){var E,x,A,T,C,O,M,B,U,G,X,q,$,ue;return t(this,function(se){switch(se.label){case 0:return se.trys.push([0,2,,12]),console.log("Heimdall: Interval Set on fetch token in fetchAndSaveToken:",l),[4,(0,n.getAccessToken)(r.CONFIG_HIVER,p,h,g)];case 1:return E=se.sent(),x=E.atToken,A=E.expiryTime,T=E.userId,C=E.userGroupId,x&&A&&(0,o.setTokenAndExpiry)(x,A),T&&C&&(0,o.setUserDetails)(T,C),y=r.INITIAL_RETRY_DELAY,v=r.INITIAL_RETRY_DELAY,d=0,[3,12];case 2:return O=se.sent(),console.log("ERROR: Heimdall fetch token",O),((U=O.response)===null||U===void 0?void 0:U.status)===401||((G=O.request)===null||G===void 0?void 0:G.status)===401?(M=1,[4,s(p,M,m)]):[3,4];case 3:return se.sent(),[3,11];case 4:return((X=O.response)===null||X===void 0?void 0:X.status)===409||((q=O.request)===null||q===void 0?void 0:q.status)===409?(console.log("Heimdall: Fetching token post 409 in fetch And Save Token"),B={retryDelay:y,configs:p,api_params:h,appUI:m},[4,u(v,d,B)]):[3,6];case 5:if(se.sent(),d>=r.MAX_CONFLICT_RETRY_DELAY)throw O;return[3,11];case 6:if(!((($=O.response)===null||$===void 0?void 0:$.status)===422||((ue=O.request)===null||ue===void 0?void 0:ue.status)===422))return[3,7];throw console.log("ERROR: Throwing error",O.response.status),O;case 7:return y<=r.MAX_RETRY_DELAY?[4,new Promise(function(ve){return setTimeout(ve,y)})]:[3,10];case 8:return se.sent(),y*=2,console.log("Heimdall: Fetch token post doubling retry delay",y),[4,c(y,v,d,p,h,m)];case 9:return se.sent(),[3,11];case 10:throw O;case 11:return[3,12];case 12:return[2]}})})},f=function(y,v,d,p,h,g){return d===void 0&&(d=r.INITIAL_RETRY_DELAY),p===void 0&&(p=r.INITIAL_RETRY_DELAY),h===void 0&&(h=0),e(void 0,void 0,void 0,function(){var m,E,x;return t(this,function(A){switch(A.label){case 0:return A.trys.push([0,4,,5]),m=(0,o.isTokenInExpiryWindow)(),m?(E=(0,o.getRandomDelay)(),[4,(0,o.introduceDelay)(E)]):[3,3];case 1:return A.sent(),console.log("Heimdall: Fetching token - in expiry window"),[4,c(d,p,h,y,v,g)];case 2:A.sent(),A.label=3;case 3:return[3,5];case 4:throw x=A.sent(),x;case 5:return[2]}})})},b=function(y,v,d,p,h,g){return e(void 0,void 0,void 0,function(){var m,E,x,A,T;return t(this,function(C){switch(C.label){case 0:i=y,a=v,m=r.INITIAL_RETRY_DELAY,E=r.INITIAL_RETRY_DELAY,x=0,A=(0,o.getConfig)(i,a,p),C.label=1;case 1:return C.trys.push([1,3,,4]),[4,c(m,E,x,A,d,h,g)];case 2:return C.sent(),console.log("Heimdall: Interval Set on fetch token when fetch token is called:",l),clearInterval(l),l=setInterval(function(){return f(A,d)},r.REFETCH_CHECK_DELAY),console.log("Heimdall: Interval Set on fetch token:",l),window.addEventListener("online",function(){return e(void 0,void 0,void 0,function(){return t(this,function(O){switch(O.label){case 0:return console.log("Online status detected. Fetching token..."),[4,f(A,d)];case 1:return O.sent(),[2]}})})}),[3,4];case 3:throw T=C.sent(),T;case 4:return[2]}})})};return va.fetchToken=b,va}var Wh;function Hh(){if(Wh)return ba;Wh=1;var e=Be&&Be.__assign||function(){return e=Object.assign||function(b){for(var y,v=1,d=arguments.length;v<d;v++){y=arguments[v];for(var p in y)Object.prototype.hasOwnProperty.call(y,p)&&(b[p]=y[p])}return b},e.apply(this,arguments)},t=Be&&Be.__awaiter||function(b,y,v,d){function p(h){return h instanceof v?h:new v(function(g){g(h)})}return new(v||(v=Promise))(function(h,g){function m(A){try{x(d.next(A))}catch(T){g(T)}}function E(A){try{x(d.throw(A))}catch(T){g(T)}}function x(A){A.done?h(A.value):p(A.value).then(m,E)}x((d=d.apply(b,y||[])).next())})},n=Be&&Be.__generator||function(b,y){var v={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},d,p,h,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(x){return function(A){return E([x,A])}}function E(x){if(d)throw new TypeError("Generator is already executing.");for(;g&&(g=0,x[0]&&(v=0)),v;)try{if(d=1,p&&(h=x[0]&2?p.return:x[0]?p.throw||((h=p.return)&&h.call(p),0):p.next)&&!(h=h.call(p,x[1])).done)return h;switch(p=0,h&&(x=[x[0]&2,h.value]),x[0]){case 0:case 1:h=x;break;case 4:return v.label++,{value:x[1],done:!1};case 5:v.label++,p=x[1],x=[0];continue;case 7:x=v.ops.pop(),v.trys.pop();continue;default:if(h=v.trys,!(h=h.length>0&&h[h.length-1])&&(x[0]===6||x[0]===2)){v=0;continue}if(x[0]===3&&(!h||x[1]>h[0]&&x[1]<h[3])){v.label=x[1];break}if(x[0]===6&&v.label<h[1]){v.label=h[1],h=x;break}if(h&&v.label<h[2]){v.label=h[2],v.ops.push(x);break}h[2]&&v.ops.pop(),v.trys.pop();continue}x=y.call(b,v)}catch(A){x=[6,A],p=0}finally{d=h=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}};Object.defineProperty(ba,"__esModule",{value:!0}),ba.makeAxiosCall=void 0;var r=_h,o=Et,i=Gh(),a,l=2,s=function(b,y){var v=y.fetchCsrfToken();b.formData?b.formData.append("_csrf_token",v):(b.data=b.data||{},b.data._csrf_token=v)},u=function(b){var y=!b.method||b.method.toLowerCase()==="get"?{params:b.data}:{data:b.data},v=e(e({method:b.method,url:"".concat(b.root_url).concat(b.url),headers:b.headers},y),{withCredentials:b.withCredentials,responseType:(b==null?void 0:b.responseType)||""});return v};function c(b){return t(this,void 0,void 0,function(){var y;return n(this,function(v){return y=u(b),[2,(0,r.default)(y).then(function(d){return d}).catch(function(d){throw d})]})})}function f(b,y,v,d){var p,h;return d===void 0&&(d=0),t(this,void 0,void 0,function(){var g,m,E,x,A,T;return n(this,function(C){switch(C.label){case 0:if(C.trys.push([0,4,,5]),!(y.getToken&&!(0,o.hasValidToken)(b)))return[3,2];if(g=b.app_env,m=b.tier,!g||!m)throw Error("app_env or tier missing : ".concat(g,"/").concat(m));return"userId"in b&&"usergroupId"in b?(E={userId:b.userId,usergroupId:b.usergroupId},typeof y.isHiverApiDomain!="boolean"&&(y.isHiverApiDomain=!0),[4,(0,i.fetchToken)(g,m,E,y.isHiverApiDomain,v)]):[3,2];case 1:C.sent(),C.label=2;case 2:return b.csrfToken&&s(b,y),y.getToken&&(a=sessionStorage.getItem("hiverAuthToken")||"",b.headers=e(e({},b.headers),{Authorization:"Bearer ".concat(a)})),[4,c(b)];case 3:return x=C.sent(),b.onSuccess&&b.onSuccess(x),[2,x];case 4:if(A=C.sent(),T=((p=A.response)===null||p===void 0?void 0:p.status)===403||((h=A.request)===null||h===void 0?void 0:h.status)===403,d<l&&T)return(0,o.expireToken)(),[2,f(b,y,v,d+1)];if(d>=l&&T||!T)throw b.onFail&&b.onFail(A),console.log("ERROR: Reached make Axios",A),A;return[3,5];case 5:return[2]}})})}return ba.makeAxiosCall=f,ba}(function(e){var t=Be&&Be.__awaiter||function(y,v,d,p){function h(g){return g instanceof d?g:new d(function(m){m(g)})}return new(d||(d=Promise))(function(g,m){function E(T){try{A(p.next(T))}catch(C){m(C)}}function x(T){try{A(p.throw(T))}catch(C){m(C)}}function A(T){T.done?g(T.value):h(T.value).then(E,x)}A((p=p.apply(y,v||[])).next())})},n=Be&&Be.__generator||function(y,v){var d={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},p,h,g,m;return m={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function E(A){return function(T){return x([A,T])}}function x(A){if(p)throw new TypeError("Generator is already executing.");for(;m&&(m=0,A[0]&&(d=0)),d;)try{if(p=1,h&&(g=A[0]&2?h.return:A[0]?h.throw||((g=h.return)&&g.call(h),0):h.next)&&!(g=g.call(h,A[1])).done)return g;switch(h=0,g&&(A=[A[0]&2,g.value]),A[0]){case 0:case 1:g=A;break;case 4:return d.label++,{value:A[1],done:!1};case 5:d.label++,h=A[1],A=[0];continue;case 7:A=d.ops.pop(),d.trys.pop();continue;default:if(g=d.trys,!(g=g.length>0&&g[g.length-1])&&(A[0]===6||A[0]===2)){d=0;continue}if(A[0]===3&&(!g||A[1]>g[0]&&A[1]<g[3])){d.label=A[1];break}if(A[0]===6&&d.label<g[1]){d.label=g[1],g=A;break}if(g&&d.label<g[2]){d.label=g[2],d.ops.push(A);break}g[2]&&d.ops.pop(),d.trys.pop();continue}A=v.call(y,d)}catch(T){A=[6,T],h=0}finally{p=g=0}if(A[0]&5)throw A[1];return{value:A[0]?A[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=Fh(),o=kh(),i=to;Object.defineProperty(e,"TENANT_PLATFORM",{enumerable:!0,get:function(){return i.TENANT_PLATFORM}}),Object.defineProperty(e,"DEFAULT_INIT_CONFIG_HIVER",{enumerable:!0,get:function(){return i.DEFAULT_INIT_CONFIG_HIVER}});var a=Nh(),l=et,s=vr,u=Hh();Object.defineProperty(e,"makeAxiosCall",{enumerable:!0,get:function(){return u.makeAxiosCall}});var c=Gh();Object.defineProperty(e,"fetchToken",{enumerable:!0,get:function(){return c.fetchToken}});var f=yr,b=function(){function y(v,d,p,h,g,m){p===void 0&&(p=i.TENANT_PLATFORM.GMAIL),h===void 0&&(h=null),g===void 0&&(g=!0),m===void 0&&(m=!1),this.setEnvironment(),this.appEnv=v,this.tier=d,this.tenantPlatform=p,this.authTokenFetchingInProgress=!1,this.getTokenForLogin=h,this.withCredentials=g,this.csrfToken=m}return y.prototype.setEnvironment=function(){typeof window<"u"&&window.document?(0,f.setValue)("PLATFORM",i.PLATFORM.WEB):(0,f.setValue)("PLATFORM",i.PLATFORM.MOBILE)},y.prototype.hiverAxios=function(v,d,p,h){return d===void 0&&(d=i.DEFAULT_INIT_CONFIG_HIVER),t(this,void 0,void 0,function(){var g,m;return n(this,function(E){switch(E.label){case 0:return E.trys.push([0,4,,5]),h&&h<2?(g={userId:v.userId,usergroupId:v.usergroupId,apiRetry:h},console.log("THIS IS THE TENNANTPLAORM -> ",this.tenantPlatform),[4,(0,o.fetchAccessToken)(this.appEnv,this.tier,g,this.tenantPlatform,this.getTokenForLogin,i.API_CALL_ORIGIN.API_RETRY)]):[3,2];case 1:E.sent(),E.label=2;case 2:return[4,(0,r.hiverAxiosCall)(this,v,d,p)];case 3:return[2,E.sent()];case 4:throw m=E.sent(),console.log("ERROR: Axios call failed",m),m;case 5:return[2]}})})},y.prototype.fetchAuthToken=function(v,d,p){return t(this,void 0,void 0,function(){var h;return n(this,function(g){switch(g.label){case 0:return g.trys.push([0,4,7,8]),this.authTokenFetchingInProgress?[3,2]:(this.authTokenFetchingInProgress=!0,[4,(0,o.fetchAccessToken)(this.appEnv,this.tier,v,this.tenantPlatform,this.getTokenForLogin,d,p)]);case 1:return g.sent(),[3,3];case 2:console.log("Heimdall: AuthToken Fetching InProgress",this.authTokenFetchingInProgress),g.label=3;case 3:return[3,8];case 4:return h=g.sent(),console.log("ERROR: Fetching token failed",h),this.authTokenFetchingInProgress=!1,[4,new Promise(function(m){return setTimeout(m,100)})];case 5:return g.sent(),console.log("Heimdall: Retrying fetchAccessToken after 100ms..."),[4,this.fetchAuthToken(v,d,p)];case 6:return g.sent(),[3,8];case 7:return this.authTokenFetchingInProgress=!1,[7];case 8:return[2]}})})},y.prototype.logout=function(){return t(this,void 0,void 0,function(){var v,d;return n(this,function(p){switch(p.label){case 0:return p.trys.push([0,2,,3]),v=(0,l.getConfig)(this.appEnv,this.tier),[4,(0,a.logoutFromHeimdall)(v,this.tenantPlatform)];case 1:return p.sent(),(0,s.removeItemFromStorage)("hiverAuthToken"),(0,s.removeItemFromStorage)("hiverAuthTokenExpiry"),(0,s.removeItemFromStorage)("hiverAuthUserId"),(0,s.removeItemFromStorage)("hiverAuthUserGroupId"),[3,3];case 2:throw d=p.sent(),console.error("Heimdall: Logout failed",d),d;case 3:return[2]}})})},y.prototype.isTokenFetchingInProgress=function(){return this.authTokenFetchingInProgress},y}();e.Bifrost=b})(ku);const ar={userId:"",userGroupId:"",baseUrl:"",appEnv:"",tier:"",bifrost:null,isInitiated:!1},hi=()=>{if(!ar.isInitiated)return null;if(!ar.baseUrl)throw new Error("Base url is not setup. please call the initConnectorsBifrost function with the appropriate value");return ar},xw=({baseUrl:e,appEnv:t,tier:n,userId:r,userGroupId:o,tenantPlatform:i=ku.TENANT_PLATFORM.GMAIL,withCredentials:a=!0,getTokenForLogin:l})=>{ar.baseUrl=e,ar.appEnv=t,ar.tier=n,ar.userGroupId=o,ar.userId=r,ar.tenantPlatform=i,ar.bifrost=new ku.Bifrost(t,n,i,l,a),ar.isInitiated=!0},on=(({configHiver:e})=>async n=>{const r=hi();if(!r)throw new Error("Please call initConnectorsBifrost before making any api calls");const{bifrost:o,userGroupId:i,userId:a}=r,{url:l,method:s,root_url:u}=n,f={root_url:(u||r.baseUrl)+((n==null?void 0:n.prefix)||""),url:l,method:s,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(a),usergroupId:Number(i)};try{return await(o==null?void 0:o.hiverAxios(f,{...e,isHiverApiDomain:!0}))}catch(b){throw console.error("API call failed with error: ",b),b}})({configHiver:{getToken:!0,fetchCsrfToken:()=>"",isHiverApiDomain:!0},withCredentials:!0}),Cw=jn+"/template/list",ww=jn+"/template/{{templateId}}",Iw=()=>on({url:Cw,method:wn.GET}),Sw=e=>on({url:ww.replace("{{templateId}}",e),method:wn.GET}),zh=e=>e.templateLibrary.connectorTemplateList,oc=e=>e.templateLibrary.connectorTemplates,Tw=e=>e.templateLibrary.templateListApiStatus,Xh=e=>e.templateLibrary.templateDetailsApiStatus,Aw=ca({name:"templateLibrary",initialState:JE,reducers:{},extraReducers:e=>{e.addCase(Hs.pending,t=>{t.templateListApiStatus=Ie.LOADING}).addCase(Hs.fulfilled,(t,n)=>{t.templateListApiStatus=Ie.IDLE,t.connectorTemplateList=n.payload.connectorList,t.connectorTemplates=n.payload.connectors}).addCase(Hs.rejected,(t,n)=>{t.templateListApiStatus=Ie.FAILED,console.error(n.error)}).addCase(ya.pending,t=>{t.templateDetailsApiStatus=Ie.LOADING}).addCase(ya.fulfilled,(t,n)=>{t.templateDetailsApiStatus=Ie.IDLE;const{templateData:r,templateId:o}=n.payload;r&&o&&(t.connectorTemplates={...t.connectorTemplates,[o]:r})}).addCase(ya.rejected,(t,n)=>{t.templateDetailsApiStatus=Ie.FAILED,console.error(n.error)})}}),Hs=Cn("connectorLibrary/fetchConnectorTemplates",async()=>{const e=await Iw();if(!e||!e.data||!Array.isArray(e.data))return{connectorList:[],connectors:{}};const t=e.data,n=Mp(t,o=>o.id),r=Bp(t,o=>o.id);return{connectors:n,connectorList:r}}),ya=Cn("connectorLibrary/fetchTemplateDetails",async e=>{const t=await Sw(e);return!t||!t.data?{templateId:e,templateData:null}:{templateData:t.data,templateId:e}}),_w=Aw.reducer,Ow={connectors:null,connectorList:[],connectorsApiStatus:Ie.IDLE,selectedConnector:null,currentUpdatingConnectors:{},connectorDetailApiStatus:Ie.IDLE,connectorDetails:null,fetchInboxApiStatus:Ie.IDLE,chatInboxDetails:null,emailInboxDetails:null,rolesAndPermissions:null,rolesAndPermissionsApiStatus:Ie.IDLE,updateEnableConnectorsApiStatus:Ie.IDLE,cardCustomFields:{},cardCustomFieldsApiStatus:Ie.IDLE},Rw=jn+"/connectors/ug",Nw=jn+"/connectors/{{id}}",Dw=jn+"/connectors/{{id}}",Zh="{{card_id}}",Pw=jn+`/connectors/cards/${Zh}`,kw=jn+"/connectors/cards/:cardId/custom_fields",Lw=()=>on({url:Rw,method:wn.GET}),Fw=({id:e,enabled:t})=>on({url:Nw.replace("{{id}}",e),method:wn.PATCH,data:{enabled:t}}),Mw=e=>{const t=Dw.replace("{{id}}",e);return on({url:t,method:wn.GET})},Bw=({cardId:e,data:t})=>on({url:Pw.replace(Zh,e),method:wn.PATCH,data:t}),jw=e=>on({url:Hp(kw,{cardId:e}),method:wn.GET}),Vw=ca({name:"connectorLibrary",initialState:Ow,reducers:{},extraReducers:e=>{e.addCase(Us.pending,t=>{t.connectorsApiStatus=Ie.LOADING}).addCase(Us.fulfilled,(t,n)=>{t.connectorsApiStatus=Ie.IDLE,t.connectorList=n.payload.connectorList,t.connectors=n.payload.connectors}).addCase(Us.rejected,(t,n)=>{t.connectorsApiStatus=Ie.FAILED,console.error(n.error)}).addCase(zs.pending,(t,n)=>{var o;const{id:r}=((o=n==null?void 0:n.meta)==null?void 0:o.arg)||{};t.currentUpdatingConnectors={...t.currentUpdatingConnectors,[r]:Ie.LOADING}}).addCase(zs.fulfilled,(t,n)=>{var i,a;const{id:r="",enabled:o}=((i=n==null?void 0:n.meta)==null?void 0:i.arg)||{};t.currentUpdatingConnectors[r]&&(t.currentUpdatingConnectors[r]=Ie.IDLE),(a=t==null?void 0:t.connectors)!=null&&a[r]&&(t.connectors[r].isEnabled=o)}).addCase(zs.rejected,(t,n)=>{var o;const{id:r}=((o=n==null?void 0:n.meta)==null?void 0:o.arg)||{};t.currentUpdatingConnectors={...t.currentUpdatingConnectors,[r]:Ie.FAILED},console.error(n.error)}).addCase(Ea.pending,t=>{t.connectorDetailApiStatus=Ie.LOADING}).addCase(Ea.fulfilled,(t,n)=>{var i;t.connectorDetailApiStatus=Ie.IDLE;const{connector:r,connectorId:o}=n.payload;r&&(t.connectors={...t.connectors,[o]:{...(i=t.connectors)==null?void 0:i[o],...r}})}).addCase(Ea.rejected,(t,n)=>{t.connectorDetailApiStatus=Ie.FAILED,console.error(n.error)}).addCase(Xs.pending,t=>{t.fetchInboxApiStatus=Ie.LOADING}).addCase(Xs.fulfilled,(t,n)=>{t.fetchInboxApiStatus=Ie.IDLE;const{chatInbox:r,emailInbox:o}=n.payload;t.chatInboxDetails=r,t.emailInboxDetails=o}).addCase(Xs.rejected,(t,n)=>{t.fetchInboxApiStatus=Ie.FAILED,console.error(n.error)}).addCase(Ys.pending,t=>{t.rolesAndPermissionsApiStatus=Ie.LOADING}).addCase(Ys.fulfilled,(t,n)=>{t.rolesAndPermissionsApiStatus=Ie.IDLE;const{rolesAndPermissions:r}=n.payload;t.rolesAndPermissions=r}).addCase(Ys.rejected,(t,n)=>{t.rolesAndPermissionsApiStatus=Ie.FAILED,console.error(n.error)}).addCase(Zs.pending,t=>{t.updateEnableConnectorsApiStatus=Ie.LOADING}).addCase(Zs.fulfilled,(t,n)=>{var u;t.updateEnableConnectorsApiStatus=Ie.IDLE;const{cardId:r,data:o,currentConnector:i}=n.payload.params,{roles:a,inboxes:l,fields:s}=o;t!=null&&t.connectors&&(t.connectors[i].cardList=(u=t.connectors[i].cardList)==null?void 0:u.map(c=>(c.id===r&&(c={...c,inboxes:l,roles:a,fields:s}),c)))}).addCase(Zs.rejected,t=>{t.updateEnableConnectorsApiStatus=Ie.FAILED}).addCase(qs.pending,t=>{t.cardCustomFieldsApiStatus=Ie.LOADING}).addCase(qs.fulfilled,(t,n)=>{t.cardCustomFieldsApiStatus=Ie.IDLE;const{cardId:r,customFields:o}=n.payload;t.cardCustomFields={...t.cardCustomFields,[r]:o}}).addCase(qs.rejected,(t,n)=>{t.cardCustomFieldsApiStatus=Ie.FAILED,console.error(n.error)})}}),zs=Cn("connectorLibrary/updateConnectors",async e=>(await Fw(e),{params:e})),Xs=Cn("connectorLibrary/getInboxDetails",async e=>{const t=await e();return{chatInbox:t.chatInboxes,emailInbox:t.emailInboxes}}),Zs=Cn("connectorLibrary/updateEnableConnectors",async e=>(await Bw(e),{params:e})),Ys=Cn("connectorLibrary/getRolesAndPermissions",async e=>({rolesAndPermissions:(await e()).roles})),Us=Cn("connectorLibrary/fetchConnectors",async()=>{const e=await Lw();if(!e||!e.data||!Array.isArray(e.data))return{connectorList:[],connectors:{}};const t=e.data;t.forEach(o=>{o.cardList&&(o.cardList.sort((i,a)=>i.priority-a.priority),o.cardList.forEach(i=>{i.fields&&i.fields.sort((a,l)=>a.priority-l.priority)}))});const n=Mp(t,o=>o.id),r=Bp(t,o=>o.id);return{connectors:n,connectorList:r}}),Ea=Cn("auth/fetchConnector",async e=>{const t=await Mw(e);return!t||!t.data?{connectorId:e,connector:null}:{connector:t.data,connectorId:e}}),qs=Cn("auth/fetchCardsCustomFields",async e=>{const t=await jw(e);return!t||!t.data||!t.data.fields||!Array.isArray(t.data.fields)?{cardId:e,customFields:[]}:{customFields:t.data.fields,cardId:e}},{condition:(e,{getState:t})=>{const{connectorLirary:n}=t();return!(n.cardCustomFields[e]&&n.cardCustomFields[e].length!==0)}}),Gw=Vw.reducer,Yh={testApiStatus:Ie.IDLE,isAuthenticated:{},verifyTokenApiStatus:Ie.IDLE,authVerificationDone:!1,testApiData:null},Ww=jn+"/connector/auth",Hw=jn+"/connector/{{id}}/auth/test",zw=jn+"/connector/{{id}}/auth",Xw=jn+"/connectors/{{id}}/auth/validate_token",Zw=jn+"/connectors/:connectorId/status",Yw=(e,t)=>{const n=Hw.replace("{{id}}",t);return on({url:n,method:wn.POST,data:e})},Uw=(e,t)=>{const n=Xw.replace("{{id}}",t);return on({url:n,method:wn.POST,data:e})},Uh=ca({name:"auth",initialState:Yh,reducers:{resetState:()=>Yh},extraReducers:e=>{e.addCase(Js.pending,t=>{t.authVerificationDone=!1,t.verifyTokenApiStatus=Ie.LOADING}).addCase(Js.fulfilled,t=>{t.authVerificationDone=!0,t.verifyTokenApiStatus=Ie.IDLE}).addCase(Js.rejected,(t,n)=>{t.authVerificationDone=!0,t.verifyTokenApiStatus=Ie.FAILED,console.error(n.error)}).addCase(ic.pending,t=>{t.testApiStatus=Ie.LOADING}).addCase(ic.fulfilled,(t,n)=>{t.testApiStatus=Ie.IDLE,t.testApiData=n.payload}).addCase(ic.rejected,(t,n)=>{const r={response:n.error,statusCode:n.error.code||"400"};t.testApiStatus=Ie.FAILED,t.testApiData=r,console.error(n.error)})}}),ic=Cn("auth/testAuth",async({data:e,connectorId:t})=>{const n=await Yw(e,t);if(!n||!n.data)return{response:null,statusCode:""};const r=n.data;return{response:r.response||r.errorMessage,statusCode:String(r.statusCode)}}),Js=Cn("auth/verifyToken",async({data:e,connectorId:t})=>{await Uw(e,t)}),{resetState:qw}=Uh.actions,Jw=Uh.reducer,Qw={connectorRequestsApiStatus:Ie.IDLE,requestableConnectors:null,requestableApis:null},qh=jn+"/connectors/integration/requests",$w=()=>on({url:qh,method:wn.GET}),Kw=({type:e,values:t,description:n})=>on({url:qh,method:wn.POST,data:{type:e,values:t,description:n}}),eI=ca({name:"connectorLibrary",initialState:Qw,reducers:{},extraReducers:e=>{e.addCase(Qs.pending,t=>{t.connectorRequestsApiStatus=Ie.LOADING}).addCase(Qs.fulfilled,(t,n)=>{t.connectorRequestsApiStatus=Ie.IDLE,t.requestableConnectors=n.payload.requestableConnectors,t.requestableApis=n.payload.requestableApis}).addCase(Qs.rejected,t=>{t.connectorRequestsApiStatus=Ie.FAILED}).addCase($s.pending,t=>{t.connectorRequestsApiStatus=Ie.LOADING}).addCase($s.fulfilled,t=>{t.connectorRequestsApiStatus=Ie.IDLE}).addCase($s.rejected,t=>{t.connectorRequestsApiStatus=Ie.FAILED})}}),Qs=Cn("connectorLibrary/fetchConnectorRequests",async()=>{const e=await $w();if(!e||!e.data)return{requestableConnectors:[],requestableApis:[]};const n=e.data.requestableConnectors,r=e.data.requestableApis;return{requestableConnectors:n,requestableApis:r}}),$s=Cn("connectorLibrary/submitConnectorRequest",async e=>(await Kw(e),{params:e})),tI=eI.reducer,nI=ip({counter:AE,connectorLirary:Gw,templateLibrary:_w,auth:Jw,requestConnectorApi:tI}),rI=aE({reducer:nI,devTools:!0}),oI={currentSideBar:"",setCurrentSideBar:()=>{},currentConnector:"",setCurrentConnector:()=>{},currentAvailableConnectors:[],setCurrentAvailableConnectors:()=>{},baseUrls:{},availableFeatures:{},sendTrackingEvent:()=>{},userPermissions:[],metaData:void 0},qt=S.createContext(oI),Xe={BASEPATH:"/",CONNECTOR_SETTINGS:"connector/settings",DASHBOARD:"dashboard",AGENT:"agent",CONNECTOR_CONFIG:"connector",API_VIEW:"connector/apiView",AUTH_SUCCESS:"authSuccess"},ac="Custom Connectors",sc={id:"connectors_view",value:"Connectors",route:Xe.DASHBOARD},Jh={id:"agent_view",value:"Agent view",route:Xe.AGENT},iI=[sc,Jh],Qh={[sc.value]:[Xe.BASEPATH+Xe.DASHBOARD,Xe.BASEPATH+Xe.CONNECTOR_CONFIG,Xe.BASEPATH+Xe.CONNECTOR_SETTINGS,Xe.BASEPATH,Xe.BASEPATH+Xe.API_VIEW],[Jh.value]:[Xe.AGENT]},aI=({children:e,baseUrls:t,availableFeatures:n,extraParams:r,connectorFunctions:o})=>{const[i,a]=S.useState(sc.id),[l,s]=S.useState(""),[u,c]=S.useState([]);return I.jsx(qt.Provider,{value:{currentSideBar:i,setCurrentSideBar:a,currentConnector:l,setCurrentConnector:s,currentAvailableConnectors:u,setCurrentAvailableConnectors:c,baseUrls:t??{},availableFeatures:n??{},sendTrackingEvent:(r==null?void 0:r.sendTrackingEvent)??(()=>{}),userPermissions:(r==null?void 0:r.userPermissions)??[],metaData:r==null?void 0:r.metaData,connectorFunctions:o},children:e})};var gi=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(){}},jo=typeof window>"u"||"Deno"in globalThis;function Un(){}function sI(e,t){return typeof e=="function"?e(t):e}function lc(e){return typeof e=="number"&&e>=0&&e!==1/0}function $h(e,t){return Math.max(e+(t||0)-Date.now(),0)}function mi(e,t){return typeof e=="function"?e(t):e}function sr(e,t){return typeof e=="function"?e(t):e}function Kh(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:l}=e;if(a){if(r){if(t.queryHash!==uc(a,t.options))return!1}else if(!xa(t.queryKey,a))return!1}if(n!=="all"){const s=t.isActive();if(n==="active"&&!s||n==="inactive"&&s)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||o&&o!==t.state.fetchStatus||i&&!i(t))}function eg(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Vo(t.options.mutationKey)!==Vo(i))return!1}else if(!xa(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function uc(e,t){return((t==null?void 0:t.queryKeyHashFn)||Vo)(e)}function Vo(e){return JSON.stringify(e,(t,n)=>dc(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function xa(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!xa(e[n],t[n])):!1}function cc(e,t){if(e===t)return e;const n=tg(e)&&tg(t);if(n||dc(e)&&dc(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),a=i.length,l=n?[]:{};let s=0;for(let u=0;u<a;u++){const c=n?u:i[u];(!n&&r.includes(c)||n)&&e[c]===void 0&&t[c]===void 0?(l[c]=void 0,s++):(l[c]=cc(e[c],t[c]),l[c]===e[c]&&e[c]!==void 0&&s++)}return o===a&&s===o?e:l}return t}function Ks(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 tg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function dc(e){if(!ng(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!ng(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ng(e){return Object.prototype.toString.call(e)==="[object Object]"}function lI(e){return new Promise(t=>{setTimeout(t,e)})}function fc(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 cc(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 cc(e,t)}return t}function uI(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function cI(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var el=Symbol();function rg(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===el&&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===el?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var dI=(my=class extends gi{constructor(){super();De(this,$o);De(this,mo);De(this,Vi);Ce(this,Vi,t=>{if(!jo&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){D(this,mo)||this.setEventListener(D(this,Vi))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,mo))==null||t.call(this),Ce(this,mo,void 0))}setEventListener(t){var n;Ce(this,Vi,t),(n=D(this,mo))==null||n.call(this),Ce(this,mo,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){D(this,$o)!==t&&(Ce(this,$o,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof D(this,$o)=="boolean"?D(this,$o):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},$o=new WeakMap,mo=new WeakMap,Vi=new WeakMap,my),pc=new dI,fI=(by=class extends gi{constructor(){super();De(this,Gi,!0);De(this,bo);De(this,Wi);Ce(this,Wi,t=>{if(!jo&&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(){D(this,bo)||this.setEventListener(D(this,Wi))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,bo))==null||t.call(this),Ce(this,bo,void 0))}setEventListener(t){var n;Ce(this,Wi,t),(n=D(this,bo))==null||n.call(this),Ce(this,bo,t(this.setOnline.bind(this)))}setOnline(t){D(this,Gi)!==t&&(Ce(this,Gi,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return D(this,Gi)}},Gi=new WeakMap,bo=new WeakMap,Wi=new WeakMap,by),tl=new fI;function hc(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});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 pI(e){return Math.min(1e3*2**e,3e4)}function og(e){return(e??"online")==="online"?tl.isOnline():!0}var ig=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function gc(e){return e instanceof ig}function ag(e){let t=!1,n=0,r=!1,o;const i=hc(),a=d=>{var p;r||(b(new ig(d)),(p=e.abort)==null||p.call(e))},l=()=>{t=!0},s=()=>{t=!1},u=()=>pc.isFocused()&&(e.networkMode==="always"||tl.isOnline())&&e.canRun(),c=()=>og(e.networkMode)&&e.canRun(),f=d=>{var p;r||(r=!0,(p=e.onSuccess)==null||p.call(e,d),o==null||o(),i.resolve(d))},b=d=>{var p;r||(r=!0,(p=e.onError)==null||p.call(e,d),o==null||o(),i.reject(d))},y=()=>new Promise(d=>{var p;o=h=>{(r||u())&&d(h)},(p=e.onPause)==null||p.call(e)}).then(()=>{var d;o=void 0,r||(d=e.onContinue)==null||d.call(e)}),v=()=>{if(r)return;let d;const p=n===0?e.initialPromise:void 0;try{d=p??e.fn()}catch(h){d=Promise.reject(h)}Promise.resolve(d).then(f).catch(h=>{var A;if(r)return;const g=e.retry??(jo?0:3),m=e.retryDelay??pI,E=typeof m=="function"?m(n,h):m,x=g===!0||typeof g=="number"&&n<g||typeof g=="function"&&g(n,h);if(t||!x){b(h);return}n++,(A=e.onFail)==null||A.call(e,n,h),lI(E).then(()=>u()?void 0:y()).then(()=>{t?b(h):v()})})};return{promise:i,cancel:a,continue:()=>(o==null||o(),i),cancelRetry:l,continueRetry:s,canStart:c,start:()=>(c()?v():y().then(v),i)}}function hI(){let e=[],t=0,n=l=>{l()},r=l=>{l()},o=l=>setTimeout(l,0);const i=l=>{t?e.push(l):o(()=>{n(l)})},a=()=>{const l=e;e=[],l.length&&o(()=>{r(()=>{l.forEach(s=>{n(s)})})})};return{batch:l=>{let s;t++;try{s=l()}finally{t--,t||a()}return s},batchCalls:l=>(...s)=>{i(()=>{l(...s)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{o=l}}}var zt=hI(),sg=(vy=class{constructor(){De(this,Ko)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lc(this.gcTime)&&Ce(this,Ko,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(jo?1/0:5*60*1e3))}clearGcTimeout(){D(this,Ko)&&(clearTimeout(D(this,Ko)),Ce(this,Ko,void 0))}},Ko=new WeakMap,vy),gI=(yy=class extends sg{constructor(t){super();De(this,hr);De(this,Hi);De(this,zi);De(this,Kn);De(this,ei);De(this,un);De(this,rs);De(this,ti);Ce(this,ti,!1),Ce(this,rs,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ce(this,ei,t.client),Ce(this,Kn,D(this,ei).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ce(this,Hi,mI(this.options)),this.state=t.state??D(this,Hi),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=D(this,un))==null?void 0:t.promise}setOptions(t){this.options={...D(this,rs),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&D(this,Kn).remove(this)}setData(t,n){const r=fc(this.state.data,t,this.options);return We(this,hr,Jr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){We(this,hr,Jr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=D(this,un))==null?void 0:r.promise;return(o=D(this,un))==null||o.cancel(t),n?n.then(Un).catch(Un):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(D(this,Hi))}isActive(){return this.observers.some(t=>sr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===el||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||!$h(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=D(this,un))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=D(this,un))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),D(this,Kn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(D(this,un)&&(D(this,ti)?D(this,un).cancel({revert:!0}):D(this,un).cancelRetry()),this.scheduleGc()),D(this,Kn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||We(this,hr,Jr).call(this,{type:"invalidate"})}fetch(t,n){var s,u,c;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(D(this,un))return D(this,un).continueRetry(),D(this,un).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(b=>b.options.queryFn);f&&this.setOptions(f.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=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(Ce(this,ti,!0),r.signal)})},i=()=>{const f=rg(this.options,n),b={client:D(this,ei),queryKey:this.queryKey,meta:this.meta};return o(b),Ce(this,ti,!1),this.options.persister?this.options.persister(f,b,this):f(b)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:D(this,ei),state:this.state,fetchFn:i};o(a),(s=this.options.behavior)==null||s.onFetch(a,this),Ce(this,zi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&We(this,hr,Jr).call(this,{type:"fetch",meta:(c=a.fetchOptions)==null?void 0:c.meta});const l=f=>{var b,y,v,d;gc(f)&&f.silent||We(this,hr,Jr).call(this,{type:"error",error:f}),gc(f)||((y=(b=D(this,Kn).config).onError)==null||y.call(b,f,this),(d=(v=D(this,Kn).config).onSettled)==null||d.call(v,this.state.data,f,this)),this.scheduleGc()};return Ce(this,un,ag({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var b,y,v,d;if(f===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}`),l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(p){l(p);return}(y=(b=D(this,Kn).config).onSuccess)==null||y.call(b,f,this),(d=(v=D(this,Kn).config).onSettled)==null||d.call(v,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,b)=>{We(this,hr,Jr).call(this,{type:"failed",failureCount:f,error:b})},onPause:()=>{We(this,hr,Jr).call(this,{type:"pause"})},onContinue:()=>{We(this,hr,Jr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),D(this,un).start()}},Hi=new WeakMap,zi=new WeakMap,Kn=new WeakMap,ei=new WeakMap,un=new WeakMap,rs=new WeakMap,ti=new WeakMap,hr=new WeakSet,Jr=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,...lg(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 gc(o)&&o.revert&&D(this,zi)?{...D(this,zi),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),zt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),D(this,Kn).notify({query:this,type:"updated",action:t})})},yy);function lg(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:og(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function mI(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 bI=(Ey=class extends gi{constructor(t={}){super();De(this,Dr);this.config=t,Ce(this,Dr,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??uc(o,n);let a=this.get(i);return a||(a=new gI({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){D(this,Dr).has(t.queryHash)||(D(this,Dr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=D(this,Dr).get(t.queryHash);n&&(t.destroy(),n===t&&D(this,Dr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){zt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return D(this,Dr).get(t)}getAll(){return[...D(this,Dr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Kh(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Kh(t,r)):n}notify(t){zt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){zt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){zt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Dr=new WeakMap,Ey),vI=(xy=class extends sg{constructor(t){super();De(this,kr);De(this,Pr);De(this,yn);De(this,ni);this.mutationId=t.mutationId,Ce(this,yn,t.mutationCache),Ce(this,Pr,[]),this.state=t.state||ug(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){D(this,Pr).includes(t)||(D(this,Pr).push(t),this.clearGcTimeout(),D(this,yn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ce(this,Pr,D(this,Pr).filter(n=>n!==t)),this.scheduleGc(),D(this,yn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){D(this,Pr).length||(this.state.status==="pending"?this.scheduleGc():D(this,yn).remove(this))}continue(){var t;return((t=D(this,ni))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,a,l,s,u,c,f,b,y,v,d,p,h,g,m,E,x,A,T;Ce(this,ni,ag({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(C,O)=>{We(this,kr,Oo).call(this,{type:"failed",failureCount:C,error:O})},onPause:()=>{We(this,kr,Oo).call(this,{type:"pause"})},onContinue:()=>{We(this,kr,Oo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>D(this,yn).canRun(this)}));const n=this.state.status==="pending",r=!D(this,ni).canStart();try{if(!n){We(this,kr,Oo).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=D(this,yn).config).onMutate)==null?void 0:i.call(o,t,this));const O=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));O!==this.state.context&&We(this,kr,Oo).call(this,{type:"pending",context:O,variables:t,isPaused:r})}const C=await D(this,ni).start();return await((u=(s=D(this,yn).config).onSuccess)==null?void 0:u.call(s,C,t,this.state.context,this)),await((f=(c=this.options).onSuccess)==null?void 0:f.call(c,C,t,this.state.context)),await((y=(b=D(this,yn).config).onSettled)==null?void 0:y.call(b,C,null,this.state.variables,this.state.context,this)),await((d=(v=this.options).onSettled)==null?void 0:d.call(v,C,null,t,this.state.context)),We(this,kr,Oo).call(this,{type:"success",data:C}),C}catch(C){try{throw await((h=(p=D(this,yn).config).onError)==null?void 0:h.call(p,C,t,this.state.context,this)),await((m=(g=this.options).onError)==null?void 0:m.call(g,C,t,this.state.context)),await((x=(E=D(this,yn).config).onSettled)==null?void 0:x.call(E,void 0,C,this.state.variables,this.state.context,this)),await((T=(A=this.options).onSettled)==null?void 0:T.call(A,void 0,C,t,this.state.context)),C}finally{We(this,kr,Oo).call(this,{type:"error",error:C})}}finally{D(this,yn).runNext(this)}}},Pr=new WeakMap,yn=new WeakMap,ni=new WeakMap,kr=new WeakSet,Oo=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),zt.batch(()=>{D(this,Pr).forEach(r=>{r.onMutationUpdate(t)}),D(this,yn).notify({mutation:this,type:"updated",action:t})})},xy);function ug(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var yI=(Cy=class extends gi{constructor(t={}){super();De(this,Xr);De(this,gr);De(this,os);this.config=t,Ce(this,Xr,new Set),Ce(this,gr,new Map),Ce(this,os,0)}build(t,n,r){const o=new vI({mutationCache:this,mutationId:++cu(this,os)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){D(this,Xr).add(t);const n=nl(t);if(typeof n=="string"){const r=D(this,gr).get(n);r?r.push(t):D(this,gr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(D(this,Xr).delete(t)){const n=nl(t);if(typeof n=="string"){const r=D(this,gr).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&D(this,gr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=nl(t);if(typeof n=="string"){const r=D(this,gr).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=nl(t);if(typeof n=="string"){const o=(r=D(this,gr).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){zt.batch(()=>{D(this,Xr).forEach(t=>{this.notify({type:"removed",mutation:t})}),D(this,Xr).clear(),D(this,gr).clear()})}getAll(){return Array.from(D(this,Xr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>eg(n,r))}findAll(t={}){return this.getAll().filter(n=>eg(t,n))}notify(t){zt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return zt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Un))))}},Xr=new WeakMap,gr=new WeakMap,os=new WeakMap,Cy);function nl(e){var t;return(t=e.options.scope)==null?void 0:t.id}function cg(e){return{onFetch:(t,n)=>{var c,f,b,y,v;const r=t.options,o=(b=(f=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:f.fetchMore)==null?void 0:b.direction,i=((y=t.state.data)==null?void 0:y.pages)||[],a=((v=t.state.data)==null?void 0:v.pageParams)||[];let l={pages:[],pageParams:[]},s=0;const u=async()=>{let d=!1;const p=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?d=!0:t.signal.addEventListener("abort",()=>{d=!0}),t.signal)})},h=rg(t.options,t.fetchOptions),g=async(m,E,x)=>{if(d)return Promise.reject();if(E==null&&m.pages.length)return Promise.resolve(m);const A={client:t.client,queryKey:t.queryKey,pageParam:E,direction:x?"backward":"forward",meta:t.options.meta};p(A);const T=await h(A),{maxPages:C}=t.options,O=x?cI:uI;return{pages:O(m.pages,T,C),pageParams:O(m.pageParams,E,C)}};if(o&&i.length){const m=o==="backward",E=m?EI:dg,x={pages:i,pageParams:a},A=E(r,x);l=await g(x,A,m)}else{const m=e??i.length;do{const E=s===0?a[0]??r.initialPageParam:dg(r,l);if(s>0&&E==null)break;l=await g(l,E),s++}while(s<m)}return l};t.options.persister?t.fetchFn=()=>{var d,p;return(p=(d=t.options).persister)==null?void 0:p.call(d,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function dg(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 EI(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 xI=(wy=class{constructor(e={}){De(this,Nt);De(this,vo);De(this,yo);De(this,Xi);De(this,Zi);De(this,Eo);De(this,Yi);De(this,Ui);Ce(this,Nt,e.queryCache||new bI),Ce(this,vo,e.mutationCache||new yI),Ce(this,yo,e.defaultOptions||{}),Ce(this,Xi,new Map),Ce(this,Zi,new Map),Ce(this,Eo,0)}mount(){cu(this,Eo)._++,D(this,Eo)===1&&(Ce(this,Yi,pc.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,Nt).onFocus())})),Ce(this,Ui,tl.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,Nt).onOnline())})))}unmount(){var e,t;cu(this,Eo)._--,D(this,Eo)===0&&((e=D(this,Yi))==null||e.call(this),Ce(this,Yi,void 0),(t=D(this,Ui))==null||t.call(this),Ce(this,Ui,void 0))}isFetching(e){return D(this,Nt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return D(this,vo).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,Nt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=D(this,Nt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(mi(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return D(this,Nt).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=D(this,Nt).get(r.queryHash),i=o==null?void 0:o.state.data,a=sI(t,i);if(a!==void 0)return D(this,Nt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return zt.batch(()=>D(this,Nt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,Nt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=D(this,Nt);zt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=D(this,Nt);return zt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=zt.batch(()=>D(this,Nt).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Un).catch(Un)}invalidateQueries(e,t={}){return zt.batch(()=>(D(this,Nt).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=zt.batch(()=>D(this,Nt).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Un)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Un)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=D(this,Nt).build(this,t);return n.isStaleByTime(mi(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Un).catch(Un)}fetchInfiniteQuery(e){return e.behavior=cg(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Un).catch(Un)}ensureInfiniteQueryData(e){return e.behavior=cg(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return tl.isOnline()?D(this,vo).resumePausedMutations():Promise.resolve()}getQueryCache(){return D(this,Nt)}getMutationCache(){return D(this,vo)}getDefaultOptions(){return D(this,yo)}setDefaultOptions(e){Ce(this,yo,e)}setQueryDefaults(e,t){D(this,Xi).set(Vo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...D(this,Xi).values()],n={};return t.forEach(r=>{xa(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){D(this,Zi).set(Vo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...D(this,Zi).values()],n={};return t.forEach(r=>{xa(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...D(this,yo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=uc(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===el&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...D(this,yo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){D(this,Nt).clear(),D(this,vo).clear()}},Nt=new WeakMap,vo=new WeakMap,yo=new WeakMap,Xi=new WeakMap,Zi=new WeakMap,Eo=new WeakMap,Yi=new WeakMap,Ui=new WeakMap,wy),CI=(Iy=class extends gi{constructor(t,n){super();De(this,ft);De(this,On);De(this,Ze);De(this,is);De(this,En);De(this,ri);De(this,qi);De(this,xo);De(this,Lr);De(this,as);De(this,Ji);De(this,Qi);De(this,oi);De(this,ii);De(this,Co);De(this,$i,new Set);this.options=n,Ce(this,On,t),Ce(this,Lr,null),Ce(this,xo,hc()),this.options.experimental_prefetchInRender||D(this,xo).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&&(D(this,Ze).addObserver(this),fg(D(this,Ze),this.options)?We(this,ft,us).call(this):this.updateResult(),We(this,ft,kf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return mc(D(this,Ze),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return mc(D(this,Ze),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,We(this,ft,Lf).call(this),We(this,ft,Ff).call(this),D(this,Ze).removeObserver(this)}setOptions(t,n){const r=this.options,o=D(this,Ze);if(this.options=D(this,On).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof sr(this.options.enabled,D(this,Ze))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");We(this,ft,Mf).call(this),D(this,Ze).setOptions(this.options),r._defaulted&&!Ks(this.options,r)&&D(this,On).getQueryCache().notify({type:"observerOptionsUpdated",query:D(this,Ze),observer:this});const i=this.hasListeners();i&&pg(D(this,Ze),o,this.options,r)&&We(this,ft,us).call(this),this.updateResult(n),i&&(D(this,Ze)!==o||sr(this.options.enabled,D(this,Ze))!==sr(r.enabled,D(this,Ze))||mi(this.options.staleTime,D(this,Ze))!==mi(r.staleTime,D(this,Ze)))&&We(this,ft,Nf).call(this);const a=We(this,ft,Df).call(this);i&&(D(this,Ze)!==o||sr(this.options.enabled,D(this,Ze))!==sr(r.enabled,D(this,Ze))||a!==D(this,Co))&&We(this,ft,Pf).call(this,a)}getOptimisticResult(t){const n=D(this,On).getQueryCache().build(D(this,On),t),r=this.createResult(n,t);return II(this,r)&&(Ce(this,En,r),Ce(this,qi,this.options),Ce(this,ri,D(this,Ze).state)),r}getCurrentResult(){return D(this,En)}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){D(this,$i).add(t)}getCurrentQuery(){return D(this,Ze)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=D(this,On).defaultQueryOptions(t),r=D(this,On).getQueryCache().build(D(this,On),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return We(this,ft,us).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),D(this,En)))}createResult(t,n){var C;const r=D(this,Ze),o=this.options,i=D(this,En),a=D(this,ri),l=D(this,qi),u=t!==r?t.state:D(this,is),{state:c}=t;let f={...c},b=!1,y;if(n._optimisticResults){const O=this.hasListeners(),M=!O&&fg(t,n),B=O&&pg(t,r,n,o);(M||B)&&(f={...f,...lg(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:d,status:p}=f;if(n.select&&f.data!==void 0)if(i&&f.data===(a==null?void 0:a.data)&&n.select===D(this,as))y=D(this,Ji);else try{Ce(this,as,n.select),y=n.select(f.data),y=fc(i==null?void 0:i.data,y,n),Ce(this,Ji,y),Ce(this,Lr,null)}catch(O){Ce(this,Lr,O)}else y=f.data;if(n.placeholderData!==void 0&&y===void 0&&p==="pending"){let O;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))O=i.data;else if(O=typeof n.placeholderData=="function"?n.placeholderData((C=D(this,Qi))==null?void 0:C.state.data,D(this,Qi)):n.placeholderData,n.select&&O!==void 0)try{O=n.select(O),Ce(this,Lr,null)}catch(M){Ce(this,Lr,M)}O!==void 0&&(p="success",y=fc(i==null?void 0:i.data,O,n),b=!0)}D(this,Lr)&&(v=D(this,Lr),y=D(this,Ji),d=Date.now(),p="error");const h=f.fetchStatus==="fetching",g=p==="pending",m=p==="error",E=g&&h,x=y!==void 0,T={status:p,fetchStatus:f.fetchStatus,isPending:g,isSuccess:p==="success",isError:m,isInitialLoading:E,isLoading:E,data:y,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:d,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:h,isRefetching:h&&!g,isLoadingError:m&&!x,isPaused:f.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:m&&x,isStale:bc(t,n),refetch:this.refetch,promise:D(this,xo)};if(this.options.experimental_prefetchInRender){const O=U=>{T.status==="error"?U.reject(T.error):T.data!==void 0&&U.resolve(T.data)},M=()=>{const U=Ce(this,xo,T.promise=hc());O(U)},B=D(this,xo);switch(B.status){case"pending":t.queryHash===r.queryHash&&O(B);break;case"fulfilled":(T.status==="error"||T.data!==B.value)&&M();break;case"rejected":(T.status!=="error"||T.error!==B.reason)&&M();break}}return T}updateResult(t){const n=D(this,En),r=this.createResult(D(this,Ze),this.options);if(Ce(this,ri,D(this,Ze).state),Ce(this,qi,this.options),D(this,ri).data!==void 0&&Ce(this,Qi,D(this,Ze)),Ks(r,n))return;Ce(this,En,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,l=typeof a=="function"?a():a;if(l==="all"||!l&&!D(this,$i).size)return!0;const s=new Set(l??D(this,$i));return this.options.throwOnError&&s.add("error"),Object.keys(D(this,En)).some(u=>{const c=u;return D(this,En)[c]!==n[c]&&s.has(c)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),We(this,ft,_y).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&We(this,ft,kf).call(this)}},On=new WeakMap,Ze=new WeakMap,is=new WeakMap,En=new WeakMap,ri=new WeakMap,qi=new WeakMap,xo=new WeakMap,Lr=new WeakMap,as=new WeakMap,Ji=new WeakMap,Qi=new WeakMap,oi=new WeakMap,ii=new WeakMap,Co=new WeakMap,$i=new WeakMap,ft=new WeakSet,us=function(t){We(this,ft,Mf).call(this);let n=D(this,Ze).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Un)),n},Nf=function(){We(this,ft,Lf).call(this);const t=mi(this.options.staleTime,D(this,Ze));if(jo||D(this,En).isStale||!lc(t))return;const r=$h(D(this,En).dataUpdatedAt,t)+1;Ce(this,oi,setTimeout(()=>{D(this,En).isStale||this.updateResult()},r))},Df=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(D(this,Ze)):this.options.refetchInterval)??!1},Pf=function(t){We(this,ft,Ff).call(this),Ce(this,Co,t),!(jo||sr(this.options.enabled,D(this,Ze))===!1||!lc(D(this,Co))||D(this,Co)===0)&&Ce(this,ii,setInterval(()=>{(this.options.refetchIntervalInBackground||pc.isFocused())&&We(this,ft,us).call(this)},D(this,Co)))},kf=function(){We(this,ft,Nf).call(this),We(this,ft,Pf).call(this,We(this,ft,Df).call(this))},Lf=function(){D(this,oi)&&(clearTimeout(D(this,oi)),Ce(this,oi,void 0))},Ff=function(){D(this,ii)&&(clearInterval(D(this,ii)),Ce(this,ii,void 0))},Mf=function(){const t=D(this,On).getQueryCache().build(D(this,On),this.options);if(t===D(this,Ze))return;const n=D(this,Ze);Ce(this,Ze,t),Ce(this,is,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},_y=function(t){zt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(D(this,En))}),D(this,On).getQueryCache().notify({query:D(this,Ze),type:"observerResultsUpdated"})})},Iy);function wI(e,t){return sr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function fg(e,t){return wI(e,t)||e.state.data!==void 0&&mc(e,t,t.refetchOnMount)}function mc(e,t,n){if(sr(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&bc(e,t)}return!1}function pg(e,t,n,r){return(e!==t||sr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&bc(e,n)}function bc(e,t){return sr(t.enabled,e)!==!1&&e.isStaleByTime(mi(t.staleTime,e))}function II(e,t){return!Ks(e.getCurrentResult(),t)}var SI=(Sy=class extends gi{constructor(t,n){super();De(this,Yr);De(this,wo);De(this,Io);De(this,Rn);De(this,Zr);Ce(this,wo,t),this.setOptions(n),this.bindMethods(),We(this,Yr,du).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=D(this,wo).defaultMutationOptions(t),Ks(this.options,n)||D(this,wo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:D(this,Rn),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Vo(n.mutationKey)!==Vo(this.options.mutationKey)?this.reset():((r=D(this,Rn))==null?void 0:r.state.status)==="pending"&&D(this,Rn).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=D(this,Rn))==null||t.removeObserver(this)}onMutationUpdate(t){We(this,Yr,du).call(this),We(this,Yr,Bf).call(this,t)}getCurrentResult(){return D(this,Io)}reset(){var t;(t=D(this,Rn))==null||t.removeObserver(this),Ce(this,Rn,void 0),We(this,Yr,du).call(this),We(this,Yr,Bf).call(this)}mutate(t,n){var r;return Ce(this,Zr,n),(r=D(this,Rn))==null||r.removeObserver(this),Ce(this,Rn,D(this,wo).getMutationCache().build(D(this,wo),this.options)),D(this,Rn).addObserver(this),D(this,Rn).execute(t)}},wo=new WeakMap,Io=new WeakMap,Rn=new WeakMap,Zr=new WeakMap,Yr=new WeakSet,du=function(){var n;const t=((n=D(this,Rn))==null?void 0:n.state)??ug();Ce(this,Io,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Bf=function(t){zt.batch(()=>{var n,r,o,i,a,l,s,u;if(D(this,Zr)&&this.hasListeners()){const c=D(this,Io).variables,f=D(this,Io).context;(t==null?void 0:t.type)==="success"?((r=(n=D(this,Zr)).onSuccess)==null||r.call(n,t.data,c,f),(i=(o=D(this,Zr)).onSettled)==null||i.call(o,t.data,null,c,f)):(t==null?void 0:t.type)==="error"&&((l=(a=D(this,Zr)).onError)==null||l.call(a,t.error,c,f),(u=(s=D(this,Zr)).onSettled)==null||u.call(s,void 0,t.error,c,f))}this.listeners.forEach(c=>{c(D(this,Io))})})},Sy),hg=P.createContext(void 0),rl=e=>{const t=P.useContext(hg);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},TI=({client:e,children:t})=>(P.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),I.jsx(hg.Provider,{value:e,children:t})),gg=P.createContext(!1),AI=()=>P.useContext(gg);gg.Provider;function _I(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var OI=P.createContext(_I()),RI=()=>P.useContext(OI);function mg(e,t){return typeof e=="function"?e(...t):!!e}function vc(){}var NI=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},DI=e=>{P.useEffect(()=>{e.clearReset()},[e])},PI=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||mg(n,[e.error,r])),kI=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)))},LI=(e,t)=>e.isLoading&&e.isFetching&&!t,FI=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,bg=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function MI(e,t,n){var f,b,y,v,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=rl(),o=AI(),i=RI(),a=r.defaultQueryOptions(e);(b=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||b.call(f,a),process.env.NODE_ENV!=="production"&&(a.queryFn||console.error(`[${a.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`)),a._optimisticResults=o?"isRestoring":"optimistic",kI(a),NI(a,i),DI(i);const l=!r.getQueryCache().get(a.queryHash),[s]=P.useState(()=>new t(r,a)),u=s.getOptimisticResult(a),c=!o&&e.subscribed!==!1;if(P.useSyncExternalStore(P.useCallback(p=>{const h=c?s.subscribe(zt.batchCalls(p)):vc;return s.updateResult(),h},[s,c]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),P.useEffect(()=>{s.setOptions(a,{listeners:!1})},[a,s]),FI(a,u))throw bg(a,s,i);if(PI({result:u,errorResetBoundary:i,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((v=(y=r.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||v.call(y,a,u),a.experimental_prefetchInRender&&!jo&&LI(u,o)){const p=l?bg(a,s,i):(d=r.getQueryCache().get(a.queryHash))==null?void 0:d.promise;p==null||p.catch(vc).finally(()=>{s.updateResult()})}return a.notifyOnChangeProps?u:s.trackResult(u)}function vg(e,t){return MI(e,CI)}function BI(e,t){const n=rl(),[r]=P.useState(()=>new SI(n,e));P.useEffect(()=>{r.setOptions(e)},[r,e]);const o=P.useSyncExternalStore(P.useCallback(a=>r.subscribe(zt.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=P.useCallback((a,l)=>{r.mutate(a,l).catch(vc)},[r]);if(o.error&&mg(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}const jI=({children:e})=>{const t=new xI;return I.jsx(TI,{client:t,children:e})},VI=e=>I.jsx(w.HiverProvider,{custom:!0,children:I.jsx(S.Suspense,{fallback:I.jsx(I.Fragment,{}),children:I.jsx(jI,{children:I.jsx(aI,{...e})})})}),GI=e=>I.jsx(s1,{store:rI,children:I.jsx(VI,{...e})});/**
|
|
67
|
+
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Mo(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Ju.assertOptions(r,{silentJSONParsing:eo.transitional(eo.boolean),forcedJSONParsing:eo.transitional(eo.boolean),clarifyTimeoutError:eo.transitional(eo.boolean)},!1),o!=null&&(Y.isFunction(o)?n.paramsSerializer={serialize:o}:Ju.assertOptions(o,{encode:eo.function,serialize:eo.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&Y.merge(i.common,i[n.method]);i&&Y.forEach(["delete","get","head","post","put","patch","common"],v=>{delete i[v]}),n.headers=or.concat(a,i);const l=[];let s=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(n)===!1||(s=s&&d.synchronous,l.unshift(d.fulfilled,d.rejected))});const u=[];this.interceptors.response.forEach(function(d){u.push(d.fulfilled,d.rejected)});let c,f=0,b;if(!s){const v=[Ih.bind(this),void 0];for(v.unshift.apply(v,l),v.push.apply(v,u),b=v.length,c=Promise.resolve(n);f<b;)c=c.then(v[f++],v[f++]);return c}b=l.length;let y=n;for(f=0;f<b;){const v=l[f++],d=l[f++];try{y=v(y)}catch(p){d.call(this,p);break}}try{c=Ih.call(this,y)}catch(v){return Promise.reject(v)}for(f=0,b=u.length;f<b;)c=c.then(u[f++],u[f++]);return c}getUri(t){t=Mo(this.defaults,t);const n=gh(t.baseURL,t.url);return ah(n,t.params,t.paramsSerializer)}};Y.forEach(["delete","get","head","options"],function(t){Vs.prototype[t]=function(n,r){return this.request(Mo(r||{},{method:t,url:n,data:(r||{}).data}))}}),Y.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,l){return this.request(Mo(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}Vs.prototype[t]=n(),Vs.prototype[t+"Form"]=n(!0)});var Gs=Vs;class Qu{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(l=>{r.subscribe(l),i=l}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,l){r.reason||(r.reason=new li(i,a,l),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 Qu(function(o){t=o}),cancel:t}}}var IC=Qu;function SC(e){return function(n){return e.apply(null,n)}}function TC(e){return Y.isObject(e)&&e.isAxiosError===!0}const $u={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($u).forEach(([e,t])=>{$u[t]=e});var AC=$u;function Ah(e){const t=new Gs(e),n=zp(Gs.prototype.request,t);return Y.extend(n,Gs.prototype,t,{allOwnKeys:!0}),Y.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Ah(Mo(e,o))},n}const Ft=Ah(Hu);Ft.Axios=Gs,Ft.CanceledError=li,Ft.CancelToken=IC,Ft.isCancel=dh,Ft.VERSION=Sh,Ft.toFormData=ks,Ft.AxiosError=je,Ft.Cancel=Ft.CanceledError,Ft.all=function(t){return Promise.all(t)},Ft.spread=SC,Ft.isAxiosError=TC,Ft.mergeConfig=Mo,Ft.AxiosHeaders=or,Ft.formToJSON=e=>uh(Y.isHTMLForm(e)?new FormData(e):e),Ft.getAdapter=wh.getAdapter,Ft.HttpStatusCode=AC,Ft.default=Ft;var _h=Ft,tt={},to={};(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={}))})(to);var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.getProdHqConfig=Sn.getProdApiConfig=Sn.getSitHqConfig=Sn.getSitApiConfig=Sn.getDevHqConfig=Sn.getDevApiConfig=void 0;var ui={heimdallTokenFetch:"/v1/token/get",heimdallLogin:"/v1/login/code",heimdallLogout:"/v1/logout",v2Login:"/api/auth/login/code",hotLogin:"/api/auth/login/code"},_C=function(){return{v2Url:"https://v2dev.hiver.space",heimdallUrl:"https://dev.hiver.space/api/heimdall-api",hotUrl:"http://local.hiverhq.co.in:3000",apiEndpoints:ui}};Sn.getDevApiConfig=_C;var OC=function(){return{v2Url:"https://v2dev.hiver.space",heimdallUrl:"https://dev.hiver.space/api/heimdall-api2",hotUrl:"http://local.hiverhq.co.in:3000",apiEndpoints:ui}};Sn.getDevHqConfig=OC;var RC=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:ui}};Sn.getSitApiConfig=RC;var NC=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:ui}};Sn.getSitHqConfig=NC;var DC=function(){return{v2Url:"https://v2.hiverhq.com",heimdallUrl:"https://heimdall.hiverapi.com",hotUrl:"https://app.hiverhq.com",apiEndpoints:ui}};Sn.getProdApiConfig=DC;var PC=function(){return{v2Url:"https://v2.hiverhq.com",heimdallUrl:"https://heimdall2.hiverhq.com",hotUrl:"https://app.hiverhq.com",apiEndpoints:ui}};Sn.getProdHqConfig=PC;var vr={},yr={};Object.defineProperty(yr,"__esModule",{value:!0}),yr.removeValue=yr.getValue=yr.setValue=void 0;var Ku={};function kC(e,t){Ku[e]=t}yr.setValue=kC;function LC(e){return Ku[e]}yr.getValue=LC;function FC(e){delete Ku[e]}yr.removeValue=FC,Object.defineProperty(vr,"__esModule",{value:!0}),vr.removeItemFromStorage=vr.setItemInStorage=vr.getItemFromStorage=void 0;var ci=to,di=yr,MC=function(e,t){switch(t===void 0&&(t=(0,di.getValue)("PLATFORM")),t){case ci.PLATFORM.WEB:return sessionStorage.getItem(e);case ci.PLATFORM.MOBILE:return(0,di.getValue)(e);default:throw Error("Invalid PLATFORM ".concat(t))}};vr.getItemFromStorage=MC;var BC=function(e,t,n){switch(n===void 0&&(n=(0,di.getValue)("PLATFORM")),n){case ci.PLATFORM.WEB:return sessionStorage.setItem(e,t);case ci.PLATFORM.MOBILE:return(0,di.setValue)(e,t);default:throw Error("Invalid PLATFORM ".concat(n))}};vr.setItemInStorage=BC;var jC=function(e,t){switch(t===void 0&&(t=(0,di.getValue)("PLATFORM")),t){case ci.PLATFORM.WEB:sessionStorage.removeItem(e);break;case ci.PLATFORM.MOBILE:(0,di.removeValue)(e);break;default:throw Error("Invalid PLATFORM ".concat(t))}};vr.removeItemFromStorage=jC;var VC=Be&&Be.__awaiter||function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function l(c){try{u(r.next(c))}catch(f){a(f)}}function s(c){try{u(r.throw(c))}catch(f){a(f)}}function u(c){c.done?i(c.value):o(c.value).then(l,s)}u((r=r.apply(e,t||[])).next())})},GC=Be&&Be.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(u){return function(c){return s([u,c])}}function s(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(tt,"__esModule",{value:!0}),tt.expireToken=tt.invalidateToken=tt.validateToken=tt.validateAccount=tt.getConfig=tt.introduceDelay=tt.isTokenInExpiryWindow=tt.getStoredAuthData=tt.setUserDetails=tt.getRefreshInterval=tt.setTokenAndExpiry=tt.getRandomDelay=tt.hasValidToken=void 0;var jr=to,fi=Sn,Gn=vr,ec=function(){var e=new Date,t=new Date(e.getTime()+e.getTimezoneOffset()*6e4);return t},tc=function(e){var t=parseInt((0,Gn.getItemFromStorage)("hiverAuthUserId")||"0"),n=parseInt((0,Gn.getItemFromStorage)("hiverAuthUserGroupId")||"0"),r=e.userId,o=e.usergroupId;return t===r&&o===n};tt.validateAccount=tc;var WC=function(e){var t=tc(e);return!Oh()&&t};tt.validateToken=WC;var HC=function(e){return e.apiRetry?e.apiRetry>0:!1};tt.invalidateToken=HC;var zC=function(){try{sessionStorage.removeItem("hiverAuthTokenExpiry")}catch{console.log("Heimdall: Unable to Remove token.")}};tt.expireToken=zC;var XC=function(e){var t=(0,Gn.getItemFromStorage)("hiverAuthTokenExpiry")||"",n=new Date(t),r=ec(),o=tc(e);return console.log("Heimdall: checking if there is a valid token",r<n&&o),r<n&&o};tt.hasValidToken=XC;var ZC=function(){return Math.floor(Math.random()*6e4)+6e4};tt.getRandomDelay=ZC;var YC=function(e,t){if(!e||!t)throw new Error("User Id or user group Id not found in the response");(0,Gn.setItemInStorage)("hiverAuthUserId",e),(0,Gn.setItemInStorage)("hiverAuthUserGroupId",t)};tt.setUserDetails=YC;var UC=function(e,t){if(!e)throw new Error("Token not found in the response");(0,Gn.setItemInStorage)("hiverAuthToken",e),(0,Gn.setItemInStorage)("hiverAuthTokenExpiry",t)};tt.setTokenAndExpiry=UC;var qC=function(){var e=(0,Gn.getItemFromStorage)("hiverAuthTokenExpiry"),t=(0,Gn.getItemFromStorage)("hiverAuthToken"),n=(0,Gn.getItemFromStorage)("hiverAuthUserId"),r=(0,Gn.getItemFromStorage)("hiverAuthUserGroupId");return{token:t,expiryTime:e,userId:n,usergroupId:r}};tt.getStoredAuthData=qC;var Oh=function(){var e=(0,Gn.getItemFromStorage)("hiverAuthTokenExpiry")||"";if(!e)return!0;var t=ec(),n=new Date(e),r=4*60*1e3,o=n.getTime()-t.getTime()<r;return console.log({currentTime:t,expiry:n,isInExpiryWindow:o}),o};tt.isTokenInExpiryWindow=Oh;var JC=function(e){return VC(void 0,void 0,void 0,function(){return GC(this,function(t){switch(t.label){case 0:return[4,new Promise(function(n){return setTimeout(n,e)})];case 1:return t.sent(),[2]}})})};tt.introduceDelay=JC;var QC=function(e,t,n){switch(n===void 0&&(n=!0),t){case jr.TIERS.SIT:case jr.TIERS.QA:return n?(0,fi.getSitApiConfig)(e):(0,fi.getSitHqConfig)(e);case jr.TIERS.PRODUCTION:case jr.TIERS.PROD:return n?(0,fi.getProdApiConfig)():(0,fi.getProdHqConfig)();case jr.TIERS.DEV:default:return n?(0,fi.getDevApiConfig)():(0,fi.getDevHqConfig)()}};tt.getConfig=QC;var $C=function(){try{var e=(0,Gn.getItemFromStorage)("hiverAuthTokenExpiry");if(!e)return jr.RETRY_DELAY_IN_CASE_OF_CORRUPTED_EXPIRY;var t=new Date(e),n=ec();return t.getTime()-n.getTime()>jr.TWO_MINUTES_IN_MS?t.getTime()-jr.TWO_MINUTES_IN_MS:t.getTime()-n.getTime()}catch(r){return console.error("Heimdall: Error in getRefreshInterval",r),jr.REFETCH_CHECK_DELAY}};tt.getRefreshInterval=$C;var ma={},ir={},Rh;function Nh(){if(Rh)return ir;Rh=1;var e=Be&&Be.__awaiter||function(v,d,p,h){function g(m){return m instanceof p?m:new p(function(E){E(m)})}return new(p||(p=Promise))(function(m,E){function x(C){try{T(h.next(C))}catch(O){E(O)}}function A(C){try{T(h.throw(C))}catch(O){E(O)}}function T(C){C.done?m(C.value):g(C.value).then(x,A)}T((h=h.apply(v,d||[])).next())})},t=Be&&Be.__generator||function(v,d){var p={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},h,g,m,E;return E={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function x(T){return function(C){return A([T,C])}}function A(T){if(h)throw new TypeError("Generator is already executing.");for(;E&&(E=0,T[0]&&(p=0)),p;)try{if(h=1,g&&(m=T[0]&2?g.return:T[0]?g.throw||((m=g.return)&&m.call(g),0):g.next)&&!(m=m.call(g,T[1])).done)return m;switch(g=0,m&&(T=[T[0]&2,m.value]),T[0]){case 0:case 1:m=T;break;case 4:return p.label++,{value:T[1],done:!1};case 5:p.label++,g=T[1],T=[0];continue;case 7:T=p.ops.pop(),p.trys.pop();continue;default:if(m=p.trys,!(m=m.length>0&&m[m.length-1])&&(T[0]===6||T[0]===2)){p=0;continue}if(T[0]===3&&(!m||T[1]>m[0]&&T[1]<m[3])){p.label=T[1];break}if(T[0]===6&&p.label<m[1]){p.label=m[1],m=T;break}if(m&&p.label<m[2]){p.label=m[2],p.ops.push(T);break}m[2]&&p.ops.pop(),p.trys.pop();continue}T=d.call(v,p)}catch(C){T=[6,C],g=0}finally{h=m=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}};Object.defineProperty(ir,"__esModule",{value:!0}),ir.logoutFromHeimdall=ir.getTenantLoginCode=ir.getLoginToken=ir.getAccessToken=void 0;var n=to,r=Fh(),o=tt,i=function(v,d,p,h){var g=(0,o.getStoredAuthData)(),m=p===n.TENANT_PLATFORM.HIVERWEB?n.TENANT_PLATFORM.HIVERWEB:n.TENANT_PLATFORM.GMAIL;return{root_url:v.heimdallUrl,url:v.apiEndpoints.heimdallTokenFetch,method:n.GET_METHOD,headers:{"x-hiver-tenant":m},data:{user_id:d.userId,usergroup_id:d.usergroupId,access_token:(g==null?void 0:g.token)||"",source:h}}},a=function(v,d,p,h,g){var m=p===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:v},headers:{"x-hiver-tenant":m,"x-hiver-userid":h,"x-hiver-usergroupid":g}}},l=function(v,d){var p=d===n.TENANT_PLATFORM.HIVERWEB?n.TENANT_PLATFORM.HIVERWEB:n.TENANT_PLATFORM.GMAIL;return{root_url:v.heimdallUrl,url:v.apiEndpoints.heimdallLogout,method:n.GET_METHOD,headers:{"x-hiver-tenant":p}}},s=function(v){return parseInt(v,10)},u=function(v,d,p,h){return{root_url:p===n.TENANT_PLATFORM.HIVERWEB?v.hotUrl:v.v2Url,url:p===n.TENANT_PLATFORM.HIVERWEB?v.apiEndpoints.hotLogin:v.apiEndpoints.v2Login,method:n.GET_METHOD,data:{usersession:s(d.userId),app:h||n.APP_UI.DEFAULT}}},c=function(v,d,p,h,g){return e(void 0,void 0,void 0,function(){var m,E,x,A,T,C,O;return t(this,function(M){switch(M.label){case 0:console.log("GETTOKEN tenantPlatform -> ",h),M.label=1;case 1:return M.trys.push([1,5,,6]),!(0,o.validateToken)(p)||(0,o.invalidateToken)(p)?(console.log("HEIMDALL: No valid token, fetching token"),m=i(d,p,h,g),[4,(0,r.performAxiosCall)(m)]):[3,3];case 2:return E=M.sent(),[2,{atToken:(A=E==null?void 0:E.data.at)===null||A===void 0?void 0:A.token,expiryTime:(T=E==null?void 0:E.data.at)===null||T===void 0?void 0:T.expires_at,userId:(C=E==null?void 0:E.data)===null||C===void 0?void 0:C.user_id,userGroupId:(O=E==null?void 0:E.data)===null||O===void 0?void 0:O.usergroup_id}];case 3:return console.log("Heimdall: Valid token already exists"),[2,{}];case 4:return[3,6];case 5:throw x=M.sent(),x;case 6:return[2]}})})};ir.getAccessToken=c;var f=function(v,d,p,h,g,m){return e(void 0,void 0,void 0,function(){var E,x,A,T,C,O,M;return t(this,function(B){switch(B.label){case 0:E=a(v,p,h,g,m),B.label=1;case 1:return B.trys.push([1,3,,4]),[4,(0,r.performAxiosCall)(E)];case 2:return x=B.sent(),[2,{userId:(T=x==null?void 0:x.data)===null||T===void 0?void 0:T.user_id,userGroupId:(C=x==null?void 0:x.data)===null||C===void 0?void 0:C.usergroup_id,atToken:(O=x==null?void 0:x.data.at)===null||O===void 0?void 0:O.token,expiryTime:(M=x==null?void 0:x.data.at)===null||M===void 0?void 0:M.expires_at}];case 3:throw A=B.sent(),A;case 4:return[2]}})})};ir.getLoginToken=f;var b=function(v,d,p,h,g){return e(void 0,void 0,void 0,function(){var m,E,x;return t(this,function(A){switch(A.label){case 0:return A.trys.push([0,2,,3]),console.log("ERROR debug: in getTenantLoginCode:",g),m=u(d,p,h,g),[4,(0,r.performAxiosCall)(m)];case 1:return E=A.sent(),[2,E==null?void 0:E.data.code];case 2:throw x=A.sent(),x;case 3:return[2]}})})};ir.getTenantLoginCode=b;var y=function(v,d,p){return p===void 0&&(p=0),e(void 0,void 0,void 0,function(){var h,g,m;return t(this,function(E){switch(E.label){case 0:return E.trys.push([0,2,,5]),h=l(v,d),[4,(0,r.performAxiosCall)(h)];case 1:return g=E.sent(),[2,g==null?void 0:g.status];case 2:return m=E.sent(),p<2?[4,y(v,d,p+1)]:[3,4];case 3:E.sent(),E.label=4;case 4:throw m;case 5:return[2]}})})};return ir.logoutFromHeimdall=y,ir}var Ws={},KC=Be&&Be.__awaiter||function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function l(c){try{u(r.next(c))}catch(f){a(f)}}function s(c){try{u(r.throw(c))}catch(f){a(f)}}function u(c){c.done?i(c.value):o(c.value).then(l,s)}u((r=r.apply(e,t||[])).next())})},ew=Be&&Be.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(u){return function(c){return s([u,c])}}function s(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.subscribeToOnlineEvent=void 0;var Dh=to,tw=yr,nw=function(e,t){switch(t===void 0&&(t=(0,tw.getValue)("PLATFORM")),console.log("Online status detected. Fetching token..."),t){case Dh.PLATFORM.WEB:return window.addEventListener("online",function(){return KC(void 0,void 0,void 0,function(){return ew(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 Dh.PLATFORM.MOBILE:e();return;default:throw Error("Invalid PLATFORM ".concat(t))}};Ws.subscribeToOnlineEvent=nw;var Ph;function kh(){if(Ph)return ma;Ph=1;var e=Be&&Be.__awaiter||function(v,d,p,h){function g(m){return m instanceof p?m:new p(function(E){E(m)})}return new(p||(p=Promise))(function(m,E){function x(C){try{T(h.next(C))}catch(O){E(O)}}function A(C){try{T(h.throw(C))}catch(O){E(O)}}function T(C){C.done?m(C.value):g(C.value).then(x,A)}T((h=h.apply(v,d||[])).next())})},t=Be&&Be.__generator||function(v,d){var p={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},h,g,m,E;return E={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function x(T){return function(C){return A([T,C])}}function A(T){if(h)throw new TypeError("Generator is already executing.");for(;E&&(E=0,T[0]&&(p=0)),p;)try{if(h=1,g&&(m=T[0]&2?g.return:T[0]?g.throw||((m=g.return)&&m.call(g),0):g.next)&&!(m=m.call(g,T[1])).done)return m;switch(g=0,m&&(T=[T[0]&2,m.value]),T[0]){case 0:case 1:m=T;break;case 4:return p.label++,{value:T[1],done:!1};case 5:p.label++,g=T[1],T=[0];continue;case 7:T=p.ops.pop(),p.trys.pop();continue;default:if(m=p.trys,!(m=m.length>0&&m[m.length-1])&&(T[0]===6||T[0]===2)){p=0;continue}if(T[0]===3&&(!m||T[1]>m[0]&&T[1]<m[3])){p.label=T[1];break}if(T[0]===6&&p.label<m[1]){p.label=m[1],m=T;break}if(m&&p.label<m[2]){p.label=m[2],p.ops.push(T);break}m[2]&&p.ops.pop(),p.trys.pop();continue}T=d.call(v,p)}catch(C){T=[6,C],g=0}finally{h=m=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}};Object.defineProperty(ma,"__esModule",{value:!0}),ma.fetchAccessToken=void 0;var n=Nh(),r=to,o=tt,i=Ws,a,l,s,u=function(v,d,p,h,g,m){return m===void 0&&(m=r.APP_UI.DEFAULT),e(void 0,void 0,void 0,function(){var E,x,A,T,C,O,M,B,U;return t(this,function(G){switch(G.label){case 0:E=2,G.label=1;case 1:return G.trys.push([1,7,,12]),console.log("ERROR debug: in login:",m,h),x=void 0,g?[4,g()]:[3,3];case 2:return x=G.sent(),[3,5];case 3:return[4,(0,n.getTenantLoginCode)(r.CONFIG_HIVER,v,d,h,m)];case 4:x=G.sent(),G.label=5;case 5:return[4,(0,n.getLoginToken)(x,r.CONFIG_HIVER,v,h,d.userId,d.usergroupId)];case 6:return A=G.sent(),T=A.userId,C=A.userGroupId,O=A.atToken,M=A.expiryTime,(0,o.setTokenAndExpiry)(O,M),(0,o.setUserDetails)(T,C),[3,12];case 7:B=G.sent(),console.log("ERROR debug: in error login:",B,m),U=p,G.label=8;case 8:return U<E?[4,u(v,d,U+1,h,g,m)]:[3,11];case 9:G.sent(),G.label=10;case 10:return U++,[3,8];case 11:throw B;case 12:return[2]}})})},c=function(v,d,p,h,g){return e(void 0,void 0,void 0,function(){var m,E,x,A;return t(this,function(T){switch(T.label){case 0:return d<r.MAX_CONFLICT_RETRY_DELAY?[4,new Promise(function(C){return setTimeout(C,v)})]:[3,3];case 1:return T.sent(),d+=v,v*2<=r.MAX_BACKOFF_LIMIT?v*=2:v=r.MAX_BACKOFF_LIMIT,console.log("Heimdall: Fetch token post doubling conflict retry delay",v),m=p.retryDelay,E=p.configs,x=p.apiParams,A=p.appUI,[4,f(m,v,d,E,x,h,g,A)];case 2:T.sent(),T.label=3;case 3:return[2]}})})},f=function(v,d,p,h,g,m,E,x,A){return x===void 0&&(x="default"),e(void 0,void 0,void 0,function(){var T,C,O,M,B,U,G,X,q,$,ue,se,ve,W;return t(this,function(te){switch(te.label){case 0:return te.trys.push([0,2,,12]),console.log("Heimdall: Interval Set on fetch token in fetchAndSaveToken:",s),[4,(0,n.getAccessToken)(r.CONFIG_HIVER,h,g,m,x)];case 1:return T=te.sent(),C=T.atToken,O=T.expiryTime,M=T.userId,B=T.userGroupId,C&&O&&(0,o.setTokenAndExpiry)(C,O),M&&B&&(0,o.setUserDetails)(M,B),v=r.INITIAL_RETRY_DELAY,d=r.INITIAL_RETRY_DELAY,p=0,[3,12];case 2:return U=te.sent(),console.log("ERROR: Heimdall fetch token",U),((q=U.response)===null||q===void 0?void 0:q.status)===401||(($=U.request)===null||$===void 0?void 0:$.status)===401?(G=1,[4,u(h,g,G,m,E,A)]):[3,4];case 3:return te.sent(),[3,11];case 4:return((ue=U.response)===null||ue===void 0?void 0:ue.status)===409||((se=U.request)===null||se===void 0?void 0:se.status)===409?(console.log("Heimdall: Fetching token post 409 in fetch And Save Token"),X={retryDelay:v,configs:h,apiParams:g,appUI:A},[4,c(d,p,X,m,E)]):[3,6];case 5:if(te.sent(),p>=r.MAX_CONFLICT_RETRY_DELAY)throw U;return[3,11];case 6:if(!(((ve=U.response)===null||ve===void 0?void 0:ve.status)===422||((W=U.request)===null||W===void 0?void 0:W.status)===422))return[3,7];throw console.log("ERROR: Throwing error",U.response.status),U;case 7:return v<=r.MAX_RETRY_DELAY?[4,new Promise(function(re){return setTimeout(re,v)})]:[3,10];case 8:return te.sent(),v*=2,console.log("Heimdall: Fetch token post doubling retry delay",v),[4,f(v,d,p,h,g,m,E,A)];case 9:return te.sent(),[3,11];case 10:throw U;case 11:return[3,12];case 12:return[2]}})})},b=function(v,d,p,h,g,m,E,x){return p===void 0&&(p=r.INITIAL_RETRY_DELAY),h===void 0&&(h=r.INITIAL_RETRY_DELAY),e(void 0,void 0,void 0,function(){var A,T,C;return t(this,function(O){switch(O.label){case 0:return O.trys.push([0,4,,5]),A=(0,o.isTokenInExpiryWindow)(),A?(T=(0,o.getRandomDelay)(),[4,(0,o.introduceDelay)(T)]):[3,3];case 1:return O.sent(),console.log("Heimdall: Fetching token - in expiry window"),[4,f(p,h,g,v,d,m,E,x)];case 2:O.sent(),O.label=3;case 3:return[3,5];case 4:throw C=O.sent(),C;case 5:return[2]}})})},y=function(v,d,p,h,g,m,E){return e(void 0,void 0,void 0,function(){var x,A,T,C,O,M;return t(this,function(B){switch(B.label){case 0:a=v,l=d,x=r.INITIAL_RETRY_DELAY,A=r.INITIAL_RETRY_DELAY,T=0,C=(0,o.getConfig)(a,l),console.log("Instance: Fetch Call"),B.label=1;case 1:return B.trys.push([1,3,,4]),[4,f(x,A,T,C,p,h,g,m,E)];case 2:return B.sent(),console.log("Heimdall: Interval Set on fetch token when fetch token is called:",s),clearInterval(s),s=setInterval(function(){return b(C,p,r.INITIAL_RETRY_DELAY,r.INITIAL_RETRY_DELAY,0,h,g,E)},r.REFETCH_CHECK_DELAY),O=function(){return e(void 0,void 0,void 0,function(){return t(this,function(U){switch(U.label){case 0:return[4,b(C,p,r.INITIAL_RETRY_DELAY,r.INITIAL_RETRY_DELAY,0,h,g,E)];case 1:return U.sent(),[2]}})})},console.log("Heimdall: Interval Set on fetch token:",s),(0,i.subscribeToOnlineEvent)(O),[3,4];case 3:return M=B.sent(),console.log("ERROR: Fetching token failed",M),[3,4];case 4:return[2]}})})};return ma.fetchAccessToken=y,ma}var Lh;function Fh(){if(Lh)return Lo;Lh=1;var e=Be&&Be.__assign||function(){return e=Object.assign||function(d){for(var p,h=1,g=arguments.length;h<g;h++){p=arguments[h];for(var m in p)Object.prototype.hasOwnProperty.call(p,m)&&(d[m]=p[m])}return d},e.apply(this,arguments)},t=Be&&Be.__awaiter||function(d,p,h,g){function m(E){return E instanceof h?E:new h(function(x){x(E)})}return new(h||(h=Promise))(function(E,x){function A(O){try{C(g.next(O))}catch(M){x(M)}}function T(O){try{C(g.throw(O))}catch(M){x(M)}}function C(O){O.done?E(O.value):m(O.value).then(A,T)}C((g=g.apply(d,p||[])).next())})},n=Be&&Be.__generator||function(d,p){var h={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},g,m,E,x;return x={next:A(0),throw:A(1),return:A(2)},typeof Symbol=="function"&&(x[Symbol.iterator]=function(){return this}),x;function A(C){return function(O){return T([C,O])}}function T(C){if(g)throw new TypeError("Generator is already executing.");for(;x&&(x=0,C[0]&&(h=0)),h;)try{if(g=1,m&&(E=C[0]&2?m.return:C[0]?m.throw||((E=m.return)&&E.call(m),0):m.next)&&!(E=E.call(m,C[1])).done)return E;switch(m=0,E&&(C=[C[0]&2,E.value]),C[0]){case 0:case 1:E=C;break;case 4:return h.label++,{value:C[1],done:!1};case 5:h.label++,m=C[1],C=[0];continue;case 7:C=h.ops.pop(),h.trys.pop();continue;default:if(E=h.trys,!(E=E.length>0&&E[E.length-1])&&(C[0]===6||C[0]===2)){h=0;continue}if(C[0]===3&&(!E||C[1]>E[0]&&C[1]<E[3])){h.label=C[1];break}if(C[0]===6&&h.label<E[1]){h.label=E[1],E=C;break}if(E&&h.label<E[2]){h.label=E[2],h.ops.push(C);break}E[2]&&h.ops.pop(),h.trys.pop();continue}C=p.call(d,h)}catch(O){C=[6,O],m=0}finally{g=E=0}if(C[0]&5)throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}};Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.hiverAxiosCall=Lo.performAxiosCall=void 0;var r=_h,o=tt,i=kh(),a=vr,l=to,s,u=2,c=function(d,p){var h=p.fetchCsrfToken();d.formData?d.formData.append("_csrf_token",h):(d.data=d.data||{},d.data._csrf_token=h)},f=function(d,p){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 g=e(e({method:d.method,url:"".concat(d.root_url).concat(d.url),headers:d.headers},h),{withCredentials:p,responseType:(d==null?void 0:d.responseType)||""});return g};function b(d,p){return p===void 0&&(p=!0),t(this,void 0,void 0,function(){var h;return n(this,function(g){return h=f(d,p),[2,(0,r.default)(h).then(function(m){return m}).catch(function(m){throw m})]})})}Lo.performAxiosCall=b;function y(d,p,h){return t(this,void 0,void 0,function(){var g,m,E;return n(this,function(x){switch(x.label){case 0:return x.trys.push([0,6,,8]),d.authTokenFetchingInProgress?[3,2]:(d.authTokenFetchingInProgress=!0,g=d.appEnv,m=d.tier,[4,(0,i.fetchAccessToken)(g,m,p,d.tenantPlatform,d.getTokenForLogin,h)]);case 1:return x.sent(),d.authTokenFetchingInProgress=!1,[3,5];case 2:return[4,new Promise(function(A){return setTimeout(A,100)})];case 3:return x.sent(),console.log("Heimdall: Retrying fetchAccessToken after 100ms..."),[4,y(d,p,h)];case 4:x.sent(),x.label=5;case 5:return[3,8];case 6:return E=x.sent(),console.log("Error while fetching Auth Token :",E),d.authTokenFetchingInProgress=!1,[4,y(d,p,h)];case 7:return x.sent(),[3,8];case 8:return[2]}})})}function v(d,p,h,g,m){var E,x;return m===void 0&&(m=0),t(this,void 0,void 0,function(){var A,T,C,O,M,B,U;return n(this,function(G){switch(G.label){case 0:if(G.trys.push([0,4,,5]),!(h.getToken&&!(0,o.hasValidToken)(p)))return[3,2];if(A=d.appEnv,T=d.tier,!A||!T)throw Error("appEnv or tier missing : ".concat(A,"/").concat(T));return"userId"in p&&"usergroupId"in p?(C={userId:p.userId,usergroupId:p.usergroupId},[4,y(d,C,g)]):[3,2];case 1:G.sent(),G.label=2;case 2:return d.csrfToken&&c(p,h),O=d.tenantPlatform===l.TENANT_PLATFORM.HIVERWEB?l.TENANT_PLATFORM.HIVERWEB:l.TENANT_PLATFORM.GMAIL,p.headers=e(e({},p.headers),{"x-hiver-tenant":O,"x-hiver-userid":(0,a.getItemFromStorage)("hiverAuthUserId")||"0","x-hiver-usergroupid":(0,a.getItemFromStorage)("hiverAuthUserGroupId")||"0"}),h.getToken&&(s=(0,a.getItemFromStorage)("hiverAuthToken")||"",p.headers=e(e({},p.headers),{Authorization:"Bearer ".concat(s)})),console.log("Performing axios call for:",p),[4,b(p,d.withCredentials)];case 3:return M=G.sent(),p.onSuccess&&p.onSuccess(M),[2,M];case 4:if(B=G.sent(),U=((E=B.response)===null||E===void 0?void 0:E.status)===403||((x=B.request)===null||x===void 0?void 0:x.status)===403,m<u&&U)return(0,o.expireToken)(),[2,v(d,p,h,g,m+1)];if(m>=u&&U||!U)throw p.onFail&&p.onFail(B),console.log("ERROR: Reached make Axios",B),B;return[3,5];case 5:return[2]}})})}return Lo.hiverAxiosCall=v,Lo}var ba={},Et={},Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.TIERS=Ot.APP_UI=Ot.CONFIG_HIVER=Ot.REFETCH_CHECK_DELAY=Ot.INITIAL_RETRY_DELAY=Ot.MAX_BACKOFF_LIMIT=Ot.MAX_CONFLICT_RETRY_DELAY=Ot.MAX_RETRY_DELAY=Ot.GET_METHOD=void 0,Ot.GET_METHOD="GET",Ot.MAX_RETRY_DELAY=18e4,Ot.MAX_CONFLICT_RETRY_DELAY=63e3,Ot.MAX_BACKOFF_LIMIT=8e3,Ot.INITIAL_RETRY_DELAY=1e3,Ot.REFETCH_CHECK_DELAY=168e4,Ot.CONFIG_HIVER={getToken:!1,fetchCsrfToken:function(){return""},isHiverApiDomain:!0},Ot.APP_UI={COLLAB_SPACE:"collab-space",DEFAULT:"default"},Ot.TIERS={DEV:"dev",SIT:"sit",PROD:"production"};var Tn={};Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.getProdHqConfig=Tn.getProdApiConfig=Tn.getSitHqConfig=Tn.getSitApiConfig=Tn.getDevHqConfig=Tn.getDevApiConfig=void 0;var pi={heimdallTokenFetch:"/v1/token/get",heimdallLogin:"/v1/login/code",v2Login:"/api/auth/login/code"},rw=function(){return{v2Url:"https://v2dev.hiver.space",heimdallUrl:"https://dev.hiver.space/api/heimdall-api",apiEndpoints:pi}};Tn.getDevApiConfig=rw;var ow=function(){return{v2Url:"https://v2dev.hiver.space",heimdallUrl:"https://dev.hiver.space/api/heimdall-api2",apiEndpoints:pi}};Tn.getDevHqConfig=ow;var iw=function(e){return{v2Url:"https://v2".concat(e,".hiver.space"),heimdallUrl:"https://".concat(e,".hiver.space/api/heimdall-api"),apiEndpoints:pi}};Tn.getSitApiConfig=iw;var aw=function(e){return{v2Url:"https://v2".concat(e,".hiver.space"),heimdallUrl:"https://".concat(e,".hiver.space/api/heimdall-api2"),apiEndpoints:pi}};Tn.getSitHqConfig=aw;var sw=function(){return{v2Url:"https://v2.hiverhq.com",heimdallUrl:"https://heimdall.hiverapi.com",apiEndpoints:pi}};Tn.getProdApiConfig=sw;var lw=function(){return{v2Url:"https://v2.hiverhq.com",heimdallUrl:"https://heimdall2.hiverhq.com",apiEndpoints:pi}};Tn.getProdHqConfig=lw;var uw=Be&&Be.__awaiter||function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function l(c){try{u(r.next(c))}catch(f){a(f)}}function s(c){try{u(r.throw(c))}catch(f){a(f)}}function u(c){c.done?i(c.value):o(c.value).then(l,s)}u((r=r.apply(e,t||[])).next())})},cw=Be&&Be.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(u){return function(c){return s([u,c])}}function s(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Et,"__esModule",{value:!0}),Et.expireToken=Et.validateToken=Et.validateAccount=Et.getConfig=Et.introduceDelay=Et.isTokenInExpiryWindow=Et.getStoredAuthData=Et.setUserDetails=Et.setTokenAndExpiry=Et.getRandomDelay=Et.hasValidToken=void 0;var nc=Ot,Bo=Tn,Mh=function(){var e=new Date,t=new Date(e.getTime()+e.getTimezoneOffset()*6e4);return t},rc=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};Et.validateAccount=rc;var dw=function(e){var t=rc(e);return!Bh()&&t};Et.validateToken=dw;var fw=function(){try{sessionStorage.removeItem("hiverAuthTokenExpiry")}catch{console.log("Heimdall: Unable to Remove token.")}};Et.expireToken=fw;var pw=function(e){console.log("Heimdall: checking if there is a valid token");var t=sessionStorage.getItem("hiverAuthTokenExpiry")||"",n=new Date(t),r=Mh(),o=rc(e);return r<n&&o};Et.hasValidToken=pw;var hw=function(){return Math.floor(Math.random()*6e4)+6e4};Et.getRandomDelay=hw;var gw=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)};Et.setUserDetails=gw;var mw=function(e,t){if(!e)throw new Error("Token not found in the response");sessionStorage.setItem("hiverAuthToken",e),sessionStorage.setItem("hiverAuthTokenExpiry",t)};Et.setTokenAndExpiry=mw;var bw=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}};Et.getStoredAuthData=bw;var Bh=function(){var e=sessionStorage.getItem("hiverAuthTokenExpiry")||"";if(!e)return!0;var t=Mh(),n=new Date(e),r=4*60*1e3,o=n.getTime()-t.getTime()<r;return console.log({currentTime:t,expiry:n,isInExpiryWindow:o}),o};Et.isTokenInExpiryWindow=Bh;var vw=function(e){return uw(void 0,void 0,void 0,function(){return cw(this,function(t){switch(t.label){case 0:return[4,new Promise(function(n){return setTimeout(n,e)})];case 1:return t.sent(),[2]}})})};Et.introduceDelay=vw;var yw=function(e,t,n){switch(t){case nc.TIERS.SIT:return console.log("ISHIVERAPIDOMAIN:",n,(0,Bo.getSitHqConfig)(e)),n?(0,Bo.getSitApiConfig)(e):(0,Bo.getSitHqConfig)(e);case nc.TIERS.PROD:return n?(0,Bo.getProdApiConfig)():(0,Bo.getProdHqConfig)();case nc.TIERS.DEV:default:return n?(0,Bo.getDevApiConfig)():(0,Bo.getDevHqConfig)()}};Et.getConfig=yw;var va={},Vr={},jh;function Ew(){if(jh)return Vr;jh=1;var e=Be&&Be.__awaiter||function(b,y,v,d){function p(h){return h instanceof v?h:new v(function(g){g(h)})}return new(v||(v=Promise))(function(h,g){function m(A){try{x(d.next(A))}catch(T){g(T)}}function E(A){try{x(d.throw(A))}catch(T){g(T)}}function x(A){A.done?h(A.value):p(A.value).then(m,E)}x((d=d.apply(b,y||[])).next())})},t=Be&&Be.__generator||function(b,y){var v={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},d,p,h,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(x){return function(A){return E([x,A])}}function E(x){if(d)throw new TypeError("Generator is already executing.");for(;g&&(g=0,x[0]&&(v=0)),v;)try{if(d=1,p&&(h=x[0]&2?p.return:x[0]?p.throw||((h=p.return)&&h.call(p),0):p.next)&&!(h=h.call(p,x[1])).done)return h;switch(p=0,h&&(x=[x[0]&2,h.value]),x[0]){case 0:case 1:h=x;break;case 4:return v.label++,{value:x[1],done:!1};case 5:v.label++,p=x[1],x=[0];continue;case 7:x=v.ops.pop(),v.trys.pop();continue;default:if(h=v.trys,!(h=h.length>0&&h[h.length-1])&&(x[0]===6||x[0]===2)){v=0;continue}if(x[0]===3&&(!h||x[1]>h[0]&&x[1]<h[3])){v.label=x[1];break}if(x[0]===6&&v.label<h[1]){v.label=h[1],h=x;break}if(h&&v.label<h[2]){v.label=h[2],v.ops.push(x);break}h[2]&&v.ops.pop(),v.trys.pop();continue}x=y.call(b,v)}catch(A){x=[6,A],p=0}finally{d=h=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}};Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.getV2LoginCode=Vr.getLoginToken=Vr.getAccessToken=void 0;var n=Ot,r=Hh(),o=Et,i=function(b,y,v){var d=(0,o.getStoredAuthData)();return{root_url:b.heimdallUrl,url:b.apiEndpoints.heimdallTokenFetch,method:n.GET_METHOD,data:{user_id:y.userId,usergroup_id:y.usergroupId,access_token:(d==null?void 0:d.token)||"",source:v},withCredentials:!0}},a=function(b,y){return{root_url:y.heimdallUrl,url:y.apiEndpoints.heimdallLogin,method:n.GET_METHOD,data:{code:b},withCredentials:!0}},l=function(b){return parseInt(b,10)},s=function(b,y){return{root_url:b.v2Url,url:b.apiEndpoints.v2Login,method:n.GET_METHOD,withCredentials:!0,data:{usersession:l(localStorage.getItem("hiver-config.usersession")),app:y||n.APP_UI.DEFAULT}}},u=function(b,y,v,d){return e(void 0,void 0,void 0,function(){var p,h,g,m,E,x,A;return t(this,function(T){switch(T.label){case 0:return T.trys.push([0,4,,5]),(0,o.validateToken)(v)?[3,2]:(console.log("HEIMDALL: No valid token, fetching token"),p=i(y,v,d),[4,(0,r.makeAxiosCall)(p,b)]);case 1:return h=T.sent(),[2,{atToken:(m=h==null?void 0:h.data.at)===null||m===void 0?void 0:m.token,expiryTime:(E=h==null?void 0:h.data.at)===null||E===void 0?void 0:E.expires_at,userId:(x=h==null?void 0:h.data)===null||x===void 0?void 0:x.user_id,userGroupId:(A=h==null?void 0:h.data)===null||A===void 0?void 0:A.usergroup_id}];case 2:return console.log("Heimdall: Valid token already exists"),[2,{}];case 3:return[3,5];case 4:throw g=T.sent(),g;case 5:return[2]}})})};Vr.getAccessToken=u;var c=function(b,y,v){return e(void 0,void 0,void 0,function(){var d,p,h,g,m,E,x;return t(this,function(A){switch(A.label){case 0:d=a(b,v),A.label=1;case 1:return A.trys.push([1,3,,4]),[4,(0,r.makeAxiosCall)(d,y)];case 2:return p=A.sent(),[2,{userId:(g=p==null?void 0:p.data)===null||g===void 0?void 0:g.user_id,userGroupId:(m=p==null?void 0:p.data)===null||m===void 0?void 0:m.usergroup_id,atToken:(E=p==null?void 0:p.data.at)===null||E===void 0?void 0:E.token,expiryTime:(x=p==null?void 0:p.data.at)===null||x===void 0?void 0:x.expires_at}];case 3:throw h=A.sent(),h;case 4:return[2]}})})};Vr.getLoginToken=c;var f=function(b,y,v){return e(void 0,void 0,void 0,function(){var d,p,h;return t(this,function(g){switch(g.label){case 0:return g.trys.push([0,2,,3]),console.log("ERROR debug: in getV2loginCode:",v),d=s(y,v),[4,(0,r.makeAxiosCall)(d,b)];case 1:return p=g.sent(),console.log("DEBUG HEIMDALL: local storage:",p==null?void 0:p.data),[2,p==null?void 0:p.data.code];case 2:throw h=g.sent(),h;case 3:return[2]}})})};return Vr.getV2LoginCode=f,Vr}var Vh;function Gh(){if(Vh)return va;Vh=1;var e=Be&&Be.__awaiter||function(y,v,d,p){function h(g){return g instanceof d?g:new d(function(m){m(g)})}return new(d||(d=Promise))(function(g,m){function E(T){try{A(p.next(T))}catch(C){m(C)}}function x(T){try{A(p.throw(T))}catch(C){m(C)}}function A(T){T.done?g(T.value):h(T.value).then(E,x)}A((p=p.apply(y,v||[])).next())})},t=Be&&Be.__generator||function(y,v){var d={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},p,h,g,m;return m={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function E(A){return function(T){return x([A,T])}}function x(A){if(p)throw new TypeError("Generator is already executing.");for(;m&&(m=0,A[0]&&(d=0)),d;)try{if(p=1,h&&(g=A[0]&2?h.return:A[0]?h.throw||((g=h.return)&&g.call(h),0):h.next)&&!(g=g.call(h,A[1])).done)return g;switch(h=0,g&&(A=[A[0]&2,g.value]),A[0]){case 0:case 1:g=A;break;case 4:return d.label++,{value:A[1],done:!1};case 5:d.label++,h=A[1],A=[0];continue;case 7:A=d.ops.pop(),d.trys.pop();continue;default:if(g=d.trys,!(g=g.length>0&&g[g.length-1])&&(A[0]===6||A[0]===2)){d=0;continue}if(A[0]===3&&(!g||A[1]>g[0]&&A[1]<g[3])){d.label=A[1];break}if(A[0]===6&&d.label<g[1]){d.label=g[1],g=A;break}if(g&&d.label<g[2]){d.label=g[2],d.ops.push(A);break}g[2]&&d.ops.pop(),d.trys.pop();continue}A=v.call(y,d)}catch(T){A=[6,T],h=0}finally{p=g=0}if(A[0]&5)throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}};Object.defineProperty(va,"__esModule",{value:!0}),va.fetchToken=void 0;var n=Ew(),r=Ot,o=Et,i,a,l,s=function(y,v,d){return d===void 0&&(d=r.APP_UI.DEFAULT),e(void 0,void 0,void 0,function(){var p,h,g,m,E,x,A,T,C;return t(this,function(O){switch(O.label){case 0:p=2,O.label=1;case 1:return O.trys.push([1,4,,9]),console.log("ERROR debug: in login:",d),[4,(0,n.getV2LoginCode)(r.CONFIG_HIVER,y,d)];case 2:return h=O.sent(),[4,(0,n.getLoginToken)(h,r.CONFIG_HIVER,y)];case 3:return g=O.sent(),m=g.userId,E=g.userGroupId,x=g.atToken,A=g.expiryTime,(0,o.setTokenAndExpiry)(x,A),(0,o.setUserDetails)(m,E),[3,9];case 4:T=O.sent(),console.log("ERROR debug: in error login:",T,d),C=v,O.label=5;case 5:return C<p?[4,s(y,C+1,d)]:[3,8];case 6:O.sent(),O.label=7;case 7:return C++,[3,5];case 8:throw T;case 9:return[2]}})})},u=function(y,v,d){return e(void 0,void 0,void 0,function(){var p,h,g,m;return t(this,function(E){switch(E.label){case 0:return v<r.MAX_CONFLICT_RETRY_DELAY?[4,new Promise(function(x){return setTimeout(x,y)})]:[3,3];case 1:return E.sent(),v+=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),p=d.retryDelay,h=d.configs,g=d.api_params,m=d.appUI,[4,c(p,y,v,h,g,m)];case 2:E.sent(),E.label=3;case 3:return[2]}})})},c=function(y,v,d,p,h,g,m){return g===void 0&&(g="default"),e(void 0,void 0,void 0,function(){var E,x,A,T,C,O,M,B,U,G,X,q,$,ue;return t(this,function(se){switch(se.label){case 0:return se.trys.push([0,2,,12]),console.log("Heimdall: Interval Set on fetch token in fetchAndSaveToken:",l),[4,(0,n.getAccessToken)(r.CONFIG_HIVER,p,h,g)];case 1:return E=se.sent(),x=E.atToken,A=E.expiryTime,T=E.userId,C=E.userGroupId,x&&A&&(0,o.setTokenAndExpiry)(x,A),T&&C&&(0,o.setUserDetails)(T,C),y=r.INITIAL_RETRY_DELAY,v=r.INITIAL_RETRY_DELAY,d=0,[3,12];case 2:return O=se.sent(),console.log("ERROR: Heimdall fetch token",O),((U=O.response)===null||U===void 0?void 0:U.status)===401||((G=O.request)===null||G===void 0?void 0:G.status)===401?(M=1,[4,s(p,M,m)]):[3,4];case 3:return se.sent(),[3,11];case 4:return((X=O.response)===null||X===void 0?void 0:X.status)===409||((q=O.request)===null||q===void 0?void 0:q.status)===409?(console.log("Heimdall: Fetching token post 409 in fetch And Save Token"),B={retryDelay:y,configs:p,api_params:h,appUI:m},[4,u(v,d,B)]):[3,6];case 5:if(se.sent(),d>=r.MAX_CONFLICT_RETRY_DELAY)throw O;return[3,11];case 6:if(!((($=O.response)===null||$===void 0?void 0:$.status)===422||((ue=O.request)===null||ue===void 0?void 0:ue.status)===422))return[3,7];throw console.log("ERROR: Throwing error",O.response.status),O;case 7:return y<=r.MAX_RETRY_DELAY?[4,new Promise(function(ve){return setTimeout(ve,y)})]:[3,10];case 8:return se.sent(),y*=2,console.log("Heimdall: Fetch token post doubling retry delay",y),[4,c(y,v,d,p,h,m)];case 9:return se.sent(),[3,11];case 10:throw O;case 11:return[3,12];case 12:return[2]}})})},f=function(y,v,d,p,h,g){return d===void 0&&(d=r.INITIAL_RETRY_DELAY),p===void 0&&(p=r.INITIAL_RETRY_DELAY),h===void 0&&(h=0),e(void 0,void 0,void 0,function(){var m,E,x;return t(this,function(A){switch(A.label){case 0:return A.trys.push([0,4,,5]),m=(0,o.isTokenInExpiryWindow)(),m?(E=(0,o.getRandomDelay)(),[4,(0,o.introduceDelay)(E)]):[3,3];case 1:return A.sent(),console.log("Heimdall: Fetching token - in expiry window"),[4,c(d,p,h,y,v,g)];case 2:A.sent(),A.label=3;case 3:return[3,5];case 4:throw x=A.sent(),x;case 5:return[2]}})})},b=function(y,v,d,p,h,g){return e(void 0,void 0,void 0,function(){var m,E,x,A,T;return t(this,function(C){switch(C.label){case 0:i=y,a=v,m=r.INITIAL_RETRY_DELAY,E=r.INITIAL_RETRY_DELAY,x=0,A=(0,o.getConfig)(i,a,p),C.label=1;case 1:return C.trys.push([1,3,,4]),[4,c(m,E,x,A,d,h,g)];case 2:return C.sent(),console.log("Heimdall: Interval Set on fetch token when fetch token is called:",l),clearInterval(l),l=setInterval(function(){return f(A,d)},r.REFETCH_CHECK_DELAY),console.log("Heimdall: Interval Set on fetch token:",l),window.addEventListener("online",function(){return e(void 0,void 0,void 0,function(){return t(this,function(O){switch(O.label){case 0:return console.log("Online status detected. Fetching token..."),[4,f(A,d)];case 1:return O.sent(),[2]}})})}),[3,4];case 3:throw T=C.sent(),T;case 4:return[2]}})})};return va.fetchToken=b,va}var Wh;function Hh(){if(Wh)return ba;Wh=1;var e=Be&&Be.__assign||function(){return e=Object.assign||function(b){for(var y,v=1,d=arguments.length;v<d;v++){y=arguments[v];for(var p in y)Object.prototype.hasOwnProperty.call(y,p)&&(b[p]=y[p])}return b},e.apply(this,arguments)},t=Be&&Be.__awaiter||function(b,y,v,d){function p(h){return h instanceof v?h:new v(function(g){g(h)})}return new(v||(v=Promise))(function(h,g){function m(A){try{x(d.next(A))}catch(T){g(T)}}function E(A){try{x(d.throw(A))}catch(T){g(T)}}function x(A){A.done?h(A.value):p(A.value).then(m,E)}x((d=d.apply(b,y||[])).next())})},n=Be&&Be.__generator||function(b,y){var v={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},d,p,h,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(x){return function(A){return E([x,A])}}function E(x){if(d)throw new TypeError("Generator is already executing.");for(;g&&(g=0,x[0]&&(v=0)),v;)try{if(d=1,p&&(h=x[0]&2?p.return:x[0]?p.throw||((h=p.return)&&h.call(p),0):p.next)&&!(h=h.call(p,x[1])).done)return h;switch(p=0,h&&(x=[x[0]&2,h.value]),x[0]){case 0:case 1:h=x;break;case 4:return v.label++,{value:x[1],done:!1};case 5:v.label++,p=x[1],x=[0];continue;case 7:x=v.ops.pop(),v.trys.pop();continue;default:if(h=v.trys,!(h=h.length>0&&h[h.length-1])&&(x[0]===6||x[0]===2)){v=0;continue}if(x[0]===3&&(!h||x[1]>h[0]&&x[1]<h[3])){v.label=x[1];break}if(x[0]===6&&v.label<h[1]){v.label=h[1],h=x;break}if(h&&v.label<h[2]){v.label=h[2],v.ops.push(x);break}h[2]&&v.ops.pop(),v.trys.pop();continue}x=y.call(b,v)}catch(A){x=[6,A],p=0}finally{d=h=0}if(x[0]&5)throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}};Object.defineProperty(ba,"__esModule",{value:!0}),ba.makeAxiosCall=void 0;var r=_h,o=Et,i=Gh(),a,l=2,s=function(b,y){var v=y.fetchCsrfToken();b.formData?b.formData.append("_csrf_token",v):(b.data=b.data||{},b.data._csrf_token=v)},u=function(b){var y=!b.method||b.method.toLowerCase()==="get"?{params:b.data}:{data:b.data},v=e(e({method:b.method,url:"".concat(b.root_url).concat(b.url),headers:b.headers},y),{withCredentials:b.withCredentials,responseType:(b==null?void 0:b.responseType)||""});return v};function c(b){return t(this,void 0,void 0,function(){var y;return n(this,function(v){return y=u(b),[2,(0,r.default)(y).then(function(d){return d}).catch(function(d){throw d})]})})}function f(b,y,v,d){var p,h;return d===void 0&&(d=0),t(this,void 0,void 0,function(){var g,m,E,x,A,T;return n(this,function(C){switch(C.label){case 0:if(C.trys.push([0,4,,5]),!(y.getToken&&!(0,o.hasValidToken)(b)))return[3,2];if(g=b.app_env,m=b.tier,!g||!m)throw Error("app_env or tier missing : ".concat(g,"/").concat(m));return"userId"in b&&"usergroupId"in b?(E={userId:b.userId,usergroupId:b.usergroupId},typeof y.isHiverApiDomain!="boolean"&&(y.isHiverApiDomain=!0),[4,(0,i.fetchToken)(g,m,E,y.isHiverApiDomain,v)]):[3,2];case 1:C.sent(),C.label=2;case 2:return b.csrfToken&&s(b,y),y.getToken&&(a=sessionStorage.getItem("hiverAuthToken")||"",b.headers=e(e({},b.headers),{Authorization:"Bearer ".concat(a)})),[4,c(b)];case 3:return x=C.sent(),b.onSuccess&&b.onSuccess(x),[2,x];case 4:if(A=C.sent(),T=((p=A.response)===null||p===void 0?void 0:p.status)===403||((h=A.request)===null||h===void 0?void 0:h.status)===403,d<l&&T)return(0,o.expireToken)(),[2,f(b,y,v,d+1)];if(d>=l&&T||!T)throw b.onFail&&b.onFail(A),console.log("ERROR: Reached make Axios",A),A;return[3,5];case 5:return[2]}})})}return ba.makeAxiosCall=f,ba}(function(e){var t=Be&&Be.__awaiter||function(y,v,d,p){function h(g){return g instanceof d?g:new d(function(m){m(g)})}return new(d||(d=Promise))(function(g,m){function E(T){try{A(p.next(T))}catch(C){m(C)}}function x(T){try{A(p.throw(T))}catch(C){m(C)}}function A(T){T.done?g(T.value):h(T.value).then(E,x)}A((p=p.apply(y,v||[])).next())})},n=Be&&Be.__generator||function(y,v){var d={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},p,h,g,m;return m={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function E(A){return function(T){return x([A,T])}}function x(A){if(p)throw new TypeError("Generator is already executing.");for(;m&&(m=0,A[0]&&(d=0)),d;)try{if(p=1,h&&(g=A[0]&2?h.return:A[0]?h.throw||((g=h.return)&&g.call(h),0):h.next)&&!(g=g.call(h,A[1])).done)return g;switch(h=0,g&&(A=[A[0]&2,g.value]),A[0]){case 0:case 1:g=A;break;case 4:return d.label++,{value:A[1],done:!1};case 5:d.label++,h=A[1],A=[0];continue;case 7:A=d.ops.pop(),d.trys.pop();continue;default:if(g=d.trys,!(g=g.length>0&&g[g.length-1])&&(A[0]===6||A[0]===2)){d=0;continue}if(A[0]===3&&(!g||A[1]>g[0]&&A[1]<g[3])){d.label=A[1];break}if(A[0]===6&&d.label<g[1]){d.label=g[1],g=A;break}if(g&&d.label<g[2]){d.label=g[2],d.ops.push(A);break}g[2]&&d.ops.pop(),d.trys.pop();continue}A=v.call(y,d)}catch(T){A=[6,T],h=0}finally{p=g=0}if(A[0]&5)throw A[1];return{value:A[0]?A[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=Fh(),o=kh(),i=to;Object.defineProperty(e,"TENANT_PLATFORM",{enumerable:!0,get:function(){return i.TENANT_PLATFORM}}),Object.defineProperty(e,"DEFAULT_INIT_CONFIG_HIVER",{enumerable:!0,get:function(){return i.DEFAULT_INIT_CONFIG_HIVER}});var a=Nh(),l=tt,s=vr,u=Hh();Object.defineProperty(e,"makeAxiosCall",{enumerable:!0,get:function(){return u.makeAxiosCall}});var c=Gh();Object.defineProperty(e,"fetchToken",{enumerable:!0,get:function(){return c.fetchToken}});var f=yr,b=function(){function y(v,d,p,h,g,m){p===void 0&&(p=i.TENANT_PLATFORM.GMAIL),h===void 0&&(h=null),g===void 0&&(g=!0),m===void 0&&(m=!1),this.setEnvironment(),this.appEnv=v,this.tier=d,this.tenantPlatform=p,this.authTokenFetchingInProgress=!1,this.getTokenForLogin=h,this.withCredentials=g,this.csrfToken=m}return y.prototype.setEnvironment=function(){typeof window<"u"&&window.document?(0,f.setValue)("PLATFORM",i.PLATFORM.WEB):(0,f.setValue)("PLATFORM",i.PLATFORM.MOBILE)},y.prototype.hiverAxios=function(v,d,p,h){return d===void 0&&(d=i.DEFAULT_INIT_CONFIG_HIVER),t(this,void 0,void 0,function(){var g,m;return n(this,function(E){switch(E.label){case 0:return E.trys.push([0,4,,5]),h&&h<2?(g={userId:v.userId,usergroupId:v.usergroupId,apiRetry:h},console.log("THIS IS THE TENNANTPLAORM -> ",this.tenantPlatform),[4,(0,o.fetchAccessToken)(this.appEnv,this.tier,g,this.tenantPlatform,this.getTokenForLogin,i.API_CALL_ORIGIN.API_RETRY)]):[3,2];case 1:E.sent(),E.label=2;case 2:return[4,(0,r.hiverAxiosCall)(this,v,d,p)];case 3:return[2,E.sent()];case 4:throw m=E.sent(),console.log("ERROR: Axios call failed",m),m;case 5:return[2]}})})},y.prototype.fetchAuthToken=function(v,d,p){return t(this,void 0,void 0,function(){var h;return n(this,function(g){switch(g.label){case 0:return g.trys.push([0,4,7,8]),this.authTokenFetchingInProgress?[3,2]:(this.authTokenFetchingInProgress=!0,[4,(0,o.fetchAccessToken)(this.appEnv,this.tier,v,this.tenantPlatform,this.getTokenForLogin,d,p)]);case 1:return g.sent(),[3,3];case 2:console.log("Heimdall: AuthToken Fetching InProgress",this.authTokenFetchingInProgress),g.label=3;case 3:return[3,8];case 4:return h=g.sent(),console.log("ERROR: Fetching token failed",h),this.authTokenFetchingInProgress=!1,[4,new Promise(function(m){return setTimeout(m,100)})];case 5:return g.sent(),console.log("Heimdall: Retrying fetchAccessToken after 100ms..."),[4,this.fetchAuthToken(v,d,p)];case 6:return g.sent(),[3,8];case 7:return this.authTokenFetchingInProgress=!1,[7];case 8:return[2]}})})},y.prototype.logout=function(){return t(this,void 0,void 0,function(){var v,d;return n(this,function(p){switch(p.label){case 0:return p.trys.push([0,2,,3]),v=(0,l.getConfig)(this.appEnv,this.tier),[4,(0,a.logoutFromHeimdall)(v,this.tenantPlatform)];case 1:return p.sent(),(0,s.removeItemFromStorage)("hiverAuthToken"),(0,s.removeItemFromStorage)("hiverAuthTokenExpiry"),(0,s.removeItemFromStorage)("hiverAuthUserId"),(0,s.removeItemFromStorage)("hiverAuthUserGroupId"),[3,3];case 2:throw d=p.sent(),console.error("Heimdall: Logout failed",d),d;case 3:return[2]}})})},y.prototype.isTokenFetchingInProgress=function(){return this.authTokenFetchingInProgress},y}();e.Bifrost=b})(ku);const ar={userId:"",userGroupId:"",baseUrl:"",appEnv:"",tier:"",bifrost:null,isInitiated:!1},hi=()=>{if(!ar.isInitiated)return null;if(!ar.baseUrl)throw new Error("Base url is not setup. please call the initConnectorsBifrost function with the appropriate value");return ar},xw=({baseUrl:e,appEnv:t,tier:n,userId:r,userGroupId:o,tenantPlatform:i=ku.TENANT_PLATFORM.GMAIL,withCredentials:a=!0,getTokenForLogin:l})=>{ar.baseUrl=e,ar.appEnv=t,ar.tier=n,ar.userGroupId=o,ar.userId=r,ar.tenantPlatform=i,ar.bifrost=new ku.Bifrost(t,n,i,l,a),ar.isInitiated=!0},on=(({configHiver:e})=>async n=>{const r=hi();if(!r)throw new Error("Please call initConnectorsBifrost before making any api calls");const{bifrost:o,userGroupId:i,userId:a}=r,{url:l,method:s,root_url:u}=n,f={root_url:(u||r.baseUrl)+((n==null?void 0:n.prefix)||""),url:l,method:s,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(a),usergroupId:Number(i)};try{return await(o==null?void 0:o.hiverAxios(f,{...e,isHiverApiDomain:!0}))}catch(b){throw console.error("API call failed with error: ",b),b}})({configHiver:{getToken:!0,fetchCsrfToken:()=>"",isHiverApiDomain:!0},withCredentials:!0}),Cw=jn+"/template/list",ww=jn+"/template/{{templateId}}",Iw=()=>on({url:Cw,method:wn.GET}),Sw=e=>on({url:ww.replace("{{templateId}}",e),method:wn.GET}),zh=e=>e.templateLibrary.connectorTemplateList,oc=e=>e.templateLibrary.connectorTemplates,Tw=e=>e.templateLibrary.templateListApiStatus,Xh=e=>e.templateLibrary.templateDetailsApiStatus,Aw=ca({name:"templateLibrary",initialState:JE,reducers:{},extraReducers:e=>{e.addCase(Hs.pending,t=>{t.templateListApiStatus=Ie.LOADING}).addCase(Hs.fulfilled,(t,n)=>{t.templateListApiStatus=Ie.IDLE,t.connectorTemplateList=n.payload.connectorList,t.connectorTemplates=n.payload.connectors}).addCase(Hs.rejected,(t,n)=>{t.templateListApiStatus=Ie.FAILED,console.error(n.error)}).addCase(ya.pending,t=>{t.templateDetailsApiStatus=Ie.LOADING}).addCase(ya.fulfilled,(t,n)=>{t.templateDetailsApiStatus=Ie.IDLE;const{templateData:r,templateId:o}=n.payload;r&&o&&(t.connectorTemplates={...t.connectorTemplates,[o]:r})}).addCase(ya.rejected,(t,n)=>{t.templateDetailsApiStatus=Ie.FAILED,console.error(n.error)})}}),Hs=Cn("connectorLibrary/fetchConnectorTemplates",async()=>{const e=await Iw();if(!e||!e.data||!Array.isArray(e.data))return{connectorList:[],connectors:{}};const t=e.data,n=Mp(t,o=>o.id),r=Bp(t,o=>o.id);return{connectors:n,connectorList:r}}),ya=Cn("connectorLibrary/fetchTemplateDetails",async e=>{const t=await Sw(e);return!t||!t.data?{templateId:e,templateData:null}:{templateData:t.data,templateId:e}}),_w=Aw.reducer,Ow={connectors:null,connectorList:[],connectorsApiStatus:Ie.IDLE,selectedConnector:null,currentUpdatingConnectors:{},connectorDetailApiStatus:Ie.IDLE,connectorDetails:null,fetchInboxApiStatus:Ie.IDLE,chatInboxDetails:null,emailInboxDetails:null,rolesAndPermissions:null,rolesAndPermissionsApiStatus:Ie.IDLE,updateEnableConnectorsApiStatus:Ie.IDLE,cardCustomFields:{},cardCustomFieldsApiStatus:Ie.IDLE},Rw=jn+"/connectors/ug",Nw=jn+"/connectors/{{id}}",Dw=jn+"/connectors/{{id}}",Zh="{{card_id}}",Pw=jn+`/connectors/cards/${Zh}`,kw=jn+"/connectors/cards/:cardId/custom_fields",Lw=()=>on({url:Rw,method:wn.GET}),Fw=({id:e,enabled:t})=>on({url:Nw.replace("{{id}}",e),method:wn.PATCH,data:{enabled:t}}),Mw=e=>{const t=Dw.replace("{{id}}",e);return on({url:t,method:wn.GET})},Bw=({cardId:e,data:t})=>on({url:Pw.replace(Zh,e),method:wn.PATCH,data:t}),jw=e=>on({url:Hp(kw,{cardId:e}),method:wn.GET}),Vw=ca({name:"connectorLibrary",initialState:Ow,reducers:{},extraReducers:e=>{e.addCase(Us.pending,t=>{t.connectorsApiStatus=Ie.LOADING}).addCase(Us.fulfilled,(t,n)=>{t.connectorsApiStatus=Ie.IDLE,t.connectorList=n.payload.connectorList,t.connectors=n.payload.connectors}).addCase(Us.rejected,(t,n)=>{t.connectorsApiStatus=Ie.FAILED,console.error(n.error)}).addCase(zs.pending,(t,n)=>{var o;const{id:r}=((o=n==null?void 0:n.meta)==null?void 0:o.arg)||{};t.currentUpdatingConnectors={...t.currentUpdatingConnectors,[r]:Ie.LOADING}}).addCase(zs.fulfilled,(t,n)=>{var i,a;const{id:r="",enabled:o}=((i=n==null?void 0:n.meta)==null?void 0:i.arg)||{};t.currentUpdatingConnectors[r]&&(t.currentUpdatingConnectors[r]=Ie.IDLE),(a=t==null?void 0:t.connectors)!=null&&a[r]&&(t.connectors[r].isEnabled=o)}).addCase(zs.rejected,(t,n)=>{var o;const{id:r}=((o=n==null?void 0:n.meta)==null?void 0:o.arg)||{};t.currentUpdatingConnectors={...t.currentUpdatingConnectors,[r]:Ie.FAILED},console.error(n.error)}).addCase(Ea.pending,t=>{t.connectorDetailApiStatus=Ie.LOADING}).addCase(Ea.fulfilled,(t,n)=>{var i;t.connectorDetailApiStatus=Ie.IDLE;const{connector:r,connectorId:o}=n.payload;r&&(t.connectors={...t.connectors,[o]:{...(i=t.connectors)==null?void 0:i[o],...r}})}).addCase(Ea.rejected,(t,n)=>{t.connectorDetailApiStatus=Ie.FAILED,console.error(n.error)}).addCase(Xs.pending,t=>{t.fetchInboxApiStatus=Ie.LOADING}).addCase(Xs.fulfilled,(t,n)=>{t.fetchInboxApiStatus=Ie.IDLE;const{chatInbox:r,emailInbox:o}=n.payload;t.chatInboxDetails=r,t.emailInboxDetails=o}).addCase(Xs.rejected,(t,n)=>{t.fetchInboxApiStatus=Ie.FAILED,console.error(n.error)}).addCase(Ys.pending,t=>{t.rolesAndPermissionsApiStatus=Ie.LOADING}).addCase(Ys.fulfilled,(t,n)=>{t.rolesAndPermissionsApiStatus=Ie.IDLE;const{rolesAndPermissions:r}=n.payload;t.rolesAndPermissions=r}).addCase(Ys.rejected,(t,n)=>{t.rolesAndPermissionsApiStatus=Ie.FAILED,console.error(n.error)}).addCase(Zs.pending,t=>{t.updateEnableConnectorsApiStatus=Ie.LOADING}).addCase(Zs.fulfilled,(t,n)=>{var u;t.updateEnableConnectorsApiStatus=Ie.IDLE;const{cardId:r,data:o,currentConnector:i}=n.payload.params,{roles:a,inboxes:l,fields:s}=o;t!=null&&t.connectors&&(t.connectors[i].cardList=(u=t.connectors[i].cardList)==null?void 0:u.map(c=>(c.id===r&&(c={...c,inboxes:l,roles:a,fields:s}),c)))}).addCase(Zs.rejected,t=>{t.updateEnableConnectorsApiStatus=Ie.FAILED}).addCase(qs.pending,t=>{t.cardCustomFieldsApiStatus=Ie.LOADING}).addCase(qs.fulfilled,(t,n)=>{t.cardCustomFieldsApiStatus=Ie.IDLE;const{cardId:r,customFields:o}=n.payload;t.cardCustomFields={...t.cardCustomFields,[r]:o}}).addCase(qs.rejected,(t,n)=>{t.cardCustomFieldsApiStatus=Ie.FAILED,console.error(n.error)})}}),zs=Cn("connectorLibrary/updateConnectors",async e=>(await Fw(e),{params:e})),Xs=Cn("connectorLibrary/getInboxDetails",async e=>{const t=await e();return{chatInbox:t.chatInboxes,emailInbox:t.emailInboxes}}),Zs=Cn("connectorLibrary/updateEnableConnectors",async e=>(await Bw(e),{params:e})),Ys=Cn("connectorLibrary/getRolesAndPermissions",async e=>({rolesAndPermissions:(await e()).roles})),Us=Cn("connectorLibrary/fetchConnectors",async()=>{const e=await Lw();if(!e||!e.data||!Array.isArray(e.data))return{connectorList:[],connectors:{}};const t=e.data;t.forEach(o=>{o.cardList&&(o.cardList.sort((i,a)=>i.priority-a.priority),o.cardList.forEach(i=>{i.fields&&i.fields.sort((a,l)=>a.priority-l.priority)}))});const n=Mp(t,o=>o.id),r=Bp(t,o=>o.id);return{connectors:n,connectorList:r}}),Ea=Cn("auth/fetchConnector",async e=>{const t=await Mw(e);return!t||!t.data?{connectorId:e,connector:null}:{connector:t.data,connectorId:e}}),qs=Cn("auth/fetchCardsCustomFields",async e=>{const t=await jw(e);return!t||!t.data||!t.data.fields||!Array.isArray(t.data.fields)?{cardId:e,customFields:[]}:{customFields:t.data.fields,cardId:e}},{condition:(e,{getState:t})=>{const{connectorLirary:n}=t();return!(n.cardCustomFields[e]&&n.cardCustomFields[e].length!==0)}}),Gw=Vw.reducer,Yh={testApiStatus:Ie.IDLE,isAuthenticated:{},verifyTokenApiStatus:Ie.IDLE,authVerificationDone:!1,testApiData:null},Ww=jn+"/connector/auth",Hw=jn+"/connector/{{id}}/auth/test",zw=jn+"/connector/{{id}}/auth",Xw=jn+"/connectors/{{id}}/auth/validate_token",Zw=jn+"/connectors/:connectorId/status",Yw=(e,t)=>{const n=Hw.replace("{{id}}",t);return on({url:n,method:wn.POST,data:e})},Uw=(e,t)=>{const n=Xw.replace("{{id}}",t);return on({url:n,method:wn.POST,data:e})},Uh=ca({name:"auth",initialState:Yh,reducers:{resetState:()=>Yh},extraReducers:e=>{e.addCase(Js.pending,t=>{t.authVerificationDone=!1,t.verifyTokenApiStatus=Ie.LOADING}).addCase(Js.fulfilled,t=>{t.authVerificationDone=!0,t.verifyTokenApiStatus=Ie.IDLE}).addCase(Js.rejected,(t,n)=>{t.authVerificationDone=!0,t.verifyTokenApiStatus=Ie.FAILED,console.error(n.error)}).addCase(ic.pending,t=>{t.testApiStatus=Ie.LOADING}).addCase(ic.fulfilled,(t,n)=>{t.testApiStatus=Ie.IDLE,t.testApiData=n.payload}).addCase(ic.rejected,(t,n)=>{const r={response:n.error,statusCode:n.error.code||"400"};t.testApiStatus=Ie.FAILED,t.testApiData=r,console.error(n.error)})}}),ic=Cn("auth/testAuth",async({data:e,connectorId:t})=>{const n=await Yw(e,t);if(!n||!n.data)return{response:null,statusCode:""};const r=n.data;return{response:r.response||r.errorMessage,statusCode:String(r.statusCode)}}),Js=Cn("auth/verifyToken",async({data:e,connectorId:t})=>{await Uw(e,t)}),{resetState:qw}=Uh.actions,Jw=Uh.reducer,Qw={connectorRequestsApiStatus:Ie.IDLE,requestableConnectors:null,requestableApis:null},qh=jn+"/connectors/integration/requests",$w=()=>on({url:qh,method:wn.GET}),Kw=({type:e,values:t,description:n})=>on({url:qh,method:wn.POST,data:{type:e,values:t,description:n}}),eI=ca({name:"connectorLibrary",initialState:Qw,reducers:{},extraReducers:e=>{e.addCase(Qs.pending,t=>{t.connectorRequestsApiStatus=Ie.LOADING}).addCase(Qs.fulfilled,(t,n)=>{t.connectorRequestsApiStatus=Ie.IDLE,t.requestableConnectors=n.payload.requestableConnectors,t.requestableApis=n.payload.requestableApis}).addCase(Qs.rejected,t=>{t.connectorRequestsApiStatus=Ie.FAILED}).addCase($s.pending,t=>{t.connectorRequestsApiStatus=Ie.LOADING}).addCase($s.fulfilled,t=>{t.connectorRequestsApiStatus=Ie.IDLE}).addCase($s.rejected,t=>{t.connectorRequestsApiStatus=Ie.FAILED})}}),Qs=Cn("connectorLibrary/fetchConnectorRequests",async()=>{const e=await $w();if(!e||!e.data)return{requestableConnectors:[],requestableApis:[]};const n=e.data.requestableConnectors,r=e.data.requestableApis;return{requestableConnectors:n,requestableApis:r}}),$s=Cn("connectorLibrary/submitConnectorRequest",async e=>(await Kw(e),{params:e})),tI=eI.reducer,nI=ip({counter:AE,connectorLirary:Gw,templateLibrary:_w,auth:Jw,requestConnectorApi:tI}),rI=aE({reducer:nI,devTools:!0}),oI={currentSideBar:"",setCurrentSideBar:()=>{},currentConnector:"",setCurrentConnector:()=>{},currentAvailableConnectors:[],setCurrentAvailableConnectors:()=>{},baseUrls:{},availableFeatures:{},sendTrackingEvent:()=>{},userPermissions:[],metaData:void 0},zt=S.createContext(oI),Xe={BASEPATH:"/",CONNECTOR_SETTINGS:"connector/settings",DASHBOARD:"dashboard",AGENT:"agent",CONNECTOR_CONFIG:"connector",API_VIEW:"connector/apiView",AUTH_SUCCESS:"authSuccess"},ac="Custom Connectors",sc={id:"connectors_view",value:"Connectors",route:Xe.DASHBOARD},Jh={id:"agent_view",value:"Agent view",route:Xe.AGENT},iI=[sc,Jh],Qh={[sc.value]:[Xe.BASEPATH+Xe.DASHBOARD,Xe.BASEPATH+Xe.CONNECTOR_CONFIG,Xe.BASEPATH+Xe.CONNECTOR_SETTINGS,Xe.BASEPATH,Xe.BASEPATH+Xe.API_VIEW],[Jh.value]:[Xe.AGENT]},aI=({children:e,baseUrls:t,availableFeatures:n,extraParams:r,connectorFunctions:o})=>{const[i,a]=S.useState(sc.id),[l,s]=S.useState(""),[u,c]=S.useState([]);return I.jsx(zt.Provider,{value:{currentSideBar:i,setCurrentSideBar:a,currentConnector:l,setCurrentConnector:s,currentAvailableConnectors:u,setCurrentAvailableConnectors:c,baseUrls:t??{},availableFeatures:n??{},sendTrackingEvent:(r==null?void 0:r.sendTrackingEvent)??(()=>{}),userPermissions:(r==null?void 0:r.userPermissions)??[],metaData:r==null?void 0:r.metaData,connectorFunctions:o},children:e})};var gi=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(){}},jo=typeof window>"u"||"Deno"in globalThis;function Un(){}function sI(e,t){return typeof e=="function"?e(t):e}function lc(e){return typeof e=="number"&&e>=0&&e!==1/0}function $h(e,t){return Math.max(e+(t||0)-Date.now(),0)}function mi(e,t){return typeof e=="function"?e(t):e}function sr(e,t){return typeof e=="function"?e(t):e}function Kh(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:l}=e;if(a){if(r){if(t.queryHash!==uc(a,t.options))return!1}else if(!xa(t.queryKey,a))return!1}if(n!=="all"){const s=t.isActive();if(n==="active"&&!s||n==="inactive"&&s)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||o&&o!==t.state.fetchStatus||i&&!i(t))}function eg(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Vo(t.options.mutationKey)!==Vo(i))return!1}else if(!xa(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function uc(e,t){return((t==null?void 0:t.queryKeyHashFn)||Vo)(e)}function Vo(e){return JSON.stringify(e,(t,n)=>dc(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function xa(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!xa(e[n],t[n])):!1}function cc(e,t){if(e===t)return e;const n=tg(e)&&tg(t);if(n||dc(e)&&dc(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),a=i.length,l=n?[]:{};let s=0;for(let u=0;u<a;u++){const c=n?u:i[u];(!n&&r.includes(c)||n)&&e[c]===void 0&&t[c]===void 0?(l[c]=void 0,s++):(l[c]=cc(e[c],t[c]),l[c]===e[c]&&e[c]!==void 0&&s++)}return o===a&&s===o?e:l}return t}function Ks(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 tg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function dc(e){if(!ng(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!ng(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ng(e){return Object.prototype.toString.call(e)==="[object Object]"}function lI(e){return new Promise(t=>{setTimeout(t,e)})}function fc(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 cc(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 cc(e,t)}return t}function uI(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function cI(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var el=Symbol();function rg(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===el&&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===el?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var dI=(my=class extends gi{constructor(){super();De(this,$o);De(this,mo);De(this,Vi);Ce(this,Vi,t=>{if(!jo&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){D(this,mo)||this.setEventListener(D(this,Vi))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,mo))==null||t.call(this),Ce(this,mo,void 0))}setEventListener(t){var n;Ce(this,Vi,t),(n=D(this,mo))==null||n.call(this),Ce(this,mo,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){D(this,$o)!==t&&(Ce(this,$o,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof D(this,$o)=="boolean"?D(this,$o):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},$o=new WeakMap,mo=new WeakMap,Vi=new WeakMap,my),pc=new dI,fI=(by=class extends gi{constructor(){super();De(this,Gi,!0);De(this,bo);De(this,Wi);Ce(this,Wi,t=>{if(!jo&&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(){D(this,bo)||this.setEventListener(D(this,Wi))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,bo))==null||t.call(this),Ce(this,bo,void 0))}setEventListener(t){var n;Ce(this,Wi,t),(n=D(this,bo))==null||n.call(this),Ce(this,bo,t(this.setOnline.bind(this)))}setOnline(t){D(this,Gi)!==t&&(Ce(this,Gi,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return D(this,Gi)}},Gi=new WeakMap,bo=new WeakMap,Wi=new WeakMap,by),tl=new fI;function hc(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});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 pI(e){return Math.min(1e3*2**e,3e4)}function og(e){return(e??"online")==="online"?tl.isOnline():!0}var ig=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function gc(e){return e instanceof ig}function ag(e){let t=!1,n=0,r=!1,o;const i=hc(),a=d=>{var p;r||(b(new ig(d)),(p=e.abort)==null||p.call(e))},l=()=>{t=!0},s=()=>{t=!1},u=()=>pc.isFocused()&&(e.networkMode==="always"||tl.isOnline())&&e.canRun(),c=()=>og(e.networkMode)&&e.canRun(),f=d=>{var p;r||(r=!0,(p=e.onSuccess)==null||p.call(e,d),o==null||o(),i.resolve(d))},b=d=>{var p;r||(r=!0,(p=e.onError)==null||p.call(e,d),o==null||o(),i.reject(d))},y=()=>new Promise(d=>{var p;o=h=>{(r||u())&&d(h)},(p=e.onPause)==null||p.call(e)}).then(()=>{var d;o=void 0,r||(d=e.onContinue)==null||d.call(e)}),v=()=>{if(r)return;let d;const p=n===0?e.initialPromise:void 0;try{d=p??e.fn()}catch(h){d=Promise.reject(h)}Promise.resolve(d).then(f).catch(h=>{var A;if(r)return;const g=e.retry??(jo?0:3),m=e.retryDelay??pI,E=typeof m=="function"?m(n,h):m,x=g===!0||typeof g=="number"&&n<g||typeof g=="function"&&g(n,h);if(t||!x){b(h);return}n++,(A=e.onFail)==null||A.call(e,n,h),lI(E).then(()=>u()?void 0:y()).then(()=>{t?b(h):v()})})};return{promise:i,cancel:a,continue:()=>(o==null||o(),i),cancelRetry:l,continueRetry:s,canStart:c,start:()=>(c()?v():y().then(v),i)}}function hI(){let e=[],t=0,n=l=>{l()},r=l=>{l()},o=l=>setTimeout(l,0);const i=l=>{t?e.push(l):o(()=>{n(l)})},a=()=>{const l=e;e=[],l.length&&o(()=>{r(()=>{l.forEach(s=>{n(s)})})})};return{batch:l=>{let s;t++;try{s=l()}finally{t--,t||a()}return s},batchCalls:l=>(...s)=>{i(()=>{l(...s)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{o=l}}}var Xt=hI(),sg=(vy=class{constructor(){De(this,Ko)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lc(this.gcTime)&&Ce(this,Ko,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(jo?1/0:5*60*1e3))}clearGcTimeout(){D(this,Ko)&&(clearTimeout(D(this,Ko)),Ce(this,Ko,void 0))}},Ko=new WeakMap,vy),gI=(yy=class extends sg{constructor(t){super();De(this,hr);De(this,Hi);De(this,zi);De(this,Kn);De(this,ei);De(this,un);De(this,rs);De(this,ti);Ce(this,ti,!1),Ce(this,rs,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ce(this,ei,t.client),Ce(this,Kn,D(this,ei).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ce(this,Hi,mI(this.options)),this.state=t.state??D(this,Hi),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=D(this,un))==null?void 0:t.promise}setOptions(t){this.options={...D(this,rs),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&D(this,Kn).remove(this)}setData(t,n){const r=fc(this.state.data,t,this.options);return We(this,hr,Jr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){We(this,hr,Jr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=D(this,un))==null?void 0:r.promise;return(o=D(this,un))==null||o.cancel(t),n?n.then(Un).catch(Un):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(D(this,Hi))}isActive(){return this.observers.some(t=>sr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===el||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||!$h(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=D(this,un))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=D(this,un))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),D(this,Kn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(D(this,un)&&(D(this,ti)?D(this,un).cancel({revert:!0}):D(this,un).cancelRetry()),this.scheduleGc()),D(this,Kn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||We(this,hr,Jr).call(this,{type:"invalidate"})}fetch(t,n){var s,u,c;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(D(this,un))return D(this,un).continueRetry(),D(this,un).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(b=>b.options.queryFn);f&&this.setOptions(f.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=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(Ce(this,ti,!0),r.signal)})},i=()=>{const f=rg(this.options,n),b={client:D(this,ei),queryKey:this.queryKey,meta:this.meta};return o(b),Ce(this,ti,!1),this.options.persister?this.options.persister(f,b,this):f(b)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:D(this,ei),state:this.state,fetchFn:i};o(a),(s=this.options.behavior)==null||s.onFetch(a,this),Ce(this,zi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&We(this,hr,Jr).call(this,{type:"fetch",meta:(c=a.fetchOptions)==null?void 0:c.meta});const l=f=>{var b,y,v,d;gc(f)&&f.silent||We(this,hr,Jr).call(this,{type:"error",error:f}),gc(f)||((y=(b=D(this,Kn).config).onError)==null||y.call(b,f,this),(d=(v=D(this,Kn).config).onSettled)==null||d.call(v,this.state.data,f,this)),this.scheduleGc()};return Ce(this,un,ag({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var b,y,v,d;if(f===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}`),l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(p){l(p);return}(y=(b=D(this,Kn).config).onSuccess)==null||y.call(b,f,this),(d=(v=D(this,Kn).config).onSettled)==null||d.call(v,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,b)=>{We(this,hr,Jr).call(this,{type:"failed",failureCount:f,error:b})},onPause:()=>{We(this,hr,Jr).call(this,{type:"pause"})},onContinue:()=>{We(this,hr,Jr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),D(this,un).start()}},Hi=new WeakMap,zi=new WeakMap,Kn=new WeakMap,ei=new WeakMap,un=new WeakMap,rs=new WeakMap,ti=new WeakMap,hr=new WeakSet,Jr=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,...lg(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 gc(o)&&o.revert&&D(this,zi)?{...D(this,zi),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),Xt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),D(this,Kn).notify({query:this,type:"updated",action:t})})},yy);function lg(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:og(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function mI(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 bI=(Ey=class extends gi{constructor(t={}){super();De(this,Dr);this.config=t,Ce(this,Dr,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??uc(o,n);let a=this.get(i);return a||(a=new gI({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){D(this,Dr).has(t.queryHash)||(D(this,Dr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=D(this,Dr).get(t.queryHash);n&&(t.destroy(),n===t&&D(this,Dr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Xt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return D(this,Dr).get(t)}getAll(){return[...D(this,Dr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Kh(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Kh(t,r)):n}notify(t){Xt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Xt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Xt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Dr=new WeakMap,Ey),vI=(xy=class extends sg{constructor(t){super();De(this,kr);De(this,Pr);De(this,yn);De(this,ni);this.mutationId=t.mutationId,Ce(this,yn,t.mutationCache),Ce(this,Pr,[]),this.state=t.state||ug(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){D(this,Pr).includes(t)||(D(this,Pr).push(t),this.clearGcTimeout(),D(this,yn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ce(this,Pr,D(this,Pr).filter(n=>n!==t)),this.scheduleGc(),D(this,yn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){D(this,Pr).length||(this.state.status==="pending"?this.scheduleGc():D(this,yn).remove(this))}continue(){var t;return((t=D(this,ni))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,a,l,s,u,c,f,b,y,v,d,p,h,g,m,E,x,A,T;Ce(this,ni,ag({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(C,O)=>{We(this,kr,Oo).call(this,{type:"failed",failureCount:C,error:O})},onPause:()=>{We(this,kr,Oo).call(this,{type:"pause"})},onContinue:()=>{We(this,kr,Oo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>D(this,yn).canRun(this)}));const n=this.state.status==="pending",r=!D(this,ni).canStart();try{if(!n){We(this,kr,Oo).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=D(this,yn).config).onMutate)==null?void 0:i.call(o,t,this));const O=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));O!==this.state.context&&We(this,kr,Oo).call(this,{type:"pending",context:O,variables:t,isPaused:r})}const C=await D(this,ni).start();return await((u=(s=D(this,yn).config).onSuccess)==null?void 0:u.call(s,C,t,this.state.context,this)),await((f=(c=this.options).onSuccess)==null?void 0:f.call(c,C,t,this.state.context)),await((y=(b=D(this,yn).config).onSettled)==null?void 0:y.call(b,C,null,this.state.variables,this.state.context,this)),await((d=(v=this.options).onSettled)==null?void 0:d.call(v,C,null,t,this.state.context)),We(this,kr,Oo).call(this,{type:"success",data:C}),C}catch(C){try{throw await((h=(p=D(this,yn).config).onError)==null?void 0:h.call(p,C,t,this.state.context,this)),await((m=(g=this.options).onError)==null?void 0:m.call(g,C,t,this.state.context)),await((x=(E=D(this,yn).config).onSettled)==null?void 0:x.call(E,void 0,C,this.state.variables,this.state.context,this)),await((T=(A=this.options).onSettled)==null?void 0:T.call(A,void 0,C,t,this.state.context)),C}finally{We(this,kr,Oo).call(this,{type:"error",error:C})}}finally{D(this,yn).runNext(this)}}},Pr=new WeakMap,yn=new WeakMap,ni=new WeakMap,kr=new WeakSet,Oo=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),Xt.batch(()=>{D(this,Pr).forEach(r=>{r.onMutationUpdate(t)}),D(this,yn).notify({mutation:this,type:"updated",action:t})})},xy);function ug(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var yI=(Cy=class extends gi{constructor(t={}){super();De(this,Xr);De(this,gr);De(this,os);this.config=t,Ce(this,Xr,new Set),Ce(this,gr,new Map),Ce(this,os,0)}build(t,n,r){const o=new vI({mutationCache:this,mutationId:++cu(this,os)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){D(this,Xr).add(t);const n=nl(t);if(typeof n=="string"){const r=D(this,gr).get(n);r?r.push(t):D(this,gr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(D(this,Xr).delete(t)){const n=nl(t);if(typeof n=="string"){const r=D(this,gr).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&D(this,gr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=nl(t);if(typeof n=="string"){const r=D(this,gr).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=nl(t);if(typeof n=="string"){const o=(r=D(this,gr).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Xt.batch(()=>{D(this,Xr).forEach(t=>{this.notify({type:"removed",mutation:t})}),D(this,Xr).clear(),D(this,gr).clear()})}getAll(){return Array.from(D(this,Xr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>eg(n,r))}findAll(t={}){return this.getAll().filter(n=>eg(t,n))}notify(t){Xt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Xt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Un))))}},Xr=new WeakMap,gr=new WeakMap,os=new WeakMap,Cy);function nl(e){var t;return(t=e.options.scope)==null?void 0:t.id}function cg(e){return{onFetch:(t,n)=>{var c,f,b,y,v;const r=t.options,o=(b=(f=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:f.fetchMore)==null?void 0:b.direction,i=((y=t.state.data)==null?void 0:y.pages)||[],a=((v=t.state.data)==null?void 0:v.pageParams)||[];let l={pages:[],pageParams:[]},s=0;const u=async()=>{let d=!1;const p=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?d=!0:t.signal.addEventListener("abort",()=>{d=!0}),t.signal)})},h=rg(t.options,t.fetchOptions),g=async(m,E,x)=>{if(d)return Promise.reject();if(E==null&&m.pages.length)return Promise.resolve(m);const A={client:t.client,queryKey:t.queryKey,pageParam:E,direction:x?"backward":"forward",meta:t.options.meta};p(A);const T=await h(A),{maxPages:C}=t.options,O=x?cI:uI;return{pages:O(m.pages,T,C),pageParams:O(m.pageParams,E,C)}};if(o&&i.length){const m=o==="backward",E=m?EI:dg,x={pages:i,pageParams:a},A=E(r,x);l=await g(x,A,m)}else{const m=e??i.length;do{const E=s===0?a[0]??r.initialPageParam:dg(r,l);if(s>0&&E==null)break;l=await g(l,E),s++}while(s<m)}return l};t.options.persister?t.fetchFn=()=>{var d,p;return(p=(d=t.options).persister)==null?void 0:p.call(d,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function dg(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 EI(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 xI=(wy=class{constructor(e={}){De(this,Nt);De(this,vo);De(this,yo);De(this,Xi);De(this,Zi);De(this,Eo);De(this,Yi);De(this,Ui);Ce(this,Nt,e.queryCache||new bI),Ce(this,vo,e.mutationCache||new yI),Ce(this,yo,e.defaultOptions||{}),Ce(this,Xi,new Map),Ce(this,Zi,new Map),Ce(this,Eo,0)}mount(){cu(this,Eo)._++,D(this,Eo)===1&&(Ce(this,Yi,pc.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,Nt).onFocus())})),Ce(this,Ui,tl.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,Nt).onOnline())})))}unmount(){var e,t;cu(this,Eo)._--,D(this,Eo)===0&&((e=D(this,Yi))==null||e.call(this),Ce(this,Yi,void 0),(t=D(this,Ui))==null||t.call(this),Ce(this,Ui,void 0))}isFetching(e){return D(this,Nt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return D(this,vo).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,Nt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=D(this,Nt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(mi(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return D(this,Nt).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=D(this,Nt).get(r.queryHash),i=o==null?void 0:o.state.data,a=sI(t,i);if(a!==void 0)return D(this,Nt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Xt.batch(()=>D(this,Nt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,Nt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=D(this,Nt);Xt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=D(this,Nt);return Xt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Xt.batch(()=>D(this,Nt).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Un).catch(Un)}invalidateQueries(e,t={}){return Xt.batch(()=>(D(this,Nt).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=Xt.batch(()=>D(this,Nt).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Un)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Un)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=D(this,Nt).build(this,t);return n.isStaleByTime(mi(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Un).catch(Un)}fetchInfiniteQuery(e){return e.behavior=cg(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Un).catch(Un)}ensureInfiniteQueryData(e){return e.behavior=cg(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return tl.isOnline()?D(this,vo).resumePausedMutations():Promise.resolve()}getQueryCache(){return D(this,Nt)}getMutationCache(){return D(this,vo)}getDefaultOptions(){return D(this,yo)}setDefaultOptions(e){Ce(this,yo,e)}setQueryDefaults(e,t){D(this,Xi).set(Vo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...D(this,Xi).values()],n={};return t.forEach(r=>{xa(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){D(this,Zi).set(Vo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...D(this,Zi).values()],n={};return t.forEach(r=>{xa(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...D(this,yo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=uc(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===el&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...D(this,yo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){D(this,Nt).clear(),D(this,vo).clear()}},Nt=new WeakMap,vo=new WeakMap,yo=new WeakMap,Xi=new WeakMap,Zi=new WeakMap,Eo=new WeakMap,Yi=new WeakMap,Ui=new WeakMap,wy),CI=(Iy=class extends gi{constructor(t,n){super();De(this,ft);De(this,On);De(this,Ze);De(this,is);De(this,En);De(this,ri);De(this,qi);De(this,xo);De(this,Lr);De(this,as);De(this,Ji);De(this,Qi);De(this,oi);De(this,ii);De(this,Co);De(this,$i,new Set);this.options=n,Ce(this,On,t),Ce(this,Lr,null),Ce(this,xo,hc()),this.options.experimental_prefetchInRender||D(this,xo).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&&(D(this,Ze).addObserver(this),fg(D(this,Ze),this.options)?We(this,ft,us).call(this):this.updateResult(),We(this,ft,kf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return mc(D(this,Ze),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return mc(D(this,Ze),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,We(this,ft,Lf).call(this),We(this,ft,Ff).call(this),D(this,Ze).removeObserver(this)}setOptions(t,n){const r=this.options,o=D(this,Ze);if(this.options=D(this,On).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof sr(this.options.enabled,D(this,Ze))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");We(this,ft,Mf).call(this),D(this,Ze).setOptions(this.options),r._defaulted&&!Ks(this.options,r)&&D(this,On).getQueryCache().notify({type:"observerOptionsUpdated",query:D(this,Ze),observer:this});const i=this.hasListeners();i&&pg(D(this,Ze),o,this.options,r)&&We(this,ft,us).call(this),this.updateResult(n),i&&(D(this,Ze)!==o||sr(this.options.enabled,D(this,Ze))!==sr(r.enabled,D(this,Ze))||mi(this.options.staleTime,D(this,Ze))!==mi(r.staleTime,D(this,Ze)))&&We(this,ft,Nf).call(this);const a=We(this,ft,Df).call(this);i&&(D(this,Ze)!==o||sr(this.options.enabled,D(this,Ze))!==sr(r.enabled,D(this,Ze))||a!==D(this,Co))&&We(this,ft,Pf).call(this,a)}getOptimisticResult(t){const n=D(this,On).getQueryCache().build(D(this,On),t),r=this.createResult(n,t);return II(this,r)&&(Ce(this,En,r),Ce(this,qi,this.options),Ce(this,ri,D(this,Ze).state)),r}getCurrentResult(){return D(this,En)}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){D(this,$i).add(t)}getCurrentQuery(){return D(this,Ze)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=D(this,On).defaultQueryOptions(t),r=D(this,On).getQueryCache().build(D(this,On),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return We(this,ft,us).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),D(this,En)))}createResult(t,n){var C;const r=D(this,Ze),o=this.options,i=D(this,En),a=D(this,ri),l=D(this,qi),u=t!==r?t.state:D(this,is),{state:c}=t;let f={...c},b=!1,y;if(n._optimisticResults){const O=this.hasListeners(),M=!O&&fg(t,n),B=O&&pg(t,r,n,o);(M||B)&&(f={...f,...lg(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:d,status:p}=f;if(n.select&&f.data!==void 0)if(i&&f.data===(a==null?void 0:a.data)&&n.select===D(this,as))y=D(this,Ji);else try{Ce(this,as,n.select),y=n.select(f.data),y=fc(i==null?void 0:i.data,y,n),Ce(this,Ji,y),Ce(this,Lr,null)}catch(O){Ce(this,Lr,O)}else y=f.data;if(n.placeholderData!==void 0&&y===void 0&&p==="pending"){let O;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))O=i.data;else if(O=typeof n.placeholderData=="function"?n.placeholderData((C=D(this,Qi))==null?void 0:C.state.data,D(this,Qi)):n.placeholderData,n.select&&O!==void 0)try{O=n.select(O),Ce(this,Lr,null)}catch(M){Ce(this,Lr,M)}O!==void 0&&(p="success",y=fc(i==null?void 0:i.data,O,n),b=!0)}D(this,Lr)&&(v=D(this,Lr),y=D(this,Ji),d=Date.now(),p="error");const h=f.fetchStatus==="fetching",g=p==="pending",m=p==="error",E=g&&h,x=y!==void 0,T={status:p,fetchStatus:f.fetchStatus,isPending:g,isSuccess:p==="success",isError:m,isInitialLoading:E,isLoading:E,data:y,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:d,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:h,isRefetching:h&&!g,isLoadingError:m&&!x,isPaused:f.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:m&&x,isStale:bc(t,n),refetch:this.refetch,promise:D(this,xo)};if(this.options.experimental_prefetchInRender){const O=U=>{T.status==="error"?U.reject(T.error):T.data!==void 0&&U.resolve(T.data)},M=()=>{const U=Ce(this,xo,T.promise=hc());O(U)},B=D(this,xo);switch(B.status){case"pending":t.queryHash===r.queryHash&&O(B);break;case"fulfilled":(T.status==="error"||T.data!==B.value)&&M();break;case"rejected":(T.status!=="error"||T.error!==B.reason)&&M();break}}return T}updateResult(t){const n=D(this,En),r=this.createResult(D(this,Ze),this.options);if(Ce(this,ri,D(this,Ze).state),Ce(this,qi,this.options),D(this,ri).data!==void 0&&Ce(this,Qi,D(this,Ze)),Ks(r,n))return;Ce(this,En,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,l=typeof a=="function"?a():a;if(l==="all"||!l&&!D(this,$i).size)return!0;const s=new Set(l??D(this,$i));return this.options.throwOnError&&s.add("error"),Object.keys(D(this,En)).some(u=>{const c=u;return D(this,En)[c]!==n[c]&&s.has(c)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),We(this,ft,_y).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&We(this,ft,kf).call(this)}},On=new WeakMap,Ze=new WeakMap,is=new WeakMap,En=new WeakMap,ri=new WeakMap,qi=new WeakMap,xo=new WeakMap,Lr=new WeakMap,as=new WeakMap,Ji=new WeakMap,Qi=new WeakMap,oi=new WeakMap,ii=new WeakMap,Co=new WeakMap,$i=new WeakMap,ft=new WeakSet,us=function(t){We(this,ft,Mf).call(this);let n=D(this,Ze).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Un)),n},Nf=function(){We(this,ft,Lf).call(this);const t=mi(this.options.staleTime,D(this,Ze));if(jo||D(this,En).isStale||!lc(t))return;const r=$h(D(this,En).dataUpdatedAt,t)+1;Ce(this,oi,setTimeout(()=>{D(this,En).isStale||this.updateResult()},r))},Df=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(D(this,Ze)):this.options.refetchInterval)??!1},Pf=function(t){We(this,ft,Ff).call(this),Ce(this,Co,t),!(jo||sr(this.options.enabled,D(this,Ze))===!1||!lc(D(this,Co))||D(this,Co)===0)&&Ce(this,ii,setInterval(()=>{(this.options.refetchIntervalInBackground||pc.isFocused())&&We(this,ft,us).call(this)},D(this,Co)))},kf=function(){We(this,ft,Nf).call(this),We(this,ft,Pf).call(this,We(this,ft,Df).call(this))},Lf=function(){D(this,oi)&&(clearTimeout(D(this,oi)),Ce(this,oi,void 0))},Ff=function(){D(this,ii)&&(clearInterval(D(this,ii)),Ce(this,ii,void 0))},Mf=function(){const t=D(this,On).getQueryCache().build(D(this,On),this.options);if(t===D(this,Ze))return;const n=D(this,Ze);Ce(this,Ze,t),Ce(this,is,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},_y=function(t){Xt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(D(this,En))}),D(this,On).getQueryCache().notify({query:D(this,Ze),type:"observerResultsUpdated"})})},Iy);function wI(e,t){return sr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function fg(e,t){return wI(e,t)||e.state.data!==void 0&&mc(e,t,t.refetchOnMount)}function mc(e,t,n){if(sr(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&bc(e,t)}return!1}function pg(e,t,n,r){return(e!==t||sr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&bc(e,n)}function bc(e,t){return sr(t.enabled,e)!==!1&&e.isStaleByTime(mi(t.staleTime,e))}function II(e,t){return!Ks(e.getCurrentResult(),t)}var SI=(Sy=class extends gi{constructor(t,n){super();De(this,Yr);De(this,wo);De(this,Io);De(this,Rn);De(this,Zr);Ce(this,wo,t),this.setOptions(n),this.bindMethods(),We(this,Yr,du).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=D(this,wo).defaultMutationOptions(t),Ks(this.options,n)||D(this,wo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:D(this,Rn),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Vo(n.mutationKey)!==Vo(this.options.mutationKey)?this.reset():((r=D(this,Rn))==null?void 0:r.state.status)==="pending"&&D(this,Rn).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=D(this,Rn))==null||t.removeObserver(this)}onMutationUpdate(t){We(this,Yr,du).call(this),We(this,Yr,Bf).call(this,t)}getCurrentResult(){return D(this,Io)}reset(){var t;(t=D(this,Rn))==null||t.removeObserver(this),Ce(this,Rn,void 0),We(this,Yr,du).call(this),We(this,Yr,Bf).call(this)}mutate(t,n){var r;return Ce(this,Zr,n),(r=D(this,Rn))==null||r.removeObserver(this),Ce(this,Rn,D(this,wo).getMutationCache().build(D(this,wo),this.options)),D(this,Rn).addObserver(this),D(this,Rn).execute(t)}},wo=new WeakMap,Io=new WeakMap,Rn=new WeakMap,Zr=new WeakMap,Yr=new WeakSet,du=function(){var n;const t=((n=D(this,Rn))==null?void 0:n.state)??ug();Ce(this,Io,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Bf=function(t){Xt.batch(()=>{var n,r,o,i,a,l,s,u;if(D(this,Zr)&&this.hasListeners()){const c=D(this,Io).variables,f=D(this,Io).context;(t==null?void 0:t.type)==="success"?((r=(n=D(this,Zr)).onSuccess)==null||r.call(n,t.data,c,f),(i=(o=D(this,Zr)).onSettled)==null||i.call(o,t.data,null,c,f)):(t==null?void 0:t.type)==="error"&&((l=(a=D(this,Zr)).onError)==null||l.call(a,t.error,c,f),(u=(s=D(this,Zr)).onSettled)==null||u.call(s,void 0,t.error,c,f))}this.listeners.forEach(c=>{c(D(this,Io))})})},Sy),hg=P.createContext(void 0),rl=e=>{const t=P.useContext(hg);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},TI=({client:e,children:t})=>(P.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),I.jsx(hg.Provider,{value:e,children:t})),gg=P.createContext(!1),AI=()=>P.useContext(gg);gg.Provider;function _I(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var OI=P.createContext(_I()),RI=()=>P.useContext(OI);function mg(e,t){return typeof e=="function"?e(...t):!!e}function vc(){}var NI=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},DI=e=>{P.useEffect(()=>{e.clearReset()},[e])},PI=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||mg(n,[e.error,r])),kI=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)))},LI=(e,t)=>e.isLoading&&e.isFetching&&!t,FI=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,bg=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function MI(e,t,n){var f,b,y,v,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=rl(),o=AI(),i=RI(),a=r.defaultQueryOptions(e);(b=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||b.call(f,a),process.env.NODE_ENV!=="production"&&(a.queryFn||console.error(`[${a.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`)),a._optimisticResults=o?"isRestoring":"optimistic",kI(a),NI(a,i),DI(i);const l=!r.getQueryCache().get(a.queryHash),[s]=P.useState(()=>new t(r,a)),u=s.getOptimisticResult(a),c=!o&&e.subscribed!==!1;if(P.useSyncExternalStore(P.useCallback(p=>{const h=c?s.subscribe(Xt.batchCalls(p)):vc;return s.updateResult(),h},[s,c]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),P.useEffect(()=>{s.setOptions(a,{listeners:!1})},[a,s]),FI(a,u))throw bg(a,s,i);if(PI({result:u,errorResetBoundary:i,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((v=(y=r.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||v.call(y,a,u),a.experimental_prefetchInRender&&!jo&&LI(u,o)){const p=l?bg(a,s,i):(d=r.getQueryCache().get(a.queryHash))==null?void 0:d.promise;p==null||p.catch(vc).finally(()=>{s.updateResult()})}return a.notifyOnChangeProps?u:s.trackResult(u)}function vg(e,t){return MI(e,CI)}function BI(e,t){const n=rl(),[r]=P.useState(()=>new SI(n,e));P.useEffect(()=>{r.setOptions(e)},[r,e]);const o=P.useSyncExternalStore(P.useCallback(a=>r.subscribe(Xt.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=P.useCallback((a,l)=>{r.mutate(a,l).catch(vc)},[r]);if(o.error&&mg(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}const jI=({children:e})=>{const t=new xI;return I.jsx(TI,{client:t,children:e})},VI=e=>I.jsx(w.HiverProvider,{custom:!0,children:I.jsx(S.Suspense,{fallback:I.jsx(I.Fragment,{}),children:I.jsx(jI,{children:I.jsx(aI,{...e})})})}),GI=e=>I.jsx(s1,{store:rI,children:I.jsx(VI,{...e})});/**
|
|
68
68
|
* @remix-run/router v1.19.2
|
|
69
69
|
*
|
|
70
70
|
* Copyright (c) Remix Software Inc.
|
|
@@ -73,9 +73,9 @@ Take a look at the reducer(s) handling this action type: ${y.type}.
|
|
|
73
73
|
* LICENSE.md file in the root directory of this source tree.
|
|
74
74
|
*
|
|
75
75
|
* @license MIT
|
|
76
|
-
*/function It(){return It=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},It.apply(this,arguments)}var Mt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Mt||(Mt={}));const yg="popstate";function WI(e){e===void 0&&(e={});function t(r,o){let{pathname:i,search:a,hash:l}=r.location;return Ca("",{pathname:i,search:a,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:no(o)}return zI(t,n,null,e)}function Oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Xt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function HI(){return Math.random().toString(36).substr(2,8)}function Eg(e,t){return{usr:e.state,key:e.key,idx:t}}function Ca(e,t,n,r){return n===void 0&&(n=null),It({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ro(t):t,{state:n,key:t&&t.key||r||HI()})}function no(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function ro(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function zI(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,l=Mt.Pop,s=null,u=c();u==null&&(u=0,a.replaceState(It({},a.state,{idx:u}),""));function c(){return(a.state||{idx:null}).idx}function f(){l=Mt.Pop;let p=c(),h=p==null?null:p-u;u=p,s&&s({action:l,location:d.location,delta:h})}function b(p,h){l=Mt.Push;let g=Ca(d.location,p,h);u=c()+1;let m=Eg(g,u),E=d.createHref(g);try{a.pushState(m,"",E)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;o.location.assign(E)}i&&s&&s({action:l,location:d.location,delta:1})}function y(p,h){l=Mt.Replace;let g=Ca(d.location,p,h);u=c();let m=Eg(g,u),E=d.createHref(g);a.replaceState(m,"",E),i&&s&&s({action:l,location:d.location,delta:0})}function v(p){let h=o.location.origin!=="null"?o.location.origin:o.location.href,g=typeof p=="string"?p:no(p);return g=g.replace(/ $/,"%20"),Oe(h,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,h)}let d={get action(){return l},get location(){return e(o,a)},listen(p){if(s)throw new Error("A history only accepts one active listener");return o.addEventListener(yg,f),s=p,()=>{o.removeEventListener(yg,f),s=null}},createHref(p){return t(o,p)},createURL:v,encodeLocation(p){let h=v(p);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:b,replace:y,go(p){return a.go(p)}};return d}var gt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(gt||(gt={}));const XI=new Set(["lazy","caseSensitive","path","id","index","children"]);function ZI(e){return e.index===!0}function wa(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let a=[...n,String(i)],l=typeof o.id=="string"?o.id:a.join("-");if(Oe(o.index!==!0||!o.children,"Cannot specify children on an index route"),Oe(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),ZI(o)){let s=It({},o,t(o),{id:l});return r[l]=s,s}else{let s=It({},o,t(o),{id:l,children:void 0});return r[l]=s,o.children&&(s.children=wa(o.children,t,a,r)),s}})}function Go(e,t,n){return n===void 0&&(n="/"),ol(e,t,n,!1)}function ol(e,t,n,r){let o=typeof t=="string"?ro(t):t,i=lr(o.pathname||"/",n);if(i==null)return null;let a=xg(e);UI(a);let l=null;for(let s=0;l==null&&s<a.length;++s){let u=iS(i);l=rS(a[s],u,r)}return l}function YI(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}function xg(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(i,a,l)=>{let s={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};s.relativePath.startsWith("/")&&(Oe(s.relativePath.startsWith(r),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(r.length));let u=Er([r,s.relativePath]),c=n.concat(s);i.children&&i.children.length>0&&(Oe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),xg(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:tS(u,i.index),routesMeta:c})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,a);else for(let s of Cg(i.path))o(i,a,s)}),t}function Cg(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=Cg(r.join("/")),l=[];return l.push(...a.map(s=>s===""?i:[i,s].join("/"))),o&&l.push(...a),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function UI(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:nS(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const qI=/^:[\w-]+$/,JI=3,QI=2,$I=1,KI=10,eS=-2,wg=e=>e==="*";function tS(e,t){let n=e.split("/"),r=n.length;return n.some(wg)&&(r+=eS),t&&(r+=QI),n.filter(o=>!wg(o)).reduce((o,i)=>o+(qI.test(i)?JI:i===""?$I:KI),r)}function nS(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function rS(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},i="/",a=[];for(let l=0;l<r.length;++l){let s=r[l],u=l===r.length-1,c=i==="/"?t:t.slice(i.length)||"/",f=il({path:s.relativePath,caseSensitive:s.caseSensitive,end:u},c),b=s.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=il({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!f)return null;Object.assign(o,f.params),a.push({params:o,pathname:Er([i,f.pathname]),pathnameBase:lS(Er([i,f.pathnameBase])),route:b}),f.pathnameBase!=="/"&&(i=Er([i,f.pathnameBase]))}return a}function il(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=oS(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:r.reduce((u,c,f)=>{let{paramName:b,isOptional:y}=c;if(b==="*"){let d=l[f]||"";a=i.slice(0,i.length-d.length).replace(/(.)\/+$/,"$1")}const v=l[f];return y&&!v?u[b]=void 0:u[b]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:a,pattern:e}}function oS(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Xt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,s)=>(r.push({paramName:l,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function iS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Xt(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function lr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function aS(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?ro(e):e;return{pathname:n?n.startsWith("/")?n:sS(n,t):t,search:uS(r),hash:cS(o)}}function sS(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function yc(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ig(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ec(e,t){let n=Ig(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function xc(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=ro(e):(o=It({},e),Oe(!o.pathname||!o.pathname.includes("?"),yc("?","pathname","search",o)),Oe(!o.pathname||!o.pathname.includes("#"),yc("#","pathname","hash",o)),Oe(!o.search||!o.search.includes("#"),yc("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,l;if(a==null)l=n;else{let f=t.length-1;if(!r&&a.startsWith("..")){let b=a.split("/");for(;b[0]==="..";)b.shift(),f-=1;o.pathname=b.join("/")}l=f>=0?t[f]:"/"}let s=aS(o,l),u=a&&a!=="/"&&a.endsWith("/"),c=(i||a===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}const Er=e=>e.join("/").replace(/\/\/+/g,"/"),lS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),uS=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,cS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class al{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function sl(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Sg=["post","put","patch","delete"],dS=new Set(Sg),fS=["get",...Sg],pS=new Set(fS),hS=new Set([301,302,303,307,308]),gS=new Set([307,308]),Cc={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},mS={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ia={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},wc=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bS=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Tg="remix-router-transitions";function vS(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Oe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let R=e.detectErrorBoundary;o=k=>({hasErrorBoundary:R(k)})}else o=bS;let i={},a=wa(e.routes,o,void 0,i),l,s=e.basename||"/",u=e.unstable_dataStrategy||IS,c=e.unstable_patchRoutesOnNavigation,f=It({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),b=null,y=new Set,v=1e3,d=new Set,p=null,h=null,g=null,m=e.hydrationData!=null,E=Go(a,e.history.location,s),x=null;if(E==null&&!c){let R=bn(404,{pathname:e.history.location.pathname}),{matches:k,route:j}=Mg(a);E=k,x={[j.id]:R}}E&&!e.hydrationData&&Wt(E,a,e.history.location.pathname).active&&(E=null);let A;if(E)if(E.some(R=>R.route.lazy))A=!1;else if(!E.some(R=>R.route.loader))A=!0;else if(f.v7_partialHydration){let R=e.hydrationData?e.hydrationData.loaderData:null,k=e.hydrationData?e.hydrationData.errors:null,j=_=>_.route.loader?typeof _.route.loader=="function"&&_.route.loader.hydrate===!0?!1:R&&R[_.route.id]!==void 0||k&&k[_.route.id]!==void 0:!0;if(k){let _=E.findIndex(F=>k[F.route.id]!==void 0);A=E.slice(0,_+1).every(j)}else A=E.every(j)}else A=e.hydrationData!=null;else if(A=!1,E=[],f.v7_partialHydration){let R=Wt(null,a,e.history.location.pathname);R.active&&R.matches&&(E=R.matches)}let T,C={historyAction:e.history.action,location:e.history.location,matches:E,initialized:A,navigation:Cc,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||x,fetchers:new Map,blockers:new Map},O=Mt.Pop,M=!1,B,U=!1,G=new Map,X=null,q=!1,$=!1,ue=[],se=new Set,ve=new Map,W=0,te=-1,re=new Map,K=new Set,oe=new Map,de=new Map,ie=new Set,ge=new Map,Ee=new Map,Ae=new Map,me;function ze(){if(b=e.history.listen(R=>{let{action:k,location:j,delta:_}=R;if(me){me(),me=void 0;return}Xt(Ee.size===0||_!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let F=ht({currentLocation:C.location,nextLocation:j,historyAction:k});if(F&&_!=null){let J=new Promise(ce=>{me=ce});e.history.go(_*-1),$e(F,{state:"blocked",location:j,proceed(){$e(F,{state:"proceeding",proceed:void 0,reset:void 0,location:j}),J.then(()=>e.history.go(_))},reset(){let ce=new Map(C.blockers);ce.set(F,Ia),Le({blockers:ce})}});return}return kt(k,j)}),n){jS(t,G);let R=()=>VS(t,G);t.addEventListener("pagehide",R),X=()=>t.removeEventListener("pagehide",R)}return C.initialized||kt(Mt.Pop,C.location,{initialHydration:!0}),T}function V(){b&&b(),X&&X(),y.clear(),B&&B.abort(),C.fetchers.forEach((R,k)=>Fr(k)),C.blockers.forEach((R,k)=>wt(k))}function Ye(R){return y.add(R),()=>y.delete(R)}function Le(R,k){k===void 0&&(k={}),C=It({},C,R);let j=[],_=[];f.v7_fetcherPersist&&C.fetchers.forEach((F,J)=>{F.state==="idle"&&(ie.has(J)?_.push(J):j.push(J))}),[...y].forEach(F=>F(C,{deletedFetchers:_,unstable_viewTransitionOpts:k.viewTransitionOpts,unstable_flushSync:k.flushSync===!0})),f.v7_fetcherPersist&&(j.forEach(F=>C.fetchers.delete(F)),_.forEach(F=>Fr(F)))}function Ue(R,k,j){var _,F;let{flushSync:J}=j===void 0?{}:j,ce=C.actionData!=null&&C.navigation.formMethod!=null&&ur(C.navigation.formMethod)&&C.navigation.state==="loading"&&((_=R.state)==null?void 0:_._isRedirect)!==!0,ne;k.actionData?Object.keys(k.actionData).length>0?ne=k.actionData:ne=null:ce?ne=C.actionData:ne=null;let be=k.loaderData?Lg(C.loaderData,k.loaderData,k.matches||[],k.errors):C.loaderData,le=C.blockers;le.size>0&&(le=new Map(le),le.forEach((Ne,Fe)=>le.set(Fe,Ia)));let ae=M===!0||C.navigation.formMethod!=null&&ur(C.navigation.formMethod)&&((F=R.state)==null?void 0:F._isRedirect)!==!0;l&&(a=l,l=void 0),q||O===Mt.Pop||(O===Mt.Push?e.history.push(R,R.state):O===Mt.Replace&&e.history.replace(R,R.state));let ke;if(O===Mt.Pop){let Ne=G.get(C.location.pathname);Ne&&Ne.has(R.pathname)?ke={currentLocation:C.location,nextLocation:R}:G.has(R.pathname)&&(ke={currentLocation:R,nextLocation:C.location})}else if(U){let Ne=G.get(C.location.pathname);Ne?Ne.add(R.pathname):(Ne=new Set([R.pathname]),G.set(C.location.pathname,Ne)),ke={currentLocation:C.location,nextLocation:R}}Le(It({},k,{actionData:ne,loaderData:be,historyAction:O,location:R,initialized:!0,navigation:Cc,revalidation:"idle",restoreScrollPosition:Pn(R,k.matches||C.matches),preventScrollReset:ae,blockers:le}),{viewTransitionOpts:ke,flushSync:J===!0}),O=Mt.Pop,M=!1,U=!1,q=!1,$=!1,ue=[]}async function Pt(R,k){if(typeof R=="number"){e.history.go(R);return}let j=Ic(C.location,C.matches,s,f.v7_prependBasename,R,f.v7_relativeSplatPath,k==null?void 0:k.fromRouteId,k==null?void 0:k.relative),{path:_,submission:F,error:J}=Ag(f.v7_normalizeFormMethod,!1,j,k),ce=C.location,ne=Ca(C.location,_,k&&k.state);ne=It({},ne,e.history.encodeLocation(ne));let be=k&&k.replace!=null?k.replace:void 0,le=Mt.Push;be===!0?le=Mt.Replace:be===!1||F!=null&&ur(F.formMethod)&&F.formAction===C.location.pathname+C.location.search&&(le=Mt.Replace);let ae=k&&"preventScrollReset"in k?k.preventScrollReset===!0:void 0,ke=(k&&k.unstable_flushSync)===!0,Ne=ht({currentLocation:ce,nextLocation:ne,historyAction:le});if(Ne){$e(Ne,{state:"blocked",location:ne,proceed(){$e(Ne,{state:"proceeding",proceed:void 0,reset:void 0,location:ne}),Pt(R,k)},reset(){let Fe=new Map(C.blockers);Fe.set(Ne,Ia),Le({blockers:Fe})}});return}return await kt(le,ne,{submission:F,pendingError:J,preventScrollReset:ae,replace:k&&k.replace,enableViewTransition:k&&k.unstable_viewTransition,flushSync:ke})}function Nn(){if(dn(),Le({revalidation:"loading"}),C.navigation.state!=="submitting"){if(C.navigation.state==="idle"){kt(C.historyAction,C.location,{startUninterruptedRevalidation:!0});return}kt(O||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation,enableViewTransition:U===!0})}}async function kt(R,k,j){B&&B.abort(),B=null,O=R,q=(j&&j.startUninterruptedRevalidation)===!0,Kt(C.location,C.matches),M=(j&&j.preventScrollReset)===!0,U=(j&&j.enableViewTransition)===!0;let _=l||a,F=j&&j.overrideNavigation,J=Go(_,k,s),ce=(j&&j.flushSync)===!0,ne=Wt(J,_,k.pathname);if(ne.active&&ne.matches&&(J=ne.matches),!J){let{error:Me,notFoundMatches:bt,route:ot}=At(k.pathname);Ue(k,{matches:bt,loaderData:{},errors:{[ot.id]:Me}},{flushSync:ce});return}if(C.initialized&&!$&&RS(C.location,k)&&!(j&&j.submission&&ur(j.submission.formMethod))){Ue(k,{matches:J},{flushSync:ce});return}B=new AbortController;let be=bi(e.history,k,B.signal,j&&j.submission),le;if(j&&j.pendingError)le=[vi(J).route.id,{type:gt.error,error:j.pendingError}];else if(j&&j.submission&&ur(j.submission.formMethod)){let Me=await Ut(be,k,j.submission,J,ne.active,{replace:j.replace,flushSync:ce});if(Me.shortCircuited)return;if(Me.pendingActionResult){let[bt,ot]=Me.pendingActionResult;if(Wn(ot)&&sl(ot.error)&&ot.error.status===404){B=null,Ue(k,{matches:Me.matches,loaderData:{},errors:{[bt]:ot.error}});return}}J=Me.matches||J,le=Me.pendingActionResult,F=_c(k,j.submission),ce=!1,ne.active=!1,be=bi(e.history,be.url,be.signal)}let{shortCircuited:ae,matches:ke,loaderData:Ne,errors:Fe}=await mt(be,k,J,ne.active,F,j&&j.submission,j&&j.fetcherSubmission,j&&j.replace,j&&j.initialHydration===!0,ce,le);ae||(B=null,Ue(k,It({matches:ke||J},Fg(le),{loaderData:Ne,errors:Fe})))}async function Ut(R,k,j,_,F,J){J===void 0&&(J={}),dn();let ce=MS(k,j);if(Le({navigation:ce},{flushSync:J.flushSync===!0}),F){let le=await xt(_,k.pathname,R.signal);if(le.type==="aborted")return{shortCircuited:!0};if(le.type==="error"){let{boundaryId:ae,error:ke}=_t(k.pathname,le);return{matches:le.partialMatches,pendingActionResult:[ae,{type:gt.error,error:ke}]}}else if(le.matches)_=le.matches;else{let{notFoundMatches:ae,error:ke,route:Ne}=At(k.pathname);return{matches:ae,pendingActionResult:[Ne.id,{type:gt.error,error:ke}]}}}let ne,be=Sa(_,k);if(!be.route.action&&!be.route.lazy)ne={type:gt.error,error:bn(405,{method:R.method,pathname:k.pathname,routeId:be.route.id})};else if(ne=(await Vt("action",C,R,[be],_,null))[be.route.id],R.signal.aborted)return{shortCircuited:!0};if(Wo(ne)){let le;return J&&J.replace!=null?le=J.replace:le=Dg(ne.response.headers.get("Location"),new URL(R.url),s)===C.location.pathname+C.location.search,await Dn(R,ne,!0,{submission:j,replace:le}),{shortCircuited:!0}}if(oo(ne))throw bn(400,{type:"defer-action"});if(Wn(ne)){let le=vi(_,be.route.id);return(J&&J.replace)!==!0&&(O=Mt.Push),{matches:_,pendingActionResult:[le.route.id,ne]}}return{matches:_,pendingActionResult:[be.route.id,ne]}}async function mt(R,k,j,_,F,J,ce,ne,be,le,ae){let ke=F||_c(k,J),Ne=J||ce||Gg(ke),Fe=!q&&(!f.v7_partialHydration||!be);if(_){if(Fe){let z=zn(ae);Le(It({navigation:ke},z!==void 0?{actionData:z}:{}),{flushSync:le})}let L=await xt(j,k.pathname,R.signal);if(L.type==="aborted")return{shortCircuited:!0};if(L.type==="error"){let{boundaryId:z,error:Q}=_t(k.pathname,L);return{matches:L.partialMatches,loaderData:{},errors:{[z]:Q}}}else if(L.matches)j=L.matches;else{let{error:z,notFoundMatches:Q,route:ee}=At(k.pathname);return{matches:Q,loaderData:{},errors:{[ee.id]:z}}}}let Me=l||a,[bt,ot]=_g(e.history,C,j,Ne,k,f.v7_partialHydration&&be===!0,f.v7_skipActionErrorRevalidation,$,ue,se,ie,oe,K,Me,s,ae);if(rn(L=>!(j&&j.some(z=>z.route.id===L))||bt&&bt.some(z=>z.route.id===L)),te=++W,bt.length===0&&ot.length===0){let L=we();return Ue(k,It({matches:j,loaderData:{},errors:ae&&Wn(ae[1])?{[ae[0]]:ae[1].error}:null},Fg(ae),L?{fetchers:new Map(C.fetchers)}:{}),{flushSync:le}),{shortCircuited:!0}}if(Fe){let L={};if(!_){L.navigation=ke;let z=zn(ae);z!==void 0&&(L.actionData=z)}ot.length>0&&(L.fetchers=cn(ot)),Le(L,{flushSync:le})}ot.forEach(L=>{ve.has(L.key)&&pn(L.key),L.controller&&ve.set(L.key,L.controller)});let Dt=()=>ot.forEach(L=>pn(L.key));B&&B.signal.addEventListener("abort",Dt);let{loaderResults:gn,fetcherResults:Mr}=await Xn(C,j,bt,ot,R);if(R.signal.aborted)return{shortCircuited:!0};B&&B.signal.removeEventListener("abort",Dt),ot.forEach(L=>ve.delete(L.key));let tr=ll(gn);if(tr)return await Dn(R,tr.result,!0,{replace:ne}),{shortCircuited:!0};if(tr=ll(Mr),tr)return K.add(tr.key),await Dn(R,tr.result,!0,{replace:ne}),{shortCircuited:!0};let{loaderData:Ki,errors:nr}=kg(C,j,bt,gn,ae,ot,Mr,ge);ge.forEach((L,z)=>{L.subscribe(Q=>{(Q||L.done)&&ge.delete(z)})}),f.v7_partialHydration&&be&&C.errors&&Object.entries(C.errors).filter(L=>{let[z]=L;return!bt.some(Q=>Q.route.id===z)}).forEach(L=>{let[z,Q]=L;nr=Object.assign(nr||{},{[z]:Q})});let Z=we(),N=mr(te),H=Z||N||ot.length>0;return It({matches:j,loaderData:Ki,errors:nr},H?{fetchers:new Map(C.fetchers)}:{})}function zn(R){if(R&&!Wn(R[1]))return{[R[0]]:R[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function cn(R){return R.forEach(k=>{let j=C.fetchers.get(k.key),_=Ta(void 0,j?j.data:void 0);C.fetchers.set(k.key,_)}),new Map(C.fetchers)}function So(R,k,j,_){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");ve.has(R)&&pn(R);let F=(_&&_.unstable_flushSync)===!0,J=l||a,ce=Ic(C.location,C.matches,s,f.v7_prependBasename,j,f.v7_relativeSplatPath,k,_==null?void 0:_.relative),ne=Go(J,ce,s),be=Wt(ne,J,ce);if(be.active&&be.matches&&(ne=be.matches),!ne){Ct(R,k,bn(404,{pathname:ce}),{flushSync:F});return}let{path:le,submission:ae,error:ke}=Ag(f.v7_normalizeFormMethod,!0,ce,_);if(ke){Ct(R,k,ke,{flushSync:F});return}let Ne=Sa(ne,le);if(M=(_&&_.preventScrollReset)===!0,ae&&ur(ae.formMethod)){To(R,k,le,Ne,ne,be.active,F,ae);return}oe.set(R,{routeId:k,path:le}),Ao(R,k,le,Ne,ne,be.active,F,ae)}async function To(R,k,j,_,F,J,ce,ne){dn(),oe.delete(R);function be(ee){if(!ee.route.action&&!ee.route.lazy){let pe=bn(405,{method:ne.formMethod,pathname:j,routeId:k});return Ct(R,k,pe,{flushSync:ce}),!0}return!1}if(!J&&be(_))return;let le=C.fetchers.get(R);fn(R,BS(ne,le),{flushSync:ce});let ae=new AbortController,ke=bi(e.history,j,ae.signal,ne);if(J){let ee=await xt(F,j,ke.signal);if(ee.type==="aborted")return;if(ee.type==="error"){let{error:pe}=_t(j,ee);Ct(R,k,pe,{flushSync:ce});return}else if(ee.matches){if(F=ee.matches,_=Sa(F,j),be(_))return}else{Ct(R,k,bn(404,{pathname:j}),{flushSync:ce});return}}ve.set(R,ae);let Ne=W,Me=(await Vt("action",C,ke,[_],F,R))[_.route.id];if(ke.signal.aborted){ve.get(R)===ae&&ve.delete(R);return}if(f.v7_fetcherPersist&&ie.has(R)){if(Wo(Me)||Wn(Me)){fn(R,io(void 0));return}}else{if(Wo(Me))if(ve.delete(R),te>Ne){fn(R,io(void 0));return}else return K.add(R),fn(R,Ta(ne)),Dn(ke,Me,!1,{fetcherSubmission:ne});if(Wn(Me)){Ct(R,k,Me.error);return}}if(oo(Me))throw bn(400,{type:"defer-action"});let bt=C.navigation.location||C.location,ot=bi(e.history,bt,ae.signal),Dt=l||a,gn=C.navigation.state!=="idle"?Go(Dt,C.navigation.location,s):C.matches;Oe(gn,"Didn't find any matches after fetcher action");let Mr=++W;re.set(R,Mr);let tr=Ta(ne,Me.data);C.fetchers.set(R,tr);let[Ki,nr]=_g(e.history,C,gn,ne,bt,!1,f.v7_skipActionErrorRevalidation,$,ue,se,ie,oe,K,Dt,s,[_.route.id,Me]);nr.filter(ee=>ee.key!==R).forEach(ee=>{let pe=ee.key,fe=C.fetchers.get(pe),he=Ta(void 0,fe?fe.data:void 0);C.fetchers.set(pe,he),ve.has(pe)&&pn(pe),ee.controller&&ve.set(pe,ee.controller)}),Le({fetchers:new Map(C.fetchers)});let Z=()=>nr.forEach(ee=>pn(ee.key));ae.signal.addEventListener("abort",Z);let{loaderResults:N,fetcherResults:H}=await Xn(C,gn,Ki,nr,ot);if(ae.signal.aborted)return;ae.signal.removeEventListener("abort",Z),re.delete(R),ve.delete(R),nr.forEach(ee=>ve.delete(ee.key));let L=ll(N);if(L)return Dn(ot,L.result,!1);if(L=ll(H),L)return K.add(L.key),Dn(ot,L.result,!1);let{loaderData:z,errors:Q}=kg(C,gn,Ki,N,void 0,nr,H,ge);if(C.fetchers.has(R)){let ee=io(Me.data);C.fetchers.set(R,ee)}mr(Mr),C.navigation.state==="loading"&&Mr>te?(Oe(O,"Expected pending action"),B&&B.abort(),Ue(C.navigation.location,{matches:gn,loaderData:z,errors:Q,fetchers:new Map(C.fetchers)})):(Le({errors:Q,loaderData:Lg(C.loaderData,z,gn,Q),fetchers:new Map(C.fetchers)}),$=!1)}async function Ao(R,k,j,_,F,J,ce,ne){let be=C.fetchers.get(R);fn(R,Ta(ne,be?be.data:void 0),{flushSync:ce});let le=new AbortController,ae=bi(e.history,j,le.signal);if(J){let Me=await xt(F,j,ae.signal);if(Me.type==="aborted")return;if(Me.type==="error"){let{error:bt}=_t(j,Me);Ct(R,k,bt,{flushSync:ce});return}else if(Me.matches)F=Me.matches,_=Sa(F,j);else{Ct(R,k,bn(404,{pathname:j}),{flushSync:ce});return}}ve.set(R,le);let ke=W,Fe=(await Vt("loader",C,ae,[_],F,R))[_.route.id];if(oo(Fe)&&(Fe=await Tc(Fe,ae.signal,!0)||Fe),ve.get(R)===le&&ve.delete(R),!ae.signal.aborted){if(ie.has(R)){fn(R,io(void 0));return}if(Wo(Fe))if(te>ke){fn(R,io(void 0));return}else{K.add(R),await Dn(ae,Fe,!1);return}if(Wn(Fe)){Ct(R,k,Fe.error);return}Oe(!oo(Fe),"Unhandled fetcher deferred data"),fn(R,io(Fe.data))}}async function Dn(R,k,j,_){let{submission:F,fetcherSubmission:J,replace:ce}=_===void 0?{}:_;k.response.headers.has("X-Remix-Revalidate")&&($=!0);let ne=k.response.headers.get("Location");Oe(ne,"Expected a Location header on the redirect Response"),ne=Dg(ne,new URL(R.url),s);let be=Ca(C.location,ne,{_isRedirect:!0});if(n){let Me=!1;if(k.response.headers.has("X-Remix-Reload-Document"))Me=!0;else if(wc.test(ne)){const bt=e.history.createURL(ne);Me=bt.origin!==t.location.origin||lr(bt.pathname,s)==null}if(Me){ce?t.location.replace(ne):t.location.assign(ne);return}}B=null;let le=ce===!0||k.response.headers.has("X-Remix-Replace")?Mt.Replace:Mt.Push,{formMethod:ae,formAction:ke,formEncType:Ne}=C.navigation;!F&&!J&&ae&&ke&&Ne&&(F=Gg(C.navigation));let Fe=F||J;if(gS.has(k.response.status)&&Fe&&ur(Fe.formMethod))await kt(le,be,{submission:It({},Fe,{formAction:ne}),preventScrollReset:M,enableViewTransition:j?U:void 0});else{let Me=_c(be,F);await kt(le,be,{overrideNavigation:Me,fetcherSubmission:J,preventScrollReset:M,enableViewTransition:j?U:void 0})}}async function Vt(R,k,j,_,F,J){let ce,ne={};try{ce=await SS(u,R,k,j,_,F,J,i,o)}catch(be){return _.forEach(le=>{ne[le.route.id]={type:gt.error,error:be}}),ne}for(let[be,le]of Object.entries(ce))if(DS(le)){let ae=le.result;ne[be]={type:gt.redirect,response:_S(ae,j,be,F,s,f.v7_relativeSplatPath)}}else ne[be]=await AS(le);return ne}async function Xn(R,k,j,_,F){let J=R.matches,ce=Vt("loader",R,F,j,k,null),ne=Promise.all(_.map(async ae=>{if(ae.matches&&ae.match&&ae.controller){let Ne=(await Vt("loader",R,bi(e.history,ae.path,ae.controller.signal),[ae.match],ae.matches,ae.key))[ae.match.route.id];return{[ae.key]:Ne}}else return Promise.resolve({[ae.key]:{type:gt.error,error:bn(404,{pathname:ae.path})}})})),be=await ce,le=(await ne).reduce((ae,ke)=>Object.assign(ae,ke),{});return await Promise.all([LS(k,be,F.signal,J,R.loaderData),FS(k,le,_)]),{loaderResults:be,fetcherResults:le}}function dn(){$=!0,ue.push(...rn()),oe.forEach((R,k)=>{ve.has(k)&&(se.add(k),pn(k))})}function fn(R,k,j){j===void 0&&(j={}),C.fetchers.set(R,k),Le({fetchers:new Map(C.fetchers)},{flushSync:(j&&j.flushSync)===!0})}function Ct(R,k,j,_){_===void 0&&(_={});let F=vi(C.matches,k);Fr(R),Le({errors:{[F.route.id]:j},fetchers:new Map(C.fetchers)},{flushSync:(_&&_.flushSync)===!0})}function Ur(R){return f.v7_fetcherPersist&&(de.set(R,(de.get(R)||0)+1),ie.has(R)&&ie.delete(R)),C.fetchers.get(R)||mS}function Fr(R){let k=C.fetchers.get(R);ve.has(R)&&!(k&&k.state==="loading"&&re.has(R))&&pn(R),oe.delete(R),re.delete(R),K.delete(R),ie.delete(R),se.delete(R),C.fetchers.delete(R)}function _o(R){if(f.v7_fetcherPersist){let k=(de.get(R)||0)-1;k<=0?(de.delete(R),ie.add(R)):de.set(R,k)}else Fr(R);Le({fetchers:new Map(C.fetchers)})}function pn(R){let k=ve.get(R);Oe(k,"Expected fetch controller: "+R),k.abort(),ve.delete(R)}function qr(R){for(let k of R){let j=Ur(k),_=io(j.data);C.fetchers.set(k,_)}}function we(){let R=[],k=!1;for(let j of K){let _=C.fetchers.get(j);Oe(_,"Expected fetcher: "+j),_.state==="loading"&&(K.delete(j),R.push(j),k=!0)}return qr(R),k}function mr(R){let k=[];for(let[j,_]of re)if(_<R){let F=C.fetchers.get(j);Oe(F,"Expected fetcher: "+j),F.state==="loading"&&(pn(j),re.delete(j),k.push(j))}return qr(k),k.length>0}function er(R,k){let j=C.blockers.get(R)||Ia;return Ee.get(R)!==k&&Ee.set(R,k),j}function wt(R){C.blockers.delete(R),Ee.delete(R)}function $e(R,k){let j=C.blockers.get(R)||Ia;Oe(j.state==="unblocked"&&k.state==="blocked"||j.state==="blocked"&&k.state==="blocked"||j.state==="blocked"&&k.state==="proceeding"||j.state==="blocked"&&k.state==="unblocked"||j.state==="proceeding"&&k.state==="unblocked","Invalid blocker state transition: "+j.state+" -> "+k.state);let _=new Map(C.blockers);_.set(R,k),Le({blockers:_})}function ht(R){let{currentLocation:k,nextLocation:j,historyAction:_}=R;if(Ee.size===0)return;Ee.size>1&&Xt(!1,"A router only supports one blocker at a time");let F=Array.from(Ee.entries()),[J,ce]=F[F.length-1],ne=C.blockers.get(J);if(!(ne&&ne.state==="proceeding")&&ce({currentLocation:k,nextLocation:j,historyAction:_}))return J}function At(R){let k=bn(404,{pathname:R}),j=l||a,{matches:_,route:F}=Mg(j);return rn(),{notFoundMatches:_,route:F,error:k}}function _t(R,k){return{boundaryId:vi(k.partialMatches).route.id,error:bn(400,{type:"route-discovery",pathname:R,message:k.error!=null&&"message"in k.error?k.error:String(k.error)})}}function rn(R){let k=[];return ge.forEach((j,_)=>{(!R||R(_))&&(j.cancel(),k.push(_),ge.delete(_))}),k}function Lt(R,k,j){if(p=R,g=k,h=j||null,!m&&C.navigation===Cc){m=!0;let _=Pn(C.location,C.matches);_!=null&&Le({restoreScrollPosition:_})}return()=>{p=null,g=null,h=null}}function Gt(R,k){return h&&h(R,k.map(_=>YI(_,C.loaderData)))||R.key}function Kt(R,k){if(p&&g){let j=Gt(R,k);p[j]=g()}}function Pn(R,k){if(p){let j=Gt(R,k),_=p[j];if(typeof _=="number")return _}return null}function Wt(R,k,j){if(c){if(d.has(j))return{active:!1,matches:R};if(R){if(Object.keys(R[0].params).length>0)return{active:!0,matches:ol(k,j,s,!0)}}else return{active:!0,matches:ol(k,j,s,!0)||[]}}return{active:!1,matches:null}}async function xt(R,k,j){let _=R;for(;;){let F=l==null,J=l||a;try{await CS(c,k,_,J,i,o,Ae,j)}catch(be){return{type:"error",error:be,partialMatches:_}}finally{F&&(a=[...a])}if(j.aborted)return{type:"aborted"};let ce=Go(J,k,s);if(ce)return Zn(k,d),{type:"success",matches:ce};let ne=ol(J,k,s,!0);if(!ne||_.length===ne.length&&_.every((be,le)=>be.route.id===ne[le].route.id))return Zn(k,d),{type:"success",matches:null};_=ne}}function Zn(R,k){if(k.size>=v){let j=k.values().next().value;k.delete(j)}k.add(R)}function Yn(R){i={},l=wa(R,o,void 0,i)}function hn(R,k){let j=l==null;Ng(R,k,l||a,i,o),j&&(a=[...a],Le({}))}return T={get basename(){return s},get future(){return f},get state(){return C},get routes(){return a},get window(){return t},initialize:ze,subscribe:Ye,enableScrollRestoration:Lt,navigate:Pt,fetch:So,revalidate:Nn,createHref:R=>e.history.createHref(R),encodeLocation:R=>e.history.encodeLocation(R),getFetcher:Ur,deleteFetcher:_o,dispose:V,getBlocker:er,deleteBlocker:wt,patchRoutes:hn,_internalFetchControllers:ve,_internalActiveDeferreds:ge,_internalSetRoutes:Yn},T}function yS(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ic(e,t,n,r,o,i,a,l){let s,u;if(a){s=[];for(let f of t)if(s.push(f),f.route.id===a){u=f;break}}else s=t,u=t[t.length-1];let c=xc(o||".",Ec(s,i),lr(e.pathname,n)||e.pathname,l==="path");return o==null&&(c.search=e.search,c.hash=e.hash),(o==null||o===""||o===".")&&u&&u.route.index&&!Ac(c.search)&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(c.pathname=c.pathname==="/"?n:Er([n,c.pathname])),no(c)}function Ag(e,t,n,r){if(!r||!yS(r))return{path:n};if(r.formMethod&&!kS(r.formMethod))return{path:n,error:bn(405,{method:r.formMethod})};let o=()=>({path:n,error:bn(400,{type:"invalid-body"})}),i=r.formMethod||"get",a=e?i.toUpperCase():i.toLowerCase(),l=Bg(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ur(a))return o();let b=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((y,v)=>{let[d,p]=v;return""+y+d+"="+p+`
|
|
77
|
-
`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:b}}}else if(r.formEncType==="application/json"){if(!ur(a))return o();try{let b=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:l,formEncType:r.formEncType,formData:void 0,json:b,text:void 0}}}catch{return o()}}}Oe(typeof FormData=="function","FormData is not available in this environment");let s,u;if(r.formData)s=Sc(r.formData),u=r.formData;else if(r.body instanceof FormData)s=Sc(r.body),u=r.body;else if(r.body instanceof URLSearchParams)s=r.body,u=Pg(s);else if(r.body==null)s=new URLSearchParams,u=new FormData;else try{s=new URLSearchParams(r.body),u=Pg(s)}catch{return o()}let c={formMethod:a,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(ur(c.formMethod))return{path:n,submission:c};let f=ro(n);return t&&f.search&&Ac(f.search)&&s.append("index",""),f.search="?"+s,{path:no(f),submission:c}}function ES(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function _g(e,t,n,r,o,i,a,l,s,u,c,f,b,y,v,d){let p=d?Wn(d[1])?d[1].error:d[1].data:void 0,h=e.createURL(t.location),g=e.createURL(o),m=d&&Wn(d[1])?d[0]:void 0,E=m?ES(n,m):n,x=d?d[1].statusCode:void 0,A=a&&x&&x>=400,T=E.filter((O,M)=>{let{route:B}=O;if(B.lazy)return!0;if(B.loader==null)return!1;if(i)return typeof B.loader!="function"||B.loader.hydrate?!0:t.loaderData[B.id]===void 0&&(!t.errors||t.errors[B.id]===void 0);if(xS(t.loaderData,t.matches[M],O)||s.some(X=>X===O.route.id))return!0;let U=t.matches[M],G=O;return Rg(O,It({currentUrl:h,currentParams:U.params,nextUrl:g,nextParams:G.params},r,{actionResult:p,actionStatus:x,defaultShouldRevalidate:A?!1:l||h.pathname+h.search===g.pathname+g.search||h.search!==g.search||Og(U,G)}))}),C=[];return f.forEach((O,M)=>{if(i||!n.some(q=>q.route.id===O.routeId)||c.has(M))return;let B=Go(y,O.path,v);if(!B){C.push({key:M,routeId:O.routeId,path:O.path,matches:null,match:null,controller:null});return}let U=t.fetchers.get(M),G=Sa(B,O.path),X=!1;b.has(M)?X=!1:u.has(M)?(u.delete(M),X=!0):U&&U.state!=="idle"&&U.data===void 0?X=l:X=Rg(G,It({currentUrl:h,currentParams:t.matches[t.matches.length-1].params,nextUrl:g,nextParams:n[n.length-1].params},r,{actionResult:p,actionStatus:x,defaultShouldRevalidate:A?!1:l})),X&&C.push({key:M,routeId:O.routeId,path:O.path,matches:B,match:G,controller:new AbortController})}),[T,C]}function xS(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function Og(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Rg(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function CS(e,t,n,r,o,i,a,l){let s=[t,...n.map(u=>u.route.id)].join("-");try{let u=a.get(s);u||(u=e({path:t,matches:n,patch:(c,f)=>{l.aborted||Ng(c,f,r,o,i)}}),a.set(s,u)),u&&NS(u)&&await u}finally{a.delete(s)}}function Ng(e,t,n,r,o){if(e){var i;let a=r[e];Oe(a,"No route found to patch children into: routeId = "+e);let l=wa(t,o,[e,"patch",String(((i=a.children)==null?void 0:i.length)||"0")],r);a.children?a.children.push(...l):a.children=l}else{let a=wa(t,o,["patch",String(n.length||"0")],r);n.push(...a)}}async function wS(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];Oe(o,"No route found in manifest");let i={};for(let a in r){let s=o[a]!==void 0&&a!=="hasErrorBoundary";Xt(!s,'Route "'+o.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!s&&!XI.has(a)&&(i[a]=r[a])}Object.assign(o,i),Object.assign(o,It({},t(o),{lazy:void 0}))}async function IS(e){let{matches:t}=e,n=t.filter(o=>o.shouldLoad);return(await Promise.all(n.map(o=>o.resolve()))).reduce((o,i,a)=>Object.assign(o,{[n[a].route.id]:i}),{})}async function SS(e,t,n,r,o,i,a,l,s,u){let c=i.map(y=>y.route.lazy?wS(y.route,s,l):void 0),f=i.map((y,v)=>{let d=c[v],p=o.some(g=>g.route.id===y.route.id);return It({},y,{shouldLoad:p,resolve:async g=>(g&&r.method==="GET"&&(y.route.lazy||y.route.loader)&&(p=!0),p?TS(t,r,y,d,g,u):Promise.resolve({type:gt.data,result:void 0}))})}),b=await e({matches:f,request:r,params:i[0].params,fetcherKey:a,context:u});try{await Promise.all(c)}catch{}return b}async function TS(e,t,n,r,o,i){let a,l,s=u=>{let c,f=new Promise((v,d)=>c=d);l=()=>c(),t.signal.addEventListener("abort",l);let b=v=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):u({request:t,params:n.params,context:i},...v!==void 0?[v]:[]),y=(async()=>{try{return{type:"data",result:await(o?o(d=>b(d)):b())}}catch(v){return{type:"error",result:v}}})();return Promise.race([y,f])};try{let u=n.route[e];if(r)if(u){let c,[f]=await Promise.all([s(u).catch(b=>{c=b}),r]);if(c!==void 0)throw c;a=f}else if(await r,u=n.route[e],u)a=await s(u);else if(e==="action"){let c=new URL(t.url),f=c.pathname+c.search;throw bn(405,{method:t.method,pathname:f,routeId:n.route.id})}else return{type:gt.data,result:void 0};else if(u)a=await s(u);else{let c=new URL(t.url),f=c.pathname+c.search;throw bn(404,{pathname:f})}Oe(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:gt.error,result:u}}finally{l&&t.signal.removeEventListener("abort",l)}return a}async function AS(e){let{result:t,type:n}=e;if(Vg(t)){let u;try{let c=t.headers.get("Content-Type");c&&/\bapplication\/json\b/.test(c)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(c){return{type:gt.error,error:c}}return n===gt.error?{type:gt.error,error:new al(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:gt.data,data:u,statusCode:t.status,headers:t.headers}}if(n===gt.error){if(jg(t)){var r;if(t.data instanceof Error){var o;return{type:gt.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status}}t=new al(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:gt.error,error:t,statusCode:sl(t)?t.status:void 0}}if(PS(t)){var i,a;return{type:gt.deferred,deferredData:t,statusCode:(i=t.init)==null?void 0:i.status,headers:((a=t.init)==null?void 0:a.headers)&&new Headers(t.init.headers)}}if(jg(t)){var l,s;return{type:gt.data,data:t.data,statusCode:(l=t.init)==null?void 0:l.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}}return{type:gt.data,data:t}}function _S(e,t,n,r,o,i){let a=e.headers.get("Location");if(Oe(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!wc.test(a)){let l=r.slice(0,r.findIndex(s=>s.route.id===n)+1);a=Ic(new URL(t.url),l,o,!0,a,i),e.headers.set("Location",a)}return e}function Dg(e,t,n){if(wc.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=lr(o.pathname,n)!=null;if(o.origin===t.origin&&i)return o.pathname+o.search+o.hash}return e}function bi(e,t,n,r){let o=e.createURL(Bg(t)).toString(),i={signal:n};if(r&&ur(r.formMethod)){let{formMethod:a,formEncType:l}=r;i.method=a.toUpperCase(),l==="application/json"?(i.headers=new Headers({"Content-Type":l}),i.body=JSON.stringify(r.json)):l==="text/plain"?i.body=r.text:l==="application/x-www-form-urlencoded"&&r.formData?i.body=Sc(r.formData):i.body=r.formData}return new Request(o,i)}function Sc(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Pg(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function OS(e,t,n,r,o){let i={},a=null,l,s=!1,u={},c=n&&Wn(n[1])?n[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let b=f.route.id,y=t[b];if(Oe(!Wo(y),"Cannot handle redirect results in processLoaderData"),Wn(y)){let v=y.error;c!==void 0&&(v=c,c=void 0),a=a||{};{let d=vi(e,b);a[d.route.id]==null&&(a[d.route.id]=v)}i[b]=void 0,s||(s=!0,l=sl(y.error)?y.error.status:500),y.headers&&(u[b]=y.headers)}else oo(y)?(r.set(b,y.deferredData),i[b]=y.deferredData.data,y.statusCode!=null&&y.statusCode!==200&&!s&&(l=y.statusCode),y.headers&&(u[b]=y.headers)):(i[b]=y.data,y.statusCode&&y.statusCode!==200&&!s&&(l=y.statusCode),y.headers&&(u[b]=y.headers))}),c!==void 0&&n&&(a={[n[0]]:c},i[n[0]]=void 0),{loaderData:i,errors:a,statusCode:l||200,loaderHeaders:u}}function kg(e,t,n,r,o,i,a,l){let{loaderData:s,errors:u}=OS(t,r,o,l);return i.forEach(c=>{let{key:f,match:b,controller:y}=c,v=a[f];if(Oe(v,"Did not find corresponding fetcher result"),!(y&&y.signal.aborted))if(Wn(v)){let d=vi(e.matches,b==null?void 0:b.route.id);u&&u[d.route.id]||(u=It({},u,{[d.route.id]:v.error})),e.fetchers.delete(f)}else if(Wo(v))Oe(!1,"Unhandled fetcher revalidation redirect");else if(oo(v))Oe(!1,"Unhandled fetcher deferred data");else{let d=io(v.data);e.fetchers.set(f,d)}}),{loaderData:s,errors:u}}function Lg(e,t,n,r){let o=It({},t);for(let i of n){let a=i.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(o[a]=t[a]):e[a]!==void 0&&i.route.loader&&(o[a]=e[a]),r&&r.hasOwnProperty(a))break}return o}function Fg(e){return e?Wn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function vi(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Mg(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function bn(e,t){let{pathname:n,routeId:r,method:o,type:i,message:a}=t===void 0?{}:t,l="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(l="Bad Request",i==="route-discovery"?s='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnNavigation()` '+(`function threw the following error:
|
|
78
|
-
`+a):o&&n&&r?s="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?s="defer() is not supported in actions":i==="invalid-body"&&(s="Unable to encode submission body")):e===403?(l="Forbidden",s='Route "'+r+'" does not match URL "'+n+'"'):e===404?(l="Not Found",s='No route matches URL "'+n+'"'):e===405&&(l="Method Not Allowed",o&&n&&r?s="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(s='Invalid request method "'+o.toUpperCase()+'"')),new al(e||500,l,new Error(s),!0)}function ll(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(Wo(o))return{key:r,result:o}}}function Bg(e){let t=typeof e=="string"?ro(e):e;return no(It({},t,{hash:""}))}function RS(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function NS(e){return typeof e=="object"&&e!=null&&"then"in e}function DS(e){return Vg(e.result)&&hS.has(e.result.status)}function oo(e){return e.type===gt.deferred}function Wn(e){return e.type===gt.error}function Wo(e){return(e&&e.type)===gt.redirect}function jg(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function PS(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Vg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function kS(e){return pS.has(e.toLowerCase())}function ur(e){return dS.has(e.toLowerCase())}async function LS(e,t,n,r,o){let i=Object.entries(t);for(let a=0;a<i.length;a++){let[l,s]=i[a],u=e.find(b=>(b==null?void 0:b.route.id)===l);if(!u)continue;let c=r.find(b=>b.route.id===u.route.id),f=c!=null&&!Og(c,u)&&(o&&o[u.route.id])!==void 0;oo(s)&&f&&await Tc(s,n,!1).then(b=>{b&&(t[l]=b)})}}async function FS(e,t,n){for(let r=0;r<n.length;r++){let{key:o,routeId:i,controller:a}=n[r],l=t[o];e.find(u=>(u==null?void 0:u.route.id)===i)&&oo(l)&&(Oe(a,"Expected an AbortController for revalidating fetcher deferred result"),await Tc(l,a.signal,!0).then(u=>{u&&(t[o]=u)}))}}async function Tc(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:gt.data,data:e.deferredData.unwrappedData}}catch(o){return{type:gt.error,error:o}}return{type:gt.data,data:e.deferredData.data}}}function Ac(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Sa(e,t){let n=typeof t=="string"?ro(t).search:t.search;if(e[e.length-1].route.index&&Ac(n||""))return e[e.length-1];let r=Ig(e);return r[r.length-1]}function Gg(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:a}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function _c(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function MS(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Ta(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function BS(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function io(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function jS(e,t){try{let n=e.sessionStorage.getItem(Tg);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function VS(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(Tg,JSON.stringify(n))}catch(r){
|
|
76
|
+
*/function It(){return It=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},It.apply(this,arguments)}var Mt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Mt||(Mt={}));const yg="popstate";function WI(e){e===void 0&&(e={});function t(r,o){let{pathname:i,search:a,hash:l}=r.location;return Ca("",{pathname:i,search:a,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:no(o)}return zI(t,n,null,e)}function Oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Zt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function HI(){return Math.random().toString(36).substr(2,8)}function Eg(e,t){return{usr:e.state,key:e.key,idx:t}}function Ca(e,t,n,r){return n===void 0&&(n=null),It({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ro(t):t,{state:n,key:t&&t.key||r||HI()})}function no(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function ro(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function zI(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,l=Mt.Pop,s=null,u=c();u==null&&(u=0,a.replaceState(It({},a.state,{idx:u}),""));function c(){return(a.state||{idx:null}).idx}function f(){l=Mt.Pop;let p=c(),h=p==null?null:p-u;u=p,s&&s({action:l,location:d.location,delta:h})}function b(p,h){l=Mt.Push;let g=Ca(d.location,p,h);u=c()+1;let m=Eg(g,u),E=d.createHref(g);try{a.pushState(m,"",E)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;o.location.assign(E)}i&&s&&s({action:l,location:d.location,delta:1})}function y(p,h){l=Mt.Replace;let g=Ca(d.location,p,h);u=c();let m=Eg(g,u),E=d.createHref(g);a.replaceState(m,"",E),i&&s&&s({action:l,location:d.location,delta:0})}function v(p){let h=o.location.origin!=="null"?o.location.origin:o.location.href,g=typeof p=="string"?p:no(p);return g=g.replace(/ $/,"%20"),Oe(h,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,h)}let d={get action(){return l},get location(){return e(o,a)},listen(p){if(s)throw new Error("A history only accepts one active listener");return o.addEventListener(yg,f),s=p,()=>{o.removeEventListener(yg,f),s=null}},createHref(p){return t(o,p)},createURL:v,encodeLocation(p){let h=v(p);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:b,replace:y,go(p){return a.go(p)}};return d}var gt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(gt||(gt={}));const XI=new Set(["lazy","caseSensitive","path","id","index","children"]);function ZI(e){return e.index===!0}function wa(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let a=[...n,String(i)],l=typeof o.id=="string"?o.id:a.join("-");if(Oe(o.index!==!0||!o.children,"Cannot specify children on an index route"),Oe(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),ZI(o)){let s=It({},o,t(o),{id:l});return r[l]=s,s}else{let s=It({},o,t(o),{id:l,children:void 0});return r[l]=s,o.children&&(s.children=wa(o.children,t,a,r)),s}})}function Go(e,t,n){return n===void 0&&(n="/"),ol(e,t,n,!1)}function ol(e,t,n,r){let o=typeof t=="string"?ro(t):t,i=lr(o.pathname||"/",n);if(i==null)return null;let a=xg(e);UI(a);let l=null;for(let s=0;l==null&&s<a.length;++s){let u=iS(i);l=rS(a[s],u,r)}return l}function YI(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}function xg(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(i,a,l)=>{let s={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};s.relativePath.startsWith("/")&&(Oe(s.relativePath.startsWith(r),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(r.length));let u=Er([r,s.relativePath]),c=n.concat(s);i.children&&i.children.length>0&&(Oe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),xg(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:tS(u,i.index),routesMeta:c})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,a);else for(let s of Cg(i.path))o(i,a,s)}),t}function Cg(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=Cg(r.join("/")),l=[];return l.push(...a.map(s=>s===""?i:[i,s].join("/"))),o&&l.push(...a),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function UI(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:nS(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const qI=/^:[\w-]+$/,JI=3,QI=2,$I=1,KI=10,eS=-2,wg=e=>e==="*";function tS(e,t){let n=e.split("/"),r=n.length;return n.some(wg)&&(r+=eS),t&&(r+=QI),n.filter(o=>!wg(o)).reduce((o,i)=>o+(qI.test(i)?JI:i===""?$I:KI),r)}function nS(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function rS(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},i="/",a=[];for(let l=0;l<r.length;++l){let s=r[l],u=l===r.length-1,c=i==="/"?t:t.slice(i.length)||"/",f=il({path:s.relativePath,caseSensitive:s.caseSensitive,end:u},c),b=s.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=il({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!f)return null;Object.assign(o,f.params),a.push({params:o,pathname:Er([i,f.pathname]),pathnameBase:lS(Er([i,f.pathnameBase])),route:b}),f.pathnameBase!=="/"&&(i=Er([i,f.pathnameBase]))}return a}function il(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=oS(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:r.reduce((u,c,f)=>{let{paramName:b,isOptional:y}=c;if(b==="*"){let d=l[f]||"";a=i.slice(0,i.length-d.length).replace(/(.)\/+$/,"$1")}const v=l[f];return y&&!v?u[b]=void 0:u[b]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:a,pattern:e}}function oS(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Zt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,s)=>(r.push({paramName:l,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function iS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Zt(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function lr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function aS(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?ro(e):e;return{pathname:n?n.startsWith("/")?n:sS(n,t):t,search:uS(r),hash:cS(o)}}function sS(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function yc(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ig(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ec(e,t){let n=Ig(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function xc(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=ro(e):(o=It({},e),Oe(!o.pathname||!o.pathname.includes("?"),yc("?","pathname","search",o)),Oe(!o.pathname||!o.pathname.includes("#"),yc("#","pathname","hash",o)),Oe(!o.search||!o.search.includes("#"),yc("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,l;if(a==null)l=n;else{let f=t.length-1;if(!r&&a.startsWith("..")){let b=a.split("/");for(;b[0]==="..";)b.shift(),f-=1;o.pathname=b.join("/")}l=f>=0?t[f]:"/"}let s=aS(o,l),u=a&&a!=="/"&&a.endsWith("/"),c=(i||a===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}const Er=e=>e.join("/").replace(/\/\/+/g,"/"),lS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),uS=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,cS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class al{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function sl(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Sg=["post","put","patch","delete"],dS=new Set(Sg),fS=["get",...Sg],pS=new Set(fS),hS=new Set([301,302,303,307,308]),gS=new Set([307,308]),Cc={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},mS={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ia={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},wc=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bS=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Tg="remix-router-transitions";function vS(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Oe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let R=e.detectErrorBoundary;o=k=>({hasErrorBoundary:R(k)})}else o=bS;let i={},a=wa(e.routes,o,void 0,i),l,s=e.basename||"/",u=e.unstable_dataStrategy||IS,c=e.unstable_patchRoutesOnNavigation,f=It({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),b=null,y=new Set,v=1e3,d=new Set,p=null,h=null,g=null,m=e.hydrationData!=null,E=Go(a,e.history.location,s),x=null;if(E==null&&!c){let R=bn(404,{pathname:e.history.location.pathname}),{matches:k,route:j}=Mg(a);E=k,x={[j.id]:R}}E&&!e.hydrationData&&Wt(E,a,e.history.location.pathname).active&&(E=null);let A;if(E)if(E.some(R=>R.route.lazy))A=!1;else if(!E.some(R=>R.route.loader))A=!0;else if(f.v7_partialHydration){let R=e.hydrationData?e.hydrationData.loaderData:null,k=e.hydrationData?e.hydrationData.errors:null,j=_=>_.route.loader?typeof _.route.loader=="function"&&_.route.loader.hydrate===!0?!1:R&&R[_.route.id]!==void 0||k&&k[_.route.id]!==void 0:!0;if(k){let _=E.findIndex(F=>k[F.route.id]!==void 0);A=E.slice(0,_+1).every(j)}else A=E.every(j)}else A=e.hydrationData!=null;else if(A=!1,E=[],f.v7_partialHydration){let R=Wt(null,a,e.history.location.pathname);R.active&&R.matches&&(E=R.matches)}let T,C={historyAction:e.history.action,location:e.history.location,matches:E,initialized:A,navigation:Cc,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||x,fetchers:new Map,blockers:new Map},O=Mt.Pop,M=!1,B,U=!1,G=new Map,X=null,q=!1,$=!1,ue=[],se=new Set,ve=new Map,W=0,te=-1,re=new Map,K=new Set,oe=new Map,de=new Map,ie=new Set,ge=new Map,Ee=new Map,Ae=new Map,me;function ze(){if(b=e.history.listen(R=>{let{action:k,location:j,delta:_}=R;if(me){me(),me=void 0;return}Zt(Ee.size===0||_!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let F=ht({currentLocation:C.location,nextLocation:j,historyAction:k});if(F&&_!=null){let J=new Promise(ce=>{me=ce});e.history.go(_*-1),Ke(F,{state:"blocked",location:j,proceed(){Ke(F,{state:"proceeding",proceed:void 0,reset:void 0,location:j}),J.then(()=>e.history.go(_))},reset(){let ce=new Map(C.blockers);ce.set(F,Ia),Le({blockers:ce})}});return}return kt(k,j)}),n){jS(t,G);let R=()=>VS(t,G);t.addEventListener("pagehide",R),X=()=>t.removeEventListener("pagehide",R)}return C.initialized||kt(Mt.Pop,C.location,{initialHydration:!0}),T}function V(){b&&b(),X&&X(),y.clear(),B&&B.abort(),C.fetchers.forEach((R,k)=>Fr(k)),C.blockers.forEach((R,k)=>wt(k))}function Ye(R){return y.add(R),()=>y.delete(R)}function Le(R,k){k===void 0&&(k={}),C=It({},C,R);let j=[],_=[];f.v7_fetcherPersist&&C.fetchers.forEach((F,J)=>{F.state==="idle"&&(ie.has(J)?_.push(J):j.push(J))}),[...y].forEach(F=>F(C,{deletedFetchers:_,unstable_viewTransitionOpts:k.viewTransitionOpts,unstable_flushSync:k.flushSync===!0})),f.v7_fetcherPersist&&(j.forEach(F=>C.fetchers.delete(F)),_.forEach(F=>Fr(F)))}function Ue(R,k,j){var _,F;let{flushSync:J}=j===void 0?{}:j,ce=C.actionData!=null&&C.navigation.formMethod!=null&&ur(C.navigation.formMethod)&&C.navigation.state==="loading"&&((_=R.state)==null?void 0:_._isRedirect)!==!0,ne;k.actionData?Object.keys(k.actionData).length>0?ne=k.actionData:ne=null:ce?ne=C.actionData:ne=null;let be=k.loaderData?Lg(C.loaderData,k.loaderData,k.matches||[],k.errors):C.loaderData,le=C.blockers;le.size>0&&(le=new Map(le),le.forEach((Ne,Fe)=>le.set(Fe,Ia)));let ae=M===!0||C.navigation.formMethod!=null&&ur(C.navigation.formMethod)&&((F=R.state)==null?void 0:F._isRedirect)!==!0;l&&(a=l,l=void 0),q||O===Mt.Pop||(O===Mt.Push?e.history.push(R,R.state):O===Mt.Replace&&e.history.replace(R,R.state));let ke;if(O===Mt.Pop){let Ne=G.get(C.location.pathname);Ne&&Ne.has(R.pathname)?ke={currentLocation:C.location,nextLocation:R}:G.has(R.pathname)&&(ke={currentLocation:R,nextLocation:C.location})}else if(U){let Ne=G.get(C.location.pathname);Ne?Ne.add(R.pathname):(Ne=new Set([R.pathname]),G.set(C.location.pathname,Ne)),ke={currentLocation:C.location,nextLocation:R}}Le(It({},k,{actionData:ne,loaderData:be,historyAction:O,location:R,initialized:!0,navigation:Cc,revalidation:"idle",restoreScrollPosition:Pn(R,k.matches||C.matches),preventScrollReset:ae,blockers:le}),{viewTransitionOpts:ke,flushSync:J===!0}),O=Mt.Pop,M=!1,U=!1,q=!1,$=!1,ue=[]}async function Pt(R,k){if(typeof R=="number"){e.history.go(R);return}let j=Ic(C.location,C.matches,s,f.v7_prependBasename,R,f.v7_relativeSplatPath,k==null?void 0:k.fromRouteId,k==null?void 0:k.relative),{path:_,submission:F,error:J}=Ag(f.v7_normalizeFormMethod,!1,j,k),ce=C.location,ne=Ca(C.location,_,k&&k.state);ne=It({},ne,e.history.encodeLocation(ne));let be=k&&k.replace!=null?k.replace:void 0,le=Mt.Push;be===!0?le=Mt.Replace:be===!1||F!=null&&ur(F.formMethod)&&F.formAction===C.location.pathname+C.location.search&&(le=Mt.Replace);let ae=k&&"preventScrollReset"in k?k.preventScrollReset===!0:void 0,ke=(k&&k.unstable_flushSync)===!0,Ne=ht({currentLocation:ce,nextLocation:ne,historyAction:le});if(Ne){Ke(Ne,{state:"blocked",location:ne,proceed(){Ke(Ne,{state:"proceeding",proceed:void 0,reset:void 0,location:ne}),Pt(R,k)},reset(){let Fe=new Map(C.blockers);Fe.set(Ne,Ia),Le({blockers:Fe})}});return}return await kt(le,ne,{submission:F,pendingError:J,preventScrollReset:ae,replace:k&&k.replace,enableViewTransition:k&&k.unstable_viewTransition,flushSync:ke})}function Nn(){if(dn(),Le({revalidation:"loading"}),C.navigation.state!=="submitting"){if(C.navigation.state==="idle"){kt(C.historyAction,C.location,{startUninterruptedRevalidation:!0});return}kt(O||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation,enableViewTransition:U===!0})}}async function kt(R,k,j){B&&B.abort(),B=null,O=R,q=(j&&j.startUninterruptedRevalidation)===!0,Kt(C.location,C.matches),M=(j&&j.preventScrollReset)===!0,U=(j&&j.enableViewTransition)===!0;let _=l||a,F=j&&j.overrideNavigation,J=Go(_,k,s),ce=(j&&j.flushSync)===!0,ne=Wt(J,_,k.pathname);if(ne.active&&ne.matches&&(J=ne.matches),!J){let{error:Me,notFoundMatches:bt,route:ot}=At(k.pathname);Ue(k,{matches:bt,loaderData:{},errors:{[ot.id]:Me}},{flushSync:ce});return}if(C.initialized&&!$&&RS(C.location,k)&&!(j&&j.submission&&ur(j.submission.formMethod))){Ue(k,{matches:J},{flushSync:ce});return}B=new AbortController;let be=bi(e.history,k,B.signal,j&&j.submission),le;if(j&&j.pendingError)le=[vi(J).route.id,{type:gt.error,error:j.pendingError}];else if(j&&j.submission&&ur(j.submission.formMethod)){let Me=await qt(be,k,j.submission,J,ne.active,{replace:j.replace,flushSync:ce});if(Me.shortCircuited)return;if(Me.pendingActionResult){let[bt,ot]=Me.pendingActionResult;if(Wn(ot)&&sl(ot.error)&&ot.error.status===404){B=null,Ue(k,{matches:Me.matches,loaderData:{},errors:{[bt]:ot.error}});return}}J=Me.matches||J,le=Me.pendingActionResult,F=_c(k,j.submission),ce=!1,ne.active=!1,be=bi(e.history,be.url,be.signal)}let{shortCircuited:ae,matches:ke,loaderData:Ne,errors:Fe}=await mt(be,k,J,ne.active,F,j&&j.submission,j&&j.fetcherSubmission,j&&j.replace,j&&j.initialHydration===!0,ce,le);ae||(B=null,Ue(k,It({matches:ke||J},Fg(le),{loaderData:Ne,errors:Fe})))}async function qt(R,k,j,_,F,J){J===void 0&&(J={}),dn();let ce=MS(k,j);if(Le({navigation:ce},{flushSync:J.flushSync===!0}),F){let le=await xt(_,k.pathname,R.signal);if(le.type==="aborted")return{shortCircuited:!0};if(le.type==="error"){let{boundaryId:ae,error:ke}=_t(k.pathname,le);return{matches:le.partialMatches,pendingActionResult:[ae,{type:gt.error,error:ke}]}}else if(le.matches)_=le.matches;else{let{notFoundMatches:ae,error:ke,route:Ne}=At(k.pathname);return{matches:ae,pendingActionResult:[Ne.id,{type:gt.error,error:ke}]}}}let ne,be=Sa(_,k);if(!be.route.action&&!be.route.lazy)ne={type:gt.error,error:bn(405,{method:R.method,pathname:k.pathname,routeId:be.route.id})};else if(ne=(await Vt("action",C,R,[be],_,null))[be.route.id],R.signal.aborted)return{shortCircuited:!0};if(Wo(ne)){let le;return J&&J.replace!=null?le=J.replace:le=Dg(ne.response.headers.get("Location"),new URL(R.url),s)===C.location.pathname+C.location.search,await Dn(R,ne,!0,{submission:j,replace:le}),{shortCircuited:!0}}if(oo(ne))throw bn(400,{type:"defer-action"});if(Wn(ne)){let le=vi(_,be.route.id);return(J&&J.replace)!==!0&&(O=Mt.Push),{matches:_,pendingActionResult:[le.route.id,ne]}}return{matches:_,pendingActionResult:[be.route.id,ne]}}async function mt(R,k,j,_,F,J,ce,ne,be,le,ae){let ke=F||_c(k,J),Ne=J||ce||Gg(ke),Fe=!q&&(!f.v7_partialHydration||!be);if(_){if(Fe){let z=zn(ae);Le(It({navigation:ke},z!==void 0?{actionData:z}:{}),{flushSync:le})}let L=await xt(j,k.pathname,R.signal);if(L.type==="aborted")return{shortCircuited:!0};if(L.type==="error"){let{boundaryId:z,error:Q}=_t(k.pathname,L);return{matches:L.partialMatches,loaderData:{},errors:{[z]:Q}}}else if(L.matches)j=L.matches;else{let{error:z,notFoundMatches:Q,route:ee}=At(k.pathname);return{matches:Q,loaderData:{},errors:{[ee.id]:z}}}}let Me=l||a,[bt,ot]=_g(e.history,C,j,Ne,k,f.v7_partialHydration&&be===!0,f.v7_skipActionErrorRevalidation,$,ue,se,ie,oe,K,Me,s,ae);if(rn(L=>!(j&&j.some(z=>z.route.id===L))||bt&&bt.some(z=>z.route.id===L)),te=++W,bt.length===0&&ot.length===0){let L=we();return Ue(k,It({matches:j,loaderData:{},errors:ae&&Wn(ae[1])?{[ae[0]]:ae[1].error}:null},Fg(ae),L?{fetchers:new Map(C.fetchers)}:{}),{flushSync:le}),{shortCircuited:!0}}if(Fe){let L={};if(!_){L.navigation=ke;let z=zn(ae);z!==void 0&&(L.actionData=z)}ot.length>0&&(L.fetchers=cn(ot)),Le(L,{flushSync:le})}ot.forEach(L=>{ve.has(L.key)&&pn(L.key),L.controller&&ve.set(L.key,L.controller)});let Dt=()=>ot.forEach(L=>pn(L.key));B&&B.signal.addEventListener("abort",Dt);let{loaderResults:gn,fetcherResults:Mr}=await Xn(C,j,bt,ot,R);if(R.signal.aborted)return{shortCircuited:!0};B&&B.signal.removeEventListener("abort",Dt),ot.forEach(L=>ve.delete(L.key));let tr=ll(gn);if(tr)return await Dn(R,tr.result,!0,{replace:ne}),{shortCircuited:!0};if(tr=ll(Mr),tr)return K.add(tr.key),await Dn(R,tr.result,!0,{replace:ne}),{shortCircuited:!0};let{loaderData:Ki,errors:nr}=kg(C,j,bt,gn,ae,ot,Mr,ge);ge.forEach((L,z)=>{L.subscribe(Q=>{(Q||L.done)&&ge.delete(z)})}),f.v7_partialHydration&&be&&C.errors&&Object.entries(C.errors).filter(L=>{let[z]=L;return!bt.some(Q=>Q.route.id===z)}).forEach(L=>{let[z,Q]=L;nr=Object.assign(nr||{},{[z]:Q})});let Z=we(),N=mr(te),H=Z||N||ot.length>0;return It({matches:j,loaderData:Ki,errors:nr},H?{fetchers:new Map(C.fetchers)}:{})}function zn(R){if(R&&!Wn(R[1]))return{[R[0]]:R[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function cn(R){return R.forEach(k=>{let j=C.fetchers.get(k.key),_=Ta(void 0,j?j.data:void 0);C.fetchers.set(k.key,_)}),new Map(C.fetchers)}function So(R,k,j,_){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");ve.has(R)&&pn(R);let F=(_&&_.unstable_flushSync)===!0,J=l||a,ce=Ic(C.location,C.matches,s,f.v7_prependBasename,j,f.v7_relativeSplatPath,k,_==null?void 0:_.relative),ne=Go(J,ce,s),be=Wt(ne,J,ce);if(be.active&&be.matches&&(ne=be.matches),!ne){Ct(R,k,bn(404,{pathname:ce}),{flushSync:F});return}let{path:le,submission:ae,error:ke}=Ag(f.v7_normalizeFormMethod,!0,ce,_);if(ke){Ct(R,k,ke,{flushSync:F});return}let Ne=Sa(ne,le);if(M=(_&&_.preventScrollReset)===!0,ae&&ur(ae.formMethod)){To(R,k,le,Ne,ne,be.active,F,ae);return}oe.set(R,{routeId:k,path:le}),Ao(R,k,le,Ne,ne,be.active,F,ae)}async function To(R,k,j,_,F,J,ce,ne){dn(),oe.delete(R);function be(ee){if(!ee.route.action&&!ee.route.lazy){let pe=bn(405,{method:ne.formMethod,pathname:j,routeId:k});return Ct(R,k,pe,{flushSync:ce}),!0}return!1}if(!J&&be(_))return;let le=C.fetchers.get(R);fn(R,BS(ne,le),{flushSync:ce});let ae=new AbortController,ke=bi(e.history,j,ae.signal,ne);if(J){let ee=await xt(F,j,ke.signal);if(ee.type==="aborted")return;if(ee.type==="error"){let{error:pe}=_t(j,ee);Ct(R,k,pe,{flushSync:ce});return}else if(ee.matches){if(F=ee.matches,_=Sa(F,j),be(_))return}else{Ct(R,k,bn(404,{pathname:j}),{flushSync:ce});return}}ve.set(R,ae);let Ne=W,Me=(await Vt("action",C,ke,[_],F,R))[_.route.id];if(ke.signal.aborted){ve.get(R)===ae&&ve.delete(R);return}if(f.v7_fetcherPersist&&ie.has(R)){if(Wo(Me)||Wn(Me)){fn(R,io(void 0));return}}else{if(Wo(Me))if(ve.delete(R),te>Ne){fn(R,io(void 0));return}else return K.add(R),fn(R,Ta(ne)),Dn(ke,Me,!1,{fetcherSubmission:ne});if(Wn(Me)){Ct(R,k,Me.error);return}}if(oo(Me))throw bn(400,{type:"defer-action"});let bt=C.navigation.location||C.location,ot=bi(e.history,bt,ae.signal),Dt=l||a,gn=C.navigation.state!=="idle"?Go(Dt,C.navigation.location,s):C.matches;Oe(gn,"Didn't find any matches after fetcher action");let Mr=++W;re.set(R,Mr);let tr=Ta(ne,Me.data);C.fetchers.set(R,tr);let[Ki,nr]=_g(e.history,C,gn,ne,bt,!1,f.v7_skipActionErrorRevalidation,$,ue,se,ie,oe,K,Dt,s,[_.route.id,Me]);nr.filter(ee=>ee.key!==R).forEach(ee=>{let pe=ee.key,fe=C.fetchers.get(pe),he=Ta(void 0,fe?fe.data:void 0);C.fetchers.set(pe,he),ve.has(pe)&&pn(pe),ee.controller&&ve.set(pe,ee.controller)}),Le({fetchers:new Map(C.fetchers)});let Z=()=>nr.forEach(ee=>pn(ee.key));ae.signal.addEventListener("abort",Z);let{loaderResults:N,fetcherResults:H}=await Xn(C,gn,Ki,nr,ot);if(ae.signal.aborted)return;ae.signal.removeEventListener("abort",Z),re.delete(R),ve.delete(R),nr.forEach(ee=>ve.delete(ee.key));let L=ll(N);if(L)return Dn(ot,L.result,!1);if(L=ll(H),L)return K.add(L.key),Dn(ot,L.result,!1);let{loaderData:z,errors:Q}=kg(C,gn,Ki,N,void 0,nr,H,ge);if(C.fetchers.has(R)){let ee=io(Me.data);C.fetchers.set(R,ee)}mr(Mr),C.navigation.state==="loading"&&Mr>te?(Oe(O,"Expected pending action"),B&&B.abort(),Ue(C.navigation.location,{matches:gn,loaderData:z,errors:Q,fetchers:new Map(C.fetchers)})):(Le({errors:Q,loaderData:Lg(C.loaderData,z,gn,Q),fetchers:new Map(C.fetchers)}),$=!1)}async function Ao(R,k,j,_,F,J,ce,ne){let be=C.fetchers.get(R);fn(R,Ta(ne,be?be.data:void 0),{flushSync:ce});let le=new AbortController,ae=bi(e.history,j,le.signal);if(J){let Me=await xt(F,j,ae.signal);if(Me.type==="aborted")return;if(Me.type==="error"){let{error:bt}=_t(j,Me);Ct(R,k,bt,{flushSync:ce});return}else if(Me.matches)F=Me.matches,_=Sa(F,j);else{Ct(R,k,bn(404,{pathname:j}),{flushSync:ce});return}}ve.set(R,le);let ke=W,Fe=(await Vt("loader",C,ae,[_],F,R))[_.route.id];if(oo(Fe)&&(Fe=await Tc(Fe,ae.signal,!0)||Fe),ve.get(R)===le&&ve.delete(R),!ae.signal.aborted){if(ie.has(R)){fn(R,io(void 0));return}if(Wo(Fe))if(te>ke){fn(R,io(void 0));return}else{K.add(R),await Dn(ae,Fe,!1);return}if(Wn(Fe)){Ct(R,k,Fe.error);return}Oe(!oo(Fe),"Unhandled fetcher deferred data"),fn(R,io(Fe.data))}}async function Dn(R,k,j,_){let{submission:F,fetcherSubmission:J,replace:ce}=_===void 0?{}:_;k.response.headers.has("X-Remix-Revalidate")&&($=!0);let ne=k.response.headers.get("Location");Oe(ne,"Expected a Location header on the redirect Response"),ne=Dg(ne,new URL(R.url),s);let be=Ca(C.location,ne,{_isRedirect:!0});if(n){let Me=!1;if(k.response.headers.has("X-Remix-Reload-Document"))Me=!0;else if(wc.test(ne)){const bt=e.history.createURL(ne);Me=bt.origin!==t.location.origin||lr(bt.pathname,s)==null}if(Me){ce?t.location.replace(ne):t.location.assign(ne);return}}B=null;let le=ce===!0||k.response.headers.has("X-Remix-Replace")?Mt.Replace:Mt.Push,{formMethod:ae,formAction:ke,formEncType:Ne}=C.navigation;!F&&!J&&ae&&ke&&Ne&&(F=Gg(C.navigation));let Fe=F||J;if(gS.has(k.response.status)&&Fe&&ur(Fe.formMethod))await kt(le,be,{submission:It({},Fe,{formAction:ne}),preventScrollReset:M,enableViewTransition:j?U:void 0});else{let Me=_c(be,F);await kt(le,be,{overrideNavigation:Me,fetcherSubmission:J,preventScrollReset:M,enableViewTransition:j?U:void 0})}}async function Vt(R,k,j,_,F,J){let ce,ne={};try{ce=await SS(u,R,k,j,_,F,J,i,o)}catch(be){return _.forEach(le=>{ne[le.route.id]={type:gt.error,error:be}}),ne}for(let[be,le]of Object.entries(ce))if(DS(le)){let ae=le.result;ne[be]={type:gt.redirect,response:_S(ae,j,be,F,s,f.v7_relativeSplatPath)}}else ne[be]=await AS(le);return ne}async function Xn(R,k,j,_,F){let J=R.matches,ce=Vt("loader",R,F,j,k,null),ne=Promise.all(_.map(async ae=>{if(ae.matches&&ae.match&&ae.controller){let Ne=(await Vt("loader",R,bi(e.history,ae.path,ae.controller.signal),[ae.match],ae.matches,ae.key))[ae.match.route.id];return{[ae.key]:Ne}}else return Promise.resolve({[ae.key]:{type:gt.error,error:bn(404,{pathname:ae.path})}})})),be=await ce,le=(await ne).reduce((ae,ke)=>Object.assign(ae,ke),{});return await Promise.all([LS(k,be,F.signal,J,R.loaderData),FS(k,le,_)]),{loaderResults:be,fetcherResults:le}}function dn(){$=!0,ue.push(...rn()),oe.forEach((R,k)=>{ve.has(k)&&(se.add(k),pn(k))})}function fn(R,k,j){j===void 0&&(j={}),C.fetchers.set(R,k),Le({fetchers:new Map(C.fetchers)},{flushSync:(j&&j.flushSync)===!0})}function Ct(R,k,j,_){_===void 0&&(_={});let F=vi(C.matches,k);Fr(R),Le({errors:{[F.route.id]:j},fetchers:new Map(C.fetchers)},{flushSync:(_&&_.flushSync)===!0})}function Ur(R){return f.v7_fetcherPersist&&(de.set(R,(de.get(R)||0)+1),ie.has(R)&&ie.delete(R)),C.fetchers.get(R)||mS}function Fr(R){let k=C.fetchers.get(R);ve.has(R)&&!(k&&k.state==="loading"&&re.has(R))&&pn(R),oe.delete(R),re.delete(R),K.delete(R),ie.delete(R),se.delete(R),C.fetchers.delete(R)}function _o(R){if(f.v7_fetcherPersist){let k=(de.get(R)||0)-1;k<=0?(de.delete(R),ie.add(R)):de.set(R,k)}else Fr(R);Le({fetchers:new Map(C.fetchers)})}function pn(R){let k=ve.get(R);Oe(k,"Expected fetch controller: "+R),k.abort(),ve.delete(R)}function qr(R){for(let k of R){let j=Ur(k),_=io(j.data);C.fetchers.set(k,_)}}function we(){let R=[],k=!1;for(let j of K){let _=C.fetchers.get(j);Oe(_,"Expected fetcher: "+j),_.state==="loading"&&(K.delete(j),R.push(j),k=!0)}return qr(R),k}function mr(R){let k=[];for(let[j,_]of re)if(_<R){let F=C.fetchers.get(j);Oe(F,"Expected fetcher: "+j),F.state==="loading"&&(pn(j),re.delete(j),k.push(j))}return qr(k),k.length>0}function er(R,k){let j=C.blockers.get(R)||Ia;return Ee.get(R)!==k&&Ee.set(R,k),j}function wt(R){C.blockers.delete(R),Ee.delete(R)}function Ke(R,k){let j=C.blockers.get(R)||Ia;Oe(j.state==="unblocked"&&k.state==="blocked"||j.state==="blocked"&&k.state==="blocked"||j.state==="blocked"&&k.state==="proceeding"||j.state==="blocked"&&k.state==="unblocked"||j.state==="proceeding"&&k.state==="unblocked","Invalid blocker state transition: "+j.state+" -> "+k.state);let _=new Map(C.blockers);_.set(R,k),Le({blockers:_})}function ht(R){let{currentLocation:k,nextLocation:j,historyAction:_}=R;if(Ee.size===0)return;Ee.size>1&&Zt(!1,"A router only supports one blocker at a time");let F=Array.from(Ee.entries()),[J,ce]=F[F.length-1],ne=C.blockers.get(J);if(!(ne&&ne.state==="proceeding")&&ce({currentLocation:k,nextLocation:j,historyAction:_}))return J}function At(R){let k=bn(404,{pathname:R}),j=l||a,{matches:_,route:F}=Mg(j);return rn(),{notFoundMatches:_,route:F,error:k}}function _t(R,k){return{boundaryId:vi(k.partialMatches).route.id,error:bn(400,{type:"route-discovery",pathname:R,message:k.error!=null&&"message"in k.error?k.error:String(k.error)})}}function rn(R){let k=[];return ge.forEach((j,_)=>{(!R||R(_))&&(j.cancel(),k.push(_),ge.delete(_))}),k}function Lt(R,k,j){if(p=R,g=k,h=j||null,!m&&C.navigation===Cc){m=!0;let _=Pn(C.location,C.matches);_!=null&&Le({restoreScrollPosition:_})}return()=>{p=null,g=null,h=null}}function Gt(R,k){return h&&h(R,k.map(_=>YI(_,C.loaderData)))||R.key}function Kt(R,k){if(p&&g){let j=Gt(R,k);p[j]=g()}}function Pn(R,k){if(p){let j=Gt(R,k),_=p[j];if(typeof _=="number")return _}return null}function Wt(R,k,j){if(c){if(d.has(j))return{active:!1,matches:R};if(R){if(Object.keys(R[0].params).length>0)return{active:!0,matches:ol(k,j,s,!0)}}else return{active:!0,matches:ol(k,j,s,!0)||[]}}return{active:!1,matches:null}}async function xt(R,k,j){let _=R;for(;;){let F=l==null,J=l||a;try{await CS(c,k,_,J,i,o,Ae,j)}catch(be){return{type:"error",error:be,partialMatches:_}}finally{F&&(a=[...a])}if(j.aborted)return{type:"aborted"};let ce=Go(J,k,s);if(ce)return Zn(k,d),{type:"success",matches:ce};let ne=ol(J,k,s,!0);if(!ne||_.length===ne.length&&_.every((be,le)=>be.route.id===ne[le].route.id))return Zn(k,d),{type:"success",matches:null};_=ne}}function Zn(R,k){if(k.size>=v){let j=k.values().next().value;k.delete(j)}k.add(R)}function Yn(R){i={},l=wa(R,o,void 0,i)}function hn(R,k){let j=l==null;Ng(R,k,l||a,i,o),j&&(a=[...a],Le({}))}return T={get basename(){return s},get future(){return f},get state(){return C},get routes(){return a},get window(){return t},initialize:ze,subscribe:Ye,enableScrollRestoration:Lt,navigate:Pt,fetch:So,revalidate:Nn,createHref:R=>e.history.createHref(R),encodeLocation:R=>e.history.encodeLocation(R),getFetcher:Ur,deleteFetcher:_o,dispose:V,getBlocker:er,deleteBlocker:wt,patchRoutes:hn,_internalFetchControllers:ve,_internalActiveDeferreds:ge,_internalSetRoutes:Yn},T}function yS(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ic(e,t,n,r,o,i,a,l){let s,u;if(a){s=[];for(let f of t)if(s.push(f),f.route.id===a){u=f;break}}else s=t,u=t[t.length-1];let c=xc(o||".",Ec(s,i),lr(e.pathname,n)||e.pathname,l==="path");return o==null&&(c.search=e.search,c.hash=e.hash),(o==null||o===""||o===".")&&u&&u.route.index&&!Ac(c.search)&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(c.pathname=c.pathname==="/"?n:Er([n,c.pathname])),no(c)}function Ag(e,t,n,r){if(!r||!yS(r))return{path:n};if(r.formMethod&&!kS(r.formMethod))return{path:n,error:bn(405,{method:r.formMethod})};let o=()=>({path:n,error:bn(400,{type:"invalid-body"})}),i=r.formMethod||"get",a=e?i.toUpperCase():i.toLowerCase(),l=Bg(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ur(a))return o();let b=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((y,v)=>{let[d,p]=v;return""+y+d+"="+p+`
|
|
77
|
+
`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:b}}}else if(r.formEncType==="application/json"){if(!ur(a))return o();try{let b=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:l,formEncType:r.formEncType,formData:void 0,json:b,text:void 0}}}catch{return o()}}}Oe(typeof FormData=="function","FormData is not available in this environment");let s,u;if(r.formData)s=Sc(r.formData),u=r.formData;else if(r.body instanceof FormData)s=Sc(r.body),u=r.body;else if(r.body instanceof URLSearchParams)s=r.body,u=Pg(s);else if(r.body==null)s=new URLSearchParams,u=new FormData;else try{s=new URLSearchParams(r.body),u=Pg(s)}catch{return o()}let c={formMethod:a,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(ur(c.formMethod))return{path:n,submission:c};let f=ro(n);return t&&f.search&&Ac(f.search)&&s.append("index",""),f.search="?"+s,{path:no(f),submission:c}}function ES(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function _g(e,t,n,r,o,i,a,l,s,u,c,f,b,y,v,d){let p=d?Wn(d[1])?d[1].error:d[1].data:void 0,h=e.createURL(t.location),g=e.createURL(o),m=d&&Wn(d[1])?d[0]:void 0,E=m?ES(n,m):n,x=d?d[1].statusCode:void 0,A=a&&x&&x>=400,T=E.filter((O,M)=>{let{route:B}=O;if(B.lazy)return!0;if(B.loader==null)return!1;if(i)return typeof B.loader!="function"||B.loader.hydrate?!0:t.loaderData[B.id]===void 0&&(!t.errors||t.errors[B.id]===void 0);if(xS(t.loaderData,t.matches[M],O)||s.some(X=>X===O.route.id))return!0;let U=t.matches[M],G=O;return Rg(O,It({currentUrl:h,currentParams:U.params,nextUrl:g,nextParams:G.params},r,{actionResult:p,actionStatus:x,defaultShouldRevalidate:A?!1:l||h.pathname+h.search===g.pathname+g.search||h.search!==g.search||Og(U,G)}))}),C=[];return f.forEach((O,M)=>{if(i||!n.some(q=>q.route.id===O.routeId)||c.has(M))return;let B=Go(y,O.path,v);if(!B){C.push({key:M,routeId:O.routeId,path:O.path,matches:null,match:null,controller:null});return}let U=t.fetchers.get(M),G=Sa(B,O.path),X=!1;b.has(M)?X=!1:u.has(M)?(u.delete(M),X=!0):U&&U.state!=="idle"&&U.data===void 0?X=l:X=Rg(G,It({currentUrl:h,currentParams:t.matches[t.matches.length-1].params,nextUrl:g,nextParams:n[n.length-1].params},r,{actionResult:p,actionStatus:x,defaultShouldRevalidate:A?!1:l})),X&&C.push({key:M,routeId:O.routeId,path:O.path,matches:B,match:G,controller:new AbortController})}),[T,C]}function xS(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function Og(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Rg(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function CS(e,t,n,r,o,i,a,l){let s=[t,...n.map(u=>u.route.id)].join("-");try{let u=a.get(s);u||(u=e({path:t,matches:n,patch:(c,f)=>{l.aborted||Ng(c,f,r,o,i)}}),a.set(s,u)),u&&NS(u)&&await u}finally{a.delete(s)}}function Ng(e,t,n,r,o){if(e){var i;let a=r[e];Oe(a,"No route found to patch children into: routeId = "+e);let l=wa(t,o,[e,"patch",String(((i=a.children)==null?void 0:i.length)||"0")],r);a.children?a.children.push(...l):a.children=l}else{let a=wa(t,o,["patch",String(n.length||"0")],r);n.push(...a)}}async function wS(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];Oe(o,"No route found in manifest");let i={};for(let a in r){let s=o[a]!==void 0&&a!=="hasErrorBoundary";Zt(!s,'Route "'+o.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!s&&!XI.has(a)&&(i[a]=r[a])}Object.assign(o,i),Object.assign(o,It({},t(o),{lazy:void 0}))}async function IS(e){let{matches:t}=e,n=t.filter(o=>o.shouldLoad);return(await Promise.all(n.map(o=>o.resolve()))).reduce((o,i,a)=>Object.assign(o,{[n[a].route.id]:i}),{})}async function SS(e,t,n,r,o,i,a,l,s,u){let c=i.map(y=>y.route.lazy?wS(y.route,s,l):void 0),f=i.map((y,v)=>{let d=c[v],p=o.some(g=>g.route.id===y.route.id);return It({},y,{shouldLoad:p,resolve:async g=>(g&&r.method==="GET"&&(y.route.lazy||y.route.loader)&&(p=!0),p?TS(t,r,y,d,g,u):Promise.resolve({type:gt.data,result:void 0}))})}),b=await e({matches:f,request:r,params:i[0].params,fetcherKey:a,context:u});try{await Promise.all(c)}catch{}return b}async function TS(e,t,n,r,o,i){let a,l,s=u=>{let c,f=new Promise((v,d)=>c=d);l=()=>c(),t.signal.addEventListener("abort",l);let b=v=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):u({request:t,params:n.params,context:i},...v!==void 0?[v]:[]),y=(async()=>{try{return{type:"data",result:await(o?o(d=>b(d)):b())}}catch(v){return{type:"error",result:v}}})();return Promise.race([y,f])};try{let u=n.route[e];if(r)if(u){let c,[f]=await Promise.all([s(u).catch(b=>{c=b}),r]);if(c!==void 0)throw c;a=f}else if(await r,u=n.route[e],u)a=await s(u);else if(e==="action"){let c=new URL(t.url),f=c.pathname+c.search;throw bn(405,{method:t.method,pathname:f,routeId:n.route.id})}else return{type:gt.data,result:void 0};else if(u)a=await s(u);else{let c=new URL(t.url),f=c.pathname+c.search;throw bn(404,{pathname:f})}Oe(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:gt.error,result:u}}finally{l&&t.signal.removeEventListener("abort",l)}return a}async function AS(e){let{result:t,type:n}=e;if(Vg(t)){let u;try{let c=t.headers.get("Content-Type");c&&/\bapplication\/json\b/.test(c)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(c){return{type:gt.error,error:c}}return n===gt.error?{type:gt.error,error:new al(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:gt.data,data:u,statusCode:t.status,headers:t.headers}}if(n===gt.error){if(jg(t)){var r;if(t.data instanceof Error){var o;return{type:gt.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status}}t=new al(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:gt.error,error:t,statusCode:sl(t)?t.status:void 0}}if(PS(t)){var i,a;return{type:gt.deferred,deferredData:t,statusCode:(i=t.init)==null?void 0:i.status,headers:((a=t.init)==null?void 0:a.headers)&&new Headers(t.init.headers)}}if(jg(t)){var l,s;return{type:gt.data,data:t.data,statusCode:(l=t.init)==null?void 0:l.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}}return{type:gt.data,data:t}}function _S(e,t,n,r,o,i){let a=e.headers.get("Location");if(Oe(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!wc.test(a)){let l=r.slice(0,r.findIndex(s=>s.route.id===n)+1);a=Ic(new URL(t.url),l,o,!0,a,i),e.headers.set("Location",a)}return e}function Dg(e,t,n){if(wc.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=lr(o.pathname,n)!=null;if(o.origin===t.origin&&i)return o.pathname+o.search+o.hash}return e}function bi(e,t,n,r){let o=e.createURL(Bg(t)).toString(),i={signal:n};if(r&&ur(r.formMethod)){let{formMethod:a,formEncType:l}=r;i.method=a.toUpperCase(),l==="application/json"?(i.headers=new Headers({"Content-Type":l}),i.body=JSON.stringify(r.json)):l==="text/plain"?i.body=r.text:l==="application/x-www-form-urlencoded"&&r.formData?i.body=Sc(r.formData):i.body=r.formData}return new Request(o,i)}function Sc(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Pg(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function OS(e,t,n,r,o){let i={},a=null,l,s=!1,u={},c=n&&Wn(n[1])?n[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let b=f.route.id,y=t[b];if(Oe(!Wo(y),"Cannot handle redirect results in processLoaderData"),Wn(y)){let v=y.error;c!==void 0&&(v=c,c=void 0),a=a||{};{let d=vi(e,b);a[d.route.id]==null&&(a[d.route.id]=v)}i[b]=void 0,s||(s=!0,l=sl(y.error)?y.error.status:500),y.headers&&(u[b]=y.headers)}else oo(y)?(r.set(b,y.deferredData),i[b]=y.deferredData.data,y.statusCode!=null&&y.statusCode!==200&&!s&&(l=y.statusCode),y.headers&&(u[b]=y.headers)):(i[b]=y.data,y.statusCode&&y.statusCode!==200&&!s&&(l=y.statusCode),y.headers&&(u[b]=y.headers))}),c!==void 0&&n&&(a={[n[0]]:c},i[n[0]]=void 0),{loaderData:i,errors:a,statusCode:l||200,loaderHeaders:u}}function kg(e,t,n,r,o,i,a,l){let{loaderData:s,errors:u}=OS(t,r,o,l);return i.forEach(c=>{let{key:f,match:b,controller:y}=c,v=a[f];if(Oe(v,"Did not find corresponding fetcher result"),!(y&&y.signal.aborted))if(Wn(v)){let d=vi(e.matches,b==null?void 0:b.route.id);u&&u[d.route.id]||(u=It({},u,{[d.route.id]:v.error})),e.fetchers.delete(f)}else if(Wo(v))Oe(!1,"Unhandled fetcher revalidation redirect");else if(oo(v))Oe(!1,"Unhandled fetcher deferred data");else{let d=io(v.data);e.fetchers.set(f,d)}}),{loaderData:s,errors:u}}function Lg(e,t,n,r){let o=It({},t);for(let i of n){let a=i.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(o[a]=t[a]):e[a]!==void 0&&i.route.loader&&(o[a]=e[a]),r&&r.hasOwnProperty(a))break}return o}function Fg(e){return e?Wn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function vi(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Mg(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function bn(e,t){let{pathname:n,routeId:r,method:o,type:i,message:a}=t===void 0?{}:t,l="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(l="Bad Request",i==="route-discovery"?s='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnNavigation()` '+(`function threw the following error:
|
|
78
|
+
`+a):o&&n&&r?s="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?s="defer() is not supported in actions":i==="invalid-body"&&(s="Unable to encode submission body")):e===403?(l="Forbidden",s='Route "'+r+'" does not match URL "'+n+'"'):e===404?(l="Not Found",s='No route matches URL "'+n+'"'):e===405&&(l="Method Not Allowed",o&&n&&r?s="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(s='Invalid request method "'+o.toUpperCase()+'"')),new al(e||500,l,new Error(s),!0)}function ll(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(Wo(o))return{key:r,result:o}}}function Bg(e){let t=typeof e=="string"?ro(e):e;return no(It({},t,{hash:""}))}function RS(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function NS(e){return typeof e=="object"&&e!=null&&"then"in e}function DS(e){return Vg(e.result)&&hS.has(e.result.status)}function oo(e){return e.type===gt.deferred}function Wn(e){return e.type===gt.error}function Wo(e){return(e&&e.type)===gt.redirect}function jg(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function PS(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Vg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function kS(e){return pS.has(e.toLowerCase())}function ur(e){return dS.has(e.toLowerCase())}async function LS(e,t,n,r,o){let i=Object.entries(t);for(let a=0;a<i.length;a++){let[l,s]=i[a],u=e.find(b=>(b==null?void 0:b.route.id)===l);if(!u)continue;let c=r.find(b=>b.route.id===u.route.id),f=c!=null&&!Og(c,u)&&(o&&o[u.route.id])!==void 0;oo(s)&&f&&await Tc(s,n,!1).then(b=>{b&&(t[l]=b)})}}async function FS(e,t,n){for(let r=0;r<n.length;r++){let{key:o,routeId:i,controller:a}=n[r],l=t[o];e.find(u=>(u==null?void 0:u.route.id)===i)&&oo(l)&&(Oe(a,"Expected an AbortController for revalidating fetcher deferred result"),await Tc(l,a.signal,!0).then(u=>{u&&(t[o]=u)}))}}async function Tc(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:gt.data,data:e.deferredData.unwrappedData}}catch(o){return{type:gt.error,error:o}}return{type:gt.data,data:e.deferredData.data}}}function Ac(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Sa(e,t){let n=typeof t=="string"?ro(t).search:t.search;if(e[e.length-1].route.index&&Ac(n||""))return e[e.length-1];let r=Ig(e);return r[r.length-1]}function Gg(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:a}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function _c(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function MS(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Ta(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function BS(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function io(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function jS(e,t){try{let n=e.sessionStorage.getItem(Tg);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function VS(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(Tg,JSON.stringify(n))}catch(r){Zt(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
79
79
|
* React Router v6.26.2
|
|
80
80
|
*
|
|
81
81
|
* Copyright (c) Remix Software Inc.
|
|
@@ -84,9 +84,9 @@ Take a look at the reducer(s) handling this action type: ${y.type}.
|
|
|
84
84
|
* LICENSE.md file in the root directory of this source tree.
|
|
85
85
|
*
|
|
86
86
|
* @license MIT
|
|
87
|
-
*/function ul(){return ul=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ul.apply(this,arguments)}const yi=P.createContext(null);process.env.NODE_ENV!=="production"&&(yi.displayName="DataRouter");const cl=P.createContext(null);process.env.NODE_ENV!=="production"&&(cl.displayName="DataRouterState");const GS=P.createContext(null);process.env.NODE_ENV!=="production"&&(GS.displayName="Await");const cr=P.createContext(null);process.env.NODE_ENV!=="production"&&(cr.displayName="Navigation");const dl=P.createContext(null);process.env.NODE_ENV!=="production"&&(dl.displayName="Location");const dr=P.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(dr.displayName="Route");const Oc=P.createContext(null);process.env.NODE_ENV!=="production"&&(Oc.displayName="RouteError");function WS(e,t){let{relative:n}=t===void 0?{}:t;Aa()||(process.env.NODE_ENV!=="production"?Oe(!1,"useHref() may be used only in the context of a <Router> component."):Oe(!1));let{basename:r,navigator:o}=P.useContext(cr),{hash:i,pathname:a,search:l}=_a(e,{relative:n}),s=a;return r!=="/"&&(s=a==="/"?r:Er([r,a])),o.createHref({pathname:s,search:l,hash:i})}function Aa(){return P.useContext(dl)!=null}function ao(){return Aa()||(process.env.NODE_ENV!=="production"?Oe(!1,"useLocation() may be used only in the context of a <Router> component."):Oe(!1)),P.useContext(dl).location}const Wg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Hg(e){P.useContext(cr).static||P.useLayoutEffect(e)}function so(){let{isDataRoute:e}=P.useContext(dr);return e?r2():HS()}function HS(){Aa()||(process.env.NODE_ENV!=="production"?Oe(!1,"useNavigate() may be used only in the context of a <Router> component."):Oe(!1));let e=P.useContext(yi),{basename:t,future:n,navigator:r}=P.useContext(cr),{matches:o}=P.useContext(dr),{pathname:i}=ao(),a=JSON.stringify(Ec(o,n.v7_relativeSplatPath)),l=P.useRef(!1);return Hg(()=>{l.current=!0}),P.useCallback(function(u,c){if(c===void 0&&(c={}),process.env.NODE_ENV!=="production"&&
|
|
87
|
+
*/function ul(){return ul=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ul.apply(this,arguments)}const yi=P.createContext(null);process.env.NODE_ENV!=="production"&&(yi.displayName="DataRouter");const cl=P.createContext(null);process.env.NODE_ENV!=="production"&&(cl.displayName="DataRouterState");const GS=P.createContext(null);process.env.NODE_ENV!=="production"&&(GS.displayName="Await");const cr=P.createContext(null);process.env.NODE_ENV!=="production"&&(cr.displayName="Navigation");const dl=P.createContext(null);process.env.NODE_ENV!=="production"&&(dl.displayName="Location");const dr=P.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(dr.displayName="Route");const Oc=P.createContext(null);process.env.NODE_ENV!=="production"&&(Oc.displayName="RouteError");function WS(e,t){let{relative:n}=t===void 0?{}:t;Aa()||(process.env.NODE_ENV!=="production"?Oe(!1,"useHref() may be used only in the context of a <Router> component."):Oe(!1));let{basename:r,navigator:o}=P.useContext(cr),{hash:i,pathname:a,search:l}=_a(e,{relative:n}),s=a;return r!=="/"&&(s=a==="/"?r:Er([r,a])),o.createHref({pathname:s,search:l,hash:i})}function Aa(){return P.useContext(dl)!=null}function ao(){return Aa()||(process.env.NODE_ENV!=="production"?Oe(!1,"useLocation() may be used only in the context of a <Router> component."):Oe(!1)),P.useContext(dl).location}const Wg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Hg(e){P.useContext(cr).static||P.useLayoutEffect(e)}function so(){let{isDataRoute:e}=P.useContext(dr);return e?r2():HS()}function HS(){Aa()||(process.env.NODE_ENV!=="production"?Oe(!1,"useNavigate() may be used only in the context of a <Router> component."):Oe(!1));let e=P.useContext(yi),{basename:t,future:n,navigator:r}=P.useContext(cr),{matches:o}=P.useContext(dr),{pathname:i}=ao(),a=JSON.stringify(Ec(o,n.v7_relativeSplatPath)),l=P.useRef(!1);return Hg(()=>{l.current=!0}),P.useCallback(function(u,c){if(c===void 0&&(c={}),process.env.NODE_ENV!=="production"&&Zt(l.current,Wg),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=xc(u,JSON.parse(a),i,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Er([t,f.pathname])),(c.replace?r.replace:r.push)(f,c.state,c)},[t,r,a,i,e])}const zS=P.createContext(null);function XS(e){let t=P.useContext(dr).outlet;return t&&P.createElement(zS.Provider,{value:e},t)}function zg(){let{matches:e}=P.useContext(dr),t=e[e.length-1];return t?t.params:{}}function _a(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=P.useContext(cr),{matches:o}=P.useContext(dr),{pathname:i}=ao(),a=JSON.stringify(Ec(o,r.v7_relativeSplatPath));return P.useMemo(()=>xc(e,JSON.parse(a),i,n==="path"),[e,a,i,n])}function ZS(e,t,n,r){Aa()||(process.env.NODE_ENV!=="production"?Oe(!1,"useRoutes() may be used only in the context of a <Router> component."):Oe(!1));let{navigator:o}=P.useContext(cr),{matches:i}=P.useContext(dr),a=i[i.length-1],l=a?a.params:{},s=a?a.pathname:"/",u=a?a.pathnameBase:"/",c=a&&a.route;if(process.env.NODE_ENV!=="production"){let h=c&&c.path||"";Yg(s,!c||h.endsWith("*"),"You rendered descendant <Routes> (or called `useRoutes()`) at "+('"'+s+'" (under <Route path="'+h+'">) but the ')+`parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
88
88
|
|
|
89
|
-
`+('Please change the parent <Route path="'+h+'"> to <Route ')+('path="'+(h==="/"?"*":h+"/*")+'">.'))}let f=ao(),b;b=f;let y=b.pathname||"/",v=y;if(u!=="/"){let h=u.replace(/^\//,"").split("/");v="/"+y.replace(/^\//,"").split("/").slice(h.length).join("/")}let d=Go(e,{pathname:v});return process.env.NODE_ENV!=="production"&&(process.env.NODE_ENV!=="production"&&
|
|
89
|
+
`+('Please change the parent <Route path="'+h+'"> to <Route ')+('path="'+(h==="/"?"*":h+"/*")+'">.'))}let f=ao(),b;b=f;let y=b.pathname||"/",v=y;if(u!=="/"){let h=u.replace(/^\//,"").split("/");v="/"+y.replace(/^\//,"").split("/").slice(h.length).join("/")}let d=Go(e,{pathname:v});return process.env.NODE_ENV!=="production"&&(process.env.NODE_ENV!=="production"&&Zt(c||d!=null,'No routes matched location "'+b.pathname+b.search+b.hash+'" '),process.env.NODE_ENV!=="production"&&Zt(d==null||d[d.length-1].route.element!==void 0||d[d.length-1].route.Component!==void 0||d[d.length-1].route.lazy!==void 0,'Matched leaf route at location "'+b.pathname+b.search+b.hash+'" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.')),QS(d&&d.map(h=>Object.assign({},h,{params:Object.assign({},l,h.params),pathname:Er([u,o.encodeLocation?o.encodeLocation(h.pathname).pathname:h.pathname]),pathnameBase:h.pathnameBase==="/"?u:Er([u,o.encodeLocation?o.encodeLocation(h.pathnameBase).pathname:h.pathnameBase])})),i,n,r)}function YS(){let e=n2(),t=sl(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},a=null;return process.env.NODE_ENV!=="production"&&(console.error("Error handled by React Router default ErrorBoundary:",e),a=P.createElement(P.Fragment,null,P.createElement("p",null,"💿 Hey developer 👋"),P.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",P.createElement("code",{style:i},"ErrorBoundary")," or"," ",P.createElement("code",{style:i},"errorElement")," prop on your route."))),P.createElement(P.Fragment,null,P.createElement("h2",null,"Unexpected Application Error!"),P.createElement("h3",{style:{fontStyle:"italic"}},t),n?P.createElement("pre",{style:o},n):null,a)}const US=P.createElement(YS,null);class qS extends P.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?P.createElement(dr.Provider,{value:this.props.routeContext},P.createElement(Oc.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function JS(e){let{routeContext:t,match:n,children:r}=e,o=P.useContext(yi);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),P.createElement(dr.Provider,{value:t},r)}function QS(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,l=(o=n)==null?void 0:o.errors;if(l!=null){let c=a.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);c>=0||(process.env.NODE_ENV!=="production"?Oe(!1,"Could not find a matching route for errors on route IDs: "+Object.keys(l).join(",")):Oe(!1)),a=a.slice(0,Math.min(a.length,c+1))}let s=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c<a.length;c++){let f=a[c];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=c),f.route.id){let{loaderData:b,errors:y}=n,v=f.route.loader&&b[f.route.id]===void 0&&(!y||y[f.route.id]===void 0);if(f.route.lazy||v){s=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((c,f,b)=>{let y,v=!1,d=null,p=null;n&&(y=l&&f.route.id?l[f.route.id]:void 0,d=f.route.errorElement||US,s&&(u<0&&b===0?(Yg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,p=null):u===b&&(v=!0,p=f.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,b+1)),g=()=>{let m;return y?m=d:v?m=p:f.route.Component?m=P.createElement(f.route.Component,null):f.route.element?m=f.route.element:m=c,P.createElement(JS,{match:f,routeContext:{outlet:c,matches:h,isDataRoute:n!=null},children:m})};return n&&(f.route.ErrorBoundary||f.route.errorElement||b===0)?P.createElement(qS,{location:n.location,revalidation:n.revalidation,component:d,error:y,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):g()},null)}var Xg=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Xg||{}),Oa=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Oa||{});function Rc(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function $S(e){let t=P.useContext(yi);return t||(process.env.NODE_ENV!=="production"?Oe(!1,Rc(e)):Oe(!1)),t}function KS(e){let t=P.useContext(cl);return t||(process.env.NODE_ENV!=="production"?Oe(!1,Rc(e)):Oe(!1)),t}function e2(e){let t=P.useContext(dr);return t||(process.env.NODE_ENV!=="production"?Oe(!1,Rc(e)):Oe(!1)),t}function Nc(e){let t=e2(e),n=t.matches[t.matches.length-1];return n.route.id||(process.env.NODE_ENV!=="production"?Oe(!1,e+' can only be used on routes that contain a unique "id"'):Oe(!1)),n.route.id}function t2(){return Nc(Oa.UseRouteId)}function n2(){var e;let t=P.useContext(Oc),n=KS(Oa.UseRouteError),r=Nc(Oa.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function r2(){let{router:e}=$S(Xg.UseNavigateStable),t=Nc(Oa.UseNavigateStable),n=P.useRef(!1);return Hg(()=>{n.current=!0}),P.useCallback(function(o,i){i===void 0&&(i={}),process.env.NODE_ENV!=="production"&&Zt(n.current,Wg),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,ul({fromRouteId:t},i)))},[e,t])}const Zg={};function Yg(e,t,n){!t&&!Zg[e]&&(Zg[e]=!0,process.env.NODE_ENV!=="production"&&Zt(!1,n))}function o2(e){return XS(e.context)}function i2(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Mt.Pop,navigator:i,static:a=!1,future:l}=e;Aa()&&(process.env.NODE_ENV!=="production"?Oe(!1,"You cannot render a <Router> inside another <Router>. You should never have more than one in your app."):Oe(!1));let s=t.replace(/^\/*/,"/"),u=P.useMemo(()=>({basename:s,navigator:i,static:a,future:ul({v7_relativeSplatPath:!1},l)}),[s,l,i,a]);typeof r=="string"&&(r=ro(r));let{pathname:c="/",search:f="",hash:b="",state:y=null,key:v="default"}=r,d=P.useMemo(()=>{let p=lr(c,s);return p==null?null:{location:{pathname:p,search:f,hash:b,state:y,key:v},navigationType:o}},[s,c,f,b,y,v,o]);return process.env.NODE_ENV!=="production"&&Zt(d!=null,'<Router basename="'+s+'"> is not able to match the URL '+('"'+c+f+b+'" because it does not start with the ')+"basename, so the <Router> won't render anything."),d==null?null:P.createElement(cr.Provider,{value:u},P.createElement(dl.Provider,{children:n,value:d}))}new Promise(()=>{});function a2(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(process.env.NODE_ENV!=="production"&&e.element&&process.env.NODE_ENV!=="production"&&Zt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:P.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(process.env.NODE_ENV!=="production"&&e.hydrateFallbackElement&&process.env.NODE_ENV!=="production"&&Zt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:P.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(process.env.NODE_ENV!=="production"&&e.errorElement&&process.env.NODE_ENV!=="production"&&Zt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:P.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}/**
|
|
90
90
|
* React Router DOM v6.26.2
|
|
91
91
|
*
|
|
92
92
|
* Copyright (c) Remix Software Inc.
|
|
@@ -95,7 +95,7 @@ Take a look at the reducer(s) handling this action type: ${y.type}.
|
|
|
95
95
|
* LICENSE.md file in the root directory of this source tree.
|
|
96
96
|
*
|
|
97
97
|
* @license MIT
|
|
98
|
-
*/function lo(){return lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lo.apply(this,arguments)}function Dc(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}const fl="get",pl="application/x-www-form-urlencoded";function hl(e){return e!=null&&typeof e.tagName=="string"}function s2(e){return hl(e)&&e.tagName.toLowerCase()==="button"}function l2(e){return hl(e)&&e.tagName.toLowerCase()==="form"}function u2(e){return hl(e)&&e.tagName.toLowerCase()==="input"}function c2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function d2(e,t){return e.button===0&&(!t||t==="_self")&&!c2(e)}function Pc(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function f2(e,t){let n=Pc(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}let gl=null;function p2(){if(gl===null)try{new FormData(document.createElement("form"),0),gl=!1}catch{gl=!0}return gl}const h2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function kc(e){return e!=null&&!h2.has(e)?(process.env.NODE_ENV!=="production"&&Xt(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+pl+'"')),null):e}function g2(e,t){let n,r,o,i,a;if(l2(e)){let l=e.getAttribute("action");r=l?lr(l,t):null,n=e.getAttribute("method")||fl,o=kc(e.getAttribute("enctype"))||pl,i=new FormData(e)}else if(s2(e)||u2(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(r=s?lr(s,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||fl,o=kc(e.getAttribute("formenctype"))||kc(l.getAttribute("enctype"))||pl,i=new FormData(l,e),!p2()){let{name:u,type:c,value:f}=e;if(c==="image"){let b=u?u+".":"";i.append(b+"x","0"),i.append(b+"y","0")}else u&&i.append(u,f)}}else{if(hl(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=fl,r=null,o=pl,a=e}return i&&o==="text/plain"&&(a=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:a}}const m2=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],b2=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],v2=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],y2="6";try{window.__reactRouterVersion=y2}catch{}function E2(e,t){return vS({basename:t==null?void 0:t.basename,future:lo({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:WI({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||x2(),routes:e,mapRouteProperties:a2,unstable_dataStrategy:t==null?void 0:t.unstable_dataStrategy,unstable_patchRoutesOnNavigation:t==null?void 0:t.unstable_patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function x2(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=lo({},t,{errors:C2(t.errors)})),t}function C2(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new al(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let a=new i(o.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const Lc=P.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(Lc.displayName="ViewTransition");const Ug=P.createContext(new Map);process.env.NODE_ENV!=="production"&&(Ug.displayName="Fetchers");const qg=P["startTransition"],Jg=Oy["flushSync"];function w2(e){qg?qg(e):e()}function Ra(e){Jg?Jg(e):e()}class I2{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function S2(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=P.useState(n.state),[a,l]=P.useState(),[s,u]=P.useState({isTransitioning:!1}),[c,f]=P.useState(),[b,y]=P.useState(),[v,d]=P.useState(),p=P.useRef(new Map),{v7_startTransition:h}=r||{},g=P.useCallback(C=>{h?w2(C):C()},[h]),m=P.useCallback((C,O)=>{let{deletedFetchers:M,unstable_flushSync:B,unstable_viewTransitionOpts:U}=O;M.forEach(X=>p.current.delete(X)),C.fetchers.forEach((X,q)=>{X.data!==void 0&&p.current.set(q,X.data)});let G=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!U||G){B?Ra(()=>i(C)):g(()=>i(C));return}if(B){Ra(()=>{b&&(c&&c.resolve(),b.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let X=n.window.document.startViewTransition(()=>{Ra(()=>i(C))});X.finished.finally(()=>{Ra(()=>{f(void 0),y(void 0),l(void 0),u({isTransitioning:!1})})}),Ra(()=>y(X));return}b?(c&&c.resolve(),b.skipTransition(),d({state:C,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(l(C),u({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[n.window,b,c,p,g]);P.useLayoutEffect(()=>n.subscribe(m),[n,m]),P.useEffect(()=>{s.isTransitioning&&!s.flushSync&&f(new I2)},[s]),P.useEffect(()=>{if(c&&a&&n.window){let C=a,O=c.promise,M=n.window.document.startViewTransition(async()=>{g(()=>i(C)),await O});M.finished.finally(()=>{f(void 0),y(void 0),l(void 0),u({isTransitioning:!1})}),y(M)}},[g,a,c,n.window]),P.useEffect(()=>{c&&a&&o.location.key===a.location.key&&c.resolve()},[c,b,o.location,a]),P.useEffect(()=>{!s.isTransitioning&&v&&(l(v.state),u({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),d(void 0))},[s.isTransitioning,v]),P.useEffect(()=>{process.env.NODE_ENV!=="production"&&Xt(t==null||!n.future.v7_partialHydration,"`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead")},[]);let E=P.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:C=>n.navigate(C),push:(C,O,M)=>n.navigate(C,{state:O,preventScrollReset:M==null?void 0:M.preventScrollReset}),replace:(C,O,M)=>n.navigate(C,{replace:!0,state:O,preventScrollReset:M==null?void 0:M.preventScrollReset})}),[n]),x=n.basename||"/",A=P.useMemo(()=>({router:n,navigator:E,static:!1,basename:x}),[n,E,x]),T=P.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return P.createElement(P.Fragment,null,P.createElement(yi.Provider,{value:A},P.createElement(cl.Provider,{value:o},P.createElement(Ug.Provider,{value:p.current},P.createElement(Lc.Provider,{value:s},P.createElement(i2,{basename:x,location:o.location,navigationType:o.historyAction,navigator:E,future:T},o.initialized||n.future.v7_partialHydration?P.createElement(T2,{routes:n.routes,future:n.future,state:o}):t))))),null)}const T2=P.memo(A2);function A2(e){let{routes:t,future:n,state:r}=e;return ZS(t,void 0,r,n)}process.env.NODE_ENV;const _2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",O2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qg=P.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:a,state:l,target:s,to:u,preventScrollReset:c,unstable_viewTransition:f}=t,b=Dc(t,m2),{basename:y}=P.useContext(cr),v,d=!1;if(typeof u=="string"&&O2.test(u)&&(v=u,_2))try{let m=new URL(window.location.href),E=u.startsWith("//")?new URL(m.protocol+u):new URL(u),x=lr(E.pathname,y);E.origin===m.origin&&x!=null?u=x+E.search+E.hash:d=!0}catch{process.env.NODE_ENV!=="production"&&Xt(!1,'<Link to="'+u+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let p=WS(u,{relative:o}),h=P2(u,{replace:a,state:l,target:s,preventScrollReset:c,relative:o,unstable_viewTransition:f});function g(m){r&&r(m),m.defaultPrevented||h(m)}return P.createElement("a",lo({},b,{href:v||p,onClick:d||i?r:g,ref:n,target:s}))});process.env.NODE_ENV!=="production"&&(Qg.displayName="Link");const R2=P.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:a=!1,style:l,to:s,unstable_viewTransition:u,children:c}=t,f=Dc(t,b2),b=_a(s,{relative:f.relative}),y=ao(),v=P.useContext(cl),{navigator:d,basename:p}=P.useContext(cr),h=v!=null&&j2(b)&&u===!0,g=d.encodeLocation?d.encodeLocation(b).pathname:b.pathname,m=y.pathname,E=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;o||(m=m.toLowerCase(),E=E?E.toLowerCase():null,g=g.toLowerCase()),E&&p&&(E=lr(E,p)||E);const x=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let A=m===g||!a&&m.startsWith(g)&&m.charAt(x)==="/",T=E!=null&&(E===g||!a&&E.startsWith(g)&&E.charAt(g.length)==="/"),C={isActive:A,isPending:T,isTransitioning:h},O=A?r:void 0,M;typeof i=="function"?M=i(C):M=[i,A?"active":null,T?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let B=typeof l=="function"?l(C):l;return P.createElement(Qg,lo({},f,{"aria-current":O,className:M,ref:n,style:B,to:s,unstable_viewTransition:u}),typeof c=="function"?c(C):c)});process.env.NODE_ENV!=="production"&&(R2.displayName="NavLink");const N2=P.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:o,replace:i,state:a,method:l=fl,action:s,onSubmit:u,relative:c,preventScrollReset:f,unstable_viewTransition:b}=e,y=Dc(e,v2),v=M2(),d=B2(s,{relative:c}),p=l.toLowerCase()==="get"?"get":"post",h=g=>{if(u&&u(g),g.defaultPrevented)return;g.preventDefault();let m=g.nativeEvent.submitter,E=(m==null?void 0:m.getAttribute("formmethod"))||l;v(m||g.currentTarget,{fetcherKey:n,method:E,navigate:r,replace:i,state:a,relative:c,preventScrollReset:f,unstable_viewTransition:b})};return P.createElement("form",lo({ref:t,method:p,action:d,onSubmit:o?u:h},y))});process.env.NODE_ENV!=="production"&&(N2.displayName="Form"),process.env.NODE_ENV;var ml;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ml||(ml={}));var $g;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})($g||($g={}));function D2(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function Kg(e){let t=P.useContext(yi);return t||(process.env.NODE_ENV!=="production"?Oe(!1,D2(e)):Oe(!1)),t}function P2(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:l}=t===void 0?{}:t,s=so(),u=ao(),c=_a(e,{relative:a});return P.useCallback(f=>{if(d2(f,n)){f.preventDefault();let b=r!==void 0?r:no(u)===no(c);s(e,{replace:b,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:l})}},[u,s,c,r,o,n,e,i,a,l])}function em(e){process.env.NODE_ENV!=="production"&&Xt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=P.useRef(Pc(e)),n=P.useRef(!1),r=ao(),o=P.useMemo(()=>f2(r.search,n.current?null:t.current),[r.search]),i=so(),a=P.useCallback((l,s)=>{const u=Pc(typeof l=="function"?l(o):l);n.current=!0,i("?"+u,s)},[i,o]);return[o,a]}function k2(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let L2=0,F2=()=>"__"+String(++L2)+"__";function M2(){let{router:e}=Kg(ml.UseSubmit),{basename:t}=P.useContext(cr),n=t2();return P.useCallback(function(r,o){o===void 0&&(o={}),k2();let{action:i,method:a,encType:l,formData:s,body:u}=g2(r,t);if(o.navigate===!1){let c=o.fetcherKey||F2();e.fetch(c,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:s,body:u,formMethod:o.method||a,formEncType:o.encType||l,unstable_flushSync:o.unstable_flushSync})}else e.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:s,body:u,formMethod:o.method||a,formEncType:o.encType||l,replace:o.replace,state:o.state,fromRouteId:n,unstable_flushSync:o.unstable_flushSync,unstable_viewTransition:o.unstable_viewTransition})},[e,t,n])}function B2(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=P.useContext(cr),o=P.useContext(dr);o||(process.env.NODE_ENV!=="production"?Oe(!1,"useFormAction must be used inside a RouteContext"):Oe(!1));let[i]=o.matches.slice(-1),a=lo({},_a(e||".",{relative:n})),l=ao();if(e==null){a.search=l.search;let s=new URLSearchParams(a.search);s.has("index")&&s.get("index")===""&&(s.delete("index"),a.search=s.toString()?"?"+s.toString():"")}return(!e||e===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(a.pathname=a.pathname==="/"?r:Er([r,a.pathname])),no(a)}function j2(e,t){t===void 0&&(t={});let n=P.useContext(Lc);n==null&&(process.env.NODE_ENV!=="production"?Oe(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):Oe(!1));let{basename:r}=Kg(ml.useViewTransitionState),o=_a(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=lr(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=lr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return il(o.pathname,a)!=null||il(o.pathname,i)!=null}const V2=w.styled(w.Stack)`
|
|
98
|
+
*/function lo(){return lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lo.apply(this,arguments)}function Dc(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}const fl="get",pl="application/x-www-form-urlencoded";function hl(e){return e!=null&&typeof e.tagName=="string"}function s2(e){return hl(e)&&e.tagName.toLowerCase()==="button"}function l2(e){return hl(e)&&e.tagName.toLowerCase()==="form"}function u2(e){return hl(e)&&e.tagName.toLowerCase()==="input"}function c2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function d2(e,t){return e.button===0&&(!t||t==="_self")&&!c2(e)}function Pc(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function f2(e,t){let n=Pc(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}let gl=null;function p2(){if(gl===null)try{new FormData(document.createElement("form"),0),gl=!1}catch{gl=!0}return gl}const h2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function kc(e){return e!=null&&!h2.has(e)?(process.env.NODE_ENV!=="production"&&Zt(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+pl+'"')),null):e}function g2(e,t){let n,r,o,i,a;if(l2(e)){let l=e.getAttribute("action");r=l?lr(l,t):null,n=e.getAttribute("method")||fl,o=kc(e.getAttribute("enctype"))||pl,i=new FormData(e)}else if(s2(e)||u2(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(r=s?lr(s,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||fl,o=kc(e.getAttribute("formenctype"))||kc(l.getAttribute("enctype"))||pl,i=new FormData(l,e),!p2()){let{name:u,type:c,value:f}=e;if(c==="image"){let b=u?u+".":"";i.append(b+"x","0"),i.append(b+"y","0")}else u&&i.append(u,f)}}else{if(hl(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=fl,r=null,o=pl,a=e}return i&&o==="text/plain"&&(a=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:a}}const m2=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],b2=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],v2=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],y2="6";try{window.__reactRouterVersion=y2}catch{}function E2(e,t){return vS({basename:t==null?void 0:t.basename,future:lo({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:WI({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||x2(),routes:e,mapRouteProperties:a2,unstable_dataStrategy:t==null?void 0:t.unstable_dataStrategy,unstable_patchRoutesOnNavigation:t==null?void 0:t.unstable_patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function x2(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=lo({},t,{errors:C2(t.errors)})),t}function C2(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new al(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let a=new i(o.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const Lc=P.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(Lc.displayName="ViewTransition");const Ug=P.createContext(new Map);process.env.NODE_ENV!=="production"&&(Ug.displayName="Fetchers");const qg=P["startTransition"],Jg=Oy["flushSync"];function w2(e){qg?qg(e):e()}function Ra(e){Jg?Jg(e):e()}class I2{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function S2(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=P.useState(n.state),[a,l]=P.useState(),[s,u]=P.useState({isTransitioning:!1}),[c,f]=P.useState(),[b,y]=P.useState(),[v,d]=P.useState(),p=P.useRef(new Map),{v7_startTransition:h}=r||{},g=P.useCallback(C=>{h?w2(C):C()},[h]),m=P.useCallback((C,O)=>{let{deletedFetchers:M,unstable_flushSync:B,unstable_viewTransitionOpts:U}=O;M.forEach(X=>p.current.delete(X)),C.fetchers.forEach((X,q)=>{X.data!==void 0&&p.current.set(q,X.data)});let G=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!U||G){B?Ra(()=>i(C)):g(()=>i(C));return}if(B){Ra(()=>{b&&(c&&c.resolve(),b.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let X=n.window.document.startViewTransition(()=>{Ra(()=>i(C))});X.finished.finally(()=>{Ra(()=>{f(void 0),y(void 0),l(void 0),u({isTransitioning:!1})})}),Ra(()=>y(X));return}b?(c&&c.resolve(),b.skipTransition(),d({state:C,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(l(C),u({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[n.window,b,c,p,g]);P.useLayoutEffect(()=>n.subscribe(m),[n,m]),P.useEffect(()=>{s.isTransitioning&&!s.flushSync&&f(new I2)},[s]),P.useEffect(()=>{if(c&&a&&n.window){let C=a,O=c.promise,M=n.window.document.startViewTransition(async()=>{g(()=>i(C)),await O});M.finished.finally(()=>{f(void 0),y(void 0),l(void 0),u({isTransitioning:!1})}),y(M)}},[g,a,c,n.window]),P.useEffect(()=>{c&&a&&o.location.key===a.location.key&&c.resolve()},[c,b,o.location,a]),P.useEffect(()=>{!s.isTransitioning&&v&&(l(v.state),u({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),d(void 0))},[s.isTransitioning,v]),P.useEffect(()=>{process.env.NODE_ENV!=="production"&&Zt(t==null||!n.future.v7_partialHydration,"`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead")},[]);let E=P.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:C=>n.navigate(C),push:(C,O,M)=>n.navigate(C,{state:O,preventScrollReset:M==null?void 0:M.preventScrollReset}),replace:(C,O,M)=>n.navigate(C,{replace:!0,state:O,preventScrollReset:M==null?void 0:M.preventScrollReset})}),[n]),x=n.basename||"/",A=P.useMemo(()=>({router:n,navigator:E,static:!1,basename:x}),[n,E,x]),T=P.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return P.createElement(P.Fragment,null,P.createElement(yi.Provider,{value:A},P.createElement(cl.Provider,{value:o},P.createElement(Ug.Provider,{value:p.current},P.createElement(Lc.Provider,{value:s},P.createElement(i2,{basename:x,location:o.location,navigationType:o.historyAction,navigator:E,future:T},o.initialized||n.future.v7_partialHydration?P.createElement(T2,{routes:n.routes,future:n.future,state:o}):t))))),null)}const T2=P.memo(A2);function A2(e){let{routes:t,future:n,state:r}=e;return ZS(t,void 0,r,n)}process.env.NODE_ENV;const _2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",O2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qg=P.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:a,state:l,target:s,to:u,preventScrollReset:c,unstable_viewTransition:f}=t,b=Dc(t,m2),{basename:y}=P.useContext(cr),v,d=!1;if(typeof u=="string"&&O2.test(u)&&(v=u,_2))try{let m=new URL(window.location.href),E=u.startsWith("//")?new URL(m.protocol+u):new URL(u),x=lr(E.pathname,y);E.origin===m.origin&&x!=null?u=x+E.search+E.hash:d=!0}catch{process.env.NODE_ENV!=="production"&&Zt(!1,'<Link to="'+u+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let p=WS(u,{relative:o}),h=P2(u,{replace:a,state:l,target:s,preventScrollReset:c,relative:o,unstable_viewTransition:f});function g(m){r&&r(m),m.defaultPrevented||h(m)}return P.createElement("a",lo({},b,{href:v||p,onClick:d||i?r:g,ref:n,target:s}))});process.env.NODE_ENV!=="production"&&(Qg.displayName="Link");const R2=P.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:a=!1,style:l,to:s,unstable_viewTransition:u,children:c}=t,f=Dc(t,b2),b=_a(s,{relative:f.relative}),y=ao(),v=P.useContext(cl),{navigator:d,basename:p}=P.useContext(cr),h=v!=null&&j2(b)&&u===!0,g=d.encodeLocation?d.encodeLocation(b).pathname:b.pathname,m=y.pathname,E=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;o||(m=m.toLowerCase(),E=E?E.toLowerCase():null,g=g.toLowerCase()),E&&p&&(E=lr(E,p)||E);const x=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let A=m===g||!a&&m.startsWith(g)&&m.charAt(x)==="/",T=E!=null&&(E===g||!a&&E.startsWith(g)&&E.charAt(g.length)==="/"),C={isActive:A,isPending:T,isTransitioning:h},O=A?r:void 0,M;typeof i=="function"?M=i(C):M=[i,A?"active":null,T?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let B=typeof l=="function"?l(C):l;return P.createElement(Qg,lo({},f,{"aria-current":O,className:M,ref:n,style:B,to:s,unstable_viewTransition:u}),typeof c=="function"?c(C):c)});process.env.NODE_ENV!=="production"&&(R2.displayName="NavLink");const N2=P.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:o,replace:i,state:a,method:l=fl,action:s,onSubmit:u,relative:c,preventScrollReset:f,unstable_viewTransition:b}=e,y=Dc(e,v2),v=M2(),d=B2(s,{relative:c}),p=l.toLowerCase()==="get"?"get":"post",h=g=>{if(u&&u(g),g.defaultPrevented)return;g.preventDefault();let m=g.nativeEvent.submitter,E=(m==null?void 0:m.getAttribute("formmethod"))||l;v(m||g.currentTarget,{fetcherKey:n,method:E,navigate:r,replace:i,state:a,relative:c,preventScrollReset:f,unstable_viewTransition:b})};return P.createElement("form",lo({ref:t,method:p,action:d,onSubmit:o?u:h},y))});process.env.NODE_ENV!=="production"&&(N2.displayName="Form"),process.env.NODE_ENV;var ml;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ml||(ml={}));var $g;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})($g||($g={}));function D2(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function Kg(e){let t=P.useContext(yi);return t||(process.env.NODE_ENV!=="production"?Oe(!1,D2(e)):Oe(!1)),t}function P2(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:l}=t===void 0?{}:t,s=so(),u=ao(),c=_a(e,{relative:a});return P.useCallback(f=>{if(d2(f,n)){f.preventDefault();let b=r!==void 0?r:no(u)===no(c);s(e,{replace:b,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:l})}},[u,s,c,r,o,n,e,i,a,l])}function em(e){process.env.NODE_ENV!=="production"&&Zt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=P.useRef(Pc(e)),n=P.useRef(!1),r=ao(),o=P.useMemo(()=>f2(r.search,n.current?null:t.current),[r.search]),i=so(),a=P.useCallback((l,s)=>{const u=Pc(typeof l=="function"?l(o):l);n.current=!0,i("?"+u,s)},[i,o]);return[o,a]}function k2(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let L2=0,F2=()=>"__"+String(++L2)+"__";function M2(){let{router:e}=Kg(ml.UseSubmit),{basename:t}=P.useContext(cr),n=t2();return P.useCallback(function(r,o){o===void 0&&(o={}),k2();let{action:i,method:a,encType:l,formData:s,body:u}=g2(r,t);if(o.navigate===!1){let c=o.fetcherKey||F2();e.fetch(c,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:s,body:u,formMethod:o.method||a,formEncType:o.encType||l,unstable_flushSync:o.unstable_flushSync})}else e.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:s,body:u,formMethod:o.method||a,formEncType:o.encType||l,replace:o.replace,state:o.state,fromRouteId:n,unstable_flushSync:o.unstable_flushSync,unstable_viewTransition:o.unstable_viewTransition})},[e,t,n])}function B2(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=P.useContext(cr),o=P.useContext(dr);o||(process.env.NODE_ENV!=="production"?Oe(!1,"useFormAction must be used inside a RouteContext"):Oe(!1));let[i]=o.matches.slice(-1),a=lo({},_a(e||".",{relative:n})),l=ao();if(e==null){a.search=l.search;let s=new URLSearchParams(a.search);s.has("index")&&s.get("index")===""&&(s.delete("index"),a.search=s.toString()?"?"+s.toString():"")}return(!e||e===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(a.pathname=a.pathname==="/"?r:Er([r,a.pathname])),no(a)}function j2(e,t){t===void 0&&(t={});let n=P.useContext(Lc);n==null&&(process.env.NODE_ENV!=="production"?Oe(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):Oe(!1));let{basename:r}=Kg(ml.useViewTransitionState),o=_a(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=lr(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=lr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return il(o.pathname,a)!=null||il(o.pathname,i)!=null}const V2=w.styled(w.Stack)`
|
|
99
99
|
width: 100%;
|
|
100
100
|
height: 100%;
|
|
101
101
|
align-items: center;
|
|
@@ -139,7 +139,7 @@ Take a look at the reducer(s) handling this action type: ${y.type}.
|
|
|
139
139
|
border-radius: 11px;
|
|
140
140
|
justify-content: center;
|
|
141
141
|
align-items: center;
|
|
142
|
-
`,X2="Customising connectors on the agent’s panel",Z2="Configure your Connectors in the right panel, add your cards and name them how you want the agents to see and update them.",Y2="Coming Soon",U2="Have any questions? ",tm="internal-chat",q2="https://cdn.hiverhq.com/connectors-module/assets/RequestNewCCLogo.svg",J2="https://cdn.hiverhq.com/connectors-module/assets/agent-view.svg",Q2="https://cdn.hiverhq.com/connectors-module/assets/RequestConnector.svg",$2="https://cdn.hiverhq.com/connectors-module/assets/UpgradeImage.svg",K2=()=>{const{availableFeatures:e}=S.useContext(
|
|
142
|
+
`,X2="Customising connectors on the agent’s panel",Z2="Configure your Connectors in the right panel, add your cards and name them how you want the agents to see and update them.",Y2="Coming Soon",U2="Have any questions? ",tm="internal-chat",q2="https://cdn.hiverhq.com/connectors-module/assets/RequestNewCCLogo.svg",J2="https://cdn.hiverhq.com/connectors-module/assets/agent-view.svg",Q2="https://cdn.hiverhq.com/connectors-module/assets/RequestConnector.svg",$2="https://cdn.hiverhq.com/connectors-module/assets/UpgradeImage.svg",K2=()=>{const{availableFeatures:e}=S.useContext(zt),t=n=>{n.stopPropagation(),br(e,tm)&&Gp()};return I.jsx(V2,{children:I.jsxs(G2,{children:[I.jsxs(W2,{children:[I.jsx(z2,{children:Y2}),I.jsx(w.Typography,{variant:"h2",children:X2}),I.jsx(w.Typography,{variant:"body2",className:"description__agentView",children:Z2}),I.jsxs(w.Typography,{variant:"body1",className:"description__agentView",children:[U2,I.jsx("span",{className:"contact__agentView",onClick:t,children:Fp})]})]}),I.jsx(H2,{children:I.jsx("img",{src:J2,alt:"agent-view"})})]})})},eT=w.styled(w.Stack)`
|
|
143
143
|
box-sizing: border-box;
|
|
144
144
|
min-height: 100%;
|
|
145
145
|
padding: 0;
|
|
@@ -147,7 +147,7 @@ Take a look at the reducer(s) handling this action type: ${y.type}.
|
|
|
147
147
|
align-items: center;
|
|
148
148
|
flex-direction: row;
|
|
149
149
|
margin-left: 23px;
|
|
150
|
-
`,tT=()=>I.jsx(eT,{children:I.jsx(K2,{})}),nT="Enhance with Custom Connectors",rT="Let us know your use case, and we'll design and deliver a custom connector tailored to your needs within a few working days.",nm="Request new connector",oT="Create your own (coming soon)",iT="Request new feature",aT="Request a new connector",rm="Tell us your use case and we will create a connector for you within a few working days.",sT=`Request new connectors to get better customer context and key actions right into your inbox. ${rm}`,lT="Select a feature",uT="Select a connector",cT="Feel free to add specific details (Optional)",dT="Submit Request",fT="Request submitted",pT="Your request has been submitted successfully. We will get back to you within a few working days.",hT="Done",gT="Add connector",mT="Edit connector",bT="Enable",vT="Disable",om={CONNECTOR:"connector",API:"api"},yT="Failed to submit the request. Please try again."
|
|
150
|
+
`,tT=()=>I.jsx(eT,{children:I.jsx(K2,{})}),nT="Enhance with Custom Connectors",rT="Let us know your use case, and we'll design and deliver a custom connector tailored to your needs within a few working days.",nm="Request new connector",oT="Create your own (coming soon)",iT="Request new feature",aT="Request a new connector",rm="Tell us your use case and we will create a connector for you within a few working days.",sT=`Request new connectors to get better customer context and key actions right into your inbox. ${rm}`,lT="Select a feature",uT="Select a connector",cT="Feel free to add specific details (Optional)",dT="Submit Request",fT="Request submitted",pT="Your request has been submitted successfully. We will get back to you within a few working days.",hT="Done",gT="Add connector",mT="Edit connector",bT="Enable",vT="Disable",om={CONNECTOR:"connector",API:"api"},yT="Failed to submit the request. Please try again.",$e={REQUEST_NEW_CLICKED:"request_new_connector_clicked",TOGGLE_ENABLED:"connector_enabled_clicked",TOGGLE_DISABLED:"connector_disabled_clicked",SETTINGS_CLICKED:"connector_settings_clicked",ADD_CONNECTOR_CLICKED:"add_connector_clicked",CONNECTOR_BACK_CLICKED:"connector_back_button_clicked",SAVE_AUTHORIZE_CLICKED:"save_and_authenticate_clicked",SEND_TEST_CLICK:"send_test_request_clicked",AUTH_UPDATED:"auth_type_updated",REQUEST_NEW_FEATURE_CLICKED:"request_new_feature_clicked",REQUEST_NEW_CONNECTOR_SHOWN:"request_new_connector_popup_shown",REQUEST_NEW_CONNECTOR_SUBMIT_CLICKED:"request_new_connector_popup_submitted_clicked",REQUEST_NEW_CONNECTOR_CLOSE_CLICKED:"request_new_connector_popup_closed_clicked",REQUEST_NEW_CONNECTOR_DONE_CLICKED:"request_new_connector_popup_done_clicked",REQUEST_NEW_FEATURE_SHOWN:"request_new_feature_popup_shown",REQUEST_NEW_FEATURE_SUBMIT_CLICKED:"request_new_feature_popup_submitted_clicked",REQUEST_NEW_FEATURE_CLOSE_CLICKED:"request_new_feature_popup_closed_clicked",REQUEST_NEW_FEATURE_DONE_CLICKED:"request_new_feature_popup_done_clicked",LIBRARY_CARD_CLICKED:"library_item_clicked",TAB_CLICKED:"tab_clicked",CONFIGURE_VISIBILITY_CLICKED:"configure_visibility_clicked",CARD_VISIBILITY_UPDATED:"card_visibility_updated",CARD_VISIBILITY_UPDATE_CLOSED:"card_visibility_update_closed",CONNECTOR_VISIBILITY_FIELD_TAB_CLICKED:"connector_visibility_field_tab_clicked",SCHEDULE_CALL_CLICKED:"schedule_call_clicked",SCHEDULE_CALL_CROSS_CLICKED:"schedule_call_cross_clicked",CONNECTOR_VIDEO_CLICKED:"connector_video_clicked",CONNECTOR_AUTH_PAGE_KB_CLICKED:"connector_auth_page_kb_clicked",CONNECTOR_AUTH_PAGE_CONTACT_SUPPORT_CLICKED:"connector_auth_page_contact_support_clicked",CONNECTOR_AUTH_SUCCESS:"connector_auth_success",CONNECTOR_SECTION_VIEWED:"connector_section_viewed"},ET={AUTH_PAGE:"auth_page",DETAILS_PAGE:"details_page",CONNECTORS_PAGE_ADMIN_SIDE:"connectors_page_admin_side"},uo=c1.withTypes(),qe=Ky.withTypes(),fr=w.styled(w.Skeleton)`
|
|
151
151
|
display: block;
|
|
152
152
|
margin: ${e=>e.margin?e.margin:0};
|
|
153
153
|
`,xT=w.styled("li")`
|
|
@@ -242,7 +242,7 @@ Take a look at the reducer(s) handling this action type: ${y.type}.
|
|
|
242
242
|
height: 20px;
|
|
243
243
|
background: linear-gradient(to right, #ffe250, #ffc350);
|
|
244
244
|
color: ${w.palette.gray.gray1};
|
|
245
|
-
`,rA=()=>{const{availableFeatures:e,sendTrackingEvent:t}=S.useContext(
|
|
245
|
+
`,rA=()=>{const{availableFeatures:e,sendTrackingEvent:t}=S.useContext(zt),n=so(),r=uo(),o=qe(zh),i=qe(oc),a=qe(Tw);S.useEffect(()=>{r(Hs())},[r]);const l=(s,u)=>{var f;s==null||s.stopPropagation();const c=(f=i==null?void 0:i[u])==null?void 0:f.name;t($e.LIBRARY_CARD_CLICKED,{connector_name:c}),n(`${Xe.BASEPATH}${Xe.API_VIEW}/${u}`)};return I.jsx(wT,{"data-testid":"connector-library",component:"ul",children:a===Ie.LOADING?I.jsx(CT,{}):I.jsx(I.Fragment,{children:o.map(s=>{const u=i==null?void 0:i[s];if(!u)return null;const{isTemplateNew:c}=u,f=fa(e)&&c;return I.jsxs(IT,{onClick:b=>l(b,s),component:"li",children:[I.jsxs(w.Stack,{direction:"row",justifyContent:"space-between",children:[I.jsx(ST,{children:I.jsx("img",{src:u.logo??"",alt:u.name})}),I.jsx(Na,{hidden:!f,label:Mc})]}),I.jsx(Fc,{variant:"h2",children:u.name}),I.jsx(TT,{variant:"body1",color:"rgba(108, 123, 148, 1)",children:u.description})]},s)})})})},oA=w.styled(w.Icon)`
|
|
246
246
|
width: 203px;
|
|
247
247
|
height: 161px;
|
|
248
248
|
`,iA=w.styled(w.Stack)`
|
|
@@ -293,7 +293,7 @@ Take a look at the reducer(s) handling this action type: ${y.type}.
|
|
|
293
293
|
box-shadow: none;
|
|
294
294
|
color: ${w.theme.palette.gray.black};
|
|
295
295
|
border: 1px solid ${w.theme.palette.gray.gray5};
|
|
296
|
-
`,fA=({setModalState:e})=>{const t=n=>{n==null||n.stopPropagation(),
|
|
296
|
+
`,fA=({setModalState:e})=>{const t=n=>{n==null||n.stopPropagation(),e(!0)};return I.jsxs(iA,{direction:"row",justifyContent:"space-between","data-testid":"connector-not-available-request-new",children:[I.jsxs(aA,{children:[I.jsx(sA,{variant:"h1",color:w.theme.palette.gray.black,children:nT}),I.jsx(lA,{variant:"body1",color:w.theme.palette.gray.gray2,children:rT}),I.jsxs(uA,{direction:"row",justifyContent:"space-between",children:[I.jsx(cA,{variant:"contained",onClick:t,children:nm}),I.jsx(dA,{variant:"outlined",className:"create-own__btn",children:oT})]})]}),I.jsx(oA,{children:I.jsx("img",{src:q2})})]})},Bc=S.createContext({hasRendered:!1,setHasRendered:()=>{}}),dm=S.memo(({children:e})=>{const[t,n]=S.useState(!1),r=S.useMemo(()=>({hasRendered:t,setHasRendered:n}),[t,n]);return I.jsx(Bc.Provider,{value:r,children:e})});dm.displayName="SingletonProvider";const fm=e=>e.connectorLirary.connectorList,bl=e=>e.connectorLirary.connectors,pm=e=>e.connectorLirary.connectorsApiStatus,pA=e=>e.connectorLirary.currentUpdatingConnectors,jc=e=>e.connectorLirary.connectorDetailApiStatus,hm=e=>e.connectorLirary.emailInboxDetails,gm=e=>e.connectorLirary.rolesAndPermissions,hA=e=>e.connectorLirary.updateEnableConnectorsApiStatus,gA=e=>e.connectorLirary.cardCustomFields,mA=e=>e.connectorLirary.cardCustomFieldsApiStatus,bA=w.styled(w.Box)`
|
|
297
297
|
border-radius: 4px;
|
|
298
298
|
border: 1px solid ${w.theme.palette.gray.gray5};
|
|
299
299
|
margin-bottom: 12px;
|
|
@@ -459,7 +459,7 @@ Take a look at the reducer(s) handling this action type: ${y.type}.
|
|
|
459
459
|
To pick up a draggable item, press the space bar.
|
|
460
460
|
While dragging, use the arrow keys to move the item.
|
|
461
461
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
462
|
-
`},p_={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function h_(e){let{announcements:t=p_,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=f_}=e;const{announce:i,announcement:a}=u_(),l=Fa("DndLiveRegion"),[s,u]=S.useState(!1);if(S.useEffect(()=>{u(!0)},[]),c_(S.useMemo(()=>({onDragStart(f){let{active:b}=f;i(t.onDragStart({active:b}))},onDragMove(f){let{active:b,over:y}=f;t.onDragMove&&i(t.onDragMove({active:b,over:y}))},onDragOver(f){let{active:b,over:y}=f;i(t.onDragOver({active:b,over:y}))},onDragEnd(f){let{active:b,over:y}=f;i(t.onDragEnd({active:b,over:y}))},onDragCancel(f){let{active:b,over:y}=f;i(t.onDragCancel({active:b,over:y}))}}),[i,t])),!s)return null;const c=S.createElement(S.Fragment,null,S.createElement(s_,{id:r,value:o.draggable}),S.createElement(l_,{id:l,announcement:a}));return n?Qe.createPortal(c,n):c}var Zt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Zt||(Zt={}));function Cl(){}function g_(e,t){return S.useMemo(()=>({sensor:e,options:{}}),[e,t])}function m_(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return S.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const pr=Object.freeze({x:0,y:0});function b_(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function v_(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function y_(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function E_(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Cm(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const x_=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Cm(t,t.left,t.top),i=[];for(const a of r){const{id:l}=a,s=n.get(l);if(s){const u=b_(Cm(s),o);i.push({id:l,data:{droppableContainer:a,value:u}})}}return i.sort(v_)};function C_(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r<o&&n<i){const s=t.width*t.height,u=e.width*e.height,c=a*l,f=c/(s+u-c);return Number(f.toFixed(4))}return 0}const w_=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:a}=i,l=n.get(a);if(l){const s=C_(l,t);s>0&&o.push({id:a,data:{droppableContainer:i,value:s}})}}return o.sort(y_)};function I_(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function wm(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:pr}function S_(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((a,l)=>({...a,top:a.top+e*l.y,bottom:a.bottom+e*l.y,left:a.left+e*l.x,right:a.right+e*l.x}),{...n})}}const T_=S_(1);function A_(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function __(e,t,n){const r=A_(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,s=e.left-a-(1-o)*parseFloat(n),u=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),c=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:c,height:f,top:u,right:s+c,bottom:u+f,left:s}}const O_={ignoreTransform:!1};function wi(e,t){t===void 0&&(t=O_);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:c}=An(e).getComputedStyle(e);u&&(n=__(n,u,c))}const{top:r,left:o,width:i,height:a,bottom:l,right:s}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:s}}function Im(e){return wi(e,{ignoreTransform:!0})}function R_(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function N_(e,t){return t===void 0&&(t=An(e).getComputedStyle(e)),t.position==="fixed"}function D_(e,t){t===void 0&&(t=An(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function Uc(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Wc(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Pa(o)||vm(o)||n.includes(o))return n;const i=An(e).getComputedStyle(o);return o!==e&&D_(o,i)&&n.push(o),N_(o,i)?n:r(o.parentNode)}return e?r(e):n}function Sm(e){const[t]=Uc(e,1);return t??null}function qc(e){return!yl||!e?null:Ei(e)?e:Gc(e)?Wc(e)||e===xi(e).scrollingElement?window:Pa(e)?e:null:null}function Tm(e){return Ei(e)?e.scrollX:e.scrollLeft}function Am(e){return Ei(e)?e.scrollY:e.scrollTop}function Jc(e){return{x:Tm(e),y:Am(e)}}var Jt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Jt||(Jt={}));function _m(e){return!yl||!e?!1:e===document.scrollingElement}function Om(e){const t={x:0,y:0},n=_m(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:a,isRight:l,maxScroll:r,minScroll:t}}const P_={x:.2,y:.2};function k_(e,t,n,r,o){let{top:i,left:a,right:l,bottom:s}=n;r===void 0&&(r=10),o===void 0&&(o=P_);const{isTop:u,isBottom:c,isLeft:f,isRight:b}=Om(e),y={x:0,y:0},v={x:0,y:0},d={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+d.height?(y.y=Jt.Backward,v.y=r*Math.abs((t.top+d.height-i)/d.height)):!c&&s>=t.bottom-d.height&&(y.y=Jt.Forward,v.y=r*Math.abs((t.bottom-d.height-s)/d.height)),!b&&l>=t.right-d.width?(y.x=Jt.Forward,v.x=r*Math.abs((t.right-d.width-l)/d.width)):!f&&a<=t.left+d.width&&(y.x=Jt.Backward,v.x=r*Math.abs((t.left+d.width-a)/d.width)),{direction:y,speed:v}}function L_(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Rm(e){return e.reduce((t,n)=>Ci(t,Jc(n)),pr)}function F_(e){return e.reduce((t,n)=>t+Tm(n),0)}function M_(e){return e.reduce((t,n)=>t+Am(n),0)}function B_(e,t){if(t===void 0&&(t=wi),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Sm(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const j_=[["x",["left","right"],F_],["y",["top","bottom"],M_]];class Qc{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Uc(n),o=Rm(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,a,l]of j_)for(const s of a)Object.defineProperty(this,s,{get:()=>{const u=l(r),c=o[i]-u;return this.rect[s]+c},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ba{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function V_(e){const{EventTarget:t}=An(e);return e instanceof t?e:xi(e)}function $c(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Jn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Jn||(Jn={}));function Nm(e){e.preventDefault()}function G_(e){e.stopPropagation()}var st;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(st||(st={}));const Dm={start:[st.Space,st.Enter],cancel:[st.Esc],end:[st.Space,st.Enter]},W_=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case st.Right:return{...n,x:n.x+25};case st.Left:return{...n,x:n.x-25};case st.Down:return{...n,y:n.y+25};case st.Up:return{...n,y:n.y-25}}};class Pm{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ba(xi(n)),this.windowListeners=new Ba(An(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Jn.Resize,this.handleCancel),this.windowListeners.add(Jn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Jn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&B_(r),n(pr)}handleKeyDown(t){if(Zc(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=Dm,coordinateGetter:a=W_,scrollBehavior:l="smooth"}=o,{code:s}=t;if(i.end.includes(s)){this.handleEnd(t);return}if(i.cancel.includes(s)){this.handleCancel(t);return}const{collisionRect:u}=r.current,c=u?{x:u.left,y:u.top}:pr;this.referenceCoordinates||(this.referenceCoordinates=c);const f=a(t,{active:n,context:r.current,currentCoordinates:c});if(f){const b=xl(f,c),y={x:0,y:0},{scrollableAncestors:v}=r.current;for(const d of v){const p=t.code,{isTop:h,isRight:g,isLeft:m,isBottom:E,maxScroll:x,minScroll:A}=Om(d),T=L_(d),C={x:Math.min(p===st.Right?T.right-T.width/2:T.right,Math.max(p===st.Right?T.left:T.left+T.width/2,f.x)),y:Math.min(p===st.Down?T.bottom-T.height/2:T.bottom,Math.max(p===st.Down?T.top:T.top+T.height/2,f.y))},O=p===st.Right&&!g||p===st.Left&&!m,M=p===st.Down&&!E||p===st.Up&&!h;if(O&&C.x!==f.x){const B=d.scrollLeft+b.x,U=p===st.Right&&B<=x.x||p===st.Left&&B>=A.x;if(U&&!b.y){d.scrollTo({left:B,behavior:l});return}U?y.x=d.scrollLeft-B:y.x=p===st.Right?d.scrollLeft-x.x:d.scrollLeft-A.x,y.x&&d.scrollBy({left:-y.x,behavior:l});break}else if(M&&C.y!==f.y){const B=d.scrollTop+b.y,U=p===st.Down&&B<=x.y||p===st.Up&&B>=A.y;if(U&&!b.x){d.scrollTo({top:B,behavior:l});return}U?y.y=d.scrollTop-B:y.y=p===st.Down?d.scrollTop-x.y:d.scrollTop-A.y,y.y&&d.scrollBy({top:-y.y,behavior:l});break}}this.handleMove(t,Ci(xl(f,this.referenceCoordinates),y))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Pm.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Dm,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const l=i.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function km(e){return!!(e&&"distance"in e)}function Lm(e){return!!(e&&"delay"in e)}class Kc{constructor(t,n,r){var o;r===void 0&&(r=V_(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:a}=i;this.props=t,this.events=n,this.document=xi(a),this.documentListeners=new Ba(this.document),this.listeners=new Ba(r),this.windowListeners=new Ba(An(a)),this.initialCoordinates=(o=Yc(i))!=null?o:pr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Jn.Resize,this.handleCancel),this.windowListeners.add(Jn.DragStart,Nm),this.windowListeners.add(Jn.VisibilityChange,this.handleCancel),this.windowListeners.add(Jn.ContextMenu,Nm),this.documentListeners.add(Jn.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Lm(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}if(km(n))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Jn.Click,G_,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Jn.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:a,options:{activationConstraint:l}}=i;if(!o)return;const s=(n=Yc(t))!=null?n:pr,u=xl(o,s);if(!r&&l){if(km(l)){if(l.tolerance!=null&&$c(u,l.tolerance))return this.handleCancel();if($c(u,l.distance))return this.handleStart()}return Lm(l)&&$c(u,l.tolerance)?this.handleCancel():void 0}t.cancelable&&t.preventDefault(),a(s)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===st.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const H_={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ed extends Kc{constructor(t){const{event:n}=t,r=xi(n.target);super(t,H_,r)}}ed.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const z_={move:{name:"mousemove"},end:{name:"mouseup"}};var td;(function(e){e[e.RightClick=2]="RightClick"})(td||(td={}));class X_ extends Kc{constructor(t){super(t,z_,xi(t.event.target))}}X_.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===td.RightClick?!1:(r==null||r({event:n}),!0)}}];const nd={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Z_ extends Kc{constructor(t){super(t,nd)}static setup(){return window.addEventListener(nd.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(nd.move.name,t)};function t(){}}}Z_.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var ja;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ja||(ja={}));var wl;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(wl||(wl={}));function Y_(e){let{acceleration:t,activator:n=ja.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:l=wl.TreeOrder,pointerCoordinates:s,scrollableAncestors:u,scrollableAncestorRects:c,delta:f,threshold:b}=e;const y=q_({delta:f,disabled:!i}),[v,d]=n_(),p=S.useRef({x:0,y:0}),h=S.useRef({x:0,y:0}),g=S.useMemo(()=>{switch(n){case ja.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case ja.DraggableRect:return o}},[n,o,s]),m=S.useRef(null),E=S.useCallback(()=>{const A=m.current;if(!A)return;const T=p.current.x*h.current.x,C=p.current.y*h.current.y;A.scrollBy(T,C)},[]),x=S.useMemo(()=>l===wl.TreeOrder?[...u].reverse():u,[l,u]);S.useEffect(()=>{if(!i||!u.length||!g){d();return}for(const A of x){if((r==null?void 0:r(A))===!1)continue;const T=u.indexOf(A),C=c[T];if(!C)continue;const{direction:O,speed:M}=k_(A,C,g,t,b);for(const B of["x","y"])y[B][O[B]]||(M[B]=0,O[B]=0);if(M.x>0||M.y>0){d(),m.current=A,v(E,a),p.current=M,h.current=O;return}}p.current={x:0,y:0},h.current={x:0,y:0},d()},[t,E,r,d,i,a,JSON.stringify(g),JSON.stringify(y),v,u,x,c,JSON.stringify(b)])}const U_={x:{[Jt.Backward]:!1,[Jt.Forward]:!1},y:{[Jt.Backward]:!1,[Jt.Forward]:!1}};function q_(e){let{delta:t,disabled:n}=e;const r=zc(t);return La(o=>{if(n||!r||!o)return U_;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Jt.Backward]:o.x[Jt.Backward]||i.x===-1,[Jt.Forward]:o.x[Jt.Forward]||i.x===1},y:{[Jt.Backward]:o.y[Jt.Backward]||i.y===-1,[Jt.Forward]:o.y[Jt.Forward]||i.y===1}}},[n,t,r])}function J_(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return La(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function Q_(e,t){return S.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...i]},[]),[e,t])}var Va;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Va||(Va={}));var rd;(function(e){e.Optimized="optimized"})(rd||(rd={}));const Fm=new Map;function $_(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=S.useState(null),{frequency:l,measure:s,strategy:u}=o,c=S.useRef(e),f=p(),b=ka(f),y=S.useCallback(function(h){h===void 0&&(h=[]),!b.current&&a(g=>g===null?h:g.concat(h.filter(m=>!g.includes(m))))},[b]),v=S.useRef(null),d=La(h=>{if(f&&!n)return Fm;if(!h||h===Fm||c.current!==e||i!=null){const g=new Map;for(let m of e){if(!m)continue;if(i&&i.length>0&&!i.includes(m.id)&&m.rect.current){g.set(m.id,m.rect.current);continue}const E=m.node.current,x=E?new Qc(s(E),E):null;m.rect.current=x,x&&g.set(m.id,x)}return g}return h},[e,i,n,f,s]);return S.useEffect(()=>{c.current=e},[e]),S.useEffect(()=>{f||y()},[n,f]),S.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),S.useEffect(()=>{f||typeof l!="number"||v.current!==null||(v.current=setTimeout(()=>{y(),v.current=null},l))},[l,f,y,...r]),{droppableRects:d,measureDroppableContainers:y,measuringScheduled:i!=null};function p(){switch(u){case Va.Always:return!1;case Va.BeforeDragging:return n;default:return!n}}}function Mm(e,t){return La(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function K_(e,t){return Mm(e,t)}function eO(e){let{callback:t,disabled:n}=e;const r=Hc(t),o=S.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return S.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Il(e){let{callback:t,disabled:n}=e;const r=Hc(t),o=S.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return S.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function tO(e){return new Qc(wi(e),e)}function Bm(e,t,n){t===void 0&&(t=tO);const[r,o]=S.useState(null);function i(){o(s=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=s??n)!=null?u:null}const c=t(e);return JSON.stringify(s)===JSON.stringify(c)?s:c})}const a=eO({callback(s){if(e)for(const u of s){const{type:c,target:f}=u;if(c==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),l=Il({callback:i});return xr(()=>{i(),e?(l==null||l.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),a==null||a.disconnect())},[e]),r}function nO(e){const t=Mm(e);return wm(e,t)}const jm=[];function rO(e){const t=S.useRef(e),n=La(r=>e?r&&r!==jm&&e&&t.current&&e.parentNode===t.current.parentNode?r:Uc(e):jm,[e]);return S.useEffect(()=>{t.current=e},[e]),n}function oO(e){const[t,n]=S.useState(null),r=S.useRef(e),o=S.useCallback(i=>{const a=qc(i.target);a&&n(l=>l?(l.set(a,Jc(a)),new Map(l)):null)},[]);return S.useEffect(()=>{const i=r.current;if(e!==i){a(i);const l=e.map(s=>{const u=qc(s);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,Jc(u)]):null}).filter(s=>s!=null);n(l.length?new Map(l):null),r.current=e}return()=>{a(e),a(i)};function a(l){l.forEach(s=>{const u=qc(s);u==null||u.removeEventListener("scroll",o)})}},[o,e]),S.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,a)=>Ci(i,a),pr):Rm(e):pr,[e,t])}function Vm(e,t){t===void 0&&(t=[]);const n=S.useRef(null);return S.useEffect(()=>{n.current=null},t),S.useEffect(()=>{const r=e!==pr;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?xl(e,n.current):pr}function iO(e){S.useEffect(()=>{if(!yl)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function aO(e,t){return S.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=a=>{i(a,t)},n},{}),[e,t])}function Gm(e){return S.useMemo(()=>e?R_(e):null,[e])}const Wm=[];function sO(e,t){t===void 0&&(t=wi);const[n]=e,r=Gm(n?An(n):null),[o,i]=S.useState(Wm);function a(){i(()=>e.length?e.map(s=>_m(s)?r:new Qc(t(s),s)):Wm)}const l=Il({callback:a});return xr(()=>{l==null||l.disconnect(),a(),e.forEach(s=>l==null?void 0:l.observe(s))},[e]),o}function lO(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Pa(t)?t:e}function uO(e){let{measure:t}=e;const[n,r]=S.useState(null),o=S.useCallback(u=>{for(const{target:c}of u)if(Pa(c)){r(f=>{const b=t(c);return f?{...f,width:b.width,height:b.height}:b});break}},[t]),i=Il({callback:o}),a=S.useCallback(u=>{const c=lO(u);i==null||i.disconnect(),c&&(i==null||i.observe(c)),r(c?t(c):null)},[t,i]),[l,s]=El(a);return S.useMemo(()=>({nodeRef:l,rect:n,setRef:s}),[n,l,s])}const cO=[{sensor:ed,options:{}},{sensor:Pm,options:{}}],dO={current:{}},Sl={draggable:{measure:Im},droppable:{measure:Im,strategy:Va.WhileDragging,frequency:rd.Optimized},dragOverlay:{measure:wi}};class Ga extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const fO={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ga,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Cl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Sl,measureDroppableContainers:Cl,windowRect:null,measuringScheduled:!1},pO={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Cl,draggableNodes:new Map,over:null,measureDroppableContainers:Cl},Tl=S.createContext(pO),Hm=S.createContext(fO);function hO(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ga}}}function gO(e,t){switch(t.type){case Zt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Zt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Zt.DragEnd:case Zt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Zt.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Ga(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Zt.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new Ga(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Zt.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Ga(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function mO(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=S.useContext(Tl),i=zc(r),a=zc(n==null?void 0:n.id);return S.useEffect(()=>{if(!t&&!r&&i&&a!=null){if(!Zc(i)||document.activeElement===i.target)return;const l=o.get(a);if(!l)return;const{activatorNode:s,node:u}=l;if(!s.current&&!u.current)return;requestAnimationFrame(()=>{for(const c of[s.current,u.current]){if(!c)continue;const f=i_(c);if(f){f.focus();break}}})}},[r,t,o,a,i]),null}function bO(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function vO(e){return S.useMemo(()=>({draggable:{...Sl.draggable,...e==null?void 0:e.draggable},droppable:{...Sl.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Sl.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function yO(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=S.useRef(!1),{x:a,y:l}=typeof o=="boolean"?{x:o,y:o}:o;xr(()=>{if(!a&&!l||!t){i.current=!1;return}if(i.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const c=n(u),f=wm(c,r);if(a||(f.x=0),l||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const b=Sm(u);b&&b.scrollBy({top:f.y,left:f.x})}},[t,a,l,r,n])}const zm=S.createContext({...pr,scaleX:1,scaleY:1});var fo;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(fo||(fo={}));const EO=S.memo(function(t){var n,r,o,i;let{id:a,accessibility:l,autoScroll:s=!0,children:u,sensors:c=cO,collisionDetection:f=w_,measuring:b,modifiers:y,...v}=t;const d=S.useReducer(gO,void 0,hO),[p,h]=d,[g,m]=d_(),[E,x]=S.useState(fo.Uninitialized),A=E===fo.Initialized,{draggable:{active:T,nodes:C,translate:O},droppable:{containers:M}}=p,B=T!=null?C.get(T):null,U=S.useRef({initial:null,translated:null}),G=S.useMemo(()=>{var ht;return T!=null?{id:T,data:(ht=B==null?void 0:B.data)!=null?ht:dO,rect:U}:null},[T,B]),X=S.useRef(null),[q,$]=S.useState(null),[ue,se]=S.useState(null),ve=ka(v,Object.values(v)),W=Fa("DndDescribedBy",a),te=S.useMemo(()=>M.getEnabled(),[M]),re=vO(b),{droppableRects:K,measureDroppableContainers:oe,measuringScheduled:de}=$_(te,{dragging:A,dependencies:[O.x,O.y],config:re.droppable}),ie=J_(C,T),ge=S.useMemo(()=>ue?Yc(ue):null,[ue]),Ee=$e(),Ae=K_(ie,re.draggable.measure);yO({activeNode:T!=null?C.get(T):null,config:Ee.layoutShiftCompensation,initialRect:Ae,measure:re.draggable.measure});const me=Bm(ie,re.draggable.measure,Ae),ze=Bm(ie?ie.parentElement:null),V=S.useRef({activatorEvent:null,active:null,activeNode:ie,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ye=M.getNodeFor((n=V.current.over)==null?void 0:n.id),Le=uO({measure:re.dragOverlay.measure}),Ue=(r=Le.nodeRef.current)!=null?r:ie,Pt=A?(o=Le.rect)!=null?o:me:null,Nn=!!(Le.nodeRef.current&&Le.rect),kt=nO(Nn?null:me),Ut=Gm(Ue?An(Ue):null),mt=rO(A?Ye??ie:null),zn=sO(mt),cn=bO(y,{transform:{x:O.x-kt.x,y:O.y-kt.y,scaleX:1,scaleY:1},activatorEvent:ue,active:G,activeNodeRect:me,containerNodeRect:ze,draggingNodeRect:Pt,over:V.current.over,overlayNodeRect:Le.rect,scrollableAncestors:mt,scrollableAncestorRects:zn,windowRect:Ut}),So=ge?Ci(ge,O):null,To=oO(mt),Ao=Vm(To),Dn=Vm(To,[me]),Vt=Ci(cn,Ao),Xn=Pt?T_(Pt,cn):null,dn=G&&Xn?f({active:G,collisionRect:Xn,droppableRects:K,droppableContainers:te,pointerCoordinates:So}):null,fn=E_(dn,"id"),[Ct,Ur]=S.useState(null),Fr=Nn?cn:Ci(cn,Dn),_o=I_(Fr,(i=Ct==null?void 0:Ct.rect)!=null?i:null,me),pn=S.useRef(null),qr=S.useCallback((ht,At)=>{let{sensor:_t,options:rn}=At;if(X.current==null)return;const Lt=C.get(X.current);if(!Lt)return;const Gt=ht.nativeEvent,Kt=new _t({active:X.current,activeNode:Lt,event:Gt,options:rn,context:V,onStart(Wt){const xt=X.current;if(xt==null)return;const Zn=C.get(xt);if(!Zn)return;const{onDragStart:Yn}=ve.current,hn={activatorEvent:Gt,active:{id:xt,data:Zn.data,rect:U}};Qe.unstable_batchedUpdates(()=>{Yn==null||Yn(hn),x(fo.Initializing),h({type:Zt.DragStart,initialCoordinates:Wt,active:xt}),g({type:"onDragStart",event:hn}),$(pn.current),se(Gt)})},onMove(Wt){h({type:Zt.DragMove,coordinates:Wt})},onEnd:Pn(Zt.DragEnd),onCancel:Pn(Zt.DragCancel)});pn.current=Kt;function Pn(Wt){return async function(){const{active:Zn,collisions:Yn,over:hn,scrollAdjustedTranslate:R}=V.current;let k=null;if(Zn&&R){const{cancelDrop:j}=ve.current;k={activatorEvent:Gt,active:Zn,collisions:Yn,delta:R,over:hn},Wt===Zt.DragEnd&&typeof j=="function"&&await Promise.resolve(j(k))&&(Wt=Zt.DragCancel)}X.current=null,Qe.unstable_batchedUpdates(()=>{h({type:Wt}),x(fo.Uninitialized),Ur(null),$(null),se(null),pn.current=null;const j=Wt===Zt.DragEnd?"onDragEnd":"onDragCancel";if(k){const _=ve.current[j];_==null||_(k),g({type:j,event:k})}})}}},[C]),we=S.useCallback((ht,At)=>(_t,rn)=>{const Lt=_t.nativeEvent,Gt=C.get(rn);if(X.current!==null||!Gt||Lt.dndKit||Lt.defaultPrevented)return;const Kt={active:Gt};ht(_t,At.options,Kt)===!0&&(Lt.dndKit={capturedBy:At.sensor},X.current=rn,qr(_t,At))},[C,qr]),mr=Q_(c,we);iO(c),xr(()=>{me&&E===fo.Initializing&&x(fo.Initialized)},[me,E]),S.useEffect(()=>{const{onDragMove:ht}=ve.current,{active:At,activatorEvent:_t,collisions:rn,over:Lt}=V.current;if(!At||!_t)return;const Gt={active:At,activatorEvent:_t,collisions:rn,delta:{x:Vt.x,y:Vt.y},over:Lt};Qe.unstable_batchedUpdates(()=>{ht==null||ht(Gt),g({type:"onDragMove",event:Gt})})},[Vt.x,Vt.y]),S.useEffect(()=>{const{active:ht,activatorEvent:At,collisions:_t,droppableContainers:rn,scrollAdjustedTranslate:Lt}=V.current;if(!ht||X.current==null||!At||!Lt)return;const{onDragOver:Gt}=ve.current,Kt=rn.get(fn),Pn=Kt&&Kt.rect.current?{id:Kt.id,rect:Kt.rect.current,data:Kt.data,disabled:Kt.disabled}:null,Wt={active:ht,activatorEvent:At,collisions:_t,delta:{x:Lt.x,y:Lt.y},over:Pn};Qe.unstable_batchedUpdates(()=>{Ur(Pn),Gt==null||Gt(Wt),g({type:"onDragOver",event:Wt})})},[fn]),xr(()=>{V.current={activatorEvent:ue,active:G,activeNode:ie,collisionRect:Xn,collisions:dn,droppableRects:K,draggableNodes:C,draggingNode:Ue,draggingNodeRect:Pt,droppableContainers:M,over:Ct,scrollableAncestors:mt,scrollAdjustedTranslate:Vt},U.current={initial:Pt,translated:Xn}},[G,ie,dn,Xn,C,Ue,Pt,K,M,Ct,mt,Vt]),Y_({...Ee,delta:O,draggingRect:Xn,pointerCoordinates:So,scrollableAncestors:mt,scrollableAncestorRects:zn});const er=S.useMemo(()=>({active:G,activeNode:ie,activeNodeRect:me,activatorEvent:ue,collisions:dn,containerNodeRect:ze,dragOverlay:Le,draggableNodes:C,droppableContainers:M,droppableRects:K,over:Ct,measureDroppableContainers:oe,scrollableAncestors:mt,scrollableAncestorRects:zn,measuringConfiguration:re,measuringScheduled:de,windowRect:Ut}),[G,ie,me,ue,dn,ze,Le,C,M,K,Ct,oe,mt,zn,re,de,Ut]),wt=S.useMemo(()=>({activatorEvent:ue,activators:mr,active:G,activeNodeRect:me,ariaDescribedById:{draggable:W},dispatch:h,draggableNodes:C,over:Ct,measureDroppableContainers:oe}),[ue,mr,G,me,h,W,C,Ct,oe]);return S.createElement(xm.Provider,{value:m},S.createElement(Tl.Provider,{value:wt},S.createElement(Hm.Provider,{value:er},S.createElement(zm.Provider,{value:_o},u)),S.createElement(mO,{disabled:(l==null?void 0:l.restoreFocus)===!1})),S.createElement(h_,{...l,hiddenTextDescribedById:W}));function $e(){const ht=(q==null?void 0:q.autoScrollEnabled)===!1,At=typeof s=="object"?s.enabled===!1:s===!1,_t=A&&!ht&&!At;return typeof s=="object"?{...s,enabled:_t}:{enabled:_t}}}),xO=S.createContext(null),Xm="button",CO="Draggable";function wO(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Fa(CO),{activators:a,activatorEvent:l,active:s,activeNodeRect:u,ariaDescribedById:c,draggableNodes:f,over:b}=S.useContext(Tl),{role:y=Xm,roleDescription:v="draggable",tabIndex:d=0}=o??{},p=(s==null?void 0:s.id)===t,h=S.useContext(p?zm:xO),[g,m]=El(),[E,x]=El(),A=aO(a,t),T=ka(n);xr(()=>(f.set(t,{id:t,key:i,node:g,activatorNode:E,data:T}),()=>{const O=f.get(t);O&&O.key===i&&f.delete(t)}),[f,t]);const C=S.useMemo(()=>({role:y,tabIndex:d,"aria-disabled":r,"aria-pressed":p&&y===Xm?!0:void 0,"aria-roledescription":v,"aria-describedby":c.draggable}),[r,y,d,p,v,c.draggable]);return{active:s,activatorEvent:l,activeNodeRect:u,attributes:C,isDragging:p,listeners:r?void 0:A,node:g,over:b,setNodeRef:m,setActivatorNodeRef:x,transform:h}}function IO(){return S.useContext(Hm)}const SO="Droppable",TO={timeout:25};function AO(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Fa(SO),{active:a,dispatch:l,over:s,measureDroppableContainers:u}=S.useContext(Tl),c=S.useRef({disabled:n}),f=S.useRef(!1),b=S.useRef(null),y=S.useRef(null),{disabled:v,updateMeasurementsFor:d,timeout:p}={...TO,...o},h=ka(d??r),g=S.useCallback(()=>{if(!f.current){f.current=!0;return}y.current!=null&&clearTimeout(y.current),y.current=setTimeout(()=>{u(Array.isArray(h.current)?h.current:[h.current]),y.current=null},p)},[p]),m=Il({callback:g,disabled:v||!a}),E=S.useCallback((C,O)=>{m&&(O&&(m.unobserve(O),f.current=!1),C&&m.observe(C))},[m]),[x,A]=El(E),T=ka(t);return S.useEffect(()=>{!m||!x.current||(m.disconnect(),f.current=!1,m.observe(x.current))},[x,m]),S.useEffect(()=>(l({type:Zt.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:b,data:T}}),()=>l({type:Zt.UnregisterDroppable,key:i,id:r})),[r]),S.useEffect(()=>{n!==c.current.disabled&&(l({type:Zt.SetDroppableDisabled,id:r,key:i,disabled:n}),c.current.disabled=n)},[r,i,n,l]),{active:a,rect:b,isOver:(s==null?void 0:s.id)===r,node:x,over:s,setNodeRef:A}}function od(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function _O(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function Al(e){return e!==null&&e>=0}function OO(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function RO(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Zm=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=od(t,r,n),a=t[o],l=i[o];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}},_l={scaleX:1,scaleY:1},NO=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:a}=e;const l=(t=i[n])!=null?t:r;if(!l)return null;if(o===n){const u=i[a];return u?{x:0,y:n<a?u.top+u.height-(l.top+l.height):u.top-l.top,..._l}:null}const s=DO(i,o,n);return o>n&&o<=a?{x:0,y:-l.height-s,..._l}:o<n&&o>=a?{x:0,y:l.height+s,..._l}:{x:0,y:0,..._l}};function DO(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const Ym="Sortable",Um=S.createContext({activeIndex:-1,containerId:Ym,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Zm,disabled:{draggable:!1,droppable:!1}});function PO(e){let{children:t,id:n,items:r,strategy:o=Zm,disabled:i=!1}=e;const{active:a,dragOverlay:l,droppableRects:s,over:u,measureDroppableContainers:c}=IO(),f=Fa(Ym,n),b=l.rect!==null,y=S.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),v=a!=null,d=a?y.indexOf(a.id):-1,p=u?y.indexOf(u.id):-1,h=S.useRef(y),g=!OO(y,h.current),m=p!==-1&&d===-1||g,E=RO(i);xr(()=>{g&&v&&c(y)},[g,y,v,c]),S.useEffect(()=>{h.current=y},[y]);const x=S.useMemo(()=>({activeIndex:d,containerId:f,disabled:E,disableTransforms:m,items:y,overIndex:p,useDragOverlay:b,sortedRects:_O(y,s),strategy:o}),[d,f,E.draggable,E.droppable,m,y,p,s,b,o]);return S.createElement(Um.Provider,{value:x},t)}const kO=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return od(n,r,o).indexOf(t)},LO=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:a,previousItems:l,previousContainerId:s,transition:u}=e;return!u||!r||l!==i&&o===a?!1:n?!0:a!==o&&t===s},FO={duration:200,easing:"ease"},qm="transform",MO=Ma.Transition.toString({property:qm,duration:0,easing:"linear"}),BO={roleDescription:"sortable"};function jO(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,a]=S.useState(null),l=S.useRef(n);return xr(()=>{if(!t&&n!==l.current&&r.current){const s=o.current;if(s){const u=wi(r.current,{ignoreTransform:!0}),c={x:s.left-u.left,y:s.top-u.top,scaleX:s.width/u.width,scaleY:s.height/u.height};(c.x||c.y)&&a(c)}}n!==l.current&&(l.current=n)},[t,n,r,o]),S.useEffect(()=>{i&&a(null)},[i]),i}function VO(e){let{animateLayoutChanges:t=LO,attributes:n,disabled:r,data:o,getNewIndex:i=kO,id:a,strategy:l,resizeObserverConfig:s,transition:u=FO}=e;const{items:c,containerId:f,activeIndex:b,disabled:y,disableTransforms:v,sortedRects:d,overIndex:p,useDragOverlay:h,strategy:g}=S.useContext(Um),m=GO(r,y),E=c.indexOf(a),x=S.useMemo(()=>({sortable:{containerId:f,index:E,items:c},...o}),[f,o,E,c]),A=S.useMemo(()=>c.slice(c.indexOf(a)),[c,a]),{rect:T,node:C,isOver:O,setNodeRef:M}=AO({id:a,data:x,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...s}}),{active:B,activatorEvent:U,activeNodeRect:G,attributes:X,setNodeRef:q,listeners:$,isDragging:ue,over:se,setActivatorNodeRef:ve,transform:W}=wO({id:a,data:x,attributes:{...BO,...n},disabled:m.draggable}),te=t_(M,q),re=!!B,K=re&&!v&&Al(b)&&Al(p),oe=!h&&ue,de=oe&&K?W:null,ge=K?de??(l??g)({rects:d,activeNodeRect:G,activeIndex:b,overIndex:p,index:E}):null,Ee=Al(b)&&Al(p)?i({id:a,items:c,activeIndex:b,overIndex:p}):E,Ae=B==null?void 0:B.id,me=S.useRef({activeId:Ae,items:c,newIndex:Ee,containerId:f}),ze=c!==me.current.items,V=t({active:B,containerId:f,isDragging:ue,isSorting:re,id:a,index:E,items:c,newIndex:me.current.newIndex,previousItems:me.current.items,previousContainerId:me.current.containerId,transition:u,wasDragging:me.current.activeId!=null}),Ye=jO({disabled:!V,index:E,node:C,rect:T});return S.useEffect(()=>{re&&me.current.newIndex!==Ee&&(me.current.newIndex=Ee),f!==me.current.containerId&&(me.current.containerId=f),c!==me.current.items&&(me.current.items=c)},[re,Ee,f,c]),S.useEffect(()=>{if(Ae===me.current.activeId)return;if(Ae!=null&&me.current.activeId==null){me.current.activeId=Ae;return}const Ue=setTimeout(()=>{me.current.activeId=Ae},50);return()=>clearTimeout(Ue)},[Ae]),{active:B,activeIndex:b,attributes:X,data:x,rect:T,index:E,newIndex:Ee,items:c,isOver:O,isSorting:re,isDragging:ue,listeners:$,node:C,overIndex:p,over:se,setNodeRef:te,setActivatorNodeRef:ve,setDroppableNodeRef:M,setDraggableNodeRef:q,transform:Ye??ge,transition:Le()};function Le(){if(Ye||ze&&me.current.newIndex===E)return MO;if(!(oe&&!Zc(U)||!u)&&(re||V))return Ma.Transition.toString({...u,property:qm})}}function GO(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}st.Down,st.Right,st.Up,st.Left;const WO=w.styled(w.Stack)`
|
|
462
|
+
`},p_={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function h_(e){let{announcements:t=p_,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=f_}=e;const{announce:i,announcement:a}=u_(),l=Fa("DndLiveRegion"),[s,u]=S.useState(!1);if(S.useEffect(()=>{u(!0)},[]),c_(S.useMemo(()=>({onDragStart(f){let{active:b}=f;i(t.onDragStart({active:b}))},onDragMove(f){let{active:b,over:y}=f;t.onDragMove&&i(t.onDragMove({active:b,over:y}))},onDragOver(f){let{active:b,over:y}=f;i(t.onDragOver({active:b,over:y}))},onDragEnd(f){let{active:b,over:y}=f;i(t.onDragEnd({active:b,over:y}))},onDragCancel(f){let{active:b,over:y}=f;i(t.onDragCancel({active:b,over:y}))}}),[i,t])),!s)return null;const c=S.createElement(S.Fragment,null,S.createElement(s_,{id:r,value:o.draggable}),S.createElement(l_,{id:l,announcement:a}));return n?Qe.createPortal(c,n):c}var Yt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Yt||(Yt={}));function Cl(){}function g_(e,t){return S.useMemo(()=>({sensor:e,options:{}}),[e,t])}function m_(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return S.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const pr=Object.freeze({x:0,y:0});function b_(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function v_(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function y_(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function E_(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Cm(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const x_=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Cm(t,t.left,t.top),i=[];for(const a of r){const{id:l}=a,s=n.get(l);if(s){const u=b_(Cm(s),o);i.push({id:l,data:{droppableContainer:a,value:u}})}}return i.sort(v_)};function C_(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r<o&&n<i){const s=t.width*t.height,u=e.width*e.height,c=a*l,f=c/(s+u-c);return Number(f.toFixed(4))}return 0}const w_=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:a}=i,l=n.get(a);if(l){const s=C_(l,t);s>0&&o.push({id:a,data:{droppableContainer:i,value:s}})}}return o.sort(y_)};function I_(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function wm(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:pr}function S_(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((a,l)=>({...a,top:a.top+e*l.y,bottom:a.bottom+e*l.y,left:a.left+e*l.x,right:a.right+e*l.x}),{...n})}}const T_=S_(1);function A_(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function __(e,t,n){const r=A_(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,s=e.left-a-(1-o)*parseFloat(n),u=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),c=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:c,height:f,top:u,right:s+c,bottom:u+f,left:s}}const O_={ignoreTransform:!1};function wi(e,t){t===void 0&&(t=O_);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:c}=An(e).getComputedStyle(e);u&&(n=__(n,u,c))}const{top:r,left:o,width:i,height:a,bottom:l,right:s}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:s}}function Im(e){return wi(e,{ignoreTransform:!0})}function R_(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function N_(e,t){return t===void 0&&(t=An(e).getComputedStyle(e)),t.position==="fixed"}function D_(e,t){t===void 0&&(t=An(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function Uc(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Wc(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Pa(o)||vm(o)||n.includes(o))return n;const i=An(e).getComputedStyle(o);return o!==e&&D_(o,i)&&n.push(o),N_(o,i)?n:r(o.parentNode)}return e?r(e):n}function Sm(e){const[t]=Uc(e,1);return t??null}function qc(e){return!yl||!e?null:Ei(e)?e:Gc(e)?Wc(e)||e===xi(e).scrollingElement?window:Pa(e)?e:null:null}function Tm(e){return Ei(e)?e.scrollX:e.scrollLeft}function Am(e){return Ei(e)?e.scrollY:e.scrollTop}function Jc(e){return{x:Tm(e),y:Am(e)}}var Jt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Jt||(Jt={}));function _m(e){return!yl||!e?!1:e===document.scrollingElement}function Om(e){const t={x:0,y:0},n=_m(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:a,isRight:l,maxScroll:r,minScroll:t}}const P_={x:.2,y:.2};function k_(e,t,n,r,o){let{top:i,left:a,right:l,bottom:s}=n;r===void 0&&(r=10),o===void 0&&(o=P_);const{isTop:u,isBottom:c,isLeft:f,isRight:b}=Om(e),y={x:0,y:0},v={x:0,y:0},d={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+d.height?(y.y=Jt.Backward,v.y=r*Math.abs((t.top+d.height-i)/d.height)):!c&&s>=t.bottom-d.height&&(y.y=Jt.Forward,v.y=r*Math.abs((t.bottom-d.height-s)/d.height)),!b&&l>=t.right-d.width?(y.x=Jt.Forward,v.x=r*Math.abs((t.right-d.width-l)/d.width)):!f&&a<=t.left+d.width&&(y.x=Jt.Backward,v.x=r*Math.abs((t.left+d.width-a)/d.width)),{direction:y,speed:v}}function L_(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Rm(e){return e.reduce((t,n)=>Ci(t,Jc(n)),pr)}function F_(e){return e.reduce((t,n)=>t+Tm(n),0)}function M_(e){return e.reduce((t,n)=>t+Am(n),0)}function B_(e,t){if(t===void 0&&(t=wi),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Sm(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const j_=[["x",["left","right"],F_],["y",["top","bottom"],M_]];class Qc{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Uc(n),o=Rm(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,a,l]of j_)for(const s of a)Object.defineProperty(this,s,{get:()=>{const u=l(r),c=o[i]-u;return this.rect[s]+c},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ba{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function V_(e){const{EventTarget:t}=An(e);return e instanceof t?e:xi(e)}function $c(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Jn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Jn||(Jn={}));function Nm(e){e.preventDefault()}function G_(e){e.stopPropagation()}var st;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(st||(st={}));const Dm={start:[st.Space,st.Enter],cancel:[st.Esc],end:[st.Space,st.Enter]},W_=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case st.Right:return{...n,x:n.x+25};case st.Left:return{...n,x:n.x-25};case st.Down:return{...n,y:n.y+25};case st.Up:return{...n,y:n.y-25}}};class Pm{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ba(xi(n)),this.windowListeners=new Ba(An(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Jn.Resize,this.handleCancel),this.windowListeners.add(Jn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Jn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&B_(r),n(pr)}handleKeyDown(t){if(Zc(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=Dm,coordinateGetter:a=W_,scrollBehavior:l="smooth"}=o,{code:s}=t;if(i.end.includes(s)){this.handleEnd(t);return}if(i.cancel.includes(s)){this.handleCancel(t);return}const{collisionRect:u}=r.current,c=u?{x:u.left,y:u.top}:pr;this.referenceCoordinates||(this.referenceCoordinates=c);const f=a(t,{active:n,context:r.current,currentCoordinates:c});if(f){const b=xl(f,c),y={x:0,y:0},{scrollableAncestors:v}=r.current;for(const d of v){const p=t.code,{isTop:h,isRight:g,isLeft:m,isBottom:E,maxScroll:x,minScroll:A}=Om(d),T=L_(d),C={x:Math.min(p===st.Right?T.right-T.width/2:T.right,Math.max(p===st.Right?T.left:T.left+T.width/2,f.x)),y:Math.min(p===st.Down?T.bottom-T.height/2:T.bottom,Math.max(p===st.Down?T.top:T.top+T.height/2,f.y))},O=p===st.Right&&!g||p===st.Left&&!m,M=p===st.Down&&!E||p===st.Up&&!h;if(O&&C.x!==f.x){const B=d.scrollLeft+b.x,U=p===st.Right&&B<=x.x||p===st.Left&&B>=A.x;if(U&&!b.y){d.scrollTo({left:B,behavior:l});return}U?y.x=d.scrollLeft-B:y.x=p===st.Right?d.scrollLeft-x.x:d.scrollLeft-A.x,y.x&&d.scrollBy({left:-y.x,behavior:l});break}else if(M&&C.y!==f.y){const B=d.scrollTop+b.y,U=p===st.Down&&B<=x.y||p===st.Up&&B>=A.y;if(U&&!b.x){d.scrollTo({top:B,behavior:l});return}U?y.y=d.scrollTop-B:y.y=p===st.Down?d.scrollTop-x.y:d.scrollTop-A.y,y.y&&d.scrollBy({top:-y.y,behavior:l});break}}this.handleMove(t,Ci(xl(f,this.referenceCoordinates),y))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Pm.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Dm,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const l=i.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function km(e){return!!(e&&"distance"in e)}function Lm(e){return!!(e&&"delay"in e)}class Kc{constructor(t,n,r){var o;r===void 0&&(r=V_(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:a}=i;this.props=t,this.events=n,this.document=xi(a),this.documentListeners=new Ba(this.document),this.listeners=new Ba(r),this.windowListeners=new Ba(An(a)),this.initialCoordinates=(o=Yc(i))!=null?o:pr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Jn.Resize,this.handleCancel),this.windowListeners.add(Jn.DragStart,Nm),this.windowListeners.add(Jn.VisibilityChange,this.handleCancel),this.windowListeners.add(Jn.ContextMenu,Nm),this.documentListeners.add(Jn.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Lm(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}if(km(n))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Jn.Click,G_,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Jn.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:a,options:{activationConstraint:l}}=i;if(!o)return;const s=(n=Yc(t))!=null?n:pr,u=xl(o,s);if(!r&&l){if(km(l)){if(l.tolerance!=null&&$c(u,l.tolerance))return this.handleCancel();if($c(u,l.distance))return this.handleStart()}return Lm(l)&&$c(u,l.tolerance)?this.handleCancel():void 0}t.cancelable&&t.preventDefault(),a(s)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===st.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const H_={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ed extends Kc{constructor(t){const{event:n}=t,r=xi(n.target);super(t,H_,r)}}ed.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const z_={move:{name:"mousemove"},end:{name:"mouseup"}};var td;(function(e){e[e.RightClick=2]="RightClick"})(td||(td={}));class X_ extends Kc{constructor(t){super(t,z_,xi(t.event.target))}}X_.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===td.RightClick?!1:(r==null||r({event:n}),!0)}}];const nd={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Z_ extends Kc{constructor(t){super(t,nd)}static setup(){return window.addEventListener(nd.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(nd.move.name,t)};function t(){}}}Z_.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var ja;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ja||(ja={}));var wl;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(wl||(wl={}));function Y_(e){let{acceleration:t,activator:n=ja.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:l=wl.TreeOrder,pointerCoordinates:s,scrollableAncestors:u,scrollableAncestorRects:c,delta:f,threshold:b}=e;const y=q_({delta:f,disabled:!i}),[v,d]=n_(),p=S.useRef({x:0,y:0}),h=S.useRef({x:0,y:0}),g=S.useMemo(()=>{switch(n){case ja.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case ja.DraggableRect:return o}},[n,o,s]),m=S.useRef(null),E=S.useCallback(()=>{const A=m.current;if(!A)return;const T=p.current.x*h.current.x,C=p.current.y*h.current.y;A.scrollBy(T,C)},[]),x=S.useMemo(()=>l===wl.TreeOrder?[...u].reverse():u,[l,u]);S.useEffect(()=>{if(!i||!u.length||!g){d();return}for(const A of x){if((r==null?void 0:r(A))===!1)continue;const T=u.indexOf(A),C=c[T];if(!C)continue;const{direction:O,speed:M}=k_(A,C,g,t,b);for(const B of["x","y"])y[B][O[B]]||(M[B]=0,O[B]=0);if(M.x>0||M.y>0){d(),m.current=A,v(E,a),p.current=M,h.current=O;return}}p.current={x:0,y:0},h.current={x:0,y:0},d()},[t,E,r,d,i,a,JSON.stringify(g),JSON.stringify(y),v,u,x,c,JSON.stringify(b)])}const U_={x:{[Jt.Backward]:!1,[Jt.Forward]:!1},y:{[Jt.Backward]:!1,[Jt.Forward]:!1}};function q_(e){let{delta:t,disabled:n}=e;const r=zc(t);return La(o=>{if(n||!r||!o)return U_;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Jt.Backward]:o.x[Jt.Backward]||i.x===-1,[Jt.Forward]:o.x[Jt.Forward]||i.x===1},y:{[Jt.Backward]:o.y[Jt.Backward]||i.y===-1,[Jt.Forward]:o.y[Jt.Forward]||i.y===1}}},[n,t,r])}function J_(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return La(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function Q_(e,t){return S.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...i]},[]),[e,t])}var Va;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Va||(Va={}));var rd;(function(e){e.Optimized="optimized"})(rd||(rd={}));const Fm=new Map;function $_(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=S.useState(null),{frequency:l,measure:s,strategy:u}=o,c=S.useRef(e),f=p(),b=ka(f),y=S.useCallback(function(h){h===void 0&&(h=[]),!b.current&&a(g=>g===null?h:g.concat(h.filter(m=>!g.includes(m))))},[b]),v=S.useRef(null),d=La(h=>{if(f&&!n)return Fm;if(!h||h===Fm||c.current!==e||i!=null){const g=new Map;for(let m of e){if(!m)continue;if(i&&i.length>0&&!i.includes(m.id)&&m.rect.current){g.set(m.id,m.rect.current);continue}const E=m.node.current,x=E?new Qc(s(E),E):null;m.rect.current=x,x&&g.set(m.id,x)}return g}return h},[e,i,n,f,s]);return S.useEffect(()=>{c.current=e},[e]),S.useEffect(()=>{f||y()},[n,f]),S.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),S.useEffect(()=>{f||typeof l!="number"||v.current!==null||(v.current=setTimeout(()=>{y(),v.current=null},l))},[l,f,y,...r]),{droppableRects:d,measureDroppableContainers:y,measuringScheduled:i!=null};function p(){switch(u){case Va.Always:return!1;case Va.BeforeDragging:return n;default:return!n}}}function Mm(e,t){return La(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function K_(e,t){return Mm(e,t)}function eO(e){let{callback:t,disabled:n}=e;const r=Hc(t),o=S.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return S.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Il(e){let{callback:t,disabled:n}=e;const r=Hc(t),o=S.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return S.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function tO(e){return new Qc(wi(e),e)}function Bm(e,t,n){t===void 0&&(t=tO);const[r,o]=S.useState(null);function i(){o(s=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=s??n)!=null?u:null}const c=t(e);return JSON.stringify(s)===JSON.stringify(c)?s:c})}const a=eO({callback(s){if(e)for(const u of s){const{type:c,target:f}=u;if(c==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),l=Il({callback:i});return xr(()=>{i(),e?(l==null||l.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),a==null||a.disconnect())},[e]),r}function nO(e){const t=Mm(e);return wm(e,t)}const jm=[];function rO(e){const t=S.useRef(e),n=La(r=>e?r&&r!==jm&&e&&t.current&&e.parentNode===t.current.parentNode?r:Uc(e):jm,[e]);return S.useEffect(()=>{t.current=e},[e]),n}function oO(e){const[t,n]=S.useState(null),r=S.useRef(e),o=S.useCallback(i=>{const a=qc(i.target);a&&n(l=>l?(l.set(a,Jc(a)),new Map(l)):null)},[]);return S.useEffect(()=>{const i=r.current;if(e!==i){a(i);const l=e.map(s=>{const u=qc(s);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,Jc(u)]):null}).filter(s=>s!=null);n(l.length?new Map(l):null),r.current=e}return()=>{a(e),a(i)};function a(l){l.forEach(s=>{const u=qc(s);u==null||u.removeEventListener("scroll",o)})}},[o,e]),S.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,a)=>Ci(i,a),pr):Rm(e):pr,[e,t])}function Vm(e,t){t===void 0&&(t=[]);const n=S.useRef(null);return S.useEffect(()=>{n.current=null},t),S.useEffect(()=>{const r=e!==pr;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?xl(e,n.current):pr}function iO(e){S.useEffect(()=>{if(!yl)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function aO(e,t){return S.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=a=>{i(a,t)},n},{}),[e,t])}function Gm(e){return S.useMemo(()=>e?R_(e):null,[e])}const Wm=[];function sO(e,t){t===void 0&&(t=wi);const[n]=e,r=Gm(n?An(n):null),[o,i]=S.useState(Wm);function a(){i(()=>e.length?e.map(s=>_m(s)?r:new Qc(t(s),s)):Wm)}const l=Il({callback:a});return xr(()=>{l==null||l.disconnect(),a(),e.forEach(s=>l==null?void 0:l.observe(s))},[e]),o}function lO(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Pa(t)?t:e}function uO(e){let{measure:t}=e;const[n,r]=S.useState(null),o=S.useCallback(u=>{for(const{target:c}of u)if(Pa(c)){r(f=>{const b=t(c);return f?{...f,width:b.width,height:b.height}:b});break}},[t]),i=Il({callback:o}),a=S.useCallback(u=>{const c=lO(u);i==null||i.disconnect(),c&&(i==null||i.observe(c)),r(c?t(c):null)},[t,i]),[l,s]=El(a);return S.useMemo(()=>({nodeRef:l,rect:n,setRef:s}),[n,l,s])}const cO=[{sensor:ed,options:{}},{sensor:Pm,options:{}}],dO={current:{}},Sl={draggable:{measure:Im},droppable:{measure:Im,strategy:Va.WhileDragging,frequency:rd.Optimized},dragOverlay:{measure:wi}};class Ga extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const fO={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ga,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Cl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Sl,measureDroppableContainers:Cl,windowRect:null,measuringScheduled:!1},pO={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Cl,draggableNodes:new Map,over:null,measureDroppableContainers:Cl},Tl=S.createContext(pO),Hm=S.createContext(fO);function hO(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ga}}}function gO(e,t){switch(t.type){case Yt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Yt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Yt.DragEnd:case Yt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Yt.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Ga(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Yt.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new Ga(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Yt.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Ga(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function mO(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=S.useContext(Tl),i=zc(r),a=zc(n==null?void 0:n.id);return S.useEffect(()=>{if(!t&&!r&&i&&a!=null){if(!Zc(i)||document.activeElement===i.target)return;const l=o.get(a);if(!l)return;const{activatorNode:s,node:u}=l;if(!s.current&&!u.current)return;requestAnimationFrame(()=>{for(const c of[s.current,u.current]){if(!c)continue;const f=i_(c);if(f){f.focus();break}}})}},[r,t,o,a,i]),null}function bO(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function vO(e){return S.useMemo(()=>({draggable:{...Sl.draggable,...e==null?void 0:e.draggable},droppable:{...Sl.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Sl.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function yO(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=S.useRef(!1),{x:a,y:l}=typeof o=="boolean"?{x:o,y:o}:o;xr(()=>{if(!a&&!l||!t){i.current=!1;return}if(i.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const c=n(u),f=wm(c,r);if(a||(f.x=0),l||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const b=Sm(u);b&&b.scrollBy({top:f.y,left:f.x})}},[t,a,l,r,n])}const zm=S.createContext({...pr,scaleX:1,scaleY:1});var fo;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(fo||(fo={}));const EO=S.memo(function(t){var n,r,o,i;let{id:a,accessibility:l,autoScroll:s=!0,children:u,sensors:c=cO,collisionDetection:f=w_,measuring:b,modifiers:y,...v}=t;const d=S.useReducer(gO,void 0,hO),[p,h]=d,[g,m]=d_(),[E,x]=S.useState(fo.Uninitialized),A=E===fo.Initialized,{draggable:{active:T,nodes:C,translate:O},droppable:{containers:M}}=p,B=T!=null?C.get(T):null,U=S.useRef({initial:null,translated:null}),G=S.useMemo(()=>{var ht;return T!=null?{id:T,data:(ht=B==null?void 0:B.data)!=null?ht:dO,rect:U}:null},[T,B]),X=S.useRef(null),[q,$]=S.useState(null),[ue,se]=S.useState(null),ve=ka(v,Object.values(v)),W=Fa("DndDescribedBy",a),te=S.useMemo(()=>M.getEnabled(),[M]),re=vO(b),{droppableRects:K,measureDroppableContainers:oe,measuringScheduled:de}=$_(te,{dragging:A,dependencies:[O.x,O.y],config:re.droppable}),ie=J_(C,T),ge=S.useMemo(()=>ue?Yc(ue):null,[ue]),Ee=Ke(),Ae=K_(ie,re.draggable.measure);yO({activeNode:T!=null?C.get(T):null,config:Ee.layoutShiftCompensation,initialRect:Ae,measure:re.draggable.measure});const me=Bm(ie,re.draggable.measure,Ae),ze=Bm(ie?ie.parentElement:null),V=S.useRef({activatorEvent:null,active:null,activeNode:ie,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ye=M.getNodeFor((n=V.current.over)==null?void 0:n.id),Le=uO({measure:re.dragOverlay.measure}),Ue=(r=Le.nodeRef.current)!=null?r:ie,Pt=A?(o=Le.rect)!=null?o:me:null,Nn=!!(Le.nodeRef.current&&Le.rect),kt=nO(Nn?null:me),qt=Gm(Ue?An(Ue):null),mt=rO(A?Ye??ie:null),zn=sO(mt),cn=bO(y,{transform:{x:O.x-kt.x,y:O.y-kt.y,scaleX:1,scaleY:1},activatorEvent:ue,active:G,activeNodeRect:me,containerNodeRect:ze,draggingNodeRect:Pt,over:V.current.over,overlayNodeRect:Le.rect,scrollableAncestors:mt,scrollableAncestorRects:zn,windowRect:qt}),So=ge?Ci(ge,O):null,To=oO(mt),Ao=Vm(To),Dn=Vm(To,[me]),Vt=Ci(cn,Ao),Xn=Pt?T_(Pt,cn):null,dn=G&&Xn?f({active:G,collisionRect:Xn,droppableRects:K,droppableContainers:te,pointerCoordinates:So}):null,fn=E_(dn,"id"),[Ct,Ur]=S.useState(null),Fr=Nn?cn:Ci(cn,Dn),_o=I_(Fr,(i=Ct==null?void 0:Ct.rect)!=null?i:null,me),pn=S.useRef(null),qr=S.useCallback((ht,At)=>{let{sensor:_t,options:rn}=At;if(X.current==null)return;const Lt=C.get(X.current);if(!Lt)return;const Gt=ht.nativeEvent,Kt=new _t({active:X.current,activeNode:Lt,event:Gt,options:rn,context:V,onStart(Wt){const xt=X.current;if(xt==null)return;const Zn=C.get(xt);if(!Zn)return;const{onDragStart:Yn}=ve.current,hn={activatorEvent:Gt,active:{id:xt,data:Zn.data,rect:U}};Qe.unstable_batchedUpdates(()=>{Yn==null||Yn(hn),x(fo.Initializing),h({type:Yt.DragStart,initialCoordinates:Wt,active:xt}),g({type:"onDragStart",event:hn}),$(pn.current),se(Gt)})},onMove(Wt){h({type:Yt.DragMove,coordinates:Wt})},onEnd:Pn(Yt.DragEnd),onCancel:Pn(Yt.DragCancel)});pn.current=Kt;function Pn(Wt){return async function(){const{active:Zn,collisions:Yn,over:hn,scrollAdjustedTranslate:R}=V.current;let k=null;if(Zn&&R){const{cancelDrop:j}=ve.current;k={activatorEvent:Gt,active:Zn,collisions:Yn,delta:R,over:hn},Wt===Yt.DragEnd&&typeof j=="function"&&await Promise.resolve(j(k))&&(Wt=Yt.DragCancel)}X.current=null,Qe.unstable_batchedUpdates(()=>{h({type:Wt}),x(fo.Uninitialized),Ur(null),$(null),se(null),pn.current=null;const j=Wt===Yt.DragEnd?"onDragEnd":"onDragCancel";if(k){const _=ve.current[j];_==null||_(k),g({type:j,event:k})}})}}},[C]),we=S.useCallback((ht,At)=>(_t,rn)=>{const Lt=_t.nativeEvent,Gt=C.get(rn);if(X.current!==null||!Gt||Lt.dndKit||Lt.defaultPrevented)return;const Kt={active:Gt};ht(_t,At.options,Kt)===!0&&(Lt.dndKit={capturedBy:At.sensor},X.current=rn,qr(_t,At))},[C,qr]),mr=Q_(c,we);iO(c),xr(()=>{me&&E===fo.Initializing&&x(fo.Initialized)},[me,E]),S.useEffect(()=>{const{onDragMove:ht}=ve.current,{active:At,activatorEvent:_t,collisions:rn,over:Lt}=V.current;if(!At||!_t)return;const Gt={active:At,activatorEvent:_t,collisions:rn,delta:{x:Vt.x,y:Vt.y},over:Lt};Qe.unstable_batchedUpdates(()=>{ht==null||ht(Gt),g({type:"onDragMove",event:Gt})})},[Vt.x,Vt.y]),S.useEffect(()=>{const{active:ht,activatorEvent:At,collisions:_t,droppableContainers:rn,scrollAdjustedTranslate:Lt}=V.current;if(!ht||X.current==null||!At||!Lt)return;const{onDragOver:Gt}=ve.current,Kt=rn.get(fn),Pn=Kt&&Kt.rect.current?{id:Kt.id,rect:Kt.rect.current,data:Kt.data,disabled:Kt.disabled}:null,Wt={active:ht,activatorEvent:At,collisions:_t,delta:{x:Lt.x,y:Lt.y},over:Pn};Qe.unstable_batchedUpdates(()=>{Ur(Pn),Gt==null||Gt(Wt),g({type:"onDragOver",event:Wt})})},[fn]),xr(()=>{V.current={activatorEvent:ue,active:G,activeNode:ie,collisionRect:Xn,collisions:dn,droppableRects:K,draggableNodes:C,draggingNode:Ue,draggingNodeRect:Pt,droppableContainers:M,over:Ct,scrollableAncestors:mt,scrollAdjustedTranslate:Vt},U.current={initial:Pt,translated:Xn}},[G,ie,dn,Xn,C,Ue,Pt,K,M,Ct,mt,Vt]),Y_({...Ee,delta:O,draggingRect:Xn,pointerCoordinates:So,scrollableAncestors:mt,scrollableAncestorRects:zn});const er=S.useMemo(()=>({active:G,activeNode:ie,activeNodeRect:me,activatorEvent:ue,collisions:dn,containerNodeRect:ze,dragOverlay:Le,draggableNodes:C,droppableContainers:M,droppableRects:K,over:Ct,measureDroppableContainers:oe,scrollableAncestors:mt,scrollableAncestorRects:zn,measuringConfiguration:re,measuringScheduled:de,windowRect:qt}),[G,ie,me,ue,dn,ze,Le,C,M,K,Ct,oe,mt,zn,re,de,qt]),wt=S.useMemo(()=>({activatorEvent:ue,activators:mr,active:G,activeNodeRect:me,ariaDescribedById:{draggable:W},dispatch:h,draggableNodes:C,over:Ct,measureDroppableContainers:oe}),[ue,mr,G,me,h,W,C,Ct,oe]);return S.createElement(xm.Provider,{value:m},S.createElement(Tl.Provider,{value:wt},S.createElement(Hm.Provider,{value:er},S.createElement(zm.Provider,{value:_o},u)),S.createElement(mO,{disabled:(l==null?void 0:l.restoreFocus)===!1})),S.createElement(h_,{...l,hiddenTextDescribedById:W}));function Ke(){const ht=(q==null?void 0:q.autoScrollEnabled)===!1,At=typeof s=="object"?s.enabled===!1:s===!1,_t=A&&!ht&&!At;return typeof s=="object"?{...s,enabled:_t}:{enabled:_t}}}),xO=S.createContext(null),Xm="button",CO="Draggable";function wO(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Fa(CO),{activators:a,activatorEvent:l,active:s,activeNodeRect:u,ariaDescribedById:c,draggableNodes:f,over:b}=S.useContext(Tl),{role:y=Xm,roleDescription:v="draggable",tabIndex:d=0}=o??{},p=(s==null?void 0:s.id)===t,h=S.useContext(p?zm:xO),[g,m]=El(),[E,x]=El(),A=aO(a,t),T=ka(n);xr(()=>(f.set(t,{id:t,key:i,node:g,activatorNode:E,data:T}),()=>{const O=f.get(t);O&&O.key===i&&f.delete(t)}),[f,t]);const C=S.useMemo(()=>({role:y,tabIndex:d,"aria-disabled":r,"aria-pressed":p&&y===Xm?!0:void 0,"aria-roledescription":v,"aria-describedby":c.draggable}),[r,y,d,p,v,c.draggable]);return{active:s,activatorEvent:l,activeNodeRect:u,attributes:C,isDragging:p,listeners:r?void 0:A,node:g,over:b,setNodeRef:m,setActivatorNodeRef:x,transform:h}}function IO(){return S.useContext(Hm)}const SO="Droppable",TO={timeout:25};function AO(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Fa(SO),{active:a,dispatch:l,over:s,measureDroppableContainers:u}=S.useContext(Tl),c=S.useRef({disabled:n}),f=S.useRef(!1),b=S.useRef(null),y=S.useRef(null),{disabled:v,updateMeasurementsFor:d,timeout:p}={...TO,...o},h=ka(d??r),g=S.useCallback(()=>{if(!f.current){f.current=!0;return}y.current!=null&&clearTimeout(y.current),y.current=setTimeout(()=>{u(Array.isArray(h.current)?h.current:[h.current]),y.current=null},p)},[p]),m=Il({callback:g,disabled:v||!a}),E=S.useCallback((C,O)=>{m&&(O&&(m.unobserve(O),f.current=!1),C&&m.observe(C))},[m]),[x,A]=El(E),T=ka(t);return S.useEffect(()=>{!m||!x.current||(m.disconnect(),f.current=!1,m.observe(x.current))},[x,m]),S.useEffect(()=>(l({type:Yt.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:b,data:T}}),()=>l({type:Yt.UnregisterDroppable,key:i,id:r})),[r]),S.useEffect(()=>{n!==c.current.disabled&&(l({type:Yt.SetDroppableDisabled,id:r,key:i,disabled:n}),c.current.disabled=n)},[r,i,n,l]),{active:a,rect:b,isOver:(s==null?void 0:s.id)===r,node:x,over:s,setNodeRef:A}}function od(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function _O(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function Al(e){return e!==null&&e>=0}function OO(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function RO(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Zm=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=od(t,r,n),a=t[o],l=i[o];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}},_l={scaleX:1,scaleY:1},NO=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:a}=e;const l=(t=i[n])!=null?t:r;if(!l)return null;if(o===n){const u=i[a];return u?{x:0,y:n<a?u.top+u.height-(l.top+l.height):u.top-l.top,..._l}:null}const s=DO(i,o,n);return o>n&&o<=a?{x:0,y:-l.height-s,..._l}:o<n&&o>=a?{x:0,y:l.height+s,..._l}:{x:0,y:0,..._l}};function DO(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const Ym="Sortable",Um=S.createContext({activeIndex:-1,containerId:Ym,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Zm,disabled:{draggable:!1,droppable:!1}});function PO(e){let{children:t,id:n,items:r,strategy:o=Zm,disabled:i=!1}=e;const{active:a,dragOverlay:l,droppableRects:s,over:u,measureDroppableContainers:c}=IO(),f=Fa(Ym,n),b=l.rect!==null,y=S.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),v=a!=null,d=a?y.indexOf(a.id):-1,p=u?y.indexOf(u.id):-1,h=S.useRef(y),g=!OO(y,h.current),m=p!==-1&&d===-1||g,E=RO(i);xr(()=>{g&&v&&c(y)},[g,y,v,c]),S.useEffect(()=>{h.current=y},[y]);const x=S.useMemo(()=>({activeIndex:d,containerId:f,disabled:E,disableTransforms:m,items:y,overIndex:p,useDragOverlay:b,sortedRects:_O(y,s),strategy:o}),[d,f,E.draggable,E.droppable,m,y,p,s,b,o]);return S.createElement(Um.Provider,{value:x},t)}const kO=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return od(n,r,o).indexOf(t)},LO=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:a,previousItems:l,previousContainerId:s,transition:u}=e;return!u||!r||l!==i&&o===a?!1:n?!0:a!==o&&t===s},FO={duration:200,easing:"ease"},qm="transform",MO=Ma.Transition.toString({property:qm,duration:0,easing:"linear"}),BO={roleDescription:"sortable"};function jO(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,a]=S.useState(null),l=S.useRef(n);return xr(()=>{if(!t&&n!==l.current&&r.current){const s=o.current;if(s){const u=wi(r.current,{ignoreTransform:!0}),c={x:s.left-u.left,y:s.top-u.top,scaleX:s.width/u.width,scaleY:s.height/u.height};(c.x||c.y)&&a(c)}}n!==l.current&&(l.current=n)},[t,n,r,o]),S.useEffect(()=>{i&&a(null)},[i]),i}function VO(e){let{animateLayoutChanges:t=LO,attributes:n,disabled:r,data:o,getNewIndex:i=kO,id:a,strategy:l,resizeObserverConfig:s,transition:u=FO}=e;const{items:c,containerId:f,activeIndex:b,disabled:y,disableTransforms:v,sortedRects:d,overIndex:p,useDragOverlay:h,strategy:g}=S.useContext(Um),m=GO(r,y),E=c.indexOf(a),x=S.useMemo(()=>({sortable:{containerId:f,index:E,items:c},...o}),[f,o,E,c]),A=S.useMemo(()=>c.slice(c.indexOf(a)),[c,a]),{rect:T,node:C,isOver:O,setNodeRef:M}=AO({id:a,data:x,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...s}}),{active:B,activatorEvent:U,activeNodeRect:G,attributes:X,setNodeRef:q,listeners:$,isDragging:ue,over:se,setActivatorNodeRef:ve,transform:W}=wO({id:a,data:x,attributes:{...BO,...n},disabled:m.draggable}),te=t_(M,q),re=!!B,K=re&&!v&&Al(b)&&Al(p),oe=!h&&ue,de=oe&&K?W:null,ge=K?de??(l??g)({rects:d,activeNodeRect:G,activeIndex:b,overIndex:p,index:E}):null,Ee=Al(b)&&Al(p)?i({id:a,items:c,activeIndex:b,overIndex:p}):E,Ae=B==null?void 0:B.id,me=S.useRef({activeId:Ae,items:c,newIndex:Ee,containerId:f}),ze=c!==me.current.items,V=t({active:B,containerId:f,isDragging:ue,isSorting:re,id:a,index:E,items:c,newIndex:me.current.newIndex,previousItems:me.current.items,previousContainerId:me.current.containerId,transition:u,wasDragging:me.current.activeId!=null}),Ye=jO({disabled:!V,index:E,node:C,rect:T});return S.useEffect(()=>{re&&me.current.newIndex!==Ee&&(me.current.newIndex=Ee),f!==me.current.containerId&&(me.current.containerId=f),c!==me.current.items&&(me.current.items=c)},[re,Ee,f,c]),S.useEffect(()=>{if(Ae===me.current.activeId)return;if(Ae!=null&&me.current.activeId==null){me.current.activeId=Ae;return}const Ue=setTimeout(()=>{me.current.activeId=Ae},50);return()=>clearTimeout(Ue)},[Ae]),{active:B,activeIndex:b,attributes:X,data:x,rect:T,index:E,newIndex:Ee,items:c,isOver:O,isSorting:re,isDragging:ue,listeners:$,node:C,overIndex:p,over:se,setNodeRef:te,setActivatorNodeRef:ve,setDroppableNodeRef:M,setDraggableNodeRef:q,transform:Ye??ge,transition:Le()};function Le(){if(Ye||ze&&me.current.newIndex===E)return MO;if(!(oe&&!Zc(U)||!u)&&(re||V))return Ma.Transition.toString({...u,property:qm})}}function GO(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}st.Down,st.Right,st.Up,st.Left;const WO=w.styled(w.Stack)`
|
|
463
463
|
flex-direction: row;
|
|
464
464
|
white-space: nowrap;
|
|
465
465
|
align-items: center;
|
|
@@ -491,7 +491,7 @@ Take a look at the reducer(s) handling this action type: ${y.type}.
|
|
|
491
491
|
background-color: #97a3b7;
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
-
`,zO="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cellipse%20cx='7.48148'%20cy='4.94'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='7.48148'%20cy='10.7'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='7.48148'%20cy='16.46'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='4.94'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='10.7'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='16.46'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3c/svg%3e",XO=({field:e,toggleSelected:t,hideNewChip:n})=>{const{availableFeatures:r}=S.useContext(
|
|
494
|
+
`,zO="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cellipse%20cx='7.48148'%20cy='4.94'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='7.48148'%20cy='10.7'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='7.48148'%20cy='16.46'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='4.94'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='10.7'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='16.46'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3c/svg%3e",XO=({field:e,toggleSelected:t,hideNewChip:n})=>{const{availableFeatures:r}=S.useContext(zt),{key:o,label:i,enabled:a,isFieldNew:l}=e,{attributes:s,listeners:u,setNodeRef:c,transform:f,transition:b}=VO({id:o}),y=S.useRef(null),[v,d]=S.useState(!1),p=fa(r)&&l&&!n,h={transform:Ma.Transform.toString(f),transition:b};return S.useEffect(()=>{const g=y.current;g&&d(g.scrollWidth>g.clientWidth||g.scrollHeight>g.clientHeight)},[i]),I.jsxs(WO,{ref:c,style:h,...s,children:[I.jsx("img",{className:"field-drag-handle",...u,src:zO}),I.jsx(w.Checkbox,{checked:a,onChange:()=>t(o),sx:{marginLeft:"-6px"}}),I.jsx(w.Tooltip,{title:i,disableHoverListener:!v,children:I.jsxs(w.Stack,{direction:"row",gap:"5px",alignItems:"center",children:[I.jsx(w.Typography,{ref:y,variant:"body2",maxWidth:"325px",noWrap:!0,children:i}),p?I.jsx(Na,{label:Mc}):null]})})]})},ZO=e=>({[e]:{isExtensionNew:[],sidePanel:[],cards:{},fieldVisibility:{cards:{}}}}),Ii=()=>{try{return JSON.parse(localStorage.getItem(da)||"{}")}catch{return{}}},Si=()=>{const e=Ii();return Object.keys(e)[0]},Jm=e=>{var t;return(t=Ii())==null?void 0:t[e]},YO=e=>{if(!e)return;const t=Ii(),n=Si();(Object.keys(t).length===0||n!=e)&&localStorage.setItem(da,JSON.stringify(ZO(e)))},UO=(e,t)=>{var a,l,s,u,c,f;if(!e||!t)return;const n=Si()??"";if(!n)return;const r=Ii(),o=r[n],i={...r,[n]:{...o,fieldVisibility:{cards:{...(a=o==null?void 0:o.fieldVisibility)==null?void 0:a.cards,[e]:[...((s=(l=o==null?void 0:o.fieldVisibility)==null?void 0:l.cards)==null?void 0:s[e])||[],...(f=(c=(u=o==null?void 0:o.fieldVisibility)==null?void 0:u.cards)==null?void 0:c[e])!=null&&f.includes(t)?[]:[t]]}}}};localStorage.setItem(da,JSON.stringify(i))},id=(e,t)=>{var o,i;const n=Si();if(!n||!e||!t)return!1;const r=Jm(n);return!!((i=(o=r==null?void 0:r.fieldVisibility)==null?void 0:o.cards[e])!=null&&i.includes(t))},qO=(e,t)=>{var a,l,s;if(!e||!t)return;const n=Si()??"";if(!n)return;const r=Ii(),o=r[n],i={...r,[n]:{...o,cards:{...o==null?void 0:o.cards,[e]:[...((a=o==null?void 0:o.cards)==null?void 0:a[e])||[],...(s=(l=o==null?void 0:o.cards)==null?void 0:l[e])!=null&&s.includes(t)?[]:[t]]}}};localStorage.setItem(da,JSON.stringify(i))},JO=(e,t)=>{var o;const n=Si();if(!n||!e||!t)return!1;const r=Jm(n);return!!((o=r==null?void 0:r.cards[e])!=null&&o.includes(t))},QO=e=>{var i;if(!e)return;const t=Ii(),n=Si();if(!n)return;const r=t[n],o={[n]:{...r,sidePanel:[...(r==null?void 0:r.sidePanel)||[],...(i=r==null?void 0:r.sidePanel)!=null&&i.includes(e)?[]:[e]]}};localStorage.setItem(da,JSON.stringify(o))},$O=({fields:e,setFields:t,cardId:n})=>{const r=m_(g_(ed)),{userId:o}=hi()||{},i=qe(mA),a=u=>{const{active:c,over:f}=u;(c==null?void 0:c.id)!==(f==null?void 0:f.id)&&t(b=>{const y=b.findIndex(d=>d.key===(c==null?void 0:c.id)),v=b.findIndex(d=>d.key===(f==null?void 0:f.id));return od(b,y,v)})},l=!!(o&&id(n,o)),s=u=>{t(c=>c.map(f=>f.key===u?{...f,enabled:!f.enabled}:f))};return I.jsxs(I.Fragment,{children:[I.jsx(HO,{children:I.jsx(EO,{sensors:r,collisionDetection:x_,onDragEnd:a,children:I.jsx(PO,{items:e.map(u=>u.key),strategy:NO,children:e.map(u=>I.jsx(XO,{field:u,toggleSelected:s,hideNewChip:l},u.key))})})}),i===Ie.LOADING?I.jsxs(w.Stack,{flexDirection:"row",alignItems:"center",gap:"8px",children:[I.jsx(w.CircularProgress,{size:15}),I.jsx(w.Typography,{variant:"caption",color:w.palette.gray.gray3,fontSize:"12px",children:WT})]}):null]})},Qm=e=>I.jsx(w.TextField,{...e}),KO=w.styled(w.Box)`
|
|
495
495
|
.request-new-connector-img {
|
|
496
496
|
width: 500px;
|
|
497
497
|
height: 500px;
|
|
@@ -536,7 +536,7 @@ Take a look at the reducer(s) handling this action type: ${y.type}.
|
|
|
536
536
|
color: ${w.palette.gray.gray3};
|
|
537
537
|
margin-top: 0.5px;
|
|
538
538
|
}
|
|
539
|
-
`,r3=({options:e=[],type:t,placeholder:n,labelKey:r="label",valueKey:o="id",onChangeFunc:i,currentSelectedOptions:a=[],isSingleSelect:l=!1})=>{const s=!a.length;return I.jsx(t3,{children:l?I.jsx(w.Autocomplete,{value:Object.keys(a[0]).length?a[0]:null,getOptionLabel:u=>u[r]??"",onChange:i,options:e,renderOption:(u,c)=>I.jsx(w.Box,{component:"li",...u,minHeight:"34px !important",children:c[r]}),renderInput:u=>I.jsx(ad,{...u,ref:u.inputProps.ref,placeholder:n})}):I.jsx(w.Autocomplete,{value:a,slotProps:{popper:{modifiers:[{name:"flip",options:{rootBoundary:"document"}}]}},"data-testid":`${t}-dropdown`,disablePortal:!0,multiple:!0,disableCloseOnSelect:!0,limitTags:2,options:e,isOptionEqualToValue:(u,c)=>(c==null?void 0:c[o])===""?!0:u[o]===c[o],renderOption:(u,c,{selected:f})=>{const{key:b,...y}=u;return I.jsxs(w.Box,{component:"li",...y,minHeight:"36px",children:[I.jsx(w.Checkbox,{style:{marginRight:8},checked:f}),c[r]]},b)},renderTags:(u,c)=>u.map((f,b)=>I.jsx("div",{children:I.jsx(n3,{...c({index:b}),label:f[r],variant:"outlined",deleteIcon:I.jsx(w.icons.Close,{})})},f[o])),renderInput:u=>I.jsx(ad,{...u,variant:"standard",placeholder:s?n:""}),getOptionLabel:u=>u[r],ListboxProps:{style:{maxHeight:250}},onChange:i})})},o3="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_3803_129233)'%3e%3cpath%20d='M7.3335%204.66683H8.66683V6.00016H7.3335V4.66683ZM7.3335%207.3335H8.66683V11.3335H7.3335V7.3335ZM8.00016%201.3335C4.32016%201.3335%201.3335%204.32016%201.3335%208.00016C1.3335%2011.6802%204.32016%2014.6668%208.00016%2014.6668C11.6802%2014.6668%2014.6668%2011.6802%2014.6668%208.00016C14.6668%204.32016%2011.6802%201.3335%208.00016%201.3335ZM8.00016%2013.3335C5.06016%2013.3335%202.66683%2010.9402%202.66683%208.00016C2.66683%205.06016%205.06016%202.66683%208.00016%202.66683C10.9402%202.66683%2013.3335%205.06016%2013.3335%208.00016C13.3335%2010.9402%2010.9402%2013.3335%208.00016%2013.3335Z'%20fill='%236F7C90'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3803_129233'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",i3=e=>{const{selectedEmailInboxes:t,setSelectedEmailInboxes:n,selectedRoles:r,setSelectedRoles:o}=e,i=qe(gm)??[],a=qe(hm)??[];return[{type:am,options:a,label:RT,isSingleSelect:!1},{type:PT,options:i,label:NT,isSingleSelect:!0}].map(({type:s,options:u,label:c,isSingleSelect:f})=>{const b=s===am,y=b?t:r;return I.jsxs(w.Box,{marginBottom:"20px",children:[I.jsx(JT,{variant:"h4",children:c}),I.jsx(r3,{isSingleSelect:f,currentSelectedOptions:f?[y]:y,options:u,type:s,placeholder:b?OT:DT,onChangeFunc:(v,d)=>b?n(d):o(d??{}),valueKey:"id",labelKey:"name"}),f?I.jsxs(nA,{width:"fit-content",children:[I.jsx("img",{src:o3}),I.jsx(w.Typography,{variant:"caption",color:w.palette.gray.gray3,fontSize:"11px",children:GT})]}):null]},s)})},Ho={CARD_VISIBILITY:{ID:0,LABEL:"Card visibility"},FIELD_VISIBILITY:{ID:1,LABEL:"Field visibility"}},$m="New fields",Km=(e,t)=>{const n=e.reduce((o,i)=>(o[i.key]||(o[i.key]=!0),o),{}),r=[...e];return t.forEach(o=>{n[o.key]||r.push(o)}),r},a3=({handleClose:e,id:t,emailSMs:n,setShowEnabledModal:r,roles:o,currentConnectorId:i,title:a,fields:l,setVisitedFieldVisTab:s})=>{const{availableFeatures:u,sendTrackingEvent:c}=S.useContext(
|
|
539
|
+
`,r3=({options:e=[],type:t,placeholder:n,labelKey:r="label",valueKey:o="id",onChangeFunc:i,currentSelectedOptions:a=[],isSingleSelect:l=!1})=>{const s=!a.length;return I.jsx(t3,{children:l?I.jsx(w.Autocomplete,{value:Object.keys(a[0]).length?a[0]:null,getOptionLabel:u=>u[r]??"",onChange:i,options:e,renderOption:(u,c)=>I.jsx(w.Box,{component:"li",...u,minHeight:"34px !important",children:c[r]}),renderInput:u=>I.jsx(ad,{...u,ref:u.inputProps.ref,placeholder:n})}):I.jsx(w.Autocomplete,{value:a,slotProps:{popper:{modifiers:[{name:"flip",options:{rootBoundary:"document"}}]}},"data-testid":`${t}-dropdown`,disablePortal:!0,multiple:!0,disableCloseOnSelect:!0,limitTags:2,options:e,isOptionEqualToValue:(u,c)=>(c==null?void 0:c[o])===""?!0:u[o]===c[o],renderOption:(u,c,{selected:f})=>{const{key:b,...y}=u;return I.jsxs(w.Box,{component:"li",...y,minHeight:"36px",children:[I.jsx(w.Checkbox,{style:{marginRight:8},checked:f}),c[r]]},b)},renderTags:(u,c)=>u.map((f,b)=>I.jsx("div",{children:I.jsx(n3,{...c({index:b}),label:f[r],variant:"outlined",deleteIcon:I.jsx(w.icons.Close,{})})},f[o])),renderInput:u=>I.jsx(ad,{...u,variant:"standard",placeholder:s?n:""}),getOptionLabel:u=>u[r],ListboxProps:{style:{maxHeight:250}},onChange:i})})},o3="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_3803_129233)'%3e%3cpath%20d='M7.3335%204.66683H8.66683V6.00016H7.3335V4.66683ZM7.3335%207.3335H8.66683V11.3335H7.3335V7.3335ZM8.00016%201.3335C4.32016%201.3335%201.3335%204.32016%201.3335%208.00016C1.3335%2011.6802%204.32016%2014.6668%208.00016%2014.6668C11.6802%2014.6668%2014.6668%2011.6802%2014.6668%208.00016C14.6668%204.32016%2011.6802%201.3335%208.00016%201.3335ZM8.00016%2013.3335C5.06016%2013.3335%202.66683%2010.9402%202.66683%208.00016C2.66683%205.06016%205.06016%202.66683%208.00016%202.66683C10.9402%202.66683%2013.3335%205.06016%2013.3335%208.00016C13.3335%2010.9402%2010.9402%2013.3335%208.00016%2013.3335Z'%20fill='%236F7C90'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3803_129233'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",i3=e=>{const{selectedEmailInboxes:t,setSelectedEmailInboxes:n,selectedRoles:r,setSelectedRoles:o}=e,i=qe(gm)??[],a=qe(hm)??[];return[{type:am,options:a,label:RT,isSingleSelect:!1},{type:PT,options:i,label:NT,isSingleSelect:!0}].map(({type:s,options:u,label:c,isSingleSelect:f})=>{const b=s===am,y=b?t:r;return I.jsxs(w.Box,{marginBottom:"20px",children:[I.jsx(JT,{variant:"h4",children:c}),I.jsx(r3,{isSingleSelect:f,currentSelectedOptions:f?[y]:y,options:u,type:s,placeholder:b?OT:DT,onChangeFunc:(v,d)=>b?n(d):o(d??{}),valueKey:"id",labelKey:"name"}),f?I.jsxs(nA,{width:"fit-content",children:[I.jsx("img",{src:o3}),I.jsx(w.Typography,{variant:"caption",color:w.palette.gray.gray3,fontSize:"11px",children:GT})]}):null]},s)})},Ho={CARD_VISIBILITY:{ID:0,LABEL:"Card visibility"},FIELD_VISIBILITY:{ID:1,LABEL:"Field visibility"}},$m="New fields",Km=(e,t)=>{const n=e.reduce((o,i)=>(o[i.key]||(o[i.key]=!0),o),{}),r=[...e];return t.forEach(o=>{n[o.key]||r.push(o)}),r},a3=({handleClose:e,id:t,emailSMs:n,setShowEnabledModal:r,roles:o,currentConnectorId:i,title:a,fields:l,setVisitedFieldVisTab:s})=>{const{availableFeatures:u,sendTrackingEvent:c}=S.useContext(zt),f=uo(),b=qe(bl),y=qe(gm)??[],v=qe(hm)??[],d=qe(gA),p=qe(hA),{userId:h}=hi()||{},[g,m]=S.useState(()=>(v==null?void 0:v.filter(K=>n==null?void 0:n.includes(K.id)))??[]),[E,x]=S.useState(()=>(y==null?void 0:y.find(K=>o==null?void 0:o.includes(K.name)))??{}),[A,T]=S.useState(()=>{var K,oe,de;return((de=(oe=(K=b==null?void 0:b[i])==null?void 0:K.cardList)==null?void 0:oe.find(ie=>ie.id===t))==null?void 0:de.fields)??[]}),[C,O]=S.useState(Ho.CARD_VISIBILITY.ID);S.useEffect(()=>{f(qs(t))},[f,t]),S.useEffect(()=>{d[t]&&T(K=>Km(K,d[t]||[]))},[d,t]);const M=S.useMemo(()=>!Array.isArray(n)||n.length!==g.length?!1:n.every(K=>g.some(({id:oe})=>oe===K)),[n,g]),B=S.useMemo(()=>Array.isArray(o)?o.length?!!(o!=null&&o.every(K=>E.name===K)):!Object.keys(E).length:!1,[o,E]),U=S.useMemo(()=>{const K=d[t]||[];if(!Array.isArray(l))return!1;const oe=Km(l,K);if(A.length!=oe.length)return!1;for(let de=0;de<oe.length;de++){const ie=oe[de],ge=A[de];if(A&&(ie.key!==ge.key||ie.enabled!==ge.enabled))return!1}return!0},[l,A,d,t]),G=g.length!==0&&A.filter(K=>K.enabled).length===0,X=p===Ie.LOADING||M&&B&&U||G,q=S.useMemo(()=>!!(l!=null&&l.some(K=>K.isFieldNew)),[l]),$=h&&id(t,h),se=fa(u)&&q&&!$?$m:"",ve=K=>{K.stopPropagation();const oe=E!=null&&E.name?[E.name]:[],de=g.map(ge=>ge.id),ie=A.map((ge,Ee)=>({...ge,priority:Ee+1}));f(Zs({cardId:t,data:{roles:oe,inboxes:{email:de,chat:[]},fields:ie},currentConnector:i})).unwrap().then(()=>{var Ae,me,ze;const ge=(Ae=b==null?void 0:b[i])==null?void 0:Ae.name,Ee=(ze=(me=b==null?void 0:b[i])==null?void 0:me.cardList)==null?void 0:ze.some(V=>{var Nn;if(V.id===t)return!1;const{email:Ye,chat:Le}=V.inboxes,Ue=!!(((Ye==null?void 0:Ye.length)??0)+((Le==null?void 0:Le.length)??0)),Pt=!!((Nn=V==null?void 0:V.roles)!=null&&Nn.length);return Ue&&Pt});c($e.CARD_VISIBILITY_UPDATED,{new_status:de.length&&(E!=null&&E.name)?lm:um,pre_status:n!=null&&n.length&&(y!=null&&y.length)?lm:um,connector_name:ge,card_title:a}),!Ee&&(E!=null&&E.name)&&de.length?r(!0):ge&&qn({message:jT.replace(BT,ge),type:Da})}).catch(()=>{qn({message:VT,type:co})}).finally(()=>e())},W=()=>{e(),c($e.CARD_VISIBILITY_UPDATE_CLOSED)},te=(K,oe)=>{O(oe),oe===Ho.FIELD_VISIBILITY.ID&&(c($e.CONNECTOR_VISIBILITY_FIELD_TAB_CLICKED),s(!0))},re=(K,oe)=>{var ie;const de=(ie=Object.values(Ho).find(ge=>ge.ID===K))==null?void 0:ie.LABEL;return I.jsxs(w.Stack,{direction:"row",alignItems:"center",gap:1.25,children:[de,oe?I.jsx(Na,{label:oe}):null]})};return I.jsx(UT,{children:I.jsxs(KT,{children:[I.jsx(qT,{variant:"h2",children:im}),I.jsx(w.Box,{marginBottom:"24px",children:I.jsxs(w.Tabs,{value:C,onChange:te,children:[I.jsx(cm,{label:re(Ho.CARD_VISIBILITY.ID)}),I.jsx(cm,{label:re(Ho.FIELD_VISIBILITY.ID,se)})]})}),I.jsx("div",{hidden:C!==Ho.CARD_VISIBILITY.ID,children:I.jsx(i3,{selectedEmailInboxes:g,setSelectedEmailInboxes:m,selectedRoles:E,setSelectedRoles:x})}),I.jsx("div",{hidden:C!==Ho.FIELD_VISIBILITY.ID,children:I.jsx($O,{fields:A,setFields:T,cardId:t})}),I.jsxs(QT,{children:[I.jsx(tA,{onClick:W,variant:"text",children:kT}),I.jsx(w.Tooltip,{title:G?zT:null,children:I.jsx("div",{children:I.jsx(eA,{onClick:ve,disabled:X,children:p!==Ie.LOADING?I.jsx(w.Typography,{variant:"body2_medium",children:HT}):I.jsx(w.Grid,{height:"22px",children:I.jsx($T,{size:22})})})})})]})]})})},s3=w.styled(w.Box)`
|
|
540
540
|
height: 52px;
|
|
541
541
|
box-sizing: border-box;
|
|
542
542
|
width: 100%;
|
|
@@ -592,13 +592,13 @@ Take a look at the reducer(s) handling this action type: ${y.type}.
|
|
|
592
592
|
opacity: 0.5;
|
|
593
593
|
background-color: transparent;
|
|
594
594
|
}
|
|
595
|
-
`,d3=({infoCard:e,currentConnectorId:t,setShowEnabledModal:n})=>{var T,C;const r=((T=e.inboxes)==null?void 0:T.email)||[],o=((C=e.inboxes)==null?void 0:C.chat)||[],i=e.roles??[],a=e.fields??[],{isCardNew:l}=e,s=r.length+o.length,u=s>0&&i.length>0,[c,f]=S.useState(!1),[b,y]=S.useState(!1),{availableFeatures:v,userPermissions:d,sendTrackingEvent:p}=S.useContext(
|
|
595
|
+
`,d3=({infoCard:e,currentConnectorId:t,setShowEnabledModal:n})=>{var T,C;const r=((T=e.inboxes)==null?void 0:T.email)||[],o=((C=e.inboxes)==null?void 0:C.chat)||[],i=e.roles??[],a=e.fields??[],{isCardNew:l}=e,s=r.length+o.length,u=s>0&&i.length>0,[c,f]=S.useState(!1),[b,y]=S.useState(!1),{availableFeatures:v,userPermissions:d,sendTrackingEvent:p}=S.useContext(zt),h=qE(d),{userId:g}=hi()||{},m=O=>{f(O),!O&&g&&(qO(e.id,g),b&&UO(e.id,g))},E=()=>{f(!0),p($e.CONFIGURE_VISIBILITY_CLICKED)},x=S.useMemo(()=>fa(v)&&l&&g&&!JO(e.id,g),[v,e,g,c,l]),A=S.useMemo(()=>g&&fa(v)&&a.some(O=>O.isFieldNew)&&!id(e.id,g),[v,e,g,c,a]);return I.jsxs(I.Fragment,{children:[I.jsxs(s3,{children:[I.jsxs(w.Stack,{gap:"8px",direction:"row",children:[e.title,I.jsxs(w.Stack,{gap:"5px",direction:"row",children:[I.jsx(Na,{hidden:!x,label:Mc}),I.jsx(Na,{hidden:!A,label:$m})]})]}),I.jsxs(l3,{children:[I.jsx(w.Typography,{className:"hover__text",variant:"caption",children:u?`Visible across ${s} Shared mailbox${s>1?"es":""}`:AT}),I.jsx($A,{children:I.jsx(u3,{})}),I.jsx(w.Tooltip,{title:h?im:_T,placement:"bottom",children:I.jsx(c3,{className:"visibilityIcon",onClick:E,disabled:!h,children:u?I.jsx(KA,{}):I.jsx(e_,{})})})]})]}),I.jsx(Vc,{shown:c,setShown:m,customPaperProps:{overflow:"inherit"},children:I.jsx(a3,{roles:i,emailSMs:r,fields:a,handleClose:()=>m(!1),id:e.id,title:e.title,currentConnectorId:t,setShowEnabledModal:n,setVisitedFieldVisTab:y})})]})},f3=({infoCards:e,currentConnectorId:t,setShowEnabledModal:n})=>I.jsx("div",{children:e.map(r=>I.jsx(d3,{setShowEnabledModal:n,currentConnectorId:t,infoCard:r},r.id))}),p3=w.styled(w.Typography)`
|
|
596
596
|
text-align: left;
|
|
597
597
|
ul {
|
|
598
598
|
margin: 0;
|
|
599
599
|
padding-inline-start: 20px;
|
|
600
600
|
}
|
|
601
|
-
`,h3=({connectorName:e,updates:t=""})=>I.jsxs(w.Stack,{padding:"20px",children:[I.jsxs(w.Typography,{variant:"h2",marginBottom:1,children:["Upgrade ",e," connector"]}),I.jsx(p3,{variant:"body2",color:w.theme.palette.gray.gray2,dangerouslySetInnerHTML:{__html:t}})]}),g3=w.styled(({className:e,...t})=>I.jsx(w.Tooltip,{...t,classes:{popper:e}}))(()=>({[`& .${w.tooltipClasses.tooltip}`]:{backgroundColor:"#fff",padding:0,minWidth:"400px",borderRadius:"4px",boxShadow:"0px 3px 15px 0px #00000040"}})),e0=({connector:e,isConfigSettingsPage:t,isEdit:n=!1,isConnectorCard:r=!1})=>{const{sendTrackingEvent:o}=S.useContext(
|
|
601
|
+
`,h3=({connectorName:e,updates:t=""})=>I.jsxs(w.Stack,{padding:"20px",children:[I.jsxs(w.Typography,{variant:"h2",marginBottom:1,children:["Upgrade ",e," connector"]}),I.jsx(p3,{variant:"body2",color:w.theme.palette.gray.gray2,dangerouslySetInnerHTML:{__html:t}})]}),g3=w.styled(({className:e,...t})=>I.jsx(w.Tooltip,{...t,classes:{popper:e}}))(()=>({[`& .${w.tooltipClasses.tooltip}`]:{backgroundColor:"#fff",padding:0,minWidth:"400px",borderRadius:"4px",boxShadow:"0px 3px 15px 0px #00000040"}})),e0=({connector:e,isConfigSettingsPage:t,isEdit:n=!1,isConnectorCard:r=!1})=>{const{sendTrackingEvent:o}=S.useContext(zt),{id:i,name:a,logo:l,description:s,isAuthenticated:u,showUpgradeButton:c=!1,updates:f}=e,b=qe(pA),y=qe(pm),v=qe(jc),[d,p]=S.useState(!1),h=uo(),g=so(),m=(X,q)=>{X==null||X.stopPropagation(),h(zs({id:q,enabled:X.target.checked})).unwrap().then(()=>{X.target.checked?o($e.TOGGLE_ENABLED,{connector_name:a}):(o($e.TOGGLE_DISABLED,{connector_name:a}),qn({message:AA,type:mm}))}).catch(()=>{qn({message:TA,type:co})})},E=(X,q)=>{X==null||X.stopPropagation(),o($e.ADD_CONNECTOR_CLICKED,{connector_name:a}),g(`${Xe.BASEPATH}${Xe.CONNECTOR_SETTINGS}/${q}`)},x=(X,q)=>{X==null||X.stopPropagation(),o($e.SETTINGS_CLICKED,{connector_name:a}),g(`${Xe.BASEPATH}${Xe.CONNECTOR_SETTINGS}/${q}?isEdit=true`)},A=(X,q="")=>{X==null||X.preventDefault(),X==null||X.stopPropagation(),!t&&g(`${Xe.BASEPATH}${Xe.API_VIEW}/${q}?isEdit=true`)},T=X=>{X==null||X.stopPropagation(),g(`${Xe.BASEPATH}${Xe.CONNECTOR_SETTINGS}/${i}?isEdit=true`)};let C=!1;"isEnabled"in e&&typeof e.isEnabled=="boolean"&&(C=e.isEnabled);const O=!(e!=null&&e.isAuthenticated),M=[y,v].includes(Ie.LOADING)||O,B=!t&&(e==null?void 0:e.cardList)&&e.isEnabled&&e.isAuthenticated,G=Wp({"connector-flex":!0,"connector-settings":!!t,"connector-expanded":!t&&C&&!!u,"connector-has-upgrade":c});return I.jsxs(bA,{className:t?"noBorder":"",children:[I.jsx(FA,{shown:d,setShown:p,connectorName:e.name}),I.jsxs(vA,{"data-testid":i,className:"connector-grid",onClick:X=>A(X,i),children:[I.jsxs(w.Stack,{className:G,width:"100%",children:[I.jsx(w.Stack,{direction:"row",gap:1,alignItems:"center",children:I.jsxs(w.Stack,{flexDirection:"row",alignItems:"center",children:[t?I.jsx("img",{src:l??"",className:"logoIcon",width:"28xp",height:"28px",alt:a}):null,I.jsxs(w.Box,{children:[I.jsx(yA,{variant:r?"body1_medium":"h2",children:a}),I.jsxs(w.Stack,{direction:"row",alignItems:"center",gap:"4px",hidden:t||!c||O||!f,children:[I.jsx(w.Typography,{variant:"body2",color:w.theme.palette.gray.gray3,children:YT}),I.jsx(g3,{placement:"bottom",title:I.jsx(h3,{connectorName:e.name,updates:f}),children:I.jsx(w.Icon,{children:I.jsx(SA,{})})})]})]})]})}),t&&!n?I.jsx(wA,{variant:"contained",onClick:X=>E(X,i),children:gT}):I.jsxs(EA,{children:[!t&&c&&!O?I.jsx(w.Box,{marginRight:"7px",children:I.jsx(w.Button,{size:"small",onClick:T,children:XT})}):null,!t&&O?I.jsx(IA,{severity:"error",children:ZT}):null,I.jsx(w.Tooltip,{title:mT,placement:"bottom",children:I.jsx(w.IconButton,{onClick:X=>x(X,i),children:I.jsx("img",{src:_A,className:"settingsIcon"})})}),(b==null?void 0:b[i])!==Ie.LOADING?I.jsx(w.Tooltip,{title:C?vT:bT,placement:"bottom",children:I.jsx(w.Switch,{id:`switch_${i}`,checked:C,disabled:M,onClick:X=>X==null?void 0:X.stopPropagation(),onChange:X=>m(X,i)})}):I.jsx(xA,{width:"58px",height:"38px",alignItems:"center",flexDirection:"row",justifyContent:"center",children:I.jsx(CA,{"data-testid":"loading"})})]})]}),t?I.jsx(w.Typography,{maxWidth:"577px",variant:"body1",color:w.theme.palette.gray.gray3,className:"connector-grid",children:s}):null]}),B?I.jsx(f3,{setShowEnabledModal:p,currentConnectorId:i,infoCards:e.cardList||[]}):null]})},m3=()=>{const e=qe(fm),t=qe(bl);return I.jsx(dm,{children:I.jsx(w.Box,{"data-testid":"connector-custom-card",children:e.map(n=>{var r;return(r=t==null?void 0:t[n])!=null&&r.id?I.jsx(e0,{connector:t[n],isConfigSettingsPage:!1,isConnectorCard:!0},n):null})})})},t0=e=>e.requestConnectorApi.connectorRequestsApiStatus,b3=e=>e.requestConnectorApi.requestableConnectors,v3=e=>e.requestConnectorApi.requestableApis,y3=({connectors:e,canSubmit:t,setSelectedConnectors:n,selectedConnectors:r,setOptionalDetails:o,handleSubmit:i,isApiText:a})=>{const{sendTrackingEvent:l}=S.useContext(zt),u=qe(t0)===Ie.LOADING,c=r.length===0?a?lT:uT:"";return S.useEffect(()=>{l(a?$e.REQUEST_NEW_FEATURE_SHOWN:$e.REQUEST_NEW_CONNECTOR_SHOWN)},[l,a]),I.jsx(w.Stack,{"data-testid":"request-panel",children:I.jsxs(w.Stack,{padding:"30px",height:"100%",children:[I.jsx(w.Stack,{width:"440px",height:"100%",children:I.jsxs(w.Stack,{gap:"14px",children:[I.jsxs(w.Stack,{gap:"4px",marginBottom:"36px",children:[I.jsx(w.Typography,{variant:"h2",children:a?iT:aT}),I.jsx(w.Typography,{variant:"body2",children:a?rm:sT})]}),I.jsx(w.Autocomplete,{"data-testid":"request-dropdown",disablePortal:!0,multiple:!0,disableCloseOnSelect:!0,limitTags:2,options:e,disabled:u,isOptionEqualToValue:(f,b)=>f.id===b.id,renderOption:(f,b,{selected:y})=>{const{key:v,...d}=f;return I.jsxs(w.Box,{component:"li",...d,minHeight:"36px",children:[I.jsx(w.Checkbox,{style:{marginRight:8},checked:y}),b.label]},v)},renderInput:f=>I.jsx(ad,{...f,variant:"outlined",placeholder:c}),ListboxProps:{style:{maxHeight:250}},onChange:(f,b)=>{n(b)}}),I.jsx(Qm,{multiline:!0,fullWidth:!0,minRows:8,variant:"outlined",disabled:u,placeholder:cT,onChange:f=>{o(f.target.value)}})]})}),I.jsx(w.Stack,{alignItems:"flex-end",children:I.jsx(w.Button,{"data-testid":"submit-request-button",onClick:i,color:"tertiary",size:"medium",sx:{height:"32px",width:"140.25px"},disabled:!t||u,children:u?I.jsx(w.CircularProgress,{sx:{color:"#97A3B7"},size:20}):I.jsx("div",{children:dT})})})]})})},E3=({handleClose:e})=>I.jsx(w.Stack,{children:I.jsxs(w.Stack,{padding:"30px",height:"100%",children:[I.jsx(w.Stack,{width:"378px",height:"100%",justifyContent:"center",children:I.jsxs(w.Stack,{gap:"14px",children:[I.jsx("img",{src:bm,alt:"checkmark",width:92,height:92}),I.jsxs(w.Stack,{gap:"4px",children:[I.jsx(w.Typography,{variant:"h2",children:fT}),I.jsx(w.Typography,{variant:"body2",children:pT})]})]})}),I.jsx(w.Stack,{alignItems:"flex-end",children:I.jsx(e3,{onClick:e,variant:"outlined",color:"tertiary",size:"medium",children:hT})})]})}),sd=({shown:e,setShown:t,connectorType:n,isApi:r=!1})=>{const{sendTrackingEvent:o}=S.useContext(zt),i=uo(),a=qe(b3),l=qe(v3),s=qe(t0),[u,c]=S.useState(""),[f,b]=S.useState([]),[y,v]=S.useState([]),[d,p]=S.useState(!1),[h,g]=S.useState(!1),m=()=>{const T=r?om.API:om.CONNECTOR,C=y.map(O=>O.id);i($s({type:T,values:C,description:u})).unwrap().then(()=>{o(r?$e.REQUEST_NEW_FEATURE_SUBMIT_CLICKED:$e.REQUEST_NEW_CONNECTOR_SUBMIT_CLICKED),g(!0)}).catch(()=>{qn({message:yT,type:co})})};S.useEffect(()=>(e&&h&&g(!1),()=>{v([]),c("")}),[e]),S.useEffect(()=>{var T;if(r){const C=((T=l==null?void 0:l.find(O=>O.connector_type===n))==null?void 0:T.apis)||[];b(C.map(O=>({label:O.name,id:O.key})))}else b((a||[]).map(C=>({label:C.name,id:C.key})))},[l,a,r,n]),S.useEffect(()=>{p(y.length>0)},[y,u]);const E=h&&s!==Ie.LOADING,x=T=>{T||o(r?$e.REQUEST_NEW_FEATURE_CLOSE_CLICKED:$e.REQUEST_NEW_CONNECTOR_CLOSE_CLICKED),t(T)},A=()=>{t(!1),o(r?$e.REQUEST_NEW_FEATURE_DONE_CLICKED:$e.REQUEST_NEW_CONNECTOR_DONE_CLICKED)};return I.jsxs(Vc,{shown:e,setShown:x,showCloseButton:!0,children:[E?I.jsx(E3,{handleClose:A}):I.jsx(y3,{connectors:f,canSubmit:d,setSelectedConnectors:v,selectedConnectors:y,setOptionalDetails:c,handleSubmit:m,isApiText:r}),I.jsx(KO,{children:I.jsx("img",{loading:"lazy",className:"request-new-connector-img",src:Q2,alt:"Request new connector"})})]})},x3="Custom Connectors",C3="Connectors help you get a better customer context and key actions right into your inbox",w3="Library",I3="Use these pre-built connectors to get started without any hassle. Authenticate and access them from the right panel of Hiver.",S3=w.styled(w.Box)`
|
|
602
602
|
padding: 14px 0px 0 32px;
|
|
603
603
|
box-sizing: border-box;
|
|
604
604
|
`,T3=w.styled(w.Stack)`
|
|
@@ -682,7 +682,7 @@ Take a look at the reducer(s) handling this action type: ${y.type}.
|
|
|
682
682
|
`,q3=w.styled(w.icons.CalendarTodayOutlinedIcon)`
|
|
683
683
|
height: 16px;
|
|
684
684
|
width: 16px;
|
|
685
|
-
`,ud=({isApiViewPage:e=!1,isSettingsPage:t=!1})=>{const{availableFeatures:n,sendTrackingEvent:r}=S.useContext(
|
|
685
|
+
`,ud=({isApiViewPage:e=!1,isSettingsPage:t=!1})=>{const{availableFeatures:n,sendTrackingEvent:r}=S.useContext(zt),{DETAILS_PAGE:o,AUTH_PAGE:i,CONNECTORS_PAGE_ADMIN_SIDE:a}=ET,l=t?i:e?o:a,s=Wp({"settings-page":t,"api-view-page":e}),[u,c]=S.useState(()=>{const y=localStorage.getItem(ld)==="true";return(t||!y)&&br(n,NE)});S.useEffect(()=>{localStorage.getItem(ld)==="true"&&!t&&c(!1)},[t]);const f=()=>{window.open(H3,"_blank"),r($e.SCHEDULE_CALL_CLICKED,{source:l})},b=()=>{localStorage.setItem(ld,"true"),c(!1),r($e.SCHEDULE_CALL_CROSS_CLICKED,{source:l})};return u?I.jsxs(X3,{direction:"row",className:s,children:[I.jsxs(Z3,{className:s,children:[I.jsxs("div",{children:[I.jsx(w.Typography,{color:w.theme.palette.gray.black,variant:"body2_medium",children:k3+(t?L3:"")}),I.jsx(w.Typography,{variant:"body2",children:F3})]}),I.jsxs(Y3,{onClick:f,variant:"outlined",size:"small",children:[I.jsx(q3,{}),M3]})]}),t?null:I.jsx("div",{className:"schedule-close",children:I.jsx(w.Tooltip,{title:"Close",placement:"bottom",children:I.jsx(w.IconButton,{onClick:b,children:I.jsx(U3,{})})})})]}):null},n0=()=>{const e=uo(),{connectorFunctions:t}=S.useContext(zt),[n,r]=S.useState(!1),[o,i]=S.useState(!1),a=qe(fm),l=qe(zh),s=qe(pm),u=!!a.length,c=!!l.length,{sendTrackingEvent:f}=S.useContext(zt),b=s===Ie.LOADING;S.useEffect(()=>{t&&(e(Xs(t.getInboxDetails)),e(Ys(t.getRoles)))},[t,e]),S.useEffect(()=>{e(Us()),e(Qs())},[e]);const y=(d,p=!1)=>{r(d),i(!1),p&&(console.log("SSSSSSSSSSSS 4 : ",f),f($e.REQUEST_NEW_CLICKED))},v=d=>{i(d),r(!1)};return I.jsxs(S3,{"data-testid":"connector-dashboard",children:[I.jsx(ud,{}),I.jsxs(T3,{children:[I.jsx(A3,{variant:"h2",children:x3}),u&&!b?I.jsx(w.Button,{"data-testid":"connector-available-request-new",onClick:()=>{y(!0,!0)},children:nm}):null]}),I.jsx(_3,{variant:"body1",color:"rgba(108, 123, 148, 1)",children:C3}),b?I.jsx(P3,{}):I.jsx(I.Fragment,{children:u?I.jsx(m3,{}):I.jsx(fA,{setModalState:y})}),I.jsxs(w.Box,{marginTop:"32px",children:[c?I.jsxs(I.Fragment,{children:[I.jsx(O3,{variant:"h2",children:w3}),I.jsx(R3,{variant:"body1",color:w.theme.palette.gray.gray3,children:I3})]}):null,I.jsx(rA,{})]}),I.jsx(sd,{shown:o||n,setShown:o?v:y,isApi:o})]})},J3=w.styled(w.Box)`
|
|
686
686
|
box-sizing: border-box;
|
|
687
687
|
background-color: #ffffff;
|
|
688
688
|
width: 178px;
|
|
@@ -720,7 +720,7 @@ Take a look at the reducer(s) handling this action type: ${y.type}.
|
|
|
720
720
|
color: #343c45;
|
|
721
721
|
}
|
|
722
722
|
}
|
|
723
|
-
`,eR=({sidebarOptions:e=[]})=>{const{currentSideBar:t,setCurrentSideBar:n,sendTrackingEvent:r}=S.useContext(
|
|
723
|
+
`,eR=({sidebarOptions:e=[]})=>{const{currentSideBar:t,setCurrentSideBar:n,sendTrackingEvent:r}=S.useContext(zt),o=so(),{pathname:i}=ao();S.useEffect(()=>{const s=e.find(c=>Xe.BASEPATH+c.route===i),u=Object.keys(Qh).find(c=>Qh[c].includes(i));s!=null&&s.value&&(s==null?void 0:s.value)!==t?n(s.value):u&&u!==t&&n(u)},[i]);const a=(s,u,c,f)=>{s.stopPropagation(),n(c),r($e.TAB_CLICKED,{tab:f}),o(u)},l=()=>I.jsx(K3,{children:e.map(({id:s,value:u,route:c})=>{const f=t===u;return I.jsx("div",{"data-testid":s,className:f?"active":"",onClick:b=>a(b,c,u,s),children:u},s)})});return I.jsx(J3,{"data-testid":"sideBarParent",children:I.jsxs(Q3,{id:"connectors__sidebar",children:[I.jsx($3,{variant:"h3","data-testid":"custom-connector-heading",children:ac}),l()]})})},tR=w.styled(w.Stack)`
|
|
724
724
|
flex-direction: row;
|
|
725
725
|
align-items: stretch;
|
|
726
726
|
min-height: 100%;
|
|
@@ -747,7 +747,7 @@ Take a look at the reducer(s) handling this action type: ${y.type}.
|
|
|
747
747
|
color: ${w.theme.palette.purple.primary} !important;
|
|
748
748
|
border: 1px solid ${w.theme.palette.purple.primary} !important;
|
|
749
749
|
}
|
|
750
|
-
`,dR=({connectorName:e,connectorType:t,apiList:n,isLoading:r=!1,isEdit:o=!1})=>{const{sendTrackingEvent:i}=S.useContext(
|
|
750
|
+
`,dR=({connectorName:e,connectorType:t,apiList:n,isLoading:r=!1,isEdit:o=!1})=>{const{sendTrackingEvent:i}=S.useContext(zt),a=oR.replace("{{connector}}",e??""),[l,s]=S.useState(!1),u=()=>{i($e.REQUEST_NEW_FEATURE_CLICKED,{connector_name:e}),s(!0)};return I.jsx(uR,{children:r?I.jsx(lR,{}):I.jsxs(I.Fragment,{children:[I.jsx(sd,{shown:l,setShown:s,isApi:!0,connectorType:t}),I.jsxs(w.Stack,{direction:"row",justifyContent:"space-between",marginTop:"28px",children:[I.jsxs("div",{children:[I.jsx(w.Typography,{variant:"h2",children:a}),I.jsx(w.Typography,{variant:"body1",marginBottom:"20px",children:iR})]}),o?I.jsx(cR,{color:"tertiary",variant:"outlined",sx:{height:"fit-content"},size:"medium",onClick:u,children:aR}):null]}),I.jsx(w.Stack,{gap:"12px",children:n.map(c=>I.jsxs(w.Stack,{width:"100%",height:"72px",border:"1px solid #E0E0E0",borderRadius:"5px",padding:"12px",gap:"10px",children:[I.jsx(w.Typography,{variant:"body1_medium",children:c.name}),I.jsx(w.Typography,{variant:"body2",children:c.description})]},c.keyName))})]})})};var cd={exports:{}},Ol={exports:{}},lt={};/** @license React v16.13.1
|
|
751
751
|
* react-is.production.min.js
|
|
752
752
|
*
|
|
753
753
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -766,7 +766,7 @@ object-assign
|
|
|
766
766
|
(c) Sindre Sorhus
|
|
767
767
|
@license MIT
|
|
768
768
|
*/var dd,l0;function hR(){if(l0)return dd;l0=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var a={},l=0;l<10;l++)a["_"+String.fromCharCode(l)]=l;var s=Object.getOwnPropertyNames(a).map(function(c){return a[c]});if(s.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return dd=o()?Object.assign:function(i,a){for(var l,s=r(i),u,c=1;c<arguments.length;c++){l=Object(arguments[c]);for(var f in l)t.call(l,f)&&(s[f]=l[f]);if(e){u=e(l);for(var b=0;b<u.length;b++)n.call(l,u[b])&&(s[u[b]]=l[u[b]])}}return s},dd}var fd,u0;function pd(){if(u0)return fd;u0=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return fd=e,fd}var hd,c0;function d0(){return c0||(c0=1,hd=Function.call.bind(Object.prototype.hasOwnProperty)),hd}var gd,f0;function gR(){if(f0)return gd;f0=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=pd(),n={},r=d0();e=function(i){var a="Warning: "+i;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function o(i,a,l,s,u){if(process.env.NODE_ENV!=="production"){for(var c in i)if(r(i,c)){var f;try{if(typeof i[c]!="function"){var b=Error((s||"React class")+": "+l+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw b.name="Invariant Violation",b}f=i[c](a,c,s,l,null,t)}catch(v){f=v}if(f&&!(f instanceof Error)&&e((s||"React class")+": type specification of "+l+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var y=u?u():"";e("Failed "+l+" type: "+f.message+(y??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},gd=o,gd}var md,p0;function mR(){if(p0)return md;p0=1;var e=s0(),t=hR(),n=pd(),r=d0(),o=gR(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(l){var s="Warning: "+l;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}});function a(){return null}return md=function(l,s){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function f(W){var te=W&&(u&&W[u]||W[c]);if(typeof te=="function")return te}var b="<<anonymous>>",y={array:h("array"),bigint:h("bigint"),bool:h("boolean"),func:h("function"),number:h("number"),object:h("object"),string:h("string"),symbol:h("symbol"),any:g(),arrayOf:m,element:E(),elementType:x(),instanceOf:A,node:M(),objectOf:C,oneOf:T,oneOfType:O,shape:U,exact:G};function v(W,te){return W===te?W!==0||1/W===1/te:W!==W&&te!==te}function d(W,te){this.message=W,this.data=te&&typeof te=="object"?te:{},this.stack=""}d.prototype=Error.prototype;function p(W){if(process.env.NODE_ENV!=="production")var te={},re=0;function K(de,ie,ge,Ee,Ae,me,ze){if(Ee=Ee||b,me=me||ge,ze!==n){if(s){var V=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw V.name="Invariant Violation",V}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ye=Ee+":"+ge;!te[Ye]&&re<3&&(i("You are manually calling a React.PropTypes validation function for the `"+me+"` prop on `"+Ee+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),te[Ye]=!0,re++)}}return ie[ge]==null?de?ie[ge]===null?new d("The "+Ae+" `"+me+"` is marked as required "+("in `"+Ee+"`, but its value is `null`.")):new d("The "+Ae+" `"+me+"` is marked as required in "+("`"+Ee+"`, but its value is `undefined`.")):null:W(ie,ge,Ee,Ae,me)}var oe=K.bind(null,!1);return oe.isRequired=K.bind(null,!0),oe}function h(W){function te(re,K,oe,de,ie,ge){var Ee=re[K],Ae=$(Ee);if(Ae!==W){var me=ue(Ee);return new d("Invalid "+de+" `"+ie+"` of type "+("`"+me+"` supplied to `"+oe+"`, expected ")+("`"+W+"`."),{expectedType:W})}return null}return p(te)}function g(){return p(a)}function m(W){function te(re,K,oe,de,ie){if(typeof W!="function")return new d("Property `"+ie+"` of component `"+oe+"` has invalid PropType notation inside arrayOf.");var ge=re[K];if(!Array.isArray(ge)){var Ee=$(ge);return new d("Invalid "+de+" `"+ie+"` of type "+("`"+Ee+"` supplied to `"+oe+"`, expected an array."))}for(var Ae=0;Ae<ge.length;Ae++){var me=W(ge,Ae,oe,de,ie+"["+Ae+"]",n);if(me instanceof Error)return me}return null}return p(te)}function E(){function W(te,re,K,oe,de){var ie=te[re];if(!l(ie)){var ge=$(ie);return new d("Invalid "+oe+" `"+de+"` of type "+("`"+ge+"` supplied to `"+K+"`, expected a single ReactElement."))}return null}return p(W)}function x(){function W(te,re,K,oe,de){var ie=te[re];if(!e.isValidElementType(ie)){var ge=$(ie);return new d("Invalid "+oe+" `"+de+"` of type "+("`"+ge+"` supplied to `"+K+"`, expected a single ReactElement type."))}return null}return p(W)}function A(W){function te(re,K,oe,de,ie){if(!(re[K]instanceof W)){var ge=W.name||b,Ee=ve(re[K]);return new d("Invalid "+de+" `"+ie+"` of type "+("`"+Ee+"` supplied to `"+oe+"`, expected ")+("instance of `"+ge+"`."))}return null}return p(te)}function T(W){if(!Array.isArray(W))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),a;function te(re,K,oe,de,ie){for(var ge=re[K],Ee=0;Ee<W.length;Ee++)if(v(ge,W[Ee]))return null;var Ae=JSON.stringify(W,function(ze,V){var Ye=ue(V);return Ye==="symbol"?String(V):V});return new d("Invalid "+de+" `"+ie+"` of value `"+String(ge)+"` "+("supplied to `"+oe+"`, expected one of "+Ae+"."))}return p(te)}function C(W){function te(re,K,oe,de,ie){if(typeof W!="function")return new d("Property `"+ie+"` of component `"+oe+"` has invalid PropType notation inside objectOf.");var ge=re[K],Ee=$(ge);if(Ee!=="object")return new d("Invalid "+de+" `"+ie+"` of type "+("`"+Ee+"` supplied to `"+oe+"`, expected an object."));for(var Ae in ge)if(r(ge,Ae)){var me=W(ge,Ae,oe,de,ie+"."+Ae,n);if(me instanceof Error)return me}return null}return p(te)}function O(W){if(!Array.isArray(W))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var te=0;te<W.length;te++){var re=W[te];if(typeof re!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+se(re)+" at index "+te+"."),a}function K(oe,de,ie,ge,Ee){for(var Ae=[],me=0;me<W.length;me++){var ze=W[me],V=ze(oe,de,ie,ge,Ee,n);if(V==null)return null;V.data&&r(V.data,"expectedType")&&Ae.push(V.data.expectedType)}var Ye=Ae.length>0?", expected one of type ["+Ae.join(", ")+"]":"";return new d("Invalid "+ge+" `"+Ee+"` supplied to "+("`"+ie+"`"+Ye+"."))}return p(K)}function M(){function W(te,re,K,oe,de){return X(te[re])?null:new d("Invalid "+oe+" `"+de+"` supplied to "+("`"+K+"`, expected a ReactNode."))}return p(W)}function B(W,te,re,K,oe){return new d((W||"React class")+": "+te+" type `"+re+"."+K+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+oe+"`.")}function U(W){function te(re,K,oe,de,ie){var ge=re[K],Ee=$(ge);if(Ee!=="object")return new d("Invalid "+de+" `"+ie+"` of type `"+Ee+"` "+("supplied to `"+oe+"`, expected `object`."));for(var Ae in W){var me=W[Ae];if(typeof me!="function")return B(oe,de,ie,Ae,ue(me));var ze=me(ge,Ae,oe,de,ie+"."+Ae,n);if(ze)return ze}return null}return p(te)}function G(W){function te(re,K,oe,de,ie){var ge=re[K],Ee=$(ge);if(Ee!=="object")return new d("Invalid "+de+" `"+ie+"` of type `"+Ee+"` "+("supplied to `"+oe+"`, expected `object`."));var Ae=t({},re[K],W);for(var me in Ae){var ze=W[me];if(r(W,me)&&typeof ze!="function")return B(oe,de,ie,me,ue(ze));if(!ze)return new d("Invalid "+de+" `"+ie+"` key `"+me+"` supplied to `"+oe+"`.\nBad object: "+JSON.stringify(re[K],null," ")+`
|
|
769
|
-
Valid keys: `+JSON.stringify(Object.keys(W),null," "));var V=ze(ge,me,oe,de,ie+"."+me,n);if(V)return V}return null}return p(te)}function X(W){switch(typeof W){case"number":case"string":case"undefined":return!0;case"boolean":return!W;case"object":if(Array.isArray(W))return W.every(X);if(W===null||l(W))return!0;var te=f(W);if(te){var re=te.call(W),K;if(te!==W.entries){for(;!(K=re.next()).done;)if(!X(K.value))return!1}else for(;!(K=re.next()).done;){var oe=K.value;if(oe&&!X(oe[1]))return!1}}else return!1;return!0;default:return!1}}function q(W,te){return W==="symbol"?!0:te?te["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&te instanceof Symbol:!1}function $(W){var te=typeof W;return Array.isArray(W)?"array":W instanceof RegExp?"object":q(te,W)?"symbol":te}function ue(W){if(typeof W>"u"||W===null)return""+W;var te=$(W);if(te==="object"){if(W instanceof Date)return"date";if(W instanceof RegExp)return"regexp"}return te}function se(W){var te=ue(W);switch(te){case"array":case"object":return"an "+te;case"boolean":case"date":case"regexp":return"a "+te;default:return te}}function ve(W){return!W.constructor||!W.constructor.name?b:W.constructor.name}return y.checkPropTypes=o,y.resetWarningCache=o.resetWarningCache,y.PropTypes=y,y},md}var bd,h0;function bR(){if(h0)return bd;h0=1;var e=pd();function t(){}function n(){}return n.resetWarningCache=t,bd=function(){function r(a,l,s,u,c,f){if(f!==e){var b=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw b.name="Invariant Violation",b}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},bd}if(process.env.NODE_ENV!=="production"){var vR=s0(),yR=!0;cd.exports=mR()(vR.isElement,yR)}else cd.exports=bR()();var Ti=cd.exports;const xe=ds(Ti);var Qn={},g0={};function ER(e){for(var t=5381,n=e.length;n;)t=t*33^e.charCodeAt(--n);return t>>>0}var m0=ER;const xR=ds(m0);var CR=vd;function vd(e){Cr.length||Rl(),Cr[Cr.length]=e}var Cr=[],Rl,wr=0,wR=1024;function b0(){for(;wr<Cr.length;){var e=wr;if(wr=wr+1,Cr[e].call(),wr>wR){for(var t=0,n=Cr.length-wr;t<n;t++)Cr[t]=Cr[t+wr];Cr.length-=wr,wr=0}}Cr.length=0,wr=0}var v0=typeof Be<"u"?Be:self,y0=v0.MutationObserver||v0.WebKitMutationObserver;typeof y0=="function"?Rl=IR(b0):Rl=E0(b0),vd.requestFlush=Rl;function IR(e){var t=1,n=new y0(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}function E0(e){return function(){var n=setTimeout(o,0),r=setInterval(o,50);function o(){clearTimeout(n),clearInterval(r),e()}}}vd.makeRequestCallFromTimer=E0;var x0=CR,Nl=[],yd=[],SR=x0.makeRequestCallFromTimer(TR);function TR(){if(yd.length)throw yd.shift()}var C0=Ed;function Ed(e){var t;Nl.length?t=Nl.pop():t=new w0,t.task=e,x0(t)}function w0(){this.task=null}w0.prototype.call=function(){try{this.task.call()}catch(e){Ed.onerror?Ed.onerror(e):(yd.push(e),SR())}finally{this.task=null,Nl[Nl.length]=this}};const AR=ds(C0);(function(e){function t(Z){return Z&&typeof Z=="object"&&"default"in Z?Z.default:Z}var n=t(m0),r=t(C0);function o(Z){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(N){return typeof N}:o=function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},o(Z)}function i(Z,N,H){return N in Z?Object.defineProperty(Z,N,{value:H,enumerable:!0,configurable:!0,writable:!0}):Z[N]=H,Z}function a(Z){for(var N=1;N<arguments.length;N++){var H=arguments[N]!=null?arguments[N]:{},L=Object.keys(H);typeof Object.getOwnPropertySymbols=="function"&&(L=L.concat(Object.getOwnPropertySymbols(H).filter(function(z){return Object.getOwnPropertyDescriptor(H,z).enumerable}))),L.forEach(function(z){i(Z,z,H[z])})}return Z}function l(Z){return s(Z)||u(Z)||c()}function s(Z){if(Array.isArray(Z)){for(var N=0,H=new Array(Z.length);N<Z.length;N++)H[N]=Z[N];return H}}function u(Z){if(Symbol.iterator in Object(Z)||Object.prototype.toString.call(Z)==="[object Arguments]")return Array.from(Z)}function c(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var f=/([A-Z])/g,b=function(N){return"-".concat(N.toLowerCase())},y=function(N){var H=N.replace(f,b);return H[0]==="m"&&H[1]==="s"&&H[2]==="-"?"-".concat(H):H},v={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function d(Z,N){return Z+N.charAt(0).toUpperCase()+N.substring(1)}var p=["Webkit","ms","Moz","O"];Object.keys(v).forEach(function(Z){p.forEach(function(N){v[d(N,Z)]=v[Z]})});var h=function(N,H){return typeof H=="number"?v[N]?""+H:H+"px":""+H},g=function(N,H){return x(h(N,H))},m=function(N,H){return n(N).toString(36)},E=function(N){return m(JSON.stringify(N))},x=function(N){return N[N.length-10]==="!"&&N.slice(-11)===" !important"?N:"".concat(N," !important")},A=typeof Map<"u",T=function(){function Z(){this.elements={},this.keyOrder=[]}var N=Z.prototype;return N.forEach=function(L){for(var z=0;z<this.keyOrder.length;z++)L(this.elements[this.keyOrder[z]],this.keyOrder[z])},N.set=function(L,z,Q){if(!this.elements.hasOwnProperty(L))this.keyOrder.push(L);else if(Q){var ee=this.keyOrder.indexOf(L);this.keyOrder.splice(ee,1),this.keyOrder.push(L)}if(z==null){this.elements[L]=z;return}if(A&&z instanceof Map||z instanceof Z){var pe=this.elements.hasOwnProperty(L)?this.elements[L]:new Z;z.forEach(function(Je,Ge){pe.set(Ge,Je,Q)}),this.elements[L]=pe;return}if(!Array.isArray(z)&&o(z)==="object"){for(var fe=this.elements.hasOwnProperty(L)?this.elements[L]:new Z,he=Object.keys(z),ye=0;ye<he.length;ye+=1)fe.set(he[ye],z[he[ye]],Q);this.elements[L]=fe;return}this.elements[L]=z},N.get=function(L){return this.elements[L]},N.has=function(L){return this.elements.hasOwnProperty(L)},N.addStyleType=function(L){var z=this;if(A&&L instanceof Map||L instanceof Z)L.forEach(function(pe,fe){z.set(fe,pe,!0)});else for(var Q=Object.keys(L),ee=0;ee<Q.length;ee++)this.set(Q[ee],L[Q[ee]],!0)},Z}();function C(Z){return Z&&Z.__esModule&&Object.prototype.hasOwnProperty.call(Z,"default")?Z.default:Z}function O(Z,N){return N={exports:{}},Z(N,N.exports),N.exports}function M(Z){return Z&&Z.default||Z}var B=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=H;function H(L){return L.charAt(0).toUpperCase()+L.slice(1)}});C(B);var U=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=z;var H=L(B);function L(Q){return Q&&Q.__esModule?Q:{default:Q}}function z(Q,ee,pe){if(Q.hasOwnProperty(ee)){for(var fe={},he=Q[ee],ye=(0,H.default)(ee),Je=Object.keys(pe),Ge=0;Ge<Je.length;Ge++){var Ke=Je[Ge];if(Ke===ee)for(var it=0;it<he.length;it++)fe[he[it]+ye]=pe[ee];fe[Ke]=pe[Ke]}return fe}return pe}});C(U);var G=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=H;function H(L,z,Q,ee,pe){for(var fe=0,he=L.length;fe<he;++fe){var ye=L[fe](z,Q,ee,pe);if(ye)return ye}}});C(G);var X=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=L;function H(z,Q){z.indexOf(Q)===-1&&z.push(Q)}function L(z,Q){if(Array.isArray(Q))for(var ee=0,pe=Q.length;ee<pe;++ee)H(z,Q[ee]);else H(z,Q)}});C(X);var q=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=H;function H(L){return L instanceof Object&&!Array.isArray(L)}});C(q);var $=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=pe;var H=ee(U),L=ee(G),z=ee(X),Q=ee(q);function ee(fe){return fe&&fe.__esModule?fe:{default:fe}}function pe(fe){var he=fe.prefixMap,ye=fe.plugins;return function Je(Ge){for(var Ke in Ge){var it=Ge[Ke];if((0,Q.default)(it))Ge[Ke]=Je(it);else if(Array.isArray(it)){for(var yt=[],Ht=0,kn=it.length;Ht<kn;++Ht){var ea=(0,L.default)(ye,Ke,it[Ht],Ge,he);(0,z.default)(yt,ea||it[Ht])}yt.length>0&&(Ge[Ke]=yt)}else{var ss=(0,L.default)(ye,Ke,it,Ge,he);ss&&(Ge[Ke]=ss),Ge=(0,H.default)(he,Ke,Ge)}}return Ge}}}),ue=C($),se=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=H;function H(L,z){if(typeof z=="string"&&z==="text")return["-webkit-text","text"]}}),ve=C(se),W=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=L;var H=/-webkit-|-moz-|-ms-/;function L(z){return typeof z=="string"&&H.test(z)}Z.exports=N.default});C(W);var te=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=Q;var H=L(W);function L(ee){return ee&&ee.__esModule?ee:{default:ee}}var z=["-webkit-","-moz-",""];function Q(ee,pe){if(typeof pe=="string"&&!(0,H.default)(pe)&&pe.indexOf("calc(")>-1)return z.map(function(fe){return pe.replace(/calc\(/g,fe+"calc(")})}}),re=C(te),K=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=Q;var H=L(W);function L(ee){return ee&&ee.__esModule?ee:{default:ee}}var z=["-webkit-",""];function Q(ee,pe){if(typeof pe=="string"&&!(0,H.default)(pe)&&pe.indexOf("cross-fade(")>-1)return z.map(function(fe){return pe.replace(/cross-fade\(/g,fe+"cross-fade(")})}}),oe=C(K),de=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=z;var H=["-webkit-","-moz-",""],L={"zoom-in":!0,"zoom-out":!0,grab:!0,grabbing:!0};function z(Q,ee){if(Q==="cursor"&&L.hasOwnProperty(ee))return H.map(function(pe){return pe+ee})}}),ie=C(de),ge=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=Q;var H=L(W);function L(ee){return ee&&ee.__esModule?ee:{default:ee}}var z=["-webkit-",""];function Q(ee,pe){if(typeof pe=="string"&&!(0,H.default)(pe)&&pe.indexOf("filter(")>-1)return z.map(function(fe){return pe.replace(/filter\(/g,fe+"filter(")})}}),Ee=C(ge),Ae=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=L;var H={flex:["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex","flex"],"inline-flex":["-webkit-inline-box","-moz-inline-box","-ms-inline-flexbox","-webkit-inline-flex","inline-flex"]};function L(z,Q){if(z==="display"&&H.hasOwnProperty(Q))return H[Q]}}),me=C(Ae),ze=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=ee;var H={"space-around":"distribute","space-between":"justify","flex-start":"start","flex-end":"end"},L={alignContent:"msFlexLinePack",alignSelf:"msFlexItemAlign",alignItems:"msFlexAlign",justifyContent:"msFlexPack",order:"msFlexOrder",flexGrow:"msFlexPositive",flexShrink:"msFlexNegative",flexBasis:"msFlexPreferredSize"},z={auto:"1 1 auto",inherit:"inherit",initial:"0 1 auto",none:"0 0 auto",unset:"unset"},Q=/^\d+(\.\d+)?$/;function ee(pe,fe,he){if(Object.prototype.hasOwnProperty.call(L,pe)&&(he[L[pe]]=H[fe]||fe),pe==="flex"){if(Object.prototype.hasOwnProperty.call(z,fe)){he.msFlex=z[fe];return}if(Q.test(fe)){he.msFlex=fe+" 1 0%";return}var ye=fe.split(/\s/);switch(ye.length){case 1:he.msFlex="1 1 "+fe;return;case 2:Q.test(ye[1])?he.msFlex=ye[0]+" "+ye[1]+" 0%":he.msFlex=ye[0]+" 1 "+ye[1];return;default:he.msFlex=fe}}}}),V=C(ze),Ye=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=z;var H={"space-around":"justify","space-between":"justify","flex-start":"start","flex-end":"end","wrap-reverse":"multiple",wrap:"multiple"},L={alignItems:"WebkitBoxAlign",justifyContent:"WebkitBoxPack",flexWrap:"WebkitBoxLines",flexGrow:"WebkitBoxFlex"};function z(Q,ee,pe){Q==="flexDirection"&&typeof ee=="string"&&(ee.indexOf("column")>-1?pe.WebkitBoxOrient="vertical":pe.WebkitBoxOrient="horizontal",ee.indexOf("reverse")>-1?pe.WebkitBoxDirection="reverse":pe.WebkitBoxDirection="normal"),L.hasOwnProperty(Q)&&(pe[L[Q]]=H[ee]||ee)}}),Le=C(Ye),Ue=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=ee;var H=L(W);function L(pe){return pe&&pe.__esModule?pe:{default:pe}}var z=["-webkit-","-moz-",""],Q=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/gi;function ee(pe,fe){if(typeof fe=="string"&&!(0,H.default)(fe)&&Q.test(fe))return z.map(function(he){return fe.replace(Q,function(ye){return he+ye})})}}),Pt=C(Ue),Nn=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0});var H=function(){function fe(he,ye){var Je=[],Ge=!0,Ke=!1,it=void 0;try{for(var yt=he[Symbol.iterator](),Ht;!(Ge=(Ht=yt.next()).done)&&(Je.push(Ht.value),!(ye&&Je.length===ye));Ge=!0);}catch(kn){Ke=!0,it=kn}finally{try{!Ge&&yt.return&&yt.return()}finally{if(Ke)throw it}}return Je}return function(he,ye){if(Array.isArray(he))return he;if(Symbol.iterator in Object(he))return fe(he,ye);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();N.default=pe;function L(fe){return typeof fe=="number"&&!isNaN(fe)}var z=["center","end","start","stretch"],Q={"inline-grid":["-ms-inline-grid","inline-grid"],grid:["-ms-grid","grid"]},ee={alignSelf:function(he,ye){z.indexOf(he)>-1&&(ye.msGridRowAlign=he)},gridColumn:function(he,ye){if(L(he))ye.msGridColumn=he;else{var Je=he.split("/").map(function(yt){return+yt}),Ge=H(Je,2),Ke=Ge[0],it=Ge[1];ee.gridColumnStart(Ke,ye),ee.gridColumnEnd(it,ye)}},gridColumnEnd:function(he,ye){var Je=ye.msGridColumn;L(he)&&L(Je)&&(ye.msGridColumnSpan=he-Je)},gridColumnStart:function(he,ye){L(he)&&(ye.msGridColumn=he)},gridRow:function(he,ye){if(L(he))ye.msGridRow=he;else{var Je=he.split("/").map(function(yt){return+yt}),Ge=H(Je,2),Ke=Ge[0],it=Ge[1];ee.gridRowStart(Ke,ye),ee.gridRowEnd(it,ye)}},gridRowEnd:function(he,ye){var Je=ye.msGridRow;L(he)&&L(Je)&&(ye.msGridRowSpan=he-Je)},gridRowStart:function(he,ye){L(he)&&(ye.msGridRow=he)},gridTemplateColumns:function(he,ye){ye.msGridColumns=he},gridTemplateRows:function(he,ye){ye.msGridRows=he},justifySelf:function(he,ye){z.indexOf(he)>-1&&(ye.msGridColumnAlign=he)}};function pe(fe,he,ye){if(fe==="display"&&he in Q)return Q[he];if(fe in ee){var Je=ee[fe];Je(he,ye)}}}),kt=C(Nn),Ut=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=Q;var H=L(W);function L(ee){return ee&&ee.__esModule?ee:{default:ee}}var z=["-webkit-",""];function Q(ee,pe){if(typeof pe=="string"&&!(0,H.default)(pe)&&pe.indexOf("image-set(")>-1)return z.map(function(fe){return pe.replace(/image-set\(/g,fe+"image-set(")})}}),mt=C(Ut),zn=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=L;var H={marginBlockStart:["WebkitMarginBefore"],marginBlockEnd:["WebkitMarginAfter"],marginInlineStart:["WebkitMarginStart","MozMarginStart"],marginInlineEnd:["WebkitMarginEnd","MozMarginEnd"],paddingBlockStart:["WebkitPaddingBefore"],paddingBlockEnd:["WebkitPaddingAfter"],paddingInlineStart:["WebkitPaddingStart","MozPaddingStart"],paddingInlineEnd:["WebkitPaddingEnd","MozPaddingEnd"],borderBlockStart:["WebkitBorderBefore"],borderBlockStartColor:["WebkitBorderBeforeColor"],borderBlockStartStyle:["WebkitBorderBeforeStyle"],borderBlockStartWidth:["WebkitBorderBeforeWidth"],borderBlockEnd:["WebkitBorderAfter"],borderBlockEndColor:["WebkitBorderAfterColor"],borderBlockEndStyle:["WebkitBorderAfterStyle"],borderBlockEndWidth:["WebkitBorderAfterWidth"],borderInlineStart:["WebkitBorderStart","MozBorderStart"],borderInlineStartColor:["WebkitBorderStartColor","MozBorderStartColor"],borderInlineStartStyle:["WebkitBorderStartStyle","MozBorderStartStyle"],borderInlineStartWidth:["WebkitBorderStartWidth","MozBorderStartWidth"],borderInlineEnd:["WebkitBorderEnd","MozBorderEnd"],borderInlineEndColor:["WebkitBorderEndColor","MozBorderEndColor"],borderInlineEndStyle:["WebkitBorderEndStyle","MozBorderEndStyle"],borderInlineEndWidth:["WebkitBorderEndWidth","MozBorderEndWidth"]};function L(z,Q,ee){if(Object.prototype.hasOwnProperty.call(H,z))for(var pe=H[z],fe=0,he=pe.length;fe<he;++fe)ee[pe[fe]]=Q}}),cn=C(zn),So=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=H;function H(L,z){if(L==="position"&&z==="sticky")return["-webkit-sticky","sticky"]}}),To=C(So),Ao=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=Q;var H=["-webkit-","-moz-",""],L={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},z={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};function Q(ee,pe){if(L.hasOwnProperty(ee)&&z.hasOwnProperty(pe))return H.map(function(fe){return fe+pe})}}),Dn=C(Ao),Vt=/[A-Z]/g,Xn=/^ms-/,dn={};function fn(Z){return"-"+Z.toLowerCase()}function Ct(Z){if(dn.hasOwnProperty(Z))return dn[Z];var N=Z.replace(Vt,fn);return dn[Z]=Xn.test(N)?"-"+N:N}var Ur=Object.freeze({default:Ct}),Fr=M(Ur),_o=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=z;var H=L(Fr);function L(Q){return Q&&Q.__esModule?Q:{default:Q}}function z(Q){return(0,H.default)(Q)}Z.exports=N.default});C(_o);var pn=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=he;var H=Q(_o),L=Q(W),z=Q(B);function Q(ye){return ye&&ye.__esModule?ye:{default:ye}}var ee={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},pe={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};function fe(ye,Je){if((0,L.default)(ye))return ye;for(var Ge=ye.split(/,(?![^()]*(?:\([^()]*\))?\))/g),Ke=0,it=Ge.length;Ke<it;++Ke){var yt=Ge[Ke],Ht=[yt];for(var kn in Je){var ea=(0,H.default)(kn);if(yt.indexOf(ea)>-1&&ea!=="order")for(var ss=Je[kn],_f=0,q9=ss.length;_f<q9;++_f)Ht.unshift(yt.replace(ea,pe[ss[_f]]+ea))}Ge[Ke]=Ht.join(",")}return Ge.join(",")}function he(ye,Je,Ge,Ke){if(typeof Je=="string"&&ee.hasOwnProperty(ye)){var it=fe(Je,Ke),yt=it.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(kn){return!/-moz-|-ms-/.test(kn)}).join(",");if(ye.indexOf("Webkit")>-1)return yt;var Ht=it.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(kn){return!/-webkit-|-ms-/.test(kn)}).join(",");return ye.indexOf("Moz")>-1?Ht:(Ge["Webkit"+(0,z.default)(ye)]=yt,Ge["Moz"+(0,z.default)(ye)]=Ht,it)}}}),qr=C(pn),we=["Webkit"],mr=["Moz"],er=["ms"],wt=["Webkit","Moz"],$e=["Webkit","ms"],ht=["Webkit","Moz","ms"],At={plugins:[ve,re,oe,ie,Ee,me,V,Le,Pt,kt,mt,cn,To,Dn,qr],prefixMap:{transform:$e,transformOrigin:$e,transformOriginX:$e,transformOriginY:$e,backfaceVisibility:we,perspective:we,perspectiveOrigin:we,transformStyle:we,transformOriginZ:we,animation:we,animationDelay:we,animationDirection:we,animationFillMode:we,animationDuration:we,animationIterationCount:we,animationName:we,animationPlayState:we,animationTimingFunction:we,appearance:wt,userSelect:ht,fontKerning:we,textEmphasisPosition:we,textEmphasis:we,textEmphasisStyle:we,textEmphasisColor:we,boxDecorationBreak:we,clipPath:we,maskImage:we,maskMode:we,maskRepeat:we,maskPosition:we,maskClip:we,maskOrigin:we,maskSize:we,maskComposite:we,mask:we,maskBorderSource:we,maskBorderMode:we,maskBorderSlice:we,maskBorderWidth:we,maskBorderOutset:we,maskBorderRepeat:we,maskBorder:we,maskType:we,textDecorationStyle:wt,textDecorationSkip:wt,textDecorationLine:wt,textDecorationColor:wt,filter:we,fontFeatureSettings:wt,breakAfter:ht,breakBefore:ht,breakInside:ht,columnCount:wt,columnFill:wt,columnGap:wt,columnRule:wt,columnRuleColor:wt,columnRuleStyle:wt,columnRuleWidth:wt,columns:wt,columnSpan:wt,columnWidth:wt,writingMode:$e,flex:$e,flexBasis:we,flexDirection:$e,flexGrow:we,flexFlow:$e,flexShrink:we,flexWrap:$e,alignContent:we,alignItems:we,alignSelf:we,justifyContent:we,order:we,transitionDelay:we,transitionDuration:we,transitionProperty:we,transitionTimingFunction:we,backdropFilter:we,scrollSnapType:$e,scrollSnapPointsX:$e,scrollSnapPointsY:$e,scrollSnapDestination:$e,scrollSnapCoordinate:$e,shapeImageThreshold:we,shapeImageMargin:we,shapeImageOutside:we,hyphens:ht,flowInto:$e,flowFrom:$e,regionFragment:$e,textOrientation:we,boxSizing:mr,textAlignLast:mr,tabSize:mr,wrapFlow:er,wrapThrough:er,wrapMargin:er,touchAction:er,textSizeAdjust:$e,borderImage:we,borderImageOutset:we,borderImageRepeat:we,borderImageSlice:we,borderImageSource:we,borderImageWidth:we}},_t=ue(At),rn=[function(N,H,L){return N[0]!==":"?null:L(H+N)},function(N,H,L){if(N[0]!=="@")return null;var z=L(H);return["".concat(N,"{").concat(z.join(""),"}")]}],Lt=function Z(N,H,L,z,Q){for(var ee=new T,pe=0;pe<H.length;pe++)ee.addStyleType(H[pe]);var fe=new T,he=[];ee.forEach(function(Je,Ge){var Ke=L.some(function(it){var yt=it(Ge,N,function(Ht){return Z(Ht,[Je],L,z,Q)});if(yt!=null)return Array.isArray(yt)?he.push.apply(he,l(yt)):(console.warn("WARNING: Selector handlers should return an array of rules.Returning a string containing multiple rules is deprecated.",it),he.push("@media all {".concat(yt,"}"))),!0});Ke||fe.set(Ge,Je,!0)});var ye=Wt(N,fe,z,Q,L);return ye&&he.unshift(ye),he},Gt=function(N,H,L){if(H)for(var z=Object.keys(H),Q=0;Q<z.length;Q++){var ee=z[Q];N.has(ee)&&N.set(ee,H[ee](N.get(ee),L),!1)}},Kt=function(N,H,L){return"".concat(y(N),":").concat(L(N,H),";")},Pn=function(N,H){return N[H]=!0,N},Wt=function(N,H,L,z,Q){Gt(H,L,Q);var ee=Object.keys(H.elements).reduce(Pn,Object.create(null)),pe=_t(H.elements),fe=Object.keys(pe);if(fe.length!==H.keyOrder.length){for(var he=0;he<fe.length;he++)if(!ee[fe[he]]){var ye=void 0;if(fe[he][0]==="W"?ye=fe[he][6].toLowerCase()+fe[he].slice(7):fe[he][1]==="o"?ye=fe[he][3].toLowerCase()+fe[he].slice(4):ye=fe[he][2].toLowerCase()+fe[he].slice(3),ye&&ee[ye]){var Je=H.keyOrder.indexOf(ye);H.keyOrder.splice(Je,0,fe[he])}else H.keyOrder.unshift(fe[he])}}for(var Ge=z===!1?h:g,Ke=[],it=0;it<H.keyOrder.length;it++){var yt=H.keyOrder[it],Ht=pe[yt];if(Array.isArray(Ht))for(var kn=0;kn<Ht.length;kn++)Ke.push(Kt(yt,Ht[kn],Ge));else Ke.push(Kt(yt,Ht,Ge))}return Ke.length?"".concat(N,"{").concat(Ke.join(""),"}"):""},xt=null,Zn=function(N){if(xt==null&&(xt=document.querySelector("style[data-aphrodite]"),xt==null)){var H=document.head||document.getElementsByTagName("head")[0];xt=document.createElement("style"),xt.type="text/css",xt.setAttribute("data-aphrodite",""),H.appendChild(xt)}var L=xt.styleSheet||xt.sheet;if(L.insertRule){var z=L.cssRules.length;N.forEach(function(Q){try{L.insertRule(Q,z),z+=1}catch{}})}else xt.innerText=(xt.innerText||"")+N.join("")},Yn={fontFamily:function Z(N){if(Array.isArray(N)){var H={};return N.forEach(function(L){H[Z(L)]=!0}),Object.keys(H).join(",")}else return o(N)==="object"?(_(N.src,"@font-face",[N],!1),'"'.concat(N.fontFamily,'"')):N},animationName:function Z(N,H){if(Array.isArray(N))return N.map(function(Q){return Z(Q,H)}).join(",");if(o(N)==="object"){var L="keyframe_".concat(E(N)),z="@keyframes ".concat(L,"{");return N instanceof T?N.forEach(function(Q,ee){z+=Lt(ee,[Q],H,Yn,!1).join("")}):Object.keys(N).forEach(function(Q){z+=Lt(Q,[N[Q]],H,Yn,!1).join("")}),z+="}",j(L,[z]),L}else return N}},hn={},R=[],k=!1,j=function(N,H){var L;if(!hn[N]){if(!k){if(typeof document>"u")throw new Error("Cannot automatically buffer without a document");k=!0,r(ae)}(L=R).push.apply(L,l(H)),hn[N]=!0}},_=function(N,H,L,z){var Q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[];if(!hn[N]){var ee=Lt(H,L,Q,Yn,z);j(N,ee)}},F=function(){R=[],hn={},k=!1,xt=null},J=function(N){delete hn[N]},ce=function(){return R},ne=function(){if(k)throw new Error("Cannot buffer while already buffering");k=!0},be=function(){k=!1;var N=R;return R=[],N},le=function(){return be().join("")},ae=function(){var N=be();N.length>0&&Zn(N)},ke=function(){return Object.keys(hn)},Ne=function(N){N.forEach(function(H){hn[H]=!0})},Fe=function(N){return"_definition"in N&&"_name"in N&&"_len"in N},Me=function Z(N,H,L,z){for(var Q=0;Q<N.length;Q+=1)if(N[Q])if(Array.isArray(N[Q]))z+=Z(N[Q],H,L,z);else if(Fe(N[Q]))H.push(N[Q]._name),L.push(N[Q]._definition),z+=N[Q]._len;else throw new Error("Invalid Style Definition: Styles should be defined using the StyleSheet.create method.");return z},bt=function(N,H,L){var z=[],Q=[],ee=Me(H,z,Q,0);if(z.length===0)return"";var pe;return process.env.NODE_ENV==="production"?pe=z.length===1?"_".concat(z[0]):"_".concat(m(z.join())).concat((ee%36).toString(36)):pe=z.join("-o_O-"),_(pe,".".concat(pe),Q,N,L),pe},ot=function(N,H){return"".concat(H,"_").concat(m(N))},Dt=function(){return process.env.NODE_ENV==="production"?m:ot},gn=Dt(),Mr={create:function(N){for(var H={},L=Object.keys(N),z=0;z<L.length;z+=1){var Q=L[z],ee=N[Q],pe=JSON.stringify(ee);H[Q]={_len:pe.length,_name:gn(pe,Q),_definition:ee}}return H},rehydrate:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Ne(N)}},tr=typeof window<"u"?null:{renderStatic:function(N){F(),ne();var H=N(),L=le();return{html:H,css:{content:L,renderedClassNames:ke()}}}},Ki=process.env.NODE_ENV==="production"?null:{suppressStyleInjection:function(){F(),ne()},clearBufferAndResumeStyleInjection:function(){F()},getBufferedStyles:function(){return ce()}};function nr(Z){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rn;return{StyleSheet:a({},Mr,{extend:function(L){var z=L.map(function(Q){return Q.selectorHandler}).filter(function(Q){return Q});return nr(Z,N.concat(z))}}),StyleSheetServer:tr,StyleSheetTestUtils:Ki,minify:function(L){gn=L?m:ot},css:function(){for(var L=arguments.length,z=new Array(L),Q=0;Q<L;Q++)z[Q]=arguments[Q];return bt(Z,z,N)},flushToStyleTag:ae,injectAndGetClassName:bt,defaultSelectorHandlers:rn,reset:F,resetInjectedStyle:J}}e.makeExports=nr})(g0),Object.defineProperty(Qn,"__esModule",{value:!0});var _R=g0,OR=!1,Ir=_R.makeExports(OR),RR=Ir.StyleSheet,NR=Ir.StyleSheetServer,DR=Ir.StyleSheetTestUtils,PR=Ir.css,kR=Ir.minify,LR=Ir.flushToStyleTag,FR=Ir.injectAndGetClassName,MR=Ir.defaultSelectorHandlers,BR=Ir.reset,jR=Ir.resetInjectedStyle;Qn.StyleSheet=RR,Qn.StyleSheetServer=NR,Qn.StyleSheetTestUtils=DR,Qn.css=PR,Qn.minify=kR,Qn.flushToStyleTag=LR,Qn.injectAndGetClassName=FR,Qn.defaultSelectorHandlers=MR,Qn.reset=BR,Qn.resetInjectedStyle=jR;var Bt=Qn,xd={exports:{}},Cd={exports:{}},I0={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(I0);var VR=I0.exports,Dl={exports:{}},S0;function GR(){return S0||(S0=1,function(e,t){t.__esModule=!0,t.default=n;function n(r,o){return r.classList?!!o&&r.classList.contains(o):(" "+(r.className.baseVal||r.className)+" ").indexOf(" "+o+" ")!==-1}e.exports=t.default}(Dl,Dl.exports)),Dl.exports}(function(e,t){var n=VR;t.__esModule=!0,t.default=o;var r=n(GR());function o(i,a){i.classList?i.classList.add(a):(0,r.default)(i,a)||(typeof i.className=="string"?i.className=i.className+" "+a:i.setAttribute("class",(i.className&&i.className.baseVal||"")+" "+a))}e.exports=t.default})(Cd,Cd.exports);var WR=Cd.exports;function T0(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var HR=function(t,n){t.classList?t.classList.remove(n):typeof t.className=="string"?t.className=T0(t.className,n):t.setAttribute("class",T0(t.className&&t.className.baseVal||"",n))},vn={};function A0(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function _0(e){function t(n){var r=this.constructor.getDerivedStateFromProps(e,n);return r??null}this.setState(t.bind(this))}function O0(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}A0.__suppressDeprecationWarning=!0,_0.__suppressDeprecationWarning=!0,O0.__suppressDeprecationWarning=!0;function zR(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if(typeof e.getDerivedStateFromProps!="function"&&typeof t.getSnapshotBeforeUpdate!="function")return e;var n=null,r=null,o=null;if(typeof t.componentWillMount=="function"?n="componentWillMount":typeof t.UNSAFE_componentWillMount=="function"&&(n="UNSAFE_componentWillMount"),typeof t.componentWillReceiveProps=="function"?r="componentWillReceiveProps":typeof t.UNSAFE_componentWillReceiveProps=="function"&&(r="UNSAFE_componentWillReceiveProps"),typeof t.componentWillUpdate=="function"?o="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(o="UNSAFE_componentWillUpdate"),n!==null||r!==null||o!==null){var i=e.displayName||e.name,a=typeof e.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
769
|
+
Valid keys: `+JSON.stringify(Object.keys(W),null," "));var V=ze(ge,me,oe,de,ie+"."+me,n);if(V)return V}return null}return p(te)}function X(W){switch(typeof W){case"number":case"string":case"undefined":return!0;case"boolean":return!W;case"object":if(Array.isArray(W))return W.every(X);if(W===null||l(W))return!0;var te=f(W);if(te){var re=te.call(W),K;if(te!==W.entries){for(;!(K=re.next()).done;)if(!X(K.value))return!1}else for(;!(K=re.next()).done;){var oe=K.value;if(oe&&!X(oe[1]))return!1}}else return!1;return!0;default:return!1}}function q(W,te){return W==="symbol"?!0:te?te["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&te instanceof Symbol:!1}function $(W){var te=typeof W;return Array.isArray(W)?"array":W instanceof RegExp?"object":q(te,W)?"symbol":te}function ue(W){if(typeof W>"u"||W===null)return""+W;var te=$(W);if(te==="object"){if(W instanceof Date)return"date";if(W instanceof RegExp)return"regexp"}return te}function se(W){var te=ue(W);switch(te){case"array":case"object":return"an "+te;case"boolean":case"date":case"regexp":return"a "+te;default:return te}}function ve(W){return!W.constructor||!W.constructor.name?b:W.constructor.name}return y.checkPropTypes=o,y.resetWarningCache=o.resetWarningCache,y.PropTypes=y,y},md}var bd,h0;function bR(){if(h0)return bd;h0=1;var e=pd();function t(){}function n(){}return n.resetWarningCache=t,bd=function(){function r(a,l,s,u,c,f){if(f!==e){var b=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw b.name="Invariant Violation",b}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},bd}if(process.env.NODE_ENV!=="production"){var vR=s0(),yR=!0;cd.exports=mR()(vR.isElement,yR)}else cd.exports=bR()();var Ti=cd.exports;const xe=ds(Ti);var Qn={},g0={};function ER(e){for(var t=5381,n=e.length;n;)t=t*33^e.charCodeAt(--n);return t>>>0}var m0=ER;const xR=ds(m0);var CR=vd;function vd(e){Cr.length||Rl(),Cr[Cr.length]=e}var Cr=[],Rl,wr=0,wR=1024;function b0(){for(;wr<Cr.length;){var e=wr;if(wr=wr+1,Cr[e].call(),wr>wR){for(var t=0,n=Cr.length-wr;t<n;t++)Cr[t]=Cr[t+wr];Cr.length-=wr,wr=0}}Cr.length=0,wr=0}var v0=typeof Be<"u"?Be:self,y0=v0.MutationObserver||v0.WebKitMutationObserver;typeof y0=="function"?Rl=IR(b0):Rl=E0(b0),vd.requestFlush=Rl;function IR(e){var t=1,n=new y0(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}function E0(e){return function(){var n=setTimeout(o,0),r=setInterval(o,50);function o(){clearTimeout(n),clearInterval(r),e()}}}vd.makeRequestCallFromTimer=E0;var x0=CR,Nl=[],yd=[],SR=x0.makeRequestCallFromTimer(TR);function TR(){if(yd.length)throw yd.shift()}var C0=Ed;function Ed(e){var t;Nl.length?t=Nl.pop():t=new w0,t.task=e,x0(t)}function w0(){this.task=null}w0.prototype.call=function(){try{this.task.call()}catch(e){Ed.onerror?Ed.onerror(e):(yd.push(e),SR())}finally{this.task=null,Nl[Nl.length]=this}};const AR=ds(C0);(function(e){function t(Z){return Z&&typeof Z=="object"&&"default"in Z?Z.default:Z}var n=t(m0),r=t(C0);function o(Z){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(N){return typeof N}:o=function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},o(Z)}function i(Z,N,H){return N in Z?Object.defineProperty(Z,N,{value:H,enumerable:!0,configurable:!0,writable:!0}):Z[N]=H,Z}function a(Z){for(var N=1;N<arguments.length;N++){var H=arguments[N]!=null?arguments[N]:{},L=Object.keys(H);typeof Object.getOwnPropertySymbols=="function"&&(L=L.concat(Object.getOwnPropertySymbols(H).filter(function(z){return Object.getOwnPropertyDescriptor(H,z).enumerable}))),L.forEach(function(z){i(Z,z,H[z])})}return Z}function l(Z){return s(Z)||u(Z)||c()}function s(Z){if(Array.isArray(Z)){for(var N=0,H=new Array(Z.length);N<Z.length;N++)H[N]=Z[N];return H}}function u(Z){if(Symbol.iterator in Object(Z)||Object.prototype.toString.call(Z)==="[object Arguments]")return Array.from(Z)}function c(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var f=/([A-Z])/g,b=function(N){return"-".concat(N.toLowerCase())},y=function(N){var H=N.replace(f,b);return H[0]==="m"&&H[1]==="s"&&H[2]==="-"?"-".concat(H):H},v={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function d(Z,N){return Z+N.charAt(0).toUpperCase()+N.substring(1)}var p=["Webkit","ms","Moz","O"];Object.keys(v).forEach(function(Z){p.forEach(function(N){v[d(N,Z)]=v[Z]})});var h=function(N,H){return typeof H=="number"?v[N]?""+H:H+"px":""+H},g=function(N,H){return x(h(N,H))},m=function(N,H){return n(N).toString(36)},E=function(N){return m(JSON.stringify(N))},x=function(N){return N[N.length-10]==="!"&&N.slice(-11)===" !important"?N:"".concat(N," !important")},A=typeof Map<"u",T=function(){function Z(){this.elements={},this.keyOrder=[]}var N=Z.prototype;return N.forEach=function(L){for(var z=0;z<this.keyOrder.length;z++)L(this.elements[this.keyOrder[z]],this.keyOrder[z])},N.set=function(L,z,Q){if(!this.elements.hasOwnProperty(L))this.keyOrder.push(L);else if(Q){var ee=this.keyOrder.indexOf(L);this.keyOrder.splice(ee,1),this.keyOrder.push(L)}if(z==null){this.elements[L]=z;return}if(A&&z instanceof Map||z instanceof Z){var pe=this.elements.hasOwnProperty(L)?this.elements[L]:new Z;z.forEach(function(Je,Ge){pe.set(Ge,Je,Q)}),this.elements[L]=pe;return}if(!Array.isArray(z)&&o(z)==="object"){for(var fe=this.elements.hasOwnProperty(L)?this.elements[L]:new Z,he=Object.keys(z),ye=0;ye<he.length;ye+=1)fe.set(he[ye],z[he[ye]],Q);this.elements[L]=fe;return}this.elements[L]=z},N.get=function(L){return this.elements[L]},N.has=function(L){return this.elements.hasOwnProperty(L)},N.addStyleType=function(L){var z=this;if(A&&L instanceof Map||L instanceof Z)L.forEach(function(pe,fe){z.set(fe,pe,!0)});else for(var Q=Object.keys(L),ee=0;ee<Q.length;ee++)this.set(Q[ee],L[Q[ee]],!0)},Z}();function C(Z){return Z&&Z.__esModule&&Object.prototype.hasOwnProperty.call(Z,"default")?Z.default:Z}function O(Z,N){return N={exports:{}},Z(N,N.exports),N.exports}function M(Z){return Z&&Z.default||Z}var B=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=H;function H(L){return L.charAt(0).toUpperCase()+L.slice(1)}});C(B);var U=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=z;var H=L(B);function L(Q){return Q&&Q.__esModule?Q:{default:Q}}function z(Q,ee,pe){if(Q.hasOwnProperty(ee)){for(var fe={},he=Q[ee],ye=(0,H.default)(ee),Je=Object.keys(pe),Ge=0;Ge<Je.length;Ge++){var et=Je[Ge];if(et===ee)for(var it=0;it<he.length;it++)fe[he[it]+ye]=pe[ee];fe[et]=pe[et]}return fe}return pe}});C(U);var G=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=H;function H(L,z,Q,ee,pe){for(var fe=0,he=L.length;fe<he;++fe){var ye=L[fe](z,Q,ee,pe);if(ye)return ye}}});C(G);var X=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=L;function H(z,Q){z.indexOf(Q)===-1&&z.push(Q)}function L(z,Q){if(Array.isArray(Q))for(var ee=0,pe=Q.length;ee<pe;++ee)H(z,Q[ee]);else H(z,Q)}});C(X);var q=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=H;function H(L){return L instanceof Object&&!Array.isArray(L)}});C(q);var $=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=pe;var H=ee(U),L=ee(G),z=ee(X),Q=ee(q);function ee(fe){return fe&&fe.__esModule?fe:{default:fe}}function pe(fe){var he=fe.prefixMap,ye=fe.plugins;return function Je(Ge){for(var et in Ge){var it=Ge[et];if((0,Q.default)(it))Ge[et]=Je(it);else if(Array.isArray(it)){for(var yt=[],Ht=0,kn=it.length;Ht<kn;++Ht){var ea=(0,L.default)(ye,et,it[Ht],Ge,he);(0,z.default)(yt,ea||it[Ht])}yt.length>0&&(Ge[et]=yt)}else{var ss=(0,L.default)(ye,et,it,Ge,he);ss&&(Ge[et]=ss),Ge=(0,H.default)(he,et,Ge)}}return Ge}}}),ue=C($),se=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=H;function H(L,z){if(typeof z=="string"&&z==="text")return["-webkit-text","text"]}}),ve=C(se),W=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=L;var H=/-webkit-|-moz-|-ms-/;function L(z){return typeof z=="string"&&H.test(z)}Z.exports=N.default});C(W);var te=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=Q;var H=L(W);function L(ee){return ee&&ee.__esModule?ee:{default:ee}}var z=["-webkit-","-moz-",""];function Q(ee,pe){if(typeof pe=="string"&&!(0,H.default)(pe)&&pe.indexOf("calc(")>-1)return z.map(function(fe){return pe.replace(/calc\(/g,fe+"calc(")})}}),re=C(te),K=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=Q;var H=L(W);function L(ee){return ee&&ee.__esModule?ee:{default:ee}}var z=["-webkit-",""];function Q(ee,pe){if(typeof pe=="string"&&!(0,H.default)(pe)&&pe.indexOf("cross-fade(")>-1)return z.map(function(fe){return pe.replace(/cross-fade\(/g,fe+"cross-fade(")})}}),oe=C(K),de=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=z;var H=["-webkit-","-moz-",""],L={"zoom-in":!0,"zoom-out":!0,grab:!0,grabbing:!0};function z(Q,ee){if(Q==="cursor"&&L.hasOwnProperty(ee))return H.map(function(pe){return pe+ee})}}),ie=C(de),ge=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=Q;var H=L(W);function L(ee){return ee&&ee.__esModule?ee:{default:ee}}var z=["-webkit-",""];function Q(ee,pe){if(typeof pe=="string"&&!(0,H.default)(pe)&&pe.indexOf("filter(")>-1)return z.map(function(fe){return pe.replace(/filter\(/g,fe+"filter(")})}}),Ee=C(ge),Ae=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=L;var H={flex:["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex","flex"],"inline-flex":["-webkit-inline-box","-moz-inline-box","-ms-inline-flexbox","-webkit-inline-flex","inline-flex"]};function L(z,Q){if(z==="display"&&H.hasOwnProperty(Q))return H[Q]}}),me=C(Ae),ze=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=ee;var H={"space-around":"distribute","space-between":"justify","flex-start":"start","flex-end":"end"},L={alignContent:"msFlexLinePack",alignSelf:"msFlexItemAlign",alignItems:"msFlexAlign",justifyContent:"msFlexPack",order:"msFlexOrder",flexGrow:"msFlexPositive",flexShrink:"msFlexNegative",flexBasis:"msFlexPreferredSize"},z={auto:"1 1 auto",inherit:"inherit",initial:"0 1 auto",none:"0 0 auto",unset:"unset"},Q=/^\d+(\.\d+)?$/;function ee(pe,fe,he){if(Object.prototype.hasOwnProperty.call(L,pe)&&(he[L[pe]]=H[fe]||fe),pe==="flex"){if(Object.prototype.hasOwnProperty.call(z,fe)){he.msFlex=z[fe];return}if(Q.test(fe)){he.msFlex=fe+" 1 0%";return}var ye=fe.split(/\s/);switch(ye.length){case 1:he.msFlex="1 1 "+fe;return;case 2:Q.test(ye[1])?he.msFlex=ye[0]+" "+ye[1]+" 0%":he.msFlex=ye[0]+" 1 "+ye[1];return;default:he.msFlex=fe}}}}),V=C(ze),Ye=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=z;var H={"space-around":"justify","space-between":"justify","flex-start":"start","flex-end":"end","wrap-reverse":"multiple",wrap:"multiple"},L={alignItems:"WebkitBoxAlign",justifyContent:"WebkitBoxPack",flexWrap:"WebkitBoxLines",flexGrow:"WebkitBoxFlex"};function z(Q,ee,pe){Q==="flexDirection"&&typeof ee=="string"&&(ee.indexOf("column")>-1?pe.WebkitBoxOrient="vertical":pe.WebkitBoxOrient="horizontal",ee.indexOf("reverse")>-1?pe.WebkitBoxDirection="reverse":pe.WebkitBoxDirection="normal"),L.hasOwnProperty(Q)&&(pe[L[Q]]=H[ee]||ee)}}),Le=C(Ye),Ue=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=ee;var H=L(W);function L(pe){return pe&&pe.__esModule?pe:{default:pe}}var z=["-webkit-","-moz-",""],Q=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/gi;function ee(pe,fe){if(typeof fe=="string"&&!(0,H.default)(fe)&&Q.test(fe))return z.map(function(he){return fe.replace(Q,function(ye){return he+ye})})}}),Pt=C(Ue),Nn=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0});var H=function(){function fe(he,ye){var Je=[],Ge=!0,et=!1,it=void 0;try{for(var yt=he[Symbol.iterator](),Ht;!(Ge=(Ht=yt.next()).done)&&(Je.push(Ht.value),!(ye&&Je.length===ye));Ge=!0);}catch(kn){et=!0,it=kn}finally{try{!Ge&&yt.return&&yt.return()}finally{if(et)throw it}}return Je}return function(he,ye){if(Array.isArray(he))return he;if(Symbol.iterator in Object(he))return fe(he,ye);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();N.default=pe;function L(fe){return typeof fe=="number"&&!isNaN(fe)}var z=["center","end","start","stretch"],Q={"inline-grid":["-ms-inline-grid","inline-grid"],grid:["-ms-grid","grid"]},ee={alignSelf:function(he,ye){z.indexOf(he)>-1&&(ye.msGridRowAlign=he)},gridColumn:function(he,ye){if(L(he))ye.msGridColumn=he;else{var Je=he.split("/").map(function(yt){return+yt}),Ge=H(Je,2),et=Ge[0],it=Ge[1];ee.gridColumnStart(et,ye),ee.gridColumnEnd(it,ye)}},gridColumnEnd:function(he,ye){var Je=ye.msGridColumn;L(he)&&L(Je)&&(ye.msGridColumnSpan=he-Je)},gridColumnStart:function(he,ye){L(he)&&(ye.msGridColumn=he)},gridRow:function(he,ye){if(L(he))ye.msGridRow=he;else{var Je=he.split("/").map(function(yt){return+yt}),Ge=H(Je,2),et=Ge[0],it=Ge[1];ee.gridRowStart(et,ye),ee.gridRowEnd(it,ye)}},gridRowEnd:function(he,ye){var Je=ye.msGridRow;L(he)&&L(Je)&&(ye.msGridRowSpan=he-Je)},gridRowStart:function(he,ye){L(he)&&(ye.msGridRow=he)},gridTemplateColumns:function(he,ye){ye.msGridColumns=he},gridTemplateRows:function(he,ye){ye.msGridRows=he},justifySelf:function(he,ye){z.indexOf(he)>-1&&(ye.msGridColumnAlign=he)}};function pe(fe,he,ye){if(fe==="display"&&he in Q)return Q[he];if(fe in ee){var Je=ee[fe];Je(he,ye)}}}),kt=C(Nn),qt=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=Q;var H=L(W);function L(ee){return ee&&ee.__esModule?ee:{default:ee}}var z=["-webkit-",""];function Q(ee,pe){if(typeof pe=="string"&&!(0,H.default)(pe)&&pe.indexOf("image-set(")>-1)return z.map(function(fe){return pe.replace(/image-set\(/g,fe+"image-set(")})}}),mt=C(qt),zn=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=L;var H={marginBlockStart:["WebkitMarginBefore"],marginBlockEnd:["WebkitMarginAfter"],marginInlineStart:["WebkitMarginStart","MozMarginStart"],marginInlineEnd:["WebkitMarginEnd","MozMarginEnd"],paddingBlockStart:["WebkitPaddingBefore"],paddingBlockEnd:["WebkitPaddingAfter"],paddingInlineStart:["WebkitPaddingStart","MozPaddingStart"],paddingInlineEnd:["WebkitPaddingEnd","MozPaddingEnd"],borderBlockStart:["WebkitBorderBefore"],borderBlockStartColor:["WebkitBorderBeforeColor"],borderBlockStartStyle:["WebkitBorderBeforeStyle"],borderBlockStartWidth:["WebkitBorderBeforeWidth"],borderBlockEnd:["WebkitBorderAfter"],borderBlockEndColor:["WebkitBorderAfterColor"],borderBlockEndStyle:["WebkitBorderAfterStyle"],borderBlockEndWidth:["WebkitBorderAfterWidth"],borderInlineStart:["WebkitBorderStart","MozBorderStart"],borderInlineStartColor:["WebkitBorderStartColor","MozBorderStartColor"],borderInlineStartStyle:["WebkitBorderStartStyle","MozBorderStartStyle"],borderInlineStartWidth:["WebkitBorderStartWidth","MozBorderStartWidth"],borderInlineEnd:["WebkitBorderEnd","MozBorderEnd"],borderInlineEndColor:["WebkitBorderEndColor","MozBorderEndColor"],borderInlineEndStyle:["WebkitBorderEndStyle","MozBorderEndStyle"],borderInlineEndWidth:["WebkitBorderEndWidth","MozBorderEndWidth"]};function L(z,Q,ee){if(Object.prototype.hasOwnProperty.call(H,z))for(var pe=H[z],fe=0,he=pe.length;fe<he;++fe)ee[pe[fe]]=Q}}),cn=C(zn),So=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=H;function H(L,z){if(L==="position"&&z==="sticky")return["-webkit-sticky","sticky"]}}),To=C(So),Ao=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=Q;var H=["-webkit-","-moz-",""],L={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},z={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};function Q(ee,pe){if(L.hasOwnProperty(ee)&&z.hasOwnProperty(pe))return H.map(function(fe){return fe+pe})}}),Dn=C(Ao),Vt=/[A-Z]/g,Xn=/^ms-/,dn={};function fn(Z){return"-"+Z.toLowerCase()}function Ct(Z){if(dn.hasOwnProperty(Z))return dn[Z];var N=Z.replace(Vt,fn);return dn[Z]=Xn.test(N)?"-"+N:N}var Ur=Object.freeze({default:Ct}),Fr=M(Ur),_o=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=z;var H=L(Fr);function L(Q){return Q&&Q.__esModule?Q:{default:Q}}function z(Q){return(0,H.default)(Q)}Z.exports=N.default});C(_o);var pn=O(function(Z,N){Object.defineProperty(N,"__esModule",{value:!0}),N.default=he;var H=Q(_o),L=Q(W),z=Q(B);function Q(ye){return ye&&ye.__esModule?ye:{default:ye}}var ee={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},pe={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};function fe(ye,Je){if((0,L.default)(ye))return ye;for(var Ge=ye.split(/,(?![^()]*(?:\([^()]*\))?\))/g),et=0,it=Ge.length;et<it;++et){var yt=Ge[et],Ht=[yt];for(var kn in Je){var ea=(0,H.default)(kn);if(yt.indexOf(ea)>-1&&ea!=="order")for(var ss=Je[kn],_f=0,q9=ss.length;_f<q9;++_f)Ht.unshift(yt.replace(ea,pe[ss[_f]]+ea))}Ge[et]=Ht.join(",")}return Ge.join(",")}function he(ye,Je,Ge,et){if(typeof Je=="string"&&ee.hasOwnProperty(ye)){var it=fe(Je,et),yt=it.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(kn){return!/-moz-|-ms-/.test(kn)}).join(",");if(ye.indexOf("Webkit")>-1)return yt;var Ht=it.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(kn){return!/-webkit-|-ms-/.test(kn)}).join(",");return ye.indexOf("Moz")>-1?Ht:(Ge["Webkit"+(0,z.default)(ye)]=yt,Ge["Moz"+(0,z.default)(ye)]=Ht,it)}}}),qr=C(pn),we=["Webkit"],mr=["Moz"],er=["ms"],wt=["Webkit","Moz"],Ke=["Webkit","ms"],ht=["Webkit","Moz","ms"],At={plugins:[ve,re,oe,ie,Ee,me,V,Le,Pt,kt,mt,cn,To,Dn,qr],prefixMap:{transform:Ke,transformOrigin:Ke,transformOriginX:Ke,transformOriginY:Ke,backfaceVisibility:we,perspective:we,perspectiveOrigin:we,transformStyle:we,transformOriginZ:we,animation:we,animationDelay:we,animationDirection:we,animationFillMode:we,animationDuration:we,animationIterationCount:we,animationName:we,animationPlayState:we,animationTimingFunction:we,appearance:wt,userSelect:ht,fontKerning:we,textEmphasisPosition:we,textEmphasis:we,textEmphasisStyle:we,textEmphasisColor:we,boxDecorationBreak:we,clipPath:we,maskImage:we,maskMode:we,maskRepeat:we,maskPosition:we,maskClip:we,maskOrigin:we,maskSize:we,maskComposite:we,mask:we,maskBorderSource:we,maskBorderMode:we,maskBorderSlice:we,maskBorderWidth:we,maskBorderOutset:we,maskBorderRepeat:we,maskBorder:we,maskType:we,textDecorationStyle:wt,textDecorationSkip:wt,textDecorationLine:wt,textDecorationColor:wt,filter:we,fontFeatureSettings:wt,breakAfter:ht,breakBefore:ht,breakInside:ht,columnCount:wt,columnFill:wt,columnGap:wt,columnRule:wt,columnRuleColor:wt,columnRuleStyle:wt,columnRuleWidth:wt,columns:wt,columnSpan:wt,columnWidth:wt,writingMode:Ke,flex:Ke,flexBasis:we,flexDirection:Ke,flexGrow:we,flexFlow:Ke,flexShrink:we,flexWrap:Ke,alignContent:we,alignItems:we,alignSelf:we,justifyContent:we,order:we,transitionDelay:we,transitionDuration:we,transitionProperty:we,transitionTimingFunction:we,backdropFilter:we,scrollSnapType:Ke,scrollSnapPointsX:Ke,scrollSnapPointsY:Ke,scrollSnapDestination:Ke,scrollSnapCoordinate:Ke,shapeImageThreshold:we,shapeImageMargin:we,shapeImageOutside:we,hyphens:ht,flowInto:Ke,flowFrom:Ke,regionFragment:Ke,textOrientation:we,boxSizing:mr,textAlignLast:mr,tabSize:mr,wrapFlow:er,wrapThrough:er,wrapMargin:er,touchAction:er,textSizeAdjust:Ke,borderImage:we,borderImageOutset:we,borderImageRepeat:we,borderImageSlice:we,borderImageSource:we,borderImageWidth:we}},_t=ue(At),rn=[function(N,H,L){return N[0]!==":"?null:L(H+N)},function(N,H,L){if(N[0]!=="@")return null;var z=L(H);return["".concat(N,"{").concat(z.join(""),"}")]}],Lt=function Z(N,H,L,z,Q){for(var ee=new T,pe=0;pe<H.length;pe++)ee.addStyleType(H[pe]);var fe=new T,he=[];ee.forEach(function(Je,Ge){var et=L.some(function(it){var yt=it(Ge,N,function(Ht){return Z(Ht,[Je],L,z,Q)});if(yt!=null)return Array.isArray(yt)?he.push.apply(he,l(yt)):(console.warn("WARNING: Selector handlers should return an array of rules.Returning a string containing multiple rules is deprecated.",it),he.push("@media all {".concat(yt,"}"))),!0});et||fe.set(Ge,Je,!0)});var ye=Wt(N,fe,z,Q,L);return ye&&he.unshift(ye),he},Gt=function(N,H,L){if(H)for(var z=Object.keys(H),Q=0;Q<z.length;Q++){var ee=z[Q];N.has(ee)&&N.set(ee,H[ee](N.get(ee),L),!1)}},Kt=function(N,H,L){return"".concat(y(N),":").concat(L(N,H),";")},Pn=function(N,H){return N[H]=!0,N},Wt=function(N,H,L,z,Q){Gt(H,L,Q);var ee=Object.keys(H.elements).reduce(Pn,Object.create(null)),pe=_t(H.elements),fe=Object.keys(pe);if(fe.length!==H.keyOrder.length){for(var he=0;he<fe.length;he++)if(!ee[fe[he]]){var ye=void 0;if(fe[he][0]==="W"?ye=fe[he][6].toLowerCase()+fe[he].slice(7):fe[he][1]==="o"?ye=fe[he][3].toLowerCase()+fe[he].slice(4):ye=fe[he][2].toLowerCase()+fe[he].slice(3),ye&&ee[ye]){var Je=H.keyOrder.indexOf(ye);H.keyOrder.splice(Je,0,fe[he])}else H.keyOrder.unshift(fe[he])}}for(var Ge=z===!1?h:g,et=[],it=0;it<H.keyOrder.length;it++){var yt=H.keyOrder[it],Ht=pe[yt];if(Array.isArray(Ht))for(var kn=0;kn<Ht.length;kn++)et.push(Kt(yt,Ht[kn],Ge));else et.push(Kt(yt,Ht,Ge))}return et.length?"".concat(N,"{").concat(et.join(""),"}"):""},xt=null,Zn=function(N){if(xt==null&&(xt=document.querySelector("style[data-aphrodite]"),xt==null)){var H=document.head||document.getElementsByTagName("head")[0];xt=document.createElement("style"),xt.type="text/css",xt.setAttribute("data-aphrodite",""),H.appendChild(xt)}var L=xt.styleSheet||xt.sheet;if(L.insertRule){var z=L.cssRules.length;N.forEach(function(Q){try{L.insertRule(Q,z),z+=1}catch{}})}else xt.innerText=(xt.innerText||"")+N.join("")},Yn={fontFamily:function Z(N){if(Array.isArray(N)){var H={};return N.forEach(function(L){H[Z(L)]=!0}),Object.keys(H).join(",")}else return o(N)==="object"?(_(N.src,"@font-face",[N],!1),'"'.concat(N.fontFamily,'"')):N},animationName:function Z(N,H){if(Array.isArray(N))return N.map(function(Q){return Z(Q,H)}).join(",");if(o(N)==="object"){var L="keyframe_".concat(E(N)),z="@keyframes ".concat(L,"{");return N instanceof T?N.forEach(function(Q,ee){z+=Lt(ee,[Q],H,Yn,!1).join("")}):Object.keys(N).forEach(function(Q){z+=Lt(Q,[N[Q]],H,Yn,!1).join("")}),z+="}",j(L,[z]),L}else return N}},hn={},R=[],k=!1,j=function(N,H){var L;if(!hn[N]){if(!k){if(typeof document>"u")throw new Error("Cannot automatically buffer without a document");k=!0,r(ae)}(L=R).push.apply(L,l(H)),hn[N]=!0}},_=function(N,H,L,z){var Q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[];if(!hn[N]){var ee=Lt(H,L,Q,Yn,z);j(N,ee)}},F=function(){R=[],hn={},k=!1,xt=null},J=function(N){delete hn[N]},ce=function(){return R},ne=function(){if(k)throw new Error("Cannot buffer while already buffering");k=!0},be=function(){k=!1;var N=R;return R=[],N},le=function(){return be().join("")},ae=function(){var N=be();N.length>0&&Zn(N)},ke=function(){return Object.keys(hn)},Ne=function(N){N.forEach(function(H){hn[H]=!0})},Fe=function(N){return"_definition"in N&&"_name"in N&&"_len"in N},Me=function Z(N,H,L,z){for(var Q=0;Q<N.length;Q+=1)if(N[Q])if(Array.isArray(N[Q]))z+=Z(N[Q],H,L,z);else if(Fe(N[Q]))H.push(N[Q]._name),L.push(N[Q]._definition),z+=N[Q]._len;else throw new Error("Invalid Style Definition: Styles should be defined using the StyleSheet.create method.");return z},bt=function(N,H,L){var z=[],Q=[],ee=Me(H,z,Q,0);if(z.length===0)return"";var pe;return process.env.NODE_ENV==="production"?pe=z.length===1?"_".concat(z[0]):"_".concat(m(z.join())).concat((ee%36).toString(36)):pe=z.join("-o_O-"),_(pe,".".concat(pe),Q,N,L),pe},ot=function(N,H){return"".concat(H,"_").concat(m(N))},Dt=function(){return process.env.NODE_ENV==="production"?m:ot},gn=Dt(),Mr={create:function(N){for(var H={},L=Object.keys(N),z=0;z<L.length;z+=1){var Q=L[z],ee=N[Q],pe=JSON.stringify(ee);H[Q]={_len:pe.length,_name:gn(pe,Q),_definition:ee}}return H},rehydrate:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Ne(N)}},tr=typeof window<"u"?null:{renderStatic:function(N){F(),ne();var H=N(),L=le();return{html:H,css:{content:L,renderedClassNames:ke()}}}},Ki=process.env.NODE_ENV==="production"?null:{suppressStyleInjection:function(){F(),ne()},clearBufferAndResumeStyleInjection:function(){F()},getBufferedStyles:function(){return ce()}};function nr(Z){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rn;return{StyleSheet:a({},Mr,{extend:function(L){var z=L.map(function(Q){return Q.selectorHandler}).filter(function(Q){return Q});return nr(Z,N.concat(z))}}),StyleSheetServer:tr,StyleSheetTestUtils:Ki,minify:function(L){gn=L?m:ot},css:function(){for(var L=arguments.length,z=new Array(L),Q=0;Q<L;Q++)z[Q]=arguments[Q];return bt(Z,z,N)},flushToStyleTag:ae,injectAndGetClassName:bt,defaultSelectorHandlers:rn,reset:F,resetInjectedStyle:J}}e.makeExports=nr})(g0),Object.defineProperty(Qn,"__esModule",{value:!0});var _R=g0,OR=!1,Ir=_R.makeExports(OR),RR=Ir.StyleSheet,NR=Ir.StyleSheetServer,DR=Ir.StyleSheetTestUtils,PR=Ir.css,kR=Ir.minify,LR=Ir.flushToStyleTag,FR=Ir.injectAndGetClassName,MR=Ir.defaultSelectorHandlers,BR=Ir.reset,jR=Ir.resetInjectedStyle;Qn.StyleSheet=RR,Qn.StyleSheetServer=NR,Qn.StyleSheetTestUtils=DR,Qn.css=PR,Qn.minify=kR,Qn.flushToStyleTag=LR,Qn.injectAndGetClassName=FR,Qn.defaultSelectorHandlers=MR,Qn.reset=BR,Qn.resetInjectedStyle=jR;var Bt=Qn,xd={exports:{}},Cd={exports:{}},I0={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(I0);var VR=I0.exports,Dl={exports:{}},S0;function GR(){return S0||(S0=1,function(e,t){t.__esModule=!0,t.default=n;function n(r,o){return r.classList?!!o&&r.classList.contains(o):(" "+(r.className.baseVal||r.className)+" ").indexOf(" "+o+" ")!==-1}e.exports=t.default}(Dl,Dl.exports)),Dl.exports}(function(e,t){var n=VR;t.__esModule=!0,t.default=o;var r=n(GR());function o(i,a){i.classList?i.classList.add(a):(0,r.default)(i,a)||(typeof i.className=="string"?i.className=i.className+" "+a:i.setAttribute("class",(i.className&&i.className.baseVal||"")+" "+a))}e.exports=t.default})(Cd,Cd.exports);var WR=Cd.exports;function T0(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var HR=function(t,n){t.classList?t.classList.remove(n):typeof t.className=="string"?t.className=T0(t.className,n):t.setAttribute("class",T0(t.className&&t.className.baseVal||"",n))},vn={};function A0(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function _0(e){function t(n){var r=this.constructor.getDerivedStateFromProps(e,n);return r??null}this.setState(t.bind(this))}function O0(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}A0.__suppressDeprecationWarning=!0,_0.__suppressDeprecationWarning=!0,O0.__suppressDeprecationWarning=!0;function zR(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if(typeof e.getDerivedStateFromProps!="function"&&typeof t.getSnapshotBeforeUpdate!="function")return e;var n=null,r=null,o=null;if(typeof t.componentWillMount=="function"?n="componentWillMount":typeof t.UNSAFE_componentWillMount=="function"&&(n="UNSAFE_componentWillMount"),typeof t.componentWillReceiveProps=="function"?r="componentWillReceiveProps":typeof t.UNSAFE_componentWillReceiveProps=="function"&&(r="UNSAFE_componentWillReceiveProps"),typeof t.componentWillUpdate=="function"?o="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(o="UNSAFE_componentWillUpdate"),n!==null||r!==null||o!==null){var i=e.displayName||e.name,a=typeof e.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
770
770
|
|
|
771
771
|
`+i+" uses "+a+" but also contains the following legacy lifecycles:"+(n!==null?`
|
|
772
772
|
`+n:"")+(r!==null?`
|
|
@@ -774,7 +774,7 @@ Valid keys: `+JSON.stringify(Object.keys(W),null," "));var V=ze(ge,me,oe,de,ie+
|
|
|
774
774
|
`+o:"")+`
|
|
775
775
|
|
|
776
776
|
The above lifecycles should be removed. Learn more about this warning here:
|
|
777
|
-
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=A0,t.componentWillReceiveProps=_0),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=O0;var l=t.componentDidUpdate;t.componentDidUpdate=function(u,c,f){var b=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:f;l.call(this,u,c,b)}}return e}const R0=Ry(Object.freeze(Object.defineProperty({__proto__:null,polyfill:zR},Symbol.toStringTag,{value:"Module"})));var zo={};zo.__esModule=!0,zo.classNamesShape=zo.timeoutsShape=void 0;var Yt=XR(Ti);function XR(e){return e&&e.__esModule?e:{default:e}}var ZR=process.env.NODE_ENV!=="production"?Yt.default.oneOfType([Yt.default.number,Yt.default.shape({enter:Yt.default.number,exit:Yt.default.number,appear:Yt.default.number}).isRequired]):null;zo.timeoutsShape=ZR;var YR=process.env.NODE_ENV!=="production"?Yt.default.oneOfType([Yt.default.string,Yt.default.shape({enter:Yt.default.string,exit:Yt.default.string,active:Yt.default.string}),Yt.default.shape({enter:Yt.default.string,enterDone:Yt.default.string,enterActive:Yt.default.string,exit:Yt.default.string,exitDone:Yt.default.string,exitActive:Yt.default.string})]):null;zo.classNamesShape=YR,vn.__esModule=!0,vn.default=vn.EXITING=vn.ENTERED=vn.ENTERING=vn.EXITED=vn.UNMOUNTED=void 0;var tn=QR(Ti),wd=N0(S),UR=N0(Qe),qR=R0,JR=zo;function N0(e){return e&&e.__esModule?e:{default:e}}function QR(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}}return t.default=e,t}function $R(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function KR(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Wa="unmounted";vn.UNMOUNTED=Wa;var Xo="exited";vn.EXITED=Xo;var Zo="entering";vn.ENTERING=Zo;var Ai="entered";vn.ENTERED=Ai;var Id="exiting";vn.EXITING=Id;var Sr=function(e){KR(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=o.transitionGroup,l=a&&!a.isMounting?r.enter:r.appear,s;return i.appearStatus=null,r.in?l?(s=Xo,i.appearStatus=Zo):s=Ai:r.unmountOnExit||r.mountOnEnter?s=Wa:s=Xo,i.state={status:s},i.nextCallback=null,i}var n=t.prototype;return n.getChildContext=function(){return{transitionGroup:null}},t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===Wa?{status:Xo}:null},n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var a=this.state.status;this.props.in?a!==Zo&&a!==Ai&&(i=Zo):(a===Zo||a===Ai)&&(i=Id)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,a,l;return i=a=l=o,o!=null&&typeof o!="number"&&(i=o.exit,a=o.enter,l=o.appear!==void 0?o.appear:a),{exit:i,enter:a,appear:l}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null){this.cancelNextCallback();var a=UR.default.findDOMNode(this);i===Zo?this.performEnter(a,o):this.performExit(a)}else this.props.unmountOnExit&&this.state.status===Xo&&this.setState({status:Wa})},n.performEnter=function(o,i){var a=this,l=this.props.enter,s=this.context.transitionGroup?this.context.transitionGroup.isMounting:i,u=this.getTimeouts(),c=s?u.appear:u.enter;if(!i&&!l){this.safeSetState({status:Ai},function(){a.props.onEntered(o)});return}this.props.onEnter(o,s),this.safeSetState({status:Zo},function(){a.props.onEntering(o,s),a.onTransitionEnd(o,c,function(){a.safeSetState({status:Ai},function(){a.props.onEntered(o,s)})})})},n.performExit=function(o){var i=this,a=this.props.exit,l=this.getTimeouts();if(!a){this.safeSetState({status:Xo},function(){i.props.onExited(o)});return}this.props.onExit(o),this.safeSetState({status:Id},function(){i.props.onExiting(o),i.onTransitionEnd(o,l.exit,function(){i.safeSetState({status:Xo},function(){i.props.onExited(o)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,a=!0;return this.nextCallback=function(l){a&&(a=!1,i.nextCallback=null,o(l))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(o,i,a){this.setNextCallback(a);var l=i==null&&!this.props.addEndListener;if(!o||l){setTimeout(this.nextCallback,0);return}this.props.addEndListener&&this.props.addEndListener(o,this.nextCallback),i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var o=this.state.status;if(o===Wa)return null;var i=this.props,a=i.children,l=$R(i,["children"]);if(delete l.in,delete l.mountOnEnter,delete l.unmountOnExit,delete l.appear,delete l.enter,delete l.exit,delete l.timeout,delete l.addEndListener,delete l.onEnter,delete l.onEntering,delete l.onEntered,delete l.onExit,delete l.onExiting,delete l.onExited,typeof a=="function")return a(o,l);var s=wd.default.Children.only(a);return wd.default.cloneElement(s,l)},t}(wd.default.Component);Sr.contextTypes={transitionGroup:tn.object},Sr.childContextTypes={transitionGroup:function(){}},Sr.propTypes=process.env.NODE_ENV!=="production"?{children:tn.oneOfType([tn.func.isRequired,tn.element.isRequired]).isRequired,in:tn.bool,mountOnEnter:tn.bool,unmountOnExit:tn.bool,appear:tn.bool,enter:tn.bool,exit:tn.bool,timeout:function(t){var n=JR.timeoutsShape;t.addEndListener||(n=n.isRequired);for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return n.apply(void 0,[t].concat(o))},addEndListener:tn.func,onEnter:tn.func,onEntering:tn.func,onEntered:tn.func,onExit:tn.func,onExiting:tn.func,onExited:tn.func}:{};function _i(){}Sr.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:_i,onEntering:_i,onEntered:_i,onExit:_i,onExiting:_i,onExited:_i},Sr.UNMOUNTED=0,Sr.EXITED=1,Sr.ENTERING=2,Sr.ENTERED=3,Sr.EXITING=4;var eN=(0,qR.polyfill)(Sr);vn.default=eN,function(e,t){t.__esModule=!0,t.default=void 0;var n=u(Ti),r=s(WR),o=s(HR),i=s(S),a=s(vn),l=zo;function s(p){return p&&p.__esModule?p:{default:p}}function u(p){if(p&&p.__esModule)return p;var h={};if(p!=null){for(var g in p)if(Object.prototype.hasOwnProperty.call(p,g)){var m=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(p,g):{};m.get||m.set?Object.defineProperty(h,g,m):h[g]=p[g]}}return h.default=p,h}function c(){return c=Object.assign||function(p){for(var h=1;h<arguments.length;h++){var g=arguments[h];for(var m in g)Object.prototype.hasOwnProperty.call(g,m)&&(p[m]=g[m])}return p},c.apply(this,arguments)}function f(p,h){p.prototype=Object.create(h.prototype),p.prototype.constructor=p,p.__proto__=h}var b=function(h,g){return h&&g&&g.split(" ").forEach(function(m){return(0,r.default)(h,m)})},y=function(h,g){return h&&g&&g.split(" ").forEach(function(m){return(0,o.default)(h,m)})},v=function(p){f(h,p);function h(){for(var m,E=arguments.length,x=new Array(E),A=0;A<E;A++)x[A]=arguments[A];return m=p.call.apply(p,[this].concat(x))||this,m.onEnter=function(T,C){var O=m.getClassNames(C?"appear":"enter"),M=O.className;m.removeClasses(T,"exit"),b(T,M),m.props.onEnter&&m.props.onEnter(T,C)},m.onEntering=function(T,C){var O=m.getClassNames(C?"appear":"enter"),M=O.activeClassName;m.reflowAndAddClass(T,M),m.props.onEntering&&m.props.onEntering(T,C)},m.onEntered=function(T,C){var O=m.getClassNames("appear").doneClassName,M=m.getClassNames("enter").doneClassName,B=C?O+" "+M:M;m.removeClasses(T,C?"appear":"enter"),b(T,B),m.props.onEntered&&m.props.onEntered(T,C)},m.onExit=function(T){var C=m.getClassNames("exit"),O=C.className;m.removeClasses(T,"appear"),m.removeClasses(T,"enter"),b(T,O),m.props.onExit&&m.props.onExit(T)},m.onExiting=function(T){var C=m.getClassNames("exit"),O=C.activeClassName;m.reflowAndAddClass(T,O),m.props.onExiting&&m.props.onExiting(T)},m.onExited=function(T){var C=m.getClassNames("exit"),O=C.doneClassName;m.removeClasses(T,"exit"),b(T,O),m.props.onExited&&m.props.onExited(T)},m.getClassNames=function(T){var C=m.props.classNames,O=typeof C=="string",M=O&&C?C+"-":"",B=O?M+T:C[T],U=O?B+"-active":C[T+"Active"],G=O?B+"-done":C[T+"Done"];return{className:B,activeClassName:U,doneClassName:G}},m}var g=h.prototype;return g.removeClasses=function(E,x){var A=this.getClassNames(x),T=A.className,C=A.activeClassName,O=A.doneClassName;T&&y(E,T),C&&y(E,C),O&&y(E,O)},g.reflowAndAddClass=function(E,x){x&&(E&&E.scrollTop,b(E,x))},g.render=function(){var E=c({},this.props);return delete E.classNames,i.default.createElement(a.default,c({},E,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},h}(i.default.Component);v.defaultProps={classNames:""},v.propTypes=process.env.NODE_ENV!=="production"?c({},a.default.propTypes,{classNames:l.classNamesShape,onEnter:n.func,onEntering:n.func,onEntered:n.func,onExit:n.func,onExiting:n.func,onExited:n.func}):{};var d=v;t.default=d,e.exports=t.default}(xd,xd.exports);var tN=xd.exports,Sd={exports:{}},Td={exports:{}},Oi={};Oi.__esModule=!0,Oi.getChildMapping=Ad,Oi.mergeChildMappings=D0,Oi.getInitialChildMapping=nN,Oi.getNextChildMapping=rN;var Gr=S;function Ad(e,t){var n=function(i){return t&&(0,Gr.isValidElement)(i)?t(i):i},r=Object.create(null);return e&&Gr.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function D0(e,t){e=e||{},t=t||{};function n(c){return c in t?t[c]:e[c]}var r=Object.create(null),o=[];for(var i in e)i in t?o.length&&(r[i]=o,o=[]):o.push(i);var a,l={};for(var s in t){if(r[s])for(a=0;a<r[s].length;a++){var u=r[s][a];l[r[s][a]]=n(u)}l[s]=n(s)}for(a=0;a<o.length;a++)l[o[a]]=n(o[a]);return l}function Yo(e,t,n){return n[t]!=null?n[t]:e.props[t]}function nN(e,t){return Ad(e.children,function(n){return(0,Gr.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:Yo(n,"appear",e),enter:Yo(n,"enter",e),exit:Yo(n,"exit",e)})})}function rN(e,t,n){var r=Ad(e.children),o=D0(t,r);return Object.keys(o).forEach(function(i){var a=o[i];if((0,Gr.isValidElement)(a)){var l=i in t,s=i in r,u=t[i],c=(0,Gr.isValidElement)(u)&&!u.props.in;s&&(!l||c)?o[i]=(0,Gr.cloneElement)(a,{onExited:n.bind(null,a),in:!0,exit:Yo(a,"exit",e),enter:Yo(a,"enter",e)}):!s&&l&&!c?o[i]=(0,Gr.cloneElement)(a,{in:!1}):s&&l&&(0,Gr.isValidElement)(u)&&(o[i]=(0,Gr.cloneElement)(a,{onExited:n.bind(null,a),in:u.props.in,exit:Yo(a,"exit",e),enter:Yo(a,"enter",e)}))}}),o}(function(e,t){t.__esModule=!0,t.default=void 0;var n=a(Ti),r=a(S),o=R0,i=Oi;function a(d){return d&&d.__esModule?d:{default:d}}function l(d,p){if(d==null)return{};var h={},g=Object.keys(d),m,E;for(E=0;E<g.length;E++)m=g[E],!(p.indexOf(m)>=0)&&(h[m]=d[m]);return h}function s(){return s=Object.assign||function(d){for(var p=1;p<arguments.length;p++){var h=arguments[p];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(d[g]=h[g])}return d},s.apply(this,arguments)}function u(d,p){d.prototype=Object.create(p.prototype),d.prototype.constructor=d,d.__proto__=p}function c(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}var f=Object.values||function(d){return Object.keys(d).map(function(p){return d[p]})},b={component:"div",childFactory:function(p){return p}},y=function(d){u(p,d);function p(g,m){var E;E=d.call(this,g,m)||this;var x=E.handleExited.bind(c(c(E)));return E.state={handleExited:x,firstRender:!0},E}var h=p.prototype;return h.getChildContext=function(){return{transitionGroup:{isMounting:!this.appeared}}},h.componentDidMount=function(){this.appeared=!0,this.mounted=!0},h.componentWillUnmount=function(){this.mounted=!1},p.getDerivedStateFromProps=function(m,E){var x=E.children,A=E.handleExited,T=E.firstRender;return{children:T?(0,i.getInitialChildMapping)(m,A):(0,i.getNextChildMapping)(m,x,A),firstRender:!1}},h.handleExited=function(m,E){var x=(0,i.getChildMapping)(this.props.children);m.key in x||(m.props.onExited&&m.props.onExited(E),this.mounted&&this.setState(function(A){var T=s({},A.children);return delete T[m.key],{children:T}}))},h.render=function(){var m=this.props,E=m.component,x=m.childFactory,A=l(m,["component","childFactory"]),T=f(this.state.children).map(x);return delete A.appear,delete A.enter,delete A.exit,E===null?T:r.default.createElement(E,A,T)},p}(r.default.Component);y.childContextTypes={transitionGroup:n.default.object.isRequired},y.propTypes=process.env.NODE_ENV!=="production"?{component:n.default.any,children:n.default.node,appear:n.default.bool,enter:n.default.bool,exit:n.default.bool,childFactory:n.default.func}:{},y.defaultProps=b;var v=(0,o.polyfill)(y);t.default=v,e.exports=t.default})(Td,Td.exports);var P0=Td.exports;(function(e,t){t.__esModule=!0,t.default=void 0;var n=a(Ti),r=a(S),o=Qe,i=a(P0);function a(f){return f&&f.__esModule?f:{default:f}}function l(f,b){if(f==null)return{};var y={},v=Object.keys(f),d,p;for(p=0;p<v.length;p++)d=v[p],!(b.indexOf(d)>=0)&&(y[d]=f[d]);return y}function s(f,b){f.prototype=Object.create(b.prototype),f.prototype.constructor=f,f.__proto__=b}var u=function(f){s(b,f);function b(){for(var v,d=arguments.length,p=new Array(d),h=0;h<d;h++)p[h]=arguments[h];return v=f.call.apply(f,[this].concat(p))||this,v.handleEnter=function(){for(var g=arguments.length,m=new Array(g),E=0;E<g;E++)m[E]=arguments[E];return v.handleLifecycle("onEnter",0,m)},v.handleEntering=function(){for(var g=arguments.length,m=new Array(g),E=0;E<g;E++)m[E]=arguments[E];return v.handleLifecycle("onEntering",0,m)},v.handleEntered=function(){for(var g=arguments.length,m=new Array(g),E=0;E<g;E++)m[E]=arguments[E];return v.handleLifecycle("onEntered",0,m)},v.handleExit=function(){for(var g=arguments.length,m=new Array(g),E=0;E<g;E++)m[E]=arguments[E];return v.handleLifecycle("onExit",1,m)},v.handleExiting=function(){for(var g=arguments.length,m=new Array(g),E=0;E<g;E++)m[E]=arguments[E];return v.handleLifecycle("onExiting",1,m)},v.handleExited=function(){for(var g=arguments.length,m=new Array(g),E=0;E<g;E++)m[E]=arguments[E];return v.handleLifecycle("onExited",1,m)},v}var y=b.prototype;return y.handleLifecycle=function(d,p,h){var g,m=this.props.children,E=r.default.Children.toArray(m)[p];E.props[d]&&(g=E.props)[d].apply(g,h),this.props[d]&&this.props[d]((0,o.findDOMNode)(this))},y.render=function(){var d=this.props,p=d.children,h=d.in,g=l(d,["children","in"]),m=r.default.Children.toArray(p),E=m[0],x=m[1];return delete g.onEnter,delete g.onEntering,delete g.onEntered,delete g.onExit,delete g.onExiting,delete g.onExited,r.default.createElement(i.default,g,h?r.default.cloneElement(E,{key:"first",onEnter:this.handleEnter,onEntering:this.handleEntering,onEntered:this.handleEntered}):r.default.cloneElement(x,{key:"second",onEnter:this.handleExit,onEntering:this.handleExiting,onEntered:this.handleExited}))},b}(r.default.Component);u.propTypes=process.env.NODE_ENV!=="production"?{in:n.default.bool.isRequired,children:function(b,y){return r.default.Children.count(b[y])!==2?new Error('"'+y+'" must be exactly two transition components.'):null}}:{};var c=u;t.default=c,e.exports=t.default})(Sd,Sd.exports);var oN=Sd.exports,iN=Pl(tN),aN=Pl(oN),sN=Pl(P0),lN=Pl(vn);function Pl(e){return e&&e.__esModule?e:{default:e}}var k0={Transition:lN.default,TransitionGroup:sN.default,ReplaceTransition:aN.default,CSSTransition:iN.default};function Ri(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ri=function(t){return typeof t}:Ri=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ri(e)}function uN(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){uN(e,o,n[o])})}return e}function L0(e){return dN(e)||fN(e)||pN()}function dN(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function fN(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function pN(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var hN=/([A-Z])/g,gN=function(t){return"-".concat(t.toLowerCase())},mN=function(t){var n=t.replace(hN,gN);return n[0]==="m"&&n[1]==="s"&&n[2]==="-"?"-".concat(n):n},kl={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function bN(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var vN=["Webkit","ms","Moz","O"];Object.keys(kl).forEach(function(e){vN.forEach(function(t){kl[bN(t,e)]=kl[e]})});var F0=function(t,n){return typeof n=="number"?kl[t]?""+n:n+"px":""+n},yN=function(t,n){return xN(F0(t,n))},Ha=function(t,n){return xR(t).toString(36)},EN=function(t){return Ha(JSON.stringify(t))},xN=function(t){return t[t.length-10]==="!"&&t.slice(-11)===" !important"?t:"".concat(t," !important")},M0=typeof Map<"u",_d=function(){function e(){this.elements={},this.keyOrder=[]}var t=e.prototype;return t.forEach=function(r){for(var o=0;o<this.keyOrder.length;o++)r(this.elements[this.keyOrder[o]],this.keyOrder[o])},t.set=function(r,o,i){if(!this.elements.hasOwnProperty(r))this.keyOrder.push(r);else if(i){var a=this.keyOrder.indexOf(r);this.keyOrder.splice(a,1),this.keyOrder.push(r)}if(o==null){this.elements[r]=o;return}if(M0&&o instanceof Map||o instanceof e){var l=this.elements.hasOwnProperty(r)?this.elements[r]:new e;o.forEach(function(f,b){l.set(b,f,i)}),this.elements[r]=l;return}if(!Array.isArray(o)&&Ri(o)==="object"){for(var s=this.elements.hasOwnProperty(r)?this.elements[r]:new e,u=Object.keys(o),c=0;c<u.length;c+=1)s.set(u[c],o[u[c]],i);this.elements[r]=s;return}this.elements[r]=o},t.get=function(r){return this.elements[r]},t.has=function(r){return this.elements.hasOwnProperty(r)},t.addStyleType=function(r){var o=this;if(M0&&r instanceof Map||r instanceof e)r.forEach(function(l,s){o.set(s,l,!0)});else for(var i=Object.keys(r),a=0;a<i.length;a++)this.set(i[a],r[i[a]],!0)},e}();function St(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Tt(e,t){return t={exports:{}},e(t,t.exports),t.exports}function CN(e){return e&&e.default||e}var Od=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r){return r.charAt(0).toUpperCase()+r.slice(1)}});St(Od);var B0=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Od);function r(i){return i&&i.__esModule?i:{default:i}}function o(i,a,l){if(i.hasOwnProperty(a)){for(var s={},u=i[a],c=(0,n.default)(a),f=Object.keys(l),b=0;b<f.length;b++){var y=f[b];if(y===a)for(var v=0;v<u.length;v++)s[u[v]+c]=l[a];s[y]=l[y]}return s}return l}});St(B0);var j0=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r,o,i,a,l){for(var s=0,u=r.length;s<u;++s){var c=r[s](o,i,a,l);if(c)return c}}});St(j0);var V0=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function n(o,i){o.indexOf(i)===-1&&o.push(i)}function r(o,i){if(Array.isArray(i))for(var a=0,l=i.length;a<l;++a)n(o,i[a]);else n(o,i)}});St(V0);var G0=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r){return r instanceof Object&&!Array.isArray(r)}});St(G0);var wN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var n=a(B0),r=a(j0),o=a(V0),i=a(G0);function a(s){return s&&s.__esModule?s:{default:s}}function l(s){var u=s.prefixMap,c=s.plugins;return function f(b){for(var y in b){var v=b[y];if((0,i.default)(v))b[y]=f(v);else if(Array.isArray(v)){for(var d=[],p=0,h=v.length;p<h;++p){var g=(0,r.default)(c,y,v[p],b,u);(0,o.default)(d,g||v[p])}d.length>0&&(b[y]=d)}else{var m=(0,r.default)(c,y,v,b,u);m&&(b[y]=m),b=(0,n.default)(u,y,b)}}return b}}}),IN=St(wN),SN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r,o){if(typeof o=="string"&&o==="text")return["-webkit-text","text"]}}),TN=St(SN),Uo=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var n=/-webkit-|-moz-|-ms-/;function r(o){return typeof o=="string"&&n.test(o)}e.exports=t.default});St(Uo);var AN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Uo);function r(a){return a&&a.__esModule?a:{default:a}}var o=["-webkit-","-moz-",""];function i(a,l){if(typeof l=="string"&&!(0,n.default)(l)&&l.indexOf("calc(")>-1)return o.map(function(s){return l.replace(/calc\(/g,s+"calc(")})}}),_N=St(AN),ON=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Uo);function r(a){return a&&a.__esModule?a:{default:a}}var o=["-webkit-",""];function i(a,l){if(typeof l=="string"&&!(0,n.default)(l)&&l.indexOf("cross-fade(")>-1)return o.map(function(s){return l.replace(/cross-fade\(/g,s+"cross-fade(")})}}),RN=St(ON),NN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=["-webkit-","-moz-",""],r={"zoom-in":!0,"zoom-out":!0,grab:!0,grabbing:!0};function o(i,a){if(i==="cursor"&&r.hasOwnProperty(a))return n.map(function(l){return l+a})}}),DN=St(NN),PN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Uo);function r(a){return a&&a.__esModule?a:{default:a}}var o=["-webkit-",""];function i(a,l){if(typeof l=="string"&&!(0,n.default)(l)&&l.indexOf("filter(")>-1)return o.map(function(s){return l.replace(/filter\(/g,s+"filter(")})}}),kN=St(PN),LN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var n={flex:["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex","flex"],"inline-flex":["-webkit-inline-box","-moz-inline-box","-ms-inline-flexbox","-webkit-inline-flex","inline-flex"]};function r(o,i){if(o==="display"&&n.hasOwnProperty(i))return n[i]}}),FN=St(LN),MN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n={"space-around":"distribute","space-between":"justify","flex-start":"start","flex-end":"end"},r={alignContent:"msFlexLinePack",alignSelf:"msFlexItemAlign",alignItems:"msFlexAlign",justifyContent:"msFlexPack",order:"msFlexOrder",flexGrow:"msFlexPositive",flexShrink:"msFlexNegative",flexBasis:"msFlexPreferredSize"},o={auto:"1 1 auto",inherit:"inherit",initial:"0 1 auto",none:"0 0 auto",unset:"unset"},i=/^\d+(\.\d+)?$/;function a(l,s,u){if(Object.prototype.hasOwnProperty.call(r,l)&&(u[r[l]]=n[s]||s),l==="flex"){if(Object.prototype.hasOwnProperty.call(o,s)){u.msFlex=o[s];return}if(i.test(s)){u.msFlex=s+" 1 0%";return}var c=s.split(/\s/);switch(c.length){case 1:u.msFlex="1 1 "+s;return;case 2:i.test(c[1])?u.msFlex=c[0]+" "+c[1]+" 0%":u.msFlex=c[0]+" 1 "+c[1];return;default:u.msFlex=s}}}}),BN=St(MN),jN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n={"space-around":"justify","space-between":"justify","flex-start":"start","flex-end":"end","wrap-reverse":"multiple",wrap:"multiple"},r={alignItems:"WebkitBoxAlign",justifyContent:"WebkitBoxPack",flexWrap:"WebkitBoxLines",flexGrow:"WebkitBoxFlex"};function o(i,a,l){i==="flexDirection"&&typeof a=="string"&&(a.indexOf("column")>-1?l.WebkitBoxOrient="vertical":l.WebkitBoxOrient="horizontal",a.indexOf("reverse")>-1?l.WebkitBoxDirection="reverse":l.WebkitBoxDirection="normal"),r.hasOwnProperty(i)&&(l[r[i]]=n[a]||a)}}),VN=St(jN),GN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=r(Uo);function r(l){return l&&l.__esModule?l:{default:l}}var o=["-webkit-","-moz-",""],i=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/gi;function a(l,s){if(typeof s=="string"&&!(0,n.default)(s)&&i.test(s))return o.map(function(u){return s.replace(i,function(c){return u+c})})}}),WN=St(GN),HN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function s(u,c){var f=[],b=!0,y=!1,v=void 0;try{for(var d=u[Symbol.iterator](),p;!(b=(p=d.next()).done)&&(f.push(p.value),!(c&&f.length===c));b=!0);}catch(h){y=!0,v=h}finally{try{!b&&d.return&&d.return()}finally{if(y)throw v}}return f}return function(u,c){if(Array.isArray(u))return u;if(Symbol.iterator in Object(u))return s(u,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.default=l;function r(s){return typeof s=="number"&&!isNaN(s)}var o=["center","end","start","stretch"],i={"inline-grid":["-ms-inline-grid","inline-grid"],grid:["-ms-grid","grid"]},a={alignSelf:function(u,c){o.indexOf(u)>-1&&(c.msGridRowAlign=u)},gridColumn:function(u,c){if(r(u))c.msGridColumn=u;else{var f=u.split("/").map(function(d){return+d}),b=n(f,2),y=b[0],v=b[1];a.gridColumnStart(y,c),a.gridColumnEnd(v,c)}},gridColumnEnd:function(u,c){var f=c.msGridColumn;r(u)&&r(f)&&(c.msGridColumnSpan=u-f)},gridColumnStart:function(u,c){r(u)&&(c.msGridColumn=u)},gridRow:function(u,c){if(r(u))c.msGridRow=u;else{var f=u.split("/").map(function(d){return+d}),b=n(f,2),y=b[0],v=b[1];a.gridRowStart(y,c),a.gridRowEnd(v,c)}},gridRowEnd:function(u,c){var f=c.msGridRow;r(u)&&r(f)&&(c.msGridRowSpan=u-f)},gridRowStart:function(u,c){r(u)&&(c.msGridRow=u)},gridTemplateColumns:function(u,c){c.msGridColumns=u},gridTemplateRows:function(u,c){c.msGridRows=u},justifySelf:function(u,c){o.indexOf(u)>-1&&(c.msGridColumnAlign=u)}};function l(s,u,c){if(s==="display"&&u in i)return i[u];if(s in a){var f=a[s];f(u,c)}}}),zN=St(HN),XN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Uo);function r(a){return a&&a.__esModule?a:{default:a}}var o=["-webkit-",""];function i(a,l){if(typeof l=="string"&&!(0,n.default)(l)&&l.indexOf("image-set(")>-1)return o.map(function(s){return l.replace(/image-set\(/g,s+"image-set(")})}}),ZN=St(XN),YN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var n={marginBlockStart:["WebkitMarginBefore"],marginBlockEnd:["WebkitMarginAfter"],marginInlineStart:["WebkitMarginStart","MozMarginStart"],marginInlineEnd:["WebkitMarginEnd","MozMarginEnd"],paddingBlockStart:["WebkitPaddingBefore"],paddingBlockEnd:["WebkitPaddingAfter"],paddingInlineStart:["WebkitPaddingStart","MozPaddingStart"],paddingInlineEnd:["WebkitPaddingEnd","MozPaddingEnd"],borderBlockStart:["WebkitBorderBefore"],borderBlockStartColor:["WebkitBorderBeforeColor"],borderBlockStartStyle:["WebkitBorderBeforeStyle"],borderBlockStartWidth:["WebkitBorderBeforeWidth"],borderBlockEnd:["WebkitBorderAfter"],borderBlockEndColor:["WebkitBorderAfterColor"],borderBlockEndStyle:["WebkitBorderAfterStyle"],borderBlockEndWidth:["WebkitBorderAfterWidth"],borderInlineStart:["WebkitBorderStart","MozBorderStart"],borderInlineStartColor:["WebkitBorderStartColor","MozBorderStartColor"],borderInlineStartStyle:["WebkitBorderStartStyle","MozBorderStartStyle"],borderInlineStartWidth:["WebkitBorderStartWidth","MozBorderStartWidth"],borderInlineEnd:["WebkitBorderEnd","MozBorderEnd"],borderInlineEndColor:["WebkitBorderEndColor","MozBorderEndColor"],borderInlineEndStyle:["WebkitBorderEndStyle","MozBorderEndStyle"],borderInlineEndWidth:["WebkitBorderEndWidth","MozBorderEndWidth"]};function r(o,i,a){if(Object.prototype.hasOwnProperty.call(n,o))for(var l=n[o],s=0,u=l.length;s<u;++s)a[l[s]]=i}}),UN=St(YN),qN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r,o){if(r==="position"&&o==="sticky")return["-webkit-sticky","sticky"]}}),JN=St(qN),QN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=["-webkit-","-moz-",""],r={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},o={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};function i(a,l){if(r.hasOwnProperty(a)&&o.hasOwnProperty(l))return n.map(function(s){return s+l})}}),$N=St(QN),KN=/[A-Z]/g,e4=/^ms-/,Rd={};function t4(e){return"-"+e.toLowerCase()}function n4(e){if(Rd.hasOwnProperty(e))return Rd[e];var t=e.replace(KN,t4);return Rd[e]=e4.test(t)?"-"+t:t}var r4=Object.freeze({default:n4}),o4=CN(r4),W0=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(o4);function r(i){return i&&i.__esModule?i:{default:i}}function o(i){return(0,n.default)(i)}e.exports=t.default});St(W0);var i4=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=i(W0),r=i(Uo),o=i(Od);function i(c){return c&&c.__esModule?c:{default:c}}var a={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},l={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};function s(c,f){if((0,r.default)(c))return c;for(var b=c.split(/,(?![^()]*(?:\([^()]*\))?\))/g),y=0,v=b.length;y<v;++y){var d=b[y],p=[d];for(var h in f){var g=(0,n.default)(h);if(d.indexOf(g)>-1&&g!=="order")for(var m=f[h],E=0,x=m.length;E<x;++E)p.unshift(d.replace(g,l[m[E]]+g))}b[y]=p.join(",")}return b.join(",")}function u(c,f,b,y){if(typeof f=="string"&&a.hasOwnProperty(c)){var v=s(f,y),d=v.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(h){return!/-moz-|-ms-/.test(h)}).join(",");if(c.indexOf("Webkit")>-1)return d;var p=v.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(h){return!/-webkit-|-ms-/.test(h)}).join(",");return c.indexOf("Moz")>-1?p:(b["Webkit"+(0,o.default)(c)]=d,b["Moz"+(0,o.default)(c)]=p,v)}}}),a4=St(i4),Se=["Webkit"],Nd=["Moz"],Ll=["ms"],an=["Webkit","Moz"],Qt=["Webkit","ms"],za=["Webkit","Moz","ms"],s4={plugins:[TN,_N,RN,DN,kN,FN,BN,VN,WN,zN,ZN,UN,JN,$N,a4],prefixMap:{transform:Qt,transformOrigin:Qt,transformOriginX:Qt,transformOriginY:Qt,backfaceVisibility:Se,perspective:Se,perspectiveOrigin:Se,transformStyle:Se,transformOriginZ:Se,animation:Se,animationDelay:Se,animationDirection:Se,animationFillMode:Se,animationDuration:Se,animationIterationCount:Se,animationName:Se,animationPlayState:Se,animationTimingFunction:Se,appearance:an,userSelect:za,fontKerning:Se,textEmphasisPosition:Se,textEmphasis:Se,textEmphasisStyle:Se,textEmphasisColor:Se,boxDecorationBreak:Se,clipPath:Se,maskImage:Se,maskMode:Se,maskRepeat:Se,maskPosition:Se,maskClip:Se,maskOrigin:Se,maskSize:Se,maskComposite:Se,mask:Se,maskBorderSource:Se,maskBorderMode:Se,maskBorderSlice:Se,maskBorderWidth:Se,maskBorderOutset:Se,maskBorderRepeat:Se,maskBorder:Se,maskType:Se,textDecorationStyle:an,textDecorationSkip:an,textDecorationLine:an,textDecorationColor:an,filter:Se,fontFeatureSettings:an,breakAfter:za,breakBefore:za,breakInside:za,columnCount:an,columnFill:an,columnGap:an,columnRule:an,columnRuleColor:an,columnRuleStyle:an,columnRuleWidth:an,columns:an,columnSpan:an,columnWidth:an,writingMode:Qt,flex:Qt,flexBasis:Se,flexDirection:Qt,flexGrow:Se,flexFlow:Qt,flexShrink:Se,flexWrap:Qt,alignContent:Se,alignItems:Se,alignSelf:Se,justifyContent:Se,order:Se,transitionDelay:Se,transitionDuration:Se,transitionProperty:Se,transitionTimingFunction:Se,backdropFilter:Se,scrollSnapType:Qt,scrollSnapPointsX:Qt,scrollSnapPointsY:Qt,scrollSnapDestination:Qt,scrollSnapCoordinate:Qt,shapeImageThreshold:Se,shapeImageMargin:Se,shapeImageOutside:Se,hyphens:za,flowInto:Qt,flowFrom:Qt,regionFragment:Qt,textOrientation:Se,boxSizing:Nd,textAlignLast:Nd,tabSize:Nd,wrapFlow:Ll,wrapThrough:Ll,wrapMargin:Ll,touchAction:Ll,textSizeAdjust:Qt,borderImage:Se,borderImageOutset:Se,borderImageRepeat:Se,borderImageSlice:Se,borderImageSource:Se,borderImageWidth:Se}},l4=IN(s4),H0=[function(t,n,r){return t[0]!==":"?null:r(n+t)},function(t,n,r){if(t[0]!=="@")return null;var o=r(n);return["".concat(t,"{").concat(o.join(""),"}")]}],Dd=function e(t,n,r,o,i){for(var a=new _d,l=0;l<n.length;l++)a.addStyleType(n[l]);var s=new _d,u=[];a.forEach(function(f,b){var y=r.some(function(v){var d=v(b,t,function(p){return e(p,[f],r,o,i)});if(d!=null)return Array.isArray(d)?u.push.apply(u,L0(d)):(console.warn("WARNING: Selector handlers should return an array of rules.Returning a string containing multiple rules is deprecated.",v),u.push("@media all {".concat(d,"}"))),!0});y||s.set(b,f,!0)});var c=d4(t,s,o,i,r);return c&&u.unshift(c),u},u4=function(t,n,r){if(n)for(var o=Object.keys(n),i=0;i<o.length;i++){var a=o[i];t.has(a)&&t.set(a,n[a](t.get(a),r),!1)}},z0=function(t,n,r){return"".concat(mN(t),":").concat(r(t,n),";")},c4=function(t,n){return t[n]=!0,t},d4=function(t,n,r,o,i){u4(n,r,i);var a=Object.keys(n.elements).reduce(c4,Object.create(null)),l=l4(n.elements),s=Object.keys(l);if(s.length!==n.keyOrder.length){for(var u=0;u<s.length;u++)if(!a[s[u]]){var c=void 0;if(s[u][0]==="W"?c=s[u][6].toLowerCase()+s[u].slice(7):s[u][1]==="o"?c=s[u][3].toLowerCase()+s[u].slice(4):c=s[u][2].toLowerCase()+s[u].slice(3),c&&a[c]){var f=n.keyOrder.indexOf(c);n.keyOrder.splice(f,0,s[u])}else n.keyOrder.unshift(s[u])}}for(var b=o===!1?F0:yN,y=[],v=0;v<n.keyOrder.length;v++){var d=n.keyOrder[v],p=l[d];if(Array.isArray(p))for(var h=0;h<p.length;h++)y.push(z0(d,p[h],b));else y.push(z0(d,p,b))}return y.length?"".concat(t,"{").concat(y.join(""),"}"):""},$n=null,f4=function(t){if($n==null&&($n=document.querySelector("style[data-aphrodite]"),$n==null)){var n=document.head||document.getElementsByTagName("head")[0];$n=document.createElement("style"),$n.type="text/css",$n.setAttribute("data-aphrodite",""),n.appendChild($n)}var r=$n.styleSheet||$n.sheet;if(r.insertRule){var o=r.cssRules.length;t.forEach(function(i){try{r.insertRule(i,o),o+=1}catch{}})}else $n.innerText=($n.innerText||"")+t.join("")},Pd={fontFamily:function e(t){if(Array.isArray(t)){var n={};return t.forEach(function(r){n[e(r)]=!0}),Object.keys(n).join(",")}else return Ri(t)==="object"?(Z0(t.src,"@font-face",[t],!1),'"'.concat(t.fontFamily,'"')):t},animationName:function e(t,n){if(Array.isArray(t))return t.map(function(i){return e(i,n)}).join(",");if(Ri(t)==="object"){var r="keyframe_".concat(EN(t)),o="@keyframes ".concat(r,"{");return t instanceof _d?t.forEach(function(i,a){o+=Dd(a,[i],n,Pd,!1).join("")}):Object.keys(t).forEach(function(i){o+=Dd(i,[t[i]],n,Pd,!1).join("")}),o+="}",X0(r,[o]),r}else return t}},qo={},Xa=[],Ni=!1,X0=function(t,n){var r;if(!qo[t]){if(!Ni){if(typeof document>"u")throw new Error("Cannot automatically buffer without a document");Ni=!0,AR(q0)}(r=Xa).push.apply(r,L0(n)),qo[t]=!0}},Z0=function(t,n,r,o){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[];if(!qo[t]){var a=Dd(n,r,i,Pd,o);X0(t,a)}},Fl=function(){Xa=[],qo={},Ni=!1,$n=null},p4=function(t){delete qo[t]},h4=function(){return Xa},Y0=function(){if(Ni)throw new Error("Cannot buffer while already buffering");Ni=!0},U0=function(){Ni=!1;var t=Xa;return Xa=[],t},g4=function(){return U0().join("")},q0=function(){var t=U0();t.length>0&&f4(t)},m4=function(){return Object.keys(qo)},b4=function(t){t.forEach(function(n){qo[n]=!0})},v4=function(t){return"_definition"in t&&"_name"in t&&"_len"in t},y4=function e(t,n,r,o){for(var i=0;i<t.length;i+=1)if(t[i])if(Array.isArray(t[i]))o+=e(t[i],n,r,o);else if(v4(t[i]))n.push(t[i]._name),r.push(t[i]._definition),o+=t[i]._len;else throw new Error("Invalid Style Definition: Styles should be defined using the StyleSheet.create method.");return o},J0=function(t,n,r){var o=[],i=[],a=y4(n,o,i,0);if(o.length===0)return"";var l;return process.env.NODE_ENV==="production"?l=o.length===1?"_".concat(o[0]):"_".concat(Ha(o.join())).concat((a%36).toString(36)):l=o.join("-o_O-"),Z0(l,".".concat(l),i,t,r),l},Q0=function(t,n){return"".concat(n,"_").concat(Ha(t))},E4=function(){return process.env.NODE_ENV==="production"?Ha:Q0},$0=E4(),x4={create:function(t){for(var n={},r=Object.keys(t),o=0;o<r.length;o+=1){var i=r[o],a=t[i],l=JSON.stringify(a);n[i]={_len:l.length,_name:$0(l,i),_definition:a}}return n},rehydrate:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];b4(t)}},C4=typeof window<"u"?null:{renderStatic:function(t){Fl(),Y0();var n=t(),r=g4();return{html:n,css:{content:r,renderedClassNames:m4()}}}},w4=process.env.NODE_ENV==="production"?null:{suppressStyleInjection:function(){Fl(),Y0()},clearBufferAndResumeStyleInjection:function(){Fl()},getBufferedStyles:function(){return h4()}};function K0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:H0;return{StyleSheet:cN({},x4,{extend:function(r){var o=r.map(function(i){return i.selectorHandler}).filter(function(i){return i});return K0(e,t.concat(o))}}),StyleSheetServer:C4,StyleSheetTestUtils:w4,minify:function(r){$0=r?Ha:Q0},css:function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return J0(e,o,t)},flushToStyleTag:q0,injectAndGetClassName:J0,defaultSelectorHandlers:H0,reset:Fl,resetInjectedStyle:p4}}var I4=!0,Tr=K0(I4),S4=Tr.StyleSheet;Tr.StyleSheetServer,Tr.StyleSheetTestUtils;var Ml=Tr.css;Tr.minify,Tr.flushToStyleTag,Tr.injectAndGetClassName,Tr.defaultSelectorHandlers,Tr.reset,Tr.resetInjectedStyle;var eb={},kd={},tb={exports:{}};/*!
|
|
777
|
+
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=A0,t.componentWillReceiveProps=_0),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=O0;var l=t.componentDidUpdate;t.componentDidUpdate=function(u,c,f){var b=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:f;l.call(this,u,c,b)}}return e}const R0=Ry(Object.freeze(Object.defineProperty({__proto__:null,polyfill:zR},Symbol.toStringTag,{value:"Module"})));var zo={};zo.__esModule=!0,zo.classNamesShape=zo.timeoutsShape=void 0;var Ut=XR(Ti);function XR(e){return e&&e.__esModule?e:{default:e}}var ZR=process.env.NODE_ENV!=="production"?Ut.default.oneOfType([Ut.default.number,Ut.default.shape({enter:Ut.default.number,exit:Ut.default.number,appear:Ut.default.number}).isRequired]):null;zo.timeoutsShape=ZR;var YR=process.env.NODE_ENV!=="production"?Ut.default.oneOfType([Ut.default.string,Ut.default.shape({enter:Ut.default.string,exit:Ut.default.string,active:Ut.default.string}),Ut.default.shape({enter:Ut.default.string,enterDone:Ut.default.string,enterActive:Ut.default.string,exit:Ut.default.string,exitDone:Ut.default.string,exitActive:Ut.default.string})]):null;zo.classNamesShape=YR,vn.__esModule=!0,vn.default=vn.EXITING=vn.ENTERED=vn.ENTERING=vn.EXITED=vn.UNMOUNTED=void 0;var tn=QR(Ti),wd=N0(S),UR=N0(Qe),qR=R0,JR=zo;function N0(e){return e&&e.__esModule?e:{default:e}}function QR(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}}return t.default=e,t}function $R(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function KR(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Wa="unmounted";vn.UNMOUNTED=Wa;var Xo="exited";vn.EXITED=Xo;var Zo="entering";vn.ENTERING=Zo;var Ai="entered";vn.ENTERED=Ai;var Id="exiting";vn.EXITING=Id;var Sr=function(e){KR(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=o.transitionGroup,l=a&&!a.isMounting?r.enter:r.appear,s;return i.appearStatus=null,r.in?l?(s=Xo,i.appearStatus=Zo):s=Ai:r.unmountOnExit||r.mountOnEnter?s=Wa:s=Xo,i.state={status:s},i.nextCallback=null,i}var n=t.prototype;return n.getChildContext=function(){return{transitionGroup:null}},t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===Wa?{status:Xo}:null},n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var a=this.state.status;this.props.in?a!==Zo&&a!==Ai&&(i=Zo):(a===Zo||a===Ai)&&(i=Id)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,a,l;return i=a=l=o,o!=null&&typeof o!="number"&&(i=o.exit,a=o.enter,l=o.appear!==void 0?o.appear:a),{exit:i,enter:a,appear:l}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null){this.cancelNextCallback();var a=UR.default.findDOMNode(this);i===Zo?this.performEnter(a,o):this.performExit(a)}else this.props.unmountOnExit&&this.state.status===Xo&&this.setState({status:Wa})},n.performEnter=function(o,i){var a=this,l=this.props.enter,s=this.context.transitionGroup?this.context.transitionGroup.isMounting:i,u=this.getTimeouts(),c=s?u.appear:u.enter;if(!i&&!l){this.safeSetState({status:Ai},function(){a.props.onEntered(o)});return}this.props.onEnter(o,s),this.safeSetState({status:Zo},function(){a.props.onEntering(o,s),a.onTransitionEnd(o,c,function(){a.safeSetState({status:Ai},function(){a.props.onEntered(o,s)})})})},n.performExit=function(o){var i=this,a=this.props.exit,l=this.getTimeouts();if(!a){this.safeSetState({status:Xo},function(){i.props.onExited(o)});return}this.props.onExit(o),this.safeSetState({status:Id},function(){i.props.onExiting(o),i.onTransitionEnd(o,l.exit,function(){i.safeSetState({status:Xo},function(){i.props.onExited(o)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,a=!0;return this.nextCallback=function(l){a&&(a=!1,i.nextCallback=null,o(l))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(o,i,a){this.setNextCallback(a);var l=i==null&&!this.props.addEndListener;if(!o||l){setTimeout(this.nextCallback,0);return}this.props.addEndListener&&this.props.addEndListener(o,this.nextCallback),i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var o=this.state.status;if(o===Wa)return null;var i=this.props,a=i.children,l=$R(i,["children"]);if(delete l.in,delete l.mountOnEnter,delete l.unmountOnExit,delete l.appear,delete l.enter,delete l.exit,delete l.timeout,delete l.addEndListener,delete l.onEnter,delete l.onEntering,delete l.onEntered,delete l.onExit,delete l.onExiting,delete l.onExited,typeof a=="function")return a(o,l);var s=wd.default.Children.only(a);return wd.default.cloneElement(s,l)},t}(wd.default.Component);Sr.contextTypes={transitionGroup:tn.object},Sr.childContextTypes={transitionGroup:function(){}},Sr.propTypes=process.env.NODE_ENV!=="production"?{children:tn.oneOfType([tn.func.isRequired,tn.element.isRequired]).isRequired,in:tn.bool,mountOnEnter:tn.bool,unmountOnExit:tn.bool,appear:tn.bool,enter:tn.bool,exit:tn.bool,timeout:function(t){var n=JR.timeoutsShape;t.addEndListener||(n=n.isRequired);for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return n.apply(void 0,[t].concat(o))},addEndListener:tn.func,onEnter:tn.func,onEntering:tn.func,onEntered:tn.func,onExit:tn.func,onExiting:tn.func,onExited:tn.func}:{};function _i(){}Sr.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:_i,onEntering:_i,onEntered:_i,onExit:_i,onExiting:_i,onExited:_i},Sr.UNMOUNTED=0,Sr.EXITED=1,Sr.ENTERING=2,Sr.ENTERED=3,Sr.EXITING=4;var eN=(0,qR.polyfill)(Sr);vn.default=eN,function(e,t){t.__esModule=!0,t.default=void 0;var n=u(Ti),r=s(WR),o=s(HR),i=s(S),a=s(vn),l=zo;function s(p){return p&&p.__esModule?p:{default:p}}function u(p){if(p&&p.__esModule)return p;var h={};if(p!=null){for(var g in p)if(Object.prototype.hasOwnProperty.call(p,g)){var m=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(p,g):{};m.get||m.set?Object.defineProperty(h,g,m):h[g]=p[g]}}return h.default=p,h}function c(){return c=Object.assign||function(p){for(var h=1;h<arguments.length;h++){var g=arguments[h];for(var m in g)Object.prototype.hasOwnProperty.call(g,m)&&(p[m]=g[m])}return p},c.apply(this,arguments)}function f(p,h){p.prototype=Object.create(h.prototype),p.prototype.constructor=p,p.__proto__=h}var b=function(h,g){return h&&g&&g.split(" ").forEach(function(m){return(0,r.default)(h,m)})},y=function(h,g){return h&&g&&g.split(" ").forEach(function(m){return(0,o.default)(h,m)})},v=function(p){f(h,p);function h(){for(var m,E=arguments.length,x=new Array(E),A=0;A<E;A++)x[A]=arguments[A];return m=p.call.apply(p,[this].concat(x))||this,m.onEnter=function(T,C){var O=m.getClassNames(C?"appear":"enter"),M=O.className;m.removeClasses(T,"exit"),b(T,M),m.props.onEnter&&m.props.onEnter(T,C)},m.onEntering=function(T,C){var O=m.getClassNames(C?"appear":"enter"),M=O.activeClassName;m.reflowAndAddClass(T,M),m.props.onEntering&&m.props.onEntering(T,C)},m.onEntered=function(T,C){var O=m.getClassNames("appear").doneClassName,M=m.getClassNames("enter").doneClassName,B=C?O+" "+M:M;m.removeClasses(T,C?"appear":"enter"),b(T,B),m.props.onEntered&&m.props.onEntered(T,C)},m.onExit=function(T){var C=m.getClassNames("exit"),O=C.className;m.removeClasses(T,"appear"),m.removeClasses(T,"enter"),b(T,O),m.props.onExit&&m.props.onExit(T)},m.onExiting=function(T){var C=m.getClassNames("exit"),O=C.activeClassName;m.reflowAndAddClass(T,O),m.props.onExiting&&m.props.onExiting(T)},m.onExited=function(T){var C=m.getClassNames("exit"),O=C.doneClassName;m.removeClasses(T,"exit"),b(T,O),m.props.onExited&&m.props.onExited(T)},m.getClassNames=function(T){var C=m.props.classNames,O=typeof C=="string",M=O&&C?C+"-":"",B=O?M+T:C[T],U=O?B+"-active":C[T+"Active"],G=O?B+"-done":C[T+"Done"];return{className:B,activeClassName:U,doneClassName:G}},m}var g=h.prototype;return g.removeClasses=function(E,x){var A=this.getClassNames(x),T=A.className,C=A.activeClassName,O=A.doneClassName;T&&y(E,T),C&&y(E,C),O&&y(E,O)},g.reflowAndAddClass=function(E,x){x&&(E&&E.scrollTop,b(E,x))},g.render=function(){var E=c({},this.props);return delete E.classNames,i.default.createElement(a.default,c({},E,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},h}(i.default.Component);v.defaultProps={classNames:""},v.propTypes=process.env.NODE_ENV!=="production"?c({},a.default.propTypes,{classNames:l.classNamesShape,onEnter:n.func,onEntering:n.func,onEntered:n.func,onExit:n.func,onExiting:n.func,onExited:n.func}):{};var d=v;t.default=d,e.exports=t.default}(xd,xd.exports);var tN=xd.exports,Sd={exports:{}},Td={exports:{}},Oi={};Oi.__esModule=!0,Oi.getChildMapping=Ad,Oi.mergeChildMappings=D0,Oi.getInitialChildMapping=nN,Oi.getNextChildMapping=rN;var Gr=S;function Ad(e,t){var n=function(i){return t&&(0,Gr.isValidElement)(i)?t(i):i},r=Object.create(null);return e&&Gr.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function D0(e,t){e=e||{},t=t||{};function n(c){return c in t?t[c]:e[c]}var r=Object.create(null),o=[];for(var i in e)i in t?o.length&&(r[i]=o,o=[]):o.push(i);var a,l={};for(var s in t){if(r[s])for(a=0;a<r[s].length;a++){var u=r[s][a];l[r[s][a]]=n(u)}l[s]=n(s)}for(a=0;a<o.length;a++)l[o[a]]=n(o[a]);return l}function Yo(e,t,n){return n[t]!=null?n[t]:e.props[t]}function nN(e,t){return Ad(e.children,function(n){return(0,Gr.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:Yo(n,"appear",e),enter:Yo(n,"enter",e),exit:Yo(n,"exit",e)})})}function rN(e,t,n){var r=Ad(e.children),o=D0(t,r);return Object.keys(o).forEach(function(i){var a=o[i];if((0,Gr.isValidElement)(a)){var l=i in t,s=i in r,u=t[i],c=(0,Gr.isValidElement)(u)&&!u.props.in;s&&(!l||c)?o[i]=(0,Gr.cloneElement)(a,{onExited:n.bind(null,a),in:!0,exit:Yo(a,"exit",e),enter:Yo(a,"enter",e)}):!s&&l&&!c?o[i]=(0,Gr.cloneElement)(a,{in:!1}):s&&l&&(0,Gr.isValidElement)(u)&&(o[i]=(0,Gr.cloneElement)(a,{onExited:n.bind(null,a),in:u.props.in,exit:Yo(a,"exit",e),enter:Yo(a,"enter",e)}))}}),o}(function(e,t){t.__esModule=!0,t.default=void 0;var n=a(Ti),r=a(S),o=R0,i=Oi;function a(d){return d&&d.__esModule?d:{default:d}}function l(d,p){if(d==null)return{};var h={},g=Object.keys(d),m,E;for(E=0;E<g.length;E++)m=g[E],!(p.indexOf(m)>=0)&&(h[m]=d[m]);return h}function s(){return s=Object.assign||function(d){for(var p=1;p<arguments.length;p++){var h=arguments[p];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(d[g]=h[g])}return d},s.apply(this,arguments)}function u(d,p){d.prototype=Object.create(p.prototype),d.prototype.constructor=d,d.__proto__=p}function c(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}var f=Object.values||function(d){return Object.keys(d).map(function(p){return d[p]})},b={component:"div",childFactory:function(p){return p}},y=function(d){u(p,d);function p(g,m){var E;E=d.call(this,g,m)||this;var x=E.handleExited.bind(c(c(E)));return E.state={handleExited:x,firstRender:!0},E}var h=p.prototype;return h.getChildContext=function(){return{transitionGroup:{isMounting:!this.appeared}}},h.componentDidMount=function(){this.appeared=!0,this.mounted=!0},h.componentWillUnmount=function(){this.mounted=!1},p.getDerivedStateFromProps=function(m,E){var x=E.children,A=E.handleExited,T=E.firstRender;return{children:T?(0,i.getInitialChildMapping)(m,A):(0,i.getNextChildMapping)(m,x,A),firstRender:!1}},h.handleExited=function(m,E){var x=(0,i.getChildMapping)(this.props.children);m.key in x||(m.props.onExited&&m.props.onExited(E),this.mounted&&this.setState(function(A){var T=s({},A.children);return delete T[m.key],{children:T}}))},h.render=function(){var m=this.props,E=m.component,x=m.childFactory,A=l(m,["component","childFactory"]),T=f(this.state.children).map(x);return delete A.appear,delete A.enter,delete A.exit,E===null?T:r.default.createElement(E,A,T)},p}(r.default.Component);y.childContextTypes={transitionGroup:n.default.object.isRequired},y.propTypes=process.env.NODE_ENV!=="production"?{component:n.default.any,children:n.default.node,appear:n.default.bool,enter:n.default.bool,exit:n.default.bool,childFactory:n.default.func}:{},y.defaultProps=b;var v=(0,o.polyfill)(y);t.default=v,e.exports=t.default})(Td,Td.exports);var P0=Td.exports;(function(e,t){t.__esModule=!0,t.default=void 0;var n=a(Ti),r=a(S),o=Qe,i=a(P0);function a(f){return f&&f.__esModule?f:{default:f}}function l(f,b){if(f==null)return{};var y={},v=Object.keys(f),d,p;for(p=0;p<v.length;p++)d=v[p],!(b.indexOf(d)>=0)&&(y[d]=f[d]);return y}function s(f,b){f.prototype=Object.create(b.prototype),f.prototype.constructor=f,f.__proto__=b}var u=function(f){s(b,f);function b(){for(var v,d=arguments.length,p=new Array(d),h=0;h<d;h++)p[h]=arguments[h];return v=f.call.apply(f,[this].concat(p))||this,v.handleEnter=function(){for(var g=arguments.length,m=new Array(g),E=0;E<g;E++)m[E]=arguments[E];return v.handleLifecycle("onEnter",0,m)},v.handleEntering=function(){for(var g=arguments.length,m=new Array(g),E=0;E<g;E++)m[E]=arguments[E];return v.handleLifecycle("onEntering",0,m)},v.handleEntered=function(){for(var g=arguments.length,m=new Array(g),E=0;E<g;E++)m[E]=arguments[E];return v.handleLifecycle("onEntered",0,m)},v.handleExit=function(){for(var g=arguments.length,m=new Array(g),E=0;E<g;E++)m[E]=arguments[E];return v.handleLifecycle("onExit",1,m)},v.handleExiting=function(){for(var g=arguments.length,m=new Array(g),E=0;E<g;E++)m[E]=arguments[E];return v.handleLifecycle("onExiting",1,m)},v.handleExited=function(){for(var g=arguments.length,m=new Array(g),E=0;E<g;E++)m[E]=arguments[E];return v.handleLifecycle("onExited",1,m)},v}var y=b.prototype;return y.handleLifecycle=function(d,p,h){var g,m=this.props.children,E=r.default.Children.toArray(m)[p];E.props[d]&&(g=E.props)[d].apply(g,h),this.props[d]&&this.props[d]((0,o.findDOMNode)(this))},y.render=function(){var d=this.props,p=d.children,h=d.in,g=l(d,["children","in"]),m=r.default.Children.toArray(p),E=m[0],x=m[1];return delete g.onEnter,delete g.onEntering,delete g.onEntered,delete g.onExit,delete g.onExiting,delete g.onExited,r.default.createElement(i.default,g,h?r.default.cloneElement(E,{key:"first",onEnter:this.handleEnter,onEntering:this.handleEntering,onEntered:this.handleEntered}):r.default.cloneElement(x,{key:"second",onEnter:this.handleExit,onEntering:this.handleExiting,onEntered:this.handleExited}))},b}(r.default.Component);u.propTypes=process.env.NODE_ENV!=="production"?{in:n.default.bool.isRequired,children:function(b,y){return r.default.Children.count(b[y])!==2?new Error('"'+y+'" must be exactly two transition components.'):null}}:{};var c=u;t.default=c,e.exports=t.default})(Sd,Sd.exports);var oN=Sd.exports,iN=Pl(tN),aN=Pl(oN),sN=Pl(P0),lN=Pl(vn);function Pl(e){return e&&e.__esModule?e:{default:e}}var k0={Transition:lN.default,TransitionGroup:sN.default,ReplaceTransition:aN.default,CSSTransition:iN.default};function Ri(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ri=function(t){return typeof t}:Ri=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ri(e)}function uN(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){uN(e,o,n[o])})}return e}function L0(e){return dN(e)||fN(e)||pN()}function dN(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function fN(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function pN(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var hN=/([A-Z])/g,gN=function(t){return"-".concat(t.toLowerCase())},mN=function(t){var n=t.replace(hN,gN);return n[0]==="m"&&n[1]==="s"&&n[2]==="-"?"-".concat(n):n},kl={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function bN(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var vN=["Webkit","ms","Moz","O"];Object.keys(kl).forEach(function(e){vN.forEach(function(t){kl[bN(t,e)]=kl[e]})});var F0=function(t,n){return typeof n=="number"?kl[t]?""+n:n+"px":""+n},yN=function(t,n){return xN(F0(t,n))},Ha=function(t,n){return xR(t).toString(36)},EN=function(t){return Ha(JSON.stringify(t))},xN=function(t){return t[t.length-10]==="!"&&t.slice(-11)===" !important"?t:"".concat(t," !important")},M0=typeof Map<"u",_d=function(){function e(){this.elements={},this.keyOrder=[]}var t=e.prototype;return t.forEach=function(r){for(var o=0;o<this.keyOrder.length;o++)r(this.elements[this.keyOrder[o]],this.keyOrder[o])},t.set=function(r,o,i){if(!this.elements.hasOwnProperty(r))this.keyOrder.push(r);else if(i){var a=this.keyOrder.indexOf(r);this.keyOrder.splice(a,1),this.keyOrder.push(r)}if(o==null){this.elements[r]=o;return}if(M0&&o instanceof Map||o instanceof e){var l=this.elements.hasOwnProperty(r)?this.elements[r]:new e;o.forEach(function(f,b){l.set(b,f,i)}),this.elements[r]=l;return}if(!Array.isArray(o)&&Ri(o)==="object"){for(var s=this.elements.hasOwnProperty(r)?this.elements[r]:new e,u=Object.keys(o),c=0;c<u.length;c+=1)s.set(u[c],o[u[c]],i);this.elements[r]=s;return}this.elements[r]=o},t.get=function(r){return this.elements[r]},t.has=function(r){return this.elements.hasOwnProperty(r)},t.addStyleType=function(r){var o=this;if(M0&&r instanceof Map||r instanceof e)r.forEach(function(l,s){o.set(s,l,!0)});else for(var i=Object.keys(r),a=0;a<i.length;a++)this.set(i[a],r[i[a]],!0)},e}();function St(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Tt(e,t){return t={exports:{}},e(t,t.exports),t.exports}function CN(e){return e&&e.default||e}var Od=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r){return r.charAt(0).toUpperCase()+r.slice(1)}});St(Od);var B0=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Od);function r(i){return i&&i.__esModule?i:{default:i}}function o(i,a,l){if(i.hasOwnProperty(a)){for(var s={},u=i[a],c=(0,n.default)(a),f=Object.keys(l),b=0;b<f.length;b++){var y=f[b];if(y===a)for(var v=0;v<u.length;v++)s[u[v]+c]=l[a];s[y]=l[y]}return s}return l}});St(B0);var j0=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r,o,i,a,l){for(var s=0,u=r.length;s<u;++s){var c=r[s](o,i,a,l);if(c)return c}}});St(j0);var V0=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function n(o,i){o.indexOf(i)===-1&&o.push(i)}function r(o,i){if(Array.isArray(i))for(var a=0,l=i.length;a<l;++a)n(o,i[a]);else n(o,i)}});St(V0);var G0=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r){return r instanceof Object&&!Array.isArray(r)}});St(G0);var wN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var n=a(B0),r=a(j0),o=a(V0),i=a(G0);function a(s){return s&&s.__esModule?s:{default:s}}function l(s){var u=s.prefixMap,c=s.plugins;return function f(b){for(var y in b){var v=b[y];if((0,i.default)(v))b[y]=f(v);else if(Array.isArray(v)){for(var d=[],p=0,h=v.length;p<h;++p){var g=(0,r.default)(c,y,v[p],b,u);(0,o.default)(d,g||v[p])}d.length>0&&(b[y]=d)}else{var m=(0,r.default)(c,y,v,b,u);m&&(b[y]=m),b=(0,n.default)(u,y,b)}}return b}}}),IN=St(wN),SN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r,o){if(typeof o=="string"&&o==="text")return["-webkit-text","text"]}}),TN=St(SN),Uo=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var n=/-webkit-|-moz-|-ms-/;function r(o){return typeof o=="string"&&n.test(o)}e.exports=t.default});St(Uo);var AN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Uo);function r(a){return a&&a.__esModule?a:{default:a}}var o=["-webkit-","-moz-",""];function i(a,l){if(typeof l=="string"&&!(0,n.default)(l)&&l.indexOf("calc(")>-1)return o.map(function(s){return l.replace(/calc\(/g,s+"calc(")})}}),_N=St(AN),ON=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Uo);function r(a){return a&&a.__esModule?a:{default:a}}var o=["-webkit-",""];function i(a,l){if(typeof l=="string"&&!(0,n.default)(l)&&l.indexOf("cross-fade(")>-1)return o.map(function(s){return l.replace(/cross-fade\(/g,s+"cross-fade(")})}}),RN=St(ON),NN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=["-webkit-","-moz-",""],r={"zoom-in":!0,"zoom-out":!0,grab:!0,grabbing:!0};function o(i,a){if(i==="cursor"&&r.hasOwnProperty(a))return n.map(function(l){return l+a})}}),DN=St(NN),PN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Uo);function r(a){return a&&a.__esModule?a:{default:a}}var o=["-webkit-",""];function i(a,l){if(typeof l=="string"&&!(0,n.default)(l)&&l.indexOf("filter(")>-1)return o.map(function(s){return l.replace(/filter\(/g,s+"filter(")})}}),kN=St(PN),LN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var n={flex:["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex","flex"],"inline-flex":["-webkit-inline-box","-moz-inline-box","-ms-inline-flexbox","-webkit-inline-flex","inline-flex"]};function r(o,i){if(o==="display"&&n.hasOwnProperty(i))return n[i]}}),FN=St(LN),MN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n={"space-around":"distribute","space-between":"justify","flex-start":"start","flex-end":"end"},r={alignContent:"msFlexLinePack",alignSelf:"msFlexItemAlign",alignItems:"msFlexAlign",justifyContent:"msFlexPack",order:"msFlexOrder",flexGrow:"msFlexPositive",flexShrink:"msFlexNegative",flexBasis:"msFlexPreferredSize"},o={auto:"1 1 auto",inherit:"inherit",initial:"0 1 auto",none:"0 0 auto",unset:"unset"},i=/^\d+(\.\d+)?$/;function a(l,s,u){if(Object.prototype.hasOwnProperty.call(r,l)&&(u[r[l]]=n[s]||s),l==="flex"){if(Object.prototype.hasOwnProperty.call(o,s)){u.msFlex=o[s];return}if(i.test(s)){u.msFlex=s+" 1 0%";return}var c=s.split(/\s/);switch(c.length){case 1:u.msFlex="1 1 "+s;return;case 2:i.test(c[1])?u.msFlex=c[0]+" "+c[1]+" 0%":u.msFlex=c[0]+" 1 "+c[1];return;default:u.msFlex=s}}}}),BN=St(MN),jN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n={"space-around":"justify","space-between":"justify","flex-start":"start","flex-end":"end","wrap-reverse":"multiple",wrap:"multiple"},r={alignItems:"WebkitBoxAlign",justifyContent:"WebkitBoxPack",flexWrap:"WebkitBoxLines",flexGrow:"WebkitBoxFlex"};function o(i,a,l){i==="flexDirection"&&typeof a=="string"&&(a.indexOf("column")>-1?l.WebkitBoxOrient="vertical":l.WebkitBoxOrient="horizontal",a.indexOf("reverse")>-1?l.WebkitBoxDirection="reverse":l.WebkitBoxDirection="normal"),r.hasOwnProperty(i)&&(l[r[i]]=n[a]||a)}}),VN=St(jN),GN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=r(Uo);function r(l){return l&&l.__esModule?l:{default:l}}var o=["-webkit-","-moz-",""],i=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/gi;function a(l,s){if(typeof s=="string"&&!(0,n.default)(s)&&i.test(s))return o.map(function(u){return s.replace(i,function(c){return u+c})})}}),WN=St(GN),HN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function s(u,c){var f=[],b=!0,y=!1,v=void 0;try{for(var d=u[Symbol.iterator](),p;!(b=(p=d.next()).done)&&(f.push(p.value),!(c&&f.length===c));b=!0);}catch(h){y=!0,v=h}finally{try{!b&&d.return&&d.return()}finally{if(y)throw v}}return f}return function(u,c){if(Array.isArray(u))return u;if(Symbol.iterator in Object(u))return s(u,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.default=l;function r(s){return typeof s=="number"&&!isNaN(s)}var o=["center","end","start","stretch"],i={"inline-grid":["-ms-inline-grid","inline-grid"],grid:["-ms-grid","grid"]},a={alignSelf:function(u,c){o.indexOf(u)>-1&&(c.msGridRowAlign=u)},gridColumn:function(u,c){if(r(u))c.msGridColumn=u;else{var f=u.split("/").map(function(d){return+d}),b=n(f,2),y=b[0],v=b[1];a.gridColumnStart(y,c),a.gridColumnEnd(v,c)}},gridColumnEnd:function(u,c){var f=c.msGridColumn;r(u)&&r(f)&&(c.msGridColumnSpan=u-f)},gridColumnStart:function(u,c){r(u)&&(c.msGridColumn=u)},gridRow:function(u,c){if(r(u))c.msGridRow=u;else{var f=u.split("/").map(function(d){return+d}),b=n(f,2),y=b[0],v=b[1];a.gridRowStart(y,c),a.gridRowEnd(v,c)}},gridRowEnd:function(u,c){var f=c.msGridRow;r(u)&&r(f)&&(c.msGridRowSpan=u-f)},gridRowStart:function(u,c){r(u)&&(c.msGridRow=u)},gridTemplateColumns:function(u,c){c.msGridColumns=u},gridTemplateRows:function(u,c){c.msGridRows=u},justifySelf:function(u,c){o.indexOf(u)>-1&&(c.msGridColumnAlign=u)}};function l(s,u,c){if(s==="display"&&u in i)return i[u];if(s in a){var f=a[s];f(u,c)}}}),zN=St(HN),XN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Uo);function r(a){return a&&a.__esModule?a:{default:a}}var o=["-webkit-",""];function i(a,l){if(typeof l=="string"&&!(0,n.default)(l)&&l.indexOf("image-set(")>-1)return o.map(function(s){return l.replace(/image-set\(/g,s+"image-set(")})}}),ZN=St(XN),YN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var n={marginBlockStart:["WebkitMarginBefore"],marginBlockEnd:["WebkitMarginAfter"],marginInlineStart:["WebkitMarginStart","MozMarginStart"],marginInlineEnd:["WebkitMarginEnd","MozMarginEnd"],paddingBlockStart:["WebkitPaddingBefore"],paddingBlockEnd:["WebkitPaddingAfter"],paddingInlineStart:["WebkitPaddingStart","MozPaddingStart"],paddingInlineEnd:["WebkitPaddingEnd","MozPaddingEnd"],borderBlockStart:["WebkitBorderBefore"],borderBlockStartColor:["WebkitBorderBeforeColor"],borderBlockStartStyle:["WebkitBorderBeforeStyle"],borderBlockStartWidth:["WebkitBorderBeforeWidth"],borderBlockEnd:["WebkitBorderAfter"],borderBlockEndColor:["WebkitBorderAfterColor"],borderBlockEndStyle:["WebkitBorderAfterStyle"],borderBlockEndWidth:["WebkitBorderAfterWidth"],borderInlineStart:["WebkitBorderStart","MozBorderStart"],borderInlineStartColor:["WebkitBorderStartColor","MozBorderStartColor"],borderInlineStartStyle:["WebkitBorderStartStyle","MozBorderStartStyle"],borderInlineStartWidth:["WebkitBorderStartWidth","MozBorderStartWidth"],borderInlineEnd:["WebkitBorderEnd","MozBorderEnd"],borderInlineEndColor:["WebkitBorderEndColor","MozBorderEndColor"],borderInlineEndStyle:["WebkitBorderEndStyle","MozBorderEndStyle"],borderInlineEndWidth:["WebkitBorderEndWidth","MozBorderEndWidth"]};function r(o,i,a){if(Object.prototype.hasOwnProperty.call(n,o))for(var l=n[o],s=0,u=l.length;s<u;++s)a[l[s]]=i}}),UN=St(YN),qN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r,o){if(r==="position"&&o==="sticky")return["-webkit-sticky","sticky"]}}),JN=St(qN),QN=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=["-webkit-","-moz-",""],r={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},o={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};function i(a,l){if(r.hasOwnProperty(a)&&o.hasOwnProperty(l))return n.map(function(s){return s+l})}}),$N=St(QN),KN=/[A-Z]/g,e4=/^ms-/,Rd={};function t4(e){return"-"+e.toLowerCase()}function n4(e){if(Rd.hasOwnProperty(e))return Rd[e];var t=e.replace(KN,t4);return Rd[e]=e4.test(t)?"-"+t:t}var r4=Object.freeze({default:n4}),o4=CN(r4),W0=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(o4);function r(i){return i&&i.__esModule?i:{default:i}}function o(i){return(0,n.default)(i)}e.exports=t.default});St(W0);var i4=Tt(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=i(W0),r=i(Uo),o=i(Od);function i(c){return c&&c.__esModule?c:{default:c}}var a={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},l={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};function s(c,f){if((0,r.default)(c))return c;for(var b=c.split(/,(?![^()]*(?:\([^()]*\))?\))/g),y=0,v=b.length;y<v;++y){var d=b[y],p=[d];for(var h in f){var g=(0,n.default)(h);if(d.indexOf(g)>-1&&g!=="order")for(var m=f[h],E=0,x=m.length;E<x;++E)p.unshift(d.replace(g,l[m[E]]+g))}b[y]=p.join(",")}return b.join(",")}function u(c,f,b,y){if(typeof f=="string"&&a.hasOwnProperty(c)){var v=s(f,y),d=v.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(h){return!/-moz-|-ms-/.test(h)}).join(",");if(c.indexOf("Webkit")>-1)return d;var p=v.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(h){return!/-webkit-|-ms-/.test(h)}).join(",");return c.indexOf("Moz")>-1?p:(b["Webkit"+(0,o.default)(c)]=d,b["Moz"+(0,o.default)(c)]=p,v)}}}),a4=St(i4),Se=["Webkit"],Nd=["Moz"],Ll=["ms"],an=["Webkit","Moz"],Qt=["Webkit","ms"],za=["Webkit","Moz","ms"],s4={plugins:[TN,_N,RN,DN,kN,FN,BN,VN,WN,zN,ZN,UN,JN,$N,a4],prefixMap:{transform:Qt,transformOrigin:Qt,transformOriginX:Qt,transformOriginY:Qt,backfaceVisibility:Se,perspective:Se,perspectiveOrigin:Se,transformStyle:Se,transformOriginZ:Se,animation:Se,animationDelay:Se,animationDirection:Se,animationFillMode:Se,animationDuration:Se,animationIterationCount:Se,animationName:Se,animationPlayState:Se,animationTimingFunction:Se,appearance:an,userSelect:za,fontKerning:Se,textEmphasisPosition:Se,textEmphasis:Se,textEmphasisStyle:Se,textEmphasisColor:Se,boxDecorationBreak:Se,clipPath:Se,maskImage:Se,maskMode:Se,maskRepeat:Se,maskPosition:Se,maskClip:Se,maskOrigin:Se,maskSize:Se,maskComposite:Se,mask:Se,maskBorderSource:Se,maskBorderMode:Se,maskBorderSlice:Se,maskBorderWidth:Se,maskBorderOutset:Se,maskBorderRepeat:Se,maskBorder:Se,maskType:Se,textDecorationStyle:an,textDecorationSkip:an,textDecorationLine:an,textDecorationColor:an,filter:Se,fontFeatureSettings:an,breakAfter:za,breakBefore:za,breakInside:za,columnCount:an,columnFill:an,columnGap:an,columnRule:an,columnRuleColor:an,columnRuleStyle:an,columnRuleWidth:an,columns:an,columnSpan:an,columnWidth:an,writingMode:Qt,flex:Qt,flexBasis:Se,flexDirection:Qt,flexGrow:Se,flexFlow:Qt,flexShrink:Se,flexWrap:Qt,alignContent:Se,alignItems:Se,alignSelf:Se,justifyContent:Se,order:Se,transitionDelay:Se,transitionDuration:Se,transitionProperty:Se,transitionTimingFunction:Se,backdropFilter:Se,scrollSnapType:Qt,scrollSnapPointsX:Qt,scrollSnapPointsY:Qt,scrollSnapDestination:Qt,scrollSnapCoordinate:Qt,shapeImageThreshold:Se,shapeImageMargin:Se,shapeImageOutside:Se,hyphens:za,flowInto:Qt,flowFrom:Qt,regionFragment:Qt,textOrientation:Se,boxSizing:Nd,textAlignLast:Nd,tabSize:Nd,wrapFlow:Ll,wrapThrough:Ll,wrapMargin:Ll,touchAction:Ll,textSizeAdjust:Qt,borderImage:Se,borderImageOutset:Se,borderImageRepeat:Se,borderImageSlice:Se,borderImageSource:Se,borderImageWidth:Se}},l4=IN(s4),H0=[function(t,n,r){return t[0]!==":"?null:r(n+t)},function(t,n,r){if(t[0]!=="@")return null;var o=r(n);return["".concat(t,"{").concat(o.join(""),"}")]}],Dd=function e(t,n,r,o,i){for(var a=new _d,l=0;l<n.length;l++)a.addStyleType(n[l]);var s=new _d,u=[];a.forEach(function(f,b){var y=r.some(function(v){var d=v(b,t,function(p){return e(p,[f],r,o,i)});if(d!=null)return Array.isArray(d)?u.push.apply(u,L0(d)):(console.warn("WARNING: Selector handlers should return an array of rules.Returning a string containing multiple rules is deprecated.",v),u.push("@media all {".concat(d,"}"))),!0});y||s.set(b,f,!0)});var c=d4(t,s,o,i,r);return c&&u.unshift(c),u},u4=function(t,n,r){if(n)for(var o=Object.keys(n),i=0;i<o.length;i++){var a=o[i];t.has(a)&&t.set(a,n[a](t.get(a),r),!1)}},z0=function(t,n,r){return"".concat(mN(t),":").concat(r(t,n),";")},c4=function(t,n){return t[n]=!0,t},d4=function(t,n,r,o,i){u4(n,r,i);var a=Object.keys(n.elements).reduce(c4,Object.create(null)),l=l4(n.elements),s=Object.keys(l);if(s.length!==n.keyOrder.length){for(var u=0;u<s.length;u++)if(!a[s[u]]){var c=void 0;if(s[u][0]==="W"?c=s[u][6].toLowerCase()+s[u].slice(7):s[u][1]==="o"?c=s[u][3].toLowerCase()+s[u].slice(4):c=s[u][2].toLowerCase()+s[u].slice(3),c&&a[c]){var f=n.keyOrder.indexOf(c);n.keyOrder.splice(f,0,s[u])}else n.keyOrder.unshift(s[u])}}for(var b=o===!1?F0:yN,y=[],v=0;v<n.keyOrder.length;v++){var d=n.keyOrder[v],p=l[d];if(Array.isArray(p))for(var h=0;h<p.length;h++)y.push(z0(d,p[h],b));else y.push(z0(d,p,b))}return y.length?"".concat(t,"{").concat(y.join(""),"}"):""},$n=null,f4=function(t){if($n==null&&($n=document.querySelector("style[data-aphrodite]"),$n==null)){var n=document.head||document.getElementsByTagName("head")[0];$n=document.createElement("style"),$n.type="text/css",$n.setAttribute("data-aphrodite",""),n.appendChild($n)}var r=$n.styleSheet||$n.sheet;if(r.insertRule){var o=r.cssRules.length;t.forEach(function(i){try{r.insertRule(i,o),o+=1}catch{}})}else $n.innerText=($n.innerText||"")+t.join("")},Pd={fontFamily:function e(t){if(Array.isArray(t)){var n={};return t.forEach(function(r){n[e(r)]=!0}),Object.keys(n).join(",")}else return Ri(t)==="object"?(Z0(t.src,"@font-face",[t],!1),'"'.concat(t.fontFamily,'"')):t},animationName:function e(t,n){if(Array.isArray(t))return t.map(function(i){return e(i,n)}).join(",");if(Ri(t)==="object"){var r="keyframe_".concat(EN(t)),o="@keyframes ".concat(r,"{");return t instanceof _d?t.forEach(function(i,a){o+=Dd(a,[i],n,Pd,!1).join("")}):Object.keys(t).forEach(function(i){o+=Dd(i,[t[i]],n,Pd,!1).join("")}),o+="}",X0(r,[o]),r}else return t}},qo={},Xa=[],Ni=!1,X0=function(t,n){var r;if(!qo[t]){if(!Ni){if(typeof document>"u")throw new Error("Cannot automatically buffer without a document");Ni=!0,AR(q0)}(r=Xa).push.apply(r,L0(n)),qo[t]=!0}},Z0=function(t,n,r,o){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[];if(!qo[t]){var a=Dd(n,r,i,Pd,o);X0(t,a)}},Fl=function(){Xa=[],qo={},Ni=!1,$n=null},p4=function(t){delete qo[t]},h4=function(){return Xa},Y0=function(){if(Ni)throw new Error("Cannot buffer while already buffering");Ni=!0},U0=function(){Ni=!1;var t=Xa;return Xa=[],t},g4=function(){return U0().join("")},q0=function(){var t=U0();t.length>0&&f4(t)},m4=function(){return Object.keys(qo)},b4=function(t){t.forEach(function(n){qo[n]=!0})},v4=function(t){return"_definition"in t&&"_name"in t&&"_len"in t},y4=function e(t,n,r,o){for(var i=0;i<t.length;i+=1)if(t[i])if(Array.isArray(t[i]))o+=e(t[i],n,r,o);else if(v4(t[i]))n.push(t[i]._name),r.push(t[i]._definition),o+=t[i]._len;else throw new Error("Invalid Style Definition: Styles should be defined using the StyleSheet.create method.");return o},J0=function(t,n,r){var o=[],i=[],a=y4(n,o,i,0);if(o.length===0)return"";var l;return process.env.NODE_ENV==="production"?l=o.length===1?"_".concat(o[0]):"_".concat(Ha(o.join())).concat((a%36).toString(36)):l=o.join("-o_O-"),Z0(l,".".concat(l),i,t,r),l},Q0=function(t,n){return"".concat(n,"_").concat(Ha(t))},E4=function(){return process.env.NODE_ENV==="production"?Ha:Q0},$0=E4(),x4={create:function(t){for(var n={},r=Object.keys(t),o=0;o<r.length;o+=1){var i=r[o],a=t[i],l=JSON.stringify(a);n[i]={_len:l.length,_name:$0(l,i),_definition:a}}return n},rehydrate:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];b4(t)}},C4=typeof window<"u"?null:{renderStatic:function(t){Fl(),Y0();var n=t(),r=g4();return{html:n,css:{content:r,renderedClassNames:m4()}}}},w4=process.env.NODE_ENV==="production"?null:{suppressStyleInjection:function(){Fl(),Y0()},clearBufferAndResumeStyleInjection:function(){Fl()},getBufferedStyles:function(){return h4()}};function K0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:H0;return{StyleSheet:cN({},x4,{extend:function(r){var o=r.map(function(i){return i.selectorHandler}).filter(function(i){return i});return K0(e,t.concat(o))}}),StyleSheetServer:C4,StyleSheetTestUtils:w4,minify:function(r){$0=r?Ha:Q0},css:function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return J0(e,o,t)},flushToStyleTag:q0,injectAndGetClassName:J0,defaultSelectorHandlers:H0,reset:Fl,resetInjectedStyle:p4}}var I4=!0,Tr=K0(I4),S4=Tr.StyleSheet;Tr.StyleSheetServer,Tr.StyleSheetTestUtils;var Ml=Tr.css;Tr.minify,Tr.flushToStyleTag,Tr.injectAndGetClassName,Tr.defaultSelectorHandlers,Tr.reset,Tr.resetInjectedStyle;var eb={},kd={},tb={exports:{}};/*!
|
|
778
778
|
Copyright (c) 2015 Jed Watson.
|
|
779
779
|
Based on code that is Copyright 2013-2015, Facebook, Inc.
|
|
780
780
|
All rights reserved.
|
|
@@ -918,7 +918,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStat
|
|
|
918
918
|
height: 18px;
|
|
919
919
|
margin: 0;
|
|
920
920
|
}
|
|
921
|
-
`,WD=()=>{const{availableFeatures:e,sendTrackingEvent:t}=S.useContext(
|
|
921
|
+
`,WD=()=>{const{availableFeatures:e,sendTrackingEvent:t}=S.useContext(zt),n=so(),r=qe(bl),o=qe(oc),i=qe(jc),a=qe(Xh),l=uo(),{id:s=""}=zg(),[u]=em(),c=u.get("isEdit")==="true",f=(r==null?void 0:r[s])||null,b=(o==null?void 0:o[s])||null;S.useEffect(()=>{l(c?Ea(s):ya(s))},[c,l,s]);const y=g=>{g==null||g.stopPropagation(),t($e.CONNECTOR_BACK_CLICKED,{connector_name:v==null?void 0:v.name}),n(Xe.BASEPATH)},v=c?f:b,d=!!(v!=null&&v.carouselImages)&&v.carouselImages.length>0,p=i===Ie.LOADING||a===Ie.LOADING,h=br(e,kE)&&(p||d);return I.jsxs(S.Fragment,{children:[c?null:I.jsx(ud,{isApiViewPage:!0}),I.jsxs(VD,{"data-testid":"connector-config",children:[I.jsx(w.Tooltip,{title:"Back",placement:"bottom",children:I.jsx(GD,{onClick:y,children:I.jsx("img",{src:jD})})}),v?I.jsx(e0,{isConfigSettingsPage:!0,connector:v,isEdit:c}):null,h&&(d?I.jsx(kD,{carouselImages:v.carouselImages,templateDescription:v.templateDescription,connectorName:v.name,isEdit:c,renderModal:({showModal:g,setShowModal:m})=>I.jsx(sd,{shown:g,setShown:m,connectorType:v.type,isApi:!0})}):I.jsx(BD,{})),!h&&I.jsx(dR,{isLoading:p&&!h,apiList:(v==null?void 0:v.apiList)||[],connectorName:(v==null?void 0:v.name)||"",connectorType:v==null?void 0:v.type,isEdit:c})]})]})},HD=w.styled(w.Stack)`
|
|
922
922
|
margin-bottom: 36px;
|
|
923
923
|
.arrow {
|
|
924
924
|
border: solid ${w.theme.palette.gray.gray3};
|
|
@@ -1127,7 +1127,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1127
1127
|
position: absolute;
|
|
1128
1128
|
margin-left: 5px;
|
|
1129
1129
|
}
|
|
1130
|
-
`;var p5=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"];function h5(e){var t=e.defaultOptions,n=t===void 0?!1:t,r=e.cacheOptions,o=r===void 0?!1:r,i=e.loadOptions;e.options;var a=e.isLoading,l=a===void 0?!1:a,s=e.onInputChange,u=e.filterOption,c=u===void 0?null:u,f=Ar(e,p5),b=f.inputValue,y=S.useRef(void 0),v=S.useRef(!1),d=S.useState(Array.isArray(n)?n:void 0),p=$t(d,2),h=p[0],g=p[1],m=S.useState(typeof b<"u"?b:""),E=$t(m,2),x=E[0],A=E[1],T=S.useState(n===!0),C=$t(T,2),O=C[0],M=C[1],B=S.useState(void 0),U=$t(B,2),G=U[0],X=U[1],q=S.useState([]),$=$t(q,2),ue=$[0],se=$[1],ve=S.useState(!1),W=$t(ve,2),te=W[0],re=W[1],K=S.useState({}),oe=$t(K,2),de=oe[0],ie=oe[1],ge=S.useState(void 0),Ee=$t(ge,2),Ae=Ee[0],me=Ee[1],ze=S.useState(void 0),V=$t(ze,2),Ye=V[0],Le=V[1];o!==Ye&&(ie({}),Le(o)),n!==Ae&&(g(Array.isArray(n)?n:void 0),me(n)),S.useEffect(function(){return v.current=!0,function(){v.current=!1}},[]);var Ue=S.useCallback(function(kt,
|
|
1130
|
+
`;var p5=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"];function h5(e){var t=e.defaultOptions,n=t===void 0?!1:t,r=e.cacheOptions,o=r===void 0?!1:r,i=e.loadOptions;e.options;var a=e.isLoading,l=a===void 0?!1:a,s=e.onInputChange,u=e.filterOption,c=u===void 0?null:u,f=Ar(e,p5),b=f.inputValue,y=S.useRef(void 0),v=S.useRef(!1),d=S.useState(Array.isArray(n)?n:void 0),p=$t(d,2),h=p[0],g=p[1],m=S.useState(typeof b<"u"?b:""),E=$t(m,2),x=E[0],A=E[1],T=S.useState(n===!0),C=$t(T,2),O=C[0],M=C[1],B=S.useState(void 0),U=$t(B,2),G=U[0],X=U[1],q=S.useState([]),$=$t(q,2),ue=$[0],se=$[1],ve=S.useState(!1),W=$t(ve,2),te=W[0],re=W[1],K=S.useState({}),oe=$t(K,2),de=oe[0],ie=oe[1],ge=S.useState(void 0),Ee=$t(ge,2),Ae=Ee[0],me=Ee[1],ze=S.useState(void 0),V=$t(ze,2),Ye=V[0],Le=V[1];o!==Ye&&(ie({}),Le(o)),n!==Ae&&(g(Array.isArray(n)?n:void 0),me(n)),S.useEffect(function(){return v.current=!0,function(){v.current=!1}},[]);var Ue=S.useCallback(function(kt,qt){if(!i)return qt();var mt=i(kt,qt);mt&&typeof mt.then=="function"&&mt.then(qt,function(){return qt()})},[i]);S.useEffect(function(){n===!0&&Ue(x,function(kt){v.current&&(g(kt||[]),M(!!y.current))})},[]);var Pt=S.useCallback(function(kt,qt){var mt=Gk(kt,qt,s);if(!mt){y.current=void 0,A(""),X(""),se([]),M(!1),re(!1);return}if(o&&de[mt])A(mt),X(mt),se(de[mt]),M(!1),re(!1);else{var zn=y.current={};A(mt),M(!0),re(!G),Ue(mt,function(cn){v&&zn===y.current&&(y.current=void 0,M(!1),X(mt),se(cn||[]),re(!1),ie(cn?_e(_e({},de),{},ki({},mt,cn)):de))})}},[o,Ue,G,de,s]),Nn=te?[]:x&&G?ue:h||[];return _e(_e({},f),{},{options:Nn,isLoading:O||l,onInputChange:Pt,filterOption:c})}var g5=S.forwardRef(function(e,t){var n=h5(e),r=Nb(n);return P.createElement(wf,Pe({ref:t},r))}),m5=g5;function b5(e){return I.jsx(Qa.DropdownIndicator,{...e,children:I.jsx(w.Icon,{children:e.selectProps.menuIsOpen?I.jsx(w.icons.ArrowDropUp,{}):I.jsx(w.icons.ArrowDropDown,{})})})}function v5(e){const[t,n]=S.useState([]),[r,o]=S.useState(""),[i,a]=S.useState(!1),{loadOptions:l,isApiSearchEnabled:s=!1,isInfiniteScrollable:u=!1,loadOptionsOnFocus:c=!1}=e,f=(h,g)=>{if(o(h),t.length>0&&!s){const E=t.filter(x=>x&&typeof x=="object"&&"label"in x&&typeof x.label=="string"?x.label.toLowerCase().includes(h.toLowerCase()):!1);g(E);return}const m=E=>{g(E),n(E)};l==null||l(h,m,!1)},b=(h,g)=>{a(!1),!(g&&"isError"in g&&g.isError)&&n(h)},y=h=>{var g;(g=e.onMenuScrollToBottom)==null||g.call(e,h),u&&l&&!i&&(a(!0),l(r,b,!0))},v=(h,g)=>{var m;(m=e.onInputChange)==null||m.call(e,h,g),g.action==="input-change"&&s&&(o(h),n([]))},d=h=>{var g;o(""),(g=e.onBlur)==null||g.call(e,h)},p=h=>{var g;(g=e.onFocus)==null||g.call(e,h),!i&&c&&(n([]),a(!0),l==null||l(r,b,!1))};return I.jsx(m5,{...e,value:e.value?e.value:null,isDisabled:e.disabled,loadOptions:f,onMenuScrollToBottom:y,onInputChange:v,onBlur:d,onFocus:p,isLoading:i,defaultOptions:t.length?t:e.defaultOptions||!1,components:{ClearIndicator:Uv,DropdownIndicator:b5,IndicatorSeparator:()=>null,Option:Yv}})}function y5(e){const[t,n]=S.useState(!1),r=S.useRef(null);S.useEffect(()=>{t&&r.current&&r.current.focus()},[t]);const o=(i,a)=>{i===null&&e.onChange(i,a),i&&typeof i.getTime=="function"&&!isNaN(i.getTime())&&e.onChange(i,a),e.onChange(i,a)};return I.jsx(w.DatePicker,{inputFormat:e.inputFormat?e.inputFormat:$v.DATE,...e,value:e.value||null,open:t,onOpen:()=>n(!0),onClose:()=>n(!1),onChange:o,PopperProps:{anchorEl:r.current},renderInput:i=>I.jsx(w.DateTextField,{...i,fullWidth:!0,variant:"outlined",disabled:e.disabled,inputRef:r,inputProps:{...i.inputProps,placeholder:e.placeholder},onBlur:e.onBlur,onFocus:e.onFocus,InputProps:{endAdornment:I.jsx(w.InputAdornment,{position:"end",sx:{backgroundColor:"#FFFFFF",cursor:"pointer"},children:I.jsx(w.icons.CalendarTodayOutlinedIcon,{})})},sx:{"& .MuiOutlinedInput-root":{backgroundColor:"#FFFFFF"}},onClick:()=>{t||n(!0)}})})}const E5=e=>{const{validation:t,helperText:n,id:r,label:o,name:i,validateOnBlur:a=!0,validateOnChange:l=!0,inputChangeHandler:s,selectChangeHandler:u,dateChangeHandler:c,onValidationError:f,iconData:b,isRequired:y,labelSpacing:v=1,loadOptions:d,showGlobalLoader:p=!1}=e,[h,g]=S.useState(!1),[m,E]=S.useState("");S.useEffect(()=>{h||A(e.value,!1)},[h,e.value]);const x=G=>{G&&!h&&g(!0)};function A(G,X=!0,q){let $="";if((t!=null&&t.isRequired||y)&&($=G?"":Qv,!G&&typeof(t==null?void 0:t.isRequired)=="function")){const se=t.isRequired(G);se&&typeof se=="boolean"?$=Qv:se&&($=se)}let ue={id:r,name:i,label:o};if(e.type==="date"?ue={...ue,disableFuture:e.disableFuture,disablePast:e.disablePast}:e.type==="number"?ue={...ue,min:e.min,max:e.max}:e.type==="text"&&e.multiline&&(ue={...ue,maxCharacters:e.maxCharacters}),G&&!$&&(t!=null&&t.validate)){const se=t.validate(G,{...ue,...q});typeof se=="boolean"&&se===!1?$=u5:typeof se=="string"&&($=se)}X&&E($),f==null||f(i,$)}const T=G=>{var X;h||g(!0),(X=e.onBlur)==null||X.call(e,G),h&&a&&A(e.value)},C=()=>e.helperText?I.jsx(ey,{children:n}):h&&m?I.jsx(ey,{className:"helper--error",children:m}):null,O=G=>{G&&!h&&g(!0),s==null||s(G),h&&l&&A(G.target.value)},M=(G,X)=>{u==null||u(G,X),G&&!h&&g(!0),G&&typeof G=="object"&&"value"in G&&h&&l&&A(G.value)},B=(G,X)=>{c==null||c(i,G,X),G&&!h&&g(!0),h&&l&&A(G)},U=G=>{if(p)return I.jsx(w.Skeleton,{variant:"rounded",height:29.69,animation:"wave"});switch(G.type){case"select":return I.jsx(Kv,{children:I.jsx(Jv,{...G,className:`formField__select ${m&&h?"formField__select--error":""} ${G.className||""}`,classNamePrefix:"hiverFormField",onBlur:T,onChange:M,onFocus:x})});case"async-select":return I.jsx(Kv,{children:I.jsx(v5,{...G,className:`formField__select ${m&&h?"formField__select--error":""} ${G.className||""}`,classNamePrefix:"hiverFormField",onBlur:T,onChange:M,onFocus:x,loadOptions:d})});case"date":return I.jsx(y5,{...G,label:void 0,onBlur:T,onFocus:x,onChange:B,error:!!(m&&h)});default:return I.jsx(d5,{variant:"outlined",fullWidth:!0,id:r,...G,label:void 0,onBlur:T,onChange:O,onFocus:x,error:!!(m&&h),inputProps:{type:G.type,min:G.min,max:G.max,...G.inputProps}})}};return I.jsxs(w.Stack,{spacing:v,useFlexGap:!0,children:[o?I.jsxs(w.Typography,{variant:"h4",component:"label",htmlFor:r,color:w.theme.palette.gray.gray1,className:"hiver__field--label",children:[o,t!=null&&t.isRequired||y?I.jsx("span",{className:"required__star",children:"*"}):null]}):null,I.jsxs(f5,{children:[I.jsx(w.Tooltip,{title:e.toolTipTitle,arrow:!0,placement:"right-end",disableHoverListener:!0,children:U(e)}),b!=null&&b.icon?I.jsx(w.Tooltip,{title:b.toolTipText,placement:"bottom",children:I.jsx(w.IconButton,{className:"form--sideIcon",children:b==null?void 0:b.icon})}):null,C()]})]})},x5=w.styled(w.Stack)`
|
|
1131
1131
|
& .authform__section-title {
|
|
1132
1132
|
margin-top: 32px;
|
|
1133
1133
|
margin-bottom: -12px;
|
|
@@ -1228,7 +1228,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1228
1228
|
padding-bottom: 13px;
|
|
1229
1229
|
border-top: 1px solid #d6dde8;
|
|
1230
1230
|
gap: 16px;
|
|
1231
|
-
`,J5="data:image/svg+xml,%3csvg%20width='22'%20height='22'%20viewBox='0%200%2022%2022'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1446_32274)'%3e%3cpath%20d='M14.6663%200.916687H3.66634C2.65801%200.916687%201.83301%201.74169%201.83301%202.75002V15.5834H3.66634V2.75002H14.6663V0.916687ZM17.4163%204.58335H7.33301C6.32467%204.58335%205.49967%205.40835%205.49967%206.41669V19.25C5.49967%2020.2584%206.32467%2021.0834%207.33301%2021.0834H17.4163C18.4247%2021.0834%2019.2497%2020.2584%2019.2497%2019.25V6.41669C19.2497%205.40835%2018.4247%204.58335%2017.4163%204.58335ZM17.4163%2019.25H7.33301V6.41669H17.4163V19.25Z'%20fill='%236F7C90'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1446_32274'%3e%3crect%20width='22'%20height='22'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Q5=()=>I.jsxs(w.Stack,{gap:"24px",marginTop:"28px",paddingRight:"65px",children:[I.jsxs("div",{children:[I.jsx(fr,{variant:"rounded",width:100,height:24,animation:"wave",margin:"12px 0px 10px 0px"}),I.jsx(fr,{variant:"rounded",height:40,animation:"wave",margin:"12px 0px 10px 0px"})]}),I.jsxs("div",{children:[I.jsx(fr,{variant:"rounded",width:100,height:24,animation:"wave",margin:"12px 0px 10px 0px"}),I.jsx(fr,{variant:"rounded",height:40,animation:"wave",margin:"12px 0px 10px 0px"})]})]}),$5=({isEdit:e=!1,connectorId:t,isLoading:n=!1,connectorData:r,authStatus:o,authMutate:i})=>{const{sendTrackingEvent:a,availableFeatures:l}=S.useContext(
|
|
1231
|
+
`,J5="data:image/svg+xml,%3csvg%20width='22'%20height='22'%20viewBox='0%200%2022%2022'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1446_32274)'%3e%3cpath%20d='M14.6663%200.916687H3.66634C2.65801%200.916687%201.83301%201.74169%201.83301%202.75002V15.5834H3.66634V2.75002H14.6663V0.916687ZM17.4163%204.58335H7.33301C6.32467%204.58335%205.49967%205.40835%205.49967%206.41669V19.25C5.49967%2020.2584%206.32467%2021.0834%207.33301%2021.0834H17.4163C18.4247%2021.0834%2019.2497%2020.2584%2019.2497%2019.25V6.41669C19.2497%205.40835%2018.4247%204.58335%2017.4163%204.58335ZM17.4163%2019.25H7.33301V6.41669H17.4163V19.25Z'%20fill='%236F7C90'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1446_32274'%3e%3crect%20width='22'%20height='22'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Q5=()=>I.jsxs(w.Stack,{gap:"24px",marginTop:"28px",paddingRight:"65px",children:[I.jsxs("div",{children:[I.jsx(fr,{variant:"rounded",width:100,height:24,animation:"wave",margin:"12px 0px 10px 0px"}),I.jsx(fr,{variant:"rounded",height:40,animation:"wave",margin:"12px 0px 10px 0px"})]}),I.jsxs("div",{children:[I.jsx(fr,{variant:"rounded",width:100,height:24,animation:"wave",margin:"12px 0px 10px 0px"}),I.jsx(fr,{variant:"rounded",height:40,animation:"wave",margin:"12px 0px 10px 0px"})]})]}),$5=({isEdit:e=!1,connectorId:t,isLoading:n=!1,connectorData:r,authStatus:o,authMutate:i})=>{const{sendTrackingEvent:a,availableFeatures:l}=S.useContext(zt),[s,u]=S.useReducer(H5,W5),[c,f]=S.useState(!1),b=r?r.name:"",y=r?r.description:"",v=r?r.isAuthenticated:!1,d=r&&r.variablesConfig?r.variablesConfig:[],p=(r==null?void 0:r.advancedSettingsFields)??[],h=Vp(l),g=S.useMemo(()=>!h||!(r!=null&&r.interpolationFields)?{}:F5(r==null?void 0:r.interpolationFields),[r==null?void 0:r.interpolationFields,h]);S.useEffect(()=>{var q;if(r!=null&&r.authDetails){const $=k5(r.authDetails);u({type:Nr.SET_FIELDS,payload:{values:$}})}if(r!=null&&r.variables&&Object.keys(r.variables).forEach($=>{var ue;u({type:Nr.SET_FIELD_VALUE,payload:{name:$,value:((ue=r.variables)==null?void 0:ue[$])||""}})}),r!=null&&r.redirectUrl&&u({type:Nr.SET_FIELD_VALUE,payload:{name:Te.oAuthRedirectUrl,value:r==null?void 0:r.redirectUrl}}),h&&(r!=null&&r.interpolationFields)&&(r!=null&&r.variables)){const $=ay((q=r==null?void 0:r.authDetails)==null?void 0:q.authType);Object.entries(r.interpolationFields).forEach(([ue,se])=>{const ve=$[ue];ve&&u({type:Nr.SET_FIELD_VALUE,payload:{name:ve,value:ly(se,r.variables)}})})}},[r,h]);const m=(q,$)=>{u({type:Nr.SET_FIELD_VALUE,payload:{value:$,name:q}})},E=q=>{var te,re;q.stopPropagation();const{name:$,value:ue}=(q==null?void 0:q.target)||{};m($,ue.trim());const se=g[$];if(!h||!(se!=null&&se.length))return;const ve=(te=s.values)==null?void 0:te.authType,W=ay(typeof ve=="object"?ve.value:void 0);for(const K of se){const oe=W[K],de=(re=r==null?void 0:r.interpolationFields)==null?void 0:re[K];if(!oe||!de)continue;const ie=ly(de,{...s.values,[$]:ue});m(oe,ie)}},x=(q,$)=>{q&&typeof q=="object"&&"label"in q&&typeof q.label=="string"&&"value"in q&&typeof q.value=="string"&&typeof $.name<"u"&&($.name===Hr.authType&&a($e.AUTH_UPDATED,{selected_auth_type:q.label}),m($.name,{value:q.value,label:q.label}))},A=(q,$)=>{u({type:Nr.SET_FIELD_ERROR,payload:{name:q,value:$}})},T=()=>{const q={...B5};if(d)if(h){const{advanced:se,basic:ve}=oy(d,p);ns.formFields=se,q.formFields=ve}else ns.formFields=[...d];let $=[];ns.formFields&&ns.formFields.length&&($=[ns]);const ue=s.values.authType;if(h){const se=typeof ue=="object"?ue.value:void 0,ve=[...uu];se===go.apiToken.value?ve.push(...uy):se===go.oAuth.value?ve.push(...cy):ve.push(...dy);const{basicFields:W,advancedConfigs:te}=D5(ve,p,se);q.formFields.push(...W),$.push(...te),q.formFields.length&&$.push(q)}else typeof ue=="object"&&ue.value===go.apiToken.value?$=[...$,...uu,...uy]:typeof ue=="object"&&ue.value===go.oAuth.value?$=[...$,...uu,...cy]:$=[...$,...uu,...dy];return $},C=()=>{const q={};return typeof s.values.apiAddTo=="object"&&s.values.apiAddTo.value===lu.queryParam.value?(q.apiHeaderPrefix=!1,q.apiHeaderName=!1):q.apiParamName=!1,q},O=()=>{const q=C(),$=jp(T());return!Object.keys(s.errors).filter(se=>!!s.errors[se]).filter(se=>se in q?q[se]:!0).filter(se=>se in $).length},M=()=>{var se;const q=C(),$=jp(T()),ue=P5({isEdit:e,templateId:t,values:s.values,formFields:$,predicates:q});if(d&&d.length){const ve=L5(d,s.values);ue.variables=ve}a($e.SAVE_AUTHORIZE_CLICKED,{connector_name:b,auth_type:((se=s.values.authType)==null?void 0:se.label)??s.values.authType,base_url:s.values.baseUrl}),!e&&"templateId"in ue?i({data:ue}):i({data:ue,connectorId:t})},B=()=>{s.values.oAuthRedirectUrl&&UE(s.values.oAuthRedirectUrl,q=>f(!q))},U={[Te.oAuthRedirectUrl]:{icon:I.jsx("img",{alt:"copy",src:J5,onClick:B}),toolTipText:HE}},G=T().filter(q=>!ry(q)),X=T().filter(ry);return I.jsxs(U5,{id:"connectors-auth-wrapper",children:[I.jsxs(z5,{direction:"column",gap:1,children:[e&&!v?I.jsx(w.Alert,{severity:"error",sx:{width:"fit-content"},children:zE}):null,I.jsx(X5,{variant:"h2",children:Ab})]}),n?I.jsxs(I.Fragment,{children:[I.jsx(R5,{}),I.jsx(Q5,{})]}):I.jsxs(I.Fragment,{children:[I.jsxs("div",{children:[I.jsx(w.Typography,{variant:"h3",children:b}),I.jsx(Z5,{variant:"body2",children:y})]}),I.jsxs(Y5,{id:"conectors-auth-form",children:[I.jsx(ty,{formConfig:h?G:T(),selectChangeHandler:x,inputChangeHandler:E,predicates:C(),values:s.values,validations:fy,onValidationError:A,icons:U}),h&&X.length>0&&I.jsx(O5,{titleNode:I.jsx(w.Typography,{variant:"h3",children:"Advanced settings"}),children:I.jsx(ty,{formConfig:X,selectChangeHandler:x,inputChangeHandler:E,predicates:C(),values:s.values,validations:fy,onValidationError:A,icons:U})})]}),I.jsx(q5,{direction:"row",children:I.jsx(w.Button,{disabled:!O()||n||o===pt.PENDING,onClick:M,children:"Save & Authorize"})})]}),I.jsx(w.Snackbar,{message:qD,anchorOrigin:{vertical:"bottom",horizontal:"left"},autoHideDuration:2e3,onClose:()=>f(!1),open:c})]})},K5=e=>P.createElement("svg",{width:19,height:14,viewBox:"0 0 19 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},P.createElement("path",{d:"M4.5 11C5.15764 11 5.79771 11.0833 6.42021 11.25C7.04285 11.4167 7.65278 11.625 8.25 11.875V2.41667C7.66667 2.11111 7.0625 1.88194 6.4375 1.72917C5.8125 1.57639 5.16514 1.5 4.49542 1.5C3.98236 1.5 3.47292 1.54514 2.96708 1.63542C2.46125 1.72569 1.97222 1.875 1.5 2.08333V11.5C1.98611 11.3194 2.47785 11.191 2.97521 11.1146C3.47271 11.0382 3.98097 11 4.5 11ZM9.75 11.875C10.3472 11.5972 10.9572 11.3819 11.5798 11.2292C12.2023 11.0764 12.8424 11 13.5 11C14.0139 11 14.5243 11.0312 15.0312 11.0938C15.5382 11.1562 16.0278 11.2917 16.5 11.5V2.08333C16.0139 1.90278 15.5195 1.76042 15.0169 1.65625C14.5142 1.55208 14.0081 1.5 13.4983 1.5C12.8328 1.5 12.1875 1.57639 11.5625 1.72917C10.9375 1.88194 10.3333 2.11111 9.75 2.41667V11.875ZM9 14C8.31944 13.5556 7.60417 13.1944 6.85417 12.9167C6.10417 12.6389 5.31944 12.5 4.5 12.5C3.97222 12.5 3.44444 12.5521 2.91667 12.6562C2.38889 12.7604 1.88194 12.9167 1.39583 13.125C1.0625 13.2639 0.746528 13.2394 0.447917 13.0515C0.149306 12.8635 0 12.5894 0 12.2292V1.75C0 1.55556 0.0520833 1.375 0.15625 1.20833C0.260417 1.04167 0.402778 0.916667 0.583333 0.833333C1.20833 0.555556 1.8475 0.347222 2.50083 0.208333C3.15417 0.0694444 3.82056 0 4.5 0C5.29097 0 6.06486 0.09375 6.82167 0.28125C7.57847 0.46875 8.30458 0.75 9 1.125C9.70833 0.763889 10.4388 0.486111 11.1915 0.291667C11.944 0.0972222 12.7135 0 13.5 0C14.1794 0 14.8458 0.0694444 15.4992 0.208333C16.1525 0.347222 16.7917 0.555556 17.4167 0.833333C17.5972 0.916667 17.7431 1.04167 17.8542 1.20833C17.9653 1.375 18.0208 1.55556 18.0208 1.75V12.2292C18.0208 12.5764 17.9132 12.8542 17.6979 13.0625C17.4826 13.2708 17.2569 13.3194 17.0208 13.2083C16.4653 12.9583 15.8925 12.7778 15.3025 12.6667C14.7126 12.5556 14.1118 12.5 13.5 12.5C12.6806 12.5 11.8958 12.6389 11.1458 12.9167C10.3958 13.1944 9.68056 13.5556 9 14Z",fill:"#4D596C"})),e9=e=>P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 20 20",fill:"none",...e},P.createElement("g",{clipPath:"url(#clip0_5762_155564)"},P.createElement("path",{d:"M8.33342 13.75L13.3334 9.99996L8.33342 6.24996V13.75ZM10.0001 1.66663C5.40008 1.66663 1.66675 5.39996 1.66675 9.99996C1.66675 14.6 5.40008 18.3333 10.0001 18.3333C14.6001 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6001 1.66663 10.0001 1.66663ZM10.0001 16.6666C6.32508 16.6666 3.33341 13.675 3.33341 9.99996C3.33341 6.32496 6.32508 3.33329 10.0001 3.33329C13.6751 3.33329 16.6667 6.32496 16.6667 9.99996C16.6667 13.675 13.6751 16.6666 10.0001 16.6666Z",fill:"#4D596C"})),P.createElement("defs",null,P.createElement("clipPath",{id:"clip0_5762_155564"},P.createElement("rect",{width:20,height:20,fill:"white"})))),t9=e=>P.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},P.createElement("path",{d:"M17.5 9.31947C17.503 10.456 17.2374 11.5772 16.725 12.5917C16.1174 13.8074 15.1834 14.8299 14.0275 15.5447C12.8717 16.2595 11.5396 16.6384 10.1806 16.6389C9.044 16.6419 7.92282 16.3763 6.90833 15.8639L2 17.5L3.63611 12.5917C3.12369 11.5772 2.85815 10.456 2.86111 9.31947C2.86164 7.96043 3.24053 6.62837 3.95534 5.4725C4.67016 4.31663 5.69266 3.3826 6.90833 2.77502C7.92282 2.2626 9.044 1.99706 10.1806 2.00002H10.6111C11.4833 2.04814 12.332 2.25177 13.1199 2.59427C13.9534 2.95658 14.7189 3.4743 15.3723 4.12771C16.1287 4.8841 16.7033 5.7907 17.0654 6.77911C17.3118 7.45168 17.4599 8.16213 17.5 8.88891V9.31947Z",stroke:"#4D596C",strokeWidth:1.44667,strokeLinecap:"round",strokeLinejoin:"round"}),P.createElement("circle",{cx:7,cy:9.5,r:1,fill:"#4D596C"}),P.createElement("circle",{cx:10,cy:9.5,r:1,fill:"#4D596C"}),P.createElement("circle",{cx:13,cy:9.5,r:1,fill:"#4D596C"})),n9=w.styled(w.Box)`
|
|
1232
1232
|
background-color: #f6f8fc;
|
|
1233
1233
|
border-radius: 4px;
|
|
1234
1234
|
padding: 4px 12px 4px 12px;
|
|
@@ -1248,7 +1248,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1248
1248
|
`,s9=w.styled(w.icons.ChevronRightOutlined)`
|
|
1249
1249
|
height: 20px;
|
|
1250
1250
|
width: 20px;
|
|
1251
|
-
`,l9=[{icon:I.jsx(e9,{}),text:B3,keys:{link:"setupGuideVideoLink",preview:"setupGuideVideoPreviewImage"},event
|
|
1251
|
+
`,l9=[{icon:I.jsx(e9,{}),text:B3,keys:{link:"setupGuideVideoLink",preview:"setupGuideVideoPreviewImage"},event:$e.CONNECTOR_VIDEO_CLICKED},{icon:I.jsx(K5,{}),text:j3,link:G3,keys:{link:"helpArticleLink"},event:$e.CONNECTOR_AUTH_PAGE_KB_CLICKED,prefixName:!0},{icon:I.jsx(t9,{}),text:V3,link:W3,event:$e.CONNECTOR_AUTH_PAGE_CONTACT_SUPPORT_CLICKED}],u9=({connectorName:e,supportLinks:t})=>{const{availableFeatures:n,sendTrackingEvent:r}=S.useContext(zt),o=br(n,DE),i=Vp(n),a=(l,s)=>{r(s,{source:e}),window.open(l,"_blank")};return o?I.jsx(w.Stack,{gap:"12px",children:l9.map(({icon:l,text:s,link:u,keys:c,event:f,prefixName:b})=>{const y=c!=null&&c.link?t==null?void 0:t[c.link]:null,v=i?y??u:u;if(!v)return null;const d=i&&b&&e?`${e} ${s}`:s,p=i&&(c!=null&&c.preview)?t==null?void 0:t[c.preview]:null;return I.jsxs(n9,{onClick:()=>a(v,f),children:[I.jsxs(r9,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[I.jsxs(w.Stack,{direction:"row",gap:"11px",alignItems:"center",children:[I.jsx(i9,{children:l}),I.jsx(a9,{variant:"body2_medium",children:d})]}),p?null:I.jsx(s9,{})]}),p&&I.jsx(o9,{children:I.jsx(I5,{src:p,alt:s,aspectRatio:"4 / 3"})})]},v)})}):null},c9=w.styled(w.Stack)`
|
|
1252
1252
|
width: 100%;
|
|
1253
1253
|
height: 100%;
|
|
1254
1254
|
padding: 17px 52px 0 0;
|
|
@@ -1284,7 +1284,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1284
1284
|
`,g9=w.styled(w.icons.OpenInNew)`
|
|
1285
1285
|
height: 18px;
|
|
1286
1286
|
width: 18px;
|
|
1287
|
-
`,m9=({upgradeGuideContent:e,upgradeGuideLink:t})=>I.jsxs(d9,{children:[I.jsxs(w.Stack,{marginBottom:"20px",children:[I.jsxs(w.Stack,{direction:"row",padding:"8px 0",gap:"4px",alignItems:"center",children:[I.jsx(f9,{}),I.jsx(w.Typography,{variant:"body1_medium",color:w.theme.palette.gray.black,children:eP})]}),I.jsx(w.Typography,{variant:"body2",children:tP})]}),I.jsx(w.Typography,{variant:"body2_medium",marginBottom:"8px",color:w.theme.palette.gray.black,children:nP}),I.jsx(h9,{variant:"body2",dangerouslySetInnerHTML:{__html:e}}),t?I.jsxs(p9,{target:"_blank",underline:"none",href:t,children:[I.jsx(g9,{}),rP]}):null]}),py=(e,t)=>{const n=t.authType===es,r=t.authType===ny;if(!e||!e.data)return{authUrl:"",authStatus:r?pt.API_KEY_FAILED:n?pt.BASIC_AUTH_FAILED:pt.OAUTH_FAILED};const o=e.data;return r?{authUrl:"",id:o.id,authStatus:pt.API_KEY_SUCCESS}:n?{authUrl:"",id:o.id,authStatus:pt.BASIC_AUTH_SUCCESS}:o.authorizationUrl?{authUrl:o.authorizationUrl,id:o.id,authStatus:pt.PENDING}:{authUrl:"",id:"",authStatus:pt.OAUTH_FAILED}},b9=async e=>{try{const t=await on({url:Ww,method:wn.POST,data:e});return py(t,e.authDetails)}catch(t){return Promise.reject(t)}},v9=async(e,t)=>{try{const n=zw.replace("{{id}}",t),r=await on({url:n,method:wn.PATCH,data:e});return py(r,e.authDetails)}catch(n){return Promise.reject(n)}},y9=({connectorId:e,onSuccess:t})=>{const n=rl(),r=S.useMemo(()=>["authDetails",{connectorId:e}],[e]),{data:o}=vg({queryKey:r,queryFn:()=>Promise.resolve({authUrl:"",authStatus:pt.IDLE,id:""}),enabled:!1}),i=BI({mutationFn:l=>"connectorId"in l?v9(l.data,l.connectorId):b9(l.data),onSuccess:l=>{n.setQueryData(r,l),t==null||t()}});S.useEffect(()=>()=>{n.removeQueries({queryKey:r,exact:!0})},[n,r]);const a=S.useCallback(l=>{n.setQueryData(r,s=>s&&{...s,authStatus:l})},[r,n]);return{mutate:i.mutate,isLoading:i.isPending,data:o,mutateStatus:a}},E9=async e=>{var t;try{const n=await on({url:Hp(Zw,{connectorId:e}),method:wn.GET});return!n||!((t=n==null?void 0:n.data)!=null&&t.status)?{status:"failed"}:n==null?void 0:n.data}catch(n){return Promise.reject(n)}},x9=({connectorId:e,enabled:t=!1})=>{const n=rl(),r=S.useMemo(()=>["authSuccessStatus",{connectorId:e}],[e]),o=vg({queryKey:r,queryFn:()=>E9(e),refetchInterval:i=>{var a,l;return((a=i.state.data)==null?void 0:a.status)==="failed"||((l=i.state.data)==null?void 0:l.status)==="success"?!1:500},enabled:t,refetchOnWindowFocus:!1,refetchIntervalInBackground:!0});return S.useEffect(()=>()=>{n.removeQueries({queryKey:r,exact:!0})},[n,r]),o},C9=()=>{const{sendTrackingEvent:e,availableFeatures:t}=S.useContext(
|
|
1287
|
+
`,m9=({upgradeGuideContent:e,upgradeGuideLink:t})=>I.jsxs(d9,{children:[I.jsxs(w.Stack,{marginBottom:"20px",children:[I.jsxs(w.Stack,{direction:"row",padding:"8px 0",gap:"4px",alignItems:"center",children:[I.jsx(f9,{}),I.jsx(w.Typography,{variant:"body1_medium",color:w.theme.palette.gray.black,children:eP})]}),I.jsx(w.Typography,{variant:"body2",children:tP})]}),I.jsx(w.Typography,{variant:"body2_medium",marginBottom:"8px",color:w.theme.palette.gray.black,children:nP}),I.jsx(h9,{variant:"body2",dangerouslySetInnerHTML:{__html:e}}),t?I.jsxs(p9,{target:"_blank",underline:"none",href:t,children:[I.jsx(g9,{}),rP]}):null]}),py=(e,t)=>{const n=t.authType===es,r=t.authType===ny;if(!e||!e.data)return{authUrl:"",authStatus:r?pt.API_KEY_FAILED:n?pt.BASIC_AUTH_FAILED:pt.OAUTH_FAILED};const o=e.data;return r?{authUrl:"",id:o.id,authStatus:pt.API_KEY_SUCCESS}:n?{authUrl:"",id:o.id,authStatus:pt.BASIC_AUTH_SUCCESS}:o.authorizationUrl?{authUrl:o.authorizationUrl,id:o.id,authStatus:pt.PENDING}:{authUrl:"",id:"",authStatus:pt.OAUTH_FAILED}},b9=async e=>{try{const t=await on({url:Ww,method:wn.POST,data:e});return py(t,e.authDetails)}catch(t){return Promise.reject(t)}},v9=async(e,t)=>{try{const n=zw.replace("{{id}}",t),r=await on({url:n,method:wn.PATCH,data:e});return py(r,e.authDetails)}catch(n){return Promise.reject(n)}},y9=({connectorId:e,onSuccess:t})=>{const n=rl(),r=S.useMemo(()=>["authDetails",{connectorId:e}],[e]),{data:o}=vg({queryKey:r,queryFn:()=>Promise.resolve({authUrl:"",authStatus:pt.IDLE,id:""}),enabled:!1}),i=BI({mutationFn:l=>"connectorId"in l?v9(l.data,l.connectorId):b9(l.data),onSuccess:l=>{n.setQueryData(r,l),t==null||t()}});S.useEffect(()=>()=>{n.removeQueries({queryKey:r,exact:!0})},[n,r]);const a=S.useCallback(l=>{n.setQueryData(r,s=>s&&{...s,authStatus:l})},[r,n]);return{mutate:i.mutate,isLoading:i.isPending,data:o,mutateStatus:a}},E9=async e=>{var t;try{const n=await on({url:Hp(Zw,{connectorId:e}),method:wn.GET});return!n||!((t=n==null?void 0:n.data)!=null&&t.status)?{status:"failed"}:n==null?void 0:n.data}catch(n){return Promise.reject(n)}},x9=({connectorId:e,enabled:t=!1})=>{const n=rl(),r=S.useMemo(()=>["authSuccessStatus",{connectorId:e}],[e]),o=vg({queryKey:r,queryFn:()=>E9(e),refetchInterval:i=>{var a,l;return((a=i.state.data)==null?void 0:a.status)==="failed"||((l=i.state.data)==null?void 0:l.status)==="success"?!1:500},enabled:t,refetchOnWindowFocus:!1,refetchIntervalInBackground:!0});return S.useEffect(()=>()=>{n.removeQueries({queryKey:r,exact:!0})},[n,r]),o},C9=()=>{const{sendTrackingEvent:e,availableFeatures:t}=S.useContext(zt),[n,r]=S.useState(!1),o=qe(bl),i=qe(oc),a=qe(jc),l=qe(Xh),s=S.useRef(null),u=so(),{id:c=""}=zg(),[f]=em(),b=f.get("isEdit")==="true",y=(o==null?void 0:o[c])||null,v=(i==null?void 0:i[c])||null,d=b?y:v,p=!!(d!=null&&d.showUpgradeButton),h=br(t,LE),{data:g,mutateStatus:m,mutate:E}=y9({connectorId:c,onSuccess:()=>{h&&r(!0)}}),x=x9({connectorId:(g==null?void 0:g.id)||"",enabled:n}),{status:A}=x.data||{},T=(g==null?void 0:g.authStatus)||pt.IDLE,C=(g==null?void 0:g.authUrl)||"",O=uo();S.useEffect(()=>()=>{O(qw())},[O]),S.useEffect(()=>{O(b?Ea(c):ya(c))},[b,O,c]),S.useEffect(()=>{let U,G;const X=q=>{s.current&&q.origin===window.location.origin&&(q.data===wb||q.data===Zd)&&(clearTimeout(U),s.current.close(),s.current=null,m(q.data===Zd?pt.OAUTH_SUCCESS:pt.OAUTH_FAILED))};try{if(C){s.current=window.open(C,"_blank");const q=5*60*1e3;U=setTimeout(()=>{var $;($=s.current)==null||$.close(),s.current=null,m(pt.OAUTH_FAILED)},q),G=setInterval(()=>{var $;($=s.current)!=null&&$.closed&&(clearInterval(G),s.current=null,m(pt.OAUTH_FAILED))},500),window.addEventListener("message",X)}}catch(q){console.log("Error in Authentication",q)}return()=>{window.removeEventListener("message",X),clearTimeout(U),clearInterval(G)}},[C,O,m]),S.useEffect(()=>{A&&A!=="pending"&&s.current&&h&&(s.current.close(),s.current=null,m(A==="success"?pt.OAUTH_SUCCESS:pt.OAUTH_FAILED))},[A,m,h]),S.useEffect(()=>{switch((T===pt.OAUTH_SUCCESS||T===pt.OAUTH_FAILED||T===pt.API_KEY_SUCCESS||T===pt.API_KEY_FAILED||T===pt.BASIC_AUTH_SUCCESS||T===pt.BASIC_AUTH_FAILED)&&u(Xe.BASEPATH),T){case pt.OAUTH_SUCCESS:{qn({message:p?Yd:Ib,type:Da}),e($e.CONNECTOR_AUTH_SUCCESS,{connector_name:d==null?void 0:d.name});break}case pt.OAUTH_FAILED:{qn({message:p?Ud:Sb,type:co});break}case pt.REQUEST_FAILED:{qn({message:Tb,type:co});break}case pt.API_KEY_SUCCESS:{qn({message:p?Yd:JD,type:Da}),e($e.CONNECTOR_AUTH_SUCCESS,{connector_name:d==null?void 0:d.name});break}case pt.API_KEY_FAILED:{qn({message:p?Ud:Tb,type:co});break}case pt.BASIC_AUTH_SUCCESS:{qn({message:p?Yd:Ib,type:Da}),e($e.CONNECTOR_AUTH_SUCCESS,{connector_name:d==null?void 0:d.name});break}case pt.BASIC_AUTH_FAILED:{qn({message:p?Ud:Sb,type:co});break}}},[T,u,p,d==null?void 0:d.name,e]);const M=a===Ie.LOADING||l===Ie.LOADING,B=[{name:iP,route:`${Xe.BASEPATH}${Xe.DASHBOARD}`},{name:(d==null?void 0:d.name)||"",route:`${Xe.BASEPATH}${Xe.API_VIEW}/${c}?isEdit=${String(b)}`},{name:Ab}];return I.jsxs(c9,{direction:"row",id:"connectors-auth-page",children:[I.jsxs("div",{children:[I.jsx(ZD,{options:B}),I.jsx($5,{connectorId:c,isEdit:b,connectorData:d,authStatus:T,isLoading:M,authMutate:E})]}),I.jsxs(w.Stack,{gap:"36px",width:"322px",children:[d!=null&&d.upgradeGuideContent?I.jsx(m9,{upgradeGuideContent:d.upgradeGuideContent,upgradeGuideLink:d.upgradeGuideLink}):null,I.jsxs(w.Stack,{gap:"12px",children:[I.jsx(w.Typography,{variant:"h2",marginBottom:"8px",children:z3}),b?null:I.jsx(ud,{isSettingsPage:!0}),I.jsx(u9,{connectorName:d==null?void 0:d.name,supportLinks:d==null?void 0:d.supportLinks})]})]})]})},w9=e=>e.auth.verifyTokenApiStatus,I9=e=>e.auth.authVerificationDone,S9=w.styled(w.Box)`
|
|
1288
1288
|
position: fixed;
|
|
1289
1289
|
z-index: 1000;
|
|
1290
1290
|
background-color: #fff;
|
|
@@ -2250,4 +2250,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2250
2250
|
align-self: auto !important;
|
|
2251
2251
|
margin-left: 12px;
|
|
2252
2252
|
}
|
|
2253
|
-
`,X9=({basename:e,baseUrls:t,extraParams:n={},availableFeatures:r={},connectorFunctions:o})=>{const{userId:i}=hi()||{};return I.jsx(W9,{children:I.jsx(GI,{baseUrls:t,availableFeatures:r,extraParams:n,connectorFunctions:o,children:ZE(r)?I.jsx(G9,{availableFeatures:r}):I.jsxs(I.Fragment,{children:[I.jsx(_9,{basename:e,metaData:n.metaData,userId:i}),Qe.createPortal(I.jsx(z9,{id:"toast-message",children:I.jsx(zy,{position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0})}),document.body)]})})})},Z9="/v1/api"+"/templates/metadata",Y9={GET:"GET",POST:"POST",DELETE:"DELETE",PATCH:"PATCH",PUT:"PUT"},U9=async e=>{const t=new URLSearchParams,{inboxIds:n,channelType:r,conversationId:o}=e||{};return n&&n.forEach(i=>t.append("inbox_ids",i)),r&&t.append("channel_type",r),o&&t.append("conversation_id",o),on({url:`${Z9}?${t.toString()}`,method:Y9.GET})};Ve.ConnectorsApp=X9,Ve.HiverConnectorBifrostAuth=on,Ve.getConnectorsBifrostConfigs=hi,Ve.getMetaData=U9,Ve.initConnectorsBifrost=xw,Object.defineProperty(Ve,Symbol.toStringTag,{value:"Module"})});
|
|
2253
|
+
`,X9=({basename:e,baseUrls:t,extraParams:n={},availableFeatures:r={},connectorFunctions:o})=>{const{userId:i}=hi()||{},{sendTrackingEvent:a}=S.useContext(zt),l=S.useRef(!1);return S.useEffect(()=>{console.log("SSSSSSSSSSSS 1 : ",l),l.current||(console.log("SSSSSSSSSSSS 2 : ",l.current),console.log("SSSSSSSSSSSS 3 : ",a),a($e.CONNECTOR_SECTION_VIEWED),l.current=!0)},[a]),I.jsx(W9,{children:I.jsx(GI,{baseUrls:t,availableFeatures:r,extraParams:n,connectorFunctions:o,children:ZE(r)?I.jsx(G9,{availableFeatures:r}):I.jsxs(I.Fragment,{children:[I.jsx(_9,{basename:e,metaData:n.metaData,userId:i}),Qe.createPortal(I.jsx(z9,{id:"toast-message",children:I.jsx(zy,{position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0})}),document.body)]})})})},Z9="/v1/api"+"/templates/metadata",Y9={GET:"GET",POST:"POST",DELETE:"DELETE",PATCH:"PATCH",PUT:"PUT"},U9=async e=>{const t=new URLSearchParams,{inboxIds:n,channelType:r,conversationId:o}=e||{};return n&&n.forEach(i=>t.append("inbox_ids",i)),r&&t.append("channel_type",r),o&&t.append("conversation_id",o),on({url:`${Z9}?${t.toString()}`,method:Y9.GET})};Ve.ConnectorsApp=X9,Ve.HiverConnectorBifrostAuth=on,Ve.getConnectorsBifrostConfigs=hi,Ve.getMetaData=U9,Ve.initConnectorsBifrost=xw,Object.defineProperty(Ve,Symbol.toStringTag,{value:"Module"})});
|