@1interface/chat-shell 0.1.0 → 0.1.1
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/dist/PaymentProviderHost-CBfoeBts.js +1 -0
- package/dist/PaymentProviderHost-VjMUCJgN.cjs +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
- package/dist/ExportResult-eb4TcH7k.cjs +0 -1
- package/dist/ExportResult-vKWGlZZX.js +0 -1
- package/dist/NoopLogger-B-ce52_l.cjs +0 -1
- package/dist/NoopLogger-aeNt0r6v.js +0 -1
- package/dist/PaymentProviderHost-BeHcCUZx.js +0 -1
- package/dist/PaymentProviderHost-Dph4wPYb.cjs +0 -1
- package/dist/ResourceImpl-DPkc_ob9.js +0 -1
- package/dist/ResourceImpl-yQJWLZDn.cjs +0 -1
- package/dist/diag-api-BepQpXrk.js +0 -1
- package/dist/diag-api-DsVI4ljU.cjs +0 -1
- package/dist/index-32QtQw41.cjs +0 -1
- package/dist/index-65-Yxkqs.cjs +0 -1
- package/dist/index-AAKj44J6.cjs +0 -1
- package/dist/index-AVWXcG-i.js +0 -1
- package/dist/index-BQf9Yax1.js +0 -1
- package/dist/index-Bs9yNhX-.js +0 -1
- package/dist/index-CS2Ktaql.cjs +0 -1
- package/dist/index-CwetZEW6.js +0 -1
- package/dist/index-_NPuwCXg.js +0 -1
- package/dist/index-iR-pnjyZ.cjs +0 -1
package/dist/index-AAKj44J6.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("@reduxjs/toolkit"),t=require("react-redux"),n=require("react"),r=require("react/jsx-runtime");var o=Symbol.for("immer-nothing"),s=Symbol.for("immer-draftable"),i=Symbol.for("immer-state"),a="production"!==process.env.NODE_ENV?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function c(e,...t){if("production"!==process.env.NODE_ENV){const n=a[e],r=C(n)?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var u=Object,d=u.getPrototypeOf,l="constructor",p="prototype",f="configurable",h="enumerable",g="writable",m="value",y=e=>!!e&&!!e[i];function v(e){return!!e&&(_(e)||A(e)||!!e[s]||!!e[l]?.[s]||F(e)||I(e))}var b=u[p][l].toString(),S=new WeakMap;function _(e){if(!e||!P(e))return!1;const t=d(e);if(null===t||t===u[p])return!0;const n=u.hasOwnProperty.call(t,l)&&t[l];if(n===Object)return!0;if(!C(n))return!1;let r=S.get(n);return void 0===r&&(r=Function.toString.call(n),S.set(n,r)),r===b}function w(e,t,n=!0){0===E(e)?(n?Reflect.ownKeys(e):u.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function E(e){const t=e[i];return t?t.type_:A(e)?1:F(e)?2:I(e)?3:0}var T=(e,t,n=E(e))=>2===n?e.has(t):u[p].hasOwnProperty.call(e,t),k=(e,t,n=E(e))=>2===n?e.get(t):e[t],x=(e,t,n,r=E(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n},A=Array.isArray,F=e=>e instanceof Map,I=e=>e instanceof Set,P=e=>"object"==typeof e,C=e=>"function"==typeof e,O=e=>"boolean"==typeof e,R=e=>e.copy_||e.base_,M=e=>e.modified_?e.copy_:e.base_;function N(e,t){if(F(e))return new Map(e);if(I(e))return new Set(e);if(A(e))return Array[p].slice.call(e);const n=_(e);if(!0===t||"class_only"===t&&!n){const t=u.getOwnPropertyDescriptors(e);delete t[i];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],s=t[o];!1===s[g]&&(s[g]=!0,s[f]=!0),(s.get||s.set)&&(t[o]={[f]:!0,[g]:!0,[h]:s[h],[m]:e[o]})}return u.create(d(e),t)}{const t=d(e);if(null!==t&&n)return{...e};const r=u.create(t);return u.assign(r,e)}}function D(e,t=!1){return j(e)||y(e)||!v(e)||(E(e)>1&&u.defineProperties(e,{set:q,add:q,clear:q,delete:q}),u.freeze(e),t&&w(e,(e,t)=>{D(t,!0)},!1)),e}var q={[m]:function(){c(2)}};function j(e){return null===e||!P(e)||u.isFrozen(e)}var Q="MapSet",B="Patches",z="ArrayMethods",$={};function U(e){const t=$[e];return t||c(0,e),t}var L,K=e=>!!$[e],V=()=>L;function W(e,t){t&&(e.patchPlugin_=U(B),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function H(e){G(e),e.drafts_.forEach(X),e.drafts_=null}function G(e){e===L&&(L=e.parent_)}var J=e=>L={drafts_:[],parent_:L,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:K(Q)?U(Q):void 0,arrayMethodsPlugin_:K(z)?U(z):void 0};function X(e){const t=e[i];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Y(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[i].modified_&&(H(t),c(4)),v(e)&&(e=Z(t,e));const{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[i].base_,e,t)}else e=Z(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&D(t,n)}(t,e,!0),H(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==o?e:void 0}function Z(e,t){if(j(t))return t;const n=t[i];if(!n)return se(t,e.handledSet_,e);if(!te(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);oe(n,e)}return n.copy_}function ee(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var te=(e,t)=>e.scope_===t,ne=[];function re(e,t,n,r){const o=R(e),s=e.type_;if(void 0!==r&&k(o,r,s)===t)return void x(o,r,n,s);if(!e.draftLocations_){const t=e.draftLocations_=new Map;w(o,(e,n)=>{if(y(n)){const r=t.get(n)||[];r.push(e),t.set(n,r)}})}const i=e.draftLocations_.get(t)??ne;for(const e of i)x(o,e,n,s)}function oe(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=t;if(n){const r=n.getPath(e);r&&n.generatePatches_(e,r,t)}ee(e)}}function se(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||y(e)||t.has(e)||!v(e)||j(e)||(t.add(e),w(e,(r,o)=>{if(y(o)){const t=o[i];if(te(t,n)){const n=M(t);x(e,r,n,e.type_),ee(t)}}else v(o)&&se(o,t,n)})),e}var ie={get(e,t){if(t===i)return e;let n=e.scope_.arrayMethodsPlugin_;const r=1===e.type_&&"string"==typeof t;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const o=R(e);if(!T(o,t,e.type_))return function(e,t,n){const r=ue(t,n);return r?m in r?r[m]:r.get?.call(e.draft_):void 0}(e,o,t);const s=o[t];if(e.finalized_||!v(s))return s;if(r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&function(e){const t=+e;return Number.isInteger(t)&&String(t)===e}(t))return s;if(s===ce(e.base_,t)){le(e);const n=1===e.type_?+t:t,r=pe(0,s,e,n);return e.copy_[n]=r}return s},has:(e,t)=>t in R(e),ownKeys:e=>Reflect.ownKeys(R(e)),set(e,t,n){const r=ue(R(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=ce(R(e),t),a=r?.[i];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(((o=n)===(s=r)?0!==o||1/o==1/s:o!=o&&s!=s)&&(void 0!==n||T(e.base_,t,e.type_)))return!0;le(e),de(e)}var o,s;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),function(e,t,n){const{scope_:r}=e;if(y(n)){const o=n[i];te(o,r)&&o.callbacks_.push(function(){le(e);const r=M(o);re(e,n,r,t)})}else v(n)&&e.callbacks_.push(function(){const o=R(e);3===e.type_?o.has(n)&&se(n,r.handledSet_,r):k(o,t,e.type_)===n&&r.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&se(k(e.copy_,t,e.type_),r.handledSet_,r)})}(e,t,n)),!0},deleteProperty:(e,t)=>(le(e),void 0!==ce(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),de(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=R(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[g]:!0,[f]:1!==e.type_||"length"!==t,[h]:r[h],[m]:n[t]}:r},defineProperty(){c(11)},getPrototypeOf:e=>d(e.base_),setPrototypeOf(){c(12)}},ae={};for(let e in ie){let t=ie[e];ae[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function ce(e,t){const n=e[i];return(n?R(n):e)[t]}function ue(e,t){if(!(t in e))return;let n=d(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=d(n)}}function de(e){e.modified_||(e.modified_=!0,e.parent_&&de(e.parent_))}function le(e){e.copy_||(e.assigned_=new Map,e.copy_=N(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function pe(e,t,n,r){const[o,s]=F(t)?U(Q).proxyMap_(t,n):I(t)?U(Q).proxySet_(t,n):function(e,t){const n=A(e),r={type_:n?1:0,scope_:t?t.scope_:V(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let o=r,s=ie;n&&(o=[r],s=ae);const{revoke:i,proxy:a}=Proxy.revocable(o,s);return r.draft_=a,r.revoke_=i,[a,r]}(t,n);return(n?.scope_??V()).drafts_.push(o),s.callbacks_=n?.callbacks_??[],s.key_=r,n&&void 0!==r?function(e,t,n){e.callbacks_.push(function(r){const o=t;if(!o||!te(o,r))return;r.mapSetPlugin_?.fixSetContents(o);const s=M(o);re(e,o.draft_??o,s,n),oe(o,r)})}(n,s,r):s.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(s);const{patchPlugin_:t}=e;s.modified_&&t&&t.generatePatches_(s,[],e)}),o}function fe(e){return y(e)||c(10,e),he(e)}function he(e){if(!v(e)||j(e))return e;const t=e[i];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=N(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=N(e,!0);return w(n,(e,t)=>{x(n,e,he(t))},r),t&&(t.finalized_=!1),n}ae.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&c(13),ae.set.call(this,e,t,void 0)},ae.set=function(e,t,n){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&c(14),ie.set.call(this,e[0],t,n,e[0])},new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(C(e)&&!C(t)){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,e=>t.call(this,e,...o))}}let r;if(C(t)||c(6),void 0===n||C(n)||c(7),v(e)){const o=J(this),s=pe(0,e,void 0);let i=!0;try{r=t(s),i=!1}finally{i?H(o):G(o)}return W(o,n),Y(r,o)}if(!e||!P(e)){if(r=t(e),void 0===r&&(r=e),r===o&&(r=void 0),this.autoFreeze_&&D(r,!0),n){const t=[],o=[];U(B).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:o}),n(t,o)}return r}c(1,e)},this.produceWithPatches=(e,t)=>{if(C(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},O(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),O(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),O(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){v(e)||c(8),y(e)&&(e=fe(e));const t=J(this),n=pe(0,e,void 0);return n[i].isManual_=!0,G(t),n}finishDraft(e,t){const n=e&&e[i];n&&n.isManual_||c(9);const{scope_:r}=n;return W(r,t),Y(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=U(B).applyPatches_;return y(e)?r(e,t):this.produce(e,e=>r(e,t))}},Error;var ge=(e,t,n)=>{if(1===t.length&&t[0]===n){let t=!1;try{const n={};e(n)===n&&(t=!0)}catch{}if(t){let e;try{throw new Error}catch(t){({stack:e}=t)}console.warn("The result function returned its own inputs without modification. e.g\n`createSelector([state => state.todos], todos => todos)`\nThis could lead to inefficient memoization and unnecessary re-renders.\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.",{stack:e})}}},me=(e,t,n)=>{const{memoize:r,memoizeOptions:o}=t,{inputSelectorResults:s,inputSelectorResultsCopy:i}=e,a=r(()=>({}),...o);if(a.apply(null,s)!==a.apply(null,i)){let e;try{throw new Error}catch(t){({stack:e}=t)}console.warn("An input selector returned a different result when passed same arguments.\nThis means your output selector will likely run more frequently than intended.\nAvoid returning a new reference inside your input selector, e.g.\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`",{arguments:n,firstInputs:s,secondInputs:i,stack:e})}},ye={inputStabilityCheck:"once",identityFunctionCheck:"once"},ve=e=>Array.isArray(e)?e:[e];function be(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}var Se="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function _e(){return{s:0,v:void 0,o:null,p:null}}function we(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:r}=t;let o,s=0;function i(){let t=n;const{length:i}=arguments;for(let e=0,n=i;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t=_e(),e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t=_e(),e.set(n,t)):t=r}}const a=t;let c;if(1===t.s)c=t.v;else if(c=e.apply(null,arguments),s++,r){const e=o?.deref?.()??o;null!=e&&r(e,c)&&(c=e,0!==s&&s--),o="object"==typeof c&&null!==c||"function"==typeof c?new Se(c):c}return a.s=1,a.v=c,c}return i.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function Ee(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,s={},i=e.pop();"object"==typeof i&&(s=i,i=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(i,`createSelector expects an output function after the inputs, but received: [${typeof i}]`);const a={...n,...s},{memoize:c,memoizeOptions:u=[],argsMemoize:d=we,argsMemoizeOptions:l=[],devModeChecks:p={}}=a,f=ve(u),h=ve(l),g=function(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){const n=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),m=c(function(){return r++,i.apply(null,arguments)},...f);let y=!0;const v=d(function(){o++;const e=be(g,arguments);if(t=m.apply(null,e),"production"!==process.env.NODE_ENV){const{identityFunctionCheck:n,inputStabilityCheck:r}=((e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...ye,...t};return{identityFunctionCheck:{shouldRun:"always"===n||"once"===n&&e,run:ge},inputStabilityCheck:{shouldRun:"always"===r||"once"===r&&e,run:me}}})(y,p);if(n.shouldRun&&n.run(i,e,t),r.shouldRun){const t=be(g,arguments);r.run({inputSelectorResults:e,inputSelectorResultsCopy:t},{memoize:c,memoizeOptions:f},arguments)}y&&(y=!1)}return t},...h);return Object.assign(v,{resultFunc:i,memoizedResultFunc:m,dependencies:g,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:c,argsMemoize:d})};return Object.assign(r,{withTypes:()=>r}),r}var Te=Ee(we),ke=Object.assign((e,t=Te)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>ke}),xe="__rtkq/",Ae="online",Fe="offline",Ie="focus",Pe="focused",Ce="visibilitychange",Oe=e.createAction(`${xe}${Pe}`),Re=e.createAction(`${xe}un${Pe}`),Me=e.createAction(`${xe}${Ae}`),Ne=e.createAction(`${xe}${Fe}`),De=!1;WeakMap,new Error("Promise never resolved before cacheEntryRemoved.");const qe="DEBUG",je="INFO",Qe="WARN",Be="ERROR";let ze=null,$e=null;const Ue=[];function Le(e,t){const n=$e?function(e){try{return e()??{}}catch{return{}}}($e):{},{message:r,...o}=t,s={...n,...o,level:e,message:r,timestamp:(new Date).toISOString()};ze?ze.emit(s):(Ue.length>=200&&Ue.shift(),Ue.push(s))}const Ke={debug(e){Le(qe,e)},info(e){Le(je,e)},warn(e){Le(Qe,e)},error(e){Le(Be,e)},flush:()=>ze?.flush?.()},Ve={[qe]:0,[je]:1,[Qe]:2,[Be]:3};function We(e={}){const t=Ve[e.minLevel??qe];return{emit(e){Ve[e.level]<t||(e.level===Be?console.error:e.level===Qe?console.warn:e.level===qe?console.debug:console.info)(e)}}}const He={[qe]:5,[je]:9,[Qe]:13,[Be]:17};function Ge(e){if(null===e)return"null";const t=typeof e;if("string"===t||"number"===t||"boolean"===t)return e;if(e instanceof Error)return JSON.stringify({name:e.name,message:e.message,stack:e.stack});try{return JSON.stringify(e)}catch{return String(e)}}function Je(e){const t={};for(const[n,r]of Object.entries(e))void 0!==r&&(t[n]=Ge(r));return t}let Xe=!1,Ye=null,Ze=!0;function et(e){Ze=e}Object.freeze(Object.defineProperty({__proto__:null,initLogger:function(e){Xe||(Xe=!0,function(e){$e=e}(function(e){const t={app_name:e.appName,app_version:e.appVersion,environment:e.environment};return()=>({...t,...e.getContext()})}(e)),function(e){if(ze=e,Ue.length>0){const t=Ue.splice(0,Ue.length);for(const n of t)e.emit(n)}}(function(e){const t=[We({minLevel:e.consoleMinLevel??(e.isDev?qe:Qe)})];if(e.otlpEndpoint&&!e.isDev){const n="otel"===(e.logTransport??"otel")?function(e){let t=!1,n=null,r=null;const o=[];function s(){r||(r=async function(){const[t,r,s,i]=await Promise.all([Promise.resolve().then(()=>require("./index-CS2Ktaql.cjs")),Promise.resolve().then(()=>require("./index-32QtQw41.cjs")),Promise.resolve().then(()=>require("./index-iR-pnjyZ.cjs")),Promise.resolve().then(()=>require("./index-65-Yxkqs.cjs"))]),a=i.resourceFromAttributes(e.resourceAttrs),c=new s.OTLPLogExporter({url:e.endpoint}),u=new r.LoggerProvider({resource:a,processors:[new r.BatchLogRecordProcessor(c)]});t.logs.setGlobalLoggerProvider(u);const d=t.logs.getLogger(e.resourceAttrs["service.name"]??"app");if(n={emit(e){const{level:t,message:n,timestamp:r,...o}=e;d.emit({severityNumber:He[t],severityText:t,body:JSON.stringify(e),attributes:Je(o),timestamp:new Date(r)})},async flush(){await u.forceFlush()}},o.length>0){const e=o.splice(0,o.length);for(const t of e)n.emit(t)}}().catch(()=>{o.length=0,n=null,t=!0}))}return{emit(e){t||(n?n.emit(e):(s(),o.length>=200&&o.shift(),o.push(e)))},async flush(){(r||n)&&(s(),await r,n&&await n.flush())}}}({endpoint:e.otlpEndpoint,resourceAttrs:{"service.name":e.appName,"service.version":e.appVersion,"deployment.environment":e.environment}}):function(e){const t=e.maxBatchSize??50,n=e.scheduledDelayMs??5e3,r=e.maxQueueSize??2048,o=e.wrapBatch??(e=>e),s=[];let i=null;function a(){return null!==i&&(clearTimeout(i),i=null),0===s.length||0===(t=s.splice(0,s.length)).length?Promise.resolve():fetch(e.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o(t)),keepalive:!0}).then(()=>{}).catch(()=>{});var t}return{emit(e){s.length>=r&&s.shift(),s.push(e),s.length>=t?a():null===i&&(i=setTimeout(()=>{i=null,a()},n))},async flush(){await a()}}}({endpoint:e.otlpEndpoint});t.push({emit(e){Ze&&n.emit(e)},flush:n.flush.bind(n)})}return e.extraSinks?.length&&t.push(...e.extraSinks),1===t.length?t[0]:function(e){return{emit(t){for(const n of e)try{n.emit(t)}catch{}},async flush(){await Promise.all(e.map(e=>e.flush?Promise.resolve(e.flush()).catch(()=>{}):Promise.resolve()))}}}(t)}(e)),!1!==e.flushOnAppHide&&Ye?.())},registerPlatformFlushAttacher:function(e){Ye=e},resetInitLoggerStateForTests:function(){Xe=!1,Ye=null,Ze=!0},setNetworkLoggingEnabled:et},Symbol.toStringTag,{value:"Module"}));let tt,nt="",rt={},ot=null,st=()=>null,it=()=>null;const at=()=>nt,ct=()=>rt,ut=()=>ot,dt=e=>{st=e},lt=e=>{it=e},pt=e=>{const t=e.startsWith("/")?e:`/${e}`;return`${nt}/api${t}`},ft={CONVERSATIONS:()=>pt("/conversations"),CONVERSATION_STREAM:e=>pt(`/conversations/${e}`),CONVERSATION_START:e=>pt(`/conversations/${e}/start`),get TRANSCRIBE(){return pt("/transcribe")},get BRANDING(){return pt("/branding")},get CONFIG(){return pt("/config")},get PROFILE(){return pt("/profile")},get AUTH_ME(){return pt("/auth/me")},get ORGANIZATIONS_EXISTS(){return pt("/organizations/exists")},get DEBUG(){return pt("/debug")},get TOOL_SERVERS(){return pt("/tool-servers")},TOOL_SERVER_AUTH_START:e=>pt(`/tool-servers/${e}/auth/start`),TOOL_SERVER_AUTH_CONNECTION:e=>pt(`/tool-servers/${e}/auth/connection`),get TOOL_SERVERS_SIGN_IN_EXCHANGE(){return pt("/tool-servers/auth/exchange")},get LOG(){return pt("/log")}},ht="accessToken",gt="refreshToken",mt="tokenExpiresAt",yt="user",vt="1interface_appearance_mode",bt="1interface_location_enabled",St="1interface_debug_mode",_t="1interface_stt_auto_send",wt="1interface_stt_implementation",Et="1interface_send_diagnostics",Tt="online",kt=e=>e?`${vt}:${e}`:vt,xt=(e="Please try again")=>function(e){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("bridge-toast",{detail:e}))}({title:"Error",description:e,variant:"destructive"}),At=e=>!!e&&Date.now()>=e-3e4,Ft=e=>!e||Date.now()>=e-6e5,It=e=>e?Math.max(0,e-Date.now()):0,Pt=e=>{const t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return t>0?`${t}m ${n}s`:`${n}s`},Ct="light",Ot="dark",Rt="system",Mt="pill",Nt="sharp",Dt={bgColor:"linear-gradient(281.8deg, #061522 6.7%, #101F2F 59.64%, #3C3B4F 76.85%, #5D4C63 88.46%, #755770 99.24%)",inputBgColor:"#222D34",sidebarBg:"#0F1419",sidebarBorderColor:"#8F8F8F",widgetBg:"#222D34",settingsGroupBg:"#272626",inputBorderStyle:"solid",inputBorderColor:"#FFFFFF80",inputBorderWidth:"1px",inputBorderOpacity:50,widgetBorderStyle:"solid",widgetBorderColor:"#FFFFFF1A",widgetBorderWidth:"1px",widgetBorderOpacity:10,placeholderColor:"#8F8F8F",primaryText:"#FFFFFF",secondaryText:"#AFAFAF",tertiaryText:"#8F8F8F",userMsgBg:"#90629F",userMsgText:"#FFFFFF",userMsgBorderStyle:"none",userMsgBorderColor:"#FFFFFFFF",userMsgBorderWidth:"1px",userMsgBorderOpacity:100,sideMenuHeadings:"#FFFFFF",sideMenuText:"#AFAFAF",sideMenuIcon:"#8F8F8F",sideMenuProfile:"#FFFFFF",statusPrimary:{solid:"#90629F",background:"#90629F",text:"#FFFFFF"},statusSecondary:{solid:"#5D5D5D",background:"#F3F3F3",text:"#0D0D0D"},statusSuccess:{solid:"#00A240",background:"#D9F4E4",text:"#FFFFFF"},statusDanger:{solid:"#E02E2A",background:"#FFD9D9",text:"#FFFFFF"},statusWarning:{solid:"#E25507",background:"#FFE7D9",text:"#FFFFFF"},statusInfo:{solid:"#0285FF",background:"#E5F3FF",text:"#FFFFFF"},statusDiscovery:{solid:"#924FF7",background:"#EFE5FE",text:"#FFFFFF"},switchCheckedColor:"#90629F",switchUncheckedColor:"#222D34",fontFamily:"'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif",fontFamilyMono:'"SF Mono", ui-monospace, monospace',fontSize:14,borderRadius:16,cornerRadiusMode:Mt,chatInputPlaceholder:"Type anything..."},qt={bgColor:"linear-gradient(281.8deg, #EEF2FF 6.7%, #E2E8FD 59.64%, #E8DFF4 76.85%, #F4DBE6 88.46%, #FFE1D0 99.24%)",inputBgColor:"#F4F4F5",sidebarBg:"#FFFFFF",sidebarBorderColor:"#9B9B9B",widgetBg:"#FFFFFF",settingsGroupBg:"#1A1A1A10",inputBorderStyle:"solid",inputBorderColor:"#0000001A",inputBorderWidth:"1px",inputBorderOpacity:10,widgetBorderStyle:"solid",widgetBorderColor:"#0000001A",widgetBorderWidth:"1px",widgetBorderOpacity:10,placeholderColor:"#9B9B9B",primaryText:"#1A1A1A",secondaryText:"#6B6B6B",tertiaryText:"#9B9B9B",userMsgBg:"#90629F",userMsgText:"#FFFFFF",userMsgBorderStyle:"none",userMsgBorderColor:"#000000FF",userMsgBorderWidth:"1px",userMsgBorderOpacity:100,sideMenuHeadings:"#1A1A1A",sideMenuText:"#6B6B6B",sideMenuIcon:"#9B9B9B",sideMenuProfile:"#1A1A1A",statusPrimary:{solid:"#90629F",background:"#90629F",text:"#FFFFFF"},statusSecondary:{solid:"#5D5D5D",background:"#F3F3F3",text:"#0D0D0D"},statusSuccess:{solid:"#00A240",background:"#D9F4E4",text:"#FFFFFF"},statusDanger:{solid:"#E02E2A",background:"#FFD9D9",text:"#FFFFFF"},statusWarning:{solid:"#E25507",background:"#FFE7D9",text:"#FFFFFF"},statusInfo:{solid:"#0285FF",background:"#E5F3FF",text:"#FFFFFF"},statusDiscovery:{solid:"#924FF7",background:"#EFE5FE",text:"#FFFFFF"},switchCheckedColor:"#90629F",switchUncheckedColor:"#F4F4F5",fontFamily:"'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif",fontFamilyMono:'"SF Mono", ui-monospace, monospace',fontSize:14,borderRadius:16,cornerRadiusMode:Mt,chatInputPlaceholder:"Type anything..."};function jt(e,t){const n=e.replace("#","");let r;r=3===n.length?n.split("").map(e=>e+e).join(""):6===n.length?n:"000000";const o=Math.max(0,Math.min(100,t));return`#${r}${Math.round(o/100*255).toString(16).padStart(2,"0")}`.toUpperCase()}function Qt(e,t){if(!e)return t.fontFamily;switch(e){case"Inter":return"'Inter', sans-serif";case"System":return"system-ui, -apple-system, sans-serif";default:return"'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif"}}function Bt(e,t){return e?`"${e}", ui-monospace, monospace`:t.fontFamilyMono}function zt(e,t){if(!e)return t.borderRadius;switch(e){case"none":return 0;case"sm":return 8;case"md":return 12;case"pill":return 16;default:const n=parseInt(e,10);return isNaN(n)?t.borderRadius:n}}function $t(e){switch(e){case"pill":return Mt;case"none":return Nt;default:return 0===parseInt(e??"",10)?Nt:"rounded"}}const Ut=n.createContext(void 0),Lt=n.createContext(null),Kt=()=>{const e=n.useContext(Lt);if(!e)throw new Error("useStorage must be called inside a <StorageProvider>. Wrap your app's root with <StorageProvider value={browserLocalStorageAdapter}> (or an RN equivalent).");return e};let Vt=null;const Wt=()=>Vt,Ht=n.createContext(null),Gt=e.createSlice({name:"auth",initialState:{user:null,accessToken:null,refreshToken:null,tokenExpiresAt:null,selectedOrgId:null,isAuthenticated:!1,isLoading:!1},reducers:{setSession:(e,t)=>{const{user:n,accessToken:r,refreshToken:o,expiresIn:s}=t.payload;void 0!==n&&(e.user=n),void 0!==r&&(e.accessToken=r),void 0!==o&&(e.refreshToken=o),void 0!==s?e.tokenExpiresAt=null===s?null:1e3*s:r&&(e.tokenExpiresAt=Date.now()+36e5),e.isAuthenticated=Boolean(e.accessToken),e.isLoading=!1},updateUser:(e,t)=>{e.user={...e.user||{},...t.payload}},clearSession:e=>{e.user=null,e.accessToken=null,e.refreshToken=null,e.tokenExpiresAt=null,e.isAuthenticated=!1,e.isLoading=!1},sessionExpired:e=>{e.user=null,e.accessToken=null,e.refreshToken=null,e.tokenExpiresAt=null,e.isAuthenticated=!1,e.isLoading=!1},setSelectedOrgId:(e,t)=>{e.selectedOrgId=t.payload??null}}}),{setSession:Jt,updateUser:Xt,clearSession:Yt,sessionExpired:Zt}=Gt.actions,en=e=>async t=>{const[n,r,o,s]=await Promise.all([e.getItem(ht),e.getItem(gt),e.getItem(mt),e.getItem(yt)]),i=o?parseInt(o,10):null;if((!n||!i||At(i))&&!r)return void(n&&await Promise.all([e.removeItem(ht),e.removeItem(gt),e.removeItem(mt),e.removeItem(yt)]));let a=null;if(s)try{a=JSON.parse(s)}catch(e){Ke.error({message:"Failed to parse stored user during session hydration",component:"sessionSlice",error_message:e instanceof Error?e.message:String(e)})}t(Jt({user:a,accessToken:n,refreshToken:r,expiresIn:null!=i?i/1e3:null}))},tn=e.createListenerMiddleware();tn.startListening({matcher:e.isAnyOf(Jt,Xt,Yt,Zt),effect:async(e,t)=>{const n=Wt();if(!n)return;const{auth:r}=t.getState(),o=[];o.push(r.accessToken?n.setItem(ht,r.accessToken):n.removeItem(ht)),o.push(r.refreshToken?n.setItem(gt,r.refreshToken):n.removeItem(gt)),o.push(null!=r.tokenExpiresAt?n.setItem(mt,String(r.tokenExpiresAt)):n.removeItem(mt)),o.push(r.user?n.setItem(yt,JSON.stringify(r.user)):n.removeItem(yt)),(Yt.match(e)||Zt.match(e))&&o.push(n.removeItem("1interface_cached_location"),n.removeItem(St),n.removeItem(vt),n.removeItem(bt),n.removeItem(_t),n.removeItem(wt),n.removeItem(Et),n.removeItem("1interface_active_conversation_id")),await Promise.all(o)}});const nn=Gt.reducer,rn={lastResponseTime:null},on=e.createSlice({name:"indicator",initialState:rn,reducers:{setLastResponseTime(e,t){e.lastResponseTime=t.payload},clearLastResponseTime(e){e.lastResponseTime=null}},extraReducers:t=>{t.addMatcher(e.isAnyOf(Yt,Zt),()=>rn)}}),sn=on.reducer,an="text/event-stream",cn="last-event-id";function un(e,t){var{signal:n,headers:r,onopen:o,onmessage:s,onclose:i,onerror:a,openWhenHidden:c,fetch:u}=t,d=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((t,l)=>{const p=Object.assign({},r);let f;function h(){f.abort(),document.hidden||S()}p.accept||(p.accept=an),c||document.addEventListener("visibilitychange",h);let g=1e3,m=0;function y(){document.removeEventListener("visibilitychange",h),window.clearTimeout(m),f.abort()}null==n||n.addEventListener("abort",()=>{y(),t()});const v=null!=u?u:window.fetch,b=null!=o?o:dn;async function S(){var n;f=new AbortController;try{const n=await v(e,Object.assign(Object.assign({},d),{headers:p,signal:f.signal}));await b(n),await async function(e,t){const n=e.getReader();let r;for(;!(r=await n.read()).done;)t(r.value)}(n.body,function(e){let t,n,r,o=!1;return function(s){void 0===t?(t=s,n=0,r=-1):t=function(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(t,s);const i=t.length;let a=0;for(;n<i;){o&&(10===t[n]&&(a=++n),o=!1);let s=-1;for(;n<i&&-1===s;++n)switch(t[n]){case 58:-1===r&&(r=n-a);break;case 13:o=!0;case 10:s=n}if(-1===s)break;e(t.subarray(a,s),r),a=n,r=-1}a===i?t=void 0:0!==a&&(t=t.subarray(a),n-=a)}}(function(e,t,n){let r={data:"",event:"",id:"",retry:void 0};const o=new TextDecoder;return function(e,t){if(0===e.length)null==n||n(r),r={data:"",event:"",id:"",retry:void 0};else if(t>0){const n=o.decode(e.subarray(0,t)),i=o.decode(e.subarray(t+(32===e[t+1]?2:1)));switch(n){case"data":r.data=r.data?r.data+"\n"+i:i;break;case"event":r.event=i;break;case"id":(s=r.id=i)?p[cn]=s:delete p[cn];break;case"retry":const e=parseInt(i,10);isNaN(e)||(e=>{g=e})(r.retry=e)}}var s}}(0,0,s))),null==i||i(),y(),t()}catch(e){if(!f.signal.aborted)try{const t=null!==(n=null==a?void 0:a(e))&&void 0!==n?n:g;window.clearTimeout(m),m=window.setTimeout(S,t)}catch(e){y(),l(e)}}}S()})}function dn(e){const t=e.headers.get("content-type");if(!(null==t?void 0:t.startsWith(an)))throw new Error(`Expected content-type to be ${an}, Actual: ${t}`)}var ln=Symbol.for("immer-nothing"),pn=Symbol.for("immer-draftable"),fn=Symbol.for("immer-state"),hn="production"!==process.env.NODE_ENV?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function gn(e,...t){if("production"!==process.env.NODE_ENV){const n=hn[e],r=jn(n)?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var mn=Object,yn=mn.getPrototypeOf,vn="constructor",bn="prototype",Sn="configurable",_n="enumerable",wn="writable",En="value",Tn=e=>!!e&&!!e[fn];function kn(e){return!!e&&(Fn(e)||Mn(e)||!!e[pn]||!!e[vn]?.[pn]||Nn(e)||Dn(e))}var xn=mn[bn][vn].toString(),An=new WeakMap;function Fn(e){if(!e||!qn(e))return!1;const t=yn(e);if(null===t||t===mn[bn])return!0;const n=mn.hasOwnProperty.call(t,vn)&&t[vn];if(n===Object)return!0;if(!jn(n))return!1;let r=An.get(n);return void 0===r&&(r=Function.toString.call(n),An.set(n,r)),r===xn}function In(e,t,n=!0){0===Pn(e)?(n?Reflect.ownKeys(e):mn.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Pn(e){const t=e[fn];return t?t.type_:Mn(e)?1:Nn(e)?2:Dn(e)?3:0}var Cn=(e,t,n=Pn(e))=>2===n?e.has(t):mn[bn].hasOwnProperty.call(e,t),On=(e,t,n=Pn(e))=>2===n?e.get(t):e[t],Rn=(e,t,n,r=Pn(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n},Mn=Array.isArray,Nn=e=>e instanceof Map,Dn=e=>e instanceof Set,qn=e=>"object"==typeof e,jn=e=>"function"==typeof e,Qn=e=>"boolean"==typeof e,Bn=e=>e.copy_||e.base_,zn=e=>e.modified_?e.copy_:e.base_;function $n(e,t){if(Nn(e))return new Map(e);if(Dn(e))return new Set(e);if(Mn(e))return Array[bn].slice.call(e);const n=Fn(e);if(!0===t||"class_only"===t&&!n){const t=mn.getOwnPropertyDescriptors(e);delete t[fn];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],s=t[o];!1===s[wn]&&(s[wn]=!0,s[Sn]=!0),(s.get||s.set)&&(t[o]={[Sn]:!0,[wn]:!0,[_n]:s[_n],[En]:e[o]})}return mn.create(yn(e),t)}{const t=yn(e);if(null!==t&&n)return{...e};const r=mn.create(t);return mn.assign(r,e)}}function Un(e,t=!1){return Kn(e)||Tn(e)||!kn(e)||(Pn(e)>1&&mn.defineProperties(e,{set:Ln,add:Ln,clear:Ln,delete:Ln}),mn.freeze(e),t&&In(e,(e,t)=>{Un(t,!0)},!1)),e}var Ln={[En]:function(){gn(2)}};function Kn(e){return null===e||!qn(e)||mn.isFrozen(e)}var Vn="MapSet",Wn="Patches",Hn="ArrayMethods",Gn={};function Jn(e){const t=Gn[e];return t||gn(0,e),t}var Xn,Yn=e=>!!Gn[e],Zn=()=>Xn;function er(e,t){t&&(e.patchPlugin_=Jn(Wn),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function tr(e){nr(e),e.drafts_.forEach(or),e.drafts_=null}function nr(e){e===Xn&&(Xn=e.parent_)}var rr=e=>Xn={drafts_:[],parent_:Xn,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Yn(Vn)?Jn(Vn):void 0,arrayMethodsPlugin_:Yn(Hn)?Jn(Hn):void 0};function or(e){const t=e[fn];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function sr(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[fn].modified_&&(tr(t),gn(4)),kn(e)&&(e=ir(t,e));const{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[fn].base_,e,t)}else e=ir(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Un(t,n)}(t,e,!0),tr(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ln?e:void 0}function ir(e,t){if(Kn(t))return t;const n=t[fn];if(!n)return pr(t,e.handledSet_,e);if(!cr(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);lr(n,e)}return n.copy_}function ar(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var cr=(e,t)=>e.scope_===t,ur=[];function dr(e,t,n,r){const o=Bn(e),s=e.type_;if(void 0!==r&&On(o,r,s)===t)return void Rn(o,r,n,s);if(!e.draftLocations_){const t=e.draftLocations_=new Map;In(o,(e,n)=>{if(Tn(n)){const r=t.get(n)||[];r.push(e),t.set(n,r)}})}const i=e.draftLocations_.get(t)??ur;for(const e of i)Rn(o,e,n,s)}function lr(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=t;if(n){const r=n.getPath(e);r&&n.generatePatches_(e,r,t)}ar(e)}}function pr(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Tn(e)||t.has(e)||!kn(e)||Kn(e)||(t.add(e),In(e,(r,o)=>{if(Tn(o)){const t=o[fn];if(cr(t,n)){const n=zn(t);Rn(e,r,n,e.type_),ar(t)}}else kn(o)&&pr(o,t,n)})),e}var fr={get(e,t){if(t===fn)return e;let n=e.scope_.arrayMethodsPlugin_;const r=1===e.type_&&"string"==typeof t;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const o=Bn(e);if(!Cn(o,t,e.type_))return function(e,t,n){const r=mr(t,n);return r?En in r?r[En]:r.get?.call(e.draft_):void 0}(e,o,t);const s=o[t];if(e.finalized_||!kn(s))return s;if(r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&function(e){const t=+e;return Number.isInteger(t)&&String(t)===e}(t))return s;if(s===gr(e.base_,t)){vr(e);const n=1===e.type_?+t:t,r=br(0,s,e,n);return e.copy_[n]=r}return s},has:(e,t)=>t in Bn(e),ownKeys:e=>Reflect.ownKeys(Bn(e)),set(e,t,n){const r=mr(Bn(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=gr(Bn(e),t),i=r?.[fn];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(((o=n)===(s=r)?0!==o||1/o==1/s:o!=o&&s!=s)&&(void 0!==n||Cn(e.base_,t,e.type_)))return!0;vr(e),yr(e)}var o,s;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),function(e,t,n){const{scope_:r}=e;if(Tn(n)){const o=n[fn];cr(o,r)&&o.callbacks_.push(function(){vr(e);const r=zn(o);dr(e,n,r,t)})}else kn(n)&&e.callbacks_.push(function(){const o=Bn(e);3===e.type_?o.has(n)&&pr(n,r.handledSet_,r):On(o,t,e.type_)===n&&r.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&pr(On(e.copy_,t,e.type_),r.handledSet_,r)})}(e,t,n)),!0},deleteProperty:(e,t)=>(vr(e),void 0!==gr(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),yr(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Bn(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[wn]:!0,[Sn]:1!==e.type_||"length"!==t,[_n]:r[_n],[En]:n[t]}:r},defineProperty(){gn(11)},getPrototypeOf:e=>yn(e.base_),setPrototypeOf(){gn(12)}},hr={};for(let e in fr){let t=fr[e];hr[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function gr(e,t){const n=e[fn];return(n?Bn(n):e)[t]}function mr(e,t){if(!(t in e))return;let n=yn(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=yn(n)}}function yr(e){e.modified_||(e.modified_=!0,e.parent_&&yr(e.parent_))}function vr(e){e.copy_||(e.assigned_=new Map,e.copy_=$n(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function br(e,t,n,r){const[o,s]=Nn(t)?Jn(Vn).proxyMap_(t,n):Dn(t)?Jn(Vn).proxySet_(t,n):function(e,t){const n=Mn(e),r={type_:n?1:0,scope_:t?t.scope_:Zn(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let o=r,s=fr;n&&(o=[r],s=hr);const{revoke:i,proxy:a}=Proxy.revocable(o,s);return r.draft_=a,r.revoke_=i,[a,r]}(t,n);return(n?.scope_??Zn()).drafts_.push(o),s.callbacks_=n?.callbacks_??[],s.key_=r,n&&void 0!==r?(a=s,c=r,(i=n).callbacks_.push(function(e){const t=a;if(!t||!cr(t,e))return;e.mapSetPlugin_?.fixSetContents(t);const n=zn(t);dr(i,t.draft_??t,n,c),lr(t,e)})):s.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(s);const{patchPlugin_:t}=e;s.modified_&&t&&t.generatePatches_(s,[],e)}),o;var i,a,c}function Sr(e){return Tn(e)||gn(10,e),_r(e)}function _r(e){if(!kn(e)||Kn(e))return e;const t=e[fn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=$n(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=$n(e,!0);return In(n,(e,t)=>{Rn(n,e,_r(t))},r),t&&(t.finalized_=!1),n}hr.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&gn(13),hr.set.call(this,e,t,void 0)},hr.set=function(e,t,n){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&gn(14),fr.set.call(this,e[0],t,n,e[0])};var wr=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(jn(e)&&!jn(t)){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,e=>t.call(this,e,...o))}}let r;if(jn(t)||gn(6),void 0===n||jn(n)||gn(7),kn(e)){const o=rr(this),s=br(0,e,void 0);let i=!0;try{r=t(s),i=!1}finally{i?tr(o):nr(o)}return er(o,n),sr(r,o)}if(!e||!qn(e)){if(r=t(e),void 0===r&&(r=e),r===ln&&(r=void 0),this.autoFreeze_&&Un(r,!0),n){const t=[],o=[];Jn(Wn).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:o}),n(t,o)}return r}gn(1,e)},this.produceWithPatches=(e,t)=>{if(jn(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},Qn(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Qn(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Qn(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){kn(e)||gn(8),Tn(e)&&(e=Sr(e));const t=rr(this),n=br(0,e,void 0);return n[fn].isManual_=!0,nr(t),n}finishDraft(e,t){const n=e&&e[fn];n&&n.isManual_||gn(9);const{scope_:r}=n;return er(r,t),sr(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Jn(Wn).applyPatches_;return Tn(e)?r(e,t):this.produce(e,e=>r(e,t))}},Er=wr.produceWithPatches.bind(wr),Tr=wr.applyPatches.bind(wr),kr=class extends Error{issues;constructor(e){super(e[0].message),this.name="SchemaError",this.issues=e}},xr=(e,t,n)=>{if(1===t.length&&t[0]===n){let t=!1;try{const n={};e(n)===n&&(t=!0)}catch{}if(t){let e;try{throw new Error}catch(t){({stack:e}=t)}console.warn("The result function returned its own inputs without modification. e.g\n`createSelector([state => state.todos], todos => todos)`\nThis could lead to inefficient memoization and unnecessary re-renders.\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.",{stack:e})}}},Ar=(e,t,n)=>{const{memoize:r,memoizeOptions:o}=t,{inputSelectorResults:s,inputSelectorResultsCopy:i}=e,a=r(()=>({}),...o);if(a.apply(null,s)!==a.apply(null,i)){let e;try{throw new Error}catch(t){({stack:e}=t)}console.warn("An input selector returned a different result when passed same arguments.\nThis means your output selector will likely run more frequently than intended.\nAvoid returning a new reference inside your input selector, e.g.\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`",{arguments:n,firstInputs:s,secondInputs:i,stack:e})}},Fr={inputStabilityCheck:"once",identityFunctionCheck:"once"},Ir=e=>Array.isArray(e)?e:[e];function Pr(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}var Cr="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function Or(){return{s:0,v:void 0,o:null,p:null}}function Rr(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:r}=t;let o,s=0;function i(){let t=n;const{length:i}=arguments;for(let e=0,n=i;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t=Or(),e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t=Or(),e.set(n,t)):t=r}}const a=t;let c;if(1===t.s)c=t.v;else if(c=e.apply(null,arguments),s++,r){const e=o?.deref?.()??o;null!=e&&r(e,c)&&(c=e,0!==s&&s--),o="object"==typeof c&&null!==c||"function"==typeof c?new Cr(c):c}return a.s=1,a.v=c,c}return i.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}var Mr,Nr=function(){const e="function"==typeof Rr?{memoize:Rr,memoizeOptions:[]}:Rr,t=(...t)=>{let n,r=0,o=0,s={},i=t.pop();"object"==typeof i&&(s=i,i=t.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(i,`createSelector expects an output function after the inputs, but received: [${typeof i}]`);const a={...e,...s},{memoize:c,memoizeOptions:u=[],argsMemoize:d=Rr,argsMemoizeOptions:l=[],devModeChecks:p={}}=a,f=Ir(u),h=Ir(l),g=function(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){const n=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(t),m=c(function(){return r++,i.apply(null,arguments)},...f);let y=!0;const v=d(function(){o++;const e=Pr(g,arguments);if(n=m.apply(null,e),"production"!==process.env.NODE_ENV){const{identityFunctionCheck:t,inputStabilityCheck:r}=((e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...Fr,...t};return{identityFunctionCheck:{shouldRun:"always"===n||"once"===n&&e,run:xr},inputStabilityCheck:{shouldRun:"always"===r||"once"===r&&e,run:Ar}}})(y,p);if(t.shouldRun&&t.run(i,e,n),r.shouldRun){const t=Pr(g,arguments);r.run({inputSelectorResults:e,inputSelectorResultsCopy:t},{memoize:c,memoizeOptions:f},arguments)}y&&(y=!1)}return n},...h);return Object.assign(v,{resultFunc:i,memoizedResultFunc:m,dependencies:g,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>n,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:c,argsMemoize:d})};return Object.assign(t,{withTypes:()=>t}),t}(),Dr=Object.assign((e,t=Nr)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>Dr}),qr=((Mr=qr||{}).uninitialized="uninitialized",Mr.pending="pending",Mr.fulfilled="fulfilled",Mr.rejected="rejected",Mr),jr="uninitialized",Qr="pending",Br="fulfilled",zr="rejected";function $r(e){return{status:e,isUninitialized:e===jr,isLoading:e===Qr,isSuccess:e===Br,isError:e===zr}}var Ur=e.isPlainObject;function Lr(e,t){if(e===t||!(Ur(e)&&Ur(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),r=Object.keys(e);let o=n.length===r.length;const s=Array.isArray(t)?[]:{};for(const r of n)s[r]=Lr(e[r],t[r]),o&&(o=e[r]===s[r]);return o?e:s}function Kr(e,t,n){return e.reduce((e,r,o)=>(t(r,o)&&e.push(n(r,o)),e),[]).flat()}function Vr(e){return null!=e}function Wr(e){return[...e?.values()??[]].filter(Vr)}function Hr(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var Gr=()=>new Map,Jr=e=>{const t=new AbortController;return setTimeout(()=>{const e="signal timed out",n="TimeoutError";t.abort("undefined"!=typeof DOMException?new DOMException(e,n):Object.assign(new Error(e),{name:n}))},e),t.signal},Xr=(...e)=>{for(const t of e)if(t.aborted)return AbortSignal.abort(t.reason);const t=new AbortController;for(const n of e)n.addEventListener("abort",()=>t.abort(n.reason),{signal:t.signal,once:!0});return t.signal},Yr=(...e)=>fetch(...e),Zr=e=>e.status>=200&&e.status<=299,eo=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function to(t){if(!e.isPlainObject(t))return t;const n={...t};for(const[e,t]of Object.entries(n))void 0===t&&delete n[e];return n}var no=class{constructor(e,t=void 0){this.value=e,this.meta=t}},ro="__rtkq/",oo="online",so="offline",io="focus",ao="focused",co="visibilitychange",uo=e.createAction(`${ro}${ao}`),lo=e.createAction(`${ro}un${ao}`),po=e.createAction(`${ro}${oo}`),fo=e.createAction(`${ro}${so}`),ho=!1,go="query",mo="mutation",yo="infinitequery";function vo(e){return e.type===go}function bo(e){return e.type===yo}function So(e){return vo(e)||bo(e)}function _o(e,t,n,r,o,s){const i="function"==typeof e?e(t,n,r,o):e;return i?Kr(i,Vr,e=>s(wo(e))):[]}function wo(e){return"string"==typeof e?{type:e}:e}var Eo=(e,t)=>e.endpointDefinitions[t],To=Symbol("forceQueryFn"),ko=e=>"function"==typeof e[To],xo=class extends kr{constructor(e,t,n,r){super(e),this.value=t,this.schemaName=n,this._bqMeta=r}},Ao=(e,t)=>Array.isArray(e)?e.includes(t):!!e;async function Fo(e,t,n,r){const o=await e["~standard"].validate(t);if(o.issues)throw new xo(o.issues,t,n,r);return o.value}function Io(e){return e}var Po=(t={})=>({...t,[e.SHOULD_AUTOBATCH]:!0});function Co(e,{pages:t,pageParams:n},r){const o=t.length-1;return e.getNextPageParam(t[o],t,n[o],n,r)}function Oo(e,{pages:t,pageParams:n},r){return e.getPreviousPageParam?.(t[0],t,n[0],n,r)}function Ro(t,n,r,o){return _o(r[t.meta.arg.endpointName][n],e.isFulfilled(t)?t.payload:void 0,e.isRejectedWithValue(t)?t.payload:void 0,t.meta.arg.originalArgs,"baseQueryMeta"in t.meta?t.meta.baseQueryMeta:void 0,o)}function Mo(e){return Tn(e)?Sr(e):e}function No(e,t,n){const r=e[t];r&&n(r)}function Do(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function qo(e,t,n){const r=e[Do(t)];r&&n(r)}var jo={},Qo=Symbol.for("RTKQ/skipToken"),Bo={status:jr},zo=e.createNextState(Bo,()=>{}),$o=e.createNextState(Bo,()=>{}),Uo=WeakMap?new WeakMap:void 0,Lo=({endpointName:t,queryArgs:n})=>{let r="";const o=Uo?.get(n);if("string"==typeof o)r=o;else{const t=JSON.stringify(n,(t,n)=>(n="bigint"==typeof n?{$bigint:n.toString()}:n,n=e.isPlainObject(n)?Object.keys(n).sort().reduce((e,t)=>(e[t]=n[t],e),{}):n));e.isPlainObject(n)&&Uo?.set(n,t),r=t}return`${t}(${r})`};function Ko(e,...t){return Object.assign(e,...t)}var Vo=({api:t,queryThunk:n,context:r,internalState:o,selectors:{selectQueryEntry:s,selectConfig:i},getRunningQueryThunk:a})=>{const{removeQueryResult:c,unsubscribeQueryResult:u,cacheEntriesUpserted:d}=t.internalActions,l=e.isAnyOf(u.match,n.fulfilled,n.rejected,d.match);function p(e){const t=o.currentSubscriptions.get(e);return!!t&&t.size>0}const f={};function h(e){for(const t of e.values())t?.abort?.()}function g(e,t,n){const r=t.getState();for(const o of e){const e=s(r,o);e?.endpointName&&m(o,e.endpointName,t,n)}}function m(e,t,n,o){const i=Eo(r,t),u=i?.keepUnusedDataFor??o.keepUnusedDataFor;if(u===1/0)return;const d=Math.max(0,Math.min(u,2147482.647));if(!p(e)){const t=f[e];t&&clearTimeout(t),f[e]=setTimeout(()=>{if(!p(e)){const t=s(n.getState(),e);if(t?.endpointName){const e=n.dispatch(a(t.endpointName,t.originalArgs));e?.abort()}n.dispatch(c({queryCacheKey:e}))}delete f[e]},1e3*d)}}return(e,n)=>{const s=n.getState(),a=i(s);if(l(e)){let t;if(d.match(e))t=e.payload.map(e=>e.queryDescription.queryCacheKey);else{const{queryCacheKey:n}=u.match(e)?e.payload:e.meta.arg;t=[n]}g(t,n,a)}if(t.util.resetApiState.match(e)){for(const[e,t]of Object.entries(f))t&&clearTimeout(t),delete f[e];h(o.runningQueries),h(o.runningMutations)}if(r.hasRehydrationInfo(e)){const{queries:t}=r.extractRehydrationInfo(e);g(Object.keys(t),n,a)}}},Wo=new Error("Promise never resolved before cacheEntryRemoved."),Ho=({api:t,reducerPath:n,context:r,queryThunk:o,mutationThunk:s,selectors:{selectQueryEntry:i}})=>{const a=e.isAsyncThunkAction(o),c=e.isAsyncThunkAction(s),u=e.isFulfilled(o,s),d={},{removeQueryResult:l,removeMutationResult:p,cacheEntriesUpserted:f}=t.internalActions;function h(e,t,n){const r=d[e];r?.valueResolved&&(r.valueResolved({data:t,meta:n}),delete r.valueResolved)}function g(e){const t=d[e];t&&(delete d[e],t.cacheEntryRemoved())}function m(e){const{arg:t,requestId:n}=e.meta,{endpointName:r,originalArgs:o}=t;return[r,o,n]}function y(e,n,o,s,i){const a=Eo(r,e),c=a?.onCacheEntryAdded;if(!c)return;const u={},l=new Promise(e=>{u.cacheEntryRemoved=e}),p=Promise.race([new Promise(e=>{u.valueResolved=e}),l.then(()=>{throw Wo})]);p.catch(()=>{}),d[o]=u;const f=t.endpoints[e].select(So(a)?n:o),h=s.dispatch((e,t,n)=>n),g={...s,getCacheEntry:()=>f(s.getState()),requestId:i,extra:h,updateCachedData:So(a)?r=>s.dispatch(t.util.updateQueryData(e,n,r)):void 0,cacheDataLoaded:p,cacheEntryRemoved:l},m=c(n,g);Promise.resolve(m).catch(e=>{if(e!==Wo)throw e})}return(e,r,v)=>{const b=a(S=e)?S.meta.arg.queryCacheKey:c(S)?S.meta.arg.fixedCacheKey??S.meta.requestId:l.match(S)?S.payload.queryCacheKey:p.match(S)?Do(S.payload):"";var S;function _(e,t,n,o){const s=i(v,t),a=i(r.getState(),t);!s&&a&&y(e,o,t,r,n)}if(o.pending.match(e)){const[t,n,r]=m(e);_(t,b,r,n)}else if(f.match(e))for(const{queryDescription:t,value:n}of e.payload){const{endpointName:r,originalArgs:o,queryCacheKey:s}=t;_(r,s,e.meta.requestId,o),h(s,n,{})}else if(s.pending.match(e)){if(r.getState()[n].mutations[b]){const[t,n,o]=m(e);y(t,n,b,r,o)}}else if(u(e))h(b,e.payload,e.meta.baseQueryMeta);else if(l.match(e)||p.match(e))g(b);else if(t.util.resetApiState.match(e))for(const e of Object.keys(d))g(e)}},Go=({api:e,context:{apiUid:t},reducerPath:n})=>(r,o)=>{e.util.resetApiState.match(r)&&o.dispatch(e.internalActions.middlewareRegistered(t)),"undefined"!=typeof process&&"development"===process.env.NODE_ENV&&e.internalActions.middlewareRegistered.match(r)&&r.payload===t&&"conflict"===o.getState()[n]?.config?.middlewareRegistered&&console.warn(`There is a mismatch between slice and middleware for the reducerPath "${n}".\nYou can only have one api per reducer path, this will lead to crashes in various situations!${"api"===n?"\nIf you have multiple apis, you *have* to specify the reducerPath option when using createApi!":""}`)},Jo=({reducerPath:t,context:n,context:{endpointDefinitions:r},mutationThunk:o,queryThunk:s,api:i,assertTagType:a,refetchQuery:c,internalState:u})=>{const{removeQueryResult:d}=i.internalActions,l=e.isAnyOf(e.isFulfilled(o),e.isRejectedWithValue(o)),p=e.isAnyOf(e.isFulfilled(s,o),e.isRejected(s,o));let f=[],h=0;function g(e,r){const o=r.getState(),s=o[t];if(f.push(...e),"delayed"===s.config.invalidationBehavior&&h>0)return;const a=f;if(f=[],0===a.length)return;const l=i.util.selectInvalidatedBy(o,a);n.batch(()=>{const e=Array.from(l.values());for(const{queryCacheKey:t}of e){const e=s.queries[t],n=Hr(u.currentSubscriptions,t,Gr);e&&(0===n.size?r.dispatch(d({queryCacheKey:t})):e.status!==jr&&r.dispatch(c(e)))}})}return(e,t)=>{(s.pending.match(e)||o.pending.match(e))&&h++,p(e)&&(h=Math.max(0,h-1)),l(e)?g(Ro(e,"invalidatesTags",r,a),t):p(e)?g([],t):i.util.invalidateTags.match(e)&&g(_o(e.payload,void 0,void 0,void 0,void 0,a),t)}},Xo=({reducerPath:e,queryThunk:t,api:n,refetchQuery:r,internalState:o})=>{const{currentPolls:s,currentSubscriptions:i}=o,a=new Set;let c=null;function u(e,t){a.add(e),c||(c=setTimeout(()=>{for(const e of a)l({queryCacheKey:e},t);a.clear(),c=null},0))}function d({queryCacheKey:t},n){const o=n.getState()[e],a=o.queries[t],c=i.get(t);if(!a||a.status===jr)return;const{lowestPollingInterval:u,skipPollingIfUnfocused:l}=f(c);if(!Number.isFinite(u))return;const p=s.get(t);p?.timeout&&(clearTimeout(p.timeout),p.timeout=void 0);const h=Date.now()+u;s.set(t,{nextPollTimestamp:h,pollingInterval:u,timeout:setTimeout(()=>{!o.config.focused&&l||n.dispatch(r(a)),d({queryCacheKey:t},n)},u)})}function l({queryCacheKey:t},n){const r=n.getState()[e].queries[t],o=i.get(t);if(!r||r.status===jr)return;const{lowestPollingInterval:a}=f(o);if("test"===process.env.NODE_ENV){const e=s.pollUpdateCounters??={};e[t]??=0,e[t]++}if(!Number.isFinite(a))return void p(t);const c=s.get(t),u=Date.now()+a;(!c||u<c.nextPollTimestamp)&&d({queryCacheKey:t},n)}function p(e){const t=s.get(e);t?.timeout&&clearTimeout(t.timeout),s.delete(e)}function f(e=new Map){let t=!1,n=Number.POSITIVE_INFINITY;for(const r of e.values())r.pollingInterval&&(n=Math.min(r.pollingInterval,n),t=r.skipPollingIfUnfocused||t);return{lowestPollingInterval:n,skipPollingIfUnfocused:t}}return(e,r)=>{(n.internalActions.updateSubscriptionOptions.match(e)||n.internalActions.unsubscribeQueryResult.match(e))&&u(e.payload.queryCacheKey,r),(t.pending.match(e)||t.rejected.match(e)&&e.meta.condition)&&u(e.meta.arg.queryCacheKey,r),(t.fulfilled.match(e)||t.rejected.match(e)&&!e.meta.condition)&&d(e.meta.arg,r),n.util.resetApiState.match(e)&&(function(){for(const e of s.keys())p(e)}(),c&&(clearTimeout(c),c=null),a.clear())}},Yo=({api:t,context:n,queryThunk:r,mutationThunk:o})=>{const s=e.isPending(r,o),i=e.isRejected(r,o),a=e.isFulfilled(r,o),c={};return(e,r)=>{if(s(e)){const{requestId:o,arg:{endpointName:s,originalArgs:i}}=e.meta,a=Eo(n,s),u=a?.onQueryStarted;if(u){const e={},n=new Promise((t,n)=>{e.resolve=t,e.reject=n});n.catch(()=>{}),c[o]=e;const d=t.endpoints[s].select(So(a)?i:o),l=r.dispatch((e,t,n)=>n),p={...r,getCacheEntry:()=>d(r.getState()),requestId:o,extra:l,updateCachedData:So(a)?e=>r.dispatch(t.util.updateQueryData(s,i,e)):void 0,queryFulfilled:n};u(i,p)}}else if(a(e)){const{requestId:t,baseQueryMeta:n}=e.meta;c[t]?.resolve({data:e.payload,meta:n}),delete c[t]}else if(i(e)){const{requestId:t,rejectedWithValue:n,baseQueryMeta:r}=e.meta;c[t]?.reject({error:e.payload??e.error,isUnhandledError:!n,meta:r}),delete c[t]}}},Zo=Symbol(),es=({createSelector:t=e.createSelector}={})=>({name:Zo,init(n,{baseQuery:r,tagTypes:o,reducerPath:s,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:c,refetchOnFocus:u,refetchOnReconnect:d,invalidationBehavior:l,onSchemaFailure:p,catchSchemaFailure:f,skipSchemaValidation:h},g){!function(){"production"!==process.env.NODE_ENV&&hn.push('Sets cannot have "replace" patches.',function(e){return"Unsupported patch operation: "+e},function(e){return"Cannot apply patch, path doesn't resolve: "+e},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");const e="replace",t="add",n="remove";function r(e){if(!kn(e))return e;if(Mn(e))return e.map(r);if(Nn(e))return new Map(Array.from(e.entries()).map(([e,t])=>[e,r(t)]));if(Dn(e))return new Set(Array.from(e).map(r));const t=Object.create(yn(e));for(const n in e)t[n]=r(e[n]);return Cn(e,pn)&&(t[pn]=e[pn]),t}function o(e){return Tn(e)?r(e):e}var s;Gn[s=Wn]||(Gn[s]={applyPatches_:function(o,s){return s.forEach(s=>{const{path:i,op:a}=s;let c=o;for(let e=0;e<i.length-1;e++){const t=Pn(c);let n=i[e];"string"!=typeof n&&"number"!=typeof n&&(n=""+n),0!==t&&1!==t||"__proto__"!==n&&n!==vn||gn(19),jn(c)&&n===bn&&gn(19),c=On(c,n),qn(c)||gn(18,i.join("/"))}const u=Pn(c),d=r(s.value),l=i[i.length-1];switch(a){case e:switch(u){case 2:return c.set(l,d);case 3:gn(16);default:return c[l]=d}case t:switch(u){case 1:return"-"===l?c.push(d):c.splice(l,0,d);case 2:return c.set(l,d);case 3:return c.add(d);default:return c[l]=d}case n:switch(u){case 1:return c.splice(l,1);case 2:return c.delete(l);case 3:return c.delete(s.value);default:return delete c[l]}default:gn(17,a)}}),o},generatePatches_:function(r,s,i){if(r.scope_.processedForPatches_.has(r))return;r.scope_.processedForPatches_.add(r);const{patches_:a,inversePatches_:c}=i;switch(r.type_){case 0:case 2:return function(r,s,i,a){const{base_:c,copy_:u,type_:d}=r;In(r.assigned_,(r,l)=>{const p=On(c,r,d),f=On(u,r,d),h=l?Cn(c,r)?e:t:n;if(p===f&&h===e)return;const g=s.concat(r);i.push(h===n?{op:h,path:g}:{op:h,path:g,value:o(f)}),a.push(h===t?{op:n,path:g}:h===n?{op:t,path:g,value:o(p)}:{op:e,path:g,value:o(p)})})}(r,s,a,c);case 1:return function(r,s,i,a){let{base_:c,assigned_:u}=r,d=r.copy_;d.length<c.length&&([c,d]=[d,c],[i,a]=[a,i]);const l=!0===r.allIndicesReassigned_;for(let t=0;t<c.length;t++){const n=d[t],r=c[t];if((l||u?.get(t.toString()))&&n!==r){const c=n?.[fn];if(c&&c.modified_)continue;const u=s.concat([t]);i.push({op:e,path:u,value:o(n)}),a.push({op:e,path:u,value:o(r)})}}for(let e=c.length;e<d.length;e++){const n=s.concat([e]);i.push({op:t,path:n,value:o(d[e])})}for(let e=d.length-1;c.length<=e;--e){const t=s.concat([e]);a.push({op:n,path:t})}}(r,s,a,c);case 3:return function(e,r,o,s){let{base_:i,copy_:a}=e,c=0;i.forEach(e=>{if(!a.has(e)){const i=r.concat([c]);o.push({op:n,path:i,value:e}),s.unshift({op:t,path:i,value:e})}c++}),c=0,a.forEach(e=>{if(!i.has(e)){const i=r.concat([c]);o.push({op:t,path:i,value:e}),s.unshift({op:n,path:i,value:e})}c++})}(r,s,a,c)}},generateReplacementPatches_:function(t,n,r){const{patches_:o,inversePatches_:s}=r;o.push({op:e,path:[],value:n===ln?void 0:n}),s.push({op:e,path:[],value:t})},getPath:function e(t,n=[]){if(void 0!==t.key_){const e=t.parent_.copy_??t.parent_.base_,o=(r=On(e,t.key_),qn(r)?r?.[fn]:null),s=On(e,t.key_);if(void 0===s)return null;if(s!==t.draft_&&s!==t.base_&&s!==t.copy_)return null;if(null!=o&&o.base_!==t.base_)return null;const i=3===t.parent_.type_;let a;if(a=i?Array.from(t.parent_.drafts_.keys()).indexOf(t.key_):t.key_,!(i&&e.size>a||Cn(e,a)))return null;n.push(a)}var r;if(t.parent_)return e(t.parent_,n);n.reverse();try{!function(e,t){let n=e;for(let e=0;e<t.length-1;e++)if(n=On(n,t[e]),!qn(n)||null===n)throw new Error(`Cannot resolve path at '${t.join("/")}'`)}(t.copy_,n)}catch(e){return null}return n}})}();const m=e=>("undefined"!=typeof process&&"development"===process.env.NODE_ENV&&(o.includes(e.type)||console.error(`Tag type '${e.type}' was used, but not specified in \`tagTypes\`!`)),e);Object.assign(n,{reducerPath:s,endpoints:{},internalActions:{onOnline:po,onOffline:fo,onFocus:uo,onFocusLost:lo},util:{}});const y=function({serializeQueryArgs:e,reducerPath:t,createSelector:n}){const r=e=>zo,o=e=>$o;return{buildQuerySelector:function(e,t){return u(e,t,s)},buildInfiniteQuerySelector:function(e,t){const{infiniteQueryOptions:n}=t;return u(e,t,function(e){const t={...e,...$r(e.status)},{isLoading:r,isError:o,direction:s}=t,i="forward"===s,a="backward"===s;return{...t,hasNextPage:(c=n,u=t.data,l=t.originalArgs,!!u&&null!=Co(c,u,l)),hasPreviousPage:d(n,t.data,t.originalArgs),isFetchingNextPage:r&&i,isFetchingPreviousPage:r&&a,isFetchNextPageError:o&&i,isFetchPreviousPageError:o&&a};var c,u,l})},buildMutationSelector:function(){return e=>{let t;return t="object"==typeof e?Do(e)??Qo:e,n(t===Qo?o:e=>i(e)?.mutations?.[t]??$o,s)}},selectInvalidatedBy:function(e,n){const r=e[t],o=new Set,s=Kr(n,Vr,wo);for(const e of s){const t=r.provided.tags[e.type];if(!t)continue;let n=(void 0!==e.id?t[e.id]:Object.values(t).flat())??[];for(const e of n)o.add(e)}return Array.from(o.values()).flatMap(e=>{const t=r.queries[e];return t?{queryCacheKey:e,endpointName:t.endpointName,originalArgs:t.originalArgs}:[]})},selectCachedArgsForQuery:function(e,t){return Kr(Object.values(a(e)),e=>e?.endpointName===t&&e.status!==jr,e=>e.originalArgs)},selectApiState:i,selectQueries:a,selectMutations:function(e){return i(e)?.mutations},selectQueryEntry:c,selectConfig:function(e){return i(e)?.config}};function s(e){return{...e,...$r(e.status)}}function i(e){const n=e[t];if("production"!==process.env.NODE_ENV&&!n){if(i.triggered)return n;i.triggered=!0,console.error(`Error: No data found at \`state.${t}\`. Did you forget to add the reducer to the store?`)}return n}function a(e){return i(e)?.queries}function c(e,t){return a(e)?.[t]}function u(t,o,s){return i=>{if(i===Qo)return n(r,s);const a=e({queryArgs:i,endpointDefinition:o,endpointName:t});return n(e=>c(e,a)??zo,s)}}function d(e,t,n){return!(!t||!e.getPreviousPageParam)&&null!=Oo(e,t,n)}}({serializeQueryArgs:i,reducerPath:s,createSelector:t}),{selectInvalidatedBy:v,selectCachedArgsForQuery:b,buildQuerySelector:S,buildInfiniteQuerySelector:_,buildMutationSelector:w}=y;Ko(n.util,{selectInvalidatedBy:v,selectCachedArgsForQuery:b});const{queryThunk:E,infiniteQueryThunk:T,mutationThunk:k,patchQueryData:x,updateQueryData:A,upsertQueryData:F,prefetch:I,buildMatchThunkActions:P}=function({reducerPath:t,baseQuery:n,context:{endpointDefinitions:r},serializeQueryArgs:o,api:s,assertTagType:i,selectors:a,onSchemaFailure:c,catchSchemaFailure:u,skipSchemaValidation:d}){function l(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}function p(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}const f=(e,t)=>e.query&&e[t]?e[t]:Io,h=async(e,{signal:t,abort:o,rejectWithValue:s,fulfillWithValue:i,dispatch:h,getState:m,extra:y})=>{const v=r[e.endpointName],{metaSchema:b,skipSchemaValidation:S=d}=v,_=e.type===go;try{let w=Io;const E={signal:t,abort:o,dispatch:h,getState:m,extra:y,endpoint:e.endpointName,type:e.type,forced:_?g(e,m()):void 0,queryCacheKey:_?e.queryCacheKey:void 0},T=_?e[To]:void 0;let k;const x=async(t,n,r,o)=>{if(null==n&&t.pages.length)return Promise.resolve({data:t});const s={queryArg:e.originalArgs,pageParam:n},i=await A(s),a=o?l:p;return{data:{pages:a(t.pages,i.data,r),pageParams:a(t.pageParams,n,r)},meta:i.meta}};async function A(t){let r;const{extraOptions:o,argSchema:s,rawResponseSchema:i,responseSchema:a}=v;if(s&&!Ao(S,"arg")&&(t=await Fo(s,t,"argSchema",{})),T?r=T():v.query?(w=f(v,"transformResponse"),r=await n(v.query(t),E,o)):r=await v.queryFn(t,E,o,e=>n(e,E,o)),"undefined"!=typeof process&&"development"===process.env.NODE_ENV){const t=v.query?"`baseQuery`":"`queryFn`";let n;if(r){if("object"!=typeof r)n=`${t} did not return an object.`;else if(r.error&&r.data)n=`${t} returned an object containing both \`error\` and \`result\`.`;else if(void 0===r.error&&void 0===r.data)n=`${t} returned an object containing neither a valid \`error\` and \`result\`. At least one of them should not be \`undefined\``;else for(const e of Object.keys(r))if("error"!==e&&"data"!==e&&"meta"!==e){n=`The object returned by ${t} has the unknown property ${e}.`;break}}else n=`${t} did not return anything.`;n&&console.error(`Error encountered handling the endpoint ${e.endpointName}.\n ${n}\n It needs to return an object with either the shape \`{ data: <value> }\` or \`{ error: <value> }\` that may contain an optional \`meta\` property.\n Object returned was:`,r)}if(r.error)throw new no(r.error,r.meta);let{data:c}=r;i&&!Ao(S,"rawResponse")&&(c=await Fo(i,r.data,"rawResponseSchema",r.meta));let u=await w(c,r.meta,t);return a&&!Ao(S,"response")&&(u=await Fo(a,u,"responseSchema",r.meta)),{...r,data:u}}if(_&&"infiniteQueryOptions"in v){const{infiniteQueryOptions:F}=v,{maxPages:I=1/0}=F,P=e.refetchCachedPages??F.refetchCachedPages??!0;let C;const O={pages:[],pageParams:[]},R=a.selectQueryEntry(m(),e.queryCacheKey)?.data,M=g(e,m())&&!e.direction||!R?O:R;if("direction"in e&&e.direction&&M.pages.length){const N="backward"===e.direction,D=(N?Oo:Co)(F,M,e.originalArgs);C=await x(M,D,I,N)}else{const{initialPageParam:q=F.initialPageParam}=e,j=R?.pageParams??[],Q=j[0]??q,B=j.length;if(C=await x(M,Q,I),T&&(C={data:C.data.pages[0]}),P)for(let z=1;z<B;z++){const $=Co(F,C.data,e.originalArgs);C=await x(C.data,$,I)}}k=C}else k=await A(e.originalArgs);return b&&!Ao(S,"meta")&&k.meta&&(k.meta=await Fo(b,k.meta,"metaSchema",k.meta)),i(k.data,Po({fulfilledTimeStamp:Date.now(),baseQueryMeta:k.meta}))}catch(U){let L=U;if(L instanceof no){let K=f(v,"transformErrorResponse");const{rawErrorResponseSchema:V,errorResponseSchema:W}=v;let{value:H,meta:G}=L;try{V&&!Ao(S,"rawErrorResponse")&&(H=await Fo(V,H,"rawErrorResponseSchema",G)),b&&!Ao(S,"meta")&&(G=await Fo(b,G,"metaSchema",G));let J=await K(H,G,e.originalArgs);return W&&!Ao(S,"errorResponse")&&(J=await Fo(W,J,"errorResponseSchema",G)),s(J,Po({baseQueryMeta:G}))}catch(X){L=X}}try{if(L instanceof xo){const Y={endpoint:e.endpointName,arg:e.originalArgs,type:e.type,queryCacheKey:_?e.queryCacheKey:void 0};v.onSchemaFailure?.(L,Y),c?.(L,Y);const{catchSchemaFailure:Z=u}=v;if(Z)return s(Z(L,Y),Po({baseQueryMeta:L._bqMeta}))}}catch(ee){L=ee}throw"undefined"!=typeof process&&"production"!==process.env.NODE_ENV?console.error(`An unhandled error occurred processing a request for the endpoint "${e.endpointName}".\nIn the case of an unhandled error, no tags will be "provided" or "invalidated".`,L):console.error(L),L}};function g(e,t){const n=a.selectQueryEntry(t,e.queryCacheKey),r=a.selectConfig(t).refetchOnMountOrArgChange,o=n?.fulfilledTimeStamp,s=e.forceRefetch??(e.subscribe&&r);return!!s&&(!0===s||(Number(new Date)-Number(o))/1e3>=s)}const m=()=>e.createAsyncThunk(`${t}/executeQuery`,h,{getPendingMeta({arg:e}){const t=r[e.endpointName];return Po({startedTimeStamp:Date.now(),...bo(t)?{direction:e.direction}:{}})},condition(e,{getState:t}){const n=t(),o=a.selectQueryEntry(n,e.queryCacheKey),s=o?.fulfilledTimeStamp,i=e.originalArgs,c=o?.originalArgs,u=r[e.endpointName],d=e.direction;return!(!ko(e)&&("pending"===o?.status||!g(e,n)&&(!vo(u)||!u?.forceRefetch?.({currentArg:i,previousArg:c,endpointState:o,state:n}))&&s&&!d))},dispatchConditionRejection:!0}),y=m(),v=m();function b(e){return t=>t?.meta?.arg?.endpointName===e}return{queryThunk:y,mutationThunk:e.createAsyncThunk(`${t}/executeMutation`,h,{getPendingMeta:()=>Po({startedTimeStamp:Date.now()})}),infiniteQueryThunk:v,prefetch:(e,t,n={})=>(r,o)=>{const i="force"in n&&n.force,a="ifOlderThan"in n&&n.ifOlderThan,c=(n=!0)=>s.endpoints[e].initiate(t,{forceRefetch:n,subscribe:!1}),u=s.endpoints[e].select(t)(o());if(i)r(c());else if(a){const e=u?.fulfilledTimeStamp;if(!e)return void r(c());(Number(new Date)-Number(new Date(e)))/1e3>=a&&r(c())}else r(c(!1))},updateQueryData:(e,t,n,r=!0)=>(o,i)=>{const a=s.endpoints[e].select(t)(i()),c={patches:[],inversePatches:[],undo:()=>o(s.util.patchQueryData(e,t,c.inversePatches,r))};if(a.status===jr)return c;let u;if("data"in a)if(kn(a.data)){const[e,t,r]=Er(a.data,n);c.patches.push(...t),c.inversePatches.push(...r),u=e}else u=n(a.data),c.patches.push({op:"replace",path:[],value:u}),c.inversePatches.push({op:"replace",path:[],value:a.data});return 0===c.patches.length||o(s.util.patchQueryData(e,t,c.patches,r)),c},upsertQueryData:(e,t,n)=>r=>r(s.endpoints[e].initiate(t,{subscribe:!1,forceRefetch:!0,[To]:()=>({data:n})})),patchQueryData:(e,t,n,a)=>(c,u)=>{const d=r[e],l=o({queryArgs:t,endpointDefinition:d,endpointName:e});if(c(s.internalActions.queryResultPatched({queryCacheKey:l,patches:n})),!a)return;const p=s.endpoints[e].select(t)(u()),f=_o(d.providesTags,p.data,void 0,t,{},i);c(s.internalActions.updateProvidedBy([{queryCacheKey:l,providedTags:f}]))},buildMatchThunkActions:function(t,n){return{matchPending:e.isAllOf(e.isPending(t),b(n)),matchFulfilled:e.isAllOf(e.isFulfilled(t),b(n)),matchRejected:e.isAllOf(e.isRejected(t),b(n))}}}}({baseQuery:r,reducerPath:s,context:g,api:n,serializeQueryArgs:i,assertTagType:m,selectors:y,onSchemaFailure:p,catchSchemaFailure:f,skipSchemaValidation:h}),{reducer:C,actions:O}=function({reducerPath:t,queryThunk:n,mutationThunk:r,serializeQueryArgs:o,context:{endpointDefinitions:s,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:c},assertTagType:u,config:d}){const l=e.createAction(`${t}/resetApiState`);function p(e,t,n,r){e[t.queryCacheKey]??={status:jr,endpointName:t.endpointName},No(e,t.queryCacheKey,e=>{e.status=Qr,e.requestId=n&&e.requestId?e.requestId:r.requestId,void 0!==t.originalArgs&&(e.originalArgs=t.originalArgs),e.startedTimeStamp=r.startedTimeStamp,bo(s[r.arg.endpointName])&&"direction"in t&&(e.direction=t.direction)})}function f(t,n,r,o){No(t,n.arg.queryCacheKey,t=>{if(t.requestId!==n.requestId&&!o)return;const{merge:i}=s[n.arg.endpointName];if(t.status=Br,i)if(void 0!==t.data){const{fulfilledTimeStamp:o,arg:s,baseQueryMeta:a,requestId:c}=n;let u=e.createNextState(t.data,e=>i(e,r,{arg:s.originalArgs,baseQueryMeta:a,fulfilledTimeStamp:o,requestId:c}));t.data=u}else t.data=r;else t.data=s[n.arg.endpointName].structuralSharing??1?Lr(Tn(t.data)?(Tn(a=t.data)||gn(15,a),a[fn].base_):t.data,r):r;var a;delete t.error,t.fulfilledTimeStamp=n.fulfilledTimeStamp})}const h=e.createSlice({name:`${t}/queries`,initialState:jo,reducers:{removeQueryResult:{reducer(e,{payload:{queryCacheKey:t}}){delete e[t]},prepare:e.prepareAutoBatched()},cacheEntriesUpserted:{reducer(e,t){for(const n of t.payload){const{queryDescription:r,value:o}=n;p(e,r,!0,{arg:r,requestId:t.meta.requestId,startedTimeStamp:t.meta.timestamp}),f(e,{arg:r,requestId:t.meta.requestId,fulfilledTimeStamp:t.meta.timestamp,baseQueryMeta:{}},o,!0)}},prepare:t=>({payload:t.map(e=>{const{endpointName:t,arg:n,value:r}=e;return{queryDescription:{type:go,endpointName:t,originalArgs:e.arg,queryCacheKey:o({queryArgs:n,endpointDefinition:s[t],endpointName:t})},value:r}}),meta:{[e.SHOULD_AUTOBATCH]:!0,requestId:e.nanoid(),timestamp:Date.now()}})},queryResultPatched:{reducer(e,{payload:{queryCacheKey:t,patches:n}}){No(e,t,e=>{e.data=Tr(e.data,n.concat())})},prepare:e.prepareAutoBatched()}},extraReducers(e){e.addCase(n.pending,(e,{meta:t,meta:{arg:n}})=>{p(e,n,ko(n),t)}).addCase(n.fulfilled,(e,{meta:t,payload:n})=>{f(e,t,n,ko(t.arg))}).addCase(n.rejected,(e,{meta:{condition:t,arg:n,requestId:r},error:o,payload:s})=>{No(e,n.queryCacheKey,e=>{if(t);else{if(e.requestId!==r)return;e.status=zr,e.error=s??o}})}).addMatcher(c,(e,t)=>{const{queries:n}=a(t);for(const[t,r]of Object.entries(n))r?.status!==Br&&r?.status!==zr||(e[t]=r)})}}),g=e.createSlice({name:`${t}/mutations`,initialState:jo,reducers:{removeMutationResult:{reducer(e,{payload:t}){const n=Do(t);n in e&&delete e[n]},prepare:e.prepareAutoBatched()}},extraReducers(e){e.addCase(r.pending,(e,{meta:t,meta:{requestId:n,arg:r,startedTimeStamp:o}})=>{r.track&&(e[Do(t)]={requestId:n,status:Qr,endpointName:r.endpointName,startedTimeStamp:o})}).addCase(r.fulfilled,(e,{payload:t,meta:n})=>{n.arg.track&&qo(e,n,e=>{e.requestId===n.requestId&&(e.status=Br,e.data=t,e.fulfilledTimeStamp=n.fulfilledTimeStamp)})}).addCase(r.rejected,(e,{payload:t,error:n,meta:r})=>{r.arg.track&&qo(e,r,e=>{e.requestId===r.requestId&&(e.status=zr,e.error=t??n)})}).addMatcher(c,(e,t)=>{const{mutations:n}=a(t);for(const[t,r]of Object.entries(n))r?.status!==Br&&r?.status!==zr||t===r?.requestId||(e[t]=r)})}}),m=e.createSlice({name:`${t}/invalidation`,initialState:{tags:{},keys:{}},reducers:{updateProvidedBy:{reducer(e,t){for(const{queryCacheKey:n,providedTags:r}of t.payload){y(e,n);for(const{type:t,id:o}of r){const r=(e.tags[t]??={})[o||"__internal_without_id"]??=[];r.includes(n)||r.push(n)}e.keys[n]=r}},prepare:e.prepareAutoBatched()}},extraReducers(t){t.addCase(h.actions.removeQueryResult,(e,{payload:{queryCacheKey:t}})=>{y(e,t)}).addMatcher(c,(e,t)=>{const{provided:n}=a(t);for(const[t,r]of Object.entries(n.tags??{}))for(const[o,s]of Object.entries(r)){const r=(e.tags[t]??={})[o||"__internal_without_id"]??=[];for(const t of s)r.includes(t)||r.push(t),e.keys[t]=n.keys[t]}}).addMatcher(e.isAnyOf(e.isFulfilled(n),e.isRejectedWithValue(n)),(e,t)=>{v(e,[t])}).addMatcher(h.actions.cacheEntriesUpserted.match,(e,t)=>{v(e,t.payload.map(({queryDescription:e,value:t})=>({type:"UNKNOWN",payload:t,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:e}})))})}});function y(e,t){const n=Mo(e.keys[t]??[]);for(const r of n){const n=r.type,o=r.id??"__internal_without_id",s=e.tags[n]?.[o];s&&(e.tags[n][o]=Mo(s).filter(e=>e!==t))}delete e.keys[t]}function v(e,t){const n=t.map(e=>{const t=Ro(e,"providesTags",s,u),{queryCacheKey:n}=e.meta.arg;return{queryCacheKey:n,providedTags:t}});m.caseReducers.updateProvidedBy(e,m.actions.updateProvidedBy(n))}const b=e.createSlice({name:`${t}/subscriptions`,initialState:jo,reducers:{updateSubscriptionOptions(e,t){},unsubscribeQueryResult(e,t){},internal_getRTKQSubscriptions(){}}}),S=e.createSlice({name:`${t}/internalSubscriptions`,initialState:jo,reducers:{subscriptionsUpdated:{reducer:(e,t)=>Tr(e,t.payload),prepare:e.prepareAutoBatched()}}}),_=e.createSlice({name:`${t}/config`,initialState:{online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine,focused:"undefined"==typeof document||"hidden"!==document.visibilityState,middlewareRegistered:!1,...d},reducers:{middlewareRegistered(e,{payload:t}){e.middlewareRegistered="conflict"!==e.middlewareRegistered&&i===t||"conflict"}},extraReducers:e=>{e.addCase(po,e=>{e.online=!0}).addCase(fo,e=>{e.online=!1}).addCase(uo,e=>{e.focused=!0}).addCase(lo,e=>{e.focused=!1}).addMatcher(c,e=>({...e}))}}),w=e.combineReducers({queries:h.reducer,mutations:g.reducer,provided:m.reducer,subscriptions:S.reducer,config:_.reducer});return{reducer:(e,t)=>w(l.match(t)?void 0:e,t),actions:{..._.actions,...h.actions,...b.actions,...S.actions,...g.actions,...m.actions,resetApiState:l}}}({context:g,queryThunk:E,mutationThunk:k,serializeQueryArgs:i,reducerPath:s,assertTagType:m,config:{refetchOnFocus:u,refetchOnReconnect:d,refetchOnMountOrArgChange:c,keepUnusedDataFor:a,reducerPath:s,invalidationBehavior:l}});Ko(n.util,{patchQueryData:x,updateQueryData:A,upsertQueryData:F,prefetch:I,resetApiState:O.resetApiState,upsertQueryEntries:O.cacheEntriesUpserted}),Ko(n.internalActions,O);const R=new WeakMap,M=e=>Hr(R,e,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:N,buildInitiateInfiniteQuery:D,buildInitiateMutation:q,getRunningMutationThunk:j,getRunningMutationsThunk:Q,getRunningQueriesThunk:B,getRunningQueryThunk:z}=function({serializeQueryArgs:t,queryThunk:n,infiniteQueryThunk:r,mutationThunk:o,api:s,context:i,getInternalState:a}){const c=e=>a(e)?.runningQueries,u=e=>a(e)?.runningMutations,{unsubscribeQueryResult:d,removeMutationResult:l,updateSubscriptionOptions:p}=s.internalActions;return{buildInitiateQuery:function(e,t){return h(e,t)},buildInitiateInfiniteQuery:function(e,t){return h(e,t)},buildInitiateMutation:function(e){return(t,{track:n=!0,fixedCacheKey:r}={})=>(s,i)=>{const a=o({type:"mutation",endpointName:e,originalArgs:t,track:n,fixedCacheKey:r}),c=s(a);f(s);const{requestId:d,abort:p,unwrap:h}=c,g=c.unwrap().then(e=>({data:e})).catch(e=>({error:e})),m=Object.assign(g,{arg:c.arg,requestId:d,abort:p,unwrap:h,reset:()=>{s(l({requestId:d,fixedCacheKey:r}))}}),y=u(s);return y.set(d,m),m.then(()=>{y.delete(d)}),r&&(y.set(r,m),m.then(()=>{y.get(r)===m&&y.delete(r)})),m}},getRunningQueryThunk:function(e,n){return r=>{const o=Eo(i,e),s=t({queryArgs:n,endpointDefinition:o,endpointName:e});return c(r)?.get(s)}},getRunningMutationThunk:function(e,t){return e=>u(e)?.get(t)},getRunningQueriesThunk:function(){return e=>Wr(c(e))},getRunningMutationsThunk:function(){return e=>Wr(u(e))}};function f(t){if("production"!==process.env.NODE_ENV){if(f.triggered)return;const n=t(s.internalActions.internal_getRTKQSubscriptions());if(f.triggered=!0,"object"!=typeof n||"string"==typeof n?.type)throw new Error("production"===process.env.NODE_ENV?e.formatProdErrorMessage(34):`Warning: Middleware for RTK-Query API at reducerPath "${s.reducerPath}" has not been added to the store.\nYou must add the middleware for RTK-Query to function correctly!`)}}function h(e,o){const i=(a,{subscribe:u=!0,forceRefetch:l,subscriptionOptions:h,[To]:g,...m}={})=>(y,v)=>{const b=t({queryArgs:a,endpointDefinition:o,endpointName:e});let S;const _={...m,type:go,subscribe:u,forceRefetch:l,subscriptionOptions:h,endpointName:e,originalArgs:a,queryCacheKey:b,[To]:g};if(vo(o))S=n(_);else{const{direction:e,initialPageParam:t,refetchCachedPages:n}=m;S=r({..._,direction:e,initialPageParam:t,refetchCachedPages:n})}const w=s.endpoints[e].select(a),E=y(S),T=w(v());f(y);const{requestId:k,abort:x}=E,A=T.requestId!==k,F=c(y)?.get(b),I=()=>w(v()),P=Object.assign(g?E.then(I):A&&!F?Promise.resolve(T):Promise.all([F,E]).then(I),{arg:a,requestId:k,subscriptionOptions:h,queryCacheKey:b,abort:x,async unwrap(){const e=await P;if(e.isError)throw e.error;return e.data},refetch:e=>y(i(a,{subscribe:!1,forceRefetch:!0,...e})),unsubscribe(){u&&y(d({queryCacheKey:b,requestId:k}))},updateSubscriptionOptions(t){P.subscriptionOptions=t,y(p({endpointName:e,requestId:k,queryCacheKey:b,options:t}))}});if(!F&&!A&&!g){const e=c(y);e.set(b,P),P.then(()=>{e.delete(b)})}return P};return i}}({queryThunk:E,mutationThunk:k,infiniteQueryThunk:T,api:n,serializeQueryArgs:i,context:g,getInternalState:M});Ko(n.util,{getRunningMutationThunk:j,getRunningMutationsThunk:Q,getRunningQueryThunk:z,getRunningQueriesThunk:B});const{middleware:$,actions:U}=function(t){const{reducerPath:n,api:r,context:o,getInternalState:s}=t,{apiUid:i}=o,a={invalidateTags:e.createAction(`${n}/invalidateTags`)},c=e=>e.type.startsWith(`${n}/`),u=[Go,Vo,Jo,Xo,Ho,Yo];return{middleware:a=>{let l=!1;const p=s(a.dispatch),f={...t,internalState:p,refetchQuery:d,isThisApiSliceAction:c,mwApi:a},h=u.map(e=>e(f)),g=(({api:e,queryThunk:t,internalState:n})=>{const r=`${e.reducerPath}/subscriptions`;let o=null,s=null;const{updateSubscriptionOptions:i,unsubscribeQueryResult:a}=e.internalActions,c=()=>n.currentSubscriptions,u={getSubscriptions:c,getSubscriptionCount:e=>{const t=c().get(e);return t?.size??0},isRequestSubscribed:(e,t)=>{const n=c();return!!n?.get(e)?.get(t)}};function d(e){return JSON.parse(JSON.stringify(Object.fromEntries([...e].map(([e,t])=>[e,Object.fromEntries(t)]))))}return(c,l)=>{if(o||(o=d(n.currentSubscriptions)),e.util.resetApiState.match(c))return o={},n.currentSubscriptions.clear(),s=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(c))return[!1,u];const p=((n,r)=>{if(i.match(r)){const{queryCacheKey:e,requestId:t,options:o}=r.payload,s=n.get(e);return s?.has(t)&&s.set(t,o),!0}if(a.match(r)){const{queryCacheKey:e,requestId:t}=r.payload,o=n.get(e);return o&&o.delete(t),!0}if(e.internalActions.removeQueryResult.match(r))return n.delete(r.payload.queryCacheKey),!0;if(t.pending.match(r)){const{meta:{arg:e,requestId:t}}=r,o=Hr(n,e.queryCacheKey,Gr);return e.subscribe&&o.set(t,e.subscriptionOptions??o.get(t)??{}),!0}let o=!1;if(t.rejected.match(r)){const{meta:{condition:e,arg:t,requestId:s}}=r;if(e&&t.subscribe){const e=Hr(n,t.queryCacheKey,Gr);e.set(s,t.subscriptionOptions??e.get(s)??{}),o=!0}}return o})(n.currentSubscriptions,c);let f=!0;if("test"===process.env.NODE_ENV&&"string"==typeof c.type&&c.type===`${e.reducerPath}/getPolling`)return[!1,n.currentPolls];if(p){s||(s=setTimeout(()=>{const t=d(n.currentSubscriptions),[,r]=Er(o,()=>t);l.next(e.internalActions.subscriptionsUpdated(r)),o=t,s=null},500));const i="string"==typeof c.type&&!!c.type.startsWith(r),a=t.rejected.match(c)&&c.meta.condition&&!!c.meta.arg.subscribe;f=!i&&!a}return[f,!1]}})(f),m=(({reducerPath:e,context:t,api:n,refetchQuery:r,internalState:o})=>{const{removeQueryResult:s}=n.internalActions;function i(n,i){const a=n.getState()[e],c=a.queries,u=o.currentSubscriptions;t.batch(()=>{for(const e of u.keys()){const t=c[e],o=u.get(e);if(!o||!t)continue;const d=[...o.values()];(d.some(e=>!0===e[i])||d.every(e=>void 0===e[i])&&a.config[i])&&(0===o.size?n.dispatch(s({queryCacheKey:e})):t.status!==jr&&n.dispatch(r(t)))}})}return(e,t)=>{uo.match(e)&&i(t,"refetchOnFocus"),po.match(e)&&i(t,"refetchOnReconnect")}})(f);return t=>s=>{if(!e.isAction(s))return t(s);l||(l=!0,a.dispatch(r.internalActions.middlewareRegistered(i)));const u={...a,next:t},d=a.getState(),[p,f]=g(s,u,d);let y;if(y=p?t(s):f,a.getState()[n]&&(m(s,u,d),c(s)||o.hasRehydrationInfo(s)))for(const e of h)e(s,u,d);return y}},actions:a};function d(e){return t.api.endpoints[e.endpointName].initiate(e.originalArgs,{subscribe:!1,forceRefetch:!0})}}({reducerPath:s,context:g,queryThunk:E,mutationThunk:k,infiniteQueryThunk:T,api:n,assertTagType:m,selectors:y,getRunningQueryThunk:z,getInternalState:M});return Ko(n.util,U),Ko(n,{reducer:C,middleware:$}),{name:Zo,injectEndpoint(e,t){const r=n,o=r.endpoints[e]??={};vo(t)&&Ko(o,{name:e,select:S(e,t),initiate:N(e,t)},P(E,e)),t.type===mo&&Ko(o,{name:e,select:w(),initiate:q(e)},P(k,e)),bo(t)&&Ko(o,{name:e,select:_(e,t),initiate:D(e,t)},P(E,e))}}}});function ts(e){return e.replace(e[0],e[0].toUpperCase())}function ns(e){let t=0;for(const n in e)t++;return t}function rs(e){return"infinitequery"===e.type}function os(e,...t){return Object.assign(e,...t)}es();var ss=Symbol();function is(e){const t=n.useRef(e),r=n.useMemo(()=>Lr(t.current,e),[e]);return n.useEffect(()=>{t.current!==r&&(t.current=r)},[r]),r}function as(e){const r=n.useRef(e);return n.useEffect(()=>{t.shallowEqual(r.current,e)||(r.current=e)},[e]),t.shallowEqual(r.current,e)?r.current:e}var cs=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),us="undefined"!=typeof navigator&&"ReactNative"===navigator.product,ds=cs||us?n.useLayoutEffect:n.useEffect,ls=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:void 0===e.data,status:qr.pending}:e;function ps(e,...t){const n={};return t.forEach(t=>{n[t]=e[t]}),n}var fs=["data","status","isLoading","isSuccess","isError","error"],hs=Symbol(),gs=function(...t){return function(n){const r=Rr(e=>n.extractRehydrationInfo?.(e,{reducerPath:n.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...n,extractRehydrationInfo:r,serializeQueryArgs(e){let t=Lo;if("serializeQueryArgs"in e.endpointDefinition){const n=e.endpointDefinition.serializeQueryArgs;t=e=>{const t=n(e);return"string"==typeof t?t:Lo({...e,queryArgs:t})}}else n.serializeQueryArgs&&(t=n.serializeQueryArgs);return t(e)},tagTypes:[...n.tagTypes||[]]},s={endpointDefinitions:{},batch(e){e()},apiUid:e.nanoid(),extractRehydrationInfo:r,hasRehydrationInfo:Rr(e=>null!=r(e))},i={injectEndpoints:function(t){const n=t.endpoints({query:e=>({...e,type:go}),mutation:e=>({...e,type:mo}),infiniteQuery:e=>({...e,type:yo})});for(const[r,o]of Object.entries(n))if(!0!==t.overrideExisting&&r in s.endpointDefinitions){if("throw"===t.overrideExisting)throw new Error("production"===process.env.NODE_ENV?e.formatProdErrorMessage(39):`called \`injectEndpoints\` to override already-existing endpointName ${r} without specifying \`overrideExisting: true\``);"undefined"!=typeof process&&"development"===process.env.NODE_ENV&&console.error(`called \`injectEndpoints\` to override already-existing endpointName ${r} without specifying \`overrideExisting: true\``)}else{if("undefined"!=typeof process&&"development"===process.env.NODE_ENV&&bo(o)){const{infiniteQueryOptions:t}=o,{maxPages:n,getPreviousPageParam:s}=t;if("number"==typeof n){if(n<1)throw new Error("production"===process.env.NODE_ENV?e.formatProdErrorMessage(40):`maxPages for endpoint '${r}' must be a number greater than 0`);if("function"!=typeof s)throw new Error("production"===process.env.NODE_ENV?e.formatProdErrorMessage(41):`getPreviousPageParam for endpoint '${r}' must be a function if maxPages is used`)}}s.endpointDefinitions[r]=o;for(const e of a)e.injectEndpoint(r,o)}return i},enhanceEndpoints({addTagTypes:e,endpoints:t}){if(e)for(const t of e)o.tagTypes.includes(t)||o.tagTypes.push(t);if(t)for(const[e,n]of Object.entries(t))"function"==typeof n?n(Eo(s,e)):Object.assign(Eo(s,e)||{},n);return i}},a=t.map(e=>e.init(i,o,s));return i.injectEndpoints({endpoints:n.endpoints})}}(es(),(({batch:r=t.batch,hooks:o={useDispatch:t.useDispatch,useSelector:t.useSelector,useStore:t.useStore},createSelector:s=Nr,unstable__sideEffectsInRender:i=!1,...a}={})=>{if("production"!==process.env.NODE_ENV){const t=["useDispatch","useSelector","useStore"];let n=!1;for(const r of t)if(ns(a)>0&&(a[r]&&(n||(console.warn("As of RTK 2.0, the hooks now need to be specified as one object, provided under a `hooks` key:\n`reactHooksModule({ hooks: { useDispatch, useSelector, useStore } })`"),n=!0)),o[r]=a[r]),"function"!=typeof o[r])throw new Error("production"===process.env.NODE_ENV?e.formatProdErrorMessage(36):`When using custom hooks for context, all ${t.length} hooks need to be provided: ${t.join(", ")}.\nHook ${r} was either not provided or not a function.`)}return{name:hs,init(a,{serializeQueryArgs:c},u){const d=a,{buildQueryHooks:l,buildInfiniteQueryHooks:p,buildMutationHook:f,usePrefetch:h}=function({api:r,moduleOptions:{batch:o,hooks:{useDispatch:s,useSelector:i,useStore:a},unstable__sideEffectsInRender:c,createSelector:u},serializeQueryArgs:d,context:l}){const p=c?e=>e():n.useEffect,f=e=>e.current?.unsubscribe?.(),h=l.endpointDefinitions;return{buildQueryHooks:function(t){const i=(r,o={})=>{const[s]=y(t,r,o);return b(s),n.useMemo(()=>({refetch:()=>function(t){if(!t.current)throw new Error("production"===process.env.NODE_ENV?e.formatProdErrorMessage(38):"Cannot refetch a query that has not been started yet.");return t.current.refetch()}(s)}),[s])},a=({refetchOnReconnect:e,refetchOnFocus:i,pollingInterval:a=0,skipPollingIfUnfocused:c=!1}={})=>{const{initiate:u}=r.endpoints[t],d=s(),[l,h]=n.useState(ss),g=n.useRef(void 0),m=as({refetchOnReconnect:e,refetchOnFocus:i,pollingInterval:a,skipPollingIfUnfocused:c});p(()=>{const e=g.current?.subscriptionOptions;m!==e&&g.current?.updateSubscriptionOptions(m)},[m]);const y=n.useRef(m);p(()=>{y.current=m},[m]);const v=n.useCallback(function(e,t=!1){let n;return o(()=>{f(g),g.current=n=d(u(e,{subscriptionOptions:y.current,forceRefetch:!t})),h(e)}),n},[d,u]),b=n.useCallback(()=>{g.current?.queryCacheKey&&d(r.internalActions.removeQueryResult({queryCacheKey:g.current?.queryCacheKey}))},[d]);return n.useEffect(()=>()=>{f(g)},[]),n.useEffect(()=>{l===ss||g.current||v(l,!0)},[l,v]),n.useMemo(()=>[v,l,{reset:b}],[v,l,b])},c=v(t,g);return{useQueryState:c,useQuerySubscription:i,useLazyQuerySubscription:a,useLazyQuery(e){const[t,r,{reset:o}]=a(e),s=c(r,{...e,skip:r===ss}),i=n.useMemo(()=>({lastArg:r}),[r]);return n.useMemo(()=>[t,{...s,reset:o},i],[t,s,o,i])},useQuery(e,t){const r=i(e,t),o=c(e,{selectFromResult:e===Qo||t?.skip?void 0:ls,...t}),s=ps(o,...fs);return n.useDebugValue(s),n.useMemo(()=>({...o,...r}),[o,r])}}},buildInfiniteQueryHooks:function(t){const r=(r,s={})=>{const[i,a,c,u]=y(t,r,s),d=n.useRef(u);p(()=>{d.current=u},[u]);const l=as(s.refetchCachedPages),h=n.useCallback(function(e,t){let n;return o(()=>{f(i),i.current=n=a(c(e,{subscriptionOptions:d.current,direction:t}))}),n},[i,a,c]);b(i);const g=is(s.skip?Qo:r),m=n.useCallback(t=>{if(!i.current)throw new Error("production"===process.env.NODE_ENV?e.formatProdErrorMessage(38):"Cannot refetch a query that has not been started yet.");return i.current.refetch({refetchCachedPages:t?.refetchCachedPages??l})},[i,l]);return n.useMemo(()=>({trigger:h,refetch:m,fetchNextPage:()=>h(g,"forward"),fetchPreviousPage:()=>h(g,"backward")}),[m,h,g])},s=v(t,m);return{useInfiniteQueryState:s,useInfiniteQuerySubscription:r,useInfiniteQuery(e,t){const{refetch:o,fetchNextPage:i,fetchPreviousPage:a}=r(e,t),c=s(e,{selectFromResult:e===Qo||t?.skip?void 0:ls,...t}),u=ps(c,...fs,"hasNextPage","hasPreviousPage");return n.useDebugValue(u),n.useMemo(()=>({...c,fetchNextPage:i,fetchPreviousPage:a,refetch:o}),[c,i,a,o])}}},buildMutationHook:function(e){return({selectFromResult:a,fixedCacheKey:c}={})=>{const{select:d,initiate:l}=r.endpoints[e],p=s(),[f,h]=n.useState();n.useEffect(()=>()=>{f?.arg.fixedCacheKey||f?.reset()},[f]);const g=n.useCallback(function(e){const t=p(l(e,{fixedCacheKey:c}));return h(t),t},[p,l,c]),{requestId:m}=f||{},y=n.useMemo(()=>d({fixedCacheKey:c,requestId:f?.requestId}),[c,f,d]),v=n.useMemo(()=>a?u([y],a):y,[a,y]),b=i(v,t.shallowEqual),S=null==c?f?.arg.originalArgs:void 0,_=n.useCallback(()=>{o(()=>{f&&h(void 0),c&&p(r.internalActions.removeMutationResult({requestId:m,fixedCacheKey:c}))})},[p,c,f,m]),w=ps(b,...fs,"endpointName");n.useDebugValue(w);const E=n.useMemo(()=>({...b,originalArgs:S,reset:_}),[b,S,_]);return n.useMemo(()=>[g,E],[g,E])}},usePrefetch:function(e,t){const o=s(),i=as(t);return n.useCallback((t,n)=>o(r.util.prefetch(e,t,{...i,...n})),[e,o,i])}};function g(e,t,n){if(t?.endpointName&&e.isUninitialized){const{endpointName:e}=t,r=h[e];n!==Qo&&d({queryArgs:t.originalArgs,endpointDefinition:r,endpointName:e})===d({queryArgs:n,endpointDefinition:r,endpointName:e})&&(t=void 0)}let r=e.isSuccess?e.data:t?.data;void 0===r&&(r=e.data);const o=void 0!==r,s=e.isLoading,i=(!t||t.isLoading||t.isUninitialized)&&!o&&s,a=e.isSuccess||o&&(s&&!t?.isError||e.isUninitialized);return{...e,data:r,currentData:e.data,isFetching:s,isLoading:i,isSuccess:a}}function m(e,t,n){if(t?.endpointName&&e.isUninitialized){const{endpointName:e}=t,r=h[e];n!==Qo&&d({queryArgs:t.originalArgs,endpointDefinition:r,endpointName:e})===d({queryArgs:n,endpointDefinition:r,endpointName:e})&&(t=void 0)}let r=e.isSuccess?e.data:t?.data;void 0===r&&(r=e.data);const o=void 0!==r,s=e.isLoading,i=(!t||t.isLoading||t.isUninitialized)&&!o&&s,a=e.isSuccess||s&&o;return{...e,data:r,currentData:e.data,isFetching:s,isLoading:i,isSuccess:a}}function y(t,o,{refetchOnReconnect:i,refetchOnFocus:a,refetchOnMountOrArgChange:c,skip:u=!1,pollingInterval:d=0,skipPollingIfUnfocused:l=!1,...f}={}){const{initiate:g}=r.endpoints[t],m=s(),y=n.useRef(void 0);if(!y.current){const t=m(r.internalActions.internal_getRTKQSubscriptions());if("production"!==process.env.NODE_ENV&&("object"!=typeof t||"string"==typeof t?.type))throw new Error("production"===process.env.NODE_ENV?e.formatProdErrorMessage(37):`Warning: Middleware for RTK-Query API at reducerPath "${r.reducerPath}" has not been added to the store.\n You must add the middleware for RTK-Query to function correctly!`);y.current=t}const v=is(u?Qo:o),b=as({refetchOnReconnect:i,refetchOnFocus:a,pollingInterval:d,skipPollingIfUnfocused:l}),S=as(f.initialPageParam),_=as(f.refetchCachedPages),w=n.useRef(void 0);let{queryCacheKey:E,requestId:T}=w.current||{},k=!1;E&&T&&(k=y.current.isRequestSubscribed(E,T));const x=!k&&void 0!==w.current;return p(()=>{x&&(w.current=void 0)},[x]),p(()=>{const e=w.current;if("undefined"!=typeof process&&process,v===Qo)return e?.unsubscribe(),void(w.current=void 0);const n=w.current?.subscriptionOptions;if(e&&e.arg===v)b!==n&&e.updateSubscriptionOptions(b);else{e?.unsubscribe();const n=m(g(v,{subscriptionOptions:b,forceRefetch:c,...rs(h[t])?{initialPageParam:S,refetchCachedPages:_}:{}}));w.current=n}},[m,g,c,v,b,x,S,_,t]),[w,m,g,b]}function v(e,o){return(s,{skip:c=!1,selectFromResult:d}={})=>{const{select:l}=r.endpoints[e],p=is(c?Qo:s),f=n.useRef(void 0),h=n.useMemo(()=>u([l(p),(e,t)=>t,e=>p],o,{memoizeOptions:{resultEqualityCheck:t.shallowEqual}}),[l,p]),g=n.useMemo(()=>d?u([h],d,{devModeChecks:{identityFunctionCheck:"never"}}):h,[h,d]),m=i(e=>g(e,f.current),t.shallowEqual),y=a(),v=h(y.getState(),f.current);return ds(()=>{f.current=v},[v]),m}}function b(e){n.useEffect(()=>()=>{f(e),e.current=void 0},[e])}}({api:a,moduleOptions:{batch:r,hooks:o,unstable__sideEffectsInRender:i,createSelector:s},serializeQueryArgs:c,context:u});return os(d,{usePrefetch:h}),os(u,{batch:r}),{injectEndpoint(e,t){if("query"===t.type){const{useQuery:t,useLazyQuery:n,useLazyQuerySubscription:r,useQueryState:o,useQuerySubscription:s}=l(e);os(d.endpoints[e],{useQuery:t,useLazyQuery:n,useLazyQuerySubscription:r,useQueryState:o,useQuerySubscription:s}),a[`use${ts(e)}Query`]=t,a[`useLazy${ts(e)}Query`]=n}if("mutation"===t.type){const t=f(e);os(d.endpoints[e],{useMutation:t}),a[`use${ts(e)}Mutation`]=t}else if(rs(t)){const{useInfiniteQuery:t,useInfiniteQuerySubscription:n,useInfiniteQueryState:r}=p(e);os(d.endpoints[e],{useInfiniteQuery:t,useInfiniteQuerySubscription:n,useInfiniteQueryState:r}),a[`use${ts(e)}InfiniteQuery`]=t}}}}}})());let ms=0;const ys="Something went wrong. Please try again.",vs="UNKNOWN";let bs=null;const Ss=function(e){const{name:t,innerBaseQuery:n,requestInterceptors:r,responseInterceptors:o,defaultOptions:s}=e;return async(e,i,a)=>{let c,u;if("string"==typeof e)c={url:e};else{const{_bridge:t,...n}=e;c=n,u=t}const d={...a,bridge:{...s,...a?.bridge,...u}},l={bridgeName:t,requestId:(p=t,ms+=1,`${p}-${ms}`),startTime:Date.now(),api:i,extraOptions:d};var p;const f=async e=>{let t=e;for(const e of r)t=await e(t,l);return n(t,i,d)};let h=await f(c);for(const e of o)h=await e(h,c,l,f);return h}}({name:"apiBridge",innerBaseQuery:async(t,n,r)=>function({baseUrl:t,prepareHeaders:n=e=>e,fetchFn:r=Yr,paramsSerializer:o,isJsonContentType:s=eo,jsonContentType:i="application/json",jsonReplacer:a,timeout:c,responseHandler:u,validateStatus:d,...l}={}){return"undefined"==typeof fetch&&r===Yr&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(f,h,g)=>{const{getState:m,extra:y,endpoint:v,forced:b,type:S}=h;let _,{url:w,headers:E=new Headers(l.headers),params:T,responseHandler:k=u??"json",validateStatus:x=d??Zr,timeout:A=c,...F}="string"==typeof f?{url:f}:f,I={...l,signal:A?Xr(h.signal,Jr(A)):h.signal,...F};E=new Headers(to(E)),I.headers=await n(E,{getState:m,arg:f,extra:y,endpoint:v,forced:b,type:S,extraOptions:g})||E;const P="object"==typeof(C=I.body)&&(e.isPlainObject(C)||Array.isArray(C)||"function"==typeof C.toJSON);var C;if(null==I.body||P||"string"==typeof I.body||I.headers.delete("content-type"),!I.headers.has("content-type")&&P&&I.headers.set("content-type",i),P&&s(I.headers)&&(I.body=JSON.stringify(I.body,a)),I.headers.has("accept")||("json"===k?I.headers.set("accept","application/json"):"text"===k&&I.headers.set("accept","text/plain, text/html, */*")),T){const e=~w.indexOf("?")?"&":"?";w+=e+(o?o(T):new URLSearchParams(to(T)))}w=function(e,t){if(!e)return t;if(!t)return e;if(n=t,new RegExp("(^|:)//").test(n))return t;var n;const r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=(e=>e.replace(/\/$/,""))(e),`${e}${r}${t=(e=>e.replace(/^\//,""))(t)}`}(t,w);const O=new Request(w,I);let R;_={request:new Request(w,I)};try{R=await r(O)}catch(e){return{error:{status:(e instanceof Error||"undefined"!=typeof DOMException&&e instanceof DOMException)&&"TimeoutError"===e.name?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(e)},meta:_}}const M=R.clone();let N;_.response=M;let D="";try{let e;if(await Promise.all([p(R,k).then(e=>N=e,t=>e=t),M.text().then(e=>D=e,()=>{})]),e)throw e}catch(e){return{error:{status:"PARSING_ERROR",originalStatus:R.status,data:D,error:String(e)},meta:_}}return x(R,N)?{data:N,meta:_}:{error:{status:R.status,data:N},meta:_}};async function p(e,t){if("function"==typeof t)return t(e);if("content-type"===t&&(t=s(e.headers)?"json":"text"),"json"===t){const t=await e.text();return t.length?JSON.parse(t):null}return e.text()}}({baseUrl:"",prepareHeaders:e=>(e.has("Content-Type")||e.set("Content-Type","application/json"),e.has("Accept")||e.set("Accept","application/json"),e)})(t,n,r),requestInterceptors:[(e,t)=>{if(t.extraOptions.bridge?.skipAuth)return e;const n=t.api.getState(),r=n.auth?.accessToken;return r?{...e,headers:{...e.headers,Authorization:`Bearer ${r}`}}:e},(e,t)=>{const n=ct(),r=t.extraOptions.bridge?.customHeaders,o=Object.keys(n).length>0,s=!!r&&Object.keys(r).length>0;return o||s?{...e,headers:{...e.headers,...n,...r??{}}}:e},(e,t)=>e],responseInterceptors:[async(e,t,n,r)=>{if(n.extraOptions.bridge?.skipTokenRefresh)return e;if(401!==e.error?.status)return e;const o=n.api.getState();if(!o.auth?.accessToken||!o.auth?.isAuthenticated)return e;if(!ut())return n.api.dispatch(Yt()),e;try{const e=await async function(){return bs||(bs=async function(){const e=ut();if(!e)return null;try{return await e()}catch{return null}}().finally(()=>{bs=null}),bs)}();if(e){const o=n.api.getState().auth?.accessToken;return o!==e.accessToken&&n.api.dispatch(Jt({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn})),r(t)}Ke.error({message:"Session cleared: token refresh failed after 401",api_name:"auth-refresh"}),n.api.dispatch(Yt())}catch{Ke.error({message:"Session cleared: token refresh threw after 401",api_name:"auth-refresh"}),n.api.dispatch(Yt())}return e},async(e,t,n)=>{if(!e.error)return e;const r=(o=e.error,s={url:t.url,method:t.method||"GET",timestamp:n.startTime,duration:Date.now()-n.startTime,requestId:n.requestId,bridgeName:n.bridgeName},o&&"object"==typeof o&&"status"in o?function(e,t){const n="PARSING_ERROR"===e.status,r=n?e.originalStatus:void 0,o="number"==typeof r&&r>=400?r:e.status;let s,i="Request failed",a=vs;if("data"in e)if(s=e.data,"string"==typeof e.data)i=e.data;else if(e.data&&"object"==typeof e.data){const t=e.data;i=t.message||t.error||t.detail||i}return!n&&"error"in e&&"string"==typeof e.error&&(i=e.error),401===o?a="UNAUTHORIZED":403===o?a="FORBIDDEN":404===o?a="NOT_FOUND":422===o?a="VALIDATION_ERROR":"FETCH_ERROR"===o?a="NETWORK_ERROR":"TIMEOUT_ERROR"===o?a="TIMEOUT":"PARSING_ERROR"===o?a="PARSE_ERROR":"number"==typeof o&&o>=500&&(a="SERVER_ERROR"),"number"==typeof o&&o>=500&&(i=ys),{status:o,message:i,data:s,code:a,meta:{timestamp:Date.now(),...t}}}(o,s):o instanceof Error?{status:"FETCH_ERROR",message:o.message||"An unexpected error occurred",code:vs,meta:{timestamp:Date.now(),...s}}:"string"==typeof o?{status:"CUSTOM_ERROR",message:o,code:vs,meta:{timestamp:Date.now(),...s}}:{status:"CUSTOM_ERROR",message:"An unknown error occurred",data:o,code:vs,meta:{timestamp:Date.now(),...s}});var o,s;return{...e,error:{...e.error,...r}}},async(e,t,n)=>{if(!e.error||n.extraOptions.bridge?.skipErrorToast)return e;const{status:r}=e.error;return"FETCH_ERROR"===r?(xt("Network error. Please check your connection."),e):"TIMEOUT_ERROR"===r?(xt("Request timed out. Please try again."),e):"number"==typeof r&&r>=500?(xt(ys),e):e},async(e,t,n,r)=>{if(!e.error)return e;const{status:o}=e.error;if("FETCH_ERROR"!==o&&"TIMEOUT_ERROR"!==o)return e;const s=n.extraOptions.bridge?.retry,i=s?.maxRetries??1,a=s?.backoffMs??1e3,c=parseInt(t.headers?.["X-Bridge-Retry-Count"]||"0",10);if(c>=i)return e;const u=a*Math.pow(2,c);return await new Promise(e=>setTimeout(e,u)),r({...t,headers:{...t.headers,"X-Bridge-Retry-Count":String(c+1)}})},async(e,t,n)=>{const r=Date.now()-n.startTime,o=(t.method||"GET").toUpperCase(),s=t.url||"",i=e.meta?.response,a=e.error?e.error.status:i?.status??"OK",c=i?.headers?.get?.("x-request-id")??void 0;return!!e.error&&Ke.error({message:`${n.bridgeName} ${o} ${s} failed (${a})`,api_name:n.api.endpoint,request_id:c??n.requestId,method:o,url:s,status:a,duration:r,error_data:e.error.data}),e}]});function _s(){return st()}let ws=0;const Es=gs({reducerPath:"chatApi",baseQuery:Ss,keepUnusedDataFor:0,tagTypes:["chat","toolServers"],endpoints:e=>({getConversationHistory:e.query({query:({skip:e=0,limit:t=20})=>({url:`${ft.CONVERSATIONS()}`,method:"GET",params:{skip:e,limit:t}}),transformResponse:e=>e?.data??{conversations:[]},providesTags:["chat"]}),getConversationById:e.query({query:({conversationId:e,skip:t,limit:n})=>({url:`${ft.CONVERSATIONS()}/${e}`,method:"GET",params:{...void 0!==t&&{skip:t},...void 0!==n&&{limit:n}}}),transformResponse:e=>e?.data??null,providesTags:["chat"]}),createConversatons:e.mutation({query:e=>({url:`${ft.CONVERSATIONS()}`,method:"POST",body:e.body||{}}),transformResponse:e=>e?.data??[],extraOptions:{bridge:{skipErrorToast:!0}}}),transcribeAudio:e.mutation({queryFn:async({audioFile:e})=>{const t=new FormData;t.append("file",e);const{data:n,error:r}=await async function(e){const{url:t,method:n="GET",body:r,headers:o={},skipAuth:s=!1,skipLogging:i=!1,skipContentType:a=!1,responseHandler:c="json",signal:u,keepalive:d}=e;ws+=1;const l=`fetch-${ws}`,p=Date.now(),f=n.toUpperCase(),h={...o};if(Object.assign(h,ct()),!s){const e=_s();e&&(h.Authorization=`Bearer ${e}`)}let g;a||h["Content-Type"]||(h["Content-Type"]="application/json"),h.Accept||(h.Accept="application/json"),g=null==r?void 0:"string"==typeof r||r instanceof FormData||r instanceof Blob||r instanceof ArrayBuffer?r:JSON.stringify(r);try{const e=await fetch(t,{method:n,headers:h,body:g,signal:u,keepalive:d}),r=Date.now()-p;if(!e.ok){let n;try{n=await e.json()}catch{try{n=await e.text()}catch{n=`HTTP ${e.status}`}}const o=e.headers.get("x-request-id")??void 0;return i||Ke.error({message:`bridgedFetch ${f} ${t} failed (${e.status})`,api_name:"bridgedFetch",request_id:o??l,method:f,url:t,status:e.status,duration:r,error_data:n}),{error:{status:e.status,data:n},response:e}}let o;if("blob"===c)o=await e.blob();else if("text"===c)o=await e.text();else{const t=await e.text();o=t?JSON.parse(t):void 0}return{data:o,response:e}}catch(e){const n=Date.now()-p;return i||Ke.error({message:`bridgedFetch ${f} ${t} network error`,api_name:"bridgedFetch",request_id:l,method:f,url:t,status:"FETCH_ERROR",duration:n,error_message:e instanceof Error?e.message:"Network error"}),{error:{status:"FETCH_ERROR",data:e instanceof Error?e.message:"Network error"}}}}({url:ft.TRANSCRIBE,method:"POST",body:t,skipContentType:!0});return r?{error:r}:{data:n}}}),getToolServers:e.query({query:()=>({url:ft.TOOL_SERVERS,method:"GET"}),transformResponse:e=>e?.data??{tool_servers:[]},providesTags:["toolServers"]}),startToolServerOAuth:e.mutation({query:e=>({url:ft.TOOL_SERVER_AUTH_START(e),method:"POST"}),transformResponse:e=>e?.data??{authorize_url:""}}),deleteToolServerConnection:e.mutation({query:e=>({url:ft.TOOL_SERVER_AUTH_CONNECTION(e),method:"DELETE"}),invalidatesTags:["toolServers"]}),exchangeOAuthCode:e.mutation({query:({code:e,state:t})=>({url:ft.TOOL_SERVERS_SIGN_IN_EXCHANGE,method:"POST",body:{code:e,state:t}}),invalidatesTags:["toolServers"]}),deleteConversation:e.mutation({query:({conversationId:e})=>({url:`${ft.CONVERSATIONS()}/${e}`,method:"DELETE"}),extraOptions:{bridge:{skipErrorToast:!0}}})})}),Ts={bridge:{skipErrorToast:!0,skipTokenRefresh:!0}},ks=gs({reducerPath:"brandingApi",baseQuery:Ss,keepUnusedDataFor:0,endpoints:e=>({getBranding:e.query({query:e=>({url:ft.BRANDING,method:"GET",_bridge:{skipAuth:!e}}),extraOptions:Ts})})}),{useGetBrandingQuery:xs}=ks,As={bridge:{skipErrorToast:!0,skipTokenRefresh:!0,retry:{maxRetries:0}}},Fs=gs({reducerPath:"configApi",baseQuery:Ss,keepUnusedDataFor:1/0,endpoints:e=>({getConfig:e.query({query:()=>({url:ft.CONFIG,method:"GET",_bridge:{skipAuth:!0},timeout:5e3}),extraOptions:As})})}),{useGetConfigQuery:Is}=Fs,Ps=gs({reducerPath:"profileApi",baseQuery:Ss,keepUnusedDataFor:0,tagTypes:["profile"],endpoints:e=>({getProfile:e.query({query:()=>({url:ft.PROFILE,method:"GET"}),extraOptions:{bridge:{skipErrorToast:!0}},transformResponse:e=>e?.data??null,providesTags:["profile"]}),updateProfile:e.mutation({query:e=>({url:ft.PROFILE,method:"PUT",body:e}),async onQueryStarted(e,{dispatch:t,queryFulfilled:n}){try{await n,t(Ps.util.updateQueryData("getProfile",void 0,t=>{t&&(void 0!==e.name&&(t.name=e.name),void 0!==e.phone&&(t.phone=e.phone))}))}catch{}}}),deleteAccount:e.mutation({query:()=>({url:ft.AUTH_ME,method:"DELETE"})})})}),Cs={[Es.reducerPath]:Es.reducer,[ks.reducerPath]:ks.reducer,[Fs.reducerPath]:Fs.reducer,[Ps.reducerPath]:Ps.reducer},Os=[Es.middleware,ks.middleware,Fs.middleware,Ps.middleware],Rs={isAgentWorking:!0,statusText:null,responseStartTime:null,messageQueue:[]},Ms=e.createSlice({name:"chat",initialState:Rs,reducers:{setIsAgentWorking(e,t){e.isAgentWorking=t.payload},setStatusText(e,t){e.statusText=t.payload},setResponseStartTime(e,t){e.responseStartTime=t.payload},enqueueMessage(e,t){e.messageQueue.push(t.payload)},dequeueMessage(e){e.messageQueue.shift()},clearMessageQueue(e){e.messageQueue=[]},resetChatState:()=>Rs},extraReducers:t=>{t.addMatcher(e.isAnyOf(Yt,Zt),()=>Rs)}}),Ns=Ms.reducer,Ds={activeConversationId:null,titles:{}},qs=e.createSlice({name:"conversations",initialState:Ds,reducers:{setActiveConversationId(e,t){e.activeConversationId=t.payload},upsertConversationTitle(e,t){const{id:n,title:r}=t.payload;n&&r.trim()&&(e.titles[n]=r)}},extraReducers:t=>{t.addMatcher(e.isAnyOf(Yt,Zt),()=>Ds)}}),js=qs.reducer,Qs=e.combineReducers({...Cs,auth:nn,chat:Ns,conversations:js,indicator:sn}),Bs={ignoredPaths:["chatApi.queries","chatApi.mutations","brandingApi.queries","brandingApi.mutations","configApi.queries","configApi.mutations","profileApi.queries","profileApi.mutations"],ignoredActions:["chatApi/executeQuery/fulfilled","chatApi/executeMutation/fulfilled","brandingApi/executeQuery/rejected","brandingApi/executeQuery/fulfilled","configApi/executeQuery/rejected","configApi/executeQuery/fulfilled","profileApi/executeQuery/rejected","profileApi/executeQuery/fulfilled","profileApi/executeMutation/rejected","profileApi/executeMutation/fulfilled"],ignoredActionPaths:["payload.error","error","meta.baseQueryMeta","meta.arg.originalArgs.audioFile"]},zs=e.configureStore({reducer:Qs,middleware:e=>e({serializableCheck:Bs}).prepend(tn.middleware).concat(Os)});var $s;$s=zs.dispatch,function(){const[e,t,n,r]=[uo,lo,po,fo].map(e=>()=>$s(e())),o=()=>{"visible"===window.document.visibilityState?e():t()};if(!ho&&"undefined"!=typeof window&&window.addEventListener){let t=function(e){Object.entries(s).forEach(([e,t])=>{window.addEventListener(e,t,!1)})};const s={[io]:e,[co]:o,[oo]:n,[so]:r};t(),ho=!0}}(),dt(()=>zs.getState().auth.accessToken),lt(()=>zs.getState().auth.tokenExpiresAt);const Us=n.createContext(void 0);var Ls=(e=>(e.START="start",e.TEXT="text",e.WIDGET="widget",e.STATUS_UPDATE="status_update",e.CLEAR_STATUS="clear_status",e.PAYMENT="payment",e.SIGN_IN="sign_in",e.CONVERSATION_TITLE="conversation_title",e.END="end",e))(Ls||{});let Ks=class extends Error{constructor(e){super(),this.reopen=e}};class Vs{type="mtx";config;constructor(e){this.config=e}streamMessage(e){const t=e.debugMode?this.config.getDebugUrl():this.config.getStreamUrl(e.conversationId);return this.createStreamHandle(t,{message:e.message})}streamInitial(e){const t=this.config.getInitialStreamUrl(e.conversationId);return this.createStreamHandle(t,{...e.body||{}})}normalizeEvent(e){const{parsed:t,eventType:n,isStreamEnd:r,requestId:o}=e;if(r)return{type:"stream_end",data:{isEnd:!0},timestamp:Date.now(),requestId:o};const s=(n||"").toLowerCase(),{type:i,data:a}=this.mapSSEEvent(s,t);return{type:i,data:a,timestamp:Date.now(),requestId:o}}mapSSEEvent(e,t){switch(e){case"text":return{type:"text",data:{text:t.token||""}};case"widget":return{type:"widget",data:{widget:t}};case"status_update":return{type:"status_update",data:{statusText:t.text||""}};case"clear_status":return{type:"status_update",data:{statusText:""}};case"payment":return{type:"payment",data:{payment:t}};case"sign_in":return{type:"sign_in",data:{signIn:{authorize_url:t.authorize_url,state:t.state}}};case"conversation_title":return{type:"conversation_title",data:{conversationTitle:t.text||""}};default:return t.token?{type:"text",data:{text:t.token}}:t.text?{type:"text",data:{text:t.text}}:{type:"text",data:{text:""}}}}createStreamHandle(e,t){let n=new AbortController,r=0,o="",s=!1;const i=[];let a=null,c=!1,u=null;const d=e=>{a?a.onEvent(e):i.push(e)},l=e=>{a?a.onError(e):u=e},p=()=>{c=!0,a&&a.onComplete()},f=async()=>{try{await(this.config.ensureFreshToken?.()),await un(e,{method:"POST",headers:{"Content-Type":"application/json",...this.config.getAuthToken()?{Authorization:`Bearer ${this.config.getAuthToken()}`}:{},...this.config.getCustomHeaders()},body:JSON.stringify(t),signal:n.signal,onopen:async e=>{if(401===e.status&&!s){s=!0,Ke.warn({message:"MTX SSE rejected with 401 — refreshing token",api_name:"mtx-sse"});const e=await(this.config.forceRefreshToken?.());throw e||(Ke.error({message:"MTX SSE 401 refresh failed — clearing session",api_name:"mtx-sse"}),this.config.onAuthExpired?.()),new Ks(Boolean(e))}const t=e.headers.get("x-request-id");t&&(o=t)},onmessage:e=>{if("[DONE]"===e.data)return;const t=(e.event||"").toLowerCase(),n=new Set(Object.values(Ls));if("status_update"!==t&&"clear_status"!==t||Ke.debug({message:"MTX SSE status event received",api_name:"mtx-sse",sse_event:t,allowed:n.has(t)}),!t||n.has(t))try{const n=t===Ls.END;let r;try{r=JSON.parse(e.data)}catch{return}if(!n&&t!==Ls.CLEAR_STATUS&&r&&"object"==typeof r&&0===Object.keys(r).length)return;const s=this.normalizeEvent({parsed:r,eventType:e.event,isStreamEnd:n,requestId:r.request_id||o||""});d(s),n&&"stream_end"!==s.type&&d({type:"stream_end",data:{isEnd:!0},timestamp:Date.now(),requestId:o})}catch(e){Ke.error({message:"Failed to parse MTX SSE message",api_name:"mtx-sse",error_message:e instanceof Error?e.message:String(e)})}else Ke.debug({message:"Ignoring unrecognized MTX SSE event type",api_name:"mtx-sse",sse_event:e.event})},onerror:e=>{if(e instanceof Ks)throw e;if(r++,r>=5)throw n.abort(),l(e instanceof Error?e:new Error(String(e))),e;throw e},onclose:()=>{p()},openWhenHidden:!0})}catch(e){if(e instanceof Ks)return e.reopen&&!n.signal.aborted?(n=new AbortController,f()):void(c||p());c||(n.signal.aborted||l(e instanceof Error?e:new Error(String(e))),p())}};return f(),{subscribe(e){a=e;for(const t of i)e.onEvent(t);return i.length=0,u&&(e.onError(u),u=null),c&&e.onComplete(),()=>{a=null}},abort(){n.abort()}}}}class Ws extends Error{constructor(e){super(),this.reopen=e}}class Hs{type="agui";config;constructor(e){this.config=e}streamMessage(e){const t=e.debugMode?this.config.getDebugUrl():this.config.getStreamUrl(e.conversationId);return this.createStreamHandle(t,{message:e.message})}streamInitial(e){const t=this.config.getInitialStreamUrl(e.conversationId);return this.createStreamHandle(t,{...e.body||{}})}normalizeEvent(e){const t=e,{type:n,data:r}=this.mapEventType(t);return{type:n,data:r,timestamp:Date.now(),requestId:t.runId||""}}mapEventType(e){switch((e.type||"").toUpperCase()){case"TEXT_MESSAGE_CONTENT":return{type:"text",data:{text:e.delta||""}};case"TEXT_MESSAGE_END":case"RUN_FINISHED":return{type:"stream_end",data:{isEnd:!0}};case"RUN_ERROR":return{type:"error",data:{error:e.error||"Unknown AG-UI run error"}};case"STATE_SNAPSHOT":return this.mapStateSnapshot(e);case"CUSTOM":return this.mapCustomEvent(e);case"PAYMENT":{const t=e?.value?.data??e.payload;return t?.provider&&t?.config&&function(e){if(e)return"moyasar"===e.provider?e.config?.given_id:e.payment_id}(t)&&("chargebee"!==t.provider||t.config?.hosted_page_url)?{type:"payment",data:{payment:t}}:{type:"text",data:{text:""}}}case"CONVERSATION_TITLE":{const t=e?.value?.data??e.payload,n=t?.text??t?.title;return{type:"conversation_title",data:{conversationTitle:"string"==typeof n?n:""}}}default:return{type:"text",data:{text:""}}}}mapStateSnapshot(e){return{type:"widget",data:{widget:e.state||e.payload||{}}}}mapCustomEvent(e){const t=e.payload||e?.value?.data||{},n=e.name||"custom";return Ke.debug({message:"AG-UI mapCustomEvent",api_name:"agui-sse",event_name:n}),"widget"===n?{type:"widget",data:{widget:{eventName:n,...e?.value?.data}}}:Object.keys(t).length>0?{type:"widget",data:{widget:{eventName:e.eventName,...t}}}:{type:"text",data:{text:""}}}createStreamHandle(e,t){let n=new AbortController,r=0,o="",s=!1;const i=[];let a=null,c=!1,u=null;const d=e=>{a?a.onEvent(e):i.push(e)},l=e=>{a?a.onError(e):u=e},p=()=>{c=!0,a&&a.onComplete()},f=async()=>{try{await(this.config.ensureFreshToken?.()),await un(e,{method:"POST",headers:{"Content-Type":"application/json",...this.config.getAuthToken()?{Authorization:`Bearer ${this.config.getAuthToken()}`}:{},...this.config.getCustomHeaders()},body:JSON.stringify(t),signal:n.signal,onopen:async e=>{if(401===e.status&&!s){s=!0,Ke.warn({message:"AG-UI SSE rejected with 401 — refreshing token",api_name:"agui-sse"});const e=await(this.config.forceRefreshToken?.());throw e||(Ke.error({message:"AG-UI SSE 401 refresh failed — clearing session",api_name:"agui-sse"}),this.config.onAuthExpired?.()),new Ws(Boolean(e))}const t=e.headers.get("x-request-id");t&&(o=t)},onmessage:e=>{Ke.debug({message:"AG-UI SSE event",api_name:"agui-sse",sse_event:e.event});const t=(e.event||"").toLowerCase(),n=new Set(Object.values(Ls));if(!t||n.has(t))if(t!==Ls.END){if("[DONE]"!==e.data)try{let n;try{n=JSON.parse(e.data)}catch(t){return void Ke.error({message:"AG-UI JSON parse error",api_name:"agui-sse",error_message:t instanceof Error?t.message:String(t),raw_data:e.data})}if(n&&"object"==typeof n&&0===Object.keys(n).length)return;n.runId&&(o=n.runId);const r=t===Ls.CONVERSATION_TITLE?{...n,type:"CONVERSATION_TITLE",payload:n,runId:n.runId||o}:{...n,runId:n.runId||o},s=this.normalizeEvent(r);d(s)}catch(e){Ke.error({message:"Failed to handle AG-UI message",api_name:"agui-sse",error_message:e instanceof Error?e.message:String(e)})}}else d(this.normalizeEvent({type:"RUN_FINISHED",runId:o}));else Ke.debug({message:"AG-UI ignoring unknown SSE event type",api_name:"agui-sse",sse_event:e.event})},onerror:e=>{if(e instanceof Ws)throw e;if(r++,r>=5)throw n.abort(),l(e instanceof Error?e:new Error(String(e))),e;throw e},onclose:()=>{p()},openWhenHidden:!0})}catch(e){if(e instanceof Ws)return e.reopen&&!n.signal.aborted?(n=new AbortController,f()):void(c||p());c||(n.signal.aborted||l(e instanceof Error?e:new Error(String(e))),p())}};return f(),{subscribe(e){a=e;for(const t of i)e.onEvent(t);return i.length=0,u&&(e.onError(u),u=null),c&&e.onComplete(),()=>{a=null}},abort(){n.abort()}}}}const Gs=()=>{const{user:e,accessToken:n,tokenExpiresAt:r,isAuthenticated:o,isLoading:s}=t.useSelector(e=>e.auth);return{user:e,accessToken:n,isAuthenticated:o,isLoading:s,tokenInfo:{isExpired:!!r&&At(r),isAboutToExpire:!!r&&Ft(r),expiresAt:r,timeUntilExpiry:r?It(r):0,timeUntilExpiryFormatted:r?Pt(It(r)):"0s"}}},Js=n.createContext(null),Xs={conversations:{disable_old_widgets:!1,allow_conversation_deletion:!0},voice_agent:{enabled:!1,show_customization_modal:!1,assistant_starts_conversation:!1},features:[]},Ys=n.createContext(void 0),Zs=()=>{const{data:e,isLoading:t,error:r}=(()=>{const e=Is(),{isError:t,isFetching:r,refetch:o}=e,s=n.useRef(!1);return n.useEffect(()=>{!t||r||s.current||(s.current=!0,o())},[t,r,o]),e})(),o=e?.success?e.data:null,s=n.useMemo(()=>{return(e=o)?{conversations:{...Xs.conversations,...e.conversations},voice_agent:{...Xs.voice_agent,...e.voice_agent},features:e.features??Xs.features}:Xs;var e},[o]);return n.useMemo(()=>({clientConfig:s,isLoading:t,error:r?new Error("Failed to fetch client configuration"):null}),[s,t,r])},ei=n.createContext({}),ti="moyasar_cb",ni=new Set(["paid","authorized","failed","captured"]);function ri(e){try{const t=decodeURIComponent(e);return t===e?e:t}catch{return e}}const oi=24e3,si="/sounds/thinking-sound.mp3",ii="reset",ai="voice_selectedMicId",ci="voice_selectedSpeakerId",ui=e.createSlice({name:"voice",initialState:{connectionStatus:"disconnected",pipelineStatus:"idle",listeningEnabled:!1,muted:!1,firstAssistantMessageComplete:!1,statusText:null,isAgentWorking:!1,responseStartTime:null,error:null,interimTranscript:null,selectedMicId:"",selectedSpeakerId:""},reducers:{setConnectionStatus(e,t){e.connectionStatus=t.payload},setPipelineStatus(e,t){e.pipelineStatus=t.payload},setListeningEnabled(e,t){e.listeningEnabled=t.payload},setStatusText(e,t){e.statusText=t.payload},setIsAgentWorking(e,t){e.isAgentWorking=t.payload},setResponseStartTime(e,t){e.responseStartTime=t.payload},setError(e,t){e.error=t.payload},setInterimTranscript(e,t){e.interimTranscript=t.payload},setMuted(e,t){e.muted=t.payload},setFirstAssistantMessageComplete(e,t){e.firstAssistantMessageComplete=t.payload},setSelectedMicId(e,t){e.selectedMicId=t.payload},setSelectedSpeakerId(e,t){e.selectedSpeakerId=t.payload},resetVoiceState:()=>({connectionStatus:"disconnected",pipelineStatus:"idle",listeningEnabled:!1,muted:!1,firstAssistantMessageComplete:!1,statusText:null,isAgentWorking:!1,responseStartTime:null,error:null,interimTranscript:null,selectedMicId:"",selectedSpeakerId:""}),resetIndicatorState(e){e.statusText=null,e.isAgentWorking=!1,e.responseStartTime=null}}}),{setSelectedMicId:di,setSelectedSpeakerId:li,resetVoiceState:pi}=ui.actions,fi=ui.reducer,hi=new Map,gi=new Map;class mi{ctx=null;masterGain=null;currentSpeakerId=void 0;nextPlayTime=0;doneTimer=null;isFirstChunk=!0;prerollProvider=null;activeSources=new Set;setPrerollProvider(e){this.prerollProvider=e}play(e,t){this.ctx&&t!==this.currentSpeakerId&&(this.ctx.close(),this.ctx=null,this.masterGain=null),this.ctx||(this.ctx=new AudioContext({sampleRate:oi,...t?{sinkId:t}:{}}),this.masterGain=this.ctx.createGain(),this.masterGain.connect(this.ctx.destination),this.currentSpeakerId=t);const n=this.ctx,r=new Int16Array(e),o=new Float32Array(r.length);for(let e=0;e<r.length;e++)o[e]=r[e]/32768;const s=n.createBuffer(1,o.length,oi);s.getChannelData(0).set(o);const i=n.createBufferSource();i.buffer=s,i.connect(this.masterGain),this.activeSources.add(i),i.onended=()=>this.activeSources.delete(i);const a=n.currentTime;let c=Math.max(a,this.nextPlayTime);if(this.isFirstChunk){this.isFirstChunk=!1;const e=this.prerollProvider?this.prerollProvider():.2;c=Math.max(c,a+e)}i.start(c),this.nextPlayTime=c+s.duration}get remainingSeconds(){return this.ctx?Math.max(0,this.nextPlayTime-this.ctx.currentTime):0}onDrained(e){this.doneTimer&&clearTimeout(this.doneTimer);const t=this.remainingSeconds;t<=0?e():this.doneTimer=setTimeout(()=>{this.doneTimer=null,e()},1e3*t)}resetForNewSegment(){this.isFirstChunk=!0}stop(){this.doneTimer&&(clearTimeout(this.doneTimer),this.doneTimer=null);for(const e of this.activeSources)try{e.stop()}catch(e){}this.activeSources.clear(),this.nextPlayTime=0,this.isFirstChunk=!0}destroy(){this.stop(),this.ctx&&(this.ctx.close(),this.ctx=null,this.masterGain=null)}}const yi=n.createContext(null);n.createContext(null),n.createContext({strategyActive:!1,voiceSlot:null,onEnterVoice:null,onFloatingOrbClick:null,voiceInputHidden:!1,headerCenterSlot:null,floatOrbPositionRef:null});const vi=e.createListenerMiddleware();vi.startListening({actionCreator:di,effect:async e=>{const t=Wt();t&&await t.setItem(ai,e.payload)}}),vi.startListening({actionCreator:li,effect:async e=>{const t=Wt();t&&await t.setItem(ci,e.payload)}}),vi.startListening({actionCreator:pi,effect:()=>{hi.clear(),gi.clear()}}),vi.startListening({matcher:e.isAnyOf(Yt,Zt),effect:async(e,t)=>{const n=Wt();n&&await Promise.all([n.removeItem(ai),n.removeItem(ci)]),t.dispatch(pi())}});class bi{ctx=null;stream=null;source=null;gain=null;worklet=null;worker=null;visibilityHandler=null;opening=!1;cancelled=!1;opts=null;open(e){this.opening||this.ctx||(this.cancelled=!1,this.opening=!0,this.opts=e,e.onLoadingChange?.(!0),(async()=>{let t=null,n=null,r=null,o=null,s=null,i=null;try{try{t=new AudioContext({sampleRate:oi})}catch{t=new AudioContext}if(this.cancelled)return void await t.close().catch(()=>{});if(await t.audioWorklet.addModule(`${at()}/audio-recorder.worklet.js`),this.cancelled)return void await t.close().catch(()=>{});if(n=await navigator.mediaDevices.getUserMedia({audio:{...e.micDeviceId?{deviceId:{exact:e.micDeviceId}}:{},echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,channelCount:1,sampleRate:oi,echoCancellationType:{ideal:"system"}}}),this.cancelled)return n.getTracks().forEach(e=>e.stop()),void await t.close().catch(()=>{});r=t.createMediaStreamSource(n),o=t.createGain(),o.gain.setValueAtTime(e.initialMuted?0:1,t.currentTime),s=new AudioWorkletNode(t,"audio-recorder"),i=new Worker(`${at()}/audio-processor.worker.js`);const a=i;if(s.port.onmessage=e=>{if(this.cancelled)return;const t=e.data;t&&0!==t.length&&a.postMessage({type:"frame",frame:t},[t.buffer])},i.onmessage=e=>{const t=e.data;t&&"chunk"===t.type&&t.buffer instanceof ArrayBuffer&&this.opts?.onChunk(t.buffer)},r.connect(o).connect(s).connect(t.destination),"suspended"===t.state&&await t.resume().catch(()=>{}),this.cancelled)return i.terminate(),s.disconnect(),o.disconnect(),r.disconnect(),n.getTracks().forEach(e=>e.stop()),void await t.close().catch(()=>{});this.ctx=t,this.stream=n,this.source=r,this.gain=o,this.worklet=s,this.worker=i;const c=()=>{"visible"===document.visibilityState&&"suspended"===t.state&&t.resume().catch(()=>{})};document.addEventListener("visibilitychange",c),this.visibilityHandler=c,this.opts?.onLoadingChange?.(!1)}catch(e){Ke.error({message:"Mic capture failed",api_name:"voice-mic",error_message:e instanceof Error?e.message:String(e)}),t?.close().catch(()=>{}),n?.getTracks().forEach(e=>e.stop()),i?.terminate(),s?.disconnect(),o?.disconnect(),r?.disconnect(),this.cancelled||(this.opts?.onError?.(e),this.opts?.onLoadingChange?.(!1))}finally{this.opening=!1}})())}setMuted(e){const t=this.ctx,n=this.gain;t&&n&&(n.gain.setValueAtTime(e?0:1,t.currentTime),e&&this.worker?.postMessage({type:ii}))}close(){this.cancelled=!0;const e=this.worker,t=this.worklet,n=this.gain,r=this.source,o=this.stream,s=this.ctx;e&&(e.postMessage({type:ii}),e.terminate()),t?.disconnect(),n?.disconnect(),r?.disconnect(),o?.getTracks().forEach(e=>e.stop()),this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null),s?.close().catch(()=>{}),this.ctx=null,this.stream=null,this.source=null,this.gain=null,this.worklet=null,this.worker=null,this.opts=null}}class Si{audio=null;timer=null;pendingPlay=null;pendingAction=null;unlock(){this.audio||(this.audio=new Audio(`${at()}${si}`),this.audio.loop=!0,this.audio.volume=.5,this.audio.preload="auto",this.audio.load());const e=this.audio.volume;this.audio.volume=0;const t=this.audio.play();t&&"function"==typeof t.then?t.then(()=>{this.pendingPlay?this.audio&&(this.audio.volume=e):(this.audio?.pause(),this.audio&&(this.audio.currentTime=0,this.audio.volume=e))}).catch(()=>{this.audio&&(this.audio.volume=e)}):(this.pendingPlay||(this.audio.pause(),this.audio.currentTime=0),this.audio.volume=e)}start(e){if(this.timer||this.audio&&!this.audio.paused)return;this.stop(),this.audio||(this.audio=new Audio(`${at()}${si}`),this.audio.loop=!0,this.audio.volume=.5);const t=Math.round(1e3*e)+300;this.timer=setTimeout(()=>{this.timer=null,this._doPlay()},t)}pause(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.pendingPlay?this.pendingAction="pause":this.audio&&!this.audio.paused&&this.audio.pause()}resume(e=0){if(!this.audio)return;const t=Math.round(1e3*e)+300;this.timer=setTimeout(()=>{this.timer=null,this._doPlay()},t)}stop(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.pendingPlay?this.pendingAction="stop":this.audio&&(this.audio.pause(),this.audio.currentTime=0)}destroy(){this.stop(),this.pendingAction=null,this.audio&&(this.audio.removeAttribute("src"),this.audio=null)}_doPlay(){this.pendingAction=null;const e=this.audio?.play();e instanceof Promise?(this.pendingPlay=e,e.then(()=>{this.pendingPlay=null;const e=this.pendingAction;this.pendingAction=null,"pause"===e?this.audio?.pause():"stop"===e&&this.audio&&(this.audio.pause(),this.audio.currentTime=0)}).catch(()=>{this.pendingPlay=null,this.pendingAction=null})):this.pendingPlay=null}}const _i={createCapture:()=>new bi,createPlayer:()=>new mi,createThinkingSound:()=>new Si,devices:new class{async enumerate(){const e={microphones:[],speakers:[]};if(!navigator.mediaDevices?.enumerateDevices)return e;try{const e=await navigator.mediaDevices.enumerateDevices();let t=0,n=0;return{microphones:e.filter(e=>"audioinput"===e.kind).map(e=>({deviceId:e.deviceId,label:e.label||"Microphone "+ ++t})),speakers:e.filter(e=>"audiooutput"===e.kind).map(e=>({deviceId:e.deviceId,label:e.label||"Speaker "+ ++n}))}}catch{return e}}onChange(e){const t=navigator.mediaDevices;return t?.addEventListener?(t.addEventListener("devicechange",e),()=>t.removeEventListener("devicechange",e)):()=>{}}},requestMicPermission:async function(){try{return(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(e=>e.stop()),{granted:!0}}catch(e){return{granted:!1,error:e}}},requiresSoftwareAecMute:!1},wi=e.combineReducers({...Cs,auth:nn,chat:Ns,conversations:js,voice:fi,indicator:sn}),Ei=e.configureStore({reducer:wi,middleware:e=>e({serializableCheck:Bs}).prepend(tn.middleware,vi.middleware).concat(Os)});var Ti;Ti=Ei.dispatch,function(){const[e,t,n,r]=[Oe,Re,Me,Ne].map(e=>()=>Ti(e())),o=()=>{"visible"===window.document.visibilityState?e():t()};if(!De&&"undefined"!=typeof window&&window.addEventListener){let t=function(e){Object.entries(s).forEach(([t,n])=>{e?window.addEventListener(t,n,!1):window.removeEventListener(t,n)})};const s={[Ie]:e,[Ce]:o,[Ae]:n,[Fe]:r};t(!0),De=!0}}(),dt(()=>Ei.getState().auth.accessToken),lt(()=>Ei.getState().auth.tokenExpiresAt);const ki=!1,xi=!0,Ai=!0,Fi=Tt,Ii=!0,Pi=(e,t)=>null===e?t:"true"===e,Ci=n.createContext(void 0),Oi=n.createContext({});function Ri(){return"undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches?Ot:Ct:Ot}const Mi=({children:e,orgId:t,fallbackThemeStyles:o,initialAppearanceMode:s=Rt})=>{const{user:i}=Gs(),a=i?.id,c=Kt(),[u,d]=n.useState(s),[l,p]=n.useState(()=>s===Rt?Ri():s);n.useEffect(()=>{let e=!1;const t=kt(a),n=vt;return(async()=>{const r=await c.getItem(t);if(a&&await c.removeItem(n),e)return;const o=((e,t)=>e===Ct||e===Ot||e===Rt?e:t)(r,s);d(o),p(o===Rt?Ri():o)})(),()=>{e=!0}},[a,c,s]),n.useEffect(()=>{if(u!==Rt)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),t=e=>{p(e.matches?Ot:Ct)};return p(e.matches?Ot:Ct),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[u]);const f=t||void 0,{data:h,isLoading:g,error:m}=xs(f),y=h?.success?h.data??null:null,v=y?.themes?(l===Ct?y.themes.light:y.themes.dark)??null:null,b=n.useMemo(()=>!y&&o?o:function(e,t,n=Ot){const r=function(e){return e===Ct?qt:Dt}(n);if(!e||!t)return r;const o=t.surface?.chatInput?.border||t.surface?.input?.border,s=t.surface?.userMessage?.border,i=t.surface?.widget?.border;return{bgColor:t.surface?.chat?.background||r.bgColor,inputBgColor:t.surface?.chatInput?.background||t.surface?.input?.background||r.inputBgColor,sidebarBg:t.surface?.sideMenu?.background||r.sidebarBg,sidebarBorderColor:t.surface?.sideMenu?.iconColor||t.surface?.sideMenu?.icons||r.sidebarBorderColor,widgetBg:t.surface?.widget?.background||r.widgetBg,settingsGroupBg:t.surface?.settings?.groupBackground||r.settingsGroupBg,inputBorderStyle:o?.style||r.inputBorderStyle,inputBorderColor:o?.color?jt(o.color,o.opacity||100):r.inputBorderColor,inputBorderWidth:o?.width||r.inputBorderWidth,inputBorderOpacity:o?.opacity||100,widgetBorderStyle:i?.style||r.widgetBorderStyle,widgetBorderColor:i?.color?jt(i.color,i.opacity||100):r.widgetBorderColor,widgetBorderWidth:i?.width||r.widgetBorderWidth,widgetBorderOpacity:i?.opacity??r.widgetBorderOpacity,placeholderColor:t.surface?.chatInput?.placeholderColor||t.surface?.input?.placeholderColor||r.placeholderColor,primaryText:t.text?.primary||r.primaryText,secondaryText:t.text?.secondary||r.secondaryText,tertiaryText:t.text?.tertiary||r.tertiaryText,userMsgBg:t.surface?.userMessage?.background||r.userMsgBg,userMsgText:t.surface?.userMessage?.textColor||r.userMsgText,userMsgBorderStyle:s?.style||r.userMsgBorderStyle,userMsgBorderColor:s?.color?jt(s.color,s.opacity||100):r.userMsgBorderColor,userMsgBorderWidth:s?.width||r.userMsgBorderWidth,userMsgBorderOpacity:s?.opacity||0,sideMenuHeadings:t.surface?.sideMenu?.headingsColor||t.surface?.sideMenu?.headings||r.sideMenuHeadings,sideMenuText:t.surface?.sideMenu?.textContentColor||t.surface?.sideMenu?.textContent||r.sideMenuText,sideMenuIcon:t.surface?.sideMenu?.iconColor||t.surface?.sideMenu?.icons||r.sideMenuIcon,sideMenuProfile:t.surface?.sideMenu?.profileTextColor||t.surface?.sideMenu?.textProfile||r.sideMenuProfile,statusPrimary:{solid:t.status?.primary?.solid||r.statusPrimary.solid,background:t.status?.primary?.background||r.statusPrimary.background,text:t.status?.primary?.text||r.statusPrimary.text},statusSecondary:{solid:t.status?.secondary?.solid||r.statusSecondary.solid,background:t.status?.secondary?.background||r.statusSecondary.background,text:t.status?.secondary?.text||r.statusSecondary.text},statusSuccess:{solid:t.status?.success?.solid||r.statusSuccess.solid,background:t.status?.success?.background||r.statusSuccess.background,text:t.status?.success?.text||r.statusSuccess.text},statusDanger:{solid:t.status?.danger?.solid||r.statusDanger.solid,background:t.status?.danger?.background||r.statusDanger.background,text:t.status?.danger?.text||r.statusDanger.text},statusWarning:{solid:t.status?.warning?.solid||r.statusWarning.solid,background:t.status?.warning?.background||r.statusWarning.background,text:t.status?.warning?.text||r.statusWarning.text},statusInfo:{solid:t.status?.info?.solid||r.statusInfo.solid,background:t.status?.info?.background||r.statusInfo.background,text:t.status?.info?.text||r.statusInfo.text},statusDiscovery:{solid:t.status?.discovery?.solid||r.statusDiscovery.solid,background:t.status?.discovery?.background||r.statusDiscovery.background,text:t.status?.discovery?.text||r.statusDiscovery.text},switchCheckedColor:t.status?.primary?.solid||r.switchCheckedColor,switchUncheckedColor:t.surface?.chatInput?.background||r.switchUncheckedColor,fontFamily:Qt(e.typography?.fontFamily,r),fontFamilyMono:Bt(e.typography?.fontFamilyMono,r),fontSize:14,borderRadius:zt(e.cornerRadius,r),cornerRadiusMode:$t(e.cornerRadius),chatInputPlaceholder:e.startScreen.inputPlaceholder}}(y,v,l),[y,v,l,o]),S=y?.orbPosition??"foreground",_=n.useCallback(e=>{d(e);const t=kt(a);c.setItem(t,e),a&&c.removeItem(vt),p(e===Rt?Ri():e)},[c,a]),w={theme:l,setTheme:_,appearanceMode:u,isLoading:g,error:m?new Error("Failed to fetch branding"):null,currentThemeColors:v,themeStyles:b,orbPosition:S};return r.jsx(Ut.Provider,{value:w,children:e})},Ni=({value:e,children:t})=>r.jsx(yi.Provider,{value:e??_i,children:t}),Di=({children:e,protocolType:t})=>{const o=t||"mtx",s=n.useMemo(()=>function(e,t){switch(e){case"mtx":return new Vs(t);case"agui":return new Hs(t);default:throw new Error(`Unknown protocol type: "${e}". Supported types: mtx, agui`)}}(o,function(e={}){return{getAuthToken:()=>_s(),getCustomHeaders:()=>ct(),onAuthExpired:e.onAuthExpired,getStreamUrl:e=>ft.CONVERSATION_STREAM(e),getInitialStreamUrl:e=>ft.CONVERSATION_START(e),getDebugUrl:()=>ft.DEBUG,ensureFreshToken:async()=>{Ft(it())&&await(ut()?.())},forceRefreshToken:async()=>Boolean(await(ut()?.()))}}({onAuthExpired:()=>Ei.dispatch(Yt())})),[o]),i=n.useMemo(()=>({adapter:s,protocolType:o}),[s,o]);return r.jsx(Us.Provider,{value:i,children:e})},qi=({value:e,children:o,fallback:s,extraHydrations:i})=>{!function(e){Vt=e}(e);const a=t.useDispatch(),c=void 0!==s,[u,d]=n.useState(!c);return n.useEffect(()=>{let t=!1;const n=[a(en(e))];if(i)for(const t of i)n.push(Promise.resolve(t(e,a)).catch(e=>{Ke.error({message:"StorageProvider hydration step failed",component:"StorageProvider",error_message:e instanceof Error?e.message:String(e)})}));return Promise.all(n).finally(()=>{t||c&&d(!0)}),()=>{t=!0}},[]),r.jsx(Lt.Provider,{value:e,children:c&&!u?r.jsx(r.Fragment,{children:s}):o})},ji=({token:e,user:t,children:o})=>{const s=n.useRef(null);return e&&e!==s.current&&(s.current=e,Ei.dispatch(Jt({accessToken:e,expiresIn:Math.floor(Date.now()/1e3)+3600,...t&&{user:{id:"",email:t.email||"",name:t.name}}}))),r.jsx(r.Fragment,{children:o})},Qi=({children:e})=>r.jsx(Ys.Provider,{value:Zs(),children:e}),Bi=({children:e,callbacks:t})=>r.jsx(ei.Provider,{value:t,children:e}),zi=n.lazy(()=>Promise.resolve().then(()=>require("./PaymentProviderHost-Dph4wPYb.cjs")));exports.BrandingProvider=Mi,exports.ChatClientProvider=({baseUrl:e,customHeaders:n,token:o,user:s,protocol:i="mtx",paymentProvider:a,onConversationChange:c,onConversationTitleChange:u,onMessagesChange:d,onLogoutRequested:l,onSessionExpired:p,storage:f,storageFallback:h,extraHydrations:g,orgId:m,initialThemeStyles:y,initialAppearanceMode:v,audioPlatform:b,networkMonitor:S,children:_})=>{(e=>{nt=e.baseUrl,rt=e.customHeaders||{},tt=e.paymentProvider})({baseUrl:e,customHeaders:n,paymentProvider:a}),(e=>{ot=e})(p??null);let w=r.jsx(ji,{token:o,user:s,children:r.jsx(Di,{protocolType:i,children:r.jsx(Qi,{children:r.jsx(Bi,{callbacks:{onConversationChange:c,onConversationTitleChange:u,onMessagesChange:d,onLogoutRequested:l},children:r.jsx(Mi,{orgId:m,fallbackThemeStyles:y,initialAppearanceMode:v,children:r.jsx(Ni,{value:b,children:_})})})})})});return S&&(w=r.jsx(Ht.Provider,{value:S,children:w})),r.jsx(t.Provider,{store:Ei,children:f?r.jsx(qi,{value:f,fallback:h,extraHydrations:g,children:w}):w})},exports.De=xt,exports.MessageContextProvider=({children:e,messageId:t,isDisabled:o=!1})=>{const[s,i]=n.useState({});return r.jsx(Ci.Provider,{value:{messageContext:s,setMessageContext:i,updateMessageContext:(e,t)=>{i(n=>({...n,[e]:t}))},messageId:t},children:r.jsx(Oi.Provider,{value:{messageId:t,isDisabled:o},children:e})})},exports.PaymentProviderHost=e=>r.jsx(n.Suspense,{fallback:null,children:r.jsx(zi,{...e})}),exports.SettingsProvider=({children:e,defaultSttImplementation:t=Fi})=>{const{user:o}=Gs(),s=o?.id,i=Kt(),[a,c]=n.useState(!1),[u,d]=n.useState(ki),[l,p]=n.useState(xi),[f,h]=n.useState(Ai),[g,m]=n.useState(t),[y,v]=n.useState(Ii);return n.useEffect(()=>{let e=!1;return Promise.all([i.getItem(St),i.getItem(bt),i.getItem(_t),i.getItem(wt),i.getItem(Et)]).then(([n,r,o,s,i])=>{if(e)return;var a;d(Pi(n,ki)),p(Pi(r,xi)),h(Pi(o,Ai)),m((a=s)===Tt||"device"===a?a:t);const c=Pi(i,Ii);v(c),et(c)}),()=>{e=!0}},[t,s,i]),r.jsx(Js.Provider,{value:{enableTts:a,setEnableTts:c,debugMode:u,setDebugMode:e=>{d(e),i.setItem(St,String(e))},locationEnabled:l,setLocationEnabled:e=>{p(e),i.setItem(bt,String(e))},autoSendVoice:f,setAutoSendVoice:e=>{h(e),i.setItem(_t,String(e))},sttImplementation:g,setSttImplementation:e=>{m(e),i.setItem(wt,e)},sendDiagnostics:y,setSendDiagnostics:e=>{v(e),et(e),i.setItem(Et,String(e))}},children:e})},exports.StorageProvider=qi,exports.Z=()=>tt,exports.bs=function(e,t){if(null==e||!t)return null;const n=e/100,r=t.toUpperCase();try{return new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(n)}catch{return`${r} ${n.toFixed(2)}`}},exports.dt=function(){const e=n.useContext(Ut);if(!e)throw new Error("useBranding must be used within a BrandingProvider");return e},exports.ho=function(e){if(!e)return null;const t=new URLSearchParams(e);if("1"!==t.get(ti))return null;const n=t.get("status"),r=t.get("id");if(!n||!r)return null;if(!ni.has(n))return null;const o=t.get("conversation_id")||null,s=(t.get("given_id")||null)??r;if("paid"===n||"authorized"===n||"captured"===n){const e=t.get("amount"),n=e?Number.parseInt(e,10):void 0;return{result:{status:"success",provider:"moyasar",paymentId:s,amount:Number.isFinite(n)?n:void 0,currency:t.get("currency")??void 0},conversationId:o}}return{result:{status:"failure",provider:"moyasar",code:n,message:ri(t.get("message")??`Payment ${n}`),paymentId:s},conversationId:o}},exports.mo=function(e,t){const n="dark"===t;return{pageBg:e.bgColor,cardBg:e.widgetBg,text:e.primaryText,heading:e.primaryText,muted:e.secondaryText,divider:e.widgetBorderColor,accent:e.statusDiscovery.solid,accentText:e.statusDiscovery.text,focus:e.statusDiscovery.solid,pillBg:e.inputBgColor,pillBorder:e.inputBorderColor,pillText:e.secondaryText,cardShadow:n?"0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04)":"0 1px 3px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04)",radius:e.borderRadius,fontFamily:e.fontFamily,colorScheme:n?"dark":"light"}},exports.po=function(e){const t=new URL(window.location.href),n=new URL(`${t.origin}${at()}/moyasar-callback.html`);return n.searchParams.set(ti,"1"),e&&n.searchParams.set("given_id",e),n.toString()},exports.preloadPaymentModal=()=>Promise.resolve().then(()=>require("./PaymentProviderHost-Dph4wPYb.cjs")).catch(()=>{}),exports.rootReducer=wi,exports.store=Ei,exports.useMessageContext=()=>{const e=n.useContext(Ci);if(!e)throw new Error("useMessageContext must be used within MessageContextProvider");return e},exports.useMessageDisabled=()=>{const e=n.useContext(Oi);return e?.isDisabled??!1},exports.useMessageId=()=>{const e=n.useContext(Oi);return e?.messageId},exports.useSettings=()=>{const e=n.useContext(Js);if(!e)throw new Error("useChatSettings must be used within a <SettingsProvider>");return e},exports.yo="stripe";
|
package/dist/index-AVWXcG-i.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e}from"./diag-api-BepQpXrk.js";import{E as r,a as t}from"./ExportResult-vKWGlZZX.js";class n{_delegate;constructor(e){this._delegate=e}export(e,r){this._delegate.export(e,r)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class s extends Error{code;name="OTLPExporterError";data;constructor(e,r,t){super(e),this.data=t,this.code=r}}function o(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function i(e,r,t){return{timeoutMillis:o(e.timeoutMillis??r.timeoutMillis??t.timeoutMillis),concurrencyLimit:e.concurrencyLimit??r.concurrencyLimit??t.concurrencyLimit,compression:e.compression??r.compression??t.compression}}class a{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);const r=()=>{const r=this._sendingPromises.indexOf(e);this._sendingPromises.splice(r,1)};e.then(r,r)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function u(e){return new a(e.concurrencyLimit)}class c{_diagLogger;_transport;_serializer;_responseHandler;_promiseQueue;_timeout;constructor(r,t,n,s,o){this._transport=r,this._serializer=t,this._responseHandler=n,this._promiseQueue=s,this._timeout=o,this._diagLogger=e.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit())return void t({code:r.FAILED,error:new Error("Concurrent export limit reached")});const n=this._serializer.serializeRequest(e);null!=n?this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if("success"!==e.status)t("failure"===e.status&&e.error?{code:r.FAILED,error:e.error}:"retryable"===e.status?{code:r.FAILED,error:e.error??new s("Export failed with retryable status")}:{code:r.FAILED,error:new s("Export failed with unknown error")});else{if(null!=e.data)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(r){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",r,e.data)}t({code:r.SUCCESS})}},e=>t({code:r.FAILED,error:e}))):t({code:r.FAILED,error:new Error("Nothing to send")})}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function l(e,r){return Object.keys(e).map(t=>d(t,e[t],r))}function d(e,r,t){return{key:e,value:h(r,t)}}function h(e,r){const t=typeof e;if("string"===t)return{stringValue:e};if("number"===t)return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if("boolean"===t)return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:r.encodeUint8Array(e)};if(Array.isArray(e)){const t=new Array(e.length);for(let n=0;n<e.length;n++)t[n]=h(e[n],r);return{arrayValue:{values:t}}}if("object"===t&&null!=e){const t=Object.keys(e),n=new Array(t.length);for(let s=0;s<t.length;s++)n[s]={key:t[s],value:h(e[t[s]],r)};return{kvlistValue:{values:n}}}return{}}function p(e,r){const t=function(e){const r=new Map;for(const t of e){const{resource:e,instrumentationScope:{name:n,version:s="",schemaUrl:o=""}}=t;let i=r.get(e);i||(i=new Map,r.set(e,i));const a=`${n}@${s}:${o}`;let u=i.get(a);u||(u=[],i.set(a,u)),u.push(t)}return r}(e);return Array.from(t,([e,t])=>{const n=function(e,r){const t={attributes:l(e.attributes,r),droppedAttributesCount:0},n=e.schemaUrl;return n&&""!==n&&(t.schemaUrl=n),t}(e,r);return{resource:n,scopeLogs:Array.from(t,([,e])=>{return{scope:(t=e[0].instrumentationScope,{name:t.name,version:t.version}),logRecords:e.map(e=>function(e,r){return{timeUnixNano:r.encodeHrTime(e.hrTime),observedTimeUnixNano:r.encodeHrTime(e.hrTimeObserved),severityNumber:e.severityNumber,severityText:e.severityText,body:h(e.body,r),eventName:e.eventName,attributes:m(e.attributes,r),droppedAttributesCount:e.droppedAttributesCount,flags:e.spanContext?.traceFlags,traceId:r.encodeOptionalSpanContext(e.spanContext?.traceId),spanId:r.encodeOptionalSpanContext(e.spanContext?.spanId)}}(e,r)),schemaUrl:e[0].instrumentationScope.schemaUrl};var t}),schemaUrl:n.schemaUrl}})}function m(e,r){return Object.keys(e).map(t=>d(t,e[t],r))}function f(e){return e}const g={encodeHrTime:"undefined"!=typeof BigInt?function(e){return function(e){const r=BigInt(1e9);return BigInt(Math.trunc(e[0]))*r+BigInt(Math.trunc(e[1]))}(e).toString()}:t,encodeSpanContext:f,encodeOptionalSpanContext:f,encodeUint8Array:e=>{if("undefined"!=typeof Buffer)return Buffer.from(e).toString("base64");const r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=String.fromCharCode(e[t]);return btoa(r.join(""))}},y={serializeRequest:e=>{const r={resourceLogs:p(e,g)};return(new TextEncoder).encode(JSON.stringify(r))},deserializeResponse:r=>{if(0===r.length)return{};const t=new TextDecoder;try{return JSON.parse(t.decode(r))}catch(r){return e.warn(`Failed to parse logs export response: ${r.message}. Returning empty response`),{}}}};function w(){return.4*Math.random()-.2}class b{_transport;constructor(e){this._transport=e}retry(e,r,t){return new Promise((n,s)=>{setTimeout(()=>{this._transport.send(e,r).then(n,s)},t)})}async send(r,t){let n=5,s=1e3;const o=Date.now()+t;let i=await this._transport.send(r,t);for(;"retryable"===i.status&&n>0;){n--;const t=Math.max(Math.min(s*(1+w()),5e3),0);s*=1.5;const a=i.retryInMillis??t,u=o-Date.now();if(a>u)return e.info(`Export retry time ${Math.round(a)}ms exceeds remaining timeout ${Math.round(u)}ms, not retrying further.`),i;e.verbose(`Scheduling export retry in ${Math.round(a)}ms`),i=await this.retry(r,u,a)}return"success"===i.status?e.verbose(`Export succeeded after ${5-n} retry attempts.`):e.info("retryable"===i.status?"Export failed after maximum retry attempts (5).":`Export failed with non-retryable error: ${i.error}`),i}shutdown(){return this._transport.shutdown()}}let _=0,x=0;class L{_parameters;constructor(e){this._parameters=e}async send(r,t){const n=new AbortController,s=setTimeout(()=>n.abort(),t);let o=globalThis.fetch;"function"==typeof o.__original&&(o=o.__original);const i=r.byteLength,a=_+i>61440,u=!(a||x>=9);if(u)_+=i,x++;else{const r=a?"size limit":"count limit";e.debug(`keepalive disabled: ${(i/1024).toFixed(1)}KB payload, ${x} pending (${r})`)}try{const t=new URL(this._parameters.url),s=await o(t.href,{method:"POST",headers:await this._parameters.headers(),body:r,signal:n.signal,keepalive:u,mode:globalThis.location?globalThis.location.origin===t.origin?"same-origin":"cors":"no-cors"});return s.status>=200&&s.status<=299?(e.debug(`export response success (status: ${s.status})`),{status:"success"}):429===(c=s.status)||502===c||503===c||504===c?(e.warn(`export response retryable (status: ${s.status})`),{status:"retryable",retryInMillis:function(e){if(null==e)return;const r=Number.parseInt(e,10);if(Number.isInteger(r))return r>0?1e3*r:-1;const t=new Date(e).getTime()-Date.now();return t>=0?t:0}(s.headers.get("Retry-After"))}):(e.error(`export response failure (status: ${s.status})`),{status:"failure",error:new Error(`Fetch request failed with non-retryable status ${s.status}`)})}catch(r){return function(e){return e instanceof TypeError&&!e.cause}(r)?(e.warn(`export request retryable (network error: ${r})`),{status:"retryable",error:new Error("Fetch request encountered a network error",{cause:r})}):(e.error(`export request failure (error: ${r})`),{status:"failure",error:new Error("Fetch request errored",{cause:r})})}finally{clearTimeout(s),u&&(_-=i,x--)}var c}shutdown(){}}function v(e){if(null!=e)try{const r=globalThis.location?.href;return new URL(e,r).href}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function E(e){return"function"==typeof e.headers?e.headers:function(e){if(null!=e)return async()=>e}(e.headers)}class S extends n{constructor(r={}){super(function(r,t){return function(r,t){return function(r,t,n){return s={transport:n,serializer:t,promiseHandler:u(r)},o={timeout:r.timeoutMillis},new c(s.transport,s.serializer,{handleResponse(r){null!=r&&function(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}(r)&&null!=r.partialSuccess&&0!==Object.keys(r.partialSuccess).length&&e.warn("Received Partial Success response:",JSON.stringify(r.partialSuccess))}},s.promiseHandler,o.timeout);var s,o}(r,t,function(e){return new b(e.transport)}({transport:(n=r,new L(n))}));var n}(function(r){return o={url:r.url,timeoutMillis:r.timeoutMillis,headers:E(r),concurrencyLimit:r.concurrencyLimit},a={},u=function(e,r){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none",headers:async()=>e,url:"http://localhost:4318/"+r}}({"Content-Type":"application/json"},"v1/logs"),{...i(o,a,u),headers:(t=o.headers,n=a.headers,s=u.headers,async()=>{const r={...await s()},o={};return null!=n&&Object.assign(o,await n()),null!=t&&Object.assign(o,function(r){const t={};return Object.entries(r??{}).forEach(([r,n])=>{void 0!==n?t[r]=String(n):e.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),t}(await t())),Object.assign(o,r)}),url:v(o.url)??a.url??u.url};var t,n,s,o,a,u}(r),t)}(r,y))}}export{S as OTLPLogExporter};
|
package/dist/index-BQf9Yax1.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e}from"./diag-api-BepQpXrk.js";import{r as t,e as r}from"./ResourceImpl-DPkc_ob9.js";import{d as o,c as s,f as a}from"./ResourceImpl-DPkc_ob9.js";const n=(o={})=>(o.detectors||[]).map(s=>{try{const r=t(s.detect(o));return e.debug(`${s.constructor.name} found resource.`,r),r}catch(t){return e.debug(`${s.constructor.name} failed: ${t.message}`),r()}}).reduce((e,t)=>e.merge(t),r()),c=new class{_MAX_LENGTH=255;_COMMA_SEPARATOR=",";_LABEL_KEY_VALUE_SPLITTER="=";detect(e){return{attributes:{}}}_parseResourceAttributes(e){if(!e)return{};const t={},r=e.split(this._COMMA_SEPARATOR).filter(e=>""!==e.trim());for(const e of r){const r=e.split(this._LABEL_KEY_VALUE_SPLITTER);if(2!==r.length)throw new Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${e}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);const[o,s]=r,a=o.trim(),n=s.trim();if(0===a.length)throw new Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${e}".`);let c,i;try{c=decodeURIComponent(a),i=decodeURIComponent(n)}catch(t){throw new Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${e}": ${t instanceof Error?t.message:t}`)}if(c.length>this._MAX_LENGTH)throw new Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${c}".`);if(i.length>this._MAX_LENGTH)throw new Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${c}".`);t[c]=i}return t}},i=new class{detect(){return{attributes:{}}}},E=i,u=i,m=i,d=i;export{o as defaultResource,s as defaultServiceName,n as detectResources,r as emptyResource,c as envDetector,E as hostDetector,u as osDetector,m as processDetector,a as resourceFromAttributes,d as serviceInstanceIdDetector};
|
package/dist/index-Bs9yNhX-.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{N as e,a as t}from"./NoopLogger-aeNt0r6v.js";import{S as r}from"./NoopLogger-aeNt0r6v.js";const g=Symbol.for("io.opentelemetry.js.api.logs"),o=globalThis,i=new class{getLogger(t,r,g){return new e}};class s{constructor(e,t,r,g){this._provider=e,this.name=t,this.version=r,this.options=g}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;const e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):t}}class n{getLogger(e,t,r){var g;return null!==(g=this._getDelegateLogger(e,t,r))&&void 0!==g?g:new s(this,e,t,r)}_getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:i}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,r){var g;return null===(g=this._delegate)||void 0===g?void 0:g.getLogger(e,t,r)}}class a{constructor(){this._proxyLoggerProvider=new n}static getInstance(){return this._instance||(this._instance=new a),this._instance}setGlobalLoggerProvider(e){return o[g]?this.getLoggerProvider():(o[g]=(t=e,r=i,e=>1===e?t:r),this._proxyLoggerProvider._setDelegate(e),e);var t,r}getLoggerProvider(){var e,t;return null!==(t=null===(e=o[g])||void 0===e?void 0:e.call(o,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete o[g],this._proxyLoggerProvider=new n}}const l=a.getInstance();export{t as NOOP_LOGGER,e as NoopLogger,r as SeverityNumber,l as logs};
|
package/dist/index-CS2Ktaql.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./NoopLogger-B-ce52_l.cjs"),t=Symbol.for("io.opentelemetry.js.api.logs"),r=globalThis,o=new class{getLogger(t,r,o){return new e.NoopLogger}};class g{constructor(e,t,r,o){this._provider=e,this.name=t,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;const t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):e.NOOP_LOGGER}}class i{getLogger(e,t,r){var o;return null!==(o=this._getDelegateLogger(e,t,r))&&void 0!==o?o:new g(this,e,t,r)}_getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:o}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,r){var o;return null===(o=this._delegate)||void 0===o?void 0:o.getLogger(e,t,r)}}class s{constructor(){this._proxyLoggerProvider=new i}static getInstance(){return this._instance||(this._instance=new s),this._instance}setGlobalLoggerProvider(e){return r[t]?this.getLoggerProvider():(r[t]=(g=e,i=o,e=>1===e?g:i),this._proxyLoggerProvider._setDelegate(e),e);var g,i}getLoggerProvider(){var e,o;return null!==(o=null===(e=r[t])||void 0===e?void 0:e.call(r,1))&&void 0!==o?o:this._proxyLoggerProvider}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete r[t],this._proxyLoggerProvider=new i}}const n=s.getInstance();exports.NOOP_LOGGER=e.NOOP_LOGGER,exports.NoopLogger=e.NoopLogger,Object.defineProperty(exports,"SeverityNumber",{enumerable:!0,get:()=>e.SeverityNumber}),exports.logs=n;
|